[
https://jira.jboss.org/jira/browse/JBPM-1976?page=com.atlassian.jira.plug...
]
Thomas Diesler commented on JBPM-1976:
--------------------------------------
I found those
[tdiesler@tddell trunk]$ find . -name *.java | xargs grep loadClass
./modules/identity/src/main/java/org/jbpm/identity/hibernate/PermissionUserType.java:
.loadClass(className)
./modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java: public static
Class<?> loadClass(String className)
./modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java: return
getClassLoader().loadClass(className);
./modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java:
.loadClass(classloaderClassname);
./modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java:
.loadClass(classloaderClassname);
./modules/core/src/main/java/org/jbpm/util/EqualsUtil.java: hibernateProxyClass =
ClassLoaderUtil.getClassLoader().loadClass("org.hibernate.proxy.HibernateProxy");
./modules/core/src/main/java/org/jbpm/instantiation/Delegation.java: delegationClass
= classLoader.loadClass(className);
./modules/core/src/main/java/org/jbpm/instantiation/Delegation.java:
instantiatorClass = classLoader.loadClass(configType);
./modules/core/src/main/java/org/jbpm/instantiation/FieldInstantiator.java: type =
ClassLoaderUtil.loadClass(attributeValue);
./modules/core/src/main/java/org/jbpm/graph/action/ActionTypes.java: Class<?>
actionClass = ClassLoaderUtil.getClassLoader().loadClass(className);
./modules/core/src/main/java/org/jbpm/graph/node/NodeTypes.java: Class<?>
nodeClass = ClassLoaderUtil.getClassLoader().loadClass(className);
./modules/core/src/main/java/org/jbpm/graph/def/ProcessDefinition.java:
ModuleDefinition moduleDefinition = (ModuleDefinition)
ClassLoaderUtil.loadClass(moduleClassName).newInstance();
./modules/core/src/main/java/org/jbpm/graph/def/ExceptionHandler.java: Class<?>
clazz = ClassLoaderUtil.loadClass(exceptionClassName);
./modules/core/src/main/java/org/jbpm/configuration/BeanInfo.java: Class clazz =
objectFactory.loadClass(className);
./modules/core/src/main/java/org/jbpm/configuration/JbpmTypeObjectInfo.java:
variableInstanceClass = ClassLoaderUtil.loadClass(variableInstanceClassName);
./modules/core/src/main/java/org/jbpm/configuration/ConstructorInfo.java:
factoryClass = ClassLoaderUtil.loadClass(factoryClassName);
./modules/core/src/main/java/org/jbpm/configuration/ConstructorInfo.java: Class clazz
= objectFactory.loadClass(className);
./modules/core/src/main/java/org/jbpm/configuration/ConstructorInfo.java:
parameterTypes[i] = objectFactory.loadClass(parameterClassNames[i]);
./modules/core/src/main/java/org/jbpm/configuration/ObjectFactoryImpl.java: Class
loadClass(String className) {
./modules/core/src/main/java/org/jbpm/configuration/ObjectFactoryImpl.java: return
classLoader.loadClass(className);
./modules/core/src/main/java/org/jbpm/jpdl/par/ProcessArchive.java:
ProcessArchiveParser processArchiveParser =
(ProcessArchiveParser)ClassLoaderUtil.loadClass(className).newInstance();
./modules/core/src/main/java/org/jbpm/security/authentication/SubjectAuthenticationService.java:
this.principalClass = ClassLoaderUtil.loadClass(principalClassName);
./modules/core/src/main/java/org/jbpm/db/hibernate/Converters.java: Class
converterClass = ClassLoaderUtil.loadClass(converterClassName);
./modules/core/src/test/java/org/jbpm/jpdl/par/ProcessClassLoaderTest.java: return
getParent().loadClass(ContextLoadedAction.class.getName());
./modules/core/src/test/java/org/jbpm/jpdl/par/ProcessClassLoaderTest.java: return
getParent().loadClass(ContextLoadedExceptionAction.class.getName());
./modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveClassLoadingDbTest.java:
testClassLoader.loadClass("org.jbpm.jpdl.par.ResourceAction");
./modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveClassLoadingDbTest.java:
testClassLoader.loadClass("org.jbpm.jpdl.par.InstantiateAction");
./modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveClassLoadingDbTest.java:
testClassLoader.loadClass("org.jbpm.jpdl.par.InstantiateClass");
./modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveClassLoadingDbTest.java:
testClassLoader.loadClass("org.jbpm.jpdl.par.InstantiateAction");
./modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveClassLoadingDbTest.java:
testClassLoader.loadClass("org.jbpm.jpdl.par.InstantiateClass");
./modules/core/src/test/java/org/jbpm/SerializabilityTest.java: Class<?> clazz =
ClassLoaderUtil.loadClass(className);
./modules/core/src/test/java/org/jbpm/context/exe/CustomSessionFactoryFactory.java:
Class clazz = ClassLoaderUtil.loadClass(extraClassMapping);
Bad usage of ClassLoader.loadClass() under JDK 6
------------------------------------------------
Key: JBPM-1976
URL:
https://jira.jboss.org/jira/browse/JBPM-1976
Project: JBoss jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Core Engine
Affects Versions: jBPM 3.2.5 GA
Reporter: Alejandro Guizar
Assignee: Thomas Diesler
Fix For: jBPM 3.2.x
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
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira