Purpose of Py#findClassEx ?

View: New views
6 Messages — Rating Filter:   Alert me  

Purpose of Py#findClassEx ?

by Leo Soto M. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Other than debugging, is there a useful purpose on duplicating
Py#findClass code in Py#findClassEx?

Anything stupid on making findClass(name) simply call findClass(name,
"unknown reason") or something like that?

Regards,
--
Leo Soto M.
http://blog.leosoto.com

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jython-dev mailing list
Jython-dev@...
https://lists.sourceforge.net/lists/listinfo/jython-dev

Re: Purpose of Py#findClassEx ?

by Frank Wierzbicki :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Aug 24, 2009 at 2:29 AM, Leo Soto M.<leo.soto@...> wrote:
> Hi,
>
> Other than debugging, is there a useful purpose on duplicating
> Py#findClass code in Py#findClassEx?
>
> Anything stupid on making findClass(name) simply call findClass(name,
> "unknown reason") or something like that?
Assuming you mean have the body of findClass(name) be
findClassEx(name, "unknown reason")

Unfortunately the exceptions that are thrown have different semantics
(findClass always returns null and findClassEx sometimes throws real
exceptions).  It *is* hard to look at the code duplication though...

-Frank

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jython-dev mailing list
Jython-dev@...
https://lists.sourceforge.net/lists/listinfo/jython-dev

Re: Purpose of Py#findClassEx ?

by Leo Soto M. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Aug 24, 2009 at 9:39 PM, Frank Wierzbicki<fwierzbicki@...> wrote:

> On Mon, Aug 24, 2009 at 2:29 AM, Leo Soto M.<leo.soto@...> wrote:
> > Anything stupid on making findClass(name) simply call findClass(name,
> > "unknown reason") or something like that?
>
> Assuming you mean have the body of findClass(name) be
> findClassEx(name, "unknown reason")
>
> Unfortunately the exceptions that are thrown have different semantics
> (findClass always returns null and findClassEx sometimes throws real
> exceptions).

Oh, right. Good thing I asked :)

Well, I think we can still refactor the common body to a single method
and call it from findClassEx and findClass, while keeping the
different exception handling code on each version. Or am I missing
something again?
--
Leo Soto M.
http://blog.leosoto.com

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jython-dev mailing list
Jython-dev@...
https://lists.sourceforge.net/lists/listinfo/jython-dev

Re: Purpose of Py#findClassEx ?

by Frank Wierzbicki :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Aug 24, 2009 at 11:02 PM, Leo Soto M.<leo.soto@...> wrote:
> Well, I think we can still refactor the common body to a single method
> and call it from findClassEx and findClass, while keeping the
> different exception handling code on each version. Or am I missing
> something again?
I think that this refactoring sounds very reasonable -- though we
should probably put out 2.5.1 before messing with classloader code
unless it fixes bugs.

-Frank

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jython-dev mailing list
Jython-dev@...
https://lists.sourceforge.net/lists/listinfo/jython-dev

Re: Purpose of Py#findClassEx ?

by Leo Soto M. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Aug 25, 2009 at 7:44 AM, Frank Wierzbicki<fwierzbicki@...> wrote:
> On Mon, Aug 24, 2009 at 11:02 PM, Leo Soto M.<leo.soto@...> wrote:
>> Well, I think we can still refactor the common body to a single method
>> and call it from findClassEx and findClass, while keeping the
>> different exception handling code on each version. Or am I missing
>> something again?
> I think that this refactoring sounds very reasonable -- though we
> should probably put out 2.5.1 before messing with classloader code
> unless it fixes bugs.

Yeah, I'll hold my changes until 2.5.1 is out.

--
Leo Soto M.
http://blog.leosoto.com

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jython-dev mailing list
Jython-dev@...
https://lists.sourceforge.net/lists/listinfo/jython-dev

Re: Purpose of Py#findClassEx ?

by Frank Wierzbicki :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Aug 25, 2009 at 8:46 AM, Leo Soto M.<leo.soto@...> wrote:
> Yeah, I'll hold my changes until 2.5.1 is out.
By the way, I'm really glad you are looking hard at this stuff, it is
in need of attention.

Thanks!

-Frank

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jython-dev mailing list
Jython-dev@...
https://lists.sourceforge.net/lists/listinfo/jython-dev