You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Jim Marino <ji...@gmail.com> on 2006/04/12 09:24:37 UTC

Re: svn commit: r393402 - /incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java

Hi,

I had a quick question about this class: why does it throw  
IllegalArgumentException on lines 49 and 52 as opposed to another  
type of exception?

Jim

On Apr 12, 2006, at 12:07 AM, antelder@apache.org wrote:

> Author: antelder
> Date: Wed Apr 12 00:07:23 2006
> New Revision: 393402
>
> URL: http://svn.apache.org/viewcvs?rev=393402&view=rev
> Log:
> Fix TUSCANY-174: http://issues.apache.org/jira/browse/TUSCANY-174
> Apply patch from Raymond Feng
>
> Modified:
>     incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java
>
> Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/scdl/loader/impl/ 
> SCDLAssemblyModelLoaderImpl.java? 
> rev=393402&r1=393401&r2=393402&view=diff
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java  
> (original)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java Wed  
> Apr 12 00:07:23 2006
> @@ -40,8 +40,10 @@
>              return definition;
>
>          try {
> -            if (wsdlReader==null)
> +            if (wsdlReader==null) {
>                  wsdlReader=WSDLFactory.newInstance().newWSDLReader();
> +                wsdlReader.setFeature("javax.wsdl.verbose", false);
> +            }
>              definition = wsdlReader.readWSDL(uri);
>          } catch (WSDLException e) {
>              throw new IllegalArgumentException(e);
>
>
>


Re: svn commit: r393402 - /incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java

Posted by Jeremy Boynes <jb...@apache.org>.
Jim Marino wrote:
> Hi,
> 
> I had a quick question about this class: why does it throw 
> IllegalArgumentException on lines 49 and 52 as opposed to another  type
> of exception?
> 

There are several classes that throw IllegalArgument as part of model
initialization. I have refactored a few of these recently to move things
like loading into the loaders where we can throw a ConfigurationLoadEx
including context such as the resource that is being loaded and the
position in the XML document. I think this one falls in the same category.

I actually looked at this specific one (strictly at the usage of
AssemblyModelLoader itself) and it led to a few of the questions I had
about using <import.wsdl> and its location. It's been a couple of days
so I'll kick those discussions back to life.

--
Jeremy

Re: svn commit: r393402 - /incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java

Posted by Jim Marino <ji...@gmail.com>.
Yea we have been trying to keep most things under  
TuscanyRuntimeException or TuscanyException so that we can then add  
context as it is propagated up the stack (as well as have an  
exception hierarchy in the runtime). There are a few places we throw  
IllegalArgumentException but that is when there really is an illegal  
argument.  Thanks.

Jim

Thanks.

On Apr 12, 2006, at 12:49 AM, ant elder wrote:

> I don't know the history of this class but other old Tuscany code  
> I've seen
> did this to turn checked exceptions into unchecked ones. I could  
> change it
> to AssemblyModelLoadException which is in the same package?
>
>    ...ant
>
> On 4/12/06, Jim Marino <ji...@gmail.com> wrote:
>
>>
>> Hi,
>>
>> I had a quick question about this class: why does it throw
>> IllegalArgumentException on lines 49 and 52 as opposed to another
>> type of exception?
>>
>> Jim
>>
>> On Apr 12, 2006, at 12:07 AM, antelder@apache.org wrote:
>>
>>
>>> Author: antelder
>>> Date: Wed Apr 12 00:07:23 2006
>>> New Revision: 393402
>>>
>>> URL: http://svn.apache.org/viewcvs?rev=393402&view=rev
>>> Log:
>>> Fix TUSCANY-174: http://issues.apache.org/jira/browse/TUSCANY-174
>>> Apply patch from Raymond Feng
>>>
>>> Modified:
>>>     incubator/tuscany/java/sca/model/src/main/java/org/apache/
>>> tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java
>>>
>>> Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/
>>> tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/
>>> src/main/java/org/apache/tuscany/model/scdl/loader/impl/
>>> SCDLAssemblyModelLoaderImpl.java?
>>> rev=393402&r1=393401&r2=393402&view=diff
>>> ==================================================================== 
>>> ==
>>> ========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/
>>> tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java
>>> (original)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/
>>> tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java Wed
>>> Apr 12 00:07:23 2006
>>> @@ -40,8 +40,10 @@
>>>              return definition;
>>>
>>>          try {
>>> -            if (wsdlReader==null)
>>> +            if (wsdlReader==null) {
>>>                  wsdlReader=WSDLFactory.newInstance 
>>> ().newWSDLReader();
>>> +                wsdlReader.setFeature("javax.wsdl.verbose", false);
>>> +            }
>>>              definition = wsdlReader.readWSDL(uri);
>>>          } catch (WSDLException e) {
>>>              throw new IllegalArgumentException(e);
>>>
>>>
>>>
>>>
>>
>>
>


Re: svn commit: r393402 - /incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java

Posted by ant elder <an...@gmail.com>.
I don't know the history of this class but other old Tuscany code I've seen
did this to turn checked exceptions into unchecked ones. I could change it
to AssemblyModelLoadException which is in the same package?

   ...ant

On 4/12/06, Jim Marino <ji...@gmail.com> wrote:
>
> Hi,
>
> I had a quick question about this class: why does it throw
> IllegalArgumentException on lines 49 and 52 as opposed to another
> type of exception?
>
> Jim
>
> On Apr 12, 2006, at 12:07 AM, antelder@apache.org wrote:
>
> > Author: antelder
> > Date: Wed Apr 12 00:07:23 2006
> > New Revision: 393402
> >
> > URL: http://svn.apache.org/viewcvs?rev=393402&view=rev
> > Log:
> > Fix TUSCANY-174: http://issues.apache.org/jira/browse/TUSCANY-174
> > Apply patch from Raymond Feng
> >
> > Modified:
> >     incubator/tuscany/java/sca/model/src/main/java/org/apache/
> > tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java
> >
> > Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/
> > tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java
> > URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/
> > src/main/java/org/apache/tuscany/model/scdl/loader/impl/
> > SCDLAssemblyModelLoaderImpl.java?
> > rev=393402&r1=393401&r2=393402&view=diff
> > ======================================================================
> > ========
> > --- incubator/tuscany/java/sca/model/src/main/java/org/apache/
> > tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java
> > (original)
> > +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/
> > tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java Wed
> > Apr 12 00:07:23 2006
> > @@ -40,8 +40,10 @@
> >              return definition;
> >
> >          try {
> > -            if (wsdlReader==null)
> > +            if (wsdlReader==null) {
> >                  wsdlReader=WSDLFactory.newInstance().newWSDLReader();
> > +                wsdlReader.setFeature("javax.wsdl.verbose", false);
> > +            }
> >              definition = wsdlReader.readWSDL(uri);
> >          } catch (WSDLException e) {
> >              throw new IllegalArgumentException(e);
> >
> >
> >
>
>