You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2019/08/27 20:03:52 UTC

[GitHub] [netbeans] jglick commented on issue #1463: INSANE bugs

jglick commented on issue #1463: INSANE bugs
URL: https://github.com/apache/netbeans/pull/1463#issuecomment-525460613
 
 
   It is still failing to find a root reference which, for example, YourKit displays:
   
   ```
   … →
   hudson.model.Hudson.queue →
   hudson.model.Queue.leftItems →
   com.google.common.cache.LocalCache$LocalManualCache.localCache →
   com.google.common.cache.LocalCache.segments →
   com.google.common.cache.LocalCache$Segment[].<index> →
   com.google.common.cache.LocalCache$Segment.table →
   java.util.concurrent.atomic.AtomicReferenceArray.array →
   java.lang.Object[].<index> →
   com.google.common.cache.LocalCache$StrongWriteEntry.valueReference →
   com.google.common.cache.LocalCache$StrongValueReference.referent →
   hudson.model.Queue$LeftItem.task →
   org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask.body →
   org.jenkinsci.plugins.workflow.cps.CpsBodyExecution.outcome →
   com.cloudbees.groovy.cps.Outcome.normal →
   java.lang.Class(p.C).classLoader →
   <target>
   ```
   
   I checked that implementing [this TODO](https://github.com/jenkinsci/jenkins-test-harness/blob/e10ad3fe19a3c8a722400217d64162a03d97ac77/src/main/java/org/jvnet/hudson/test/MemoryAssert.java#L250-L254) did not help, because `MemoryAssert` already works out:
   
   ```diff
   diff --git a/harness/o.n.insane/src/org/netbeans/insane/impl/InsaneEngine.java b/harness/o.n.insane/src/org/netbeans/insane/impl/InsaneEngine.java
   index e1a1b5b1ac..f47fbf1586 100644
   --- a/harness/o.n.insane/src/org/netbeans/insane/impl/InsaneEngine.java
   +++ b/harness/o.n.insane/src/org/netbeans/insane/impl/InsaneEngine.java
   @@ -190,7 +190,12 @@ try {
            //if (cls.getName().startsWith("org.netbeans.insane.scanner")) return; // skip refs from myself
    
            ClassLoader cl = cls.getClassLoader();
   -        if ( cl != null) recognize(cl);
   +        if (cl != null) {
   +            if (filter.accept(cl, cls, null)) {
   +                recognize(cl);
   +                if (objects.isKnown(cl)) visitor.visitObjectReference(objects, cls, cl, /* cannot get a Field for Class.classLoader */ null);
   +            }
   +        }
    
            // process only fields declared by this class,
            // fields of all superclasses were already processed in separate run.
   diff --git a/harness/o.n.insane/src/org/netbeans/insane/scanner/SimpleXmlVisitor.java b/harness/o.n.insane/src/org/netbeans/insane/scanner/SimpleXmlVisitor.java
   index 2f48f271d4..cea5a72f45 100644
   --- a/harness/o.n.insane/src/org/netbeans/insane/scanner/SimpleXmlVisitor.java
   +++ b/harness/o.n.insane/src/org/netbeans/insane/scanner/SimpleXmlVisitor.java
   @@ -120,7 +120,7 @@ public final class SimpleXmlVisitor implements Visitor {
        }
        
        private static String getFldName(Field fld) {
   -        return fld.getDeclaringClass().getName() + "." + fld.getName();
   +        return fld == null ? "?" : fld.getDeclaringClass().getName() + "." + fld.getName();
        }
    
    
   ```
   
   So not sure why INSANE fails in this case.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists