/** * This method is here for use by the SABER validator's reporter instance ONLY. Do not use. See * defect 260144 for details. */ public static IMarker setPriority(IMarker item, int priority) throws CoreException { Map attrib = item.getAttributes(); attrib.put(IMarker.PRIORITY, new Integer(priority)); item.setAttributes(attrib); return item; }
void backupMarkers() { if (fResource != null) fModificationStamp= fResource.getModificationStamp(); List markers= getMarkers(); fAttributes= new ArrayList(markers.size()); Iterator iter= markers.iterator(); while (iter.hasNext()) { IMarker marker= (IMarker)iter.next(); Map attributes= null; try { attributes= marker.getAttributes(); } catch (CoreException ex) { // don't backup corrupt marker continue; } fAttributes.add(attributes); } }
void backupMarkers() { if (fResource != null) fModificationStamp= fResource.getModificationStamp(); List<IMarker> markers= getMarkers(); fAttributes= new ArrayList<>(markers.size()); Iterator<IMarker> iter= markers.iterator(); while (iter.hasNext()) { IMarker marker= iter.next(); Map<String, Object> attributes= null; try { attributes= marker.getAttributes(); } catch (CoreException ex) { // don't backup corrupt marker continue; } fAttributes.add(attributes); } }
/** * Create a marker description from the specified marker. * * @param marker the marker to be described * @throws CoreException */ public MarkerDescription(IMarker marker) throws CoreException { this.type = marker.getType(); this.attributes = marker.getAttributes(); this.resource = marker.getResource(); }
/** * * Create a {@link MarkerUndoState} from the specified marker. * * @param marker * the marker to be described * @throws CoreException if the marker is invalid */ public MarkerUndoState(IMarker marker) throws CoreException { this.type = marker.getType(); this.attributes = marker.getAttributes(); this.resource = marker.getResource(); }
/** * * Create a {@link MarkerUndoState} from the specified marker. * * @param marker * the marker to be described * @throws CoreException if the marker is invalid */ public MarkerUndoState(IMarker marker) throws CoreException { this.type = marker.getType(); this.attributes = marker.getAttributes(); this.resource = marker.getResource(); }
/** * * Create a marker description from the specified marker. * * @param marker * the marker to be described * @throws CoreException */ public MarkerDescription(IMarker marker) throws CoreException { this.type = marker.getType(); this.attributes = marker.getAttributes(); this.resource = marker.getResource(); }
for (int i = 0; i < markers.length; i++) { if (mergeAttributes) { Map oldAttributes = markers[i].getAttributes(); int increment = markerWork / attributes[i].size(); Map replacedAttributes = new HashMap(); } else { Map oldAttributes = markers[i].getAttributes(); markers[i].setAttributes(attributes[i]); attributes[i] = oldAttributes;
private void removeUncheckedBreakpoints(IBreakpoint[] importedBreakpoints) { IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager(); for(int i = 0; i < importedBreakpoints.length; i++) { boolean selected = false; for(int j = 0; j < selectedMarkers.size(); j++) { try { Map<String, Object> importedMarkerAttributes = importedBreakpoints[i].getMarker().getAttributes(); Map<String, Object> selectedMarkerAttributes = selectedMarkers.get(j).getAttributes(); if(importedMarkerAttributes.equals(selectedMarkerAttributes)) { selected = true; break; } } catch (CoreException e) { DebugPlugin.log(e); } } if(!selected) { try { manager.removeBreakpoint(importedBreakpoints[i], true); } catch (CoreException e) { DebugPlugin.log(e); } } } } });
resource = marker.getResource(); try { initialAttributes = marker.getAttributes(); } catch (CoreException e) {
newMarkerAttributes.add(markerData[i].getAttributes());
/** * After tracking issue from server, only a few attributes need to be updated: * - severity (may be changed on server side) * - server issue key * - creation date */ private static void updateServerMarkerAttributes(Trackable trackable, IMarker marker) throws CoreException { Map<String, Object> existingAttributes = marker.getAttributes(); setMarkerAttributeIfDifferent(marker, existingAttributes, IMarker.PRIORITY, getPriority(trackable.getSeverity())); setMarkerAttributeIfDifferent(marker, existingAttributes, MarkerUtils.SONAR_MARKER_ISSUE_SEVERITY_ATTR, trackable.getSeverity()); setMarkerAttributeIfDifferent(marker, existingAttributes, MarkerUtils.SONAR_MARKER_ISSUE_TYPE_ATTR, trackable.getType()); setMarkerAttributeIfDifferent(marker, existingAttributes, MarkerUtils.SONAR_MARKER_SERVER_ISSUE_KEY_ATTR, trackable.getServerIssueKey()); Long creationDate = trackable.getCreationDate(); setMarkerAttributeIfDifferent(marker, existingAttributes, MarkerUtils.SONAR_MARKER_CREATION_DATE_ATTR, creationDate != null ? String.valueOf(creationDate.longValue()) : null); }
newMarkerAttributes.add(markerData[i].getAttributes());
Map<String, Object> attrs; try { attrs = marker.getAttributes(); } catch (CoreException e) { attrs = new HashMap<>();
String value = null; boolean wsattrib = false; for (Entry<String, Object> entry : marker.getAttributes().entrySet()) { String iterval = entry.getKey(); value = entry.getValue().toString();
System.out.println("ApiAnalysisBuilder: Created the marker: " + marker.getId() + " - " + marker.getAttributes().entrySet()); //$NON-NLS-1$ //$NON-NLS-2$
private static void updateMarkerAttributes(IDocument document, Trackable trackable, IMarker marker, boolean createExtraLocations) throws CoreException { Map<String, Object> existingAttributes = marker.getAttributes(); setMarkerAttributeIfDifferent(marker, existingAttributes, MarkerUtils.SONAR_MARKER_RULE_KEY_ATTR, trackable.getRuleKey()); setMarkerAttributeIfDifferent(marker, existingAttributes, MarkerUtils.SONAR_MARKER_RULE_NAME_ATTR, trackable.getRuleName()); setMarkerAttributeIfDifferent(marker, existingAttributes, IMarker.SEVERITY, PreferencesUtils.getMarkerSeverity()); setMarkerAttributeIfDifferent(marker, existingAttributes, IMarker.MESSAGE, trackable.getMessage()); // File level issues (line == null) are displayed on line 1 setMarkerAttributeIfDifferent(marker, existingAttributes, IMarker.LINE_NUMBER, trackable.getLine() != null ? trackable.getLine() : 1); Position position = MarkerUtils.getPosition(document, trackable.getTextRange()); if (position != null) { setMarkerAttributeIfDifferent(marker, existingAttributes, IMarker.CHAR_START, position.getOffset()); setMarkerAttributeIfDifferent(marker, existingAttributes, IMarker.CHAR_END, position.getOffset() + position.getLength()); } boolean hasExtraLocation = false; if (createExtraLocations) { hasExtraLocation = createExtraLocations(document, trackable, marker); } setMarkerAttributeIfDifferent(marker, existingAttributes, MarkerUtils.SONAR_MARKER_HAS_EXTRA_LOCATION_KEY_ATTR, hasExtraLocation); updateServerMarkerAttributes(trackable, marker); }