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.
In the code example below, at the very end, there is a switch statement. It switches through C++11 enum class enumerators Its body is generated by the IDE. Class name is printed twice - Token::Token::Kind::NUMBER instead of Token::Kind::NUMBER Although it compiles OK, the code looks weird. class Token { public: enum class Kind { NUMBER, ALL, LAST, DBL_PERIOD, LPAREN, RPAREN, COMMA, MINUS, INVALID, EOD // end of data marker }; private: Token::Kind kind; int value; public: Token(Token::Kind k, int v = 0); int getValue(); Kind getKind(); bool isValid(); Token& operator=(const Token& other); Token(const Token& other); }; class Tokenizer { const char* curr; bool errors; public: Tokenizer(const char* Curr); bool HasErrors(); Token NextToken(); }; void Parse(const char* rule) { Tokenizer tokenizer(rule); Token tok(Token::Kind::INVALID); while ((tok = tokenizer.NextToken()).isValid()) { switch (tok.getKind()) { // this switch body is generated case Token::Token::Kind::NUMBER: // should be Token::Kind::NUMBER break; case Token::Token::Kind::ALL: // should be Token::Kind::ALL break; // ... default: break; } } }
fixed, change set: http://hg.netbeans.org/cnd-main/rev/0f82909bdc72
Integrated into 'main-silver', will be available in build *201603220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/0f82909bdc72 User: Alexander Simon <alexvsimon@netbeans.org> Log: fixed Bug #258348 Double class name in generated switch statement code
verified in builds on enum server
Verified in NetBeans 8.1 with latest updates.