You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Peter Courcoux <pe...@courcoux.biz> on 2003/06/14 16:19:25 UTC

Re: cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/services/pull/util UIManager.java

Henning,

I may be wrong, but resourcesDirectory is set in init() by pulling the
property from Configuration and skinsDirectory is set also in init() by
getting the absolute path and appending a static final to
resourcesDirectory. 

It looked to me as though these were ok static. What am I missing?

Regards,

Peter

On Sat, 2003-06-14 at 11:18, henning@apache.org wrote:
> henning     2003/06/14 03:18:36
> 
>   Modified:    src/java/org/apache/turbine/services/pull/util
>                         UIManager.java
>   Log:
>   Remove the static attribute to some variables which are accessed from
>   non-static context and should not be shared between instances of the
>   Tool.
>   
>   Found by Peter Courcoux <pe...@courcoux.biz>
>   
>   Revision  Changes    Path
>   1.10      +4 -4      jakarta-turbine-2/src/java/org/apache/turbine/services/pull/util/UIManager.java
>   
>   Index: UIManager.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/pull/util/UIManager.java,v
>   retrieving revision 1.9
>   retrieving revision 1.10
>   diff -u -r1.9 -r1.10
>   --- UIManager.java	3 Jun 2003 13:41:27 -0000	1.9
>   +++ UIManager.java	14 Jun 2003 10:18:36 -0000	1.10
>   @@ -158,7 +158,7 @@
>        /**
>         * The skins directory.
>         */
>   -    private static String skinsDirectory;
>   +    private String skinsDirectory;
>    
>        /**
>         * The file within the skin directory that actually
>   @@ -176,13 +176,13 @@
>         * webapp context. Used for constructing correct
>         * URIs for retrieving images in image().
>         */
>   -    private static String resourcesDirectory;
>   +    private String resourcesDirectory;
>    
>        /**
>         * Properties to hold the name/value pairs
>         * for the skin.
>         */
>   -    private static Properties skinProperties;
>   +    private Properties skinProperties;
>    
>        /**
>         * Initialize the UIManager object.
>   
>   
>   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
-- 
Peter Courcoux <pe...@courcoux.biz>

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


Re: cvs commit:

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Peter Courcoux <pe...@courcoux.biz> writes:

>Henning,

>I may be wrong, but resourcesDirectory is set in init() by pulling the
>property from Configuration and skinsDirectory is set also in init() by
>getting the absolute path and appending a static final to
>resourcesDirectory. 

>It looked to me as though these were ok static. What am I missing?

The init() method is not static, so there might be more than one
object in this class. These objects might want to have different
settings (which is, admittedly, quite improbable). IMHO it is bad
style to set a class related variable from an object member function.

But yes, the change shouldn't do anything in practice because these fields
will most surely be always identical in all objects of the class.

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

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