You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by mb...@apache.org on 2023/01/09 07:44:24 UTC

[netbeans] branch master updated: Replaced a part of replaceAll() calls to replace()

This is an automated email from the ASF dual-hosted git repository.

mbien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new f98e74dcb9 Replaced a part of replaceAll() calls to replace()
     new 0ecc6721fb Merge pull request #5228 from tbw777/replaceAll2
f98e74dcb9 is described below

commit f98e74dcb9577466492cf7600c4b3306efa69e3f
Author: Andrei Briukhov <an...@gmail.com>
AuthorDate: Fri Jan 6 15:06:44 2023 -0300

    Replaced a part of replaceAll() calls to replace()
    
    replace() method is more fast then replaceAll() for non regex cases
---
 .../src/org/netbeans/modules/bugzilla/commands/BugzillaExecutor.java    | 2 +-
 .../src/org/netbeans/modules/nativeexecution/api/util/MacroMap.java     | 2 +-
 .../src/org/netbeans/modules/mercurial/ui/commit/CommitPanel.java       | 2 +-
 .../src/org/netbeans/modules/subversion/ui/commit/CommitPanel.java      | 2 +-
 .../org/netbeans/modules/versioning/util/common/CollapsiblePanel.java   | 2 +-
 .../qa-functional/src/org/netbeans/xml/test/actions/XMLActionsTest.java | 2 +-
 .../org/netbeans/installer/utils/system/launchers/impl/ShLauncher.java  | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/BugzillaExecutor.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/BugzillaExecutor.java
index 7f0da48acb..a65f48336f 100644
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/BugzillaExecutor.java
+++ b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/BugzillaExecutor.java
@@ -308,7 +308,7 @@ public class BugzillaExecutor {
         html = html.substring(idxS, idxE);
 
         // very nice
-        html = html.replaceAll("Please press \\<b\\>Back\\</b\\> and try again.", ""); // NOI18N
+        html = html.replace("Please press <b>Back</b> and try again.", ""); // NOI18N
 
         return html;
     }
diff --git a/ide/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/MacroMap.java b/ide/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/MacroMap.java
index 4450204089..3731b56a20 100644
--- a/ide/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/MacroMap.java
+++ b/ide/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/MacroMap.java
@@ -237,7 +237,7 @@ public final class MacroMap implements Cloneable {
 
         String oldpath = get(name);
         String newPath = path + (oldpath == null ? "" : (isWindows ? ';' : ':') + oldpath); // NOI18N
-        newPath = newPath.replaceAll("::", ":"); // NOI18N
+        newPath = newPath.replace("::", ":"); // NOI18N
         newPath = newPath.replaceAll("^:", ""); // NOI18N
         newPath = newPath.replaceAll(":$", ""); // NOI18N
         put(name, newPath);
diff --git a/ide/mercurial/src/org/netbeans/modules/mercurial/ui/commit/CommitPanel.java b/ide/mercurial/src/org/netbeans/modules/mercurial/ui/commit/CommitPanel.java
index 58ff389183..914ab24807 100644
--- a/ide/mercurial/src/org/netbeans/modules/mercurial/ui/commit/CommitPanel.java
+++ b/ide/mercurial/src/org/netbeans/modules/mercurial/ui/commit/CommitPanel.java
@@ -306,7 +306,7 @@ public class CommitPanel extends AutoResizingPanel implements PreferenceChangeLi
             JTabbedPane hooksTabbedPane = new JTabbedPane();
             for (HgHook hook : hooks) {
                 hooksTabbedPane.add(hook.createComponent(hookContext),
-                                    hook.getDisplayName().replaceAll("\\&", ""));
+                                    hook.getDisplayName().replace("&", ""));
             }
             hookSectionPanel.add(hooksTabbedPane);
         }
diff --git a/ide/subversion/src/org/netbeans/modules/subversion/ui/commit/CommitPanel.java b/ide/subversion/src/org/netbeans/modules/subversion/ui/commit/CommitPanel.java
index 7ca61cc5c0..4e27036d1f 100644
--- a/ide/subversion/src/org/netbeans/modules/subversion/ui/commit/CommitPanel.java
+++ b/ide/subversion/src/org/netbeans/modules/subversion/ui/commit/CommitPanel.java
@@ -302,7 +302,7 @@ public class CommitPanel extends AutoResizingPanel implements PreferenceChangeLi
             JTabbedPane hooksTabbedPane = new JTabbedPane();
             for (SvnHook hook : hooks) {
                 hooksTabbedPane.add(hook.createComponent(hookContext),
-                                    hook.getDisplayName().replaceAll("\\&", ""));
+                                    hook.getDisplayName().replace("&", ""));
             }
             hooksSectionPanel.add(hooksTabbedPane);
         }
diff --git a/ide/versioning.util/src/org/netbeans/modules/versioning/util/common/CollapsiblePanel.java b/ide/versioning.util/src/org/netbeans/modules/versioning/util/common/CollapsiblePanel.java
index e42da20b3c..85bf7e85f2 100644
--- a/ide/versioning.util/src/org/netbeans/modules/versioning/util/common/CollapsiblePanel.java
+++ b/ide/versioning.util/src/org/netbeans/modules/versioning/util/common/CollapsiblePanel.java
@@ -212,7 +212,7 @@ abstract class CollapsiblePanel extends JPanel {
             } else {
                 JTabbedPane hooksTabbedPane = new JTabbedPane();
                 for (VCSHook hook : hooks) {
-                    hooksTabbedPane.add(hook.createComponent(hookContext), hook.getDisplayName().replaceAll("\\&", ""));
+                    hooksTabbedPane.add(hook.createComponent(hookContext), hook.getDisplayName().replace("&", ""));
                 }
                 sectionPanel.add(hooksTabbedPane);
             }
diff --git a/ide/xml/test/qa-functional/src/org/netbeans/xml/test/actions/XMLActionsTest.java b/ide/xml/test/qa-functional/src/org/netbeans/xml/test/actions/XMLActionsTest.java
index a5ff9a2edf..b8957ff575 100644
--- a/ide/xml/test/qa-functional/src/org/netbeans/xml/test/actions/XMLActionsTest.java
+++ b/ide/xml/test/qa-functional/src/org/netbeans/xml/test/actions/XMLActionsTest.java
@@ -165,7 +165,7 @@ public class XMLActionsTest extends XMLTest {
         Thread.sleep(1000);//wait for opening a window
         String text = new EditorOperator(outputName).getText();
         //create one line because of Windows are adding few empty lines
-        text = text.replaceAll("\n", "");
+        text = text.replace("\n", "");
         ref(text);
         ending();
     }
diff --git a/nbi/engine/src/org/netbeans/installer/utils/system/launchers/impl/ShLauncher.java b/nbi/engine/src/org/netbeans/installer/utils/system/launchers/impl/ShLauncher.java
index 1b8698e971..6d695314f5 100644
--- a/nbi/engine/src/org/netbeans/installer/utils/system/launchers/impl/ShLauncher.java
+++ b/nbi/engine/src/org/netbeans/installer/utils/system/launchers/impl/ShLauncher.java
@@ -297,7 +297,7 @@ public class ShLauncher extends CommonLauncher {
                 replace("\t","\\\\t").
                 replace("\r","\\\\r").
                 replace("`","\\`").
-                replaceAll("\"","\\\\\"");
+                replace("\"","\\\\\"");
         
     }
     private String escapeSlashesAndChars(String str) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists