Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-1976

Bad usage of ClassLoader.loadClass() under JDK 6

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jBPM 3.2.7
    • jBPM 3.2.5 GA
    • Runtime Engine
    • None

      Any class name provided as a String parameter to methods in ClassLoader must be a binary name as defined by the JLS (1). In particular, array syntax is not allowed, unless the system property sun.lang.ClassLoader.allowArraySyntax is set to true.

      Sun recommends (2) replacing
      myClassLoader.loadClass(className);
      with
      Class.forName(className,false,myClassLoader);

      The first form has plenty of occurrences in the jBPM codebase. No bug has come to my attention with respect to array class loading. Anyhow, it is worthwhile to fix any potential problem in advance as other JBoss projects have (3).

      (1) http://java.sun.com/javase/6/docs/api/java/lang/ClassLoader.html#name
      (2) http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6516909
      (3) https://jira.jboss.org/jira/browse/JBREM-659 * http://opensource.atlassian.com/projects/hibernate/browse/HHH-2990

              tdiesler@redhat.com Thomas Diesler
              aguizar_jira Alejandro Guizar (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: