QDox
  1. QDox
  2. QDOX-183 Parser Errors when processing jdk-src
  3. QDOX-191

Parsing exception due to operator in constructor of a new Object

    Details

    • Type: Sub-task Sub-task
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.10
    • Fix Version/s: 1.11
    • Component/s: Parser
    • Labels:
      None
    • Number of attachments :
      0

      Description

      These exceptions are caused by pre-processing instructions in the java source code. Hence the files do not consist of valid java code and the exceptions are fine. I opened an issue just for completeness. I'll let it to you to decide if you want to handle such cases or just to reject it.

      at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:992)
      at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:1298)
      at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:973)
      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:322)
      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:354)
      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:350)
      at com.thoughtworks.qdox.JavaDocBuilder$2.visitFile(JavaDocBuilder.java:440)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:43)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.scan(DirectoryScanner.java:52)
      at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:437)
      at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:426)
      at ch.fhnw.i4ds.yadoc.MainTest.main(MainTest.java:44)

        Activity

        Hide
        Marco Soldati added a comment -
        /**
         * The left shift operator seems to cause troubles.
         */
        public void testLeftShift() {
        	JavaDocBuilder builder = new JavaDocBuilder();
        	String source = 
        		"private static class Flags {\n" +
        		"	static final Flags LEFT_JUSTIFY = new Flags(1 << 0);\n" +
        		"}\n";
        	builder.addSource(new StringReader(source));
        }
        

        Those files that have an error at position [8;2] contain preprocessing statements and are not valid Java.

        Show
        Marco Soldati added a comment - /** * The left shift operator seems to cause troubles. */ public void testLeftShift() { JavaDocBuilder builder = new JavaDocBuilder(); String source = " private static class Flags {\n" + " static final Flags LEFT_JUSTIFY = new Flags(1 << 0);\n" + "}\n" ; builder.addSource( new StringReader(source)); } Those files that have an error at position [8;2] contain preprocessing statements and are not valid Java.
        Robert Scholte made changes -
        Field Original Value New Value
        Summary Exception #6 Parsing exception due to operator in constructor of a new Object
        Robert Scholte made changes -
        Assignee Robert Scholte [ rfscholte ]
        Robert Scholte made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Robert Scholte added a comment -

        Fixed in rev. 698

        Show
        Robert Scholte added a comment - Fixed in rev. 698
        Robert Scholte made changes -
        Resolution Fixed [ 1 ]
        Fix Version/s 1.11 [ 16104 ]
        Status In Progress [ 3 ] Resolved [ 5 ]

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Marco Soldati
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: