db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r542697 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest2.java
Date Tue, 29 May 2007 23:31:28 GMT
Author: mikem
Date: Tue May 29 16:31:27 2007
New Revision: 542697

URL: http://svn.apache.org/viewvc?view=rev&rev=542697
Log:
DERBY-2716

fixed bad parsing of java version argument.  In the process also discovered 
that J2ME environment also reproduces DERBY-2703, so changed the test case
to also not run in this enviroment.   I just brute forced the java version
check, hopefully 2703 will get fixed before needing to add more jvm's to 
ignore.


Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest2.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest2.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest2.java?view=diff&rev=542697&r1=542696&r2=542697
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest2.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest2.java
Tue May 29 16:31:27 2007
@@ -740,22 +740,21 @@
 
 	private boolean is142JVM() 
 	{
+        // bug shows up in ibm142, sun142, 
+        // and j9 (J2ME Foundation Specification v1.1)
 	    String java_version = System.getProperty("java.version");
 
-        // get string indexes for major/minor numbers
-        int jvm_major_idx = java_version.indexOf('.');
-        int jvm_minor_idx = java_version.indexOf('.', jvm_major_idx + 1);
+        // only match java versions with leading 1.4.2
+        String leading_version_no = java_version.substring(0, 5);
 
-        
-        int jvm_major = 
-            Integer.parseInt(
-                java_version.substring(0, jvm_major_idx));
-        int jvm_minor = 
-            Integer.parseInt(
-                java_version.substring(jvm_major_idx + 1, jvm_minor_idx));
+        /*
+        System.out.println("java_version = " + java_version);
+        System.out.println("leading_version_no = " + leading_version_no);
+        */
 
 
-        return(jvm_major == 1 && jvm_minor == 4);
+        return(leading_version_no.equals("1.4.2") || 
+               java_version.equals("J2ME Foundation Specification v1.1"));
 	}
 
 



Mime
View raw message