commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r1392542 - in /commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla: ./ forward/arithmetic/ forward/instructions/
Date Mon, 01 Oct 2012 19:29:54 GMT
Author: luc
Date: Mon Oct  1 19:29:53 2012
New Revision: 1392542

URL: http://svn.apache.org/viewvc?rev=1392542&view=rev
Log:
Fixed checkstyle warnings.

Modified:
    commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/DifferentiationException.java
    commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DAddTransformer.java
    commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DDivTransformer.java
    commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DMulTransformer.java
    commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DRemTransformer.java
    commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DSubTransformer.java
    commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/instructions/DcmpTransformer.java
    commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/instructions/InvokeStaticTransformer.java

Modified: commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/DifferentiationException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/DifferentiationException.java?rev=1392542&r1=1392541&r2=1392542&view=diff
==============================================================================
--- commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/DifferentiationException.java
(original)
+++ commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/DifferentiationException.java
Mon Oct  1 19:29:53 2012
@@ -87,17 +87,17 @@ public class DifferentiationException ex
             /** {@inheritDoc} */
             @Override
             public String getMessage() {
-                final ExceptionContext context = new ExceptionContext(this);
-                context.addMessage(specifier, parts);
-                return context.getMessage();
+                final ExceptionContext ctx = new ExceptionContext(this);
+                ctx.addMessage(specifier, parts);
+                return ctx.getMessage();
             }
 
             /** {@inheritDoc} */
             @Override
             public String getLocalizedMessage() {
-                final ExceptionContext context = new ExceptionContext(this);
-                context.addMessage(specifier, parts);
-                return context.getLocalizedMessage();
+                final ExceptionContext ctx = new ExceptionContext(this);
+                ctx.addMessage(specifier, parts);
+                return ctx.getLocalizedMessage();
             }
 
         };
@@ -124,17 +124,17 @@ public class DifferentiationException ex
             /** {@inheritDoc} */
             @Override
             public String getMessage() {
-                final ExceptionContext context = new ExceptionContext(this);
-                context.addMessage(SPECIFIER, REPORT_URL);
-                return context.getMessage();
+                final ExceptionContext ctx = new ExceptionContext(this);
+                ctx.addMessage(SPECIFIER, REPORT_URL);
+                return ctx.getMessage();
             }
 
             /** {@inheritDoc} */
             @Override
             public String getLocalizedMessage() {
-                final ExceptionContext context = new ExceptionContext(this);
-                context.addMessage(SPECIFIER, REPORT_URL);
-                return context.getLocalizedMessage();
+                final ExceptionContext ctx = new ExceptionContext(this);
+                ctx.addMessage(SPECIFIER, REPORT_URL);
+                return ctx.getLocalizedMessage();
             }
 
         };

Modified: commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DAddTransformer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DAddTransformer.java?rev=1392542&r1=1392541&r2=1392542&view=diff
==============================================================================
--- commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DAddTransformer.java
(original)
+++ commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DAddTransformer.java
Mon Oct  1 19:29:53 2012
@@ -31,6 +31,9 @@ import org.objectweb.asm.tree.MethodInsn
  */
 public class DAddTransformer implements InstructionsTransformer {
 
+    /** Name of the {@link org.apache.commons.math3.analysis.differentiation.DerivativeStructure}
method corresponding to the addition. */
+    private static final String ADD_METHOD = "add";
+
     /** Indicator for top stack element conversion. */
     private final boolean stack0Converted;
 
@@ -56,18 +59,18 @@ public class DAddTransformer implements 
         if (stack1Converted) {
             if (stack0Converted) {
                 list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                            "add",
+                                            ADD_METHOD,
                                             Type.getMethodDescriptor(DS_TYPE, DS_TYPE)));
             } else {
                 list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                            "add",
+                                            ADD_METHOD,
                                             Type.getMethodDescriptor(DS_TYPE, Type.DOUBLE_TYPE)));
             }
         } else {
             list.add(new InsnNode(Opcodes.DUP_X2));
             list.add(new InsnNode(Opcodes.POP));
             list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                        "add",
+                                        ADD_METHOD,
                                         Type.getMethodDescriptor(DS_TYPE, Type.DOUBLE_TYPE)));
         }
 

Modified: commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DDivTransformer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DDivTransformer.java?rev=1392542&r1=1392541&r2=1392542&view=diff
==============================================================================
--- commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DDivTransformer.java
(original)
+++ commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DDivTransformer.java
Mon Oct  1 19:29:53 2012
@@ -31,6 +31,15 @@ import org.objectweb.asm.tree.MethodInsn
  */
 public class DDivTransformer implements InstructionsTransformer {
 
+    /** Name of the {@link org.apache.commons.math3.analysis.differentiation.DerivativeStructure}
method corresponding to the division. */
+    private static final String DIVIDE_METHOD = "divide";
+
+    /** Name of the {@link org.apache.commons.math3.analysis.differentiation.DerivativeStructure}
method corresponding to the reciproval. */
+    private static final String RECIPROCAL_METHOD = "reciprocal";
+
+    /** Name of the {@link org.apache.commons.math3.analysis.differentiation.DerivativeStructure}
method corresponding to the multiplication. */
+    private static final String MULTIPLY_METHOD = "multiply";
+
     /** Indicator for top stack element conversion. */
     private final boolean stack0Converted;
 
@@ -56,21 +65,21 @@ public class DDivTransformer implements 
         if (stack1Converted) {
             if (stack0Converted) {
                 list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                            "divide",
+                                            DIVIDE_METHOD,
                                             Type.getMethodDescriptor(DS_TYPE, DS_TYPE)));
             } else {
                 list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                            "divide",
+                                            DIVIDE_METHOD,
                                             Type.getMethodDescriptor(DS_TYPE, Type.DOUBLE_TYPE)));
             }
         } else {
             list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                        "reciprocal",
+                                        RECIPROCAL_METHOD,
                                         Type.getMethodDescriptor(DS_TYPE)));
             list.add(new InsnNode(Opcodes.DUP_X2));
             list.add(new InsnNode(Opcodes.POP));
             list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                        "multiply",
+                                        MULTIPLY_METHOD,
                                         Type.getMethodDescriptor(DS_TYPE, Type.DOUBLE_TYPE)));
         }
 

Modified: commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DMulTransformer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DMulTransformer.java?rev=1392542&r1=1392541&r2=1392542&view=diff
==============================================================================
--- commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DMulTransformer.java
(original)
+++ commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DMulTransformer.java
Mon Oct  1 19:29:53 2012
@@ -31,6 +31,9 @@ import org.objectweb.asm.tree.MethodInsn
  */
 public class DMulTransformer implements InstructionsTransformer {
 
+    /** Name of the {@link org.apache.commons.math3.analysis.differentiation.DerivativeStructure}
method corresponding to the multiplication. */
+    private static final String MULTIPLY_METHOD = "multiply";
+
     /** Indicator for top stack element conversion. */
     private final boolean stack0Converted;
 
@@ -56,18 +59,18 @@ public class DMulTransformer implements 
         if (stack1Converted) {
             if (stack0Converted) {
                 list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                            "multiply",
+                                            MULTIPLY_METHOD,
                                             Type.getMethodDescriptor(DS_TYPE, DS_TYPE)));
             } else {
                 list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                            "multiply",
+                                            MULTIPLY_METHOD,
                                             Type.getMethodDescriptor(DS_TYPE, Type.DOUBLE_TYPE)));
             }
         } else {
             list.add(new InsnNode(Opcodes.DUP_X2));
             list.add(new InsnNode(Opcodes.POP));
             list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                        "multiply",
+                                        MULTIPLY_METHOD,
                                         Type.getMethodDescriptor(DS_TYPE, Type.DOUBLE_TYPE)));
         }
 

Modified: commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DRemTransformer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DRemTransformer.java?rev=1392542&r1=1392541&r2=1392542&view=diff
==============================================================================
--- commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DRemTransformer.java
(original)
+++ commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DRemTransformer.java
Mon Oct  1 19:29:53 2012
@@ -32,6 +32,18 @@ import org.objectweb.asm.tree.VarInsnNod
  */
 public class DRemTransformer implements InstructionsTransformer {
 
+    /** Name of the {@link org.apache.commons.math3.analysis.differentiation.DerivativeStructure}
method corresponding to the remainder. */
+    private static final String REMAINDER_METHOD = "remainder";
+
+    /** Name of the {@link org.apache.commons.math3.analysis.differentiation.DerivativeStructure}
method corresponding to the value getter. */
+    private static final String VALUE_GETTER_METHOD = "getValue";
+
+    /** Name of the {@link org.apache.commons.math3.analysis.differentiation.DerivativeStructure}
method corresponding to the multiplication. */
+    private static final String MULTIPLY_METHOD = "multiply";
+
+    /** Name of the {@link org.apache.commons.math3.analysis.differentiation.DerivativeStructure}
method corresponding to the addition. */
+    private static final String ADD_METHOD = "add";
+
     /** Indicator for top stack element conversion. */
     private final boolean stack0Converted;
 
@@ -57,11 +69,11 @@ public class DRemTransformer implements 
         if (stack1Converted) {
             if (stack0Converted) {
                 list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                            "remainder",
+                                            REMAINDER_METHOD,
                                             Type.getMethodDescriptor(DS_TYPE, DS_TYPE)));
             } else {
                 list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                            "remainder",
+                                            REMAINDER_METHOD,
                                             Type.getMethodDescriptor(DS_TYPE, Type.DOUBLE_TYPE)));
             }
         } else {
@@ -75,7 +87,7 @@ public class DRemTransformer implements 
             list.add(new VarInsnNode(Opcodes.DSTORE, tmp1));                            
      // => ds_b
             list.add(new InsnNode(Opcodes.DUP));                                        
      // => ds_b, ds_b
             list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                        "getValue",
+                                        VALUE_GETTER_METHOD,
                                         Type.getMethodDescriptor(Type.DOUBLE_TYPE)));   
      // => ds_b, b0
             list.add(new InsnNode(Opcodes.DUP2));                                       
      // => ds_b, b0, b0
             list.add(new VarInsnNode(Opcodes.DLOAD,  tmp1));                            
      // => ds_b, b0, b0, a
@@ -88,11 +100,11 @@ public class DRemTransformer implements 
             list.add(new InsnNode(Opcodes.POP2));                                       
      // => ds_b, a%b0-a, b0
             list.add(new InsnNode(Opcodes.DDIV));                                       
      // => ds_b, q=(a%b0-a)/b0
             list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                        "multiply",
+                                        MULTIPLY_METHOD,
                                         Type.getMethodDescriptor(DS_TYPE, Type.DOUBLE_TYPE)));
// => q*b
             list.add(new VarInsnNode(Opcodes.DLOAD,  tmp1));                            
      // => q*b, a
             list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                        "add",
+                                        ADD_METHOD,
                                         Type.getMethodDescriptor(DS_TYPE, Type.DOUBLE_TYPE)));
// => a+q*b
 
         }

Modified: commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DSubTransformer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DSubTransformer.java?rev=1392542&r1=1392541&r2=1392542&view=diff
==============================================================================
--- commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DSubTransformer.java
(original)
+++ commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/arithmetic/DSubTransformer.java
Mon Oct  1 19:29:53 2012
@@ -31,6 +31,12 @@ import org.objectweb.asm.tree.MethodInsn
  */
 public class DSubTransformer implements InstructionsTransformer {
 
+    /** Name of the {@link org.apache.commons.math3.analysis.differentiation.DerivativeStructure}
method corresponding to the subtraction. */
+    private static final String SUBTRACT_METHOD = "subtract";
+
+    /** Name of the {@link org.apache.commons.math3.analysis.differentiation.DerivativeStructure}
method corresponding to the negation. */
+    private static final String NEGATE_METHOD = "negate";
+
     /** Indicator for top stack element conversion. */
     private final boolean stack0Converted;
 
@@ -56,21 +62,21 @@ public class DSubTransformer implements 
         if (stack1Converted) {
             if (stack0Converted) {
                 list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                            "subtract",
+                                            SUBTRACT_METHOD,
                                             Type.getMethodDescriptor(DS_TYPE, DS_TYPE)));
             } else {
                 list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                            "subtract",
+                                            SUBTRACT_METHOD,
                                             Type.getMethodDescriptor(DS_TYPE, Type.DOUBLE_TYPE)));
             }
         } else {
             list.add(new InsnNode(Opcodes.DUP_X2));
             list.add(new InsnNode(Opcodes.POP));
             list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                        "subtract",
+                                        SUBTRACT_METHOD,
                                         Type.getMethodDescriptor(DS_TYPE, Type.DOUBLE_TYPE)));
             list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                        "negate",
+                                        NEGATE_METHOD,
                                         Type.getMethodDescriptor(DS_TYPE)));
         }
 

Modified: commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/instructions/DcmpTransformer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/instructions/DcmpTransformer.java?rev=1392542&r1=1392541&r2=1392542&view=diff
==============================================================================
--- commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/instructions/DcmpTransformer.java
(original)
+++ commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/instructions/DcmpTransformer.java
Mon Oct  1 19:29:53 2012
@@ -31,6 +31,9 @@ import org.objectweb.asm.tree.MethodInsn
  */
 public class DcmpTransformer implements InstructionsTransformer {
 
+    /** Name of the {@link org.apache.commons.math3.analysis.differentiation.DerivativeStructure}
method corresponding to the value getter. */
+    private static final String VALUE_GETTER_METHOD = "getValue";
+
     /** Indicator for top stack element conversion. */
     private final boolean stack0Converted;
 
@@ -57,19 +60,19 @@ public class DcmpTransformer implements 
                 // operand stack initial state: ds_a, ds_b
                 list.add(new InsnNode(Opcodes.SWAP));                                   
          // => ds_b, ds_a
                 list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                            "getValue",
+                                            VALUE_GETTER_METHOD,
                                             Type.getMethodDescriptor(Type.DOUBLE_TYPE)));
         // => ds_b, a0
                 list.add(new InsnNode(Opcodes.DUP2_X2));                                
          // => a0, ds_b, a0
                 list.add(new InsnNode(Opcodes.POP2));                                   
          // => a0, ds_b
                 list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                            "getValue",
+                                            VALUE_GETTER_METHOD,
                                             Type.getMethodDescriptor(Type.DOUBLE_TYPE)));
         // => a0, b0
             } else {
                 // operand stack initial state: ds_a, b0
                 list.add(new InsnNode(Opcodes.DUP2_X2));                                
          // => b0, ds_a, b0
                 list.add(new InsnNode(Opcodes.POP2));                                   
          // => b0, ds_a
                 list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                            "getValue",
+                                            VALUE_GETTER_METHOD,
                                             Type.getMethodDescriptor(Type.DOUBLE_TYPE)));
         // => b0, a0
                 list.add(new InsnNode(Opcodes.DUP2_X2));                                
          // => a0, b0, a0
                 list.add(new InsnNode(Opcodes.POP2));                                   
          // => a0, b0
@@ -77,7 +80,7 @@ public class DcmpTransformer implements 
         } else {
             // operand stack initial state: a, ds_b
             list.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, DS_TYPE.getInternalName(),
-                                        "getValue",
+                                        VALUE_GETTER_METHOD,
                                         Type.getMethodDescriptor(Type.DOUBLE_TYPE)));   
          // => a0, b0
         }
 

Modified: commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/instructions/InvokeStaticTransformer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/instructions/InvokeStaticTransformer.java?rev=1392542&r1=1392541&r2=1392542&view=diff
==============================================================================
--- commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/instructions/InvokeStaticTransformer.java
(original)
+++ commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/instructions/InvokeStaticTransformer.java
Mon Oct  1 19:29:53 2012
@@ -138,5 +138,5 @@ public class InvokeStaticTransformer imp
         return list;
 
     }
-    
+
 }



Mime
View raw message