cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lgaw...@apache.org
Subject svn commit: r267166 - /cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatNumber.java
Date Fri, 02 Sep 2005 09:01:42 GMT
Author: lgawron
Date: Fri Sep  2 02:01:30 2005
New Revision: 267166

URL: http://svn.apache.org/viewcvs?rev=267166&view=rev
Log:
an awful bunch of NPEs

Modified:
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatNumber.java

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatNumber.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatNumber.java?rev=267166&r1=267165&r2=267166&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatNumber.java
(original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatNumber.java
Fri Sep  2 02:01:30 2005
@@ -115,17 +115,17 @@
 
     private String format(ExpressionContext expressionContext) throws Exception {
         // Determine formatting locale
-        String var = this.var.getStringValue(expressionContext);
+        String var = this.var == null ? null : this.var.getStringValue(expressionContext);
         Number input = this.value.getNumberValue(expressionContext);
-        String type = this.type.getStringValue(expressionContext);
-        String pattern = this.pattern.getStringValue(expressionContext);
-        String currencyCode = this.currencyCode.getStringValue(expressionContext);
-        String currencySymbol = this.currencySymbol.getStringValue(expressionContext);
-        Boolean isGroupingUsed = this.isGroupingUsed.getBooleanValue(expressionContext);
-        Number maxIntegerDigits = this.maxIntegerDigits.getNumberValue(expressionContext);
-        Number minIntegerDigits = this.minIntegerDigits.getNumberValue(expressionContext);
-        Number maxFractionDigits = this.maxFractionDigits.getNumberValue(expressionContext);
-        Number minFractionDigits = this.minFractionDigits.getNumberValue(expressionContext);
+        String type = this.type == null ? null : this.type.getStringValue(expressionContext);
+        String pattern = this.pattern == null ? null : this.pattern.getStringValue(expressionContext);
+        String currencyCode = this.currencyCode == null ? null : this.currencyCode.getStringValue(expressionContext);
+        String currencySymbol = this.currencySymbol == null ? null : this.currencySymbol.getStringValue(expressionContext);
+        Boolean isGroupingUsed = this.isGroupingUsed == null ? null : this.isGroupingUsed.getBooleanValue(expressionContext);
+        Number maxIntegerDigits = this.maxIntegerDigits == null ? null : this.maxIntegerDigits.getNumberValue(expressionContext);
+        Number minIntegerDigits = this.minIntegerDigits == null ? null : this.minIntegerDigits.getNumberValue(expressionContext);
+        Number maxFractionDigits = this.maxFractionDigits == null ? null : this.maxFractionDigits.getNumberValue(expressionContext);
+        Number minFractionDigits = this.minFractionDigits == null ? null : this.minFractionDigits.getNumberValue(expressionContext);
         
         Locale loc = getLocale(expressionContext);
         String formatted;



Mime
View raw message