axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sagara Gunathunga <sagara.gunathu...@gmail.com>
Subject Re: svn commit: r1176281 - /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/TypeTable.java
Date Thu, 29 Sep 2011 11:22:54 GMT
On Thu, Sep 29, 2011 at 12:54 AM, Andreas Veithen
<andreas.veithen@gmail.com> wrote:
> That doesn't look like good OO design. XMLGregorianCalendar is an
> abstract API and the actual runtime type is completely implementation
> dependent. Trying to enumerate every possible existing implementation
> is obviously not a correct approach. I would not be surprised if e.g.
> on IBM WebSphere, that API is implemented by yet another class.

Agree on you, in fact my original aim was to use instanceof operator
to identify implementation class. BTW I have changed above method in
r1177265.

Thanks !

>
> This probably points to a design flaw in the TypeTable thing.
>
> Andreas
>
> On Tue, Sep 27, 2011 at 10:45,  <sagara@apache.org> wrote:
>> Author: sagara
>> Date: Tue Sep 27 08:45:05 2011
>> New Revision: 1176281
>>
>> URL: http://svn.apache.org/viewvc?rev=1176281&view=rev
>> Log:
>> Since org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl is not an instantiable
class this method return null, changed to use Class names.
>>
>> Modified:
>>    axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/TypeTable.java
>>
>> Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/TypeTable.java
>> URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/TypeTable.java?rev=1176281&r1=1176280&r2=1176281&view=diff
>> ==============================================================================
>> --- axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/TypeTable.java
(original)
>> +++ axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/TypeTable.java
Tue Sep 27 08:45:05 2011
>> @@ -330,25 +330,18 @@ public class TypeTable {
>>      *            the name
>>      * @return the schema type name by class
>>      */
>> -    private QName getSchemaTypeNameByClass(String name) {
>> -        Object dataClass;
>> -        try {
>> -            dataClass = Class.forName(name).newInstance();
>> -            /*
>> -             * XMLGregorianCalendar can be found as following classes.
>> -             * 1.)com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl
>> -             * 2.)org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl
>> -             */
>> -            if (dataClass instanceof XMLGregorianCalendar) {
>> -                return (QName) simpleTypetoxsd.get(XMLGregorianCalendar.class
>> -                        .getName());
>> -            }
>> -        } catch (InstantiationException e) {
>> -            e.printStackTrace();
>> -        } catch (IllegalAccessException e) {
>> -            e.printStackTrace();
>> -        } catch (ClassNotFoundException e) {
>> -            e.printStackTrace();
>> +    private QName getSchemaTypeNameByClass(String name) {
>> +        /*
>> +         * XMLGregorianCalendar can be found as following classes.
>> +         * 1.)com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl
>> +         * 2.)org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl
>> +         */
>> +        if ("com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl"
>> +                .equals(name)
>> +                || "org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl"
>> +                        .equals(name)) {
>> +            return (QName) simpleTypetoxsd.get(XMLGregorianCalendar.class
>> +                    .getName());
>>         }
>>         return null;
>>     }
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-dev-help@axis.apache.org
>
>



-- 
Sagara Gunathunga

Blog      - http://ssagara.blogspot.com
Web      - http://people.apache.org/~sagara/
LinkedIn - http://www.linkedin.com/in/ssagara

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message