Community
Participate
Working Groups
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=419829#c7 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=419829#c18 for details. Please pass it back if JDT/Core has a hand somewhere. It would be nice to have a fix soon, as this hits me fairly frequently as I often switch back and forth between project settings to study behavior in different levels.
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.
This smells like bug 65267.
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.