Skip to content

Commit 38fd300

Browse files
committed
2 parents cd61b40 + bfe67d8 commit 38fd300

File tree

1,465 files changed

+72492
-10359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,465 files changed

+72492
-10359
lines changed

ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntCorePreferences.java

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2018 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -607,9 +607,7 @@ private void addURLToExtraClasspathEntries(URL url, IConfigurationElement elemen
607607
if (eclipseRuntime != null) {
608608
eclipseRuntimeRequired = Boolean.parseBoolean(eclipseRuntime);
609609
}
610-
Iterator<AntClasspathEntry> itr = extraClasspathURLs.iterator();
611-
while (itr.hasNext()) {
612-
IAntClasspathEntry entry = itr.next();
610+
for (IAntClasspathEntry entry : extraClasspathURLs) {
613611
if (entry.getEntryURL().equals(url)) {
614612
return;
615613
}
@@ -689,8 +687,7 @@ private boolean configureAntObject(IConfigurationElement element, AntObject antO
689687

690688
String library = element.getAttribute(AntCorePlugin.LIBRARY);
691689
if (library == null) {
692-
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_Library_not_specified_for___0__4, new String[] {
693-
objectName }), null);
690+
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_Library_not_specified_for___0__4, objectName), null);
694691
AntCorePlugin.getPlugin().getLog().log(status);
695692
return false;
696693
}
@@ -708,8 +705,7 @@ private boolean configureAntObject(IConfigurationElement element, AntObject antO
708705
}
709706

710707
// type specifies a library that does not exist
711-
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(errorMessage, new String[] {
712-
library, element.getContributor().getName() }), null);
708+
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(errorMessage, library, element.getContributor().getName()), null);
713709
AntCorePlugin.getPlugin().getLog().log(status);
714710
return false;
715711
}
@@ -720,8 +716,7 @@ private boolean configureAntObject(IConfigurationElement element, AntObject antO
720716
}
721717
catch (Exception e) {
722718
// likely extra classpath entry library that does not exist
723-
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_8, new String[] {
724-
library, element.getContributor().getName() }), null);
719+
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_8, library, element.getContributor().getName()), null);
725720
AntCorePlugin.getPlugin().getLog().log(status);
726721
}
727722
return false;
@@ -744,8 +739,7 @@ protected void computeDefaultExtraClasspathEntries(List<IConfigurationElement> e
744739
addPluginClassLoader(bundle);
745740
} else {
746741
// extra classpath entry that does not exist
747-
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_6, new String[] {
748-
library, element.getContributor().getName() }), null);
742+
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_6, library, element.getContributor().getName()), null);
749743
AntCorePlugin.getPlugin().getLog().log(status);
750744
continue;
751745
}
@@ -758,8 +752,7 @@ protected void computeDefaultExtraClasspathEntries(List<IConfigurationElement> e
758752
}
759753
catch (Exception e) {
760754
// likely extra classpath entry that does not exist
761-
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_6, new String[] {
762-
library, element.getContributor().getName() }), null);
755+
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_6, library, element.getContributor().getName()), null);
763756
AntCorePlugin.getPlugin().getLog().log(status);
764757
continue;
765758
}
@@ -1069,11 +1062,9 @@ private void addEntryURLs(List<URL> result, IAntClasspathEntry[] entries) {
10691062

10701063
protected ClassLoader[] getPluginClassLoaders() {
10711064
if (orderedPluginClassLoaders == null) {
1072-
Iterator<WrappedClassLoader> classLoaders = pluginClassLoaders.iterator();
10731065
Map<String, WrappedClassLoader> idToLoader = new HashMap<>(pluginClassLoaders.size());
10741066
List<BundleRevision> bundles = new ArrayList<>(pluginClassLoaders.size());
1075-
while (classLoaders.hasNext()) {
1076-
WrappedClassLoader loader = classLoaders.next();
1067+
for (WrappedClassLoader loader : pluginClassLoaders) {
10771068
idToLoader.put(loader.bundle.getSymbolicName(), loader);
10781069
BundleRevision revision = loader.bundle.adapt(BundleRevision.class);
10791070
if (revision != null) {
@@ -1134,8 +1125,7 @@ private List<BundleRevision> computePrerequisiteOrder(List<BundleRevision> plugi
11341125
prereqs.add(new Relation(currentFrag, hostWires.get(0).getProvider()));
11351126
}
11361127
} else {
1137-
AntCorePlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_MALFORMED_URL, NLS.bind(InternalCoreAntMessages.AntCorePreferences_1, new String[] {
1138-
currentFrag.getSymbolicName() }), null));
1128+
AntCorePlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_MALFORMED_URL, NLS.bind(InternalCoreAntMessages.AntCorePreferences_1, currentFrag.getSymbolicName()), null));
11391129
}
11401130
}
11411131

@@ -1289,9 +1279,7 @@ public List<Task> getTasks() {
12891279
public List<Task> getRemoteTasks() {
12901280
List<Task> result = new ArrayList<>(10);
12911281
if (defaultTasks != null && !defaultTasks.isEmpty()) {
1292-
Iterator<Task> iter = defaultTasks.iterator();
1293-
while (iter.hasNext()) {
1294-
Task task = iter.next();
1282+
for (Task task : defaultTasks) {
12951283
if (!task.isEclipseRuntimeRequired()) {
12961284
result.add(task);
12971285
}
@@ -1356,9 +1344,7 @@ public List<Property> getProperties() {
13561344
public List<Property> getRemoteAntProperties() {
13571345
List<Property> result = new ArrayList<>(10);
13581346
if (defaultProperties != null && !defaultProperties.isEmpty()) {
1359-
Iterator<Property> iter = defaultProperties.iterator();
1360-
while (iter.hasNext()) {
1361-
Property property = iter.next();
1347+
for (Property property : defaultProperties) {
13621348
if (!property.isEclipseRuntimeRequired()) {
13631349
result.add(property);
13641350
}
@@ -1527,9 +1513,7 @@ public List<Type> getTypes() {
15271513
public List<Type> getRemoteTypes() {
15281514
List<Type> result = new ArrayList<>(10);
15291515
if (defaultTypes != null && !defaultTypes.isEmpty()) {
1530-
Iterator<Type> iter = defaultTypes.iterator();
1531-
while (iter.hasNext()) {
1532-
Type type = iter.next();
1516+
for (Type type : defaultTypes) {
15331517
if (!type.isEclipseRuntimeRequired()) {
15341518
result.add(type);
15351519
}

ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntRunner.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,7 @@ private void basicConfigure(Class<?> classInternalAntRunner, Object runner) thro
303303
*/
304304
public void run(IProgressMonitor monitor) throws CoreException {
305305
if (buildRunning) {
306-
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_RUNNING_BUILD, NLS.bind(InternalCoreAntMessages.AntRunner_Already_in_progess, new String[] {
307-
buildFileLocation }), null);
306+
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_RUNNING_BUILD, NLS.bind(InternalCoreAntMessages.AntRunner_Already_in_progess, buildFileLocation), null);
308307
throw new CoreException(status);
309308
}
310309
buildRunning = true;
@@ -450,7 +449,7 @@ protected void problemLoadingClass(Throwable e) throws CoreException {
450449
if (missingClassName != null) {
451450
missingClassName = missingClassName.replace('/', '.');
452451
message = InternalCoreAntMessages.AntRunner_Could_not_find_one_or_more_classes__Please_check_the_Ant_classpath__2;
453-
message = NLS.bind(message, new String[] { missingClassName });
452+
message = NLS.bind(message, missingClassName);
454453
} else {
455454
message = InternalCoreAntMessages.AntRunner_Could_not_find_one_or_more_classes__Please_check_the_Ant_classpath__1;
456455
}

ant/org.eclipse.ant.launching/buildfiles/buildCommonDebug.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<property name="destdir" value="${temp.folder}/lib/antdebug.jar.bin"/>
3131
<delete dir="${destdir}"/>
3232
<mkdir dir="${destdir}"/>
33-
<javac source="11" target="11" destdir="${destdir}" failonerror="true" verbose="false" debug="on" includeAntRuntime="yes"
33+
<javac release="17" destdir="${destdir}" failonerror="true" verbose="false" debug="on" includeAntRuntime="yes"
3434
classpath="${basedir}/bin">
3535
<src path="${basedir}/common"/>
3636
<compilerarg value="-Xlint"/>

ant/org.eclipse.ant.launching/buildfiles/buildRemote.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<property name="destdir" value="${temp.folder}/lib/remote.jar.bin"/>
3131
<delete dir="${destdir}"/>
3232
<mkdir dir="${destdir}"/>
33-
<javac release="11" destdir="${destdir}" failonerror="true" verbose="false" debug="on" includeAntRuntime="yes"
33+
<javac release="17" destdir="${destdir}" failonerror="true" verbose="false" debug="on" includeAntRuntime="yes"
3434
classpath="${basedir}/bin">
3535
<src path="${basedir}/remote"/>
3636
<compilerarg value="-Xlint"/>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ protected void setInputHandler(Project project, String inputHandlerClassname) {
3535
handler = (InputHandler) (Class.forName(inputHandlerClassname).getConstructor().newInstance());
3636
}
3737
catch (ClassCastException e) {
38-
String msg = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.The_specified_input_handler_class_{0}_does_not_implement_the_org.apache.tools.ant.input.InputHandler_interface_5"), inputHandlerClassname);
38+
String msg = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.The_specified_input_handler_class_{0}_does_not_implement_the_org.apache.tools.ant.input.InputHandler_interface_5"), inputHandlerClassname); //$NON-NLS-1$
3939
throw new BuildException(msg, e);
4040
}
4141
catch (Exception e) {
42-
String msg = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Unable_to_instantiate_specified_input_handler_class_{0}___{1}_6"), inputHandlerClassname, e.getClass().getName());
42+
String msg = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Unable_to_instantiate_specified_input_handler_class_{0}___{1}_6"), inputHandlerClassname, e.getClass().getName()); //$NON-NLS-1$
4343
throw new BuildException(msg, e);
4444
}
4545
}

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private void addBuildListeners(Project project) {
192192
}
193193
}
194194
catch (ClassCastException e) {
195-
String message = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.{0}_which_was_specified_to_be_a_build_listener_is_not_an_instance_of_org.apache.tools.ant.BuildListener._1"), clazz);
195+
String message = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.{0}_which_was_specified_to_be_a_build_listener_is_not_an_instance_of_org.apache.tools.ant.BuildListener._1"), clazz); //$NON-NLS-1$
196196
logMessage(null, message, Project.MSG_ERR);
197197
throw new BuildException(message, e);
198198
}
@@ -432,7 +432,7 @@ private void run(List<String> argList) {
432432
}
433433
}
434434

435-
getCurrentProject().log(MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Build_file__{0}_1"), getBuildFileLocation()));
435+
getCurrentProject().log(MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Build_file__{0}_1"), getBuildFileLocation())); //$NON-NLS-1$
436436

437437
setTasks();
438438
setTypes();
@@ -579,12 +579,12 @@ private BuildLogger createLogger() {
579579
buildLogger = (BuildLogger) (Class.forName(loggerClassname).getConstructor().newInstance());
580580
}
581581
catch (ClassCastException e) {
582-
String message = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.{0}_which_was_specified_to_perform_logging_is_not_an_instance_of_org.apache.tools.ant.BuildLogger._2"), loggerClassname);
582+
String message = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.{0}_which_was_specified_to_perform_logging_is_not_an_instance_of_org.apache.tools.ant.BuildLogger._2"), loggerClassname); //$NON-NLS-1$
583583
logMessage(null, message, Project.MSG_ERR);
584584
throw new BuildException(message, e);
585585
}
586586
catch (Exception e) {
587-
String message = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Unable_to_instantiate_logger__{0}_6"), loggerClassname);
587+
String message = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Unable_to_instantiate_logger__{0}_6"), loggerClassname); //$NON-NLS-1$
588588
logMessage(null, message, Project.MSG_ERR);
589589
throw new BuildException(message, e);
590590
}
@@ -684,7 +684,7 @@ private String getAntVersionNumber() throws BuildException {
684684
antVersionNumber = versionNumber;
685685
}
686686
catch (IOException ioe) {
687-
throw new BuildException(MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Could_not_load_the_version_information._{0}_9"), ioe.getMessage()), ioe);
687+
throw new BuildException(MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Could_not_load_the_version_information._{0}_9"), ioe.getMessage()), ioe); //$NON-NLS-1$
688688
}
689689
catch (NullPointerException npe) {
690690
throw new BuildException(RemoteAntMessages.getString("InternalAntRunner.Could_not_load_the_version_information._10"), npe); //$NON-NLS-1$
@@ -895,7 +895,7 @@ private boolean processCommandLine(List<String> commands) {
895895
}
896896
catch (IOException e) {
897897
// just log message and ignore exception
898-
logMessage(getCurrentProject(), MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Could_not_write_to_the_specified_log_file__{0}._Make_sure_the_path_exists_and_you_have_write_permissions._2"), arg), Project.MSG_ERR);
898+
logMessage(getCurrentProject(), MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Could_not_write_to_the_specified_log_file__{0}._Make_sure_the_path_exists_and_you_have_write_permissions._2"), arg), Project.MSG_ERR); //$NON-NLS-1$
899899
return false;
900900
}
901901

@@ -1011,7 +1011,7 @@ private void processUnrecognizedCommands(List<String> commands) {
10111011
}
10121012

10131013
// warn of ignored commands
1014-
String message = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Unknown_argument__{0}_2"), s.substring(1));
1014+
String message = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Unknown_argument__{0}_2"), s.substring(1)); //$NON-NLS-1$
10151015
logMessage(currentProject, message, Project.MSG_WARN);
10161016
}
10171017

@@ -1037,7 +1037,7 @@ private void createLogFile(String fileName) throws FileNotFoundException, IOExce
10371037
// this stream is closed in the finally block of run(list)
10381038
out = new PrintStream(new FileOutputStream(logFile));
10391039
err = out;
1040-
logMessage(getCurrentProject(), MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Using_{0}_file_as_build_log._1"), logFile.getCanonicalPath()), Project.MSG_INFO);
1040+
logMessage(getCurrentProject(), MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Using_{0}_file_as_build_log._1"), logFile.getCanonicalPath()), Project.MSG_INFO); //$NON-NLS-1$
10411041
if (buildLogger != null) {
10421042
buildLogger.setErrorPrintStream(err);
10431043
buildLogger.setOutputPrintStream(out);
@@ -1287,7 +1287,7 @@ private void loadPropertyFiles() {
12871287
props.load(fis);
12881288
}
12891289
catch (IOException e) {
1290-
fEarlyErrorMessage = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Could_not_load_property_file_{0}__{1}_4"), filename, e.getMessage());
1290+
fEarlyErrorMessage = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Could_not_load_property_file_{0}__{1}_4"), filename, e.getMessage()); //$NON-NLS-1$
12911291
}
12921292
if (userProperties == null) {
12931293
userProperties = new HashMap<>();

ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUIImages.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ private static void declareImages() {
9292
declareRegistryImage(IAntUIConstants.IMG_ANT_IMPORT, OBJECT + "import_obj.svg"); //$NON-NLS-1$
9393
declareRegistryImage(IAntUIConstants.IMG_ANT_ECLIPSE_RUNTIME_OBJECT, OBJECT + "eclipse16.svg"); //$NON-NLS-1$
9494

95-
declareRegistryImage(IAntUIConstants.IMG_WIZARD_BANNER, WIZ + "ant_wiz.png"); //$NON-NLS-1$
96-
declareRegistryImage(IAntUIConstants.IMG_EXPORT_WIZARD_BANNER, WIZ + "export_ant_wiz.png"); //$NON-NLS-1$
95+
declareRegistryImage(IAntUIConstants.IMG_WIZARD_BANNER, WIZ + "ant_wiz.svg"); //$NON-NLS-1$
96+
declareRegistryImage(IAntUIConstants.IMG_EXPORT_WIZARD_BANNER, WIZ + "export_ant_wiz.svg"); //$NON-NLS-1$
9797
declareRegistryImage(IAntUIConstants.IMG_TAB_ANT_TARGETS, LOCALTOOL + "ant_targets.svg"); //$NON-NLS-1$
9898

9999
// Overlays

ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntElementNode.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,10 @@ public boolean equals(Object o2) {
357357
if (!(o1 instanceof AntElementNode || o2 instanceof AntElementNode)) {
358358
return o2.equals(o1);
359359
}
360-
if (!(o1 instanceof AntElementNode e1 && o2 instanceof AntElementNode)) {
360+
if (!(o1 instanceof AntElementNode e1 && o2 instanceof AntElementNode e2)) {
361361
return false;
362362
}
363363

364-
AntElementNode e2 = (AntElementNode) o2;
365-
366364
return e1.getElementPath().equals(e2.getElementPath());
367365
}
368366

ant/org.eclipse.ant.ui/buildfiles/buildRemoteExtraJAR.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
<property name="destdir" value="${temp.folder}/lib/remoteAnt.jar.bin"/>
3131
<delete dir="${destdir}"/>
3232
<mkdir dir="${destdir}"/>
33-
<javac source="11" target="11" destdir="${destdir}" failonerror="true" verbose="false" debug="on" includeAntRuntime="yes">
33+
<javac release="17" destdir="${destdir}" failonerror="true" verbose="false" debug="on" includeAntRuntime="yes">
3434
<src path="${basedir}/Remote Ant Support"/>
3535
<compilerarg value="-Xlint"/>
3636
<classpath>
3737
<dirset dir="${basedir}/..">
3838
<include name="org.eclipse.ant.launching/common_bin"/>
3939
</dirset>
4040
<dirset dir="${basedir}/../../..">
41-
<include name="eclipse.platform.swt/bundles/org.eclipse.swt/bin"/>
41+
<include name="eclipse.platform.swt/binaries/org.eclipse.swt*/bin"/>
4242
</dirset>
4343

4444
<fileset dir="${eclipse.home}">

0 commit comments

Comments
 (0)