Browse Source

Change some .isEmpty()s

android
Chris Smith 15 years ago
parent
commit
3e5269fd71

+ 1
- 1
src/com/dmdirc/Channel.java View File

@@ -299,7 +299,7 @@ public final class Channel extends MessageTarget
299 299
     private void updateTitle() {
300 300
         String temp = Styliser.stipControlCodes(channelInfo.getName());
301 301
 
302
-        if (!channelInfo.getTopic().isEmpty()) {
302
+        if (channelInfo.getTopic().length() > 0) {
303 303
             temp = temp + " - " + Styliser.stipControlCodes(channelInfo.getTopic());
304 304
         }
305 305
 

+ 4
- 4
src/com/dmdirc/ChannelEventHandler.java View File

@@ -143,7 +143,7 @@ public final class ChannelEventHandler extends EventHandler implements
143 143
 
144 144
         owner.doNotification("channel"
145 145
                 + (isMyself(cChannelClient) ? "Self" : "") + "Part"
146
-                + (sReason.isEmpty() ? "" : "Reason"), CoreActionType.CHANNEL_PART,
146
+                + (sReason.length() == 0 ? "" : "Reason"), CoreActionType.CHANNEL_PART,
147 147
                 cChannelClient, sReason);
148 148
         owner.removeClient(cChannelClient);
149 149
     }
@@ -155,7 +155,7 @@ public final class ChannelEventHandler extends EventHandler implements
155 155
             final String sReason, final String sKickedByHost) {
156 156
         checkParser(tParser);
157 157
 
158
-        owner.doNotification("channelKick" + (sReason.isEmpty() ? "" : "Reason"),
158
+        owner.doNotification("channelKick" + (sReason.length() == 0 ? "" : "Reason"),
159 159
                 CoreActionType.CHANNEL_KICK, cKickedByClient, cKickedClient, sReason);
160 160
         owner.removeClient(cKickedClient);
161 161
     }
@@ -166,7 +166,7 @@ public final class ChannelEventHandler extends EventHandler implements
166 166
             final ChannelClientInfo cChannelClient, final String sReason) {
167 167
         checkParser(tParser);
168 168
 
169
-        owner.doNotification("channelQuit" + (sReason.isEmpty() ? "" : "Reason"),
169
+        owner.doNotification("channelQuit" + (sReason.length() == 0 ? "" : "Reason"),
170 170
                 CoreActionType.CHANNEL_QUIT, cChannelClient, sReason);
171 171
         owner.removeClient(cChannelClient);
172 172
     }
@@ -202,7 +202,7 @@ public final class ChannelEventHandler extends EventHandler implements
202 202
             final String sModes) {
203 203
         checkParser(tParser);
204 204
 
205
-        if (sHost.isEmpty()) {
205
+        if (sHost.length() == 0) {
206 206
             owner.doNotification(sModes.length() <= 1 ? "channelNoModes"
207 207
                     : "channelModeDiscovered", CoreActionType.CHANNEL_MODESDISCOVERED,
208 208
                     sModes.length() <= 1 ? "" : sModes);

+ 1
- 1
src/com/dmdirc/Query.java View File

@@ -296,7 +296,7 @@ public final class Query extends MessageTarget implements
296 296
     public void onQuit(final IRCParser tParser, final ClientInfo cClient,
297 297
             final String sReason) {
298 298
         if (cClient.getNickname().equals(ClientInfo.parseHost(host))) {
299
-            final StringBuffer format = new StringBuffer(sReason.isEmpty()
299
+            final StringBuffer format = new StringBuffer(sReason.length() == 0
300 300
                 ? "queryQuit" : "queryQuitReason");
301 301
 
302 302
             ActionManager.processEvent(CoreActionType.QUERY_QUIT, format, this, sReason);

+ 2
- 2
src/com/dmdirc/Server.java View File

@@ -792,7 +792,7 @@ public final class Server extends WritableFrameContainer implements Serializable
792 792
         if (parser == null) {
793 793
             throw new IllegalStateException("getNetwork called when "
794 794
                     + "parser is null (state: " + getState() + ")");
795
-        } else if (parser.getNetworkName().isEmpty()) {
795
+        } else if (parser.getNetworkName().length() == 0) {
796 796
             return getNetworkFromServerName(parser.getServerName());
797 797
         } else {
798 798
             return parser.getNetworkName();
@@ -1100,7 +1100,7 @@ public final class Server extends WritableFrameContainer implements Serializable
1100 1100
             }
1101 1101
         }
1102 1102
 
1103
-        if (offset < alts.size() && !alts.get(offset).isEmpty()) {
1103
+        if (offset < alts.size() && alts.get(offset).length() > 0) {
1104 1104
             newNick = alts.get(offset);
1105 1105
         }
1106 1106
 

+ 1
- 1
src/com/dmdirc/WritableFrameContainer.java View File

@@ -93,7 +93,7 @@ public abstract class WritableFrameContainer extends FrameContainer {
93 93
         int lines = 0;
94 94
         
95 95
         for (String splitLine : splitLines) {
96
-            if (splitLine.isEmpty() || getMaxLineLength() <= 0) {
96
+            if (splitLine.length() == 0 || getMaxLineLength() <= 0) {
97 97
                 lines++;
98 98
             } else {
99 99
                 lines += (int) Math.ceil(splitLine.length() / (double) getMaxLineLength());

+ 1
- 1
src/com/dmdirc/util/CipherUtils.java View File

@@ -234,7 +234,7 @@ public class CipherUtils {
234 234
                         "passwordHash");
235 235
             }
236 236
 
237
-            while ((password == null || password.isEmpty()) && tries < AUTH_TRIES) {
237
+            while ((password == null || password.length() == 0) && tries < AUTH_TRIES) {
238 238
                 password = getPassword(prompt);
239 239
                 if (passwordHash == null) {
240 240
                     passwordHash = hash(password);

+ 2
- 2
src/com/dmdirc/util/ConfigFile.java View File

@@ -112,12 +112,12 @@ public class ConfigFile extends TextFile {
112 112
         for (String line : getLines()) {
113 113
             String tline = line;
114 114
             
115
-            while (!tline.isEmpty() && (tline.charAt(0) == '\t' || 
115
+            while (tline.length() > 0 && (tline.charAt(0) == '\t' || 
116 116
                     tline.charAt(0) == ' ')) {
117 117
                 tline = tline.substring(1);
118 118
             }
119 119
 
120
-            if (tline.indexOf('#') == 0 || tline.isEmpty()) {
120
+            if (tline.indexOf('#') == 0 || tline.length() == 0) {
121 121
                 continue;
122 122
             } else if (
123 123
                     (tline.endsWith(":") && !tline.endsWith("\\:"))

+ 1
- 1
src/com/dmdirc/util/IrcAddress.java View File

@@ -128,7 +128,7 @@ public class IrcAddress implements Serializable {
128 128
         for (String channel : channels.substring(1).split(",")) {
129 129
             if (!channel.equalsIgnoreCase("needpass") && 
130 130
                     !channel.equalsIgnoreCase("needkey") &&
131
-                    !channel.equalsIgnoreCase("isnick") && !channel.isEmpty()) {
131
+                    !channel.equalsIgnoreCase("isnick") && channel.length() > 0) {
132 132
                 this.channels.add(channel);
133 133
             }
134 134
         }

+ 2
- 2
src/com/dmdirc/util/URLHandler.java View File

@@ -131,7 +131,7 @@ public class URLHandler {
131 131
 
132 132
         final String command = config.getOption("protocol", uri.getScheme(), "");
133 133
 
134
-        if (command.isEmpty()) {
134
+        if (command.length() == 0) {
135 135
             Main.getUI().showURLDialog(uri);
136 136
             return;
137 137
         }
@@ -200,7 +200,7 @@ public class URLHandler {
200 200
             port = String.valueOf(url.getPort());
201 201
         }
202 202
 
203
-        if (userInfo != null && !userInfo.isEmpty()) {
203
+        if (userInfo != null && userInfo.length() > 0) {
204 204
             if (userInfo.indexOf(':') == -1) {
205 205
                 username = userInfo;
206 206
             } else {

Loading…
Cancel
Save