You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2003/01/28 02:50:52 UTC

DO NOT REPLY [Bug 16481] New: - Incorrect usage of context ClassLoader for static field initialization

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16481>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16481

Incorrect usage of context ClassLoader for static field initialization

           Summary: Incorrect usage of context ClassLoader for static field
                    initialization
           Product: XalanJ2
           Version: 2.0.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Xalan
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: igor@widespace.ee


Several classes read resources through thread context ClassLoader. When it is
right thing for factories, it it is definitely not right for static field
initialization. Due to this it is problematic for me to use Xalan as Eclipse
plugin. This might be issue in other environments with many ClassLoaders too.

These two classes should not use context Classloader:
org.apache.xalan.serialize.Encodings
org.apache.xalan.templates.OutputProperties

Instead they should simply read properties from their OWN Classloader as
org.apache.xalan.serialize.CharInfo does:
ClassLoader cl = CharInfo.class.getClassLoader();

There are one more class:
org.apache.xalan.processor.TransformerFactoryImpl
It does "System.setProperties(systemProps)" in it's static initialization!
Actually it does'nt set anything what could be needed except sax-driver (which
should be defined in META-INF/services by default!), and I think it is something
from legacy code and must be removed now (to remove possible side effects)...