db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1377206 - /db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java
Date Sat, 25 Aug 2012 04:37:32 GMT
Author: tfischer
Date: Sat Aug 25 04:37:32 2012
New Revision: 1377206

URL: http://svn.apache.org/viewvc?rev=1377206&view=rev
Log:
Use defined charset when reading transformer properties

Modified:
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java?rev=1377206&r1=1377205&r2=1377206&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java
Sat Aug 25 04:37:32 2012
@@ -27,6 +27,8 @@ import static org.apache.torque.template
 import static org.apache.torque.templates.transformer.om.OMColumnTransformer.GET_DEFAULT_TIME_METHOD_NAME;
 
 import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.UnsupportedEncodingException;
 import java.util.List;
 
 import org.apache.commons.lang.ObjectUtils;
@@ -71,11 +73,29 @@ public class OMTableAndViewTransformer e
 
     public OMTableAndViewTransformer() throws SourceTransformerException
     {
-        super(new InputStreamReader(
-                OMTableAndViewTransformer.class.getResourceAsStream(
-                        "OMTableTransformer.properties")));
+        super(getTransformerProperties());
     }
 
+    /**
+     * Returns the Reader to read the transformer propertes from.
+     *
+     * @return the reader, not null.
+     */
+    private static Reader getTransformerProperties()
+    {
+        try
+        {
+            return new InputStreamReader(
+                    OMTableAndViewTransformer.class.getResourceAsStream(
+                            "OMTableTransformer.properties"),
+                    "ISO-8859-1");
+        }
+        catch (UnsupportedEncodingException e)
+        {
+            // will not happen
+            throw new RuntimeException(e);
+        }
+    }
 
     @Override
     public SourceElement transform(



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


Mime
View raw message