From: <no...@so...> - 2002-03-30 15:29:03
|
Bugs item #537111, was opened at 2002-03-30 09:29 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=102228&aid=537111&group_id=2228 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Allen Bell (apbell) Assigned to: Nobody/Anonymous (nobody) Summary: MVConstantString MATCH problem Initial Comment: Consider: NUMB = '' IF NUMB MATCH '1N0N' THEN CRT 'IT MATCHES' END This causes a StringIndexOutOfBounds Exception in mvBasicString.charAt (index = 0) It might be nice to fix this in the charAt method of mvBasicString because there may be siomilar ways this can happen, but that routine returns a char, and other than catching the exception from all the other places it might occur, I could think of no good way to handle it there. In the interim, I modified mvConstantString method MATCH by insert a length() test at the start of the method to trap it. If I get time I will try and test other odd things to see if it can happen there. <<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>> public mvConstantString MATCH(mvConstantString pattern) { if (length() <= 0) { return STRING_ZERO; } ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=102228&aid=537111&group_id=2228 |
From: <no...@so...> - 2002-03-31 06:23:51
|
Bugs item #537111, was opened at 2002-03-30 15:29 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=102228&aid=537111&group_id=2228 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Allen Bell (apbell) >Assigned to: Robert Colquhoun (rjc) Summary: MVConstantString MATCH problem Initial Comment: Consider: NUMB = '' IF NUMB MATCH '1N0N' THEN CRT 'IT MATCHES' END This causes a StringIndexOutOfBounds Exception in mvBasicString.charAt (index = 0) It might be nice to fix this in the charAt method of mvBasicString because there may be siomilar ways this can happen, but that routine returns a char, and other than catching the exception from all the other places it might occur, I could think of no good way to handle it there. In the interim, I modified mvConstantString method MATCH by insert a length() test at the start of the method to trap it. If I get time I will try and test other odd things to see if it can happen there. <<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>> public mvConstantString MATCH(mvConstantString pattern) { if (length() <= 0) { return STRING_ZERO; } ---------------------------------------------------------------------- >Comment By: Robert Colquhoun (rjc) Date: 2002-03-31 06:23 Message: Logged In: YES user_id=11445 I don't think the solution is quite as simple as automatically returning zero if the string to be tested is of zero length. For instance, on Unidata at least "" MATCH "0A" "" MATCH "0X" "" MATCH "0B" all return one. There are also problems with returning an invalid character with charAt(), if the string index is invalid you will now need to check for the invalid character at every position you call charAt() which in the end is the same amount of work as checking the string boundaries before calling charAt(). Also charAt() is a very frequently called routine bounds checking on each call, especially when you know it is within range, could have performance implications. There is a MATCH test routine in the test suite(MATCH.java in test/org/maverickdbms/test/basic), maybe this could be converted to basic and run on other platforms to ensure compatibility. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=102228&aid=537111&group_id=2228 |
From: SourceForge.net <no...@so...> - 2004-04-29 01:16:53
|
Bugs item #537111, was opened at 2002-03-30 15:29 Message generated for change (Comment added) made by rjc You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102228&aid=537111&group_id=2228 Category: None Group: None Status: Open >Resolution: Fixed Priority: 5 Submitted By: Allen Bell (apbell) Assigned to: Robert Colquhoun (rjc) Summary: MVConstantString MATCH problem Initial Comment: Consider: NUMB = '' IF NUMB MATCH '1N0N' THEN CRT 'IT MATCHES' END This causes a StringIndexOutOfBounds Exception in mvBasicString.charAt (index = 0) It might be nice to fix this in the charAt method of mvBasicString because there may be siomilar ways this can happen, but that routine returns a char, and other than catching the exception from all the other places it might occur, I could think of no good way to handle it there. In the interim, I modified mvConstantString method MATCH by insert a length() test at the start of the method to trap it. If I get time I will try and test other odd things to see if it can happen there. <<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>> public mvConstantString MATCH(mvConstantString pattern) { if (length() <= 0) { return STRING_ZERO; } ---------------------------------------------------------------------- >Comment By: Robert Colquhoun (rjc) Date: 2004-04-29 01:16 Message: Logged In: YES user_id=11445 The rewriting of the MATCH function a month or so ago appears to have fixed this bug. Now ('' MATCH '1N0N') = 0 ie no match ---------------------------------------------------------------------- Comment By: Robert Colquhoun (rjc) Date: 2002-03-31 06:23 Message: Logged In: YES user_id=11445 I don't think the solution is quite as simple as automatically returning zero if the string to be tested is of zero length. For instance, on Unidata at least "" MATCH "0A" "" MATCH "0X" "" MATCH "0B" all return one. There are also problems with returning an invalid character with charAt(), if the string index is invalid you will now need to check for the invalid character at every position you call charAt() which in the end is the same amount of work as checking the string boundaries before calling charAt(). Also charAt() is a very frequently called routine bounds checking on each call, especially when you know it is within range, could have performance implications. There is a MATCH test routine in the test suite(MATCH.java in test/org/maverickdbms/test/basic), maybe this could be converted to basic and run on other platforms to ensure compatibility. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102228&aid=537111&group_id=2228 |
From: SourceForge.net <no...@so...> - 2004-12-29 02:29:12
|
Bugs item #537111, was opened at 2002-03-30 15:29 Message generated for change (Settings changed) made by rjc You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102228&aid=537111&group_id=2228 Category: None Group: None >Status: Closed Resolution: Fixed Priority: 5 Submitted By: Allen Bell (apbell) Assigned to: Robert Colquhoun (rjc) Summary: MVConstantString MATCH problem Initial Comment: Consider: NUMB = '' IF NUMB MATCH '1N0N' THEN CRT 'IT MATCHES' END This causes a StringIndexOutOfBounds Exception in mvBasicString.charAt (index = 0) It might be nice to fix this in the charAt method of mvBasicString because there may be siomilar ways this can happen, but that routine returns a char, and other than catching the exception from all the other places it might occur, I could think of no good way to handle it there. In the interim, I modified mvConstantString method MATCH by insert a length() test at the start of the method to trap it. If I get time I will try and test other odd things to see if it can happen there. <<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>> public mvConstantString MATCH(mvConstantString pattern) { if (length() <= 0) { return STRING_ZERO; } ---------------------------------------------------------------------- Comment By: Robert Colquhoun (rjc) Date: 2004-04-29 01:16 Message: Logged In: YES user_id=11445 The rewriting of the MATCH function a month or so ago appears to have fixed this bug. Now ('' MATCH '1N0N') = 0 ie no match ---------------------------------------------------------------------- Comment By: Robert Colquhoun (rjc) Date: 2002-03-31 06:23 Message: Logged In: YES user_id=11445 I don't think the solution is quite as simple as automatically returning zero if the string to be tested is of zero length. For instance, on Unidata at least "" MATCH "0A" "" MATCH "0X" "" MATCH "0B" all return one. There are also problems with returning an invalid character with charAt(), if the string index is invalid you will now need to check for the invalid character at every position you call charAt() which in the end is the same amount of work as checking the string boundaries before calling charAt(). Also charAt() is a very frequently called routine bounds checking on each call, especially when you know it is within range, could have performance implications. There is a MATCH test routine in the test suite(MATCH.java in test/org/maverickdbms/test/basic), maybe this could be converted to basic and run on other platforms to ensure compatibility. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102228&aid=537111&group_id=2228 |