Author: isurues
Date: Fri Jan 28 09:24:56 2011
New Revision: 1064552
URL: http://svn.apache.org/viewvc?rev=1064552&view=rev
Log:
Adding an instanceof check to prevent a possible ClassCastException
Modified:
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
Modified:
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java?rev=1064552&r1=1064551&r2=1064552&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
(original)
+++
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
Fri Jan 28 09:24:56 2011
@@ -125,12 +125,15 @@ public class ServiceBuilder extends Desc
Parameter childFirstClassLoading =
service.getParameter(Constants.Configuration.ENABLE_CHILD_FIRST_CLASS_LOADING);
- if (childFirstClassLoading != null){
- DeploymentClassLoader deploymentClassLoader =
(DeploymentClassLoader) service.getClassLoader();
- if
(JavaUtils.isTrueExplicitly(childFirstClassLoading.getValue())){
- deploymentClassLoader.setChildFirstClassLoading(true);
- } else if
(JavaUtils.isFalseExplicitly(childFirstClassLoading.getValue())){
- deploymentClassLoader.setChildFirstClassLoading(false);
+ if (childFirstClassLoading != null) {
+ ClassLoader cl = service.getClassLoader();
+ if (cl instanceof DeploymentClassLoader) {
+ DeploymentClassLoader deploymentClassLoader =
(DeploymentClassLoader) cl;
+ if
(JavaUtils.isTrueExplicitly(childFirstClassLoading.getValue())){
+ deploymentClassLoader.setChildFirstClassLoading(true);
+ } else if
(JavaUtils.isFalseExplicitly(childFirstClassLoading.getValue())){
+ deploymentClassLoader.setChildFirstClassLoading(false);
+ }
}
}