diff --git a/byte-buddy-dep/src/test/java/net/bytebuddy/ClassFileVersionOtherTest.java b/byte-buddy-dep/src/test/java/net/bytebuddy/ClassFileVersionOtherTest.java index 47ff3e66a8..6352930af2 100644 --- a/byte-buddy-dep/src/test/java/net/bytebuddy/ClassFileVersionOtherTest.java +++ b/byte-buddy-dep/src/test/java/net/bytebuddy/ClassFileVersionOtherTest.java @@ -19,7 +19,9 @@ public void testExplicitConstructionOfUnknownVersion() throws Exception { Pattern pattern = Pattern.compile("V[0-9]+(_[0-9]+)?"); for (Field field : Opcodes.class.getFields()) { if (pattern.matcher(field.getName()).matches()) { - if (version < Double.parseDouble(field.getName().substring(1).replace('_', '.'))) { + double candidate = Double.parseDouble(field.getName().substring(1).replace('_', '.')); + if (version < candidate) { + version = candidate; value = field.getInt(null); } }