[hg] main-silver: Some warnings eliminated.

  • From:
  • To:
  • Subject: [hg] main-silver: Some warnings eliminated.
  • Date: Thu, 07 Mar 2013 13:00:38 -0800

changeset b97b2706532a in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/b97b2706532a
description:
        Some warnings eliminated.

diffstat:

 debugger.jpda/src/org/netbeans/modules/debugger/jpda/util/Operator.java |  
43 ++++++---
 1 files changed, 27 insertions(+), 16 deletions(-)

diffs (148 lines):

diff --git 
a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/util/Operator.java 
b/debugger.jpda/src/org/netbeans/modules/debugger/jpda/util/Operator.java
--- a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/util/Operator.java
+++ b/debugger.jpda/src/org/netbeans/modules/debugger/jpda/util/Operator.java
@@ -159,8 +159,9 @@
         } catch (VMDisconnectedExceptionWrapper ex) {
             eventQueue = null;
         }
-        if (eventQueue == null)
+        if (eventQueue == null) {
             throw new NullPointerException ();
+        }
         this.debugger = debugger;
         final AWTGrabHandler awtGrabHandler = new AWTGrabHandler(debugger);
         final SuspendCount suspendCount = new SuspendCount();
@@ -203,7 +204,9 @@
                      if (eventSet == null) {
                         try {
                             synchronized (Operator.this) {
-                                if (stop) break;
+                                if (stop) {
+                                    break;
+                                }
                                 canInterrupt = true;
                             }
                             if (logger.isLoggable(Level.FINE)) {
@@ -261,7 +264,9 @@
                      }
                  }
              }// for
-             if (finalizer != null) finalizer.run ();
+             if (finalizer != null) {
+                 finalizer.run ();
+             }
              //S ystem.out.println ("Operator end"); // NOI18N
              finalizer = null;
              eventQueue = null;
@@ -474,9 +479,9 @@
                     if (logger.isLoggable(Level.FINE)) {
                         logger.fine("EVENT: " + e + " REQUEST: null"); // 
NOI18N
                     }
-                } else
+                } else {
                     exec = eventsToProcess.get(e);
-
+                }
                 if (logger.isLoggable(Level.FINE)) {
                     printEvent (e, exec);
                 }
@@ -530,7 +535,7 @@
                 } else {
                     List<PropertyChangeEvent> events = 
debugger.notifySuspendAll(false, false, ignoredThreads);
                     if (eventAccessLock != null) {
-                        logger.finer("Write access lock 
RELEASED:"+eventAccessLock);
+                        logger.log(Level.FINER, "Write access lock 
RELEASED:{0}", eventAccessLock);
                         eventAccessLock.unlock();
                         eventAccessLock = null;
                     }
@@ -546,7 +551,7 @@
                 } else {
                     PropertyChangeEvent event = 
suspendedThread.notifySuspended(false, false);
                     if (eventAccessLock != null) {
-                        logger.finer("Write access lock 
RELEASED:"+eventAccessLock);
+                        logger.log(Level.FINER, "Write access lock 
RELEASED:{0}", eventAccessLock);
                         eventAccessLock.unlock();
                         eventAccessLock = null;
                     }
@@ -618,12 +623,14 @@
             if (session != null) {
                 
DebuggerManager.getDebuggerManager().setCurrentSession(session);
             }
-            if (thref != null) debugger.setStoppedState (thref, 
suspendedAll);
+            if (thref != null) {
+                debugger.setStoppedState (thref, suspendedAll);
+            }
         }
 
         } finally {
             if (eventAccessLock != null) {
-                logger.finer("Write access lock RELEASED:"+eventAccessLock);
+                logger.log(Level.FINER, "Write access lock RELEASED:{0}", 
eventAccessLock);
                 eventAccessLock.unlock();
             }
             if (resume && threadWasInitiallySuspended) {
@@ -678,7 +685,9 @@
     }
     
     private static void dumpThreadsStatus(VirtualMachine vm) {
-        if (!logger.isLoggable(Level.FINE)) return;
+        if (!logger.isLoggable(Level.FINE)) {
+            return;
+        }
         logger.fine("DUMP of threads:\n");
         List<ThreadReference> allThreads = vm.allThreads();
         for (ThreadReference t : allThreads) {
@@ -748,7 +757,9 @@
      */
     public void stop() {
         synchronized (this) {
-            if (stop) return ; // Do not interrupt the thread when we're 
stopped
+            if (stop) {
+                return ;    // Do not interrupt the thread when we're stopped
+            }
             stop = true;
             if (canInterrupt) {
                 thread.interrupt();
@@ -897,13 +908,13 @@
         int suspendPolicy = EventSetWrapper.suspendPolicy(eventSet);
         if (suspendPolicy == EventRequest.SUSPEND_ALL) {
             // Event suspended all threads, including those in which a 
method is being invoked.
-            logger.fine("methodInvokingThreads = "+methodInvokingThreads);
+            logger.log(Level.FINE, "methodInvokingThreads = {0}", 
methodInvokingThreads);
             synchronized (methodInvokingThreads) {
                 for (ThreadReference tr : methodInvokingThreads) {
                     try {
                         ThreadReferenceWrapper.resume(tr);
                         resumedThreads.add(tr);
-                        logger.fine("  resumed threads = "+resumedThreads);
+                        logger.log(Level.FINE, "  resumed threads = {0}", 
resumedThreads);
                     } catch (ObjectCollectedExceptionWrapper ex) {
                     } catch (IllegalThreadStateExceptionWrapper ex) {
                     }
@@ -917,7 +928,7 @@
                     resumed = resumedThreads;
                 }
                 threadsResumedForEvents.put(eventSet, resumed);
-                logger.fine("Set threadsResumedForEvents "+resumed+" for 
events "+System.identityHashCode(eventSet));
+                logger.log(Level.FINE, "Set threadsResumedForEvents {0} for 
events {1}", new Object[]{resumed, System.identityHashCode(eventSet)});
             }
             // We handle resumed threads later - exclude them from 
notifying, etc.
             // TODO: If we hit this just before a method invoke, the thread 
will be suspended double-times.
@@ -946,7 +957,7 @@
                     // Ignore events that occur during method invocations
                     // in the invocation thread completely
                     if (logger.isLoggable(Level.FINE)) {
-                        logger.fine("testIgnoreEvent("+eventSet+") = 
"+Collections.emptySet());
+                        logger.log(Level.FINE, "testIgnoreEvent({0}) = []", 
eventSet);
                     }
                     return Collections.emptySet();
                 }
@@ -955,7 +966,7 @@
         Set<ThreadReference> threadsToResume = null;
         if (suspendPolicy == EventRequest.SUSPEND_ALL) {
             // Event suspended all threads, including those in which a 
method is being invoked.
-            logger.fine("methodInvokingThreads = "+methodInvokingThreads);
+            logger.log(Level.FINE, "methodInvokingThreads = {0}", 
methodInvokingThreads);
             synchronized (methodInvokingThreads) {
                 if (!methodInvokingThreads.isEmpty()) {
                     threadsToResume = new 
HashSet<ThreadReference>(methodInvokingThreads);

[hg] main-silver: Some warnings eliminated.

mentlicher 03/07/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 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close