Bug 571019 - Use atomic marker creation API in
EECompilationParticipant#createProblemMarker
The new marker API from Bug 570914 allows to create markers with
attributes and therefore avoids sending out resource change events for
every attribute change.
Change-Id: Ic9cc4f0b35a5f1204848d6d9b9901ed7d5527134
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EECompilationParticipant.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EECompilationParticipant.java
index 128fa8d..4f7442a 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EECompilationParticipant.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EECompilationParticipant.java
@@ -14,6 +14,7 @@
package org.eclipse.jdt.internal.launching;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -331,17 +332,12 @@
*/
private void createProblemMarker(IJavaProject javaProject, String message, int severity, String problemId, String location) {
try {
- IMarker marker = javaProject.getProject().createMarker(problemId);
- marker.setAttributes(
- new String[] {
- IMarker.MESSAGE,
- IMarker.SEVERITY,
- IMarker.LOCATION },
- new Object[] {
- message,
- Integer.valueOf(severity),
- location
- });
+ Map<String, Object> attributes = new HashMap<>();
+ attributes.put(IMarker.MESSAGE, message);
+ attributes.put(IMarker.SEVERITY, Integer.valueOf(severity));
+ attributes.put(IMarker.LOCATION, location);
+
+ javaProject.getProject().createMarker(problemId, attributes);
} catch (CoreException e) {
return;
}