portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity PortletEntityAccessComponentImpl.java
Date Fri, 05 Mar 2004 16:53:30 GMT
weaver      2004/03/05 08:53:30

  Modified:    components/registry/src/java/org/apache/jetspeed/components/portletentity
                        PortletEntityAccessComponentImpl.java
  Log:
  fixed problem with portlet enity NPEs
  
  Revision  Changes    Path
  1.7       +13 -7     jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityAccessComponentImpl.java
  
  Index: PortletEntityAccessComponentImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityAccessComponentImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PortletEntityAccessComponentImpl.java	5 Mar 2004 00:37:02 -0000	1.6
  +++ PortletEntityAccessComponentImpl.java	5 Mar 2004 16:53:30 -0000	1.7
  @@ -91,7 +91,7 @@
       // TODO: this should eventually use a system cach like JCS
       private HashMap entityCache = new HashMap();
   
  -    private Class entityClass = null;
  +    
   
       public PortletEntityAccessComponentImpl(PersistenceStoreContainer pContainer, String
storeId)
       {
  @@ -114,12 +114,18 @@
               prepareTransaction(store);
               
               Filter filter = store.newFilter();
  -            filter.addEqualTo("oid", entityId);
  -            Object q = store.newQuery(entityClass, filter);
  +            filter.addEqualTo("oid", entityId.toString());
  +            Object q = store.newQuery(PortletEntityImpl.class, filter);
               PortletEntity portletEntity = (PortletEntity) store.getObjectByQuery(q);
  -
  -            entityCache.put(entityId, portletEntity);
  -            return wrapEntity((PortletEntityImpl) portletEntity);
  +            if(portletEntity == null)
  +            {
  +                return null;
  +            } 
  +            else
  +            {
  +                entityCache.put(entityId, portletEntity);
  +                return wrapEntity((PortletEntityImpl) portletEntity);
  +            }
           }
       }
   
  
  
  

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


Mime
View raw message