1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-05 16:56:04 +02:00

Fixed "Dead code" compiler warning

Change-Id: Idc18751d1bcd59a8fa49529731e11dce354b925a
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
This commit is contained in:
Torbjörn Svensson 2020-08-28 18:24:01 +02:00 committed by Jonah Graham
parent f6016c5e0b
commit 4376632208
2 changed files with 3 additions and 32 deletions

View file

@ -313,24 +313,14 @@ public class ManagedBuildManager extends AbstractCExtension {
e.printStackTrace();
}
// Get the project types for this project and all referenced projects
List<IProjectType> definedTypes = null;
// To Do
// Create the array and copy the elements over
int size = projectTypes != null ? projectTypes.size() : 0;
size += definedTypes != null ? definedTypes.size() : 0;
IProjectType[] types = new IProjectType[size];
if (size > 0) {
int n = 0;
for (int i = 0; i < projectTypes.size(); i++)
types[n++] = projectTypes.get(i);
if (definedTypes != null)
for (int i = 0; i < definedTypes.size(); i++)
types[n++] = definedTypes.get(i);
int n = 0;
for (IProjectType type : projectTypes) {
types[n++] = type;
}
return types;
@ -1951,8 +1941,6 @@ public class ManagedBuildManager extends AbstractCExtension {
// o The major versions are equal, but the remainder of the .cdtbuild version # is
// greater than the MBS version #
boolean compatible = false;
if (version == null)
compatible = false;
if (buildInfoVersion.getMajor() != version.getMajor())
compatible = false;
if (buildInfoVersion.getMinor() > version.getMinor())

View file

@ -25,9 +25,7 @@ import java.util.Map;
import org.eclipse.cdt.debug.core.sourcelookup.AbsolutePathSourceContainer;
import org.eclipse.cdt.debug.core.sourcelookup.ISourceLookupChangeListener;
import org.eclipse.cdt.debug.internal.core.ListenerList;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.core.model.IDebugElement;
import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupParticipant;
import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
@ -77,7 +75,6 @@ public class CSourceLookupParticipant extends AbstractSourceLookupParticipant {
// Workaround for cases when the stack frame doesn't contain the source file name
String name = null;
IBreakpoint breakpoint = null;
if (object instanceof String) {
name = (String) object;
}
@ -96,20 +93,6 @@ public class CSourceLookupParticipant extends AbstractSourceLookupParticipant {
}
}
// Source lookup participant order is preserved where possible except for one case:
// - If we've stopped at a breakpoint the user has made on an IResource, we definitely want to show
// that IResource before others
if (breakpoint != null && breakpoint.getMarker() != null && breakpoint.getMarker().getResource() != null) {
IResource breakpointResource = breakpoint.getMarker().getResource();
for (int i = 0; i < foundElements.length; i++) {
if (foundElements[i].equals(breakpointResource)) {
Object temp = foundElements[0];
foundElements[0] = foundElements[i];
foundElements[i] = temp;
break;
}
}
}
fCachedResults.put(object, foundElements);
return foundElements;
}