jdk/src/share/classes/com/sun/tools/example/debug/tty/TTY.java
changeset 9520 99d378796e54
parent 5506 202f599c92aa
child 10292 ed7db6a12c2a
--- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTY.java	Fri Apr 22 17:03:51 2011 +0100
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTY.java	Tue Apr 26 12:49:34 2011 +0200
@@ -47,34 +47,43 @@
      */
     private static final String progname = "jdb";
 
+    @Override
     public void vmStartEvent(VMStartEvent se)  {
         Thread.yield();  // fetch output
         MessageOutput.lnprint("VM Started:");
     }
 
+    @Override
     public void vmDeathEvent(VMDeathEvent e)  {
     }
 
+    @Override
     public void vmDisconnectEvent(VMDisconnectEvent e)  {
     }
 
+    @Override
     public void threadStartEvent(ThreadStartEvent e)  {
     }
 
+    @Override
     public void threadDeathEvent(ThreadDeathEvent e)  {
     }
 
+    @Override
     public void classPrepareEvent(ClassPrepareEvent e)  {
     }
 
+    @Override
     public void classUnloadEvent(ClassUnloadEvent e)  {
     }
 
+    @Override
     public void breakpointEvent(BreakpointEvent be)  {
         Thread.yield();  // fetch output
         MessageOutput.lnprint("Breakpoint hit:");
     }
 
+    @Override
     public void fieldWatchEvent(WatchpointEvent fwe)  {
         Field field = fwe.field();
         ObjectReference obj = fwe.object();
@@ -90,11 +99,13 @@
         }
     }
 
+    @Override
     public void stepEvent(StepEvent se)  {
         Thread.yield();  // fetch output
         MessageOutput.lnprint("Step completed:");
     }
 
+    @Override
     public void exceptionEvent(ExceptionEvent ee) {
         Thread.yield();  // fetch output
         Location catchLocation = ee.catchLocation();
@@ -108,6 +119,7 @@
         }
     }
 
+    @Override
     public void methodEntryEvent(MethodEntryEvent me) {
         Thread.yield();  // fetch output
         /*
@@ -125,6 +137,7 @@
         }
     }
 
+    @Override
     public boolean methodExitEvent(MethodExitEvent me) {
         Thread.yield();  // fetch output
         /*
@@ -173,6 +186,7 @@
         return false;
     }
 
+    @Override
     public void vmInterrupted() {
         Thread.yield();  // fetch output
         printCurrentLocation();
@@ -184,6 +198,7 @@
         MessageOutput.printPrompt();
     }
 
+    @Override
     public void receivedEvent(Event event) {
     }
 
@@ -317,18 +332,19 @@
         //           Adapted for use with String[][0].
         int low = 0;
         int high = commandList.length - 1;
-        long i = 0;
         while (low <= high) {
             int mid = (low + high) >>> 1;
             String midVal = commandList[mid][0];
             int compare = midVal.compareTo(key);
-            if (compare < 0)
+            if (compare < 0) {
                 low = mid + 1;
-            else if (compare > 0)
+            } else if (compare > 0) {
                 high = mid - 1;
-            else
+            }
+            else {
                 return mid; // key found
         }
+        }
         return -(low + 1);  // key not found.
     };
 
@@ -336,7 +352,9 @@
      * Return true if the command is OK when disconnected.
      */
     private boolean isDisconnectCmd(int ii) {
-        if (ii < 0 || ii >= commandList.length) return false;
+        if (ii < 0 || ii >= commandList.length) {
+            return false;
+        }
         return (commandList[ii][1].equals("y"));
     }
 
@@ -344,7 +362,9 @@
      * Return true if the command is OK when readonly.
      */
     private boolean isReadOnlyCmd(int ii) {
-        if (ii < 0 || ii >= commandList.length) return false;
+        if (ii < 0 || ii >= commandList.length) {
+            return false;
+        }
         return (commandList[ii][2].equals("y"));
     };