Procházet zdrojové kódy

Change non-regex uses of replaceAll to replace

Change-Id: I55762a3c25de36b1e3c435fccab4a4cc653c78ed
Reviewed-on: http://gerrit.dmdirc.com/703
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
Automatic-Compile: Gregory Holmes <greg@dmdirc.com>
tags/0.6.3b1
Chris Smith před 14 roky
rodič
revize
bcb50254d7

+ 2
- 2
src/com/dmdirc/Main.java Zobrazit soubor

219
         }
219
         }
220
 
220
 
221
         // Let command-line users know what is happening.
221
         // Let command-line users know what is happening.
222
-        System.out.println(message.replaceAll("<br>", "\n"));
222
+        System.out.println(message.replace("<br>", "\n"));
223
 
223
 
224
         final File configFile = new File(getConfigDir() + "dmdirc.config");
224
         final File configFile = new File(getConfigDir() + "dmdirc.config");
225
         final File newConfigFile = new File(getConfigDir() + "dmdirc.config." + date);
225
         final File newConfigFile = new File(getConfigDir() + "dmdirc.config." + date);
237
             if (!GraphicsEnvironment.isHeadless()) {
237
             if (!GraphicsEnvironment.isHeadless()) {
238
                 new WarningDialog("Invalid Config File", newMessage).displayBlocking();
238
                 new WarningDialog("Invalid Config File", newMessage).displayBlocking();
239
             }
239
             }
240
-            System.out.println(newMessage.replaceAll("<br>", "\n"));
240
+            System.out.println(newMessage.replace("<br>", "\n"));
241
             System.exit(1);
241
             System.exit(1);
242
         }
242
         }
243
     }
243
     }

+ 1
- 1
src/com/dmdirc/ui/themes/ThemeIdentity.java Zobrazit soubor

82
         if (result == null) {
82
         if (result == null) {
83
             return result;
83
             return result;
84
         } else {
84
         } else {
85
-            return result.replaceAll("\\$theme", theme.getFileName(false));
85
+            return result.replace("$theme", theme.getFileName(false));
86
         }
86
         }
87
     }
87
     }
88
 
88
 

+ 9
- 11
src/com/dmdirc/util/URLHandler.java Zobrazit soubor

37
 import java.util.ArrayList;
37
 import java.util.ArrayList;
38
 import java.util.Date;
38
 import java.util.Date;
39
 import java.util.List;
39
 import java.util.List;
40
-import java.util.regex.Matcher;
41
-import java.util.regex.Pattern;
42
 
40
 
43
 /** Handles URLs. */
41
 /** Handles URLs. */
44
 public class URLHandler {
42
 public class URLHandler {
208
             }
206
             }
209
         }
207
         }
210
 
208
 
211
-        newCommand = newCommand.replaceAll("\\$url", Matcher.quoteReplacement(url.toString()));
212
-        newCommand = newCommand.replaceAll("\\$fragment", Matcher.quoteReplacement(fragment));
213
-        newCommand = newCommand.replaceAll("\\$host", Matcher.quoteReplacement(host));
214
-        newCommand = newCommand.replaceAll("\\$path", Matcher.quoteReplacement(path));
215
-        newCommand = newCommand.replaceAll("\\$port", Matcher.quoteReplacement(port));
216
-        newCommand = newCommand.replaceAll("\\$query", Matcher.quoteReplacement(query));
217
-        newCommand = newCommand.replaceAll("\\$protocol", Matcher.quoteReplacement(protocol));
218
-        newCommand = newCommand.replaceAll("\\$username", Matcher.quoteReplacement(username));
219
-        newCommand = newCommand.replaceAll("\\$password", Matcher.quoteReplacement(password));
209
+        newCommand = newCommand.replace("$url", url.toString());
210
+        newCommand = newCommand.replace("$fragment", fragment);
211
+        newCommand = newCommand.replace("$host", host);
212
+        newCommand = newCommand.replace("$path", path);
213
+        newCommand = newCommand.replace("$port", port);
214
+        newCommand = newCommand.replace("$query", query);
215
+        newCommand = newCommand.replace("$protocol", protocol);
216
+        newCommand = newCommand.replace("$username", username);
217
+        newCommand = newCommand.replace("$password", password);
220
 
218
 
221
         return newCommand;
219
         return newCommand;
222
     }
220
     }

Načítá se…
Zrušit
Uložit