You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Dirk Meuser (JIRA)" <ji...@apache.org> on 2010/05/04 15:42:56 UTC

[jira] Created: (WICKET-2856) PackageStringResourceLoader.loadStringResource() causes NullPointerException when used in a Class within the root package (i.e. it has no package declaration)

PackageStringResourceLoader.loadStringResource() causes NullPointerException when used in a Class within the root package (i.e. it has no package declaration)
--------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: WICKET-2856
                 URL: https://issues.apache.org/jira/browse/WICKET-2856
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4.7
            Reporter: Dirk Meuser
            Priority: Minor


Cause is the line

    String packageName = clazz.getPackage().getName();

because Class.getPackage() [respectivly Package.getPackage(Class)] returns null if a class has no dot in its full qualifier.

Example (from the Java Doc for org.apache.wicket.model.StringResourceModel):

-------------------- CODE ------------------------
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.StringResourceModel;

public class MyPage extends WebPage {

    public MyPage() {
        add(new Label("username", new StringResourceModel("label.username", this, null)));
    }

}
-------------------- CODE ------------------------

If this class is in the root directory (no package declaration as above) a NullPointerException is thrown.

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


[jira] Commented: (WICKET-2856) PackageStringResourceLoader.loadStringResource() causes NullPointerException when used in a Class within the root package (i.e. it has no package declaration)

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868860#action_12868860 ] 

Hudson commented on WICKET-2856:
--------------------------------

Integrated in Apache Wicket 1.5.x #54 (See [http://hudson.zones.apache.org/hudson/job/Apache%20Wicket%201.5.x/54/])
    WICKET-2856: PackageStringResourceLoader.loadStringResource() causes NullPointerException when used in a Class within the root package (i.e. it has no package declaration)


> PackageStringResourceLoader.loadStringResource() causes NullPointerException when used in a Class within the root package (i.e. it has no package declaration)
> --------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-2856
>                 URL: https://issues.apache.org/jira/browse/WICKET-2856
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.7
>            Reporter: Dirk Meuser
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.4.9, 1.5-M1
>
>
> Cause is the line
>     String packageName = clazz.getPackage().getName();
> because Class.getPackage() [respectivly Package.getPackage(Class)] returns null if a class has no dot in its full qualifier.
> Example (from the Java Doc for org.apache.wicket.model.StringResourceModel):
> -------------------- CODE ------------------------
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.model.StringResourceModel;
> public class MyPage extends WebPage {
>     public MyPage() {
>         add(new Label("username", new StringResourceModel("label.username", this, null)));
>     }
> }
> -------------------- CODE ------------------------
> If this class is in the root directory (no package declaration as above) a NullPointerException is thrown.

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


[jira] Resolved: (WICKET-2856) PackageStringResourceLoader.loadStringResource() causes NullPointerException when used in a Class within the root package (i.e. it has no package declaration)

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

Igor Vaynberg resolved WICKET-2856.
-----------------------------------

         Assignee: Igor Vaynberg
    Fix Version/s: 1.4.9
                   1.5-M1
       Resolution: Fixed

> PackageStringResourceLoader.loadStringResource() causes NullPointerException when used in a Class within the root package (i.e. it has no package declaration)
> --------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-2856
>                 URL: https://issues.apache.org/jira/browse/WICKET-2856
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.7
>            Reporter: Dirk Meuser
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.4.9, 1.5-M1
>
>
> Cause is the line
>     String packageName = clazz.getPackage().getName();
> because Class.getPackage() [respectivly Package.getPackage(Class)] returns null if a class has no dot in its full qualifier.
> Example (from the Java Doc for org.apache.wicket.model.StringResourceModel):
> -------------------- CODE ------------------------
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.model.StringResourceModel;
> public class MyPage extends WebPage {
>     public MyPage() {
>         add(new Label("username", new StringResourceModel("label.username", this, null)));
>     }
> }
> -------------------- CODE ------------------------
> If this class is in the root directory (no package declaration as above) a NullPointerException is thrown.

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