QDox

QDox fails to parse correct code

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.7
  • Fix Version/s: 1.8
  • Component/s: Parser
  • Labels:
    None
  • Number of attachments :
    1

Description

Checked with the latest 1.7-snapshot.

QDox fails to parse this code:

package org.carrot2.util.attribute.constraint;

public class Test
{
public enum TestValueSet
{ VALUE_1 }

static class AnnotationContainer
{ @ValueHintEnum(values = TestValueSet.class) String hint; }
}

while it does not have problems when the enum is moved at the end of the class:

package org.carrot2.util.attribute.constraint;

public class Test
{
static class AnnotationContainer
{ @ValueHintEnum(values = TestValueSet.class) String hint; } }

public enum TestValueSet
{ VALUE_1 } }
}

Activity

Hide
Robert Scholte added a comment -

Found the bug and was able to fix it.
The enumMode in the lexer ends with the next Parser.SEMI. This enum didn't contain any.
Fix is setting the enumMode explicit for interfaces, classes, enums and anno's.

Show
Robert Scholte added a comment - Found the bug and was able to fix it. The enumMode in the lexer ends with the next Parser.SEMI. This enum didn't contain any. Fix is setting the enumMode explicit for interfaces, classes, enums and anno's.
Hide
Mauro Talevi added a comment -

Applied patch from Robert Scholte.

Show
Mauro Talevi added a comment - Applied patch from Robert Scholte.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: