You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by "Krzysztof Białek (JIRA)" <ji...@apache.org> on 2005/07/15 19:33:15 UTC

[jira] Created: (OJB-61) xdoclet ojb.reference property class-ref doesn't work with generics

xdoclet ojb.reference property class-ref doesn't work with generics
-------------------------------------------------------------------

         Key: OJB-61
         URL: http://issues.apache.org/jira/browse/OJB-61
     Project: OJB
        Type: Bug
    Versions: 1.0.3    
 Environment: java version: 1.5.0 (build 1.5.0_02-b09)
    Reporter: Krzysztof Białek
    Priority: Minor
 Attachments: ReferenceDescriptorConstraints.java

There is bug inside xdoclet-ojb-module, which cause it to crash when parsing classes using generics feature.

Here is example code:

package some.package;

/**
* @ojb.class
*/
class Foo {
}

/**
* @ojb.class
*/
class Bar<T extends Foo> {
   /**
   * @ojb.reference class-ref="some.package.Foo"
    *                foreignkey="someReferenceId"
    *                database-foreignkey="false"
    *                auto-retrieve="true"
    *                auto-update="none"
    *                auto-delete="none"
   */
   private T someReference;

   /**
   * @ojb.field
   */
   private Integer someReferenceId;
}

I skiped some elements, to make this example shorten.
xdoclet craches when tries to find T class, which doesn't exist of course. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


[jira] Updated: (OJB-61) xdoclet ojb.reference property class-ref doesn't work with generics

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OJB-61?page=all ]

Thomas Dudziak updated OJB-61:
------------------------------

    Version: 1.1 CVS

> xdoclet ojb.reference property class-ref doesn't work with generics
> -------------------------------------------------------------------
>
>          Key: OJB-61
>          URL: http://issues.apache.org/jira/browse/OJB-61
>      Project: OJB
>         Type: Bug
>     Versions: 1.1 CVS, 1.0.3
>  Environment: java version: 1.5.0 (build 1.5.0_02-b09)
>     Reporter: Krzysztof Bia?ek
>     Assignee: Thomas Dudziak
>     Priority: Minor
>  Attachments: ReferenceDescriptorConstraints.java
>
> There is bug inside xdoclet-ojb-module, which cause it to crash when parsing classes using generics feature.
> Here is example code:
> package some.package;
> /**
> * @ojb.class
> */
> class Foo {
> }
> /**
> * @ojb.class
> */
> class Bar<T extends Foo> {
>    /**
>    * @ojb.reference class-ref="some.package.Foo"
>     *                foreignkey="someReferenceId"
>     *                database-foreignkey="false"
>     *                auto-retrieve="true"
>     *                auto-update="none"
>     *                auto-delete="none"
>    */
>    private T someReference;
>    /**
>    * @ojb.field
>    */
>    private Integer someReferenceId;
> }
> I skiped some elements, to make this example shorten.
> xdoclet craches when tries to find T class, which doesn't exist of course. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


[jira] Resolved: (OJB-61) xdoclet ojb.reference property class-ref doesn't work with generics

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OJB-61?page=all ]
     
Thomas Dudziak resolved OJB-61:
-------------------------------

    Resolution: Fixed

There was a tiny bug related to this issue (use of the unqualified name for finding a class when the qualified name was required) which is fixed.
The issue itself has been fixed by checking whether the declared field type (T in your sample) can be found (source or in the classpath). If not, a warning will be issued and the check for whether the class-ref type is assignable to the variable type, will not be performed. Eg. in your case you will get a warning that T cannot be found, but other than that, it will run through.

> xdoclet ojb.reference property class-ref doesn't work with generics
> -------------------------------------------------------------------
>
>          Key: OJB-61
>          URL: http://issues.apache.org/jira/browse/OJB-61
>      Project: OJB
>         Type: Bug
>     Versions: 1.1 CVS, 1.0.3
>  Environment: java version: 1.5.0 (build 1.5.0_02-b09)
>     Reporter: Krzysztof Bia?ek
>     Assignee: Thomas Dudziak
>     Priority: Minor
>      Fix For: 1.0.x CVS, 1.1 CVS
>  Attachments: ReferenceDescriptorConstraints.java
>
> There is bug inside xdoclet-ojb-module, which cause it to crash when parsing classes using generics feature.
> Here is example code:
> package some.package;
> /**
> * @ojb.class
> */
> class Foo {
> }
> /**
> * @ojb.class
> */
> class Bar<T extends Foo> {
>    /**
>    * @ojb.reference class-ref="some.package.Foo"
>     *                foreignkey="someReferenceId"
>     *                database-foreignkey="false"
>     *                auto-retrieve="true"
>     *                auto-update="none"
>     *                auto-delete="none"
>    */
>    private T someReference;
>    /**
>    * @ojb.field
>    */
>    private Integer someReferenceId;
> }
> I skiped some elements, to make this example shorten.
> xdoclet craches when tries to find T class, which doesn't exist of course. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


[jira] Updated: (OJB-61) xdoclet ojb.reference property class-ref doesn't work with generics

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OJB-61?page=all ]

Thomas Dudziak updated OJB-61:
------------------------------

    Fix Version: 1.0.x CVS
                 1.1 CVS

> xdoclet ojb.reference property class-ref doesn't work with generics
> -------------------------------------------------------------------
>
>          Key: OJB-61
>          URL: http://issues.apache.org/jira/browse/OJB-61
>      Project: OJB
>         Type: Bug
>     Versions: 1.0.3, 1.1 CVS
>  Environment: java version: 1.5.0 (build 1.5.0_02-b09)
>     Reporter: Krzysztof Bia?ek
>     Assignee: Thomas Dudziak
>     Priority: Minor
>      Fix For: 1.0.x CVS, 1.1 CVS
>  Attachments: ReferenceDescriptorConstraints.java
>
> There is bug inside xdoclet-ojb-module, which cause it to crash when parsing classes using generics feature.
> Here is example code:
> package some.package;
> /**
> * @ojb.class
> */
> class Foo {
> }
> /**
> * @ojb.class
> */
> class Bar<T extends Foo> {
>    /**
>    * @ojb.reference class-ref="some.package.Foo"
>     *                foreignkey="someReferenceId"
>     *                database-foreignkey="false"
>     *                auto-retrieve="true"
>     *                auto-update="none"
>     *                auto-delete="none"
>    */
>    private T someReference;
>    /**
>    * @ojb.field
>    */
>    private Integer someReferenceId;
> }
> I skiped some elements, to make this example shorten.
> xdoclet craches when tries to find T class, which doesn't exist of course. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


[jira] Assigned: (OJB-61) xdoclet ojb.reference property class-ref doesn't work with generics

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OJB-61?page=all ]

Thomas Dudziak reassigned OJB-61:
---------------------------------

    Assign To: Thomas Dudziak

> xdoclet ojb.reference property class-ref doesn't work with generics
> -------------------------------------------------------------------
>
>          Key: OJB-61
>          URL: http://issues.apache.org/jira/browse/OJB-61
>      Project: OJB
>         Type: Bug
>     Versions: 1.0.3
>  Environment: java version: 1.5.0 (build 1.5.0_02-b09)
>     Reporter: Krzysztof Bia?ek
>     Assignee: Thomas Dudziak
>     Priority: Minor
>  Attachments: ReferenceDescriptorConstraints.java
>
> There is bug inside xdoclet-ojb-module, which cause it to crash when parsing classes using generics feature.
> Here is example code:
> package some.package;
> /**
> * @ojb.class
> */
> class Foo {
> }
> /**
> * @ojb.class
> */
> class Bar<T extends Foo> {
>    /**
>    * @ojb.reference class-ref="some.package.Foo"
>     *                foreignkey="someReferenceId"
>     *                database-foreignkey="false"
>     *                auto-retrieve="true"
>     *                auto-update="none"
>     *                auto-delete="none"
>    */
>    private T someReference;
>    /**
>    * @ojb.field
>    */
>    private Integer someReferenceId;
> }
> I skiped some elements, to make this example shorten.
> xdoclet craches when tries to find T class, which doesn't exist of course. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


[jira] Updated: (OJB-61) xdoclet ojb.reference property class-ref doesn't work with generics

Posted by "Krzysztof Białek (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OJB-61?page=all ]

Krzysztof Białek updated OJB-61:
--------------------------------

    Attachment: ReferenceDescriptorConstraints.java

My modification is very simple, it forces xdoclet to use class-ref property if class-ref is set.

> xdoclet ojb.reference property class-ref doesn't work with generics
> -------------------------------------------------------------------
>
>          Key: OJB-61
>          URL: http://issues.apache.org/jira/browse/OJB-61
>      Project: OJB
>         Type: Bug
>     Versions: 1.0.3
>  Environment: java version: 1.5.0 (build 1.5.0_02-b09)
>     Reporter: Krzysztof Białek
>     Priority: Minor
>  Attachments: ReferenceDescriptorConstraints.java
>
> There is bug inside xdoclet-ojb-module, which cause it to crash when parsing classes using generics feature.
> Here is example code:
> package some.package;
> /**
> * @ojb.class
> */
> class Foo {
> }
> /**
> * @ojb.class
> */
> class Bar<T extends Foo> {
>    /**
>    * @ojb.reference class-ref="some.package.Foo"
>     *                foreignkey="someReferenceId"
>     *                database-foreignkey="false"
>     *                auto-retrieve="true"
>     *                auto-update="none"
>     *                auto-delete="none"
>    */
>    private T someReference;
>    /**
>    * @ojb.field
>    */
>    private Integer someReferenceId;
> }
> I skiped some elements, to make this example shorten.
> xdoclet craches when tries to find T class, which doesn't exist of course. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org