[jboss-cvs] JBossCache/src/org/jboss/cache/interceptors ...

Elias Ross genman at noderunner.net
Mon Nov 6 18:34:09 EST 2006


  User: genman  
  Date: 06/11/06 18:34:09

  Modified:    src/org/jboss/cache/interceptors  
                        InvocationContextInterceptor.java
                        OptimisticValidatorInterceptor.java
  Log:
  Fix potential NPE found using static analysis, clean up unused variables, use Integer.valueOf() as an optimization
  
  Revision  Changes    Path
  1.9       +21 -21    JBossCache/src/org/jboss/cache/interceptors/InvocationContextInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: InvocationContextInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/InvocationContextInterceptor.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- InvocationContextInterceptor.java	20 Oct 2006 07:08:54 -0000	1.8
  +++ InvocationContextInterceptor.java	6 Nov 2006 23:34:09 -0000	1.9
  @@ -35,8 +35,9 @@
            Transaction tx = getTransaction();
            setTransactionalContext(tx, getGlobalTransaction(tx, call));
   
  -         if (optionOverride != null && optionOverride.isFailSilently())
  -         {
  +         if (optionOverride != null) {
  +            
  +            if (optionOverride.isFailSilently()) {
               log.debug("FAIL_SILENTLY Option is present - suspending any ongoing transaction.");
               if (ctx.getTransaction() != null)
               {
  @@ -51,15 +52,14 @@
               }
            }
   
  -
            if (optionOverride.isBypassInterceptorChain())
            {
               return getLast().invoke(call);
            }
  -         else
  -         {
  -            return super.invoke(call);
            }
  +         
  +         return super.invoke(call);
  +         
         }
         finally
         {
  
  
  
  1.36      +9 -2      JBossCache/src/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: OptimisticValidatorInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -b -r1.35 -r1.36
  --- OptimisticValidatorInterceptor.java	20 Sep 2006 16:28:57 -0000	1.35
  +++ OptimisticValidatorInterceptor.java	6 Nov 2006 23:34:09 -0000	1.36
  @@ -239,8 +239,15 @@
   
      private boolean dataEquals(Map map1, Map map2)
      {
  -      if (map1 == null && (map2 == null || map2.isEmpty())) return true;
  -      if (map2 == null && map1.isEmpty()) return true;
  +      if (map1 == null) 
  +      {
  +         return (map2 == null) || (map2.isEmpty());
  +      }
  +      if (map2 == null)
  +      {
  +         if (map1.isEmpty())
  +            return true;
  +      }
         return map1.equals(map2);
      }
   
  
  
  



More information about the jboss-cvs-commits mailing list