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 256625 - [newcodemodel] AssertionError: getIdentifierInfo() on a tok::raw_identifier token! kind:raw_identifier
Summary: [newcodemodel] AssertionError: getIdentifierInfo() on a tok::raw_identifier t...
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
: 256551 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-11-16 14:48 UTC by Vladimir Voskresensky
Modified: 2016-01-29 14:58 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 221192


Attachments
stacktrace (6.97 KB, text/plain)
2015-11-16 14:48 UTC, Vladimir Voskresensky
Details
The fix might be as simple as this: (1.09 KB, patch)
2015-12-18 21:09 UTC, Vladimir Kvashin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2015-11-16 14:48:09 UTC
Build: NetBeans IDE 8.1 (Build 20151116-3d5ad1f845f6)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.66-b17, Java(TM) SE Runtime Environment, 1.8.0_66-b17
OS: SunOS

User Comments:
vv159170: /net/volvo/export/devarea/osprojects/gcc-master/gcc/testsuite/gcc.dg/cpp/unc4.c




Stacktrace: 
java.lang.AssertionError: getIdentifierInfo() on a tok::raw_identifier token! kind:raw_identifier
   at org.clang.lex.Token.getIdentifierInfo(Token.java:309)
   at org.netbeans.modules.cnd.apt.impl.support.clank.ClankToAPTUtils.getTokenText(ClankToAPTUtils.java:775)
   at org.netbeans.modules.cnd.apt.impl.support.clank.ClankToAPTToken.convert(ClankToAPTToken.java:207)
   at org.netbeans.modules.cnd.apt.impl.support.clank.ClankToAPTToken.convertToAPT(ClankToAPTToken.java:147)
   at org.netbeans.modules.cnd.apt.impl.support.clank.ClankPPCallback$ClankFileInfoWrapper.prepareConvertedTokensIfAny(ClankPPCallback.java:964)
   at org.netbeans.modules.cnd.apt.impl.support.clank.ClankPPCallback$ClankFileInfoWrapper.prepareCaches(ClankPPCallback.java:1031)
Comment 1 Vladimir Voskresensky 2015-11-16 14:48:11 UTC
Created attachment 157359 [details]
stacktrace
Comment 2 Vladimir Voskresensky 2015-11-16 14:50:44 UTC
*** Bug 256551 has been marked as a duplicate of this bug. ***
Comment 3 Vladimir Kvashin 2015-12-14 17:09:03 UTC
I was unable to reproduce this so far. I opened exactly the same file - nothing happened. And the content seems not to be platform specific.
Comment 4 Vladimir Kvashin 2015-12-18 21:08:29 UTC
I was not able to reproduce this. I parsed unconfigured gcc-master on Ubuntu Linux and on Solaris, with GNU and Studio 12.4 tool chains (on both OS) and this exception never repeated.

However, the code is not correct; ClankToAPTUtils.getTokenText calls token.getIdentifierInfo() for each token; but getIdentifierInfo() asserts that the token is not a raw identifier. Below there is the code that processes raw identifiers, but it's too late - assertion is already thrown.
Comment 5 Vladimir Kvashin 2015-12-18 21:09:20 UTC
Created attachment 157850 [details]
The fix might be as simple as this:

Unfortunately I don't quite understand how to reproduce and thus check the fix
Comment 6 Vladimir Kvashin 2015-12-19 17:31:37 UTC
Fix in sputnik:
  3023b49f80b4
Comment 7 Vladimir Kvashin 2015-12-19 17:33:28 UTC
(In reply to Vladimir Kvashin from comment #6)
> Fix in sputnik:
>   3023b49f80b4
Sorry for the typo. The fix is in release81 on enum.
Comment 8 Quality Engineering 2015-12-22 02:27:21 UTC
Integrated into 'main-silver', will be available in build *201512220002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b4c6efc89cfe
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: Fixed #256625 - [newcodemodel] AssertionError: getIdentifierInfo() on a tok::raw_identifier token! kind:raw_identifier
(transplanted from 3023b49f80b4c320e45974c5d50a2dfd50caea55)
Comment 9 ilia 2016-01-27 14:52:45 UTC
  Fixes of this bug:
    http://hg.netbeans.org/releases/rev/3023b49f80b4