diff options
author | Carsten Hammer | 2020-11-01 13:35:17 +0000 |
---|---|---|
committer | Mickael Istria | 2021-04-03 16:15:31 +0000 |
commit | f9b3b190af277108c012e1d6a0aa16619d09b59d (patch) | |
tree | 5f096ba60f4d640fa9573050a77e49ff79b7408c | |
parent | 99074fd4e1982008888507196bb79d7c0c71eb60 (diff) | |
download | rt.equinox.p2-f9b3b190af277108c012e1d6a0aa16619d09b59d.tar.gz rt.equinox.p2-f9b3b190af277108c012e1d6a0aa16619d09b59d.tar.xz rt.equinox.p2-f9b3b190af277108c012e1d6a0aa16619d09b59d.zip |
Bug: Return value of String.replace(CharSequence, CharSequence) ignoredI20210405-0630I20210405-0600I20210404-1800I20210404-0600I20210403-1800
in org.eclipse.equinox.internal.p2.ui.discovery.wizards.CatalogViewer.createPattern(String)
The return value of this method should be checked. One common cause of
this warning is to invoke a method on an immutable object, thinking that
it updates the object. For example, in the following code fragment,
String dateString = getHeaderField(name);
dateString.trim();
the programmer seems to be thinking that the trim() method will update
the String referenced by dateString. But since Strings are immutable,
the trim() function returns a new String value, which is being ignored
here. The code should be corrected to:
String dateString = getHeaderField(name);
dateString = dateString.trim();
Rank: Scariest (3), confidence: High
Pattern: RV_RETURN_VALUE_IGNORED
Type: RV, Category: CORRECTNESS (Correctness)
Change-Id: I742c36e979c97ce67bbe1ef69abd8d19cfa04ec8
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
3 files changed, 3 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.discovery/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.ui.discovery/META-INF/MANIFEST.MF index e3e2304f1..648f49784 100644 --- a/bundles/org.eclipse.equinox.p2.ui.discovery/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.ui.discovery/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.equinox.p2.ui.discovery;singleton:=true -Bundle-Version: 1.2.100.qualifier +Bundle-Version: 1.2.200.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-11 diff --git a/bundles/org.eclipse.equinox.p2.ui.discovery/pom.xml b/bundles/org.eclipse.equinox.p2.ui.discovery/pom.xml index d2839ef3d..f901ddc26 100644 --- a/bundles/org.eclipse.equinox.p2.ui.discovery/pom.xml +++ b/bundles/org.eclipse.equinox.p2.ui.discovery/pom.xml @@ -9,6 +9,6 @@ </parent> <groupId>org.eclipse.equinox</groupId> <artifactId>org.eclipse.equinox.p2.ui.discovery</artifactId> - <version>1.2.100-SNAPSHOT</version> + <version>1.2.200-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/wizards/CatalogViewer.java b/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/wizards/CatalogViewer.java index f7ad21549..f4df92354 100644 --- a/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/wizards/CatalogViewer.java +++ b/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/wizards/CatalogViewer.java @@ -275,7 +275,7 @@ public class CatalogViewer extends FilteredViewer { return null; } String regex = filterText; - regex.replace("\\", "\\\\").replace("?", ".").replace("*", ".*?"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ + regex = regex.replace("\\", "\\\\").replace("?", ".").replace("*", ".*?"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ return Pattern.compile(regex, Pattern.CASE_INSENSITIVE | Pattern.DOTALL); } |