Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 206100 - [71cat] UnsupportedOperationException: Not supported element kind:RESOURCE_VARIABLE Tree = 'session'
[71cat] UnsupportedOperationException: Not supported element kind:RESOURCE_VA...
Product: debugger
Classification: Unclassified
Component: Java
All All
: P3 (vote)
: 7.1.1
Assigned To: Martin Entlicher
EXCEPTIONS_REPORT, 71patch1-verified
Depends on:
  Show dependency treegraph
Reported: 2011-12-07 16:45 UTC by _ gtzabari
Modified: 2012-02-27 13:43 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT

stacktrace (2.66 KB, text/plain)
2011-12-07 16:45 UTC, _ gtzabari

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2011-12-07 16:45:25 UTC
This bug was originally marked as duplicate of bug 157191, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.1 RC2 (Build 201111302200)
VM: Java HotSpot(TM) Client VM, 21.1-b02, Java(TM) SE Runtime Environment, 1.7.0_01-b08
OS: Windows 7

User Comments:
gtzabari: Placed caret on top of "session" variable for evaluation. Exception thrown.

java.lang.UnsupportedOperationException: Not supported element kind:RESOURCE_VARIABLE Tree = 'session'
   at org.netbeans.modules.debugger.jpda.expr.EvaluatorVisitor.visitIdentifier(
   at org.netbeans.modules.debugger.jpda.expr.EvaluatorVisitor.visitIdentifier(
   at com.sun.source.util.TreePathScanner.scan(
   at org.netbeans.modules.debugger.jpda.expr.EvaluatorVisitor.scan(
   at org.netbeans.modules.debugger.jpda.expr.EvaluatorVisitor.scan(
Comment 1 _ gtzabari 2011-12-07 16:45:29 UTC
Created attachment 113932 [details]
Comment 2 Martin Entlicher 2011-12-08 10:17:57 UTC
Reproduced with a small program:

    public static void main(String[] args) {
        System.out.println("Hello World.");
        try (DataOutputStream os = new DataOutputStream(new FileOutputStream("/tmp/xTestHello.hello"));) {
            os.writeChars("Hello World!\n");
        } catch (EOFException e) {
        } catch (IOException ioex) {

When trying to evaluate "os" in debugger, it throws this exception.
Comment 3 Martin Entlicher 2011-12-08 13:28:29 UTC
It's fixed by changeset:   208605:d7a5471edf3f

I'm making this a candidate for 7.1 patch.
Comment 4 Martin Entlicher 2011-12-08 13:31:29 UTC
Oops, the last comment was intended for issue #206096, please ignore.

This is fixed by changeset:   208606:e586a7ee25ad
Comment 5 Quality Engineering 2011-12-09 12:10:49 UTC
Integrated into 'main-golden'
Log: #206100 Handle resource variables.
Comment 6 Jiri Kovalsky 2012-01-18 12:13:07 UTC
If I get it right, this issue is erroneously marked as candidate for 7.1.1. Correct?
Comment 7 Martin Entlicher 2012-01-19 14:17:55 UTC
Well, it was marked as candidate for 7.1.1 by a mistake, but I've decided to leave it there, since the patch is very simple and very unlikely to do any harm. And users trying to use the new language features can easily run into this bug.
Comment 8 Jiri Kovalsky 2012-01-20 10:32:07 UTC
I see. The problem is that I was not able to reproduce this exception even in 7.1. I toggled line breakpoint as indicated below, started debugging and invoked "Debug > Evaluate Expression...". Typed "os" and pushed "Evaluate code fragment" button. New "os" variable was created in "Variables" tab and no exception was thrown.

public static void main(String[] args) {
    System.out.println("Hello World.");
    try {
        DataOutputStream os = new DataOutputStream(new FileOutputStream("/tmp/xTestHello.hello"));
        os.writeChars("Hello World!\n"); // Toggle line breakpoint here
    } catch (EOFException e) {
    } catch (IOException ioex) {

Any exact steps to reproduce?
Comment 9 Jiri Kovalsky 2012-01-20 10:45:22 UTC
Oh, sorry. This is JDK 7 specific issue. Reproduced in NetBeans 7.1 with JDK 7 and the original code fragment and verified as fixed in development build #201201170601 of NetBeans 7.2.
Comment 10 Martin Entlicher 2012-01-31 14:31:11 UTC
Fix transplanted to release71_fixes branch: changeset: 218584:7e87846ed376

Increased specification version by changeset:   218587:50816e61e6b9
Comment 11 Jiri Kovalsky 2012-02-27 13:43:17 UTC
The bug is fixed in NetBeans IDE 7.1.1 build #201202262200.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo