Quellcode durchsuchen

Remove some redundant casts.

Change-Id: I7b4c7348eb44d731347546105a3a6c66fb132aa8
Reviewed-on: http://gerrit.dmdirc.com/3882
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
changes/82/3882/2
Chris Smith vor 9 Jahren
Ursprung
Commit
57d088b6fe

+ 1
- 1
logging/src/com/dmdirc/addons/logging/LoggingManager.java Datei anzeigen

@@ -746,7 +746,7 @@ public class LoggingManager implements ConfigChangeListener {
746 746
         final String descriptor;
747 747
 
748 748
         if (target instanceof Channel) {
749
-            descriptor = ((Channel) target).getName();
749
+            descriptor = target.getName();
750 750
         } else if (target instanceof Query) {
751 751
             final Parser parser = target.getConnection().getParser();
752 752
             descriptor = parser.getClient(((PrivateChat) target).getHost()).getNickname();

+ 2
- 2
nowplaying/src/com/dmdirc/addons/nowplaying/NowPlayingManager.java Datei anzeigen

@@ -159,11 +159,11 @@ public class NowPlayingManager {
159 159
     private void removePlugin(final PluginInfo target) {
160 160
         final Plugin targetPlugin = target.getPlugin();
161 161
         if (targetPlugin instanceof MediaSource) {
162
-            sources.remove((MediaSource) targetPlugin);
162
+            sources.remove(targetPlugin);
163 163
         }
164 164
 
165 165
         if (targetPlugin instanceof MediaSourceManager) {
166
-            managers.remove((MediaSourceManager) targetPlugin);
166
+            managers.remove(targetPlugin);
167 167
         }
168 168
     }
169 169
 

+ 1
- 1
parser_xmpp/src/com/dmdirc/addons/parser_xmpp/XmppParser.java Datei anzeigen

@@ -286,7 +286,7 @@ public class XmppParser extends BaseSocketAwareParser {
286 286
 
287 287
     @Override
288 288
     public List<String> getServerInformationLines() {
289
-        return Collections.<String>emptyList(); // TODO
289
+        return Collections.emptyList(); // TODO
290 290
     }
291 291
 
292 292
     @Override

+ 4
- 4
ui_swing/src/com/dmdirc/addons/ui_swing/components/addonbrowser/DataLoaderWorker.java Datei anzeigen

@@ -147,7 +147,7 @@ public class DataLoaderWorker
147 147
             } catch (final IOException ex) {
148 148
                 loadingPanel.removeAll();
149 149
                 loadingPanel.add(new TextLabel("Unable to download feeds: " + ex.getMessage()));
150
-                return Collections.<AddonInfo>emptyList();
150
+                return Collections.emptyList();
151 151
             }
152 152
         }
153 153
 
@@ -157,7 +157,7 @@ public class DataLoaderWorker
157 157
         try {
158 158
             data.read();
159 159
         } catch (final IOException | InvalidConfigFileException ex) {
160
-            return Collections.<AddonInfo>emptyList();
160
+            return Collections.emptyList();
161 161
         }
162 162
 
163 163
         final List<AddonInfo> list = new ArrayList<>();
@@ -177,10 +177,10 @@ public class DataLoaderWorker
177 177
         try {
178 178
             data = get();
179 179
         } catch (final InterruptedException ex) {
180
-            data = Collections.<AddonInfo>emptyList();
180
+            data = Collections.emptyList();
181 181
         } catch (final ExecutionException ex) {
182 182
             eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, ex, ex.getMessage(), ""));
183
-            data = Collections.<AddonInfo>emptyList();
183
+            data = Collections.emptyList();
184 184
         }
185 185
         final int selectedRow;
186 186
         if (table.getRowCount() > 0 && table.getSelectedRow() > 0) {

+ 1
- 1
ui_swing/src/com/dmdirc/addons/ui_swing/components/renderers/ToStringListCellRenderer.java Datei anzeigen

@@ -45,7 +45,7 @@ public class ToStringListCellRenderer<E> extends MethodListCellRenderer<E> {
45 45
      */
46 46
     public ToStringListCellRenderer(final ListCellRenderer<? super E> parentRenderer,
47 47
             final Class<? super E> type) {
48
-        super(parentRenderer, ToStringListCellRenderer.<E>getMethod(type));
48
+        super(parentRenderer, ToStringListCellRenderer.getMethod(type));
49 49
     }
50 50
 
51 51
     private static <E> Method getMethod(final Class<? super E> type) {

+ 1
- 2
ui_swing/src/com/dmdirc/addons/ui_swing/components/text/WrapLabelView.java Datei anzeigen

@@ -7,7 +7,6 @@ package com.dmdirc.addons.ui_swing.components.text;
7 7
 
8 8
 import javax.swing.text.BadLocationException;
9 9
 import javax.swing.text.Element;
10
-import javax.swing.text.GlyphView;
11 10
 import javax.swing.text.LabelView;
12 11
 import javax.swing.text.View;
13 12
 
@@ -61,7 +60,7 @@ public class WrapLabelView extends LabelView {
61 60
                 final int index = getDocument().getText(p0, p1 - p0)
62 61
                         .indexOf("\r");
63 62
                 if (index >= 0) {
64
-                    return (GlyphView) createFragment(p0, p0 + index + 1);
63
+                    return createFragment(p0, p0 + index + 1);
65 64
                 }
66 65
             } catch (BadLocationException ex) {
67 66
                 //should never happen

+ 2
- 2
ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/profiles/ProfileManagerModel.java Datei anzeigen

@@ -196,7 +196,7 @@ public class ProfileManagerModel {
196 196
     public void setSelectedProfile(final Object selectedProfile) {
197 197
         if (selectedProfile != null
198 198
                 && !profiles.isEmpty()
199
-                && profiles.contains((Profile) selectedProfile)) {
199
+                && profiles.contains(selectedProfile)) {
200 200
             upadateSelectedProfile((Profile) selectedProfile);
201 201
         }
202 202
         pcs.firePropertyChange("selectedprofile", null, null);
@@ -316,7 +316,7 @@ public class ProfileManagerModel {
316 316
     public void setSelectedNickname(final Object selectedNickname) {
317 317
         if (selectedProfile != null
318 318
                 && selectedNickname instanceof String
319
-                && selectedProfile.getNicknames().contains((String) selectedNickname)) {
319
+                && selectedProfile.getNicknames().contains(selectedNickname)) {
320 320
             this.selectedNickname = (String) selectedNickname;
321 321
             pcs.firePropertyChange("selectednickname", null, null);
322 322
         }

Laden…
Abbrechen
Speichern