[hg] main-silver: #222700: Added logging, that might shed some l...

  • From:
  • To:
  • Subject: [hg] main-silver: #222700: Added logging, that might shed some l...
  • Date: Wed, 28 Nov 2012 00:05:17 -0800

changeset fa91f4a8d497 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/fa91f4a8d497
description:
        #222700: Added logging, that might shed some light on the problem 
reported in that issue.

diffstat:

 api.debugger/src/org/netbeans/api/debugger/ActionsManager.java  |  17 
++++++++++
 api.debugger/src/org/netbeans/api/debugger/Lookup.java          |  10 +++++
 api.debugger/src/org/netbeans/spi/debugger/ActionsProvider.java |   5 ++
 3 files changed, 32 insertions(+), 0 deletions(-)

diffs (111 lines):

diff --git a/api.debugger/src/org/netbeans/api/debugger/ActionsManager.java 
b/api.debugger/src/org/netbeans/api/debugger/ActionsManager.java
--- a/api.debugger/src/org/netbeans/api/debugger/ActionsManager.java
+++ b/api.debugger/src/org/netbeans/api/debugger/ActionsManager.java
@@ -47,6 +47,8 @@
 import java.beans.*;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.swing.SwingUtilities;
 
 import org.netbeans.spi.debugger.ActionsProvider;
@@ -120,6 +122,7 @@
      *  @since 1.29 */
     public static final Object              ACTION_EVALUATE = "evaluate";
 
+    private static final Logger logger = 
Logger.getLogger(ActionsManager.class.getName());
 
     // variables 
...............................................................
     
@@ -142,6 +145,7 @@
      */
     ActionsManager (Lookup lookup) {
         this.lookup = lookup;
+        logger.log(Level.INFO, "new ActionsManager({0}) = {1}", new Object[] 
{ lookup, this });
     }
     
     
@@ -478,6 +482,16 @@
     
     private void registerActionsProviders(List<? extends ActionsProvider> 
aps) {
         synchronized (aps) {
+            if (logger.isLoggable(Level.INFO)) {
+                StringBuilder sb = new StringBuilder(this.toString());
+                sb.append(".registerActionsProviders:");
+                for (ActionsProvider ap : aps) {
+                    sb.append("\n  ");
+                    sb.append(ap.toString());
+                }
+                sb.append("\n");
+                logger.info(sb.toString());
+            }
             for (ActionsProvider ap : aps) {
                 Iterator ii = ap.getActions ().iterator ();
                 while (ii.hasNext ())
@@ -491,12 +505,14 @@
         providersChangeListener = new PropertyChangeListener() {
                 @Override
                 public void propertyChange(PropertyChangeEvent evt) {
+                    logger.log(Level.INFO, "{0} Providers lookup changed, 
aps = {1}", new Object[] { this, aps });
                     synchronized (actionProvidersLock) {
                         actionProviders.clear();
                     }
                     registerActionsProviders(aps);
                 }
         };
+        logger.log(Level.INFO, "{0}.initActionImpls(): Add 
ProvidersChangeListener to {1}", new Object[] { this, aps });
         ((Customizer) 
aps).addPropertyChangeListener(providersChangeListener);
         registerActionsProviders(aps);
         synchronized (actionProvidersInitialized) {
@@ -534,6 +550,7 @@
     
     private void destroyIn () {
         ((Customizer) 
aps).removePropertyChangeListener(providersChangeListener);
+        logger.log(Level.INFO, "{0}.destroyIn(): ProvidersChangeListener 
removed from {1}", new Object[] { this, aps });
         synchronized (this) {
             if (lazyListeners != null) {
                 int i, k = lazyListeners.size ();
diff --git a/api.debugger/src/org/netbeans/api/debugger/Lookup.java 
b/api.debugger/src/org/netbeans/api/debugger/Lookup.java
--- a/api.debugger/src/org/netbeans/api/debugger/Lookup.java
+++ b/api.debugger/src/org/netbeans/api/debugger/Lookup.java
@@ -166,6 +166,11 @@
             if (l2 instanceof MetaInf) ((MetaInf) l2).setContext (context);
         }
 
+        @Override
+        public String toString() {
+            return 
"Lookup.Compound@"+Integer.toHexString(hashCode())+"[l1="+l1+", l2="+l2+"]";
+        }
+        
         private class CompoundLookupList<T> extends LookupList<T>
                                             implements PositionedList<T>,
                                                        Customizer,
@@ -574,6 +579,11 @@
             };
         }
 
+        @Override
+        public String toString() {
+            return 
"Lookup.MetaInf@"+Integer.toHexString(hashCode())+"[rootFolder="+rootFolder+"]";
+        }
+        
         private final class ModuleChangeListener implements 
PropertyChangeListener, org.openide.util.LookupListener {
 
             private ClassLoader cl;
diff --git a/api.debugger/src/org/netbeans/spi/debugger/ActionsProvider.java 
b/api.debugger/src/org/netbeans/spi/debugger/ActionsProvider.java
--- a/api.debugger/src/org/netbeans/spi/debugger/ActionsProvider.java
+++ b/api.debugger/src/org/netbeans/spi/debugger/ActionsProvider.java
@@ -493,7 +493,12 @@
             
         }
 
+        @Override
+        public synchronized String toString() {
+            return "ActionsProvider.ContextAware for service 
"+serviceName+", context = "+context+", path = "+path+", delegate = 
"+delegate;
     }
     
 }
 
+}
+

[hg] main-silver: #222700: Added logging, that might shed some l...

mentlicher 11/28/2012

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