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.

View | Details | Raw Unified | Return to bug 142405
Collapse All | Expand All

(-)a/java.hints/src/org/netbeans/modules/java/hints/errors/Utilities.java (-3 / +8 lines)
Lines 99-108 Link Here
99
        String name = getName(et);
99
        String name = getName(et);
100
        
100
        
101
        if (name == null) {
101
        if (name == null) {
102
            if(et instanceof LiteralTree) {
102
            if (et instanceof LiteralTree) {
103
                String guess = (String) ((LiteralTree) et).getValue();
103
                LiteralTree literalTree= (LiteralTree) et;
104
                if (guess != null)
104
                 //142405 check is LiteralTree.getValue() String before cast
105
                if (literalTree.getValue() instanceof String) {
106
                    String guess = (String) literalTree.getValue();
105
                    return guessLiteralName(guess);
107
                    return guessLiteralName(guess);
108
                } else {
109
                     return DEFAULT_NAME;
110
                }
106
            } else
111
            } else
107
                return DEFAULT_NAME;
112
                return DEFAULT_NAME;
108
        }
113
        }

Return to bug 142405