Skip to content

Commit 3134074

Browse files
authored
Merge pull request #7635 from mbien/parse-java-version-fix_delivery
truffle.RemoteServices should parse the java version correctly
2 parents be2a72c + 5f63648 commit 3134074

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

java/debugger.jpda.truffle/nbproject/project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# under the License.
1717

1818
javac.compilerargs=-Xlint:unchecked
19-
javac.source=1.8
19+
javac.release=11
2020
javadoc.arch=${basedir}/arch.xml
2121
nbm.module.author=Martin Entlicher
2222
requires.nb.javac=true

java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/RemoteServices.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,7 @@ private static ObjectReference getContextClassLoader(ThreadReference tawt, Virtu
180180

181181
private static int getTargetMajorVersion(VirtualMachine vm) throws InternalExceptionWrapper, VMDisconnectedExceptionWrapper {
182182
String version = VirtualMachineWrapper.version(vm);
183-
int dot = version.indexOf(".");
184-
if (dot < 0) {
185-
dot = version.length();
186-
}
187-
return Integer.parseInt(version.substring(0, dot));
183+
return Runtime.Version.parse(version).feature();
188184
}
189185

190186
public static ClassObjectReference uploadBasicClasses(JPDAThreadImpl t, String basicClassName) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException, IOException, PropertyVetoException, InternalExceptionWrapper, VMDisconnectedExceptionWrapper, ObjectCollectedExceptionWrapper, UnsupportedOperationExceptionWrapper, ClassNotPreparedExceptionWrapper {

0 commit comments

Comments
 (0)