You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Nathan Bubna <na...@esha.com> on 2003/12/09 03:22:51 UTC

[veltools] jdk1.4 dependency in ImportSupport

looks like some jdk 1.4 dependencies snuck into the last release (once again,
i'm glad we decided to call it a beta :).  apparently i was not careful to be
sure i'd compiled it on both 1.3 and 1.4 when i did the release.  :(  sorry, i
should have caught this earlier.

anyway, the problem's in ImportSupport.  there frequent use is made of the new
Exception(Throwable) and Exception(String,Throwable) constructors.  as much as
i like it, i don't think we should require 1.4 yet (not sure my employer is
even using 1.4 in production yet), so we gotta do something about this.  i'm
not too familiar with this stuff yet.  ideas anyone?  Marino? :)

Nathan Bubna
nathan@esha.com


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


Re: [veltools] jdk1.4 dependency in ImportSupport

Posted by Nathan Bubna <na...@esha.com>.
Daniel Rall said:
> Nathan Bubna wrote:
> > Daniel Rall said:
> >>Marinó A. Jónsson wrote:
> >>>Nathan said:
> >>>>i didn't write the class, so i'm not sure of the reasons for wrapping
> >>>>and rethrowing all those exceptions.
> >>>
> >>>In the original ImportSupport from JSTL they wrap most of the Exceptions
> > in
> >>>JspTagExceptions and rethrow them.  When I did the porting I originally
> > just
> >>>changed these to plain Exceptions - then I didn't pay more mind to it.
> >>>
> >>>There's no need to make this dependent on jdk 1.4 so IMHO
> >>we might as well
> >>>just use the messages themselves - instead of wrapping the throwables.
> >>
> >>Wrapping the Throwables is extremely convenient for preserving the
original
> >>stack trace information (the most relevant part when debugging).  If none
of
> >
> > the
> >>libraries depended on by Velocity Tools have an equivalent
> >>Exception sub-class
> >>(e.g. org.apache.commons.lang.exception.NestableException),
> >>how about sticking
> >>our own in there?  A quick look at Velocity core makes me think
> >>it doesn't have
> >>such an exception, but lifting existing code to do that would be trivial.
> >
> > yeah, this thought crossed my mind, but i just went with the path of least
> > resistance. :) i'll have to give it another look/think when i get the
chance
> > (unless someone else feels motivated enough to beat me to it).  it would
be
> > pretty trivial and probably useful for other tools.
>
> As I wrote the code in Commons Lang, this probably has my
> name on it.  Should
> such a thing go into Velocity core (my preference), or into
> Tools?  If it goes into Core and then we make Tools depend
> on it, it sets a minimum Core version dependency for Tools.

you can put one in the Velocity core if you like, but i'll veto any use of it
in the Tools until at least Velocity 1.5 final is released, if not longer.
something like this is definitely not worth requiring the latest Velocity code
for Tools users.  i'm not even sure at this point if it's worth adding this to
Tools until we get 1.1 final released.

Nathan Bubna
nathan@esha.com


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


Re: [veltools] jdk1.4 dependency in ImportSupport

Posted by Daniel Rall <dl...@collab.net>.
Nathan Bubna wrote:
> Daniel Rall said:
> 
>>Marinó A. Jónsson wrote:
>>
>>>Nathan said:
>>>
>>>
>>>>i didn't write the class, so i'm not sure of the reasons for wrapping
>>>>and rethrowing all those exceptions.
>>>
>>>In the original ImportSupport from JSTL they wrap most of the Exceptions
> 
> in
> 
>>>JspTagExceptions and rethrow them.  When I did the porting I originally
> 
> just
> 
>>>changed these to plain Exceptions - then I didn't pay more mind to it.
>>>
>>>There's no need to make this dependent on jdk 1.4 so IMHO
>>
>>we might as well
>>
>>>just use the messages themselves - instead of wrapping the throwables.
>>
>>Wrapping the Throwables is extremely convenient for preserving the original
>>stack trace information (the most relevant part when debugging).  If none of
> 
> the
> 
>>libraries depended on by Velocity Tools have an equivalent
>>Exception sub-class
>>(e.g. org.apache.commons.lang.exception.NestableException),
>>how about sticking
>>our own in there?  A quick look at Velocity core makes me think
>>it doesn't have
>>such an exception, but lifting existing code to do that would be trivial.
> 
> 
> yeah, this thought crossed my mind, but i just went with the path of least
> resistance. :) i'll have to give it another look/think when i get the chance
> (unless someone else feels motivated enough to beat me to it).  it would be
> pretty trivial and probably useful for other tools.

As I wrote the code in Commons Lang, this probably has my name on it.  Should 
such a thing go into Velocity core (my preference), or into Tools?  If it goes 
into Core and then we make Tools depend on it, it sets a minimum Core version 
dependency for Tools.


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


Re: [veltools] jdk1.4 dependency in ImportSupport

Posted by Nathan Bubna <na...@esha.com>.
Daniel Rall said:
> Marinó A. Jónsson wrote:
> > Nathan said:
> >
> >>i didn't write the class, so i'm not sure of the reasons for wrapping
> >>and rethrowing all those exceptions.
> >
> > In the original ImportSupport from JSTL they wrap most of the Exceptions
in
> > JspTagExceptions and rethrow them.  When I did the porting I originally
just
> > changed these to plain Exceptions - then I didn't pay more mind to it.
> >
> > There's no need to make this dependent on jdk 1.4 so IMHO
> we might as well
> > just use the messages themselves - instead of wrapping the throwables.
>
> Wrapping the Throwables is extremely convenient for preserving the original
> stack trace information (the most relevant part when debugging).  If none of
the
> libraries depended on by Velocity Tools have an equivalent
> Exception sub-class
> (e.g. org.apache.commons.lang.exception.NestableException),
> how about sticking
> our own in there?  A quick look at Velocity core makes me think
> it doesn't have
> such an exception, but lifting existing code to do that would be trivial.

yeah, this thought crossed my mind, but i just went with the path of least
resistance. :) i'll have to give it another look/think when i get the chance
(unless someone else feels motivated enough to beat me to it).  it would be
pretty trivial and probably useful for other tools.

Nathan Bubna
nathan@esha.com


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


Re: [veltools] jdk1.4 dependency in ImportSupport

Posted by Daniel Rall <dl...@collab.net>.
Marinó A. Jónsson wrote:
> Nathan said:
> 
>>i didn't write the class, so i'm not sure of the reasons for wrapping 
>>and rethrowing all those exceptions.
> 
> 
> In the original ImportSupport from JSTL they wrap most of the Exceptions in
> JspTagExceptions and rethrow them.  When I did the porting I originally just
> changed these to plain Exceptions - then I didn't pay more mind to it.
> 
> There's no need to make this dependent on jdk 1.4 so IMHO we might as well
> just use the messages themselves - instead of wrapping the throwables.

Wrapping the Throwables is extremely convenient for preserving the original 
stack trace information (the most relevant part when debugging).  If none of the 
libraries depended on by Velocity Tools have an equivalent Exception sub-class 
(e.g. org.apache.commons.lang.exception.NestableException), how about sticking 
our own in there?  A quick look at Velocity core makes me think it doesn't have 
such an exception, but lifting existing code to do that would be trivial.


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


RE: [veltools] jdk1.4 dependency in ImportSupport

Posted by "Marinó A. Jónsson" <ma...@centrum.is>.
Nathan said:
> i didn't write the class, so i'm not sure of the reasons for wrapping 
> and rethrowing all those exceptions.

In the original ImportSupport from JSTL they wrap most of the Exceptions in
JspTagExceptions and rethrow them.  When I did the porting I originally just
changed these to plain Exceptions - then I didn't pay more mind to it.

There's no need to make this dependent on jdk 1.4 so IMHO we might as well
just use the messages themselves - instead of wrapping the throwables.

cheers,
Marinó



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


Re: [veltools] jdk1.4 dependency in ImportSupport

Posted by Nathan Bubna <na...@esha.com>.
Geir Magnusson Jr said:
> On Dec 8, 2003, at 9:22 PM, Nathan Bubna wrote:
> > looks like some jdk 1.4 dependencies snuck into the last release (once
> > again,
> > i'm glad we decided to call it a beta :).  apparently i was not
> > careful to be
> > sure i'd compiled it on both 1.3 and 1.4 when i did the release.  :(
> > sorry, i
> > should have caught this earlier.
> >
> > anyway, the problem's in ImportSupport.  there frequent use is made of
> > the new
> > Exception(Throwable) and Exception(String,Throwable) constructors.  as
> > much as
> > i like it, i don't think we should require 1.4 yet (not sure my
> > employer is
> > even using 1.4 in production yet), so we gotta do something about
> > this.  i'm
> > not too familiar with this stuff yet.  ideas anyone?  Marino? :)
>
> Requiring 1.4 is a bad idea.  Many people don't use it in production...

is there an echo in here? ;)

guess i wasn't clear.  i am not considering requiring 1.4.  i'm really just
drawing attention to my carelessness and asking Marino (or anyone else with an
opinion) how they want to change ImportSupport.  i didn't write the class, so
i'm not sure of the reasons for wrapping and rethrowing all those exceptions.

Nathan Bubna
nathan@esha.com


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


Re: [veltools] jdk1.4 dependency in ImportSupport

Posted by Geir Magnusson Jr <ge...@4quarters.com>.
On Dec 8, 2003, at 9:22 PM, Nathan Bubna wrote:

> looks like some jdk 1.4 dependencies snuck into the last release (once 
> again,
> i'm glad we decided to call it a beta :).  apparently i was not 
> careful to be
> sure i'd compiled it on both 1.3 and 1.4 when i did the release.  :(  
> sorry, i
> should have caught this earlier.
>
> anyway, the problem's in ImportSupport.  there frequent use is made of 
> the new
> Exception(Throwable) and Exception(String,Throwable) constructors.  as 
> much as
> i like it, i don't think we should require 1.4 yet (not sure my 
> employer is
> even using 1.4 in production yet), so we gotta do something about 
> this.  i'm
> not too familiar with this stuff yet.  ideas anyone?  Marino? :)

Requiring 1.4 is a bad idea.  Many people don't use it in production...

>
> Nathan Bubna
> nathan@esha.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geir@4quarters.com


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


Re: [veltools] jdk1.4 dependency in ImportSupport

Posted by Daniel Rall <dl...@collab.net>.
Nathan Bubna wrote:
> Daniel Dekany said:
> 
>>Tuesday, December 9, 2003, 3:22:51 AM, Nathan Bubna wrote:
>>
>>
>>>looks like some jdk 1.4 dependencies snuck into the last release (once
> 
> again,
> 
>>>i'm glad we decided to call it a beta :).  apparently i was not careful to
> 
> be
> 
>>>sure i'd compiled it on both 1.3 and 1.4 when i did the release.  :(
> 
> sorry, i
> 
>>>should have caught this earlier.
>>
>>[snip]
>>
>>I think mistakes like this that can be easily prevented with a trick. I
>>use J2SE 1.4.x, but I release a certain product for J2SE 1.2 and later,
>>so in the build.xml of that product is this:
>>
>>        <javac
>>                bootclasspath="${bootclasspath.path}"
>>                target="1.2"
>>                ...
>>        >
>>
>>and in the build.properties:
>>
>>  bootclasspath.path=C:/jdk1.2/jre/lib/rt.jar
>>
>>So if I accidentally use something that was not present in 1.2, then the
>>build will fail, despite that I use 1.4.
> 
> 
> hmm.  not a bad idea.  i have a pretty easy setup for switching jdk's (just
> type 'java1.3' or 'java1.4' and hit enter), but going fully automated might be
> good. :)

+1, I saw this while playing around with Eclipse today and was wondering what 
the equivalent Ant attributes were.  Nice to know!



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


Re: [veltools] jdk1.4 dependency in ImportSupport

Posted by Nathan Bubna <na...@esha.com>.
Daniel Dekany said:
> Tuesday, December 9, 2003, 3:22:51 AM, Nathan Bubna wrote:
>
> > looks like some jdk 1.4 dependencies snuck into the last release (once
again,
> > i'm glad we decided to call it a beta :).  apparently i was not careful to
be
> > sure i'd compiled it on both 1.3 and 1.4 when i did the release.  :(
sorry, i
> > should have caught this earlier.
> [snip]
>
> I think mistakes like this that can be easily prevented with a trick. I
> use J2SE 1.4.x, but I release a certain product for J2SE 1.2 and later,
> so in the build.xml of that product is this:
>
>         <javac
>                 bootclasspath="${bootclasspath.path}"
>                 target="1.2"
>                 ...
>         >
>
> and in the build.properties:
>
>   bootclasspath.path=C:/jdk1.2/jre/lib/rt.jar
>
> So if I accidentally use something that was not present in 1.2, then the
> build will fail, despite that I use 1.4.

hmm.  not a bad idea.  i have a pretty easy setup for switching jdk's (just
type 'java1.3' or 'java1.4' and hit enter), but going fully automated might be
good. :)

Nathan Bubna
nathan@esha.com


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


Re: [veltools] jdk1.4 dependency in ImportSupport

Posted by Daniel Dekany <dd...@freemail.hu>.
Tuesday, December 9, 2003, 3:22:51 AM, Nathan Bubna wrote:

> looks like some jdk 1.4 dependencies snuck into the last release (once again,
> i'm glad we decided to call it a beta :).  apparently i was not careful to be
> sure i'd compiled it on both 1.3 and 1.4 when i did the release.  :(  sorry, i
> should have caught this earlier.
[snip]

I think mistakes like this that can be easily prevented with a trick. I
use J2SE 1.4.x, but I release a certain product for J2SE 1.2 and later,
so in the build.xml of that product is this:

        <javac
                bootclasspath="${bootclasspath.path}"
                target="1.2"
                ...
        >

and in the build.properties:

  bootclasspath.path=C:/jdk1.2/jre/lib/rt.jar

So if I accidentally use something that was not present in 1.2, then the
build will fail, despite that I use 1.4.

-- 
Best regards,
 Daniel Dekany



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