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

ClassCastException during code completion on Annotation #1440

Closed
c-koell opened this issue Sep 27, 2023 · 11 comments · Fixed by #1696
Closed

ClassCastException during code completion on Annotation #1440

c-koell opened this issue Sep 27, 2023 · 11 comments · Fixed by #1696
Assignees

Comments

@c-koell
Copy link

c-koell commented Sep 27, 2023

We have a Class where we define some static final Strings

public class Constants {

	public static final class Group1 {
		public static final String val1 = "val1";
	}

	public static final class Group2 {
		public static final String val2 = "val2";
	}
}

We use this on a custom Annotation.

@Aspect(id = "test", fetch = { Constants.Group1.val1 + "." + Constants.Group2.val2 })
public class Member {

}

The fetch Attribute can take a String[].

The Exception only occurs if we try to concat more Constants.
This example works fine

@Aspect(id = "test", fetch = { Constants.Group1.val1})
public class Member {

}

With Eclipse 4.28 the code completion works fine in the fetch attrribute.

With Eclipse 4.29 we get following exception

java.lang.ClassCastException: org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding incompatible with org.eclipse.jdt.internal.compiler.lookup.FieldBinding
@c-koell
Copy link
Author

c-koell commented Sep 27, 2023

This is the Stacktrace

java.lang.ClassCastException: org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding incompatible with org.eclipse.jdt.internal.compiler.lookup.FieldBinding
	at org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference.computeConversion(QualifiedNameReference.java:309)
	at org.eclipse.jdt.internal.compiler.ast.BinaryExpression.resolveType(BinaryExpression.java:1921)
	at org.eclipse.jdt.internal.compiler.ast.CombinedBinaryExpression.resolveType(CombinedBinaryExpression.java:398)
	at org.eclipse.jdt.internal.compiler.ast.ArrayInitializer.resolveTypeExpecting(ArrayInitializer.java:193)
	at org.eclipse.jdt.internal.compiler.ast.MemberValuePair.resolveTypeExpecting(MemberValuePair.java:87)
	at org.eclipse.jdt.internal.compiler.ast.Annotation.resolveType(Annotation.java:920)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveAnnotations(ASTNode.java:970)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveAnnotations(ASTNode.java:800)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.getAnnotationTagBits(SourceTypeBinding.java:1643)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.updateSupertypesWithAnnotations(TypeDeclaration.java:1891)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy2(CompilationUnitScope.java:402)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:598)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:2334)
	at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:136)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:367)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:357)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.internalComputeCompletionProposals(JavaCompletionProposalComputer.java:256)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.computeCompletionProposals(JavaCompletionProposalComputer.java:218)
	at org.eclipse.jdt.internal.ui.text.java.JavaTypeCompletionProposalComputer.computeCompletionProposals(JavaTypeCompletionProposalComputer.java:65)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:348)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:340)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:333)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:289)
	at org.eclipse.jface.text.contentassist.AsyncCompletionProposalPopup.lambda$10(AsyncCompletionProposalPopup.java:378)


@c-koell
Copy link
Author

c-koell commented Oct 5, 2023

Can someone have a look ? It's really easy to reproduce .. thanks

@iloveeclipse
Copy link
Member

Please make the example complete, the "Aspect" annotation is missing. Or even better, attach the simple project with the used compiler settings.

@iloveeclipse iloveeclipse added the needinfo Further information is requested label Oct 5, 2023
@c-koell
Copy link
Author

c-koell commented Oct 5, 2023

jdt-1440.zip
Here is a very simple project export from eclipse. If you try the content assist you will hopefully get the same exception :-)

@iloveeclipse
Copy link
Member

If you try the content assist you will hopefully get the same exception :-)

Thanks!

I do get three different exceptions trying code completion on anything inside the "fetch" block below
@Aspect(id = "test", fetch = { Constants.Group1.val1 + "." + Constants.Group2.val2 })

@jjohnstn : it could be JDT UI issue, could you please check.

Errors from latest 4.30 build I20231004-1800:

!ENTRY org.eclipse.jdt.ui 2 0 2023-10-05 14:27:15.977
!MESSAGE The 'org.eclipse.jdt.ui.JavaAllCompletionProposalComputer' proposal computer from the 'org.eclipse.jdt.ui' plug-in did not complete normally. The extension has thrown a runtime exception.
!STACK 0
java.lang.ClassCastException: class org.eclipse.jdt.internal.compiler.lookup.MemberTypeBinding cannot be cast to class org.eclipse.jdt.internal.compiler.lookup.FieldBinding (org.eclipse.jdt.internal.compiler.lookup.MemberTypeBinding and org.eclipse.jdt.internal.compiler.lookup.FieldBinding are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @637ca739)
	at org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference.computeConversion(QualifiedNameReference.java:309)
	at org.eclipse.jdt.internal.compiler.ast.BinaryExpression.resolveType(BinaryExpression.java:1921)
	at org.eclipse.jdt.internal.compiler.ast.CombinedBinaryExpression.resolveType(CombinedBinaryExpression.java:398)
	at org.eclipse.jdt.internal.compiler.ast.ArrayInitializer.resolveTypeExpecting(ArrayInitializer.java:193)
	at org.eclipse.jdt.internal.compiler.ast.MemberValuePair.resolveTypeExpecting(MemberValuePair.java:87)
	at org.eclipse.jdt.internal.compiler.ast.Annotation.resolveType(Annotation.java:920)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveAnnotations(ASTNode.java:970)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveAnnotations(ASTNode.java:800)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.getAnnotationTagBits(SourceTypeBinding.java:1644)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.updateSupertypesWithAnnotations(TypeDeclaration.java:1891)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy2(CompilationUnitScope.java:402)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:598)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:2334)
	at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:136)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:367)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:357)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.internalComputeCompletionProposals(JavaCompletionProposalComputer.java:256)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.computeCompletionProposals(JavaCompletionProposalComputer.java:218)
	at org.eclipse.jdt.internal.ui.text.java.JavaTypeCompletionProposalComputer.computeCompletionProposals(JavaTypeCompletionProposalComputer.java:65)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:348)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:340)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:333)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:289)
	at org.eclipse.jface.text.contentassist.AsyncCompletionProposalPopup.lambda$10(AsyncCompletionProposalPopup.java:378)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jface.text.contentassist.AsyncCompletionProposalPopup.lambda$9(AsyncCompletionProposalPopup.java:377)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)

!ENTRY org.eclipse.jdt.ui 2 0 2023-10-05 14:27:26.233
!MESSAGE The 'org.eclipse.jdt.ui.JavaAllCompletionProposalComputer' proposal computer from the 'org.eclipse.jdt.ui' plug-in did not complete normally. The extension has thrown a runtime exception.
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.impl.Constant.typeID()" because "this.constant" is null
	at org.eclipse.jdt.internal.compiler.ast.Expression.computeConversion(Expression.java:711)
	at org.eclipse.jdt.internal.compiler.ast.SingleNameReference.computeConversion(SingleNameReference.java:320)
	at org.eclipse.jdt.internal.compiler.ast.BinaryExpression.resolveType(BinaryExpression.java:1920)
	at org.eclipse.jdt.internal.compiler.ast.BinaryExpression.resolveType(BinaryExpression.java:1859)
	at org.eclipse.jdt.internal.compiler.ast.CombinedBinaryExpression.resolveType(CombinedBinaryExpression.java:398)
	at org.eclipse.jdt.internal.compiler.ast.ArrayInitializer.resolveTypeExpecting(ArrayInitializer.java:193)
	at org.eclipse.jdt.internal.compiler.ast.MemberValuePair.resolveTypeExpecting(MemberValuePair.java:87)
	at org.eclipse.jdt.internal.compiler.ast.Annotation.resolveType(Annotation.java:920)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveAnnotations(ASTNode.java:970)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveAnnotations(ASTNode.java:800)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.getAnnotationTagBits(SourceTypeBinding.java:1644)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.updateSupertypesWithAnnotations(TypeDeclaration.java:1891)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy2(CompilationUnitScope.java:402)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:598)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:2334)
	at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:136)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:367)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:357)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.internalComputeCompletionProposals(JavaCompletionProposalComputer.java:256)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.computeCompletionProposals(JavaCompletionProposalComputer.java:218)
	at org.eclipse.jdt.internal.ui.text.java.JavaTypeCompletionProposalComputer.computeCompletionProposals(JavaTypeCompletionProposalComputer.java:65)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:348)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:340)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:333)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:289)
	at org.eclipse.jface.text.contentassist.AsyncCompletionProposalPopup.lambda$10(AsyncCompletionProposalPopup.java:378)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jface.text.contentassist.AsyncCompletionProposalPopup.lambda$9(AsyncCompletionProposalPopup.java:377)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)

!ENTRY org.eclipse.jdt.ui 2 0 2023-10-05 14:27:30.065
!MESSAGE The 'org.eclipse.jdt.ui.JavaAllCompletionProposalComputer' proposal computer from the 'org.eclipse.jdt.ui' plug-in did not complete normally. The extension has thrown a runtime exception.
!STACK 0
java.lang.ClassCastException: class org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding cannot be cast to class org.eclipse.jdt.internal.compiler.lookup.FieldBinding (org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding and org.eclipse.jdt.internal.compiler.lookup.FieldBinding are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @637ca739)
	at org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference.computeConversion(QualifiedNameReference.java:309)
	at org.eclipse.jdt.internal.compiler.ast.BinaryExpression.resolveType(BinaryExpression.java:1920)
	at org.eclipse.jdt.internal.compiler.ast.BinaryExpression.resolveType(BinaryExpression.java:1859)
	at org.eclipse.jdt.internal.compiler.ast.CombinedBinaryExpression.resolveType(CombinedBinaryExpression.java:398)
	at org.eclipse.jdt.internal.compiler.ast.ArrayInitializer.resolveTypeExpecting(ArrayInitializer.java:193)
	at org.eclipse.jdt.internal.compiler.ast.MemberValuePair.resolveTypeExpecting(MemberValuePair.java:87)
	at org.eclipse.jdt.internal.compiler.ast.Annotation.resolveType(Annotation.java:920)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveAnnotations(ASTNode.java:970)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveAnnotations(ASTNode.java:800)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.getAnnotationTagBits(SourceTypeBinding.java:1644)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.updateSupertypesWithAnnotations(TypeDeclaration.java:1891)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy2(CompilationUnitScope.java:402)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:598)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:2334)
	at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:136)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:367)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:357)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.internalComputeCompletionProposals(JavaCompletionProposalComputer.java:256)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.computeCompletionProposals(JavaCompletionProposalComputer.java:218)
	at org.eclipse.jdt.internal.ui.text.java.JavaTypeCompletionProposalComputer.computeCompletionProposals(JavaTypeCompletionProposalComputer.java:65)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:348)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:340)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:333)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:289)
	at org.eclipse.jface.text.contentassist.AsyncCompletionProposalPopup.lambda$10(AsyncCompletionProposalPopup.java:378)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jface.text.contentassist.AsyncCompletionProposalPopup.lambda$9(AsyncCompletionProposalPopup.java:377)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)

@c-koell
Copy link
Author

c-koell commented Oct 18, 2023

@jjohnstn do you have found something ?

@jjohnstn
Copy link
Contributor

@c-koell @iloveeclipse Sorry for the delay. Doing some debugging, I do not see this is as a JDT UI issue. The problem occurs because the Constants.Group1.val1 + "." becomes a BinaryExpression with the left-side being a CompletionOnQualifiedNameReference and it has a MemberTypeBinding that has the Binding.FIELD bit set on so QualifiedNameReference.computeConversion() tries to cast it to a FieldBinding which fails.

Looking at 2023-06, I see a difference in CompilationOnQualifiedNameReference.resolveType() which used to throw a new CompletionNodeFound() and after commit 32961cf returns a new CompletionNodeFound().throwOrDeferAndReturn() The throw caused it to skip the code that ends up doing the QualifiedNameReference.computeConversion() and it ended up in the finally clause in SourceTypeBinding.initAnnotationTagBits()

@c-koell
Copy link
Author

c-koell commented Dec 5, 2023

@jjohnstn thanks for your info. Is there a plan to fix it ?

@jjohnstn
Copy link
Contributor

jjohnstn commented Dec 5, 2023

@stephan-herrmann Could you take a look? I am not sure if the answer is to simply throw the old CompletionNodeFound().

stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue Dec 5, 2023
stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue Dec 5, 2023
@stephan-herrmann
Copy link
Contributor

Thanks @jjohnstn your analysis put the finger right on the sore spot :)

@stephan-herrmann stephan-herrmann removed the needinfo Further information is requested label Dec 5, 2023
@stephan-herrmann stephan-herrmann self-assigned this Dec 5, 2023
stephan-herrmann added a commit that referenced this issue Dec 5, 2023
jarthana pushed a commit to jarthana/eclipse.jdt.core that referenced this issue Dec 13, 2023
noopur2507 pushed a commit that referenced this issue Dec 15, 2023
mpalat added a commit that referenced this issue Dec 19, 2023
* configure default output.. = bin/

* JavaSearchScope: improve encloses() performance  #474

* [test] remove outdated latestBREE project

* fix some ecj markers

Especially after moving files to compiler.batch - which has no resource
warnings - the @SuppressWarnings("resource") is not used - leading to a
marker

* Single async "Synchronizing projects" Job #419

Scheduling multiple times "while the job is running, the job will still
only be rescheduled once" (javadoc) so there will be always only a
single job running.
Using a Set prevents touching projects multiple times.

#419

Manually tested by changing Compiler Building options "Circular
dependencies", which triggers a new build.

* [test] fix AbstractJavaModelTests #1333

avoid asynchronous refresh. Implementation taken from
org.eclipse.core.tests.resources.refresh.RefreshProviderTest.joinAutoRefreshJobs()

#1333

* TestVerifier: never wait 100ms

improve test time, accurate timeout

* [performance] ClassFileReader: use already open Zip File

instead of creating new ZipFile instance.

also:
* use Files.readAllBytes
* removed unused code
* faster toUri avoiding isDirectory() check for the JARs which are known
to be no directory

improves performance of read() on windows by factor 2
tested with java reference search to java.lang.Object

* Stop skipping compare-with-baseline for jdt.annotation v2

One less thing that has to be manually tracked and done.

* Version bump for jdt.annotation

Pointed by
https://download.eclipse.org/eclipse/downloads/drops4/I20231130-0020/buildlogs/reporeports/reports/versionChecks.html

* Fix github urls in NOTICE file

* Use try-with-resource and enable warning if not

org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning

StringWriter does not need flush() or close() and can not throw
IOException.

Tests excluded.

To get rid of boiler plate code.

* version bumps

* [21] JEP 430 String Templates (#1513)

Grammar, compiler AST, resolution and code generation changes

* Javadoc: fix unclosed <code>

* break from loop within labeled block causes loss of nullness info (#1660)

fixes #1659

* Fixes incorrect Javadoc after StringBuffer to StringBuilder change

* NPE in ASTRewriteFlattener as return value of GuardedPattern.getPattern() is null  (#1647)

NPE in ASTRewriteFlattener as return value of
GuardedPattern.getPattern() is null

* Adding pomless build to JDT core

This enables pomless builds for JDT coreand removes the simple pom
files.

Future commits can reduce the usage of pom files further. This might
require enhancements in pomless builds to specify the test classes and
suites eclipse-tycho/tycho#3105

* Using Simplify lambda expression and method reference syntax cleanup on
core

Using the JDT UI "Simplify lambda expression and method reference
syntax" clean-up on jdt.core.

* Internal compiler error: ArrayIndexOutOfBoundsException in latest i build (#1664)


fixes #1661

* Using Simplify lambda expression and method reference syntax cleanup on
all plug-ins except core

Using the JDT UI "Simplify lambda expression and method reference
syntax" clean-up on all plug-ins except jdt.core.

* Using short-circuit in IncrementalImageBuilder

* Re-normalize line-endings in git of all files to Linux style ("\n")

Some files were checked-in into git having windows style line
endings (\r\n). This is in general not wanted because it can cause
modified files without any difference in git-staging on Windows if
auto-crlf is enabled.

To re-normalize line endings of all files use the following command
(including dot):

git add --renormalize .

* Bump bundle dependencies to trigger a rebuild / fix SDK build error

The change in bytecode of FullSourceWorkspaceBuildTests is due the
constant value change of
o.e.jdt.internal.compiler.parser.TerminalTokens.TokenNameEOF coming
from #1513.

Fixes eclipse-platform/eclipse.platform.releng.aggregator#1617

* False positive "Dead code" compiler error reported on org.eclipse.pde.internal.core.util.PDEJavaHelper.getExternalPackageFragment(String, String) (#1671)

fixes #1667

* Use diamond operator in jdt.core repo

Using the JDT UI clean-up, this removes the redundant type information.

Also activating
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
The rest of the changes in the prefs file were done by the tooling, not
by
selecting anther value.

* Improve constructor completions inside method invocations Fix #1587 (#1588)

* Try-with-resource clean-up in JDT core

Using the JDT UI try-with-resource clean-up on core.
Also manually inlining the declaration of multiple places into the try()
clause.

* Make inner classes static where possible in JDT core

Running the JDT performnace clean-up "Make inner classes static where
possible" in JDT core

* Use Use lazy logical operator (&& and ||)

Running the performance clean-up "Use lazy logical operator (&& and ||)"
on JDT core

* Using Integer.toString directly in Disassembler

It is also a JDT UI performance clean-up but this clean-up found only
one occurrence.

* use Path.of() to avoid 'Potential resource leak' warnings

* @NonNullByDefault does not work for type arguments of a local type (#1694)

fixes #1693

* ClassCastException during code completion on Annotation (#1696)

fixes #1440

Also fixes noise from #1662

* CompilationUnitResolver: Name the CU that causes Exception (#1690)

for example during Cleanup
eclipse-jdt/eclipse.jdt.ui#950

Co-authored-by: Jörg Kubitz <jkubitz-eclipse@gmx.de>

* Code selection support for String template expressions (#1699)

Fixes  #1685

* Report error if string template is used without preview option enabled (#1697)

Improves the fix for #544

* ECJ crashes when an embedded expression contains broken code (#1702)

Set haltOnSyntaxError when parsing for embedded expressions. Also using the correct delimiters for text blocks in printExpression() methods.

* Selection model tests for string templates (#1704)

* tests: enable discouragedReference=warning, declare x-friends

to get rid of warnings during build (does not respect the jdt
preferences)

* Javadoc format fixes

Contributes to
eclipse-platform/eclipse.platform.releng.aggregator#1531

* Performance: Add public API for Batch Reads in UI - closes #1614

During Batches:
* cache Zip Files
* enable JavaModelManager.temporaryCache

Also:
* uses Batch Reads during some core actions that benefit from it.
* adds trace logging when caching is missing.

#1614

* Javadoc format fixes (part 2)

Contributes to
eclipse-platform/eclipse.platform.releng.aggregator#1531.
It's a pity that this takes multiple cycles but fixing one thing from
the log uncovers the next.

* ECJ 3.36.0 regression: The type 'E extends java.lang.Exception' is not a valid substitute for the type parameter 'E extends java.lang.@nonnull Exception' (#1708)

fixes #1691

+ also slightly updates NullAnnotationTests18 as NullAnnotationTests21

* Implement support for code completion inside embedded expression of (only) string templates (not text block templates) (#1712)

* Implement support for code completion inside embedded expression of
(only) string templates (not text block templates)

* Fixes #1711

* Fixes #1641 (#1713)

* Add new testcase #1701 (#1705)

* Content assist does not propose overrides in records (#1718)

* Fixes #1095

* JavaModelManager: lazy initialize TouchJob #1720

#1720

* Run the JavaCoreStandaloneTest in the build

#1720

* Bogus error about return expression involving pattern matching (#1731)

Fixes #1726

* Compiler fails to recognize an exhaustive switch (#1733)

*  Fixes #1725

* [21] Processed string templates falsely contain backslash characters (#1730)

#1719

* 1641_enum_further_fixes (#1739)

* Fix one too many pops arising from string concat invoke dynamic (#1740)

* Fix one too many pops arising from string concat invoke dynamic

* Fixes #1394

* Wrong placement of exception range closure results in AIOOB (#1744)

Fixes #1686

* Improper warning - Potential null pointer access (#1469)

Fixes #1461
Sets the flow info reach mode to FlowInfo.UNREACHABLE_BY_NULLANALYSIS
after 'Object o = null;if (Objects.isNull(o)) return;', 'Object o = "";if (Objects.nonNull(o)) return;

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>

* Touch bundles affected by the changed ecj version

See #1394
See eclipse-platform/eclipse.platform.releng.aggregator#1659

* Upload eventfile and unit test results

* 2023-06->2023-09 Seems to have broke dependency graph management in our project (#1698)

* Add test for reproducing #1654
* Fix to make that test pass

---------

Co-authored-by: Stephan Herrmann <stephan.herrmann@berlin.de>

* [memory] SoftReference for ResourceCompilationUnit.contents #1743

Ability to reduce memory during searches that find many files

#1743

* deduplicate "eclipse" #1743

CharDeduplication was not designed to deduplicate tokens with length 7+
which could lead to high memory consumption. With this change tokens of
all sizes can be deduplicated.

#1743

A benchmark implemented in CharDeduplicationTest.main(String[]) shows
the new deduplication is performed at similar speed (.21s instead of
.16s) but deduplicates much more tokens (99% instead of 36%).

* 1703.constant definitions (#1756)

* Fixes [21] AIOOB at switchStatement TNode.addPattern  (#1757)

org.eclipse.jdt.internal.compiler.ast.SwitchStatement $TNode.addPattern

---------

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
Co-authored-by: Jörg Kubitz <jkubitz-eclipse@gmx.de>
Co-authored-by: Eric Milles <eric.milles@thomsonreuters.com>
Co-authored-by: Александър Куртаков <akurtakov@gmail.com>
Co-authored-by: Jay Arthanareeswaran <jarthana@in.ibm.com>
Co-authored-by: Stephan Herrmann <stephan.herrmann@berlin.de>
Co-authored-by: Lars Vogel <Lars.Vogel@vogella.com>
Co-authored-by: Suby S Surendran <suby.surendran@ibm.com>
Co-authored-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
Co-authored-by: Andrey Loskutov <loskutov@gmx.de>
Co-authored-by: Gayan Perera <gayanper@gmail.com>
Co-authored-by: Jörg Kubitz <51790620+jukzi@users.noreply.github.com>
Co-authored-by: Srikanth Sankaran <131454720+srikanth-sankaran@users.noreply.github.com>
Co-authored-by: Ed Merks <ed.merks@gmail.com>
Co-authored-by: Snjeza <snjezana.peco@redhat.com>
Co-authored-by: Christoph Läubrich <laeubi@laeubi-soft.de>
Co-authored-by: Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
rgrunber pushed a commit to eclipse-jdtls/eclipse-jdt-core-incubator that referenced this issue Jan 9, 2024
@c-koell
Copy link
Author

c-koell commented Jan 15, 2024

Will this fix be available in the next Eclipse Release .. 2024 ?

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 a pull request may close this issue.

4 participants