QDox
  1. QDox
  2. QDOX-130

Semicolon after Class bounding brace when reading and exporting methods

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7
    • Component/s: Parser
    • Labels:
      None
    • Environment:
      Windows XP / Debian 4.0 Linux / Java 1.5 / qdox-1.6.3.jar / Eclipse
    • Number of attachments :
      0

      Description

      Hi there,

      I try to write a little mock generation application and fail when creating a class definition.
      The output of my methods allways has a semicolon after the last brace.

      My code:

      // Create new source
      final JavaSource source = new JavaSource();

      // Create package information
      source.setPackage("xyz.test");

      // and an import
      source.addImport ("import xyz;");

      // add new class
      final JavaClass targetClass = new JavaClass("MyMockClass");

      // and a new public method
      final JavaMethod javaMethod = new JavaMethod("myMethod");
      javaMethod.setModifiers(new String[]

      { "public" }

      );

      // which returns void
      javaMethod.setReturns(Type.VOID);

      // and has some code between braces
      javaMethod.setSourceCode("

      {...}");

      // add this method to our class
      targetClass.addMethod(javaMethod);

      // and the class to our source
      source.addClass(targetClass);

      // finally output everything
      System.out.println(source);

      And the output contains an unwanted semicolon after class definition:

      package xyz.test ;

      import import xyz;;

      class MyMockClass {

      public void myMethod(){...}

      ;

      }

      Could some one give me a hint how to solve his problem? Is suppose that this is a bug, isn`t it?

      Thank you very much,

      Maciej Andreas Bednarz

        Activity

        Hide
        Maciej Andreas Bednarz added a comment -

        Sorry, I mean not class but method. The semicolon is after the method "}"

        Show
        Maciej Andreas Bednarz added a comment - Sorry, I mean not class but method. The semicolon is after the method "}"
        Hide
        Maciej Andreas Bednarz added a comment -

        I have just tested qdox-1.7-20070527.154641-2.jar . Tis release has the same behavior.

        Show
        Maciej Andreas Bednarz added a comment - I have just tested qdox-1.7-20070527.154641-2.jar . Tis release has the same behavior.
        Hide
        Dennis Lundberg added a comment -

        Tested this with latest version built from svn and there is no semi colon after the method.

        Show
        Dennis Lundberg added a comment - Tested this with latest version built from svn and there is no semi colon after the method.
        Dennis Lundberg made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Fix Version/s 1.7 [ 11160 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Maciej Andreas Bednarz
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: