Comments (7)
Confirmed for 2023-06 (Win 10 & Win 11). Now the Task will never stop and consume ~1 CPU-Core forever. Even after the affected file is deleted from workspace. Only fix is to reboot the whole IDE.
from eclipse.jdt.core.
switch (opt) { // <- Write 'boolean test' here and press CTRL+Space
Here the snippet I've used and it is reproducible at current master in plain SDK
package gg;
import java.lang.StackWalker.Option;
public class PlanetTravelActionLagTest {
private void test() {
Option opt = Option.RETAIN_CLASS_REFERENCE;
boolean test|switch (opt) { // <- remove pipe and press CTRL+Space
case RETAIN_CLASS_REFERENCE -> {
}
case SHOW_HIDDEN_FRAMES -> {
}
case SHOW_REFLECT_FRAMES -> throw new UnsupportedOperationException("Unimplemented case: ");
}
}
}
Thread below will run in endless loop:
Daemon Thread [ForkJoinPool.commonPool-worker-5] (Suspended)
CompletionParser(AssistParser).copyState(Parser) line: 161
CompletionParser.copyState(Parser) line: 5612
CompletionParser(AssistParser).commit() line: 2348
CompletionParser(AssistParser).triggerRecoveryUponLambdaClosure(Statement, boolean) line: 627
CompletionParser(AssistParser).consumeBlockStatements() line: 748
CompletionParser(Parser).consumeRule(int) line: 7554
CompletionParser(Parser).parse() line: 13183
CompletionParser.parseSomeStatements(int, int, int, CompilationUnitDeclaration) line: 5895
UnresolvedReferenceNameFinder.findAfter(char[], Scope, int, int, int, boolean, char[][], UnresolvedReferenceNameFinder$UnresolvedReferenceNameRequestor) line: 155
UnresolvedReferenceNameFinder.find(char[], AbstractMethodDeclaration, int, char[][], UnresolvedReferenceNameFinder$UnresolvedReferenceNameRequestor) line: 101
CompletionEngine.findVariableFromUnresolvedReference(LocalDeclaration, BlockScope, char[][]) line: 13005
CompletionEngine.completionOnLocalOrArgumentName(ASTNode, Scope) line: 3062
CompletionEngine.complete(ASTNode, ASTNode, ASTNode, CompilationUnitDeclaration, Binding, Scope, boolean) line: 2057
CompletionEngine.complete(ICompilationUnit, int, int, ITypeRoot) line: 2356
CompilationUnit(Openable).codeComplete(ICompilationUnit, ICompilationUnit, int, CompletionRequestor, WorkingCopyOwner, ITypeRoot, IProgressMonitor) line: 136
CompilationUnit.codeComplete(int, CompletionRequestor, WorkingCopyOwner, IProgressMonitor) line: 367
CompilationUnit.codeComplete(int, CompletionRequestor, IProgressMonitor) line: 357
JavaAllCompletionProposalComputer(JavaCompletionProposalComputer).internalComputeCompletionProposals(int, JavaContentAssistInvocationContext) line: 256
JavaAllCompletionProposalComputer(JavaCompletionProposalComputer).computeCompletionProposals(ContentAssistInvocationContext, IProgressMonitor) line: 218
JavaAllCompletionProposalComputer(JavaTypeCompletionProposalComputer).computeCompletionProposals(ContentAssistInvocationContext, IProgressMonitor) line: 65
CompletionProposalComputerDescriptor.computeCompletionProposals(ContentAssistInvocationContext, IProgressMonitor) line: 348
CompletionProposalCategory.computeCompletionProposals(ContentAssistInvocationContext, String, SubProgressMonitor) line: 340
JavaCompletionProcessor(ContentAssistProcessor).collectProposals(ITextViewer, int, IProgressMonitor, ContentAssistInvocationContext) line: 333
JavaCompletionProcessor(ContentAssistProcessor).computeCompletionProposals(ITextViewer, int) line: 289
AsyncCompletionProposalPopup.lambda$10(IContentAssistProcessor, int, AtomicReference) line: 378
0x0000000801727a40.run() line: not available
SafeRunner.run(ISafeRunnable) line: 45
AsyncCompletionProposalPopup.lambda$9(IContentAssistProcessor, int) line: 377
0x00000008017275d0.get() line: not available
CompletableFuture$AsyncSupply<T>.run() line: 1768
CompletableFuture$AsyncSupply<T>.exec() line: 1760
CompletableFuture$AsyncSupply<T>(ForkJoinTask<V>).doExec() line: 373
ForkJoinPool$WorkQueue.topLevelExec(ForkJoinTask<?>, WorkQueue) line: 1182
ForkJoinPool.scan(ForkJoinPool$WorkQueue, int, int) line: 1655
ForkJoinPool.runWorker(ForkJoinPool$WorkQueue) line: 1622
ForkJoinWorkerThread.run() line: 165
@Kademlia : I'm not sure how your snippet should finally look like, and why do you have such strange code (it doesn't compile).
Is it supposed to look like this below may be? Just trying to understand your use case, hanging thread is without doubt not OK.
package gg;
import java.lang.StackWalker.Option;
public class X {
public void test() {
Option opt = Option.RETAIN_CLASS_REFERENCE;
boolean test = switch (opt) {
case RETAIN_CLASS_REFERENCE -> true;
case SHOW_HIDDEN_FRAMES -> false;
default -> throw new IllegalArgumentException("Unexpected value: " + opt);
};
System.out.println(test);
}
}
from eclipse.jdt.core.
@iloveeclipse
You can see my use case in the linked video in the first post. I just tried to create a minified version of the code for the example.
from eclipse.jdt.core.
OK, I see it now. So you've tried to refactor the code basically to something like in my smaller snippet, and during this you've opened content assist on "unfinished" code.
@srikanth-sankaran: are you familiar with the code in question (see stack in comment above)?
IDE shouldn't hang just because of an incomplete code state.
from eclipse.jdt.core.
OK, I see it now. So you've tried to refactor the code basically to something like in my smaller snippet, and during this you've opened content assist on "unfinished" code.
@srikanth-sankaran: are you familiar with the code in question (see stack in comment above)? IDE shouldn't hang just because of an incomplete code state.
I was familiar long ago. I will add this to my queue.
from eclipse.jdt.core.
Hmm. A very interesting bug! The CompletionParser sees a lambda expression in the code while the normal parser (correctly) sees none! Looking into it ...
from eclipse.jdt.core.
#708 is basically a case where the -> of a switch expression was confused for a lambda and its fix brings about #968
from eclipse.jdt.core.
Related Issues (20)
- [21] Add AST rewrite support for new String Template DOM nodes HOT 2
- Unchecked casts go unreported with ECJ HOT 1
- Record pattern matching with `null` gives wrong result HOT 3
- Parameters of compact canonical constructor are not marked as mandated HOT 1
- Error in Java Model (code 980): JDT/Autocomplete wrecked sometimes
- Incorrect unused import warning
- The operator += is undefined for the argument type(s) CharSequence, String HOT 3
- [21] Enums cause issues in Record Pattern exhaustiveness checks HOT 4
- [21] Record Patterns in InstanceOf not detected HOT 3
- Implementation of javax.lang.model.util.Elements#getTypeElement(String) returns TypeElement with empty metadata HOT 2
- [switch] Switch expression fails with instanceof + ternary operator combo HOT 5
- CCE while typing try-with-resources
- EXPERIMENT: JDT using Javac instead of ECJ HOT 3
- "Error indexing package names!" HOT 4
- The nullness annotation @Nonnull is not applicable for the primitive type byte HOT 1
- Index is not ready on first use
- slow DiagnoseParser.diagnoseParse(boolean) HOT 3
- silent NumberFormatException in SourceMapper
- [Switch][patterns][record] AssertionError at org.eclipse.jdt.internal.compiler.ast.YieldStatement.addSecretYieldResultValue(YieldStatement.java:120) HOT 14
- StackOverflowError in TypeBinding.getQualifiedName(TypeBinding.java:748) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eclipse.jdt.core.