Changeset 9199 in josm
- Timestamp:
- 2015-12-28T15:21:30+01:00 (9 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/TestUtils.java
r8793 r9199 109 109 110 110 /** 111 * Returns the Java version as a doublevalue.112 * @return the Java version as a double value (1.7, 1.8, 1.9, etc.)111 * Returns the Java version as an int value. 112 * @return the Java version as an int value (7, 8, 9, etc.) 113 113 */ 114 public static doublegetJavaVersion() {114 public static int getJavaVersion() { 115 115 String version = System.getProperty("java.version"); 116 int pos = version.indexOf('.'); 117 pos = version.indexOf('.', pos + 1); 118 return Double.parseDouble(version.substring(0, pos)); 116 if (version.startsWith("1.")) { 117 version = version.substring(2); 118 } 119 return Integer.parseInt(version.substring(0, version.indexOf('.'))); 119 120 } 120 121 } -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
r9133 r9199 54 54 55 55 private static String getProjectionDataFile() { 56 return TestUtils.getJavaVersion() >= 1.9 ? PROJECTION_DATA_FILE_JAVA_9 : PROJECTION_DATA_FILE;56 return TestUtils.getJavaVersion() >= 9 ? PROJECTION_DATA_FILE_JAVA_9 : PROJECTION_DATA_FILE; 57 57 } 58 58
Note:
See TracChangeset
for help on using the changeset viewer.