|
From: Olivier J. <oli...@pc...> - 2006-01-17 09:16:59
|
Hi, I'm using spring+GNU classpath right now to ensure that the free java implementations can get the best framework around running neatly and when underdoing the Jdk13ControlFlowTests, I noticed that the checks involving methods were not working. After a bit of investigations, I found that the stack trace generated by cacao was putting an extra space between the end of the method name and the parenthesis to precise the location. Since for 1.3 spec level the search is done within the string image of the stack trace, the exact formatting is very important and breaks in this case. I was wondering who was "wrong" there and it seems that the sun javadocs state that the format used by their jdk (and described in the docs) is only an example (pasted from the Throwable javadoc : "The format of this information depends on the implementation, but the following example may be regarded as typical: [...]") so I don't think cacao can be thought as non compliant with the spec. On the other hand, I do understand that if the spec doesn't give details about the format, we either have to make assumptions or forget it totally (but we don't have any other way to get the stack trace in jvm1.4- afaik). So basically I was wondering whether spring had to be aware of this quirk (either by using a cacao compliant regexp when looking for methods, using probably [ ]? or by "flagging" the test as runnable only in certain jvm implementations) or if cacao had to be adapted. Thanks for your feedback Olivier |
|
From: Juergen H. <ju...@in...> - 2006-01-17 09:27:25
|
Interesting issue. So for a simple fix, would this mean that we should also
check for:
this.stackTrace.indexOf(clazz.getName() + "." + methodName + " (") != -1
With an extra space before the parenthesis?
Juergen
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...] On Behalf Of
Olivier Jolly
Sent: Tuesday, January 17, 2006 10:17 AM
To: spr...@li...
Subject: [Springframework-developer] Assumption about stack trace format and
cacao
Hi,
I'm using spring+GNU classpath right now to ensure that the free java
implementations can get the best framework around running neatly and when
underdoing the Jdk13ControlFlowTests, I noticed that the checks involving
methods were not working.
After a bit of investigations, I found that the stack trace generated by
cacao was putting an extra space between the end of the method name and the
parenthesis to precise the location. Since for 1.3 spec level the search is
done within the string image of the stack trace, the exact formatting is
very important and breaks in this case.
I was wondering who was "wrong" there and it seems that the sun javadocs
state that the format used by their jdk (and described in the docs) is only
an example (pasted from the Throwable javadoc : "The format of this
information depends on the implementation, but the following example may be
regarded as typical: [...]") so I don't think cacao can be thought as non
compliant with the spec. On the other hand, I do understand that if the spec
doesn't give details about the format, we either have to make assumptions or
forget it totally (but we don't have any other way to get the stack trace in
jvm1.4- afaik).
So basically I was wondering whether spring had to be aware of this quirk
(either by using a cacao compliant regexp when looking for methods, using
probably [ ]? or by "flagging" the test as runnable only in certain jvm
implementations) or if cacao had to be adapted.
Thanks for your feedback
Olivier
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: Olivier J. <oli...@pc...> - 2006-01-17 09:39:01
|
> Interesting issue. So for a simple fix, would this mean that we should
> also
> check for:
>
> this.stackTrace.indexOf(clazz.getName() + "." + methodName + " (") != -1
>
> With an extra space before the parenthesis?
Yes, exactly, that should do the trick nicely. I can confirm this later
when I'm home.
But, for performance issues, shouldn't it be better know which exact
pattern we're looking for ? If I understand right, the jdk13 way of doing
is already quite slow, it may hurt to make the situation worse ..
> Juergen
Olivier
|
|
From: Juergen H. <ju...@in...> - 2006-01-17 12:01:00
|
I've just refined Jdk13ControlFactory to take this into account.
This should still be pretty efficient, since it does indexOf with start
indexes now, iterating over the stacktrace to find a match without
subsequent parenthesis - then checking the character right after the method
name whether it's a parenthesis or whitespace, either returning "found" or
increasing the index accordingly for the next iteration.
Juergen
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...] On Behalf Of
Olivier Jolly
Sent: Tuesday, January 17, 2006 10:39 AM
To: spr...@li...
Subject: Re: [Springframework-developer] Assumption about stack trace format
and cacao
> Interesting issue. So for a simple fix, would this mean that we should
> also check for:
>
> this.stackTrace.indexOf(clazz.getName() + "." + methodName + " (")
> != -1
>
> With an extra space before the parenthesis?
Yes, exactly, that should do the trick nicely. I can confirm this later when
I'm home.
But, for performance issues, shouldn't it be better know which exact pattern
we're looking for ? If I understand right, the jdk13 way of doing is already
quite slow, it may hurt to make the situation worse ..
> Juergen
Olivier
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: Juergen H. <ju...@in...> - 2006-01-17 17:48:40
|
FYI, I've finally committed this change to CVS HEAD.
Juergen
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...] On Behalf Of
Juergen Hoeller
Sent: Tuesday, January 17, 2006 1:01 PM
To: spr...@li...
Subject: Re: [Springframework-developer] Assumption about stack trace format
and cacao
I've just refined Jdk13ControlFactory to take this into account.
This should still be pretty efficient, since it does indexOf with start
indexes now, iterating over the stacktrace to find a match without
subsequent parenthesis - then checking the character right after the method
name whether it's a parenthesis or whitespace, either returning "found" or
increasing the index accordingly for the next iteration.
Juergen
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...] On Behalf Of
Olivier Jolly
Sent: Tuesday, January 17, 2006 10:39 AM
To: spr...@li...
Subject: Re: [Springframework-developer] Assumption about stack trace format
and cacao
> Interesting issue. So for a simple fix, would this mean that we should
> also check for:
>
> this.stackTrace.indexOf(clazz.getName() + "." + methodName + " (")
> != -1
>
> With an extra space before the parenthesis?
Yes, exactly, that should do the trick nicely. I can confirm this later when
I'm home.
But, for performance issues, shouldn't it be better know which exact pattern
we're looking for ? If I understand right, the jdk13 way of doing is already
quite slow, it may hurt to make the situation worse ..
> Juergen
Olivier
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: Olivier J. <oli...@pc...> - 2006-01-17 18:38:22
|
Great, I just tested and now it works fine. Thank you Olivier Juergen Hoeller a =E9crit : >FYI, I've finally committed this change to CVS HEAD. > >Juergen >=20 > >-----Original Message----- >From: spr...@li... >[mailto:spr...@li...] On Behalf= Of >Juergen Hoeller >Sent: Tuesday, January 17, 2006 1:01 PM >To: spr...@li... >Subject: Re: [Springframework-developer] Assumption about stack trace fo= rmat >and cacao > >I've just refined Jdk13ControlFactory to take this into account.=20 > >This should still be pretty efficient, since it does indexOf with start >indexes now, iterating over the stacktrace to find a match without >subsequent parenthesis - then checking the character right after the met= hod >name whether it's a parenthesis or whitespace, either returning "found" = or >increasing the index accordingly for the next iteration. > >Juergen >=20 > |