diff --git a/ant/org.eclipse.ant.tests.core/test plugin/org/eclipse/ant/tests/core/testplugin/AntTestPlugin.java b/ant/org.eclipse.ant.tests.core/test plugin/org/eclipse/ant/tests/core/testplugin/AntTestPlugin.java index f07f1e7bcfc..f309988d9c1 100644 --- a/ant/org.eclipse.ant.tests.core/test plugin/org/eclipse/ant/tests/core/testplugin/AntTestPlugin.java +++ b/ant/org.eclipse.ant.tests.core/test plugin/org/eclipse/ant/tests/core/testplugin/AntTestPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 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 @@ -54,7 +54,7 @@ public static void enableAutobuild(boolean enable) throws CoreException { public File getFileInPlugin(IPath path) { try { Bundle bundle = getDefault().getBundle(); - URL installURL = new URL(bundle.getEntry("/"), path.toString()); //$NON-NLS-1$ + URL installURL = bundle.getEntry("/" + path.toString()); //$NON-NLS-1$ URL localURL = FileLocator.toFileURL(installURL); return new File(localURL.getFile()); } diff --git a/team/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLPlugin.java b/team/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLPlugin.java index d9c932debcc..7e37d054370 100644 --- a/team/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLPlugin.java +++ b/team/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 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 @@ -13,7 +13,6 @@ *******************************************************************************/ package org.eclipse.compare.examples.xml; -import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; @@ -114,12 +113,8 @@ protected ImageDescriptor getImageDescriptor(String relativePath) { URL installURL= fgXMLPlugin.getBundle().getEntry("/"); //$NON-NLS-1$ if (installURL != null) { - try { - URL url= new URL(installURL, "icons/full/" + relativePath); //$NON-NLS-1$ - return ImageDescriptor.createFromURL(url); - } catch (MalformedURLException e) { - Assert.isTrue(false); - } + URL url = fgXMLPlugin.getBundle().getEntry("/icons/full/" + relativePath); //$NON-NLS-1$ + return ImageDescriptor.createFromURL(url); } return null; } @@ -252,8 +247,8 @@ public void setIdMaps(HashMap IdMap, HashMap IdExtensionToName, HashMap OrderedE if (refresh) { Object[] viewers = fViewers.getListeners(); - for (int i = 0; i < viewers.length; ++i) { - XMLStructureViewer viewer = (XMLStructureViewer) viewers[i]; + for (Object viewer2 : viewers) { + XMLStructureViewer viewer = (XMLStructureViewer) viewer2; viewer.updateIdMaps(); viewer.contentChanged(); } diff --git a/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java b/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java index cdf3b7be7e9..8712994716f 100644 --- a/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java +++ b/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2018 IBM Corporation and others. + * Copyright (c) 2009, 2025 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -163,7 +163,7 @@ public static String asString(InputStream exptStream) throws IOException { public static InputStream asInputStream(String name) { IPath path = IPath.fromOSString(PATCHDATA).append(name); try { - URL url = new URL(getBundle().getEntry("/"), path.toString()); + URL url = getBundle().getEntry("/" + path.toString()); return url.openStream(); } catch (IOException e) { throw new IllegalStateException("failed while reading " + name, e);