You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrp4j-dev@portals.apache.org by "Julie MacNaught (JIRA)" <ws...@ws.apache.org> on 2005/04/12 00:09:17 UTC

[jira] Resolved: (WSRP4J-37) Properties file in class org.apache.wsrp4j.exception.Messages never gets initialized

     [ http://issues.apache.org/jira/browse/WSRP4J-37?page=history ]
     
Julie MacNaught resolved WSRP4J-37:
-----------------------------------

      Assign To: Julie MacNaught
     Resolution: Fixed
    Fix Version: current (nightly)

> Properties file in class org.apache.wsrp4j.exception.Messages never gets initialized
> ------------------------------------------------------------------------------------
>
>          Key: WSRP4J-37
>          URL: http://issues.apache.org/jira/browse/WSRP4J-37
>      Project: WSRP4J
>         Type: Bug
>   Components: Consumer, Producer
>     Versions: current (nightly)
>     Reporter: Diego Louzán
>     Assignee: Julie MacNaught
>      Fix For: current (nightly)

>
> The constructor of class org.apache.wsrp4j.exception.Messages actually never gets called and so the properties attribute is empty. If you replace the private constructor with a static block and change the getClass method call for a reference to Messages.class (as in a static context you can't call getClass method) everything works. Replacing getClass() with Messages.class could introduce some minor issues with the classpath at runtime, but since this is a class used only with a static method, that should be no problem. A patch is shown below:
> 64a65
> >
> 66,70c67
> <     /**
> <       Private constructor loads messages from <code>messages.properties</code> file in
> <       <code>org.apache.wsrp4j.exception</code>
> <     */
> <     private Messages()
> ---
> >     static
> 72d68
> <
> 76c72
> <             InputStream in = getClass().getClassLoader().getResourceAsStream(FILE_MSG_PROPERTIES);
> ---
> >             InputStream in = Messages.class.getClassLoader().getResourceAsStream(FILE_MSG_PROPERTIES);

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira