Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use JLS23 as latest compliance level in AST #465

Open
wants to merge 303 commits into
base: dom-with-javac
Choose a base branch
from

Conversation

gayanper
Copy link

@gayanper gayanper commented Jun 9, 2024

Currently JavaCore returns the latest supported java version as Java 23, But the AST validation is restricted to Java 22, this cause the issue with vscode java debugger, which sends the compliancy level as 23 when evaluating debug breakpoints to be registered.

@gayanper
Copy link
Author

gayanper commented Jun 9, 2024

@mickaelistria another small fix to make javac usable with debugging in vscode.

@mickaelistria
Copy link

This seems to cause ~60 new test failures: https://ci.eclipse.org/ls/job/jdt-core-incubator/job/PR-465/1/
The issue is that when we set the "latest" then many other bits of JDT expect that ECJ can support this latest too, which is not the case yet.This seems to cause ~60 new test failures: https://ci.eclipse.org/ls/job/jdt-core-incubator/job/PR-465/1/
The issue is that when we set the "latest" then many other bits of JDT expect that ECJ can support this latest too, which is not the case yet. So far, the approach of declaring the new versions but not listing them as "latest" has been the best working one. Do you know where in your use-case is JLS_Latest being used?

@gayanper
Copy link
Author

If we check the code here https://github.com/microsoft/java-debug/blob/83403a458e0d01fba5a3871fea81af742460bdf0/com.microsoft.java.debug.plugin/src/main/java/com/microsoft/java/debug/plugin/internal/JdtSourceLookUpProvider.java#L103

as we can see it reads the latest java version from JavaCore.latestSupportedJavaVersion() which has the following implementation in our incubator

	public static String latestSupportedJavaVersion() {
		return allVersions.get(allVersions.size() - 1);
	}

allVersions has VERSION_23 as the last element.

@gayanper
Copy link
Author

@mickaelistria How should we handle this ?

@mickaelistria
Copy link

I'm curious about "AST validation is restricted to Java 22", can you please elaborate how we can see this? I think AST validation should be working for any known AST version, independently of what's the one marked as latest.

Rob Stryker and others added 24 commits June 14, 2024 15:50
Signed-off-by: Rob Stryker <stryker@redhat.com>
Signed-off-by: Rob Stryker <stryker@redhat.com>
Signed-off-by: Rob Stryker <stryker@redhat.com>
Signed-off-by: Rob Stryker <stryker@redhat.com>
Signed-off-by: Rob Stryker <stryker@redhat.com>
Signed-off-by: Rob Stryker <stryker@redhat.com>
Signed-off-by: Rob Stryker <stryker@redhat.com>
Signed-off-by: David Thompson <davthomp@redhat.com>
Signed-off-by: Rob Stryker <stryker@redhat.com>
Signed-off-by: David Thompson <davthomp@redhat.com>
Setting value is "enabled" and thus has to be handled like all the other
"enabled" options.
Signed-off-by: David Thompson <davthomp@redhat.com>
fail less, log more.
Fixes eclipse-jdt#284

---------

Signed-off-by: David Thompson <davthomp@redhat.com>
Signed-off-by: Rob Stryker <stryker@redhat.com>
Co-authored-by: Rob Stryker <stryker@redhat.com>
Seems a better API than drilling down in JavacCompiler.
Calling JavaProject.getJavaProject() is guaranteed to never be null as
it returns "this". The intended check here should have been if
getProject() is not null.
Signed-off-by: David Thompson <davthomp@redhat.com>
mickaelistria and others added 11 commits June 14, 2024 18:30
Signed-off-by: Rob Stryker <stryker@redhat.com>
- Small bug fix related to getKey for annotation bindings where the
  parent is sometimes not set correctly

Signed-off-by: David Thompson <davthomp@redhat.com>
Should fix ~7 tests

Signed-off-by: David Thompson <davthomp@redhat.com>
fixes for method proposals where it causes runtime errors
- fix return type signature when it is a type parameter
- set parameter names
fix downstream errors due to required proposals null
improve static method chain completions
improve the previous commit implementations
support few more scenarios
remove unused code
Signed-off-by: David Thompson <davthomp@redhat.com>
Signed-off-by: Rob Stryker <stryker@redhat.com>
Signed-off-by: Rob Stryker <stryker@redhat.com>
@gayanper
Copy link
Author

I'm curious about "AST validation is restricted to Java 22", can you please elaborate how we can see this? I think AST validation should be working for any known AST version, independently of what's the one marked as latest.

The problem happens in https://github.com/gayanper/eclipse.jdt.core/blob/81b72d0d5ee1283ae61f543bb64d6e966fd35e22/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java#L1181

Since the constant at https://github.com/gayanper/eclipse.jdt.core/blob/81b72d0d5ee1283ae61f543bb64d6e966fd35e22/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java#L546 is not pointing to the latest version provided by avaCore.latestSupportedJavaVersion() method.

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.

None yet

7 participants