Skip to content

Commit cc8a717

Browse files
authored
Merge branch 'master' into 1668
2 parents 0d99094 + 1ef11c0 commit cc8a717

File tree

2,979 files changed

+352002
-15786
lines changed

Some content is hidden

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

2,979 files changed

+352002
-15786
lines changed

.github/workflows/doCleanCode.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Perform Code Clean
2+
concurrency:
3+
group: ${{ github.workflow }}-${{ github.ref }}
4+
cancel-in-progress: true
5+
on:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: '0 2 * * *'
9+
10+
jobs:
11+
clean-code:
12+
uses: eclipse-platform/eclipse.platform.releng.aggregator/.github/workflows/cleanCode.yml@master
13+
with:
14+
author: Eclipse Platform Bot <[email protected]>
15+
do-quickfix: false
16+
do-cleanups: true
17+
bundle-folders: ant/*/ debug/*/ resources/bundles/*/ runtime/bundles/*/ team/bundles/*/ ua/*/ update/*/ platform/*/ terminal/bundles/*/
18+
secrets:
19+
token: ${{ secrets.PLATFORM_BOT_PAT }}

.mvn/jvm.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
-XX:+PrintFlagsFinal
2-
-Xmx1500m

Jenkinsfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ pipeline {
1111
maven 'apache-maven-latest'
1212
jdk 'temurin-jdk21-latest'
1313
}
14+
environment {
15+
MAVEN_OPTS = '-Xmx1500m'
16+
}
1417
stages {
1518
stage('Build') {
1619
steps {
@@ -29,12 +32,16 @@ pipeline {
2932
post {
3033
always {
3134
archiveArtifacts artifacts: '.*log,**/target/**/.*log', allowEmptyArchive: true
32-
junit '**/target/surefire-reports/TEST-*.xml'
35+
junit allowEmptyResults: true, testResults: '**/target/surefire-reports/TEST-*.xml'
3336
discoverGitReferenceBuild referenceJob: 'eclipse.platform/master'
34-
recordIssues(publishAllIssues:false, ignoreQualityGate:true,
35-
tool: eclipse(name: 'Compiler and API Tools', pattern: '**/target/compilelogs/*.xml'),
36-
qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]])
37-
recordIssues publishAllIssues:false, tools: [mavenConsole(), javaDoc()]
37+
recordIssues enabledForFailure: true, publishAllIssues:false, ignoreQualityGate:true,
38+
tools: [
39+
eclipse(name: 'Compiler', pattern: '**/target/compilelogs/*.xml'),
40+
javaDoc(),
41+
issues(name: 'API Tools', id: 'apitools', pattern: '**/target/apianalysis/*.xml')
42+
],
43+
qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]]
44+
recordIssues enabledForFailure: true, publishAllIssues:false, tools: [mavenConsole()]
3845
}
3946
}
4047
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.ant.core; singleton:=true
5-
Bundle-Version: 3.7.600.qualifier
5+
Bundle-Version: 3.7.700.qualifier
66
Bundle-Activator: org.eclipse.ant.core.AntCorePlugin
77
Bundle-Vendor: %providerName
88
Bundle-Localization: plugin

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

Lines changed: 18 additions & 32 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
}
@@ -663,8 +661,9 @@ private URL getClasspathEntryURL(Bundle bundle, String library) throws IOExcepti
663661
}
664662
}
665663

666-
if (urlFile == null || !urlFile.exists())
664+
if (urlFile == null || !urlFile.exists()) {
667665
return null;
666+
}
668667

669668
String path = urlFile.getAbsolutePath();
670669
return new URL(IAntCoreConstants.FILE_PROTOCOL + (urlFile.isDirectory() ? path + "/" : path)); //$NON-NLS-1$
@@ -688,8 +687,7 @@ private boolean configureAntObject(IConfigurationElement element, AntObject antO
688687

689688
String library = element.getAttribute(AntCorePlugin.LIBRARY);
690689
if (library == null) {
691-
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[] {
692-
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);
693691
AntCorePlugin.getPlugin().getLog().log(status);
694692
return false;
695693
}
@@ -707,8 +705,7 @@ private boolean configureAntObject(IConfigurationElement element, AntObject antO
707705
}
708706

709707
// type specifies a library that does not exist
710-
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(errorMessage, new String[] {
711-
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);
712709
AntCorePlugin.getPlugin().getLog().log(status);
713710
return false;
714711
}
@@ -719,8 +716,7 @@ private boolean configureAntObject(IConfigurationElement element, AntObject antO
719716
}
720717
catch (Exception e) {
721718
// likely extra classpath entry library that does not exist
722-
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_8, new String[] {
723-
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);
724720
AntCorePlugin.getPlugin().getLog().log(status);
725721
}
726722
return false;
@@ -743,8 +739,7 @@ protected void computeDefaultExtraClasspathEntries(List<IConfigurationElement> e
743739
addPluginClassLoader(bundle);
744740
} else {
745741
// extra classpath entry that does not exist
746-
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_6, new String[] {
747-
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);
748743
AntCorePlugin.getPlugin().getLog().log(status);
749744
continue;
750745
}
@@ -757,8 +752,7 @@ protected void computeDefaultExtraClasspathEntries(List<IConfigurationElement> e
757752
}
758753
catch (Exception e) {
759754
// likely extra classpath entry that does not exist
760-
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_6, new String[] {
761-
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);
762756
AntCorePlugin.getPlugin().getLog().log(status);
763757
continue;
764758
}
@@ -1068,11 +1062,9 @@ private void addEntryURLs(List<URL> result, IAntClasspathEntry[] entries) {
10681062

10691063
protected ClassLoader[] getPluginClassLoaders() {
10701064
if (orderedPluginClassLoaders == null) {
1071-
Iterator<WrappedClassLoader> classLoaders = pluginClassLoaders.iterator();
10721065
Map<String, WrappedClassLoader> idToLoader = new HashMap<>(pluginClassLoaders.size());
10731066
List<BundleRevision> bundles = new ArrayList<>(pluginClassLoaders.size());
1074-
while (classLoaders.hasNext()) {
1075-
WrappedClassLoader loader = classLoaders.next();
1067+
for (WrappedClassLoader loader : pluginClassLoaders) {
10761068
idToLoader.put(loader.bundle.getSymbolicName(), loader);
10771069
BundleRevision revision = loader.bundle.adapt(BundleRevision.class);
10781070
if (revision != null) {
@@ -1133,8 +1125,7 @@ private List<BundleRevision> computePrerequisiteOrder(List<BundleRevision> plugi
11331125
prereqs.add(new Relation(currentFrag, hostWires.get(0).getProvider()));
11341126
}
11351127
} else {
1136-
AntCorePlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_MALFORMED_URL, NLS.bind(InternalCoreAntMessages.AntCorePreferences_1, new String[] {
1137-
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));
11381129
}
11391130
}
11401131

@@ -1231,11 +1222,12 @@ private Map<BundleRevision, Integer> computeCounts(List<Relation> mappings) {
12311222
BundleRevision from = mapping.from;
12321223
Integer fromCount = counts.get(from);
12331224
BundleRevision to = mapping.to;
1234-
if (to == null)
1225+
if (to == null) {
12351226
counts.put(from, Integer.valueOf(0));
1236-
else {
1237-
if (counts.get(to) == null)
1227+
} else {
1228+
if (counts.get(to) == null) {
12381229
counts.put(to, Integer.valueOf(0));
1230+
}
12391231
fromCount = fromCount == null ? Integer.valueOf(1) : Integer.valueOf(fromCount.intValue() + 1);
12401232
counts.put(from, fromCount);
12411233
}
@@ -1287,9 +1279,7 @@ public List<Task> getTasks() {
12871279
public List<Task> getRemoteTasks() {
12881280
List<Task> result = new ArrayList<>(10);
12891281
if (defaultTasks != null && !defaultTasks.isEmpty()) {
1290-
Iterator<Task> iter = defaultTasks.iterator();
1291-
while (iter.hasNext()) {
1292-
Task task = iter.next();
1282+
for (Task task : defaultTasks) {
12931283
if (!task.isEclipseRuntimeRequired()) {
12941284
result.add(task);
12951285
}
@@ -1354,9 +1344,7 @@ public List<Property> getProperties() {
13541344
public List<Property> getRemoteAntProperties() {
13551345
List<Property> result = new ArrayList<>(10);
13561346
if (defaultProperties != null && !defaultProperties.isEmpty()) {
1357-
Iterator<Property> iter = defaultProperties.iterator();
1358-
while (iter.hasNext()) {
1359-
Property property = iter.next();
1347+
for (Property property : defaultProperties) {
13601348
if (!property.isEclipseRuntimeRequired()) {
13611349
result.add(property);
13621350
}
@@ -1525,9 +1513,7 @@ public List<Type> getTypes() {
15251513
public List<Type> getRemoteTypes() {
15261514
List<Type> result = new ArrayList<>(10);
15271515
if (defaultTypes != null && !defaultTypes.isEmpty()) {
1528-
Iterator<Type> iter = defaultTypes.iterator();
1529-
while (iter.hasNext()) {
1530-
Type type = iter.next();
1516+
for (Type type : defaultTypes) {
15311517
if (!type.isEclipseRuntimeRequired()) {
15321518
result.add(type);
15331519
}

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ private String[] getArray(String args) {
140140
}
141141
waitingForQuote = true;
142142
} else {
143-
if (!(token.equals(",") || token.equals(" "))) //$NON-NLS-1$ //$NON-NLS-2$
143+
if (!(token.equals(",") || token.equals(" "))) { //$NON-NLS-1$ //$NON-NLS-2$
144144
result.add(token);
145+
}
145146
}
146147
}
147148
}
@@ -281,7 +282,7 @@ private void basicConfigure(Class<?> classInternalAntRunner, Object runner) thro
281282
setProperties(runner, classInternalAntRunner);
282283

283284
if (arguments != null && arguments.length > 0) {
284-
Method setArguments = classInternalAntRunner.getMethod("setArguments", new Class[] { String[].class }); //$NON-NLS-1$
285+
Method setArguments = classInternalAntRunner.getMethod("setArguments", String[].class); //$NON-NLS-1$
285286
setArguments.invoke(runner, new Object[] { arguments });
286287
}
287288
}
@@ -302,8 +303,7 @@ private void basicConfigure(Class<?> classInternalAntRunner, Object runner) thro
302303
*/
303304
public void run(IProgressMonitor monitor) throws CoreException {
304305
if (buildRunning) {
305-
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_RUNNING_BUILD, NLS.bind(InternalCoreAntMessages.AntRunner_Already_in_progess, new String[] {
306-
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);
307307
throw new CoreException(status);
308308
}
309309
buildRunning = true;
@@ -319,7 +319,7 @@ public void run(IProgressMonitor monitor) throws CoreException {
319319

320320
// set the custom classpath
321321
if (customClasspath != null) {
322-
Method setCustomClasspath = classInternalAntRunner.getMethod("setCustomClasspath", new Class[] { URL[].class }); //$NON-NLS-1$
322+
Method setCustomClasspath = classInternalAntRunner.getMethod("setCustomClasspath", URL[].class); //$NON-NLS-1$
323323
setCustomClasspath.invoke(runner, new Object[] { customClasspath });
324324
}
325325

@@ -360,7 +360,7 @@ public void run(IProgressMonitor monitor) throws CoreException {
360360

361361
// set execution targets
362362
if (targets != null) {
363-
Method setExecutionTargets = classInternalAntRunner.getMethod("setExecutionTargets", new Class[] { String[].class }); //$NON-NLS-1$
363+
Method setExecutionTargets = classInternalAntRunner.getMethod("setExecutionTargets", String[].class); //$NON-NLS-1$
364364
setExecutionTargets.invoke(runner, new Object[] { targets });
365365
}
366366

@@ -400,7 +400,7 @@ private void setProperties(Object runner, Class<?> classInternalAntRunner) throw
400400

401401
// add property files
402402
if (propertyFiles != null) {
403-
Method addPropertyFiles = classInternalAntRunner.getMethod("addPropertyFiles", new Class[] { String[].class }); //$NON-NLS-1$
403+
Method addPropertyFiles = classInternalAntRunner.getMethod("addPropertyFiles", String[].class); //$NON-NLS-1$
404404
addPropertyFiles.invoke(runner, new Object[] { propertyFiles });
405405
}
406406
}
@@ -449,7 +449,7 @@ protected void problemLoadingClass(Throwable e) throws CoreException {
449449
if (missingClassName != null) {
450450
missingClassName = missingClassName.replace('/', '.');
451451
message = InternalCoreAntMessages.AntRunner_Could_not_find_one_or_more_classes__Please_check_the_Ant_classpath__2;
452-
message = NLS.bind(message, new String[] { missingClassName });
452+
message = NLS.bind(message, missingClassName);
453453
} else {
454454
message = InternalCoreAntMessages.AntRunner_Could_not_find_one_or_more_classes__Please_check_the_Ant_classpath__1;
455455
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,9 @@ public boolean isDefault() {
100100

101101
@Override
102102
public boolean equals(Object obj) {
103-
if (!(obj instanceof TargetInfo)) {
103+
if (!(obj instanceof TargetInfo other)) {
104104
return false;
105105
}
106-
TargetInfo other = (TargetInfo) obj;
107106
return getName().equals(other.getName());
108107
}
109108

ant/org.eclipse.ant.core/src/org/eclipse/ant/internal/core/AntClasspathEntry.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ public AntClasspathEntry(URL url) {
8080

8181
@Override
8282
public boolean equals(Object obj) {
83-
if (obj instanceof IAntClasspathEntry) {
84-
IAntClasspathEntry other = (IAntClasspathEntry) obj;
83+
if (obj instanceof IAntClasspathEntry other) {
8584
return entryString.equals(other.getLabel());
8685
}
8786
return false;

ant/org.eclipse.ant.core/src_ant/org/eclipse/ant/internal/core/ant/InputHandlerSetter.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +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(InternalAntMessages.InternalAntRunner_handler_does_not_implement_InputHandler5, new Object[] {
39-
inputHandlerClassname });
38+
String msg = MessageFormat.format(InternalAntMessages.InternalAntRunner_handler_does_not_implement_InputHandler5, inputHandlerClassname);
4039
throw new BuildException(msg, e);
4140
}
4241
catch (Exception e) {
43-
String msg = MessageFormat.format(InternalAntMessages.InternalAntRunner_Unable_to_instantiate_input_handler_class, new Object[] {
44-
inputHandlerClassname, e.getClass().getName() });
42+
String msg = MessageFormat.format(InternalAntMessages.InternalAntRunner_Unable_to_instantiate_input_handler_class, inputHandlerClassname, e.getClass().getName());
4543
throw new BuildException(msg, e);
4644
}
4745
}

0 commit comments

Comments
 (0)