Pārlūkot izejas kodu

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 gadus atpakaļ
vecāks
revīzija
4da9c6fffa

+ 5
- 5
src/com/dmdirc/util/ConfigFile.java Parādīt failu

109
         for (String line : getLines()) {
109
         for (String line : getLines()) {
110
             String tline = line;
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
                 tline = tline.substring(1);
114
                 tline = tline.substring(1);
115
             }
115
             }
116
 
116
 
140
             } else if (domain != null && !keydomain) {
140
             } else if (domain != null && !keydomain) {
141
                 flatdomains.add(domain, unescape(tline));
141
                 flatdomains.add(domain, unescape(tline));
142
             } else {
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
 
369
 
370
         return -1;
370
         return -1;
371
     }
371
     }
372
-}
372
+}

+ 2
- 2
src/com/dmdirc/util/DateUtils.java Parādīt failu

74
 
74
 
75
         int seconds = duration;
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
         seconds -= doDuration(buff, seconds, 60, "minute");
79
         seconds -= doDuration(buff, seconds, 60, "minute");
80
         seconds -= doDuration(buff, seconds, 1, "second");
80
         seconds -= doDuration(buff, seconds, 1, "second");
81
 
81
 

+ 2
- 2
src/com/dmdirc/util/DoubleMap.java Parādīt failu

38
  * @param <A> The first type of data to be mapped
38
  * @param <A> The first type of data to be mapped
39
  * @param <B> The second type of data to be mapped
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
     /** The keys in this map. */
43
     /** The keys in this map. */
44
     protected final List<A> keys = new ArrayList<A>();
44
     protected final List<A> keys = new ArrayList<A>();
158
     /** {@inheritDoc} */
158
     /** {@inheritDoc} */
159
     @Override
159
     @Override
160
     public Set<Entry<A, B>> entrySet() {
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
         for (A key : keys) {
162
         for (A key : keys) {
163
             set.add(new SimpleEntry<A, B>(key, getValue(key)));
163
             set.add(new SimpleEntry<A, B>(key, getValue(key)));
164
         }
164
         }

+ 4
- 9
src/com/dmdirc/util/Downloader.java Parādīt failu

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

+ 1
- 1
src/com/dmdirc/util/ReturnableThread.java Parādīt failu

25
 /**
25
 /**
26
  * Normal thread with the potential to return a value.
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
 public abstract class ReturnableThread<T> extends Thread {
30
 public abstract class ReturnableThread<T> extends Thread {
31
 
31
 

+ 1
- 1
src/com/dmdirc/util/RollingList.java Parādīt failu

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

+ 3
- 3
src/com/dmdirc/util/StreamReader.java Parādīt failu

36
     /** This is the Input Stream we are reading. */
36
     /** This is the Input Stream we are reading. */
37
     private final InputStream stream;
37
     private final InputStream stream;
38
     /** List to store output in. */
38
     /** List to store output in. */
39
-    private List<String> list = null;
39
+    private List<String> list;
40
     /** StringBuffer to store output in. */
40
     /** StringBuffer to store output in. */
41
-    private StringBuffer buffer = null; //NOPMD
41
+    private StringBuffer buffer; // NOPMD
42
 
42
 
43
     /**
43
     /**
44
      * Create a new Stream Reader that discards output.
44
      * Create a new Stream Reader that discards output.
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
     @Override
92
     @Override
93
     public void run() {
93
     public void run() {

+ 1
- 1
src/com/dmdirc/util/WeakList.java Parādīt failu

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

+ 1
- 1
src/com/dmdirc/util/WeakMapList.java Parādīt failu

33
  * @param <S> the type of keys maintained by this map
33
  * @param <S> the type of keys maintained by this map
34
  * @param <T> the type of mapped values
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
      * Retrieves the list of values associated with the specified key, creating
39
      * Retrieves the list of values associated with the specified key, creating

+ 3
- 2
src/com/dmdirc/util/validators/PortValidator.java Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt