struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject svn commit: r1412281 - in /struts/struts2/trunk/core/src: main/java/org/apache/struts2/components/Number.java test/java/org/apache/struts2/views/jsp/NumberTagTest.java
Date Wed, 21 Nov 2012 20:48:21 GMT
Author: lukaszlenart
Date: Wed Nov 21 20:48:20 2012
New Revision: 1412281

URL: http://svn.apache.org/viewvc?rev=1412281&view=rev
Log:
Adjusts code base to be compliant with Java 1.5

Modified:
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Number.java
    struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/NumberTagTest.java

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Number.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Number.java?rev=1412281&r1=1412280&r2=1412281&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Number.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Number.java Wed
Nov 21 20:48:20 2012
@@ -33,7 +33,6 @@ import org.apache.struts2.views.annotati
 
 import java.io.IOException;
 import java.io.Writer;
-import java.math.RoundingMode;
 import java.text.NumberFormat;
 import java.util.Currency;
 
@@ -212,6 +211,8 @@ public class Number extends ContextBean 
     }
 
     private void setRoundingMode(NumberFormat format) {
+    /*
+        TODO lukaszlenart: enable when switched to Java 1.6
         if (roundingMode != null) {
             roundingMode = findString(roundingMode);
             if ("ceiling".equals(roundingMode)) {
@@ -234,6 +235,7 @@ public class Number extends ContextBean 
                 LOG.error("Could not recognise a roundingMode of [" + roundingMode + "]");
             }
         }
+    */
     }
 
     private NumberFormat getNumberFormat() {
@@ -396,7 +398,7 @@ public class Number extends ContextBean 
     /**
      * @param roundingMode the roundingMode to set
      */
-    @StrutsTagAttribute(description = "The rounding mode to use", type = "String")
+    @StrutsTagAttribute(description = "The rounding mode to use - not implemented yet as
this required Java 1.6", type = "String")
     public void setRoundingMode(String roundingMode) {
         this.roundingMode = roundingMode;
     }

Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/NumberTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/NumberTagTest.java?rev=1412281&r1=1412280&r2=1412281&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/NumberTagTest.java
(original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/NumberTagTest.java
Wed Nov 21 20:48:20 2012
@@ -3,7 +3,6 @@ package org.apache.struts2.views.jsp;
 import com.opensymphony.xwork2.ActionContext;
 import org.apache.struts2.TestAction;
 
-import java.math.RoundingMode;
 import java.text.NumberFormat;
 import java.util.Locale;
 
@@ -66,7 +65,10 @@ public class NumberTagTest extends Abstr
 
         // then
         NumberFormat format = NumberFormat.getCurrencyInstance((Locale) context.get(ActionContext.LOCALE));
+        /*
+        TODO lukaszlenart: enable when switched to Java 1.6
         format.setRoundingMode(RoundingMode.CEILING);
+        */
         String expected = format.format(120.0f);
 
         assertEquals(expected, writer.toString());
@@ -90,7 +92,10 @@ public class NumberTagTest extends Abstr
 
         // then
         NumberFormat format = NumberFormat.getInstance((Locale) context.get(ActionContext.LOCALE));
+        /*
+        TODO lukaszlenart: enable when switched to Java 1.6
         format.setRoundingMode(RoundingMode.CEILING);
+        */
         String expected = format.format(120.45f);
 
         assertEquals(expected, writer.toString());



Mime
View raw message