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 252660 - better recovery on mistake in enum body
Summary: better recovery on mistake in enum body
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-28 19:04 UTC by Vladimir Voskresensky
Modified: 2015-05-30 10:05 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2015-05-28 19:04:42 UTC
enum {

    , LAST
};

in real code it looks like
enum {
#define KEY VALUE
#include "body.h"
    , LAST
};

It would be great to have better parser recovery on the first phase to have possibility to fix fake include later on.
Now enum is empty.
In console I see:
INFO [cnd.logger]: incomplete enum CSM_ENUM_DECLARATION
java.lang.Exception: incomplete enum CSM_ENUM_DECLARATION
[catch] at org.netbeans.modules.cnd.utils.CndUtils.assertTrueInConsole(CndUtils.java:218)
	at org.netbeans.modules.cnd.utils.CndUtils.assertTrueInConsole(CndUtils.java:245)
	at org.netbeans.modules.cnd.modelimpl.csm.EnumImpl.isStronglyTypedEnum(EnumImpl.java:245)
	at org.netbeans.modules.cnd.modelimpl.csm.EnumImpl.<init>(EnumImpl.java:77)
	at org.netbeans.modules.cnd.modelimpl.csm.EnumImpl.create(EnumImpl.java:97)
	at org.netbeans.modules.cnd.modelimpl.csm.core.AstRenderer.createEnum(AstRenderer.java:1400)
	at org.netbeans.modules.cnd.modelimpl.csm.core.AstRenderer.render(AstRenderer.java:185)
	at org.netbeans.modules.cnd.modelimpl.csm.core.AstRenderer.render(AstRenderer.java:122)
	at org.netbeans.modules.cnd.modelimpl.parser.ParserProviderImpl$Antlr2CppParser.render(ParserProviderImpl.java:240)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl._reparse(FileImpl.java:953)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.ensureParsedImpl(FileImpl.java:737)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.ensureParsed(FileImpl.java:619)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread._run(ParserThread.java:148)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread.run(ParserThread.java:74)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThreadManager$Wrapper.run(ParserThreadManager.java:92)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
Comment 1 petrk 2015-05-29 18:40:42 UTC
Fixed in http://hg.netbeans.org/cnd-main/rev/8d949cb65d5b
Comment 2 Quality Engineering 2015-05-30 10:05:52 UTC
Integrated into 'main-silver', will be available in build *201505300811* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/8d949cb65d5b
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Fixed #252660 - better recovery on mistake in enum body