diff options
author | Nitin Dahyabhai | 2022-09-29 04:28:49 +0000 |
---|---|---|
committer | Nitin Dahyabhai | 2022-09-29 04:52:39 +0000 |
commit | b0a0df1c7097c1e5eab7185dc99499e29aee9852 (patch) | |
tree | 7690e1f39c39de2b0800c9504aed8f32de56a736 | |
parent | c479ea70999b4deaab7e57ee066e622d51f79d36 (diff) | |
download | webtools.sourceediting-b0a0df1c7097c1e5eab7185dc99499e29aee9852.tar.gz webtools.sourceediting-b0a0df1c7097c1e5eab7185dc99499e29aee9852.tar.xz webtools.sourceediting-b0a0df1c7097c1e5eab7185dc99499e29aee9852.zip |
[580788] SSE StringUtils imports com.ibm.icu.util.StringTokenizer instead of java.util.StringTokenizer
20 files changed, 85 insertions, 147 deletions
diff --git a/core/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF b/core/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF index 6abc0095e3..2fac57df59 100644 --- a/core/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF +++ b/core/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF @@ -38,12 +38,10 @@ Export-Package: org.eclipse.wst.sse.core, org.eclipse.wst.sse.core.text, org.eclipse.wst.sse.core.utils, org.eclipse.wst.sse.internal.contentproperties;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui" -Import-Package: com.ibm.icu.util, - com.ibm.icu.text Require-Bundle: org.eclipse.core.resources;bundle-version="[3.13.0,4.0.0)", org.eclipse.text;bundle-version="[3.6.0,4.0.0)";visibility:=reexport, org.eclipse.core.jobs;bundle-version="[3.10.0,4.0.0)", - org.eclipse.core.runtime;bundle-version="[3.14.0,4.0.0)", + org.eclipse.core.runtime;bundle-version="[3.26.0,4.0.0)", org.eclipse.core.filebuffers;bundle-version="[3.6.0,4.0.0)", org.eclipse.wst.common.uriresolver;bundle-version="[1.2.300,2.0.0)", org.eclipse.emf.common;bundle-version="[2.14.0,3.0.0)", diff --git a/core/bundles/org.eclipse.wst.sse.core/pom.xml b/core/bundles/org.eclipse.wst.sse.core/pom.xml index 1acee3cb0b..5bb2b2200b 100644 --- a/core/bundles/org.eclipse.wst.sse.core/pom.xml +++ b/core/bundles/org.eclipse.wst.sse.core/pom.xml @@ -23,25 +23,4 @@ <artifactId>org.eclipse.wst.sse.core</artifactId> <version>1.2.900-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> - - <build> - <plugins> - <plugin> - <groupId>org.eclipse.tycho</groupId> - <artifactId>target-platform-configuration</artifactId> - <configuration> - <dependency-resolution> - <extraRequirements> - <requirement> - <type>eclipse-plugin</type> - <id>com.ibm.icu</id> - <versionRange>0.0.0</versionRange> - </requirement> - </extraRequirements> - </dependency-resolution> - </configuration> - </plugin> - </plugins> - </build> - </project> diff --git a/core/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Logger.java b/core/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Logger.java index bdea85da38..95f6ff89d9 100644 --- a/core/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Logger.java +++ b/core/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Logger.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. + * Copyright (c) 2001, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -14,7 +14,7 @@ *******************************************************************************/ package org.eclipse.wst.sse.core.internal.encoding.util; -import com.ibm.icu.util.StringTokenizer; +import java.util.StringTokenizer; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; diff --git a/core/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java b/core/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java index c7cbf3cc8b..d2ceec1128 100644 --- a/core/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java +++ b/core/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2010 IBM Corporation and others. + * Copyright (c) 2001, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -16,9 +16,8 @@ package org.eclipse.wst.sse.core.internal.util; - import java.io.File; -import com.ibm.icu.util.StringTokenizer; +import java.util.StringTokenizer; /** * Collection of helper methods to manage and convert links Originally part of diff --git a/core/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ProjectResolver.java b/core/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ProjectResolver.java index 790fc7f830..0b81dedc5a 100644 --- a/core/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ProjectResolver.java +++ b/core/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ProjectResolver.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2007 IBM Corporation and others. + * Copyright (c) 2001, 202 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -17,6 +17,7 @@ package org.eclipse.wst.sse.core.internal.util; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; +import java.util.StringTokenizer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; @@ -24,8 +25,6 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.wst.common.uriresolver.internal.util.URIHelper; -import com.ibm.icu.util.StringTokenizer; - /** * @deprecated The URIResolver interface is deprecated. Use the resolver from * org.eclipse.wst.common.uriresolver. diff --git a/core/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java b/core/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java index 3f054c01b4..dd6cbfdea0 100644 --- a/core/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java +++ b/core/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2019 IBM Corporation and others. + * Copyright (c) 2001, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -17,6 +17,7 @@ package org.eclipse.wst.sse.core.utils; import java.util.ArrayList; import java.util.List; +import java.util.StringTokenizer; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.Document; @@ -24,8 +25,6 @@ import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IRegion; import org.eclipse.wst.sse.core.internal.Logger; -import com.ibm.icu.util.StringTokenizer; - public class StringUtils { protected static final String AMPERSTAND = "&"; //$NON-NLS-1$ diff --git a/core/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF b/core/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF index ef872e0bbe..a6f74c9c54 100755 --- a/core/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF +++ b/core/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.wst.sse.ui; singleton:=true -Bundle-Version: 1.7.500.qualifier +Bundle-Version: 1.7.600.qualifier Bundle-Activator: org.eclipse.wst.sse.ui.internal.SSEUIPlugin Bundle-Vendor: %providerName Bundle-Localization: plugin @@ -50,8 +50,6 @@ Export-Package: org.eclipse.wst.sse.ui, org.eclipse.wst.sse.ui.typing, org.eclipse.wst.sse.ui.views.contentoutline, org.eclipse.wst.sse.ui.views.properties -Import-Package: com.ibm.icu.util, - com.ibm.icu.text Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.14.0,4.0.0)", org.eclipse.jface.text;bundle-version="[3.13.0,4.0.0)", org.eclipse.debug.ui;bundle-version="[3.13.0,4.0.0)", diff --git a/core/bundles/org.eclipse.wst.sse.ui/pom.xml b/core/bundles/org.eclipse.wst.sse.ui/pom.xml index ee70675997..304342b22c 100644 --- a/core/bundles/org.eclipse.wst.sse.ui/pom.xml +++ b/core/bundles/org.eclipse.wst.sse.ui/pom.xml @@ -21,26 +21,6 @@ <groupId>org.eclipse.webtools.sourceediting</groupId> <artifactId>org.eclipse.wst.sse.ui</artifactId> - <version>1.7.500-SNAPSHOT</version> + <version>1.7.600-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> - - <build> - <plugins> - <plugin> - <groupId>org.eclipse.tycho</groupId> - <artifactId>target-platform-configuration</artifactId> - <configuration> - <dependency-resolution> - <extraRequirements> - <requirement> - <type>eclipse-plugin</type> - <id>com.ibm.icu</id> - <versionRange>0.0.0</versionRange> - </requirement> - </extraRequirements> - </dependency-resolution> - </configuration> - </plugin> - </plugins> - </build> </project> diff --git a/core/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java b/core/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java index 0dfd3f1a38..0de263fce0 100644 --- a/core/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java +++ b/core/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2011 IBM Corporation and others. + * Copyright (c) 2001, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -16,6 +16,7 @@ package org.eclipse.wst.sse.ui.internal.preferences.ui; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.StringTokenizer; import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.Platform; @@ -60,8 +61,6 @@ import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys; import org.eclipse.wst.sse.core.utils.StringUtils; import org.eclipse.wst.sse.ui.internal.SSEUIMessages; -import com.ibm.icu.util.StringTokenizer; - class MainTab implements IPreferenceTab { public class TaskTagDialog extends Dialog { public TaskTag taskTag = null; @@ -193,9 +192,9 @@ class MainTab implements IPreferenceTab { int result = dlg.open(); if (result == Window.OK) { TaskTag newTag = dlg.taskTag; - List newTags = new ArrayList(Arrays.asList(fTaskTags)); + List<TaskTag> newTags = new ArrayList<>(Arrays.asList(fTaskTags)); newTags.add(newTag); - fTaskTags = (TaskTag[]) newTags.toArray(new TaskTag[newTags.size()]); + fTaskTags = newTags.toArray(new TaskTag[newTags.size()]); valueTable.setInput(fTaskTags); valueTable.getTable().setSelection(fTaskTags.length - 1); } @@ -211,7 +210,6 @@ class MainTab implements IPreferenceTab { Label description = new Label(composite, SWT.NONE); description.setText(SSEUIMessages.TaskTagPreferenceTab_33); //$NON-NLS-1$ -// description.setBackground(composite.getBackground()); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1); // https://bugs.eclipse.org/bugs/show_bug.cgi?id=104403 Point sizeHint = description.computeSize(SWT.DEFAULT, SWT.DEFAULT); @@ -340,7 +338,7 @@ class MainTab implements IPreferenceTab { String[] tags = StringUtils.unpack(tagString); StringTokenizer toker = null; - List list = new ArrayList(); + List<Integer> list = new ArrayList<>(); toker = new StringTokenizer(priorityString, ","); //$NON-NLS-1$ while (toker.hasMoreTokens()) { @@ -349,11 +347,11 @@ class MainTab implements IPreferenceTab { number = Integer.valueOf(toker.nextToken()); } catch (NumberFormatException e) { - number = new Integer(IMarker.PRIORITY_NORMAL); + number = Integer.valueOf(IMarker.PRIORITY_NORMAL); } list.add(number); } - Integer[] priorities = (Integer[]) list.toArray(new Integer[0]); + Integer[] priorities = list.toArray(new Integer[0]); fTaskTags = new TaskTag[Math.min(tags.length, priorities.length)]; for (int i = 0; i < fTaskTags.length; i++) { @@ -396,18 +394,18 @@ class MainTab implements IPreferenceTab { */ private void removeTags(ISelection selection) { IStructuredSelection structuredSelection = (IStructuredSelection) selection; - List taskTags = new ArrayList(Arrays.asList(fTaskTags)); + List<TaskTag> taskTags = new ArrayList<>(Arrays.asList(fTaskTags)); taskTags.removeAll(structuredSelection.toList()); - fTaskTags = (TaskTag[]) taskTags.toArray(new TaskTag[taskTags.size()]); + fTaskTags = taskTags.toArray(new TaskTag[taskTags.size()]); valueTable.setInput(fTaskTags); } private void save() { - IEclipsePreferences defaultPreferences = new DefaultScope().getNode(TaskTagPreferenceKeys.TASK_TAG_NODE); + IEclipsePreferences defaultPreferences = DefaultScope.INSTANCE.getNode(TaskTagPreferenceKeys.TASK_TAG_NODE); String defaultTags = defaultPreferences.get(TaskTagPreferenceKeys.TASK_TAG_TAGS, null); String defaultPriorities = defaultPreferences.get(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, null); - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for (int i = 0; i < fTaskTags.length; i++) { if (i > 0) { buf.append(","); //$NON-NLS-1$ @@ -429,7 +427,7 @@ class MainTab implements IPreferenceTab { fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).put(TaskTagPreferenceKeys.TASK_TAG_TAGS, currentTags); } - StringBuffer buf2 = new StringBuffer(); + StringBuilder buf2 = new StringBuilder(); for (int i = 0; i < fTaskTags.length; i++) { if (i > 0) { buf2.append(","); //$NON-NLS-1$ diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java index 215ae3e003..2b4e6807ea 100644 --- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java +++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2010 IBM Corporation and others. + * Copyright (c) 2001, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -16,13 +16,13 @@ package org.eclipse.wst.sse.ui.internal; +import java.util.StringTokenizer; + import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.osgi.framework.Bundle; -import com.ibm.icu.util.StringTokenizer; - /** * Small convenience class to log messages to plugin's log file and also, if * desired, the console. This class should only be used by classes in this diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ActionDescriptor.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ActionDescriptor.java index 5263bdf463..9407eec652 100644 --- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ActionDescriptor.java +++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ActionDescriptor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. + * Copyright (c) 2001, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -14,9 +14,7 @@ *******************************************************************************/ package org.eclipse.wst.sse.ui.internal.extension; - - -import com.ibm.icu.util.StringTokenizer; +import java.util.StringTokenizer; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; @@ -31,7 +29,6 @@ import org.eclipse.wst.sse.ui.internal.IActionValidator; import org.eclipse.wst.sse.ui.internal.Logger; import org.osgi.framework.Bundle; - /** * When 'action' tag is found in the registry, an object of this class is * created. It creates the appropriate action object and captures information @@ -270,8 +267,6 @@ public class ActionDescriptor { */ private IAction createAction(IConfigurationElement actionElement) { Object action = new ExtendedEditorActionProxyForDelayLoading(actionElement, ATT_CLASS); - if (action == null) - return null; if (action instanceof IActionValidator) { if (!((IActionValidator) action).isValidAction()) return null; diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/BreakpointProviderBuilder.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/BreakpointProviderBuilder.java index 30fa1f350f..65bc26896e 100644 --- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/BreakpointProviderBuilder.java +++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/BreakpointProviderBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2018 IBM Corporation and others. + * Copyright (c) 2001, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -22,7 +22,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; -import com.ibm.icu.util.StringTokenizer; +import java.util.StringTokenizer; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; @@ -40,7 +40,7 @@ import org.osgi.framework.Bundle; /** - * Reads breakpoint extension registory and returns breakpoint provider + * Reads breakpoint extension registry and returns breakpoint provider * instances */ public class BreakpointProviderBuilder extends RegistryReader { @@ -129,8 +129,8 @@ public class BreakpointProviderBuilder extends RegistryReader { } - protected List cache; - private Map map = new HashMap(); + protected List<IConfigurationElement> cache; + private Map<String,IBreakpointProvider[]> map = new HashMap<>(); protected String targetContributionTag; @@ -219,7 +219,7 @@ public class BreakpointProviderBuilder extends RegistryReader { return new IConfigurationElement[0]; int num = cache.size(); - List elements = new ArrayList(1); + List<IConfigurationElement> elements = new ArrayList<>(1); for (int i = 0; i < num; i++) { Object obj = cache.get(i); if (!(obj instanceof IConfigurationElement)) @@ -265,7 +265,7 @@ public class BreakpointProviderBuilder extends RegistryReader { elements.add(element); } } - return (IConfigurationElement[]) elements.toArray(new IConfigurationElement[0]); + return elements.toArray(new IConfigurationElement[0]); } /** @@ -284,9 +284,9 @@ public class BreakpointProviderBuilder extends RegistryReader { // Get breakpoint providers for this content type handler IBreakpointProvider[] providers1 = new IBreakpointProvider[0]; IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID); - List holdProviders = new ArrayList(2); + List<IBreakpointProvider> holdProviders = new ArrayList<>(2); while (contentType != null) { - IBreakpointProvider[] providers = (IBreakpointProvider[]) map.get(contentType.getId()); + IBreakpointProvider[] providers = map.get(contentType.getId()); if (providers == null) { providers = createBreakpointProviders(ATT_CONTENT_TYPES, contentType.getId()); if (providers != null) { @@ -299,12 +299,12 @@ public class BreakpointProviderBuilder extends RegistryReader { } contentType = contentType.getBaseType(); } - providers1 = (IBreakpointProvider[]) holdProviders.toArray(new IBreakpointProvider[holdProviders.size()]); + providers1 = holdProviders.toArray(new IBreakpointProvider[holdProviders.size()]); // Get breakpoint providers for this extension IBreakpointProvider[] providers2 = new IBreakpointProvider[0]; if (ext != null) { - providers2 = (IBreakpointProvider[]) map.get(ext); + providers2 = map.get(ext); if (providers2 == null) { providers2 = createBreakpointProviders(ATT_EXTENSIONS, ext); if (providers2 != null) { @@ -314,7 +314,7 @@ public class BreakpointProviderBuilder extends RegistryReader { } // create single hash set to remove duplication - Set s = new HashSet(); + Set<IBreakpointProvider> s = new HashSet<>(); s.addAll(Arrays.asList(providers1)); s.addAll(Arrays.asList(providers2)); @@ -355,7 +355,7 @@ public class BreakpointProviderBuilder extends RegistryReader { private void initCache() { if (cache == null) { - cache = new ArrayList(); + cache = new ArrayList<>(); readContributions(TAG_BREAKPOINT_CONTRIBUTION, PL_BREAKPOINT); } } diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/RegistryReader.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/RegistryReader.java index 5d73ff4d1e..e4fca6175c 100644 --- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/RegistryReader.java +++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/RegistryReader.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2021 IBM Corporation and others. + * Copyright (c) 2001, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterDescriptor.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterDescriptor.java index 3ab64c1db8..cfb9cd46f0 100644 --- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterDescriptor.java +++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterDescriptor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 IBM Corporation and others. + * Copyright (c) 2011, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -12,29 +12,24 @@ *******************************************************************************/ package org.eclipse.wst.sse.ui.internal.filter; +import java.text.Collator; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; -import com.ibm.icu.text.Collator; - import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.ISafeRunnable; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.SafeRunner; - import org.eclipse.jface.util.SafeRunnable; import org.eclipse.jface.viewers.ViewerFilter; - import org.eclipse.ui.IPluginContribution; import org.eclipse.ui.activities.WorkbenchActivityHelper; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; - - /** * Represents a custom filter which is provided by the * "org.eclipse.sse.ui.outlineFilters" extension point. @@ -82,7 +77,7 @@ public class OutlineFilterDescriptor implements Comparable, IPluginContribution */ public static OutlineFilterDescriptor[] getFilterDescriptors(String targetId) { OutlineFilterDescriptor[] filterDescs= OutlineFilterDescriptor.getFilterDescriptors(); - List result= new ArrayList(filterDescs.length); + List<OutlineFilterDescriptor> result= new ArrayList<>(filterDescs.length); for (int i= 0; i < filterDescs.length; i++) { String tid= filterDescs[i].getTargetId(); if (WorkbenchActivityHelper.filterItem(filterDescs[i])) @@ -90,7 +85,7 @@ public class OutlineFilterDescriptor implements Comparable, IPluginContribution if (tid == null || tid.equals(targetId)) result.add(filterDescs[i]); } - return (OutlineFilterDescriptor[])result.toArray(new OutlineFilterDescriptor[result.size()]); + return result.toArray(new OutlineFilterDescriptor[result.size()]); } /** @@ -247,8 +242,8 @@ public class OutlineFilterDescriptor implements Comparable, IPluginContribution * @return new filter descriptors */ private static OutlineFilterDescriptor[] createFilterDescriptors(IConfigurationElement[] elements) { - List result= new ArrayList(5); - Set descIds= new HashSet(5); + List<OutlineFilterDescriptor> result= new ArrayList<>(5); + Set<String> descIds= new HashSet<>(5); for (int i= 0; i < elements.length; i++) { final IConfigurationElement element= elements[i]; if (FILTER_TAG.equals(element.getName())) { @@ -266,7 +261,7 @@ public class OutlineFilterDescriptor implements Comparable, IPluginContribution } } } - return (OutlineFilterDescriptor[])result.toArray(new OutlineFilterDescriptor[result.size()]); + return result.toArray(new OutlineFilterDescriptor[result.size()]); } public String getLocalId() { diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenFileHyperlinkTracker.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenFileHyperlinkTracker.java index 424d00f7ce..02a05beb18 100644 --- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenFileHyperlinkTracker.java +++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenFileHyperlinkTracker.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. + * Copyright (c) 2001, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -14,7 +14,7 @@ *******************************************************************************/ package org.eclipse.wst.sse.ui.internal.openon; -import com.ibm.icu.util.StringTokenizer; +import java.util.StringTokenizer; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java index a94b6d242a..d61b23d866 100644 --- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java +++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2008 IBM Corporation and others. + * Copyright (c) 2001, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -16,12 +16,12 @@ package org.eclipse.wst.sse.ui.internal.preferences.ui; +import java.util.StringTokenizer; + import org.eclipse.jface.resource.ColorRegistry; import org.eclipse.swt.graphics.RGB; import org.eclipse.wst.sse.ui.internal.Logger; -import com.ibm.icu.util.StringTokenizer; - public class ColorHelper { public final static String BACKGROUND = "background";//$NON-NLS-1$ diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/TextHoverManager.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/TextHoverManager.java index 0faa8d44c8..c2aceccc2e 100644 --- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/TextHoverManager.java +++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/TextHoverManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2007 IBM Corporation and others. + * Copyright (c) 2001, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -15,6 +15,7 @@ package org.eclipse.wst.sse.ui.internal.taginfo; import java.util.HashMap; +import java.util.StringTokenizer; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.text.ITextHover; @@ -23,8 +24,6 @@ import org.eclipse.wst.sse.ui.internal.SSEUIMessages; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames; -import com.ibm.icu.util.StringTokenizer; - /** * Manages text hovers for Structured Text editors */ diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/EditorUtility.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/EditorUtility.java index 0e0bd8f07d..5fcf90e247 100644 --- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/EditorUtility.java +++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/EditorUtility.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. + * Copyright (c) 2001, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -15,7 +15,7 @@ package org.eclipse.wst.sse.ui.internal.util; -import com.ibm.icu.util.StringTokenizer; +import java.util.StringTokenizer; import org.eclipse.jface.action.Action; import org.eclipse.jface.resource.JFaceResources; diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AbstractCompletionProposalCategoriesConfiguration.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AbstractCompletionProposalCategoriesConfiguration.java index ad5f8ca291..43d8ad2ff4 100644 --- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AbstractCompletionProposalCategoriesConfiguration.java +++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AbstractCompletionProposalCategoriesConfiguration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 IBM Corporation and others. + * Copyright (c) 2010, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -17,12 +17,11 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; +import java.util.StringTokenizer; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposalCategory; -import com.ibm.icu.util.StringTokenizer; - /** * <p>Implements a completion proposal categories configuration * reader and writer using an {@link IPreferenceStore}</p> @@ -47,7 +46,7 @@ public abstract class AbstractCompletionProposalCategoriesConfiguration * <code>{@link List}<{@link String}></code> * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul> */ - private List fDefaultPageSortOrder; + private List<String> fDefaultPageSortOrder; /** * <p>{@link CompletionProposalCategory} IDs sorted by the order they should @@ -56,7 +55,7 @@ public abstract class AbstractCompletionProposalCategoriesConfiguration * <code>{@link List}<{@link String}></code> * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul> */ - private List fOwnPageSortOrder; + private List<String> fOwnPageSortOrder; /** * <p>{@link CompletionProposalCategory} IDs that should not be displayed on @@ -65,7 +64,7 @@ public abstract class AbstractCompletionProposalCategoriesConfiguration * <code>{@link Set}<{@link String}></code> * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul> */ - private Set fShouldNotDisplayOnOwnPage; + private Set<String> fShouldNotDisplayOnOwnPage; /** * <p>{@link CompletionProposalCategory} IDs that should not be displayed on @@ -74,16 +73,16 @@ public abstract class AbstractCompletionProposalCategoriesConfiguration * <code>{@link Set}<{@link String}></code> * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul> */ - private Set fShouldNotDisplayOnDefaultPage; + private Set<String> fShouldNotDisplayOnDefaultPage; /** * <p>Create a new configuration by loading from the associated {@link IPreferenceStore}</p> */ public AbstractCompletionProposalCategoriesConfiguration() { - this.fOwnPageSortOrder = new ArrayList(); - this.fDefaultPageSortOrder = new ArrayList(); - this.fShouldNotDisplayOnOwnPage = new HashSet(); - this.fShouldNotDisplayOnDefaultPage = new HashSet(); + this.fOwnPageSortOrder = new ArrayList<>(); + this.fDefaultPageSortOrder = new ArrayList<>(); + this.fShouldNotDisplayOnOwnPage = new HashSet<>(); + this.fShouldNotDisplayOnDefaultPage = new HashSet<>(); this.loadUserConfiguration(); } @@ -208,14 +207,14 @@ public abstract class AbstractCompletionProposalCategoriesConfiguration /** * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#setPageOrder(java.util.List) */ - public void setPageOrder(List order) { + public void setPageOrder(List<String> order) { this.fOwnPageSortOrder = order; } /** * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#setDefaultPageOrder(java.util.List) */ - public void setDefaultPageOrder(List order) { + public void setDefaultPageOrder(List<String> order) { this.fDefaultPageSortOrder = order; } @@ -314,7 +313,7 @@ public abstract class AbstractCompletionProposalCategoriesConfiguration //parse either the default or user configuration preference String preference; - if(useDefaults) { + if (useDefaults) { preference = getPreferenceStore().getDefaultString(getShouldNotDisplayOnOwnPagePrefKey()); } else { preference = getPreferenceStore().getString(getShouldNotDisplayOnOwnPagePrefKey()); @@ -333,9 +332,9 @@ public abstract class AbstractCompletionProposalCategoriesConfiguration private void saveShouldDisplayOnDefaultPageConfiguration() { //create the preference string StringBuffer defaultPageBuff = new StringBuffer(); - Iterator defaultPageIter = this.fShouldNotDisplayOnDefaultPage.iterator(); - while(defaultPageIter.hasNext()) { - String categoryID = (String)defaultPageIter.next(); + Iterator<String> defaultPageIter = this.fShouldNotDisplayOnDefaultPage.iterator(); + while (defaultPageIter.hasNext()) { + String categoryID = defaultPageIter.next(); defaultPageBuff.append(categoryID + PREFERENCE_CATEGORY_SEPERATOR); } @@ -348,9 +347,9 @@ public abstract class AbstractCompletionProposalCategoriesConfiguration */ private void savePageSortOrderConfiguration() { //create the preference string - StringBuffer orderBuff = new StringBuffer(); - for(int i = 0; i < this.fOwnPageSortOrder.size(); ++i) { - if(this.fOwnPageSortOrder.get(i) != null) { + StringBuilder orderBuff = new StringBuilder(); + for (int i = 0; i < this.fOwnPageSortOrder.size(); ++i) { + if (this.fOwnPageSortOrder.get(i) != null) { orderBuff.append(this.fOwnPageSortOrder.get(i) + PREFERENCE_CATEGORY_SEPERATOR); } } @@ -364,8 +363,8 @@ public abstract class AbstractCompletionProposalCategoriesConfiguration */ private void saveDefaultPageSortOrderConfiguration() { //create the preference string - StringBuffer orderBuff = new StringBuffer(); - for(int i = 0; i < this.fDefaultPageSortOrder.size(); ++i) { + StringBuilder orderBuff = new StringBuilder(); + for (int i = 0; i < this.fDefaultPageSortOrder.size(); ++i) { if(this.fDefaultPageSortOrder.get(i) != null) { orderBuff.append(this.fDefaultPageSortOrder.get(i) + PREFERENCE_CATEGORY_SEPERATOR); } @@ -381,10 +380,10 @@ public abstract class AbstractCompletionProposalCategoriesConfiguration */ private void saveShouldDisplayOnOwnPageConfiguration() { //create the preference string - StringBuffer buff = new StringBuffer(); - Iterator iter = this.fShouldNotDisplayOnOwnPage.iterator(); + StringBuilder buff = new StringBuilder(); + Iterator<String> iter = this.fShouldNotDisplayOnOwnPage.iterator(); while(iter.hasNext()) { - String categoryID = (String)iter.next(); + String categoryID = iter.next(); buff.append(categoryID + PREFERENCE_CATEGORY_SEPERATOR); } diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationWriter.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationWriter.java index a4c483efa7..17a02bf73b 100644 --- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationWriter.java +++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationWriter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 IBM Corporation and others. + * Copyright (c) 2010, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -87,7 +87,7 @@ public interface ICompletionProposalCategoriesConfigurationWriter extends * @param order <code>{@link List}<{@link String}></code> * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul> */ - void setPageOrder(List order); + void setPageOrder(List<String> order); /** * <p>Sets the order in which the categories should be listed on the default page. @@ -102,7 +102,7 @@ public interface ICompletionProposalCategoriesConfigurationWriter extends * @param order <code>{@link List}<{@link String}></code> * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul> */ - void setDefaultPageOrder(List order); + void setDefaultPageOrder(List<String> order); /** * <p>Should load the default settings from wherever they are being stored</p> |