瀏覽代碼

Style fixes

Change-Id: I5a1b323d7ed9f83ff30ad4c2da1f1a7de1662757
Reviewed-on: http://gerrit.dmdirc.com/1945
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
tags/0.7rc1
Chris Smith 13 年之前
父節點
當前提交
4da9c6fffa

+ 5
- 5
src/com/dmdirc/util/ConfigFile.java 查看文件

@@ -109,8 +109,8 @@ public class ConfigFile extends TextFile {
109 109
         for (String line : getLines()) {
110 110
             String tline = line;
111 111
 
112
-            while (!tline.isEmpty() && (tline.charAt(0) == '\t' ||
113
-                    tline.charAt(0) == ' ')) {
112
+            while (!tline.isEmpty() && (tline.charAt(0) == '\t'
113
+                    || tline.charAt(0) == ' ')) {
114 114
                 tline = tline.substring(1);
115 115
             }
116 116
 
@@ -140,8 +140,8 @@ public class ConfigFile extends TextFile {
140 140
             } else if (domain != null && !keydomain) {
141 141
                 flatdomains.add(domain, unescape(tline));
142 142
             } else {
143
-                throw new InvalidConfigFileException("Unknown or unexpected" +
144
-                        " line encountered: " + tline);
143
+                throw new InvalidConfigFileException("Unknown or unexpected"
144
+                        + " line encountered: " + tline);
145 145
             }
146 146
         }
147 147
     }
@@ -369,4 +369,4 @@ public class ConfigFile extends TextFile {
369 369
 
370 370
         return -1;
371 371
     }
372
-}
372
+}

+ 2
- 2
src/com/dmdirc/util/DateUtils.java 查看文件

@@ -74,8 +74,8 @@ public final class DateUtils {
74 74
 
75 75
         int seconds = duration;
76 76
 
77
-        seconds -= doDuration(buff, seconds, 60*60*24, "day");
78
-        seconds -= doDuration(buff, seconds, 60*60, "hour");
77
+        seconds -= doDuration(buff, seconds, 60 * 60 * 24, "day");
78
+        seconds -= doDuration(buff, seconds, 60 * 60, "hour");
79 79
         seconds -= doDuration(buff, seconds, 60, "minute");
80 80
         seconds -= doDuration(buff, seconds, 1, "second");
81 81
 

+ 2
- 2
src/com/dmdirc/util/DoubleMap.java 查看文件

@@ -38,7 +38,7 @@ import java.util.Set;
38 38
  * @param <A> The first type of data to be mapped
39 39
  * @param <B> The second type of data to be mapped
40 40
  */
41
-public class DoubleMap<A,B> implements Map<A,B> {
41
+public class DoubleMap<A,B> implements Map<A, B> {
42 42
 
43 43
     /** The keys in this map. */
44 44
     protected final List<A> keys = new ArrayList<A>();
@@ -158,7 +158,7 @@ public class DoubleMap<A,B> implements Map<A,B> {
158 158
     /** {@inheritDoc} */
159 159
     @Override
160 160
     public Set<Entry<A, B>> entrySet() {
161
-        final HashSet<Entry<A, B>> set = new HashSet<Entry<A, B>>();
161
+        final Set<Entry<A, B>> set = new HashSet<Entry<A, B>>();
162 162
         for (A key : keys) {
163 163
             set.add(new SimpleEntry<A, B>(key, getValue(key)));
164 164
         }

+ 4
- 9
src/com/dmdirc/util/Downloader.java 查看文件

@@ -53,11 +53,9 @@ public final class Downloader {
53 53
      *
54 54
      * @param url The URL to retrieve
55 55
      * @return A list of lines received from the server
56
-     * @throws java.net.MalformedURLException If the URL is malformed
57 56
      * @throws java.io.IOException If there's an I/O error while downloading
58 57
      */
59
-    public static List<String> getPage(final String url)
60
-            throws MalformedURLException, IOException {
58
+    public static List<String> getPage(final String url) throws IOException {
61 59
 
62 60
         return getPage(url, "");
63 61
     }
@@ -68,11 +66,10 @@ public final class Downloader {
68 66
      * @param url The URL to retrieve
69 67
      * @param postData The raw POST data to send
70 68
      * @return A list of lines received from the server
71
-     * @throws java.net.MalformedURLException If the URL is malformed
72 69
      * @throws java.io.IOException If there's an I/O error while downloading
73 70
      */
74 71
     public static List<String> getPage(final String url, final String postData)
75
-            throws MalformedURLException, IOException {
72
+            throws IOException {
76 73
 
77 74
         final List<String> res = new ArrayList<String>();
78 75
 
@@ -106,12 +103,10 @@ public final class Downloader {
106 103
      * @param url The URL to retrieve
107 104
      * @param postData A map of post data that should be sent
108 105
      * @return A list of lines received from the server
109
-     * @throws java.net.MalformedURLException If the URL is malformed
110 106
      * @throws java.io.IOException If there's an I/O error while downloading
111 107
      */
112 108
     public static List<String> getPage(final String url,
113
-            final Map<String, String> postData)
114
-            throws MalformedURLException, IOException {
109
+            final Map<String, String> postData) throws IOException {
115 110
         final StringBuilder data = new StringBuilder();
116 111
 
117 112
         for (Map.Entry<String, String> entry : postData.entrySet()) {
@@ -223,4 +218,4 @@ public final class Downloader {
223 218
         return urlConn;
224 219
     }
225 220
 
226
-}
221
+}

+ 1
- 1
src/com/dmdirc/util/ReturnableThread.java 查看文件

@@ -25,7 +25,7 @@ package com.dmdirc.util;
25 25
 /**
26 26
  * Normal thread with the potential to return a value.
27 27
  *
28
- * @param T Type to be returned
28
+ * @param <T> Type to be returned
29 29
  */
30 30
 public abstract class ReturnableThread<T> extends Thread {
31 31
 

+ 1
- 1
src/com/dmdirc/util/RollingList.java 查看文件

@@ -39,7 +39,7 @@ public class RollingList<T> {
39 39
     /** Whether or not to add a fake empty item to the end of this list. */
40 40
     private final boolean addEmpty;
41 41
     /** This list's position pointer. */
42
-    private int position = 0;
42
+    private int position;
43 43
     /** The "empty" item to be added. */
44 44
     private T empty;
45 45
 

+ 3
- 3
src/com/dmdirc/util/StreamReader.java 查看文件

@@ -36,9 +36,9 @@ public class StreamReader extends Thread {
36 36
     /** This is the Input Stream we are reading. */
37 37
     private final InputStream stream;
38 38
     /** List to store output in. */
39
-    private List<String> list = null;
39
+    private List<String> list;
40 40
     /** StringBuffer to store output in. */
41
-    private StringBuffer buffer = null; //NOPMD
41
+    private StringBuffer buffer; // NOPMD
42 42
 
43 43
     /**
44 44
      * Create a new Stream Reader that discards output.
@@ -87,7 +87,7 @@ public class StreamReader extends Thread {
87 87
     }
88 88
 
89 89
     /**
90
-     * Wait for input on stream, and output/throw away/save to list
90
+     * Wait for input on stream, and output/throw away/save to list.
91 91
      */
92 92
     @Override
93 93
     public void run() {

+ 1
- 1
src/com/dmdirc/util/WeakList.java 查看文件

@@ -244,4 +244,4 @@ public class WeakList<T> implements List<T> {
244 244
     public List<T> subList(final int fromIndex, final int toIndex) {
245 245
         return dereferenceList(list.subList(fromIndex, toIndex));
246 246
     }
247
-}
247
+}

+ 1
- 1
src/com/dmdirc/util/WeakMapList.java 查看文件

@@ -33,7 +33,7 @@ import java.util.List;
33 33
  * @param <S> the type of keys maintained by this map
34 34
  * @param <T> the type of mapped values
35 35
  */
36
-public class WeakMapList<S,T> extends MapList<S,T> {
36
+public class WeakMapList<S,T> extends MapList<S, T> {
37 37
 
38 38
     /**
39 39
      * Retrieves the list of values associated with the specified key, creating

+ 3
- 2
src/com/dmdirc/util/validators/PortValidator.java 查看文件

@@ -23,8 +23,6 @@ package com.dmdirc.util.validators;
23 23
 
24 24
 /**
25 25
  * Validates a port number.
26
- *
27
- * @author chris
28 26
  */
29 27
 public class PortValidator extends NumericalValidator {
30 28
 
@@ -34,6 +32,9 @@ public class PortValidator extends NumericalValidator {
34 32
     /** The maximum port number. */
35 33
     private static final int MAX_PORT = 65535;
36 34
 
35
+    /**
36
+     * Creates a new port validator.
37
+     */
37 38
     public PortValidator() {
38 39
         super(MIN_PORT, MAX_PORT);
39 40
     }

Loading…
取消
儲存