Summary: | Rebuild after changes in project settings while editor is dirty results in weird errors. | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Srikanth Sankaran <srikanth_sankaran> | ||||
Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> | ||||
Status: | ASSIGNED --- | QA Contact: | |||||
Severity: | major | ||||||
Priority: | P3 | CC: | daniel_megert, markus.kell.r | ||||
Version: | 4.4 | ||||||
Target Milestone: | --- | ||||||
Hardware: | PC | ||||||
OS: | Windows 7 | ||||||
Whiteboard: | stalebug | ||||||
Attachments: |
|
Description
Srikanth Sankaran
2014-02-23 20:16:50 EST
Noopur, please investigate. I can consistently reproduce the issue mentioned in https://bugs.eclipse.org/bugs/show_bug.cgi?id=419829#c18. The issue exists in Eclipse 3.8.1 also, while changing the project JRE from 1.7 to 1.6 (as per the steps given in bug 419829 comment #18) with the following snippets: --------------------------------------------------------- package com.bug; import java.util.ArrayList; import java.util.List; public class CTest { List<String> l= new ArrayList<>(); } --------------------------------------------------------- package com.bug; import java.util.ArrayList; import java.util.List; public class CTest { void foo() { return ""; } } --------------------------------------------------------- Looks like the rebuild happens on the last saved contents of the file and hence Problem view shows the error from snippet 1. The dirty editor shows error markers at incorrect locations, also showing the errors from old content. Needs more investigation. It could be related to bug 423416 as mentioned by Markus in bug 419829 comment #15. Created attachment 240333 [details]
MarkerDelta after the build
On changing the Project's JRE system library, org.eclipse.core.internal.events.AutoBuildJob.doBuild(IProgressMonitor monitor) is called and the build is performed.
Adding a breakpoint in org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager.resourceChanged(IResourceChangeEvent event) shows that after the above build, the ResourceDelta has MarkerDelta corresponding to the org.eclipse.jdt.core.problem - '<>' operator is not allowed for source level before 1.7 (See attached screenshot).
The above MarkerDelta corresponds to the old contents of the file.
Accordingly, ProblemMarkerManager.runPendingUpdates() notifies the ProblemLabelDecorator and JavaEditorErrorTickUpdater listeners.
ResourceDelta should not contain the MarkerDelta corresponding to the old contents of the file after the build.
Please suggest where should we investigate further.
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. 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. |