[gatein-commits] gatein SVN: r630 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Nov 17 16:25:52 EST 2009


Author: julien_viet
Date: 2009-11-17 16:25:51 -0500 (Tue, 17 Nov 2009)
New Revision: 630

Modified:
   portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGroovyPortlet.java
Log:
- use a static final field for something that looks immutable
- avoid to compute the groovy portlet id every time it is needed
- make some field final since they are

Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGroovyPortlet.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGroovyPortlet.java	2009-11-17 13:30:01 UTC (rev 629)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGroovyPortlet.java	2009-11-17 21:25:51 UTC (rev 630)
@@ -31,23 +31,26 @@
 public class UIGroovyPortlet extends UIPortletApplication
 {
 
-   private String DEFAULT_TEMPLATE = "system:/groovy/portal/webui/application/UIGroovyPortlet.gtmpl";
+   private static final String DEFAULT_TEMPLATE = "system:/groovy/portal/webui/application/UIGroovyPortlet.gtmpl";
 
-   private String template_;
+   private final String template_;
 
-   private String windowId;
+   private final String windowId;
 
+   private final String id;
+
    public UIGroovyPortlet() throws Exception
    {
       PortletRequestContext context = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
       PortletRequest prequest = context.getRequest();
       template_ = prequest.getPreferences().getValue("template", DEFAULT_TEMPLATE);
       windowId = prequest.getWindowID();
+      id = windowId + "-portlet";
    }
 
    public String getId()
    {
-      return windowId + "-portlet";
+      return id;
    }
 
    public String getTemplate()



More information about the gatein-commits mailing list