Skip to content

Ensure URB's are resolved before performing visibility checks.#4647

Merged
srikanth-sankaran merged 3 commits intoeclipse-jdt:masterfrom
srikanth-sankaran:descriptor-type-invisible
Dec 1, 2025
Merged

Ensure URB's are resolved before performing visibility checks.#4647
srikanth-sankaran merged 3 commits intoeclipse-jdt:masterfrom
srikanth-sankaran:descriptor-type-invisible

Conversation

@srikanth-sankaran
Copy link
Contributor

@srikanth-sankaran srikanth-sankaran self-assigned this Nov 21, 2025
@srikanth-sankaran
Copy link
Contributor Author

srikanth-sankaran commented Nov 21, 2025

This problem goes back to the original implementation of lambda expressions. While checking whether the computed SAM descriptor is "kosher", we must ensure all types mentioned in the SAM (return types, enclosing types, arguments, thrown exceptions etc.,) are visible at the lambda invocation site. While doing these checks we may end up with an UnresolvedReferenceBinding in one of the involved types. If that happens, we must resolve the UnresolvedReferenceBinding (a place holder proxy for on demand resolution into a sharp type) to compute the real type. Which is what the proposed fix does.

@stephan-herrmann - since you are fascinated by bugs that have managed to hide for a long time, you may want to study this one 😆

@iloveeclipse @jarthana - Let me know if you want this for 4.38 - On the one hand, this bug has been there from day 1 and so perhaps could wait for 4.39. On the other hand, the fix is simple so we could consider this fix for 4.38 RC1/RC2 - I guess it is too late for RC1.

(PR still under test - I don't expect any failures - famous last words 😆)

@srikanth-sankaran
Copy link
Contributor Author

@jarthana - Let me know if you want this for 4.38

Jay and I discussed this offline and decided we will release this as soon as the tree opens for 4.39. I looked through bugzilla and github issues tracker for similar defect reports and didn't find any. This seems one off case and given it is not a regression, it is prudent to wait for 4.38 to ship.

@srikanth-sankaran srikanth-sankaran added this to the MilestoneNxt milestone Nov 21, 2025
@iloveeclipse
Copy link
Member

This seems one off case and given it is not a regression, it is prudent to wait for 4.38 to ship.

I fully agree with that

@eclipse-jdt-bot
Copy link
Contributor

eclipse-jdt-bot commented Dec 1, 2025

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

org.eclipse.jdt.core.compiler.batch/META-INF/MANIFEST.MF
org.eclipse.jdt.core.compiler.batch/pom.xml
org.eclipse.jdt.core.tests.builder/META-INF/MANIFEST.MF
org.eclipse.jdt.core.tests.builder/pom.xml
org.eclipse.jdt.core/META-INF/MANIFEST.MF
org.eclipse.jdt.core/pom.xml

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From 698bd00bf88d7ed0981ff97c1d740efb8daa2ee4 Mon Sep 17 00:00:00 2001
From: Eclipse JDT Bot <jdt-bot@eclipse.org>
Date: Mon, 1 Dec 2025 03:47:54 +0000
Subject: [PATCH] Version bump(s) for 4.39 stream


diff --git a/org.eclipse.jdt.core.compiler.batch/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.compiler.batch/META-INF/MANIFEST.MF
index a030ab4e78..9fa22b6d2a 100644
--- a/org.eclipse.jdt.core.compiler.batch/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core.compiler.batch/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Main-Class: org.eclipse.jdt.internal.compiler.batch.Main
 Bundle-ManifestVersion: 2
 Bundle-Name: Eclipse Compiler for Java(TM)
 Bundle-SymbolicName: org.eclipse.jdt.core.compiler.batch
-Bundle-Version: 3.44.0.qualifier
+Bundle-Version: 3.44.100.qualifier
 Bundle-ClassPath: .
 Bundle-Vendor: Eclipse.org
 Automatic-Module-Name: org.eclipse.jdt.core.compiler.batch
diff --git a/org.eclipse.jdt.core.compiler.batch/pom.xml b/org.eclipse.jdt.core.compiler.batch/pom.xml
index 85ed594e39..5c670fc93a 100644
--- a/org.eclipse.jdt.core.compiler.batch/pom.xml
+++ b/org.eclipse.jdt.core.compiler.batch/pom.xml
@@ -17,7 +17,7 @@
     <version>4.39.0-SNAPSHOT</version>
   </parent>
   <artifactId>org.eclipse.jdt.core.compiler.batch</artifactId>
-  <version>3.44.0-SNAPSHOT</version>
+  <version>3.44.100-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <properties>
diff --git a/org.eclipse.jdt.core.tests.builder/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.tests.builder/META-INF/MANIFEST.MF
index eb405a9e42..5915821370 100644
--- a/org.eclipse.jdt.core.tests.builder/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core.tests.builder/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.core.tests.builder; singleton:=true
-Bundle-Version: 3.12.1000.qualifier
+Bundle-Version: 3.12.1100.qualifier
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.jdt.core.tests.builder
diff --git a/org.eclipse.jdt.core.tests.builder/pom.xml b/org.eclipse.jdt.core.tests.builder/pom.xml
index 41f9288100..537be97432 100644
--- a/org.eclipse.jdt.core.tests.builder/pom.xml
+++ b/org.eclipse.jdt.core.tests.builder/pom.xml
@@ -18,7 +18,7 @@
     <relativePath>../tests-pom/</relativePath>
   </parent>
   <artifactId>org.eclipse.jdt.core.tests.builder</artifactId>
-  <version>3.12.1000-SNAPSHOT</version>
+  <version>3.12.1100-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <properties>
diff --git a/org.eclipse.jdt.core/META-INF/MANIFEST.MF b/org.eclipse.jdt.core/META-INF/MANIFEST.MF
index f63fc9f5bf..f52d974ebf 100644
--- a/org.eclipse.jdt.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.core; singleton:=true
-Bundle-Version: 3.44.0.qualifier
+Bundle-Version: 3.44.100.qualifier
 Bundle-Activator: org.eclipse.jdt.core.JavaCore
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/org.eclipse.jdt.core/pom.xml b/org.eclipse.jdt.core/pom.xml
index 7783792da4..c423ea9f8e 100644
--- a/org.eclipse.jdt.core/pom.xml
+++ b/org.eclipse.jdt.core/pom.xml
@@ -17,7 +17,7 @@
     <version>4.39.0-SNAPSHOT</version>
   </parent>
   <artifactId>org.eclipse.jdt.core</artifactId>
-  <version>3.44.0-SNAPSHOT</version>
+  <version>3.44.100-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <properties>
-- 
2.51.2

Further information are available in Common Build Issues - Missing version increments.

@srikanth-sankaran srikanth-sankaran force-pushed the descriptor-type-invisible branch from 005178f to a2881c7 Compare December 1, 2025 03:44
@srikanth-sankaran srikanth-sankaran merged commit e76e46e into eclipse-jdt:master Dec 1, 2025
8 checks passed
@srikanth-sankaran srikanth-sankaran deleted the descriptor-type-invisible branch December 1, 2025 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The type ... from the descriptor computed for the target context is not visible here

3 participants