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.
Summary: | ClassCastException: com.sun.tools.javac.tree.JCTree$JCErroneous cannot be cast to com.sun.tools.javac.tree.JCTree$JCIdent | ||
---|---|---|---|
Product: | java | Reporter: | aldobrucale <aldobrucale> |
Component: | Compiler | Assignee: | Dusan Balek <dbalek> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | aldobrucale, almson, cybersoft, gholmer, jbsabmello, lhochet, MackSix, markiewb, mdeggersbeans, mfriedenhagen, mslama, muellermi, ovrabec, petrk, sdedic, sreimers, theshadow27, tnleeuw, yardus |
Priority: | P1 | Keywords: | 7.4_HR_FIX |
Version: | 7.4 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | 203520 |
Attachments: |
stacktrace
stacktrace stacktrace stacktrace stacktrace stacktrace Project to use for reproduction. stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace |
Description
aldobrucale
2013-09-02 15:13:48 UTC
Created attachment 139586 [details]
stacktrace
Created attachment 139613 [details]
stacktrace
Deleted a line in java. An if statement is missing the closing brace. The code looks like this:
while (reader.hasNext()) {
final String name = reader.nextName();
if ("sections".equals(name)) {
--- deleted line here
// } else {
// reader.skipValue();
// }
}
Created attachment 139616 [details]
stacktrace
Added try { to a long piece of code.
This bug already has 5 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=203520 Created attachment 139694 [details]
stacktrace
Exception occured while editing Java-Code.
Created attachment 139696 [details]
stacktrace
Just editing code in java editor
Created attachment 139744 [details]
stacktrace
1. had an ArrayList<String> tempWordList = new ArrayList<string>();
2. changed delcreation to ListModel<String> tempWordList= new DefaultListModel<String>();
3. attmepted to changed line tempWordList.add(line) to tempWordList.addElement(line)
4. while backspacking out the part "addElement(line)", I think I backspaced and removed the dot and when I typed the dot again, this exception was thrown.
Will try to reproduce
1. Open attached project Illuminator_1.zip and file. 2. Open UserWordListModel.java in editor. 3. Go to line 82 and remove the comments "//". 4. Go to line 83 and remove the comments "//". This exception is thrown. Product Version: NetBeans IDE Dev (Build 201309040001) Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b55 Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b40 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb) Created attachment 139745 [details]
Project to use for reproduction.
This bug already has 10 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=203520 Created attachment 139839 [details]
stacktrace
Editing in editor when cursor at the end of
try{ Thread.sl
The scenario from comment #8 is reproducable in dev build. Possibly the defect is in com.sun.tools.javac.tree.TreeInfo.getEndPos(), the switch branch for ERRONEOUS contains a hardly intended fall-through to the IDENT case. Created attachment 139849 [details]
stacktrace
created inner class
Created attachment 139850 [details]
stacktrace
typed else {
Created attachment 139872 [details]
stacktrace
Typing the closing bracket in the try clause
try {
ProcessBuilder pb = new ProcessBuilder(LAUNCHER, p.toString(), TEST_CLASSES, "TestApplication");
Process prc = pb.start();
monitorProcess(prc.getInputStream(), "TestApplication", null);
prc.waitFor();
}
(In reply to Svata Dedic from comment #12) > The scenario from comment #8 is reproducable in dev build. Possibly the > defect is in com.sun.tools.javac.tree.TreeInfo.getEndPos(), the switch > branch for ERRONEOUS contains a hardly intended fall-through to the IDENT > case. Yes, that is not intended, there should be a break in the erroneous section. Sorry for that. Created attachment 139923 [details]
stacktrace
edit java code
Created attachment 139926 [details]
stacktrace
finishing: } catch (IllegalArgumentException ex)
This bug already has 20 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=203520 Created attachment 139934 [details]
stacktrace
typing
Created attachment 139941 [details]
stacktrace
Editing Java code. Error comes up repeatedly.
Created attachment 139955 [details]
stacktrace
Writing generics code with jdk8
Created attachment 139968 [details]
stacktrace
edit after paste
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/33dfbc4b9364 http://hg.netbeans.org/main/nb-javac/rev/bf149ece9888 verified in trunk The fix is OK. Integrated into release74. http://hg.netbeans.org/releases/rev/cc09ed195044 Integrated into 'main-silver', will be available in build *201309150002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/33dfbc4b9364 User: Dusan Balek <dbalek@netbeans.org> Log: Issue #235421: ClassCastException: com.sun.tools.javac.tree.JCTree$JCErroneous cannot be cast to com.sun.tools.javac.tree.JCTree$JCIdent - fixed. verified in 7.4 rc1 |