QDox
  1. QDox
  2. QDOX-256

Full star comment can't be parsed

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Entities that have a comment line that only uses * as in between characters can't be parsed.

      A full star comment line is something like "/**********************************************************************/"

        Activity

        Hide
        Iulian Zuzu added a comment -

        Affected version is <qdox.version>2.0-M2</qdox.version>

        Show
        Iulian Zuzu added a comment - Affected version is <qdox.version>2.0-M2</qdox.version>
        Hide
        Iulian Zuzu added a comment - - edited

        A test showing the parsing error is:

        public void testFullStarCommentLine()
           {
              final JavaProjectBuilder builder = new JavaProjectBuilder();
              final String source =
                    "package com.frequentis.taptools.smarttools.siplivemonitor.sipstack;"
                          + "import javax.sip.ServerTransaction;"
                          + "import javax.sip.message.Request;"
                          + "public interface MessageProcessor{   "
                          + "/**********************************************************************/"
                          + "/*                                                                    */   "
                          + "/*                    Handling request messages                       */   "
                          + "/*                                                                    */   "
                          + "/**********************************************************************/   "
                          + "/**    * Process the ACK received request    "
                          + "* @param serverTransaction - the server transaction associated with the request   "
                          + "* @param ack - the ack request    " + "*/   "
                          + "void processAck( ServerTransaction serverTransaction, Request ack );   "
                          + "}";
              builder.addSource( new StringReader( source ) );
           }
        
        Show
        Iulian Zuzu added a comment - - edited A test showing the parsing error is: public void testFullStarCommentLine() { final JavaProjectBuilder builder = new JavaProjectBuilder(); final String source = " package com.frequentis.taptools.smarttools.siplivemonitor.sipstack;" + " import javax.sip.ServerTransaction;" + " import javax.sip.message.Request;" + " public interface MessageProcessor{ " + "/**********************************************************************/" + "/* */ " + "/* Handling request messages */ " + "/* */ " + "/**********************************************************************/ " + "/** * Process the ACK received request " + "* @param serverTransaction - the server transaction associated with the request " + "* @param ack - the ack request " + "*/ " + "void processAck( ServerTransaction serverTransaction, Request ack ); " + "}" ; builder.addSource( new StringReader( source ) ); }
        Hide
        Iulian Zuzu added a comment - - edited

        The full exception stack for the above is:

        Exception in thread "main" com.thoughtworks.qdox.parser.ParseException: syntax error @[1,245]
        	at com.thoughtworks.qdox.parser.impl.DefaultJavaCommentParser.yyerror(DefaultJavaCommentParser.java:332)
        	at com.thoughtworks.qdox.parser.impl.DefaultJavaCommentParser.yyparse(DefaultJavaCommentParser.java:424)
        	at com.thoughtworks.qdox.parser.impl.DefaultJavaCommentParser.parse(DefaultJavaCommentParser.java:313)
        	at com.thoughtworks.qdox.parser.impl.Parser.onComment(Parser.java:1714)
        	at com.thoughtworks.qdox.parser.impl.JFlexLexer.yylex(JFlexLexer.java:1729)
        	at com.thoughtworks.qdox.parser.impl.JFlexLexer.lex(JFlexLexer.java:830)
        	at com.thoughtworks.qdox.parser.impl.Parser.yylex(Parser.java:1669)
        	at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:1765)
        	at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:1664)
        	at com.thoughtworks.qdox.library.SourceLibrary.parse(SourceLibrary.java:205)
        	at com.thoughtworks.qdox.library.SourceLibrary.parse(SourceLibrary.java:162)
        	at com.thoughtworks.qdox.library.SourceLibrary.addSource(SourceLibrary.java:91)
        	at com.thoughtworks.qdox.library.SourceLibrary.addSource(SourceLibrary.java:86)
        	at com.thoughtworks.qdox.library.SortedClassLibraryBuilder.addSource(SortedClassLibraryBuilder.java:161)
        	at com.thoughtworks.qdox.JavaProjectBuilder.addSource(JavaProjectBuilder.java:173)
        
        Show
        Iulian Zuzu added a comment - - edited The full exception stack for the above is: Exception in thread "main" com.thoughtworks.qdox.parser.ParseException: syntax error @[1,245] at com.thoughtworks.qdox.parser.impl.DefaultJavaCommentParser.yyerror(DefaultJavaCommentParser.java:332) at com.thoughtworks.qdox.parser.impl.DefaultJavaCommentParser.yyparse(DefaultJavaCommentParser.java:424) at com.thoughtworks.qdox.parser.impl.DefaultJavaCommentParser.parse(DefaultJavaCommentParser.java:313) at com.thoughtworks.qdox.parser.impl.Parser.onComment(Parser.java:1714) at com.thoughtworks.qdox.parser.impl.JFlexLexer.yylex(JFlexLexer.java:1729) at com.thoughtworks.qdox.parser.impl.JFlexLexer.lex(JFlexLexer.java:830) at com.thoughtworks.qdox.parser.impl.Parser.yylex(Parser.java:1669) at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:1765) at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:1664) at com.thoughtworks.qdox.library.SourceLibrary.parse(SourceLibrary.java:205) at com.thoughtworks.qdox.library.SourceLibrary.parse(SourceLibrary.java:162) at com.thoughtworks.qdox.library.SourceLibrary.addSource(SourceLibrary.java:91) at com.thoughtworks.qdox.library.SourceLibrary.addSource(SourceLibrary.java:86) at com.thoughtworks.qdox.library.SortedClassLibraryBuilder.addSource(SortedClassLibraryBuilder.java:161) at com.thoughtworks.qdox.JavaProjectBuilder.addSource(JavaProjectBuilder.java:173)
        Hide
        Robert Scholte added a comment -

        It looks like in lexer.flex the following doesn't work as expected: "/*" ~"/"

        Show
        Robert Scholte added a comment - It looks like in lexer.flex the following doesn't work as expected: "/* " ~" /"

          People

          • Assignee:
            Unassigned
            Reporter:
            Iulian Zuzu
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: