Skip to content

Commit 49e4e78

Browse files
committed
Use String.replace instead of String.replaceAll when regexp is not needed
1 parent 81c4516 commit 49e4e78

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceHyperlink.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public IStatus processAmbiguousResults(List<Object> matches, String typeName, in
281281
if (methodSignature == null) {
282282
return openClipboard(matches, line, typeName);
283283
}
284-
methodSignature = methodSignature.replaceAll(" ", ""); //$NON-NLS-1$//$NON-NLS-2$ ;
284+
methodSignature = methodSignature.replace(" ", ""); //$NON-NLS-1$//$NON-NLS-2$ ;
285285
String methodNameExtracted = methodSignature.substring(0, methodSignature.indexOf('('));
286286
for (Object obj : matches) {
287287
if (filterClasses(obj, methodSignature, methodNameExtracted, link)) {
@@ -439,7 +439,7 @@ private boolean extractFromResults(IType type, String methodSignature, String me
439439
return false;
440440
}
441441
String methodName = matcher.group();
442-
methodName = methodName.replaceAll(" ", ""); //$NON-NLS-1$//$NON-NLS-2$
442+
methodName = methodName.replace(" ", ""); //$NON-NLS-1$//$NON-NLS-2$
443443
pattern = Pattern.compile(METHOD_ARGUMENTS_REGEX);
444444
matcher = pattern.matcher(methodSignature);
445445
if (!matcher.find()) {

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/InstalledJREsBlock.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ public void run(IProgressMonitor monitor) {
925925
}
926926

927927
if (locations.isEmpty()) {
928-
String messagePath = path.replaceAll("&", "&&"); // @see bug 29855 //$NON-NLS-1$//$NON-NLS-2$
928+
String messagePath = path.replace("&", "&&"); // @see bug 29855 //$NON-NLS-1$//$NON-NLS-2$
929929
MessageDialog.openInformation(getShell(), JREMessages.InstalledJREsBlock_12, NLS.bind(JREMessages.InstalledJREsBlock_13, new String[]{messagePath})); //
930930
} else {
931931
Iterator<IVMInstallType> iter2 = types.iterator();
@@ -1055,7 +1055,7 @@ protected void search(File directory, List<File> found, List<IVMInstallType> typ
10551055
}
10561056
File file = name == null ? directory : new File(directory, name);
10571057
monitor.subTask(NLS.bind(JREMessages.InstalledJREsBlock_14, new String[] { Integer.toString(found.size()),
1058-
file.toPath().normalize().toAbsolutePath().toString().replaceAll("&", "&&") })); // @see bug 29855 //$NON-NLS-1$ //$NON-NLS-2$
1058+
file.toPath().normalize().toAbsolutePath().toString().replace("&", "&&") })); // @see bug 29855 //$NON-NLS-1$ //$NON-NLS-2$
10591059
IVMInstallType[] vmTypes = JavaRuntime.getVMInstallTypes();
10601060
if (file.isDirectory()) {
10611061
if (ignore.add(file)) {

0 commit comments

Comments
 (0)