1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Bug 254849 - [Problems View] Sort by location sorts lexicographically

This commit is contained in:
Anton Leherbauer 2008-11-11 13:43:23 +00:00
parent edeb6f1af1
commit 172288ff75
3 changed files with 5 additions and 8 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2007 IBM Corporation and others. * Copyright (c) 2004, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -67,7 +67,6 @@ public class SCMarkerGenerator implements IMarkerGenerator {
} }
IMarker marker = problemMarkerInfo.file.createMarker(ICModelMarker.C_MODEL_PROBLEM_MARKER); IMarker marker = problemMarkerInfo.file.createMarker(ICModelMarker.C_MODEL_PROBLEM_MARKER);
marker.setAttribute(IMarker.LOCATION, String.valueOf(problemMarkerInfo.lineNumber));
marker.setAttribute(IMarker.MESSAGE, problemMarkerInfo.description); marker.setAttribute(IMarker.MESSAGE, problemMarkerInfo.description);
marker.setAttribute(IMarker.SEVERITY, mapMarkerSeverity(problemMarkerInfo.severity)); marker.setAttribute(IMarker.SEVERITY, mapMarkerSeverity(problemMarkerInfo.severity));
marker.setAttribute(IMarker.LINE_NUMBER, problemMarkerInfo.lineNumber); marker.setAttribute(IMarker.LINE_NUMBER, problemMarkerInfo.lineNumber);
@ -92,7 +91,7 @@ public class SCMarkerGenerator implements IMarkerGenerator {
try { try {
IMarker[] markers = file.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_ONE); IMarker[] markers = file.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_ONE);
if (markers != null) { if (markers != null) {
List exactMarkers = new ArrayList(); List<IMarker> exactMarkers = new ArrayList<IMarker>();
for (int i = 0; i < markers.length; i++) { for (int i = 0; i < markers.length; i++) {
IMarker marker = markers[i]; IMarker marker = markers[i];
int location = ((Integer) marker.getAttribute(IMarker.LINE_NUMBER)).intValue(); int location = ((Integer) marker.getAttribute(IMarker.LINE_NUMBER)).intValue();
@ -105,7 +104,7 @@ public class SCMarkerGenerator implements IMarkerGenerator {
} }
} }
if (exactMarkers.size() > 0) { if (exactMarkers.size() > 0) {
workspace.deleteMarkers((IMarker[]) exactMarkers.toArray(new IMarker[exactMarkers.size()])); workspace.deleteMarkers(exactMarkers.toArray(new IMarker[exactMarkers.size()]));
} }
} }
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2006 QNX Software Systems and others. * Copyright (c) 2000, 2008 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -63,7 +63,6 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
} }
IMarker marker = markerResource.createMarker(ICModelMarker.C_MODEL_PROBLEM_MARKER); IMarker marker = markerResource.createMarker(ICModelMarker.C_MODEL_PROBLEM_MARKER);
marker.setAttribute(IMarker.LOCATION, String.valueOf(problemMarkerInfo.lineNumber));
marker.setAttribute(IMarker.MESSAGE, problemMarkerInfo.description); marker.setAttribute(IMarker.MESSAGE, problemMarkerInfo.description);
marker.setAttribute(IMarker.SEVERITY, mapMarkerSeverity(problemMarkerInfo.severity)); marker.setAttribute(IMarker.SEVERITY, mapMarkerSeverity(problemMarkerInfo.severity));
marker.setAttribute(IMarker.LINE_NUMBER, problemMarkerInfo.lineNumber); marker.setAttribute(IMarker.LINE_NUMBER, problemMarkerInfo.lineNumber);

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007 Nokia and others. * Copyright (c) 2007, 2008 Nokia and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -162,7 +162,6 @@ public class BreakpointProblems {
} }
IMarker marker = markerResource.createMarker(BREAKPOINT_PROBLEM_MARKER_ID); IMarker marker = markerResource.createMarker(BREAKPOINT_PROBLEM_MARKER_ID);
marker.setAttribute(IMarker.LOCATION, String.valueOf(problemMarkerInfo.lineNumber));
marker.setAttribute(IMarker.MESSAGE, problemMarkerInfo.description); marker.setAttribute(IMarker.MESSAGE, problemMarkerInfo.description);
marker.setAttribute(IMarker.SEVERITY, problemMarkerInfo.severity); marker.setAttribute(IMarker.SEVERITY, problemMarkerInfo.severity);
marker.setAttribute(IMarker.LINE_NUMBER, problemMarkerInfo.lineNumber); marker.setAttribute(IMarker.LINE_NUMBER, problemMarkerInfo.lineNumber);