QDox
  1. QDox
  2. QDOX-152

JavaClass.getFullyQualifiedName() does not work on version 1.9 (version 1.6.3 works without problem). Manual resolve scanning imports are required

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9.1
    • Component/s: Java API
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Hi

      I'm trying to upgrade qdox version from 1.6.3 to 1.9 for myfaces-builder-plugin project.

      On version 1.6.3, JavaClass.getFullyQualifiedName() returns the fully qualified name no matter if the class is part of scanning path or not.

      On version 1.9, suppose a class (source file) that we are scanning, and the parent class is just a class in other jar, the package is omitted and just the class name is returned. I have to scan the imports of the source file to retrieve the "fully qualified name"!!!.

      At first view, this issue is blocker, because a previous version has a correct behavior and this version do not, so if the previous version behavior is correct there is no way to release this library again without solve this issue.

      For now, I'll change the code to scan imports if it is required (because some bugs on 1.6.3 that makes this plugin fail on some conditions are worst than this, and I don't know when could be released this library!).

        Activity

        Hide
        Robert Scholte added a comment - - edited

        Hi Leonardo,

        while developing on QDOX-151 I ran into comparable issues around the full qualified name. So maybe it's more efficient if you can apply a test, 'cause there's a chance it's already fixed in my codebase.

        found this test, which succeeds

        JavaDocBuilderTest.java
         public void testBinaryClassesAreFound() throws Exception {
        
                String in = ""
                        + "package x;"
                        + "import java.util.*;"
                        + "class X {"
                        + " ArrayList a();"
                        + "}";
                builder.addSource(new StringReader(in));
        
                JavaClass cls = builder.getClassByName("x.X");
                Type returnType = cls.getMethods()[0].getReturns();
                JavaClass returnClass = builder.getClassByName(returnType.getValue());
        
                assertEquals("java.util.ArrayList", returnClass.getFullyQualifiedName());
        }
        
        Show
        Robert Scholte added a comment - - edited Hi Leonardo, while developing on QDOX-151 I ran into comparable issues around the full qualified name. So maybe it's more efficient if you can apply a test, 'cause there's a chance it's already fixed in my codebase. found this test, which succeeds JavaDocBuilderTest.java public void testBinaryClassesAreFound() throws Exception { String in = "" + " package x;" + " import java.util.*;" + "class X {" + " ArrayList a();" + "}" ; builder.addSource( new StringReader(in)); JavaClass cls = builder.getClassByName( "x.X" ); Type returnType = cls.getMethods()[0].getReturns(); JavaClass returnClass = builder.getClassByName(returnType.getValue()); assertEquals( "java.util.ArrayList" , returnClass.getFullyQualifiedName()); }
        Hide
        Robert Scholte added a comment -

        r589 | rfscholte | 2009-03-26 22:17:13 CET

        test + fix for qdox-152
        ----------------------------------------------------------------------------

        Show
        Robert Scholte added a comment - r589 | rfscholte | 2009-03-26 22:17:13 CET test + fix for qdox-152 ----------------------------------------------------------------------------
        Robert Scholte made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Fix Version/s 1.10 [ 15020 ]
        Assignee Robert Scholte [ rfscholte ]
        Hide
        Robert Scholte added a comment -

        solution for this issue confirmed by Leonardo Uribe

        Show
        Robert Scholte added a comment - solution for this issue confirmed by Leonardo Uribe
        Robert Scholte made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Paul Hammant made changes -
        Status Closed [ 6 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Paul Hammant made changes -
        Fix Version/s 1.9.1 [ 15252 ]
        Fix Version/s 1.10 [ 15020 ]
        Resolution Fixed [ 1 ]
        Status Reopened [ 4 ] Closed [ 6 ]

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Leonardo Uribe
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: