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 249820 - ClassCastException: org.netbeans.modules.cnd.modelimpl.csm.deep.ExpressionStatementImpl cannot be cast to org.netbeans.modules.cnd.api.model.deep.CsmDeclarationStatement
Summary: ClassCastException: org.netbeans.modules.cnd.modelimpl.csm.deep.ExpressionSta...
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-15 06:51 UTC by Exceptions Reporter
Modified: 2015-09-25 01:47 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 214782


Attachments
stacktrace (3.04 KB, text/plain)
2015-01-15 06:51 UTC, Exceptions Reporter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2015-01-15 06:51:55 UTC
This issue was reported manually by alexvsimon.
It already has 1 duplicates 


Build: NetBeans IDE 8.0.2 (Build 201411181905)
VM: Java HotSpot(TM) Client VM, 25.25-b02, Java(TM) SE Runtime Environment, 1.8.0_25-b18
OS: Windows XP

User Comments:
GUEST: error




Stacktrace: 
java.lang.ClassCastException: org.netbeans.modules.cnd.modelimpl.csm.deep.ExpressionStatementImpl cannot be cast to org.netbeans.modules.cnd.api.model.deep.CsmDeclarationStatement
   at org.netbeans.modules.cnd.modelimpl.csm.deep.ForStatementImpl.getDeclaration(ForStatementImpl.java:210)
   at org.netbeans.modules.cnd.completion.csm.CsmStatementResolver.findInner(CsmStatementResolver.java:332)
   at org.netbeans.modules.cnd.completion.csm.CsmStatementResolver.findInnerObject(CsmStatementResolver.java:110)
   at org.netbeans.modules.cnd.completion.csm.CsmStatementResolver.findInner(CsmStatementResolver.java:141)
   at org.netbeans.modules.cnd.completion.csm.CsmStatementResolver.findInnerObject(CsmStatementResolver.java:88)
   at org.netbeans.modules.cnd.completion.csm.CsmStatementResolver.findInner(CsmStatementResolver.java:354)
Comment 1 Exceptions Reporter 2015-01-15 06:51:57 UTC
Created attachment 151517 [details]
stacktrace
Comment 2 Vladimir Kvashin 2015-09-24 12:26:37 UTC
Caused by 
http://hg.netbeans.org/cnd-main/rev
Comment 3 Vladimir Kvashin 2015-09-24 12:33:42 UTC
Caused by 
http://hg.netbeans.org/cnd-main/rev/928fe71ed0c0
which unconditionally casts init statement to declaration statement, while  
for cycle like the one below it's an expression statement

    int i;
    for(i = 0; i < 5; i++) {
        i++;
    }


fixed:
http://hg.netbeans.org/cnd-main/rev/b273d977acfe
Comment 4 Quality Engineering 2015-09-25 01:47:10 UTC
Integrated into 'main-silver', will be available in build *201509250002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b273d977acfe
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: fixed #249820 - ClassCastException: org.netbeans.modules.cnd.modelimpl.csm.deep.ExpressionStatementImpl cannot be cast to org.netbeans.modules.cnd.api.model.deep.CsmDeclarationStatement