[hg] main-silver: Warning elimination - @Override and brackets.

  • From:
  • To:
  • Subject: [hg] main-silver: Warning elimination - @Override and brackets.
  • Date: Thu, 21 Feb 2013 19:39:15 -0800

changeset 39b6ecafce1c in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/39b6ecafce1c
description:
        Warning elimination - @Override and brackets.

diffstat:

 
debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/VariablesNodeModel.java
 |  145 ++++++---
 1 files changed, 92 insertions(+), 53 deletions(-)

diffs (316 lines):

diff --git 
a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/VariablesNodeModel.java
 
b/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/VariablesNodeModel.java
--- 
a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/VariablesNodeModel.java
+++ 
b/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/VariablesNodeModel.java
@@ -50,8 +50,6 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
-import java.util.Vector;
-import org.netbeans.api.debugger.DebuggerEngine;
 import org.netbeans.api.debugger.jpda.ClassVariable;
 import org.netbeans.api.debugger.jpda.JPDAClassType;
 import org.netbeans.api.debugger.jpda.ReturnVariable;
@@ -132,20 +130,27 @@
     }
     
     
+    @Override
     public String getDisplayName (Object o) throws UnknownTypeException {
-        if (o == TreeModel.ROOT)
-            return NbBundle.getBundle (VariablesNodeModel.class).getString 
-                ("CTL_LocalsModel_Column_Name_Name");
-        if (o instanceof Field)
+        if (o == TreeModel.ROOT) {
+            return NbBundle.getMessage 
+                (VariablesNodeModel.class, 
"CTL_LocalsModel_Column_Name_Name");
+        }
+        if (o instanceof Field) {
             return ((Field) o).getName ();
-        if (o instanceof LocalVariable)
+        }
+        if (o instanceof LocalVariable) {
             return ((LocalVariable) o).getName ();
-        if (o instanceof Super)
+        }
+        if (o instanceof Super) {
             return "super"; // NOI18N
-        if (o instanceof This)
+        }
+        if (o instanceof This) {
             return "this"; // NOI18N
-        if (o == "NoInfo") // NOI18N
+        }
+        if (o == "NoInfo") { // NOI18N
             return NbBundle.getMessage(VariablesNodeModel.class, 
"CTL_No_Info");
+        }
         if (o == "No current thread") { // NOI18N
             return NbBundle.getMessage(VariablesNodeModel.class, 
"NoCurrentThreadVar");
         }
@@ -220,11 +225,14 @@
     
     private final Map shortDescriptionMap = new HashMap();
     
+    @Override
     public String getShortDescription (final Object o) throws 
UnknownTypeException {
-        if (o == TreeModel.ROOT)
-            return 
NbBundle.getBundle(VariablesNodeModel.class).getString("CTL_LocalsModel_Column_Name_Desc");
-        if (o == "NoInfo") // NOI18N
+        if (o == TreeModel.ROOT) {
+            return NbBundle.getMessage(VariablesNodeModel.class, 
"CTL_LocalsModel_Column_Name_Desc");
+        }
+        if (o == "NoInfo") {// NOI18N
             return NbBundle.getMessage(VariablesNodeModel.class, 
"CTL_No_Info_descr");
+        }
         if (o == "No current thread") { // NOI18N
             return NbBundle.getMessage(VariablesNodeModel.class, 
"NoCurrentThreadVar");
         }
@@ -288,6 +296,7 @@
         testKnown(o);
         // Called from AWT - we need to postpone the work...
         evaluationRP.post(new Runnable() {
+            @Override
             public void run() {
                 Object shortDescription = getShortDescriptionSynch(o);
                 if (shortDescription != null && 
!"".equals(shortDescription)) {
@@ -307,55 +316,61 @@
             if (o instanceof ObjectVariable) {
                 String type = ((ObjectVariable) o).getType ();
                 String declaredType = ((Field) o).getDeclaredType ();
-                if (type.equals (declaredType))
+                if (type.equals (declaredType)) {
                     try {
                         return "(" + type + ") " + 
                             getLimitedToString((ObjectVariable) o);
                     } catch (InvalidExpressionException ex) {
                         return ex.getLocalizedMessage ();
                     }
-                else
+                } else {
                     try {
                         return "(" + declaredType + ") " + "(" + type + ") " 

                             getLimitedToString((ObjectVariable) o);
                     } catch (InvalidExpressionException ex) {
                         return ex.getLocalizedMessage ();
                     }
-            } else
+                }
+            } else {
                 return "(" + ((Field) o).getDeclaredType () + ") " + 
                     ((Field) o).getValue ();
         }
+        }
         if (o instanceof LocalVariable) {
             if (o instanceof ObjectVariable) {
                 String type = ((ObjectVariable) o).getType ();
                 String declaredType = ((LocalVariable) o).getDeclaredType ();
-                if (type.equals (declaredType))
+                if (type.equals (declaredType)) {
                     try {
                         return "(" + type + ") " + 
                             getLimitedToString((ObjectVariable) o);
                     } catch (InvalidExpressionException ex) {
                         return ex.getLocalizedMessage ();
                     }
-                else
+                } else {
                     try {
                         return "(" + declaredType + ") " + "(" + type + ") " 

                             getLimitedToString((ObjectVariable) o);
                     } catch (InvalidExpressionException ex) {
                         return ex.getLocalizedMessage ();
                     }
-            } else
+                }
+            } else {
                 return "(" + ((LocalVariable) o).getDeclaredType () + ") " + 
                     ((LocalVariable) o).getValue ();
         }
-        if (o instanceof Super)
+        }
+        if (o instanceof Super) {
             return ((Super) o).getType ();
-        if (o instanceof This)
+        }
+        if (o instanceof This) {
             try {
                 return "(" + ((This) o).getType () + ") " + 
                     getLimitedToString((This) o);
             } catch (InvalidExpressionException ex) {
                 return ex.getLocalizedMessage ();
             }
+        }
         return null;
         //throw new UnknownTypeException (o);
     }
@@ -378,78 +393,98 @@
     }
     
     protected void testKnown(Object o) throws UnknownTypeException {
-        if (o == TreeModel.ROOT) return ;
-        if (o instanceof Field) return ;
-        if (o instanceof LocalVariable) return ;
-        if (o instanceof Super) return ;
-        if (o instanceof This) return ;
+        if (o == TreeModel.ROOT ||
+            o instanceof Field ||
+            o instanceof LocalVariable ||
+            o instanceof Super ||
+            o instanceof This) {
+            
+            return ;
+        }
         String str = o.toString();
-        if (str.startsWith("SubArray")) return ; // NOI18N
-        if (o == "NoInfo") return ; // NOI18N
-        if (o == "No current thread") return ; // NOI18N
-        if (o == "lastOperations") return ; // NOI18N
-        if (o instanceof String && ((String) 
o).startsWith("operationArguments ")) return ; // NOI18N
-        if (o == "NativeMethodException") return ; // NOI18N
-        if (o == "noDebugInfoWarning") return ; // NOI18N
-        if (o instanceof JPDAClassType) return ;
-        if (o instanceof ClassVariable) return ;
-        if (o instanceof ReturnVariable) return ;
-        if (o instanceof ExceptionVariableImpl) return ;
-        if (o instanceof FieldReadVariableImpl) return ;
-        if (o instanceof FieldToBeVariableImpl) return ;
-        if (o instanceof Operation) return ;
+        if (str.startsWith("SubArray") ||   // NOI18N
+            o == "NoInfo" ||                // NOI18N
+            o == "No current thread" ||     // NOI18N
+            o == "lastOperations" ||        // NOI18N
+            o instanceof String && ((String) 
o).startsWith("operationArguments ") || // NOI18N
+            o == "NativeMethodException" || // NOI18N
+            o == "noDebugInfoWarning" ||    // NOI18N
+            o instanceof JPDAClassType ||
+            o instanceof ClassVariable ||
+            o instanceof ReturnVariable ||
+            o instanceof ExceptionVariableImpl ||
+            o instanceof FieldReadVariableImpl ||
+            o instanceof FieldToBeVariableImpl ||
+            o instanceof Operation) {
+            
+            return ;
+        }
         throw new UnknownTypeException (o);
     }
     
+    @Override
     public String getIconBase (Object o) throws UnknownTypeException {
         throw new UnsupportedOperationException("Not supported.");
     }
 
+    @Override
     public boolean canRename(Object node) throws UnknownTypeException {
         return false;
     }
 
+    @Override
     public boolean canCopy(Object node) throws UnknownTypeException {
         return false;
     }
 
+    @Override
     public boolean canCut(Object node) throws UnknownTypeException {
         return false;
     }
 
+    @Override
     public Transferable clipboardCopy(Object node) throws IOException,
                                                           
UnknownTypeException {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
+    @Override
     public Transferable clipboardCut(Object node) throws IOException,
                                                          
UnknownTypeException {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
+    @Override
     public PasteType[] getPasteTypes(Object node, Transferable t) throws 
UnknownTypeException {
         return null;
     }
 
+    @Override
     public void setName(Object node, String name) throws 
UnknownTypeException {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
+    @Override
     public String getIconBaseWithExtension(Object node) throws 
UnknownTypeException {
-        if (node == TreeModel.ROOT)
-            return FIELD;
-        if (node instanceof Field) {
-            if (((Field) node).isStatic ())
-                return STATIC_FIELD;
-            else
+        if (node == TreeModel.ROOT) {
                 return FIELD;
         }
-        if (node instanceof LocalVariable)
+        if (node instanceof Field) {
+            if (((Field) node).isStatic ()) {
+                return STATIC_FIELD;
+            } else {
+                return FIELD;
+            }
+        }
+        if (node instanceof LocalVariable) {
             return LOCAL;
-        if (node instanceof Super)
+        }
+        if (node instanceof Super) {
             return SUPER;
-        if (node instanceof This)
+        }
+        if (node instanceof This) {
             return FIELD;
+        }
         if (node instanceof JPDAClassType) {
             return STATIC;
         }
@@ -459,7 +494,7 @@
         if (node instanceof Operation) {
             return EXPR_ARGUMENTS;
         }
-        if (node instanceof ReturnVariable || node == "lastOperations") {
+        if (node instanceof ReturnVariable || node == "lastOperations") {    
   // NOI18N
             return RETURN;
         }
         if (node instanceof ExceptionVariableImpl) {
@@ -468,28 +503,32 @@
         if (node instanceof FieldReadVariableImpl || node instanceof 
FieldToBeVariableImpl) {
             return FIELD;
         }
-        if (node == "noDebugInfoWarning") {
+        if (node == "noDebugInfoWarning") {                                  
   // NOI18N
             return NO_DEBUG_INFO;
         }
         if (node instanceof String && ((String) 
node).startsWith("operationArguments ")) { // NOI18N
             return EXPR_ARGUMENTS;
         }
-        if (node.toString().startsWith("SubArray")) // NOI18N
+        if (node.toString().startsWith("SubArray")) {                        
   // NOI18N
             return LOCAL;
-        if (node == "NoInfo" || node == "No current thread" || node == 
"NativeMethodException") // NOI18N
+        }
+        if (node == "NoInfo" || node == "No current thread" || node == 
"NativeMethodException") {// NOI18N
             return null;
+        }
         if (node instanceof Variable) {
             return LOCAL;
         }
         throw new UnknownTypeException (node);
     }
     
+    @Override
     public void addModelListener (ModelListener l) {
         synchronized (modelListeners) {
             modelListeners.add(l);
         }
     }
 
+    @Override
     public void removeModelListener (ModelListener l) {
         synchronized (modelListeners) {
             modelListeners.remove(l);

[hg] main-silver: Warning elimination - @Override and brackets.

mentlicher 02/22/2013

Project Features

About this Project

Debugger was started in November 2009, is owned by tpavek, and has 29 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close