| Summary: | [jdt] NPE LoopingFlowContext.recordNullReference | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | EPP Error Reports <error-reports-inbox> |
| Component: | Core | Assignee: | Stephan Herrmann <stephan.herrmann> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | blocker | ||
| Priority: | P3 | CC: | ed, jarthana |
| Version: | 4.5 | ||
| Target Milestone: | 4.5 M5 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
I've looked up the (to date) top-3 most similar bug groups and listed the
closest bug of each group below. This report may or may not be duplicate of
those (low or similar scores for all entries may indicate that this hasn't
been reported yet):
> 1. Bug 451237: [egit] UI freeze of 3.0s at 22:31:47.800 – 1
If this report actually is a duplicate of those, please mark it as such. This
information helps me to improve the recommendations further for the next issue.
Thank you for your assistance.
Your friendly error-reports-inbox.
M4 Regression. This is a blocker for me. My code just does not compile. Reverting to M3 and problems go away. Ed, can you share the code that is causing this problem? Thanks! Looks like this is happening after bug 453483 got fixed. (In reply to Jayaprakash Arthanareeswaran from comment #3) > Ed, can you share the code that is causing this problem? Thanks! > > Looks like this is happening after bug 453483 got fixed. I suspect you just need to do some testing for Java 7 users. The problem code is all in the ewillink/ocl25 branch of https://git.eclipse.org/r/ocl/org.eclipse.ocl. Probably the quickest bootstrap is: Install http://www.eclipse.org/modeling/download.php?file=/modeling/mdt/ocl/downloads/drops/5.1.0/S201412151441/mdt-ocl-Update-5.1.0M4.zip with dependencies from staging. Checkout the org.eclipse.ocl.jdt.annotation7, org.eclipse.ocl.library, org.eclipse.ocl.pivot, org.eclipse.ocl.pivot.internal plugins from GIT. Only the org.eclipse.ocl.pivot successfully compiles for me. (In reply to Ed Willink from comment #4) > (In reply to Jayaprakash Arthanareeswaran from comment #3) > > Ed, can you share the code that is causing this problem? Thanks! > > > > Looks like this is happening after bug 453483 got fixed. correct, sorry my bad. > I suspect you just need to do some testing for Java 7 users. Your suspicion doesn't help. All our compiler tests are always run at all relevant compliance levels including 1.7. > Probably the quickest bootstrap is: I'm downloading this as we speak, and from the stack trace I already learned where the null is leaking from. (In reply to Ed Willink from comment #4) > Probably the quickest bootstrap is: > > Install > http://www.eclipse.org/modeling/download.php?file=/modeling/mdt/ocl/ > downloads/drops/5.1.0/S201412151441/mdt-ocl-Update-5.1.0M4.zip with > dependencies from staging. > > Checkout the org.eclipse.ocl.jdt.annotation7, org.eclipse.ocl.library, > org.eclipse.ocl.pivot, org.eclipse.ocl.pivot.internal plugins from GIT. > > Only the org.eclipse.ocl.pivot successfully compiles for me. Sorry, that doesn't look like a quick repro. After downloading 40 MB zip plus 400 MB git I just get a workspace with tens of thousands of unresolved type errors. I guess by saying "with dependencies from staging" you implied the solution to this, but I don't know what "staging" you mean and how I would locate the parts that I need (no, I'm not going to download all of simrel just to create a repro of 10 lines of code). Perhaps ocl needs some Oomph :) staging is the standard location for SimRel contributions http://download.eclipse.org/releases/staging. You will indeedd have thousands of errors since nothing compoiles. I said to check out (only) the org.eclipse.ocl.jdt.annotation7, org.eclipse.ocl.library, org.eclipse.ocl.pivot, org.eclipse.ocl.pivot.internal plugins from GIT. (In reply to Stephan Herrmann from comment #6) > but I don't know what "staging" you mean Perhaps you are not aware of how good P2 is these days. If you want to install project X, you install the download/repo for project X, then let P2 find the rest from either http://download.eclipse.org/releases/staging or http://download.eclipse.org/releases/mars. So installing the OCL downloadable is a quick way of getting EMF/MWE/Xtext/UML2 etc installed without thinking. Then you only need the GIT for the active projects. Literally "installing" all that stuff doesn't get me ahead of where you already are. You are in a far better situation to isolate the original problem into a small repro than me.
So, instead of "installing" I tried to setup for debugging by populating the workspace of a runtime workbench with all I need. A PDE target platform helps here, but that doesn't magically fetch things from a p2 repo.
Nevermind. Since your steps didn't help I created a substitute:
//---
import java.util.List;
import org.eclipse.jdt.annotation.NonNull;
public class X {
void test(List<String> list, boolean b) {
if (b)
while (true)
for (@NonNull Object y : list) {
}
}
//---
Stacktrace is close enough to the one in comment 0:
java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.flow.LoopingFlowContext.recordNullReference(LoopingFlowContext.java:565)
at org.eclipse.jdt.internal.compiler.flow.LoopingFlowContext.internalRecordNullityMismatch(LoopingFlowContext.java:759)
at org.eclipse.jdt.internal.compiler.flow.FlowContext.recordNullityMismatch(FlowContext.java:1007)
at org.eclipse.jdt.internal.compiler.ast.NullAnnotationMatching.checkAssignment(NullAnnotationMatching.java:112)
at org.eclipse.jdt.internal.compiler.ast.ForeachStatement.analyseCode(ForeachStatement.java:115)
at org.eclipse.jdt.internal.compiler.ast.Block.analyseCode(Block.java:43)
at org.eclipse.jdt.internal.compiler.ast.WhileStatement.analyseCode(WhileStatement.java:120)
at org.eclipse.jdt.internal.compiler.ast.Block.analyseCode(Block.java:43)
at org.eclipse.jdt.internal.compiler.ast.IfStatement.analyseCode(IfStatement.java:105)
at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:126)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.internalAnalyseCode(TypeDeclaration.java:737)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.analyseCode(TypeDeclaration.java:261)
at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:118)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:776)
Thanks.
I often have to do
for (@SuppressWarnings("null")@NonNull Object y : list)
in case that is more stressful.
Released for 4.5 M5 via commit 7730019127bc3900db63640d79d3086b55d5a420 Thanks. Seems to be fixed in eclipse-SDK-N20141220-150 ok. As per comment #13. |
The following error was reported via the automated error reporting: The user provided the following details for this error report: code: 2 plugin: org.eclipse.core.resources_3.9.100.v20141128-1217 message: Problems occurred when invoking code from plug-in: "org.eclipse.core.resources". fingerprint: 5b9eb6b7 exception class: java.lang.NullPointerException exception message: - number of children: 0 java.lang.NullPointerException: null at org.eclipse.jdt.internal.compiler.flow.LoopingFlowContext.recordNullReference(LoopingFlowContext.java:565) at org.eclipse.jdt.internal.compiler.flow.LoopingFlowContext.internalRecordNullityMismatch(LoopingFlowContext.java:759) at org.eclipse.jdt.internal.compiler.flow.FlowContext.recordNullityMismatch(FlowContext.java:1007) at org.eclipse.jdt.internal.compiler.ast.NullAnnotationMatching.checkAssignment(NullAnnotationMatching.java:112) at org.eclipse.jdt.internal.compiler.ast.ForeachStatement.analyseCode(ForeachStatement.java:115) at org.eclipse.jdt.internal.compiler.ast.Block.analyseCode(Block.java:43) at org.eclipse.jdt.internal.compiler.ast.ForeachStatement.analyseCode(ForeachStatement.java:126) at org.eclipse.jdt.internal.compiler.ast.Block.analyseCode(Block.java:43) at org.eclipse.jdt.internal.compiler.ast.IfStatement.analyseCode(IfStatement.java:105) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:126) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.internalAnalyseCode(TypeDeclaration.java:737) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.analyseCode(TypeDeclaration.java:261) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:118) at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:776) at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:137) at java.lang.Thread.run(Thread.java:745) General Information: reported-by: OCLstdlibTables.Types._Ed Willink anonymous-id: 4480ddfc-64ed-45bb-a550-d1669a82122a eclipse-build-id: 4.5.0.I20141210-2000 eclipse-product: org.eclipse.sdk.ide operating system: Windows8 6.3.0 (x86_64) - win32 jre-version: 1.7.0_72-b14 The following plug-ins were present on the execution stack (*): 1. org.eclipse.jdt_3.11.0.v20141210-2000 Please note that: * Messages, stacktraces, and nested status objects may be shortened. * Bug fields like status, resolution, and whiteboard are sent back to reporters. * The list of present bundles and their respective versions was calculated by package naming heuristics. This may or may not reflect reality. Please visit http://goo.gl/MWFSff for further details. Thank you for your assistance. Your friendly error-reports-inbox.