Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2018 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -607,9 +607,7 @@ private void addURLToExtraClasspathEntries(URL url, IConfigurationElement elemen
if (eclipseRuntime != null) {
eclipseRuntimeRequired = Boolean.parseBoolean(eclipseRuntime);
}
Iterator<AntClasspathEntry> itr = extraClasspathURLs.iterator();
while (itr.hasNext()) {
IAntClasspathEntry entry = itr.next();
for (IAntClasspathEntry entry : extraClasspathURLs) {
if (entry.getEntryURL().equals(url)) {
return;
}
Expand Down Expand Up @@ -689,8 +687,7 @@ private boolean configureAntObject(IConfigurationElement element, AntObject antO

String library = element.getAttribute(AntCorePlugin.LIBRARY);
if (library == null) {
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[] {
objectName }), null);
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);
AntCorePlugin.getPlugin().getLog().log(status);
return false;
}
Expand All @@ -708,8 +705,7 @@ private boolean configureAntObject(IConfigurationElement element, AntObject antO
}

// type specifies a library that does not exist
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(errorMessage, new String[] {
library, element.getContributor().getName() }), null);
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(errorMessage, library, element.getContributor().getName()), null);
AntCorePlugin.getPlugin().getLog().log(status);
return false;
}
Expand All @@ -720,8 +716,7 @@ private boolean configureAntObject(IConfigurationElement element, AntObject antO
}
catch (Exception e) {
// likely extra classpath entry library that does not exist
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_8, new String[] {
library, element.getContributor().getName() }), null);
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_8, library, element.getContributor().getName()), null);
AntCorePlugin.getPlugin().getLog().log(status);
}
return false;
Expand All @@ -744,8 +739,7 @@ protected void computeDefaultExtraClasspathEntries(List<IConfigurationElement> e
addPluginClassLoader(bundle);
} else {
// extra classpath entry that does not exist
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_6, new String[] {
library, element.getContributor().getName() }), null);
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_6, library, element.getContributor().getName()), null);
AntCorePlugin.getPlugin().getLog().log(status);
continue;
}
Expand All @@ -758,8 +752,7 @@ protected void computeDefaultExtraClasspathEntries(List<IConfigurationElement> e
}
catch (Exception e) {
// likely extra classpath entry that does not exist
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_6, new String[] {
library, element.getContributor().getName() }), null);
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_6, library, element.getContributor().getName()), null);
AntCorePlugin.getPlugin().getLog().log(status);
continue;
}
Expand Down Expand Up @@ -1069,11 +1062,9 @@ private void addEntryURLs(List<URL> result, IAntClasspathEntry[] entries) {

protected ClassLoader[] getPluginClassLoaders() {
if (orderedPluginClassLoaders == null) {
Iterator<WrappedClassLoader> classLoaders = pluginClassLoaders.iterator();
Map<String, WrappedClassLoader> idToLoader = new HashMap<>(pluginClassLoaders.size());
List<BundleRevision> bundles = new ArrayList<>(pluginClassLoaders.size());
while (classLoaders.hasNext()) {
WrappedClassLoader loader = classLoaders.next();
for (WrappedClassLoader loader : pluginClassLoaders) {
idToLoader.put(loader.bundle.getSymbolicName(), loader);
BundleRevision revision = loader.bundle.adapt(BundleRevision.class);
if (revision != null) {
Expand Down Expand Up @@ -1134,8 +1125,7 @@ private List<BundleRevision> computePrerequisiteOrder(List<BundleRevision> plugi
prereqs.add(new Relation(currentFrag, hostWires.get(0).getProvider()));
}
} else {
AntCorePlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_MALFORMED_URL, NLS.bind(InternalCoreAntMessages.AntCorePreferences_1, new String[] {
currentFrag.getSymbolicName() }), null));
AntCorePlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_MALFORMED_URL, NLS.bind(InternalCoreAntMessages.AntCorePreferences_1, currentFrag.getSymbolicName()), null));
}
}

Expand Down Expand Up @@ -1289,9 +1279,7 @@ public List<Task> getTasks() {
public List<Task> getRemoteTasks() {
List<Task> result = new ArrayList<>(10);
if (defaultTasks != null && !defaultTasks.isEmpty()) {
Iterator<Task> iter = defaultTasks.iterator();
while (iter.hasNext()) {
Task task = iter.next();
for (Task task : defaultTasks) {
if (!task.isEclipseRuntimeRequired()) {
result.add(task);
}
Expand Down Expand Up @@ -1356,9 +1344,7 @@ public List<Property> getProperties() {
public List<Property> getRemoteAntProperties() {
List<Property> result = new ArrayList<>(10);
if (defaultProperties != null && !defaultProperties.isEmpty()) {
Iterator<Property> iter = defaultProperties.iterator();
while (iter.hasNext()) {
Property property = iter.next();
for (Property property : defaultProperties) {
if (!property.isEclipseRuntimeRequired()) {
result.add(property);
}
Expand Down Expand Up @@ -1527,9 +1513,7 @@ public List<Type> getTypes() {
public List<Type> getRemoteTypes() {
List<Type> result = new ArrayList<>(10);
if (defaultTypes != null && !defaultTypes.isEmpty()) {
Iterator<Type> iter = defaultTypes.iterator();
while (iter.hasNext()) {
Type type = iter.next();
for (Type type : defaultTypes) {
if (!type.isEclipseRuntimeRequired()) {
result.add(type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,7 @@ private void basicConfigure(Class<?> classInternalAntRunner, Object runner) thro
*/
public void run(IProgressMonitor monitor) throws CoreException {
if (buildRunning) {
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_RUNNING_BUILD, NLS.bind(InternalCoreAntMessages.AntRunner_Already_in_progess, new String[] {
buildFileLocation }), null);
IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_RUNNING_BUILD, NLS.bind(InternalCoreAntMessages.AntRunner_Already_in_progess, buildFileLocation), null);
throw new CoreException(status);
}
buildRunning = true;
Expand Down Expand Up @@ -450,7 +449,7 @@ protected void problemLoadingClass(Throwable e) throws CoreException {
if (missingClassName != null) {
missingClassName = missingClassName.replace('/', '.');
message = InternalCoreAntMessages.AntRunner_Could_not_find_one_or_more_classes__Please_check_the_Ant_classpath__2;
message = NLS.bind(message, new String[] { missingClassName });
message = NLS.bind(message, missingClassName);
} else {
message = InternalCoreAntMessages.AntRunner_Could_not_find_one_or_more_classes__Please_check_the_Ant_classpath__1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected static void abort(String message, Throwable exception, int code) throw
public static IPath getLocation(ILaunchConfiguration configuration) throws CoreException {
String location = configuration.getAttribute(IExternalToolConstants.ATTR_LOCATION, (String) null);
if (location == null) {
abort(NLS.bind(ExternalToolsProgramMessages.ExternalToolsUtil_Location_not_specified_by__0__1, new String[] { configuration.getName()}), null, 0);
abort(NLS.bind(ExternalToolsProgramMessages.ExternalToolsUtil_Location_not_specified_by__0__1, configuration.getName()), null, 0);
} else {
String expandedLocation = getStringVariableManager().performStringSubstitution(location);
if (expandedLocation == null || expandedLocation.length() == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void launch(ILaunchConfiguration configuration, String mode,
if (p != null) {
monitor.beginTask(NLS.bind(
ExternalToolsProgramMessages.ProgramLaunchDelegate_3,
new String[] { configuration.getName() }),
configuration.getName()),
IProgressMonitor.UNKNOWN);
String label = getProcessLabel(location, p);
process = DebugPlugin.newProcess(launch, p, label, processAttributes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private void doBuildBasedOnScope(IResource[] resources, int kind, ILaunchConfigu
}

private void launchBuild(int kind, ILaunchConfiguration config, Map<String, String> args, IProgressMonitor monitor) throws CoreException {
monitor.subTask(NLS.bind(ExternalToolsModelMessages.ExternalToolBuilder_Running__0_____1, new String[] { config.getName()}));
monitor.subTask(NLS.bind(ExternalToolsModelMessages.ExternalToolBuilder_Running__0_____1, config.getName()));
buildStarted(kind, args);
// The default value for "launch in background" is true in debug core. If
// the user doesn't go through the UI, the new attribute won't be set. This means
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ private void initialize() {
if (object instanceof IValueVariableInitializer initializer) {
initializer.initialize(this);
} else {
VariablesPlugin.logMessage(NLS.bind("Unable to initialize variable {0} - initializer must be an instance of IValueVariableInitializer.", new String[]{getName()}), null); //$NON-NLS-1$
VariablesPlugin.logMessage(NLS.bind("Unable to initialize variable {0} - initializer must be an instance of IValueVariableInitializer.", getName()), null); //$NON-NLS-1$
}
} catch (CoreException e) {
VariablesPlugin.logMessage(NLS.bind("Unable to initialize variable {0}",new String[]{getName()}), e); //$NON-NLS-1$
VariablesPlugin.logMessage(NLS.bind("Unable to initialize variable {0}", getName()), e); //$NON-NLS-1$
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,25 @@ public String getValue(String argument) throws CoreException {
if (!supportsArgument()) {
// check for an argument - not supported
if (argument != null && argument.length() > 0) {
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.DynamicVariable_0, new String[]{argument, getName()}), null));
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.DynamicVariable_0, argument, getName()), null));
}
}
if (fResolver == null) {
String name = getConfigurationElement().getAttribute("resolver"); //$NON-NLS-1$
if (name == null) {
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Contributed context variable {0} must specify a resolver.",new String[]{getName()}), null)); //$NON-NLS-1$
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Contributed context variable {0} must specify a resolver.", getName()), null)); //$NON-NLS-1$
}
Object object = getConfigurationElement().createExecutableExtension("resolver"); //$NON-NLS-1$
if (object instanceof IDynamicVariableResolver) {
fResolver = (IDynamicVariableResolver)object;
} else {
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Contributed context variable resolver for {0} must be an instance of IContextVariableResolver.",new String[]{getName()}), null)); //$NON-NLS-1$
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Contributed context variable resolver for {0} must be an instance of IContextVariableResolver.", getName()), null)); //$NON-NLS-1$
}
}
try {
return fResolver.resolveValue(this, argument);
} catch (RuntimeException e) {
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Error while evaluating variable {0}.",new String[]{getName()}), e)); //$NON-NLS-1$
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Error while evaluating variable {0}.", getName()), e)); //$NON-NLS-1$
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public String performStringSubstitution(String expression, boolean reportUndefin
problemVariableList.append(", "); //$NON-NLS-1$
}
problemVariableList.setLength(problemVariableList.length()-2); //truncate the last ", "
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.REFERENCE_CYCLE_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_4, new String[]{problemVariableList.toString()}), null));
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.REFERENCE_CYCLE_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_4, problemVariableList.toString()), null));
}
}

Expand Down Expand Up @@ -260,7 +260,7 @@ private String resolve(VariableReference var, boolean reportUndefinedVariables,
if (dynamicVariable == null) {
// no variables with the given name
if (reportUndefinedVariables) {
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_3, new String[]{name}), null));
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_3, name), null));
}
// leave as is
return getOriginalVarText(var);
Expand All @@ -283,7 +283,7 @@ private String resolve(VariableReference var, boolean reportUndefinedVariables,
return getOriginalVarText(var);
}
// error - an argument specified for a value variable
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_4, new String[]{valueVariable.getName()}), null));
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_4, valueVariable.getName()), null));
}

private String getOriginalVarText(VariableReference var) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ private void loadDynamicVariables() {
for (IConfigurationElement element : elements) {
String name= element.getAttribute(ATTR_NAME);
if (name == null) {
VariablesPlugin.logMessage(NLS.bind("Variable extension missing required 'name' attribute: {0}", new String[] {element.getDeclaringExtension().getLabel()}), null); //$NON-NLS-1$
VariablesPlugin.logMessage(NLS.bind("Variable extension missing required 'name' attribute: {0}", element.getDeclaringExtension().getLabel()), null); //$NON-NLS-1$
continue;
}
String description= element.getAttribute(ATTR_DESCRIPTION);
Expand All @@ -246,7 +246,7 @@ private void loadContributedValueVariables() {
for (IConfigurationElement element : elements) {
String name= element.getAttribute(ATTR_NAME);
if (name == null) {
VariablesPlugin.logMessage(NLS.bind("Variable extension missing required 'name' attribute: {0}", new String[] {element.getDeclaringExtension().getLabel()}), null); //$NON-NLS-1$
VariablesPlugin.logMessage(NLS.bind("Variable extension missing required 'name' attribute: {0}", element.getDeclaringExtension().getLabel()), null); //$NON-NLS-1$
continue;
}
String description= element.getAttribute(ATTR_DESCRIPTION);
Expand Down Expand Up @@ -295,7 +295,7 @@ private void loadPersistedValueVariables() {
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element element= (Element) node;
if (!element.getNodeName().equals(VALUE_VARIABLE_TAG)) {
VariablesPlugin.logMessage(NLS.bind("Invalid XML element encountered while loading value variables: {0}", new String[] {node.getNodeName()}), null); //$NON-NLS-1$
VariablesPlugin.logMessage(NLS.bind("Invalid XML element encountered while loading value variables: {0}", node.getNodeName()), null); //$NON-NLS-1$
continue;
}
String name= element.getAttribute(NAME_TAG);
Expand Down Expand Up @@ -360,7 +360,7 @@ public synchronized void addVariables(IValueVariable[] variables) throws CoreExc
MultiStatus status = new MultiStatus(VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, VariablesMessages.StringVariableManager_26, null);
for (IValueVariable variable : variables) {
if (getValueVariable(variable.getName()) != null) {
status.add(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringVariableManager_27, new String[]{variable.getName()}), null));
status.add(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringVariableManager_27, variable.getName()), null));
}
}
if (status.isOK()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ void reportReplacement(LaunchConfigurationTabGroupExtension oldext, LaunchConfig
Status status = new Status(IStatus.ERROR,
DebugUIPlugin.getUniqueIdentifier(),
NLS.bind(LaunchConfigurationsMessages.LaunchConfigurationPresentationManager_0,
new String[]{oldext.getIdentifier(), oldext.getTypeIdentifier(), mode.toString(), newext.getIdentifier()}));
oldext.getIdentifier(), oldext.getTypeIdentifier(), mode.toString(),
newext.getIdentifier()));
DebugUIPlugin.log(status);
}
}
Expand Down
Loading
Loading