Skip to content

Commit 7b41d8a

Browse files
EcljpseB0Tjukzi
authored andcommitted
ant: remove wrong @SuppressWarnings("unused")
1 parent fda6401 commit 7b41d8a

File tree

7 files changed

+5
-30
lines changed

7 files changed

+5
-30
lines changed

ant/org.eclipse.ant.launching/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
33
Bundle-Localization: plugin
44
Bundle-Name: %pluginName
55
Bundle-SymbolicName: org.eclipse.ant.launching;singleton:=true
6-
Bundle-Version: 1.4.400.qualifier
6+
Bundle-Version: 1.4.500.qualifier
77
Bundle-Activator: org.eclipse.ant.internal.launching.AntLaunching
88
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
99
org.eclipse.debug.core;bundle-version="[3.12.0,4.0.0)",

ant/org.eclipse.ant.launching/common/org/eclipse/ant/internal/launching/debug/AntDebugState.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import java.util.HashMap;
1818
import java.util.Hashtable;
19-
import java.util.Iterator;
2019
import java.util.Map;
2120
import java.util.Stack;
2221
import java.util.Vector;
@@ -35,9 +34,7 @@ public class AntDebugState {
3534
private static final String fgAntCallTaskName = "antcall"; //$NON-NLS-1$
3635

3736
private final IDebugBuildLogger fLogger;
38-
@SuppressWarnings("unused")
3937
private final Stack<Task> fTasks = new Stack<>();
40-
@SuppressWarnings("unused")
4138
private final Map<Task, Object> fTaskToProxies = new HashMap<>();
4239
private Task fCurrentTask;
4340
private Task fStepOverTask;
@@ -50,9 +47,7 @@ public class AntDebugState {
5047

5148
private Map<Project, Vector<?>> fProjectToTargetNames = null;
5249
private Map<Project, Map<Target, Vector<Target>>> fProjectToMapOfTargetToBuildSequence = null;
53-
@SuppressWarnings("unused")
5450
private final Stack<Target> fTargetsToExecute = new Stack<>();
55-
@SuppressWarnings("unused")
5651
private final Stack<Target> fTargetsExecuting = new Stack<>();
5752

5853
private boolean fConsiderTargetBreakpoints = false;
@@ -65,7 +60,6 @@ public AntDebugState(IDebugBuildLogger logger) {
6560
fLogger = logger;
6661
}
6762

68-
@SuppressWarnings("unused")
6963
public void buildStarted() {
7064
fProjectToTargetNames = new HashMap<>();
7165
fProjectToMapOfTargetToBuildSequence = new HashMap<>();
@@ -306,7 +300,6 @@ public void targetStarted(BuildEvent event) {
306300
Object ref = eventProject.getReference(IAntCoreConstants.TARGET_VECTOR_NAME);
307301
if (ref != null) {
308302
fProjectToTargetNames.put(eventProject, (Vector<?>) ref);
309-
@SuppressWarnings("unused")
310303
HashMap<Target, Vector<Target>> targetToBuildSequence = new HashMap<>();
311304
setTargetToExecute(initializeBuildSequenceInformation(event, targetToBuildSequence));
312305
fProjectToMapOfTargetToBuildSequence.put(eventProject, targetToBuildSequence);
@@ -429,9 +422,7 @@ public void marshalStack(StringBuffer stackRepresentation) {
429422
// sub build target dependencies
430423
String targetName = task.getOwningTarget().getName();
431424
if (targetName != null && targetName.length() != 0) { // skip for implicit target
432-
Iterator<Target> itr = fTargetsToExecute.iterator();
433-
while (itr.hasNext()) {
434-
Target target = itr.next();
425+
for (Target target : fTargetsToExecute) {
435426
if (target.getProject() != projectExecuting) {
436427
targetToExecute = target;
437428
continue;

ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/EclipseDefaultExecutor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public class EclipseDefaultExecutor extends DefaultExecutor {
2525

2626
private static final EclipseSingleCheckExecutor SUB_EXECUTOR = new EclipseSingleCheckExecutor();
2727

28-
@SuppressWarnings("unused")
2928
@Override
3029
public void executeTargets(Project project, String[] targetNames) throws BuildException {
3130
Vector<String> v = new Vector<>();

ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/EclipseSingleCheckExecutor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
public class EclipseSingleCheckExecutor extends SingleCheckExecutor {
2525

26-
@SuppressWarnings("unused")
2726
@Override
2827
public void executeTargets(Project project, String[] targetNames) throws BuildException {
2928
Vector<String> v = new Vector<>();

ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/InternalAntRunner.java

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import java.util.Collections;
2727
import java.util.Enumeration;
2828
import java.util.HashMap;
29-
import java.util.Iterator;
3029
import java.util.List;
3130
import java.util.Map;
3231
import java.util.Map.Entry;
@@ -114,7 +113,6 @@ public class InternalAntRunner {
114113

115114
private boolean scriptExecuted = false;
116115

117-
@SuppressWarnings("unused")
118116
private final List<String> propertyFiles = new ArrayList<>();
119117

120118
/**
@@ -152,7 +150,6 @@ public static void main(String[] args) {
152150
/*
153151
* Helper method to ensure an array is converted into an ArrayList.
154152
*/
155-
@SuppressWarnings("unused")
156153
static ArrayList<String> getArrayList(String[] args) {
157154
if (args == null) {
158155
return null;
@@ -248,7 +245,6 @@ private void printArguments(Project project) {
248245
* @param project
249246
* the project to list targets from
250247
*/
251-
@SuppressWarnings("unused")
252248
private void printTargets(Project project) {
253249
// notify the logger that project help message are coming
254250
// since there is no buildstarted or targetstarted to
@@ -618,9 +614,7 @@ private void fireBuildFinished(Project project, Throwable error) {
618614
if (!isVersionCompatible("1.5")) { //$NON-NLS-1$
619615
BuildEvent event = new BuildEvent(project);
620616
event.setException(error);
621-
Iterator<BuildListener> iter = project.getBuildListeners().iterator();
622-
while (iter.hasNext()) {
623-
BuildListener listener = iter.next();
617+
for (BuildListener listener : project.getBuildListeners()) {
624618
listener.buildFinished(event);
625619
}
626620
} else {
@@ -790,7 +784,6 @@ private int parseInt(String value, String version) {
790784
}
791785
}
792786

793-
@SuppressWarnings("unused")
794787
private boolean preprocessCommandLine(List<String> commands) {
795788

796789
String arg = getArgument(commands, "-listener"); //$NON-NLS-1$
@@ -953,7 +946,6 @@ private boolean processCommandLine(List<String> commands) {
953946
return true;
954947
}
955948

956-
@SuppressWarnings("unused")
957949
private void processTasksAndTypes(List<String> commands) {
958950
String arg = getArgument(commands, "-eclipseTask"); //$NON-NLS-1$
959951
while (arg != null) {
@@ -1019,7 +1011,6 @@ private void processUnrecognizedCommands(List<String> commands) {
10191011
/*
10201012
* Checks for targets specified at the command line.
10211013
*/
1022-
@SuppressWarnings("unused")
10231014
private void processTargets(List<String> commands) {
10241015
if (targets == null) {
10251016
targets = new Vector<>(commands.size());
@@ -1095,11 +1086,9 @@ private boolean processProperties(List<String> commands) {
10951086
return exceptionToBeThrown;
10961087
}
10971088

1098-
@SuppressWarnings("unused")
10991089
private void processMinusDProperties(List<String> commands) {
11001090
String[] args = commands.toArray(new String[commands.size()]);
1101-
for (int i = 0; i < args.length; i++) {
1102-
String arg = args[i];
1091+
for (String arg : args) {
11031092
if (arg.startsWith("-D")) { //$NON-NLS-1$
11041093
String name = arg.substring(2, arg.length());
11051094
String value = null;
@@ -1120,7 +1109,7 @@ private void processMinusDProperties(List<String> commands) {
11201109
userProperties = new HashMap<>();
11211110
}
11221111
userProperties.put(name, value);
1123-
commands.remove(args[i]);
1112+
commands.remove(arg);
11241113
}
11251114
}
11261115
}
@@ -1283,7 +1272,6 @@ private void setCurrentProject(Project currentProject) {
12831272
/**
12841273
* Load all properties from the files specified by -propertyfile.
12851274
*/
1286-
@SuppressWarnings("unused")
12871275
private void loadPropertyFiles() {
12881276
for (String filename : propertyFiles) {
12891277
File file = getFileRelativeToBaseDir(filename);

ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntBuildLogger.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ protected void establishConnection() {
236236
}
237237
}
238238

239-
@SuppressWarnings("unused")
240239
@Override
241240
public void messageLogged(BuildEvent event) {
242241
if (event.getPriority() > msgOutputLevel && event.getPriority() != InternalAntRunner.MSG_PROJECT_HELP) {

ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntDebugBuildLogger.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ protected void marshallProperties() {
332332
sendRequestResponse(propertiesRepresentation.toString());
333333
}
334334

335-
@SuppressWarnings("unused")
336335
protected void addBreakpoint(String breakpointRepresentation) {
337336
if (fBreakpoints == null) {
338337
fBreakpoints = new ArrayList<>();

0 commit comments

Comments
 (0)