You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2008/02/27 10:52:32 UTC
svn commit: r631531 - in /webservices/axis2/trunk/java/modules:
adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
integration/test/org/tempuri/complex/data/BitMask.java
kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
Author: deepal
Date: Wed Feb 27 01:52:28 2008
New Revision: 631531
URL: http://svn.apache.org/viewvc?rev=631531&view=rev
Log:
fixing inner class issue in Axis2
however we need to get a version of annogen in order to fix the issue completely however I will upload the fix version of annogen to my apache repo and send the link
Modified:
webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
webservices/axis2/trunk/java/modules/integration/test/org/tempuri/complex/data/BitMask.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?rev=631531&r1=631530&r2=631531&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java Wed Feb 27 01:52:28 2008
@@ -172,7 +172,10 @@
Method readMethod = propDesc.getReadMethod();
Object value;
if(readMethod!=null){
- value = readMethod.invoke(beanObject, null);
+ if (property.getGetter() !=null && property.getGetter().isPublic()){
+ readMethod.setAccessible(true);
+ }
+ value = readMethod.invoke(beanObject, null);
} else {
throw new AxisFault("can not find read method for : " + propDesc.getName());
}
@@ -184,8 +187,10 @@
Method readMethod = propDesc.getReadMethod();
Object value;
if(readMethod!=null){
- value = readMethod.invoke(beanObject,
- null);
+ if (property.getGetter() !=null && property.getGetter().isPublic()){
+ readMethod.setAccessible(true);
+ }
+ value = readMethod.invoke(beanObject,null);
} else {
throw new AxisFault("can not find read method for : " + propDesc.getName());
}
@@ -206,8 +211,16 @@
object.add(value);
}
} else {
- Object value [] = (Object[])propDesc.getReadMethod().invoke(beanObject,
- null);
+ Method readMethod = propDesc.getReadMethod();
+ Object value [] = null;
+ if(readMethod!=null){
+ if (property.getGetter() !=null && property.getGetter().isPublic()){
+ readMethod.setAccessible(true);
+ }
+ value = (Object[])propDesc.getReadMethod().invoke(beanObject,
+ null);
+ }
+
if (value != null) {
for (int j = 0; j < value.length; j++) {
Object o = value[j];
@@ -220,7 +233,11 @@
}
}
} else if (SimpleTypeMapper.isCollection(ptype)) {
- Object value = propDesc.getReadMethod().invoke(beanObject,
+ Method readMethod = propDesc.getReadMethod();
+ if (property.getGetter() !=null && property.getGetter().isPublic()){
+ readMethod.setAccessible(true);
+ }
+ Object value = readMethod.invoke(beanObject,
null);
Collection objList = (Collection)value;
if (objList != null && objList.size() > 0) {
@@ -244,7 +261,11 @@
}
} else {
addTypeQname(elemntNameSpace, object, propDesc, beanName,processingDocLitBare);
- Object value = propDesc.getReadMethod().invoke(beanObject,
+ Method readMethod = propDesc.getReadMethod();
+ if (property.getGetter() !=null && property.getGetter().isPublic()){
+ readMethod.setAccessible(true);
+ }
+ Object value = readMethod.invoke(beanObject,
null);
if ("java.lang.Object".equals(ptype.getName())){
if ((value instanceof Integer ) ||
@@ -421,6 +442,7 @@
Object [] parms = new Object[] { partObj };
Method writeMethod = prty.getWriteMethod();
if (writeMethod != null) {
+ writeMethod.setAccessible(true);
writeMethod.invoke(beanObj, parms);
}
}
@@ -486,6 +508,7 @@
Object [] parms = new Object[] { partObj };
Method writeMethod = prty.getWriteMethod();
if (writeMethod != null) {
+ writeMethod.setAccessible(true);
writeMethod.invoke(beanObj, parms);
}
}
Modified: webservices/axis2/trunk/java/modules/integration/test/org/tempuri/complex/data/BitMask.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/tempuri/complex/data/BitMask.java?rev=631531&r1=631530&r2=631531&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/tempuri/complex/data/BitMask.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/tempuri/complex/data/BitMask.java Wed Feb 27 01:52:28 2008
@@ -34,6 +34,7 @@
BitMask(String v) {
value = v;
+ values = new ArrayList();
values.add(this);
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java?rev=631531&r1=631530&r2=631531&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java Wed Feb 27 01:52:28 2008
@@ -160,7 +160,7 @@
//all most all the time the ittr will have only one class in it
while (jClassIter.hasNext()) {
JClass jclass = (JClass) jClassIter.next();
- if (getQualifiedName(jclass).equals(className)) {
+ if (getActualQualifiedName(jclass).equals(className)) {
/**
* Schema genertaion done in two stage 1. Load all the methods and
* create type for methods parameters (if the parameters are Bean
@@ -949,7 +949,11 @@
}
protected String getSimpleName(JClass type) {
- return type.getSimpleName();
+ String name = type.getSimpleName();
+ if (name.indexOf("$")>0){
+ name = name.replace("$","_");
+ }
+ return name;
}
protected String getSimpleName(JProperty peroperty) {
@@ -964,8 +968,15 @@
return method.getQualifiedName();
}
- protected String getQualifiedName(JClass type) {
+ protected String getActualQualifiedName(JClass type ) {
return type.getQualifiedName();
+ }
+ protected String getQualifiedName(JClass type) {
+ String name = type.getQualifiedName();
+ if (name.indexOf("$")>0){
+ name = name.replace("$","_");
+ }
+ return name;
}
protected String getQualifiedName(JProperty peroperty) {
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org