diff --git a/ua/org.eclipse.help/.classpath b/ua/org.eclipse.help/.classpath index 81fe078c20c..375961e4d61 100644 --- a/ua/org.eclipse.help/.classpath +++ b/ua/org.eclipse.help/.classpath @@ -1,6 +1,6 @@ - + diff --git a/ua/org.eclipse.help/.settings/.api_filters b/ua/org.eclipse.help/.settings/.api_filters index c550bad5ff9..e9f7848f3bd 100644 --- a/ua/org.eclipse.help/.settings/.api_filters +++ b/ua/org.eclipse.help/.settings/.api_filters @@ -1,13 +1,5 @@ - - - - - - - - diff --git a/ua/org.eclipse.help/.settings/org.eclipse.jdt.core.prefs b/ua/org.eclipse.help/.settings/org.eclipse.jdt.core.prefs index ffbf95a2c1b..d9c5451c962 100644 --- a/ua/org.eclipse.help/.settings/org.eclipse.jdt.core.prefs +++ b/ua/org.eclipse.help/.settings/org.eclipse.jdt.core.prefs @@ -10,9 +10,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable.secondary= org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=21 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.compliance=21 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -106,7 +106,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=17 +org.eclipse.jdt.core.compiler.source=21 org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,NORMAL org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,HELP diff --git a/ua/org.eclipse.help/META-INF/MANIFEST.MF b/ua/org.eclipse.help/META-INF/MANIFEST.MF index b2bfb185af5..fe8ca88fd71 100644 --- a/ua/org.eclipse.help/META-INF/MANIFEST.MF +++ b/ua/org.eclipse.help/META-INF/MANIFEST.MF @@ -65,6 +65,6 @@ Import-Package: javax.xml.parsers, org.w3c.dom, org.xml.sax, org.xml.sax.helpers -Bundle-RequiredExecutionEnvironment: JavaSE-17 +Bundle-RequiredExecutionEnvironment: JavaSE-21 Bundle-ActivationPolicy: lazy Automatic-Module-Name: org.eclipse.help diff --git a/ua/org.eclipse.help/src/org/eclipse/help/internal/util/ResourceLocator.java b/ua/org.eclipse.help/src/org/eclipse/help/internal/util/ResourceLocator.java index 200e07aee2e..b7e9eb84820 100644 --- a/ua/org.eclipse.help/src/org/eclipse/help/internal/util/ResourceLocator.java +++ b/ua/org.eclipse.help/src/org/eclipse/help/internal/util/ResourceLocator.java @@ -23,7 +23,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Hashtable; -import java.util.Iterator; import java.util.Locale; import java.util.Map; import java.util.Set; @@ -96,8 +95,8 @@ public IHelpContentProducer getProducer() { static { Platform.getExtensionRegistry().addRegistryChangeListener(event -> { IExtensionDelta[] deltas = event.getExtensionDeltas(HelpPlugin.PLUGIN_ID, CONTENTPRODUCER_XP_NAME); - for (int i = 0; i < deltas.length; i++) { - IExtension extension = deltas[i].getExtension(); + for (IExtensionDelta element : deltas) { + IExtension extension = element.getExtension(); String affectedPlugin = extension.getContributor().getName(); // reset producer for the affected plugin, // it will be recreated on demand @@ -154,9 +153,8 @@ private static ProducerDescriptor createContentProducer(String pluginId) { checkForDuplicateExtensionElements(elements); - for (int i = 0; i < elements.length; i++) { - IConfigurationElement element = elements[i]; - if (!elements[i].getContributor().getName().equals(pluginId)) { + for (IConfigurationElement element : elements) { + if (!element.getContributor().getName().equals(pluginId)) { continue; } if (BINDING.equals(element.getName())) { @@ -182,8 +180,7 @@ private static void checkForDuplicateExtensionElements(IConfigurationElement[] e isCheckedForDuplicates = true; Set logged = new HashSet<>(); Set keys = new HashSet<>(); - for (int i = 0; i < elements.length; i++) { - IConfigurationElement element = elements[i]; + for (IConfigurationElement element : elements) { String pluginName = element.getContributor().getName(); String key = pluginName; if (logged.contains(key)) { @@ -204,8 +201,7 @@ private static void checkForDuplicateExtensionElements(IConfigurationElement[] e private static ProducerDescriptor findContentProducer(IConfigurationElement [] elements, String refId) { // try existing ones - for (Iterator iter = contentProducers.values().iterator(); iter.hasNext();) { - Object obj = iter.next(); + for (Object obj : contentProducers.values()) { if (obj instanceof ProducerDescriptor desc) { if (desc.matches(refId)) { return desc; @@ -215,11 +211,11 @@ private static ProducerDescriptor findContentProducer(IConfigurationElement [] e // not created yet. Find the matching configuration element, // take its contributing pluginId and get the descriptor // for that plug-in - for (int i=0; i= 5) { - l = new Locale(locale.substring(0, 2), locale.substring(3, 5)); + l = Locale.of(locale.substring(0, 2), locale.substring(3, 5)); } else if (locale.length() >= 2) { - l = new Locale(locale.substring(0, 2), ""); //$NON-NLS-1$ + l = Locale.of(locale.substring(0, 2), ""); //$NON-NLS-1$ } else { l = Locale.getDefault(); } @@ -291,14 +287,14 @@ public static InputStream openFromZip(Bundle pluginDesc, String zip, String file Map cache = zipCache; ArrayList pathPrefix = getPathPrefix(locale); - for (int i = 0; i < pathPrefix.size(); i++) { + for (String element : pathPrefix) { // finds the zip file by either using a cached location, or // calling Platform.find - the result is cached for future use. - Object cached = cache.get(pluginID + '/' + pathPrefix.get(i) + zip); + Object cached = cache.get(pluginID + '/' + element + zip); if (cached == null) { try { - URL url = FileLocator.find(pluginDesc, IPath.fromOSString(pathPrefix.get(i) + zip), null); + URL url = FileLocator.find(pluginDesc, IPath.fromOSString(element + zip), null); if (url != null) { URL realZipURL = FileLocator.toFileURL(FileLocator.resolve(url)); cached = realZipURL.toExternalForm(); @@ -309,7 +305,7 @@ public static InputStream openFromZip(Bundle pluginDesc, String zip, String file cached = ZIP_NOT_FOUND; } // cache it - cache.put(pluginID + '/' + pathPrefix.get(i) + zip, cached); + cache.put(pluginID + '/' + element + zip, cached); } if (cached == ZIP_NOT_FOUND || cached.toString().startsWith("jar:")) { //$NON-NLS-1$ @@ -371,8 +367,8 @@ public static InputStream openFromPlugin(Bundle pluginDesc, String file, String public static URL find(Bundle pluginDesc, IPath flatFilePath, ArrayList pathPrefix) { // try to find the actual file. - for (int i = 0; i < pathPrefix.size(); i++) { - URL url = FileLocator.find(pluginDesc, IPath.fromOSString(pathPrefix.get(i) + flatFilePath), null); + for (String element : pathPrefix) { + URL url = FileLocator.find(pluginDesc, IPath.fromOSString(element + flatFilePath), null); if (url != null) { return url; } @@ -447,8 +443,8 @@ private static void findTopicPaths(Bundle pluginDesc, String directory, String l directory = directory.substring(0, directory.length() - 1); } ArrayList pathPrefix = getPathPrefix(locale); - for (int i = 0; i < pathPrefix.size(); i++) { - String path = pathPrefix.get(i) + directory; + for (String element : pathPrefix) { + String path = element + directory; if (path.length() == 0) { path = "/"; //$NON-NLS-1$ }