Bug 564315 - Upgrading to eclipse-jdt-annotations-2.2.4 broke incremental compilation
Summary: Upgrading to eclipse-jdt-annotations-2.2.4 broke incremental compilation
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.13   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2020-06-16 02:14 EDT by Matthew Daggitt CLA
Modified: 2022-07-03 14:24 EDT (History)
3 users (show)

See Also:


Attachments
Stack trace for NPE when disabling null analysis (1.96 KB, text/plain)
2020-06-16 02:47 EDT, Matthew Daggitt CLA
no flags Details
Stack trace for NPE when disabling null analysis in 4.16 (1.80 KB, application/octet-stream)
2020-06-22 01:27 EDT, Matthew Daggitt CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Daggitt CLA 2020-06-16 02:14:59 EDT
We've recently upgraded our Java null annotations from "eclipse-jdt-annotations-1.1.0.jar" (declaration-based) to "eclipse-jdt-annotations-2.2.4.jar" (type-based).

Previously Eclipse's incremental compilation worked well for our projects containing over 8000 files, but after the upgrade even small changes trigger a full rebuild of the our code. This includes changes to comments. Switching back to the old annotations resolves the problem. 

We can't tell if disabling the null analysis would help as if we go Window -> Preferences -> Errors/Warnings and uncheck "Enable annotation-based null analysis", then Eclipse throws the following NPE when we then rebuild the project: 

Internal compiler error: java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding.constantPoolName(TypeVariableBinding.java:410)	Graph.java	/Utilities/src/java/com/dugeo/lib/math	line 0	Java Problem

Creating a new workspace and reimporting the projects also does not help.
Comment 1 Andrey Loskutov CLA 2020-06-16 02:25:53 EDT
Please do two things: 
1) Try 4.16 SDK
2) Attach full error stack from error log view.
Comment 2 Matthew Daggitt CLA 2020-06-16 02:47:33 EDT
Created attachment 283294 [details]
Stack trace for NPE when disabling null analysis
Comment 3 Matthew Daggitt CLA 2020-06-16 02:48:34 EDT
Added the full stack trace. The problem still occurs on 4.15 SDK. I'm currently in the process of trying 4.16.
Comment 4 Matthew Daggitt CLA 2020-06-17 01:58:41 EDT
Upgrading to 4.16RC2 seems to have helped but not entirely eliminated the problem. It is now only triggering unnecessary full rebuilds occasionally rather than every time.
Comment 5 Matthew Daggitt CLA 2020-06-17 01:59:12 EDT
Sorry, should have mentioned the NPE still occurs.
Comment 6 Andrey Loskutov CLA 2020-06-17 02:35:35 EDT
(In reply to Matthew Daggitt from comment #5)
> Sorry, should have mentioned the NPE still occurs.

Please attach the stack trace. Ideally you could also try to isolate the smallest possible source that reproduces the problem.
Comment 7 Matthew Daggitt CLA 2020-06-22 01:27:46 EDT
Created attachment 283368 [details]
Stack trace for NPE when disabling null analysis in 4.16
Comment 8 Matthew Daggitt CLA 2020-06-22 01:30:38 EDT
I've added the stack trace for 4.16.

Apologies, I'm having difficulty isolating it. Once I start removing projects and source files it appears to become non-deterministic. Sometimes I remove one of our projects and it disappears, but then when I revert the state and remove the project again it still persists.

One thing that might be a little unusual about our setup is that we have 3 projects X, Y, Z (where X is on the build path of Y and Y is on the build path of Z) in which X and Z do not use null annotations but Y does. Unsure if that's relevant.
Comment 9 Eclipse Genie CLA 2022-07-03 14:24:47 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.