You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Detelin Yordanov (JIRA)" <ji...@apache.org> on 2009/07/23 16:33:14 UTC

[jira] Created: (AXIS2-4443) Schema generation for inner classes is not backward compatible

Schema generation for inner classes is not backward compatible
--------------------------------------------------------------

                 Key: AXIS2-4443
                 URL: https://issues.apache.org/jira/browse/AXIS2-4443
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: kernel
    Affects Versions: 1.5
            Reporter: Detelin Yordanov


In Axis2 1.5  schema types generated for inner classes have just the name of the class, while in Axis2 1.4.1 the name of the type incorporated the name of the parent class, e.g.

class Parent {
    class Inner {
    }
}

Axis2 1.4.1 created a complex type named "Parent_Inner" for the Inner class (it was replacing the dollar character in "Parent$Inner" with an underscore), while Axis2 1.5 creates just "Inner" type.

The reason must be in using Class#getSimpleName(), this method does not return the parent class prefix as the annogen's JClass#getSimpleName() did in Axis2 1.4.1.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AXIS2-4443) Schema generation for inner classes is not backward compatible

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735692#action_12735692 ] 

Andreas Veithen commented on AXIS2-4443:
----------------------------------------

Detelin,

I tried to apply the patch to the trunk, but that causes a test failure:

Failed tests: 
  testGeneratesExtraClass(org.apache.axis2.description.java2wsdl.DefaultSchemaGeneratorTest)

Can you have a look at why this test fails?

> Schema generation for inner classes is not backward compatible
> --------------------------------------------------------------
>
>                 Key: AXIS2-4443
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4443
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.5
>            Reporter: Detelin Yordanov
>            Assignee: Andreas Veithen
>         Attachments: DefaultSchemaGenerator.diff, InnerClassTestService.aar, InnerClassTestService.wsdl
>
>
> In Axis2 1.5  schema types generated for inner classes have just the name of the class, while in Axis2 1.4.1 the name of the type incorporated the name of the parent class, e.g.
> class Parent {
>     class Inner {
>     }
> }
> Axis2 1.4.1 created a complex type named "Parent_Inner" for the Inner class (it was replacing the dollar character in "Parent$Inner" with an underscore), while Axis2 1.5 creates just "Inner" type.
> The reason must be in using Class#getSimpleName(), this method does not return the parent class prefix as the annogen's JClass#getSimpleName() did in Axis2 1.4.1.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AXIS2-4443) Schema generation for inner classes is not backward compatible

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen resolved AXIS2-4443.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.6

Detelin,

I changed the test case (so that it is independent of the way inner classes are represented) and committed your patch. Thanks for contributing!

> Schema generation for inner classes is not backward compatible
> --------------------------------------------------------------
>
>                 Key: AXIS2-4443
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4443
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.5
>            Reporter: Detelin Yordanov
>            Assignee: Andreas Veithen
>             Fix For: 1.6
>
>         Attachments: DefaultSchemaGenerator.diff, InnerClassTestService.aar, InnerClassTestService.wsdl
>
>
> In Axis2 1.5  schema types generated for inner classes have just the name of the class, while in Axis2 1.4.1 the name of the type incorporated the name of the parent class, e.g.
> class Parent {
>     class Inner {
>     }
> }
> Axis2 1.4.1 created a complex type named "Parent_Inner" for the Inner class (it was replacing the dollar character in "Parent$Inner" with an underscore), while Axis2 1.5 creates just "Inner" type.
> The reason must be in using Class#getSimpleName(), this method does not return the parent class prefix as the annogen's JClass#getSimpleName() did in Axis2 1.4.1.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AXIS2-4443) Schema generation for inner classes is not backward compatible

Posted by "Detelin Yordanov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735509#action_12735509 ] 

Detelin Yordanov commented on AXIS2-4443:
-----------------------------------------

Hi Andreas,
  Yes, this is in the class responsible for schema generation - org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator in Axis2 kernel.



> Schema generation for inner classes is not backward compatible
> --------------------------------------------------------------
>
>                 Key: AXIS2-4443
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4443
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.5
>            Reporter: Detelin Yordanov
>            Assignee: Andreas Veithen
>         Attachments: InnerClassTestService.aar, InnerClassTestService.wsdl
>
>
> In Axis2 1.5  schema types generated for inner classes have just the name of the class, while in Axis2 1.4.1 the name of the type incorporated the name of the parent class, e.g.
> class Parent {
>     class Inner {
>     }
> }
> Axis2 1.4.1 created a complex type named "Parent_Inner" for the Inner class (it was replacing the dollar character in "Parent$Inner" with an underscore), while Axis2 1.5 creates just "Inner" type.
> The reason must be in using Class#getSimpleName(), this method does not return the parent class prefix as the annogen's JClass#getSimpleName() did in Axis2 1.4.1.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AXIS2-4443) Schema generation for inner classes is not backward compatible

Posted by "Detelin Yordanov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Detelin Yordanov updated AXIS2-4443:
------------------------------------

    Attachment: DefaultSchemaGenerator.diff

A patch against axis2 1.5 branch. The solution is to replace the Class#getSimpleName() with a custom method which uses Class#getName(). The latter will return the enclosing class name as part of the class name (replacing the dollar with underscore):

org.apache.axis2.test.Parent$Inner  -> Parent_Inner

> Schema generation for inner classes is not backward compatible
> --------------------------------------------------------------
>
>                 Key: AXIS2-4443
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4443
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.5
>            Reporter: Detelin Yordanov
>            Assignee: Andreas Veithen
>         Attachments: DefaultSchemaGenerator.diff, InnerClassTestService.aar, InnerClassTestService.wsdl
>
>
> In Axis2 1.5  schema types generated for inner classes have just the name of the class, while in Axis2 1.4.1 the name of the type incorporated the name of the parent class, e.g.
> class Parent {
>     class Inner {
>     }
> }
> Axis2 1.4.1 created a complex type named "Parent_Inner" for the Inner class (it was replacing the dollar character in "Parent$Inner" with an underscore), while Axis2 1.5 creates just "Inner" type.
> The reason must be in using Class#getSimpleName(), this method does not return the parent class prefix as the annogen's JClass#getSimpleName() did in Axis2 1.4.1.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AXIS2-4443) Schema generation for inner classes is not backward compatible

Posted by "Detelin Yordanov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Detelin Yordanov updated AXIS2-4443:
------------------------------------

    Attachment: InnerClassTestService.wsdl
                InnerClassTestService.aar

A web service which demonstrates the problem and the invalid WSDL generated by Axis2 1.5.

> Schema generation for inner classes is not backward compatible
> --------------------------------------------------------------
>
>                 Key: AXIS2-4443
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4443
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.5
>            Reporter: Detelin Yordanov
>         Attachments: InnerClassTestService.aar, InnerClassTestService.wsdl
>
>
> In Axis2 1.5  schema types generated for inner classes have just the name of the class, while in Axis2 1.4.1 the name of the type incorporated the name of the parent class, e.g.
> class Parent {
>     class Inner {
>     }
> }
> Axis2 1.4.1 created a complex type named "Parent_Inner" for the Inner class (it was replacing the dollar character in "Parent$Inner" with an underscore), while Axis2 1.5 creates just "Inner" type.
> The reason must be in using Class#getSimpleName(), this method does not return the parent class prefix as the annogen's JClass#getSimpleName() did in Axis2 1.4.1.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AXIS2-4443) Schema generation for inner classes is not backward compatible

Posted by "Detelin Yordanov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735984#action_12735984 ] 

Detelin Yordanov commented on AXIS2-4443:
-----------------------------------------

Hi Andreas,
  The patch was made agains the 1.5 branch, I'm not sure it can be applied to the trunk. 
Regarding the failed DefaultSchemaGeneratorTest - it fails because it expects to find a schema element  "ExtraClass", while after applying the patch, the name of the element will be "DefaultSchemaGeneratorTest_ExtraClass" (since ExtraClass is an inner class).
The test case should be patched to expect "DefaultSchemaGeneratorTest_ExtraClass".

> Schema generation for inner classes is not backward compatible
> --------------------------------------------------------------
>
>                 Key: AXIS2-4443
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4443
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.5
>            Reporter: Detelin Yordanov
>            Assignee: Andreas Veithen
>         Attachments: DefaultSchemaGenerator.diff, InnerClassTestService.aar, InnerClassTestService.wsdl
>
>
> In Axis2 1.5  schema types generated for inner classes have just the name of the class, while in Axis2 1.4.1 the name of the type incorporated the name of the parent class, e.g.
> class Parent {
>     class Inner {
>     }
> }
> Axis2 1.4.1 created a complex type named "Parent_Inner" for the Inner class (it was replacing the dollar character in "Parent$Inner" with an underscore), while Axis2 1.5 creates just "Inner" type.
> The reason must be in using Class#getSimpleName(), this method does not return the parent class prefix as the annogen's JClass#getSimpleName() did in Axis2 1.4.1.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AXIS2-4443) Schema generation for inner classes is not backward compatible

Posted by "Detelin Yordanov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12734993#action_12734993 ] 

Detelin Yordanov commented on AXIS2-4443:
-----------------------------------------

Using Class#getSimpleName() leads to an erroneous schema when there are two classes in a package, which both contain an inner class definition with one and the same name, e.g.:

class Mother {
    public class Child {

    }
}


class Father{
    public class Child {

    }
}

Since Class#getSimpleName() returns just the name of the class, in both cases it will return "Child" and the schema generation will produce
two complex types with one and the same name. Such XML schema is not valid, so the whole service is rendered inaccessible.


> Schema generation for inner classes is not backward compatible
> --------------------------------------------------------------
>
>                 Key: AXIS2-4443
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4443
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.5
>            Reporter: Detelin Yordanov
>
> In Axis2 1.5  schema types generated for inner classes have just the name of the class, while in Axis2 1.4.1 the name of the type incorporated the name of the parent class, e.g.
> class Parent {
>     class Inner {
>     }
> }
> Axis2 1.4.1 created a complex type named "Parent_Inner" for the Inner class (it was replacing the dollar character in "Parent$Inner" with an underscore), while Axis2 1.5 creates just "Inner" type.
> The reason must be in using Class#getSimpleName(), this method does not return the parent class prefix as the annogen's JClass#getSimpleName() did in Axis2 1.4.1.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (AXIS2-4443) Schema generation for inner classes is not backward compatible

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen reassigned AXIS2-4443:
--------------------------------------

    Assignee: Andreas Veithen

> Schema generation for inner classes is not backward compatible
> --------------------------------------------------------------
>
>                 Key: AXIS2-4443
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4443
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.5
>            Reporter: Detelin Yordanov
>            Assignee: Andreas Veithen
>         Attachments: InnerClassTestService.aar, InnerClassTestService.wsdl
>
>
> In Axis2 1.5  schema types generated for inner classes have just the name of the class, while in Axis2 1.4.1 the name of the type incorporated the name of the parent class, e.g.
> class Parent {
>     class Inner {
>     }
> }
> Axis2 1.4.1 created a complex type named "Parent_Inner" for the Inner class (it was replacing the dollar character in "Parent$Inner" with an underscore), while Axis2 1.5 creates just "Inner" type.
> The reason must be in using Class#getSimpleName(), this method does not return the parent class prefix as the annogen's JClass#getSimpleName() did in Axis2 1.4.1.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AXIS2-4443) Schema generation for inner classes is not backward compatible

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735409#action_12735409 ] 

Andreas Veithen commented on AXIS2-4443:
----------------------------------------

I confirm this issue.

Detelin, any idea where in the code this happens?

> Schema generation for inner classes is not backward compatible
> --------------------------------------------------------------
>
>                 Key: AXIS2-4443
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4443
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.5
>            Reporter: Detelin Yordanov
>            Assignee: Andreas Veithen
>         Attachments: InnerClassTestService.aar, InnerClassTestService.wsdl
>
>
> In Axis2 1.5  schema types generated for inner classes have just the name of the class, while in Axis2 1.4.1 the name of the type incorporated the name of the parent class, e.g.
> class Parent {
>     class Inner {
>     }
> }
> Axis2 1.4.1 created a complex type named "Parent_Inner" for the Inner class (it was replacing the dollar character in "Parent$Inner" with an underscore), while Axis2 1.5 creates just "Inner" type.
> The reason must be in using Class#getSimpleName(), this method does not return the parent class prefix as the annogen's JClass#getSimpleName() did in Axis2 1.4.1.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.