Skip to content

Commit e76e46e

Browse files
Ensure URB's are resolved before performing visibility checks. (#4647)
* Ensure URB's are resolved before performing visibility checks. * Fixes #4632 * Remove unused problem filters * Version bump(s) for 4.39 stream --------- Co-authored-by: Eclipse JDT Bot <[email protected]>
1 parent 26830a9 commit e76e46e

File tree

10 files changed

+77
-23
lines changed

10 files changed

+77
-23
lines changed

org.eclipse.jdt.core.compiler.batch/.settings/.api_filters

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,4 @@
88
</message_arguments>
99
</filter>
1010
</resource>
11-
<resource path="src/org/eclipse/jdt/core/compiler/IProblem.java" type="org.eclipse.jdt.core.compiler.IProblem">
12-
<filter id="405864542">
13-
<message_arguments>
14-
<message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
15-
<message_argument value="ModifierOnRequiresJavaBasePreview"/>
16-
</message_arguments>
17-
</filter>
18-
</resource>
1911
</component>

org.eclipse.jdt.core.compiler.batch/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Main-Class: org.eclipse.jdt.internal.compiler.batch.Main
33
Bundle-ManifestVersion: 2
44
Bundle-Name: Eclipse Compiler for Java(TM)
55
Bundle-SymbolicName: org.eclipse.jdt.core.compiler.batch
6-
Bundle-Version: 3.44.0.qualifier
6+
Bundle-Version: 3.44.100.qualifier
77
Bundle-ClassPath: .
88
Bundle-Vendor: Eclipse.org
99
Automatic-Module-Name: org.eclipse.jdt.core.compiler.batch

org.eclipse.jdt.core.compiler.batch/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<version>4.39.0-SNAPSHOT</version>
1818
</parent>
1919
<artifactId>org.eclipse.jdt.core.compiler.batch</artifactId>
20-
<version>3.44.0-SNAPSHOT</version>
20+
<version>3.44.100-SNAPSHOT</version>
2121
<packaging>eclipse-plugin</packaging>
2222

2323
<properties>

org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ public VisibilityInspector(FunctionalExpression expression, Scope scope, boolean
239239
}
240240

241241
private void checkVisibility(ReferenceBinding referenceBinding) {
242+
if (referenceBinding.isUnresolvedType())
243+
referenceBinding = (ReferenceBinding) BinaryTypeBinding.resolveType(referenceBinding, this.scope.environment(), false);
242244
if (!referenceBinding.canBeSeenBy(this.scope)) {
243245
this.visible = false;
244246
if (this.shouldChatter)

org.eclipse.jdt.core.tests.builder/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.jdt.core.tests.builder; singleton:=true
5-
Bundle-Version: 3.12.1000.qualifier
5+
Bundle-Version: 3.12.1100.qualifier
66
Bundle-Vendor: %providerName
77
Bundle-Localization: plugin
88
Export-Package: org.eclipse.jdt.core.tests.builder

org.eclipse.jdt.core.tests.builder/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<relativePath>../tests-pom/</relativePath>
1919
</parent>
2020
<artifactId>org.eclipse.jdt.core.tests.builder</artifactId>
21-
<version>3.12.1000-SNAPSHOT</version>
21+
<version>3.12.1100-SNAPSHOT</version>
2222
<packaging>eclipse-test-plugin</packaging>
2323

2424
<properties>

org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,4 +1835,73 @@ public static void main(String [] args) {
18351835
env.removeProject(projectPath);
18361836
}
18371837

1838+
1839+
// https://github.com/eclipse-jdt/eclipse.jdt.core/issues/4632
1840+
// The type ... from the descriptor computed for the target context is not visible here
1841+
public void testIssue4632() throws JavaModelException {
1842+
IPath projectPath = env.addProject("Project", "19");
1843+
env.addExternalJars(projectPath, Util.getJavaClassLibs());
1844+
1845+
// remove old package fragment root so that names don't collide
1846+
env.removePackageFragmentRoot(projectPath, "");
1847+
1848+
IPath root = env.addPackageFragmentRoot(projectPath, "src");
1849+
env.setOutputFolder(projectPath, "bin");
1850+
1851+
env.addClass(root, "other", "AuthorizeHttpRequestsConfigurer",
1852+
"""
1853+
package other;
1854+
1855+
public class AuthorizeHttpRequestsConfigurer<T> {
1856+
public class AuthorizationManagerRequestMatcherRegistry {}
1857+
}
1858+
""");
1859+
env.addClass(root, "other", "Customizer",
1860+
"""
1861+
package other;
1862+
1863+
public interface Customizer<T> {
1864+
void customize(T t);
1865+
}
1866+
""");
1867+
env.addClass(root, "other", "HttpSecurity",
1868+
"""
1869+
package other;
1870+
1871+
public class HttpSecurity {
1872+
}
1873+
""");
1874+
env.addClass(root, "test", "FrontEndSecurityCustomizer",
1875+
"""
1876+
package test;
1877+
1878+
import other.AuthorizeHttpRequestsConfigurer;
1879+
import other.Customizer;
1880+
import other.HttpSecurity;
1881+
1882+
public interface FrontEndSecurityCustomizer extends Customizer<AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry> {
1883+
1884+
}
1885+
""");
1886+
fullBuild(projectPath);
1887+
expectingNoProblems();
1888+
1889+
env.addClass(root, "test", "ProfileSecurityConfiguration",
1890+
"""
1891+
package test;
1892+
1893+
public class ProfileSecurityConfiguration {
1894+
1895+
FrontEndSecurityCustomizer profileFrontEndSecurityCustomizer() {
1896+
return auth -> System.out.println(auth);
1897+
}
1898+
}
1899+
""");
1900+
1901+
incrementalBuild(projectPath);
1902+
expectingNoProblems();
1903+
1904+
env.removeProject(projectPath);
1905+
}
1906+
18381907
}

org.eclipse.jdt.core/.settings/.api_filters

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<component id="org.eclipse.jdt.core" version="2">
3-
<resource path="dom/org/eclipse/jdt/core/dom/AST.java" type="org.eclipse.jdt.core.dom.AST">
4-
<filter id="388194388">
5-
<message_arguments>
6-
<message_argument value="org.eclipse.jdt.core.dom.AST"/>
7-
<message_argument value="JLS_Latest"/>
8-
<message_argument value="24"/>
9-
</message_arguments>
10-
</filter>
11-
</resource>
123
<resource path="dom/org/eclipse/jdt/core/dom/AbstractTagElement.java" type="org.eclipse.jdt.core.dom.AbstractTagElement">
134
<filter id="576725006">
145
<message_arguments>

org.eclipse.jdt.core/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.jdt.core; singleton:=true
5-
Bundle-Version: 3.44.0.qualifier
5+
Bundle-Version: 3.44.100.qualifier
66
Bundle-Activator: org.eclipse.jdt.core.JavaCore
77
Bundle-Vendor: %providerName
88
Bundle-Localization: plugin

org.eclipse.jdt.core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<version>4.39.0-SNAPSHOT</version>
1818
</parent>
1919
<artifactId>org.eclipse.jdt.core</artifactId>
20-
<version>3.44.0-SNAPSHOT</version>
20+
<version>3.44.100-SNAPSHOT</version>
2121
<packaging>eclipse-plugin</packaging>
2222

2323
<properties>

0 commit comments

Comments
 (0)