[jboss-cvs] jboss-seam/src/main/org/jboss/seam/framework ...

Gavin King gavin.king at jboss.com
Mon Jun 25 20:59:34 EDT 2007


  User: gavin   
  Date: 07/06/25 20:59:34

  Modified:    src/main/org/jboss/seam/framework   Controller.java
                        EntityIdentifier.java
  Log:
  get rid of non-dynamic-locale aware validator
  
  Revision  Changes    Path
  1.15      +2 -2      jboss-seam/src/main/org/jboss/seam/framework/Controller.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Controller.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/framework/Controller.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -b -r1.14 -r1.15
  --- Controller.java	25 Jun 2007 22:56:49 -0000	1.14
  +++ Controller.java	26 Jun 2007 00:59:34 -0000	1.15
  @@ -9,13 +9,13 @@
   
   import org.hibernate.validator.ClassValidator;
   import org.jboss.seam.Component;
  -import org.jboss.seam.Model;
   import org.jboss.seam.annotations.Logger;
   import org.jboss.seam.contexts.Context;
   import org.jboss.seam.contexts.Contexts;
   import org.jboss.seam.core.Conversation;
   import org.jboss.seam.core.Events;
   import org.jboss.seam.core.Interpolator;
  +import org.jboss.seam.core.Validators;
   import org.jboss.seam.faces.FacesMessages;
   import org.jboss.seam.faces.HttpError;
   import org.jboss.seam.faces.Redirect;
  @@ -175,7 +175,7 @@
   
      protected <T> ClassValidator<T> getValidator(Class<T> modelClass)
      {
  -      return Model.forClass(modelClass).getValidator();
  +      return Validators.instance().getValidator(modelClass);
      } 
   
      protected void debug(Object object, Object... params)
  
  
  
  1.3       +1 -22     jboss-seam/src/main/org/jboss/seam/framework/EntityIdentifier.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: EntityIdentifier.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/framework/EntityIdentifier.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- EntityIdentifier.java	26 Apr 2007 09:06:43 -0000	1.2
  +++ EntityIdentifier.java	26 Jun 2007 00:59:34 -0000	1.3
  @@ -12,7 +12,7 @@
   {
      public EntityIdentifier(Object entity, EntityManager entityManager)
      {
  -      super(Entity.forClass(deproxy(entity.getClass())).getBeanClass(), PersistenceProvider.instance().getId(entity, entityManager));
  +      super(Entity.forClass(entity.getClass()).getBeanClass(), PersistenceProvider.instance().getId(entity, entityManager));
      }
      
      @Override
  @@ -26,25 +26,4 @@
         return entityManager.find(getClazz(), getId());
      }
      
  -   private static Class deproxy(Class clazz)
  -   {
  -      Class c = clazz;
  -      /* Work our way up the inheritance hierachy, looking of @Entity, if we are unsuccessful,
  -       * return the class we started with (possibly it's mapped in xml).
  -       * 
  -       * Workaround for lazy proxies and a lack of a way to do entityManager.getEntityClass(entity)
  -       */
  -      while (!Object.class.equals(c))
  -      {
  -         if (c.isAnnotationPresent(javax.persistence.Entity.class))
  -         {
  -              return c;
  -         }
  -         else
  -         {
  -            c = c.getSuperclass();
  -         }
  -      }
  -      return clazz;
  -   }
   }
  \ No newline at end of file
  
  
  



More information about the jboss-cvs-commits mailing list