This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 223728 - IllegalStateException: ArrayType array class java.lang.Class[] (no class loader) can not have [instance of java.lang.Class[1] (id=1539)] elements.
Summary: IllegalStateException: ArrayType array class java.lang.Class[] (no class load...
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-12 14:05 UTC by mklaehn
Modified: 2012-12-19 02:48 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 196447


Attachments
stacktrace (5.79 KB, text/plain)
2012-12-12 14:05 UTC, mklaehn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mklaehn 2012-12-12 14:05:46 UTC
This issue was reported manually by mklaehn.
It already has 1 duplicates 


Build: NetBeans IDE Dev (Build nbms-and-javadoc-9811-on-20121210)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.6-b04, Java(TM) SE Runtime Environment, 1.7.0_10-ea-b13
OS: Windows 7

User Comments:
mklaehn: evaluating default case with one argument (initArgs.length = 1)

public static Method method(final Class<?> clazz, final String methodName, final Class... initArgs)
    switch (initArgs.length) {
        case 0: return clazz.getMethod(methodName);
        default: return clazz.getMethod(methodName, initArgs);
    }
    return method;
}




Stacktrace: 
java.lang.IllegalStateException: ArrayType array class java.lang.Class[] (no class loader) can not have [instance of java.lang.Class[1] (id=1539)] elements.
   at org.netbeans.modules.debugger.jpda.expr.EvaluatorVisitor.transformVarArgsValues(EvaluatorVisitor.java:478)
   at org.netbeans.modules.debugger.jpda.expr.EvaluatorVisitor.visitMethodInvocation(EvaluatorVisitor.java:444)
   at org.netbeans.modules.debugger.jpda.expr.EvaluatorVisitor.visitMethodInvocation(EvaluatorVisitor.java:192)
   at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1336)
   at org.netbeans.modules.debugger.jpda.expr.EvaluatorVisitor.visitExpressionStatement(EvaluatorVisitor.java:1623)
   at org.netbeans.modules.debugger.jpda.expr.EvaluatorVisitor.visitExpressionStatement(EvaluatorVisitor.java:192)
Comment 1 mklaehn 2012-12-12 14:05:48 UTC
Created attachment 129268 [details]
stacktrace
Comment 2 Martin Entlicher 2012-12-18 10:51:18 UTC
Thanks for the code snippet, reproduced on the following code:

public static void main(String[] args) throws NoSuchMethodException {
    Runtime.runFinalizersOnExit(true);
    Class[] initArgs = new Class[] { Boolean.TYPE };
    Method m = method(Runtime.class, "runFinalizersOnExit", initArgs);
}

public static Method method(final Class<?> clazz, final String methodName, final Class... initArgs) throws NoSuchMethodException {
    switch (initArgs.length) {
        case 0: return clazz.getMethod(methodName);
        default: return clazz.getMethod(methodName, initArgs);
    }
}

When suspended on the last line, evaluate
method(Runtime.class, "runFinalizersOnExit", initArgs)
and the exception is thrown.
Evaluation of
method(Runtime.class, "runFinalizersOnExit", Boolean.TRUE)
works O.K.
Comment 3 Martin Entlicher 2012-12-18 13:20:48 UTC
Fixed by changeset:   243206:08e627deac48
http://hg.netbeans.org/core-main/rev/08e627deac48
Comment 4 Quality Engineering 2012-12-19 02:48:04 UTC
Integrated into 'main-golden', will be available in build *201212190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/08e627deac48
User: mentlicher@netbeans.org
Log: #223728: Varargs methods execution is fixed. Test included.