cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r805401 - /cocoon/trunk/blocks/cocoon-serializers/cocoon-serializers-charsets/src/main/java/org/apache/cocoon/components/serializers/encoding/CharsetFactory.java
Date Tue, 18 Aug 2009 12:58:31 GMT
Author: cziegeler
Date: Tue Aug 18 12:58:31 2009
New Revision: 805401

URL: http://svn.apache.org/viewvc?rev=805401&view=rev
Log:
No need to use context class loader, charset are loaded with the same class loader as the
charset factory.

Modified:
    cocoon/trunk/blocks/cocoon-serializers/cocoon-serializers-charsets/src/main/java/org/apache/cocoon/components/serializers/encoding/CharsetFactory.java

Modified: cocoon/trunk/blocks/cocoon-serializers/cocoon-serializers-charsets/src/main/java/org/apache/cocoon/components/serializers/encoding/CharsetFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-serializers/cocoon-serializers-charsets/src/main/java/org/apache/cocoon/components/serializers/encoding/CharsetFactory.java?rev=805401&r1=805400&r2=805401&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-serializers/cocoon-serializers-charsets/src/main/java/org/apache/cocoon/components/serializers/encoding/CharsetFactory.java
(original)
+++ cocoon/trunk/blocks/cocoon-serializers/cocoon-serializers-charsets/src/main/java/org/apache/cocoon/components/serializers/encoding/CharsetFactory.java
Tue Aug 18 12:58:31 2009
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,10 +18,10 @@
 
 import java.io.ByteArrayOutputStream;
 import java.io.File;
-import java.io.PrintWriter;
-import java.io.PrintStream;
 import java.io.IOException;
 import java.io.OutputStreamWriter;
+import java.io.PrintStream;
+import java.io.PrintWriter;
 import java.io.UnsupportedEncodingException;
 import java.net.URL;
 import java.util.Enumeration;
@@ -30,8 +30,8 @@
 import java.util.zip.ZipFile;
 
 /**
- * 
- * 
+ *
+ *
  * @version $Id$
  */
 public final class CharsetFactory {
@@ -59,8 +59,8 @@
         super();
         this.unknownCharset = new UnknownCharset();
 
-        ClassLoader loader = Thread.currentThread().getContextClassLoader();
-        URL url = loader.getResource(CHARSET_LOOKUP_CLASS);
+        final ClassLoader loader = this.getClass().getClassLoader();
+        final URL url = loader.getResource(CHARSET_LOOKUP_CLASS);
 
         if (url == null) {
             throw new CharsetFactoryException("Unable to load charsets "
@@ -125,7 +125,7 @@
             String mtch = file.substring(file.indexOf('!'));
             file = file.substring(5, file.indexOf('!'));
             mtch = mtch.substring(2, mtch.lastIndexOf('/') + 1) + "cs_";
-    
+
             ZipFile zip = new ZipFile(file);
             Enumeration enumeration = zip.entries();
             while (enumeration.hasMoreElements()) {
@@ -215,7 +215,7 @@
         /** The root cause of this exception. */
         private Exception exception = null;
 
-        /** 
+        /**
          * Create a new <code>CharsetFactoryException</code> instance.
          */
         private CharsetFactoryException(String message, Exception exception) {



Mime
View raw message