commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1155555 - /commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/
Date Tue, 09 Aug 2011 20:36:58 GMT
Author: simonetripodi
Date: Tue Aug  9 20:36:58 2011
New Revision: 1155555

URL: http://svn.apache.org/viewvc?rev=1155555&view=rev
Log:
fixed findbugs SE_INNER_CLASS bad practice violation: org.apache.commons.functor.XXX$Helper
is serializable and an inner class

Modified:
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java?rev=1155555&r1=1155554&r2=1155555&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java
Tue Aug  9 20:36:58 2011
@@ -44,7 +44,7 @@ public class BinaryCompositeBinaryFuncti
      * @param <G>
      * @param <H>
      */
-    private class Helper<G, H> implements BinaryFunction<L, R, T>, Serializable
{
+    private static class Helper<G, H, L, R, T> implements BinaryFunction<L, R, T>,
Serializable {
         private BinaryFunction<? super G, ? super H, ? extends T> f;
         private BinaryFunction<? super L, ? super R, ? extends G> g;
         private BinaryFunction<? super L, ? super R, ? extends H> h;
@@ -70,7 +70,7 @@ public class BinaryCompositeBinaryFuncti
         }
     }
 
-    private final Helper<?, ?> helper;
+    private final Helper<?, ?, L, R, T> helper;
 
     // constructor
     // ------------------------------------------------------------------------
@@ -85,7 +85,7 @@ public class BinaryCompositeBinaryFuncti
         if (f == null || g == null || h == null) {
             throw new IllegalArgumentException("BinaryFunction arguments may not be null");
         }
-        this.helper = new Helper<G, H>(f, g, h);
+        this.helper = new Helper<G, H, L, R, T>(f, g, h);
     }
 
     // function interface

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.java?rev=1155555&r1=1155554&r2=1155555&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.java
Tue Aug  9 20:36:58 2011
@@ -56,7 +56,7 @@ public class CompositeUnaryFunction<A, T
      * @param <X> intermediate type
      * @param <T> return type
      */
-    private class Helper<X> implements UnaryFunction<A, T>, Serializable {
+    private static class Helper<X, A, T> implements UnaryFunction<A, T>, Serializable
{
         private UnaryFunction<? super X, ? extends T> following;
         private UnaryFunction<? super A, ? extends X> preceding;
 
@@ -82,10 +82,10 @@ public class CompositeUnaryFunction<A, T
          */
         @Override
         public boolean equals(Object obj) {
-            return obj == this || obj instanceof CompositeUnaryFunction<?, ?>.Helper<?>
&& equals((Helper<?>) obj);
+            return obj == this || obj instanceof Helper<?, ?, ?> && equals((Helper<?,
A, T>) obj);
         }
 
-        private boolean equals(Helper<?> helper) {
+        private boolean equals(Helper<?, A, T> helper) {
             return helper.following.equals(following) && helper.preceding.equals(preceding);
         }
 
@@ -126,7 +126,7 @@ public class CompositeUnaryFunction<A, T
 
     private <X> CompositeUnaryFunction(UnaryFunction<? super X, ? extends T>
following,
             UnaryFunction<? super A, ? extends X> preceding) {
-        this.function = new Helper<X>(following, preceding);
+        this.function = new Helper<X, A, T>(following, preceding);
     }
 
     /**

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryFunction.java?rev=1155555&r1=1155554&r2=1155555&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryFunction.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryFunction.java
Tue Aug  9 20:36:58 2011
@@ -31,7 +31,7 @@ public class TransformedBinaryFunction<L
      * Type-remembering helper
      * @param <X>
      */
-    private class Helper<X> implements BinaryFunction<L, R, T>, Serializable
{
+    private static class Helper<X, L, R, T> implements BinaryFunction<L, R, T>,
Serializable {
         private BinaryFunction<? super L, ? super R, ? extends X> preceding;
         private UnaryFunction<? super X, ? extends T> following;
 
@@ -53,7 +53,7 @@ public class TransformedBinaryFunction<L
         }
     }
 
-    private final Helper<?> helper;
+    private final Helper<?, L, R, T> helper;
 
     /**
      * Create a new TransformedBinaryFunction.
@@ -63,7 +63,7 @@ public class TransformedBinaryFunction<L
      */
     public <X> TransformedBinaryFunction(BinaryFunction<? super L, ? super R, ?
extends X> preceding,
             UnaryFunction<? super X, ? extends T> following) {
-        this.helper = new Helper<X>(preceding, following);
+        this.helper = new Helper<X, L, R, T>(preceding, following);
     }
 
     /**

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryProcedure.java?rev=1155555&r1=1155554&r2=1155555&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryProcedure.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryProcedure.java
Tue Aug  9 20:36:58 2011
@@ -32,7 +32,7 @@ public class TransformedBinaryProcedure<
      * Type-remembering helper
      * @param <X>
      */
-    private class Helper<X> implements BinaryProcedure<L, R>, Serializable {
+    private static class Helper<X, L, R> implements BinaryProcedure<L, R>, Serializable
{
         private BinaryFunction<? super L, ? super R, ? extends X> function;
         private UnaryProcedure<? super X> procedure;
 
@@ -54,7 +54,7 @@ public class TransformedBinaryProcedure<
         }
     }
 
-    private final Helper<?> helper;
+    private final Helper<?, L, R> helper;
 
     /**
      * Create a new TransformedBinaryProcedure.
@@ -64,7 +64,7 @@ public class TransformedBinaryProcedure<
      */
     public <X> TransformedBinaryProcedure(BinaryFunction<? super L, ? super R, ?
extends X> function,
             UnaryProcedure<? super X> procedure) {
-        this.helper = new Helper<X>(function, procedure);
+        this.helper = new Helper<X, L, R>(function, procedure);
     }
 
     /**

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedFunction.java?rev=1155555&r1=1155554&r2=1155555&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedFunction.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedFunction.java
Tue Aug  9 20:36:58 2011
@@ -31,7 +31,7 @@ public class TransformedFunction<T> impl
      * Type-remembering helper
      * @param <X>
      */
-    private class Helper<X> implements Function<T>, Serializable {
+    private static class Helper<X, T> implements Function<T>, Serializable {
         private Function<? extends X> preceding;
         private UnaryFunction<? super X, ? extends T> following;
 
@@ -53,7 +53,7 @@ public class TransformedFunction<T> impl
         }
     }
 
-    private final Helper<?> helper;
+    private final Helper<?, T> helper;
 
     /**
      * Create a new TransformedFunction.
@@ -63,7 +63,7 @@ public class TransformedFunction<T> impl
      */
     public <X> TransformedFunction(Function<? extends X> preceding,
             UnaryFunction<? super X, ? extends T> following) {
-        this.helper = new Helper<X>(preceding, following);
+        this.helper = new Helper<X, T>(preceding, following);
     }
 
     /**

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedProcedure.java?rev=1155555&r1=1155554&r2=1155555&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedProcedure.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedProcedure.java
Tue Aug  9 20:36:58 2011
@@ -32,7 +32,7 @@ public class TransformedProcedure implem
      * Type-remembering helper
      * @param <X>
      */
-    private class Helper<X> implements Procedure, Serializable {
+    private static class Helper<X> implements Procedure, Serializable {
         private Function<? extends X> function;
         private UnaryProcedure<? super X> procedure;
 

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryFunction.java?rev=1155555&r1=1155554&r2=1155555&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryFunction.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryFunction.java
Tue Aug  9 20:36:58 2011
@@ -40,7 +40,7 @@ import org.apache.commons.functor.UnaryF
  */
 public class UnaryCompositeBinaryFunction<L, R, T> implements BinaryFunction<L,
R, T>, Serializable {
 
-    private class Helper<G, H> implements BinaryFunction<L, R, T>, Serializable
{
+    private static class Helper<G, H, L, R, T> implements BinaryFunction<L, R, T>,
Serializable {
         private BinaryFunction<? super G, ? super H, ? extends T> f;
         private UnaryFunction<? super L, ? extends G> g;
         private UnaryFunction<? super R, ? extends H> h;
@@ -66,7 +66,7 @@ public class UnaryCompositeBinaryFunctio
         }
     }
 
-    private final Helper<?, ?> helper;
+    private final Helper<?, ?, L, R, T> helper;
 
     // constructor
     // ------------------------------------------------------------------------
@@ -84,7 +84,7 @@ public class UnaryCompositeBinaryFunctio
         if (g == null || h == null) {
             throw new IllegalArgumentException("Left and right UnaryFunctions may not be
null");
         }
-        this.helper = new Helper<G, H>(f, g, h);
+        this.helper = new Helper<G, H, L, R, T>(f, g, h);
     }
 
     // function interface

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java?rev=1155555&r1=1155554&r2=1155555&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java
Tue Aug  9 20:36:58 2011
@@ -39,7 +39,7 @@ import org.apache.commons.functor.UnaryF
  * @author Rodney Waldhoff
  */
 public class UnaryCompositeBinaryPredicate<L, R> implements BinaryPredicate<L, R>,
Serializable {
-    private class Helper<G, H> implements BinaryPredicate<L, R>, Serializable
{
+    private static class Helper<G, H, L, R> implements BinaryPredicate<L, R>,
Serializable {
         private BinaryPredicate<? super G, ? super H> f;
         private UnaryFunction<? super L, ? extends G> g;
         private UnaryFunction<? super R, ? extends H> h;
@@ -67,7 +67,7 @@ public class UnaryCompositeBinaryPredica
 
     // attributes
     // ------------------------------------------------------------------------
-    private final Helper<?, ?> helper;
+    private final Helper<?, ?, L, R> helper;
 
     // constructor
     // ------------------------------------------------------------------------
@@ -85,7 +85,7 @@ public class UnaryCompositeBinaryPredica
         if (g == null || h == null) {
             throw new IllegalArgumentException("Left and right UnaryFunctions may not be
null");
         }
-        helper = new Helper<G, H>(f, g, h);
+        helper = new Helper<G, H, L, R>(f, g, h);
     }
 
     // function interface



Mime
View raw message