diff --git a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/xform/LoggingTests.java b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/xform/LoggingTests.java index 19c78de306..9773bef9e1 100644 --- a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/xform/LoggingTests.java +++ b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/xform/LoggingTests.java @@ -121,7 +121,7 @@ public void testLog4j2() { }; //@formatter:on - addRuntimeLibrary("org.apache.logging.log4j:log4j-api:2.17.0", "org.apache.logging.log4j:log4j-core:2.17.0"); + addRuntimeLibrary("org.apache.logging.log4j:log4j-api:2.17.1", "org.apache.logging.log4j:log4j-core:2.17.1"); vmArguments = new String[] {"-Dorg.apache.logging.log4j.level=INFO", "-Dlog4j2.clock=T"}; runConformTest(sources, "[main] INFO C - yay!"); } diff --git a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/xform/SealedTests.java b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/xform/SealedTests.java index c8f8639fdc..e79346bb6d 100644 --- a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/xform/SealedTests.java +++ b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/xform/SealedTests.java @@ -185,6 +185,6 @@ public void testSealed3() { private static boolean javaModelSealedSupport() { return org.eclipse.jdt.core.JavaCore.getPlugin().getBundle().getVersion() - .compareTo(org.osgi.framework.Version.parseVersion("3.24")) >= 0; + .compareTo(org.osgi.framework.Version.parseVersion("3.28")) >= 0; } } diff --git a/base/org.eclipse.jdt.groovy.core/src/org/eclipse/jdt/groovy/search/SimpleTypeLookup.java b/base/org.eclipse.jdt.groovy.core/src/org/eclipse/jdt/groovy/search/SimpleTypeLookup.java index e3529a53fc..31472e37bd 100644 --- a/base/org.eclipse.jdt.groovy.core/src/org/eclipse/jdt/groovy/search/SimpleTypeLookup.java +++ b/base/org.eclipse.jdt.groovy.core/src/org/eclipse/jdt/groovy/search/SimpleTypeLookup.java @@ -481,6 +481,10 @@ protected TypeLookupResult findTypeForVariable(final VariableExpression var, fin (isDirectAccess && resolveStrategy != Closure.OWNER_FIRST && resolveStrategy != Closure.OWNER_ONLY)) { // accessed variable was found using direct search; forget the reference accessedVar = new DynamicVariable(var.getName(), scope.isStatic()); + } else if (accessedVar instanceof Parameter && ((Parameter) accessedVar).getEnd() < 1 && var.getEnd() > 0 && // explicit reference to implicit parameter + variableInfo != null && variableInfo.scopeNode instanceof ConstructorNode) { + // could be field reference from pre- or post-condition block (incl. record compact constructor) + accessedVar = ((MethodNode) variableInfo.scopeNode).getDeclaringClass().getField(var.getName()); } if (accessedVar instanceof ASTNode) {