Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 1.12
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      the Javasource output from the JavaDocBuilder does not show the actual code (some reformatting)

      package de.lgohlke.qdox;
      
      import java.io.File;
      import java.io.IOException;
      
      import org.junit.Test;
      
      import com.thoughtworks.qdox.JavaDocBuilder;
      import com.thoughtworks.qdox.model.JavaClass;
      import com.thoughtworks.qdox.model.JavaSource;
      
      public class QdoxBug
      {
        @Test
        public void testBug() throws IOException
        {
          File file = new File("src/test/java/de/lgohlke/qdox/QdoxBug.java");
      
          JavaSource source = new JavaDocBuilder().addSource(file);
      
          for (JavaClass clazz : source.getClasses())
          {
            System.out.println(clazz.getSource().toString());
          }
        }
      }
      

      this is really annoying, can it be fixed?

        Activity

        Hide
        Lars K. W. Gohlke added a comment -

        I found the line number from other parser are not matching the qdox numbers.

        Show
        Lars K. W. Gohlke added a comment - I found the line number from other parser are not matching the qdox numbers.
        Robert Scholte made changes -
        Field Original Value New Value
        Testcase included yes
        Hide
        Robert Scholte added a comment -

        It looks like you're talking about two different things.
        First of all: QDox was created to be able to parse java-code and construct a model with it. It's actually a feature that QDox can write this model to a file. The model doesn't keep any formatting information.
        With QDox-2.0 it will be possible to define your own writer, which means you have full control of how a generated file should look like.
        The line numbers you're talking about are based on the *source*file, not the file generated by QDox.

        Show
        Robert Scholte added a comment - It looks like you're talking about two different things. First of all: QDox was created to be able to parse java-code and construct a model with it. It's actually a feature that QDox can write this model to a file. The model doesn't keep any formatting information. With QDox-2.0 it will be possible to define your own writer, which means you have full control of how a generated file should look like. The line numbers you're talking about are based on the *source*file, not the file generated by QDox.
        Hide
        Lars K. W. Gohlke added a comment -

        Ok, I relying heavily on the feature to write out.

        But the source code is not as read, but it seems be so this is kind of error-prone.

        So best would be to have a standard not changing writer. The writer concept seems for me the best solution for that.

        Anyway great work! When it comes the time, that are users complaining because of additional features, u did a really good job

        Show
        Lars K. W. Gohlke added a comment - Ok, I relying heavily on the feature to write out. But the source code is not as read, but it seems be so this is kind of error-prone. So best would be to have a standard not changing writer. The writer concept seems for me the best solution for that. Anyway great work! When it comes the time, that are users complaining because of additional features, u did a really good job
        Hide
        Robert Scholte added a comment -

        FYI: QDox-2.0 won't be backwards compatible with previous versions. It requires java5 and uses Lists with generics instead of arrays. There are still a few things I'd like to change, so maybe I'll start releasing a few alpha's somewhere soon.
        But could you be more specific. I don't see a test or two examples of what you get and what you would have expected. Just to be sure so I can close this issue.

        Show
        Robert Scholte added a comment - FYI: QDox-2.0 won't be backwards compatible with previous versions. It requires java5 and uses Lists with generics instead of arrays. There are still a few things I'd like to change, so maybe I'll start releasing a few alpha's somewhere soon. But could you be more specific. I don't see a test or two examples of what you get and what you would have expected. Just to be sure so I can close this issue.
        Hide
        Lars K. W. Gohlke added a comment -

        Just adjust the Path for this test (it reads itself) and see the output.

        It differs, else I could write an explicit test.

        Show
        Lars K. W. Gohlke added a comment - Just adjust the Path for this test (it reads itself) and see the output. It differs, else I could write an explicit test.
        Robert Scholte made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Robert Scholte [ rfscholte ]
        Resolution Not A Bug [ 6 ]

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Lars K. W. Gohlke
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: