XalanJ2
  1. XalanJ2
  2. XALANJ-1402

Incorrect usage of context ClassLoader for static field initialization

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.5
    • Fix Version/s: None
    • Component/s: Xalan
    • Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects. Anybody can view the issue.)
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All

      Description

      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)...

        Activity

        Igor Malinin created issue -
        Serge Knystautas made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 16481 26311
        Henry Zongaro made changes -
        Priority Critical [ 2 ]
        Brian Minchau made changes -
        Affects Version/s 2.0.0 [ 10856 ]
        Affects Version/s Latest Development Code [ 10863 ]
        Brian Minchau made changes -
        Affects Version/s Latest Development Code [ 10863 ]
        Affects Version/s 2.5 [ 10870 ]
        Mark Thomas made changes -
        Workflow jira [ 36306 ] Default workflow, editable Closed status [ 12569759 ]
        Mark Thomas made changes -
        Assignee Xalan Developers Mailing List [ xalan-dev@xml.apache.org ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12569759 ] jira [ 12593728 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Igor Malinin
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development