commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: [GUMP@brutus]: Project commons-jelly-tags-ant (in module jelly-tags) failed
Date Fri, 26 Nov 2004 10:26:56 GMT
Hi all,

This has been hanging around for quite some time now and I'd like to
help getting it resolved in some way.

>From my reading of the code the tag

  <util:loadText var="text" file="${basedir}/target/tmp/ant-tests/output.txt"/>

in ant/target/test-classes/org/apache/commons/jelly/ant/suite.jelly
line 114 somehow manages to invoke LoadTextTag#doTag without setting
the encoding.

I don't know who is supposed to set the encoding, but I don't see any
code in doTag that would check for encoding != null either.  Maybe
some code change in the util tag lib hasn't been refelected in the Ant
tag lib's testsuite?

This here
<http://cvs.apache.org/viewcvs.cgi/jakarta-commons/jelly/jelly-tags/util/src/java/org/apache/commons/jelly/tags/util/LoadTextTag.java?r1=1.6&r2=1.7>
looks intruiging and it's quite possible that Gump started nagging
about the problem two months ago (discounting some time that jaxen or
dom4j failed to build).

The appended patch makes the util and ant tag lib build successfully
in my personal Gump setup.

Cheers

        Stefan

Index: util/src/java/org/apache/commons/jelly/tags/util/LoadTextTag.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/jelly/jelly-tags/util/src/java/org/apache/commons/jelly/tags/util/LoadTextTag.java,v
retrieving revision 1.7
diff -u -r1.7 LoadTextTag.java
--- util/src/java/org/apache/commons/jelly/tags/util/LoadTextTag.java	12 Sep 2004 16:04:59
-0000	1.7
+++ util/src/java/org/apache/commons/jelly/tags/util/LoadTextTag.java	26 Nov 2004 10:25:13
-0000
@@ -83,10 +83,14 @@
         }
 
         Reader reader = null;
-        try {
-            reader = new InputStreamReader(in, encoding);
-        } catch (UnsupportedEncodingException e) {
-            throw new JellyTagException("unsupported encoding",e);
+        if (encoding != null) {
+            try {
+                reader = new InputStreamReader(in, encoding);
+            } catch (UnsupportedEncodingException e) {
+                throw new JellyTagException("unsupported encoding",e);
+            }
+        } else {
+            reader = new InputStreamReader(in);
         }
 
         String text = null;

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message