cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S├ębastien Koechlin <skoech...@ivision.fr>
Subject [C1] bug & patch about 'preserve-space' in cocoon/formatter/AbstractFormatter.java
Date Wed, 07 Mar 2001 16:17:59 GMT
I found a bug in org/apache/cocoon/formatter/AbstractFormatter,
boolean values in cocoon.properties were read using
Boolean.getBoolean(),

static boolean Boolean.getBoolean(String name) Java 1.3 :
	Returns true if and only if the system property named by the
	argument exists and is equal to the string "true".

I did not find any static function to parse a boolean. So this patch
use Boolean.valueOf(String).booleanValue(). Is there a better way ?

Also AbstractFormatter:init() is called twice for each mime-type in
cocoon.properties, I don't know why.

Here is the patch:




diff -u -r1.4 AbstractFormatter.java
--- AbstractFormatter.java      2000/11/20 01:43:54     1.4
+++ AbstractFormatter.java      2001/03/07 16:12:55
@@ -104,7 +104,7 @@
 
         preserveSpace = (String) conf.get("preserve-space");
         if (preserveSpace!= null) {
-            format.setPreserveSpace(Boolean.getBoolean(preserveSpace));
+           
format.setPreserveSpace(Boolean.valueOf(preserveSpace).booleanValue());
         }
         
         lineWidth = (String) conf.get("line-width");




-- 
S├ębastien Koechlin - IVision - skoechlin@ivision.fr

Mime
View raw message