|
Hi all,
Something seems to be wrong here: http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/runtime/ArrayUtil.java Any ideas what's going on here? Cheers, Behrang Saeedzadeh http://www.behrang.org |
|
OK, so I was the one that posted the link to Twitter because I was surprised by the implementation. However, it wasn't explained well and out of context people did not understand this class.
First: the package is org.codehaus.groovy.runtime. This is NOT a class that any user of Groovy will ever use. There are plenty of XML utilities in groovy.lang or groovy.xml for you to use. Second: This class is never invoked from code. It exists so that byte code statements have something to link against. If you dump the stack language of a .class file you may indeed see a "INVOKESTATIC org/codehaus/groovy/runtime/XMLUtil" invocation. This logic is used around the CallSite writing features. Third: Implementing a dynamic language (Groovy) in a static language (Java) on a type less virtual machine (JVM) is hard. Every language has their work arounds. We generated some code so that we had something to link against. At one point, JRuby was generating reams of interfaces (IIRC) and have you seen the implementation of OpenJDK? Ever notice now many methods are overloaded for all the primitives plus Object. These are all workarounds to get the end user a good programming experience while still running on the JVM. I am sure I butchered some of the explanations here, but the intent stands. |
|
In reply to this post by Behrang Saeedzadeh
This is trivial bytecode shortcut for creating array out of objects on
top of stack What's wrong with it? On Tue, Nov 30, 2010 at 4:37 AM, Behrang Saeedzadeh <[hidden email]> wrote: > Hi all, > > Something seems to be wrong here: > > http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/runtime/ArrayUtil.java > > Any ideas what's going on here? > > Cheers, > Behrang Saeedzadeh > http://www.behrang.org > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
> This is trivial bytecode shortcut for creating array out of objects on
> top of stack What's wrong with it? The problem is that people don't understand why it exists, how it was created, or where it is used. If you saw this source file in a typical enterprise application then you would probably go find the developer responsible and ask some questions because there are easier ways (from user code) to manipulate Arrays. I'm sorry I tweeted about this file. What a pointless mess I needlessly created. -- Hamlet D'Arcy [hidden email] ----- Original Message ----- > This is trivial bytecode shortcut for creating array out of objects on > top of stack What's wrong with it? > > On Tue, Nov 30, 2010 at 4:37 AM, Behrang Saeedzadeh > <[hidden email]> wrote: > > Hi all, > > > > Something seems to be wrong here: > > > > http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/runtime/ArrayUtil.java > > > > Any ideas what's going on here? > > > > Cheers, > > Behrang Saeedzadeh > > http://www.behrang.org > > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
It was a good explanation, let this sleeping dog lie :) I found it interesting not scary!
On Tue, Nov 30, 2010 at 9:13 AM, Hamlet DArcy <[hidden email]> wrote:
-- John Rellis @johnrellis |
|
In reply to this post by HamletDRC2
No problem, Hamlet. I think we have much more intriguing pieces of
code. ACG, for example, or ClassInfo. Not to mention MCI, EMC and around. If someone asks what we do in let say ClassInfo and synchronize here but not there... you know it is an interesting discussion. BTW, if you want some real challenge - read ClassInfo. I am (almost) sure we have deep synchronization bug somewhere around. I saw recently several reports on deadlock which makes me think so. Some fresh eye reading might help. On Tue, Nov 30, 2010 at 11:13 AM, Hamlet DArcy <[hidden email]> wrote: >> This is trivial bytecode shortcut for creating array out of objects on >> top of stack What's wrong with it? > > > The problem is that people don't understand why it exists, how it was created, or where it is used. If you saw this source file in a typical enterprise application then you would probably go find the developer responsible and ask some questions because there are easier ways (from user code) to manipulate Arrays. I'm sorry I tweeted about this file. What a pointless mess I needlessly created. > > -- > Hamlet D'Arcy > [hidden email] > > ----- Original Message ----- >> This is trivial bytecode shortcut for creating array out of objects on >> top of stack What's wrong with it? >> >> On Tue, Nov 30, 2010 at 4:37 AM, Behrang Saeedzadeh >> <[hidden email]> wrote: >> > Hi all, >> > >> > Something seems to be wrong here: >> > >> > http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/runtime/ArrayUtil.java >> > >> > Any ideas what's going on here? >> > >> > Cheers, >> > Behrang Saeedzadeh >> > http://www.behrang.org >> > >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
Interesting topic - thanks for useful answers! Alex, I have one idea about what you have said "Some fresh eye reading might help" I think there are quite a lot of experienced and skillful java developers starting trying Groovy... And Groovy itself is written in Java.
So, when you guys who develop groovy core have some particular place (at package / several class level probably) then you can just publish that on groovy site and post here. Something like: Following piece of code probably has a bug and needs to be reviewed. So we start a contest :) first one who described correctly what the bug is (if it is) will be..you know.. winner of that contest :) This way you may involve more developers into that reviews, just making that some sort of programming competition. What do you think? Thanks, Michael
2010/11/30 Alex Tkachman <[hidden email]> No problem, Hamlet. I think we have much more intriguing pieces of -- Thanks, Michael Antonov |
|
>> What do you think?
It is an open source project. Write a small grails/gaelyk app that subsscribes to the Groovy-SCM mailing list and displays all the changed files in the last 7 days. Offer a small reward for anyone submitting a failing test case against any of these files. The ball is in your court. :) -- Hamlet D'Arcy [hidden email] ----- Original Message ----- Interesting topic - thanks for useful answers! Alex , I have one idea about what you have said "Some fresh eye reading might help" I think there are quite a lot of experienced and skillful java developers starting trying Groovy... And Groovy itself is written in Java. So, when you guys who develop groovy core have some particular place (at package / several class level probably) then you can just publish that on groovy site and post here. Something like: Following piece of code probably has a bug and needs to be reviewed. So we start a contest :) first one who described correctly what the bug is (if it is) will be..you know.. winner of that contest :) This way you may involve more developers into that reviews, just making that some sort of programming competition. What do you think? Thanks, Michael 2010/11/30 Alex Tkachman < [hidden email] > No problem, Hamlet. I think we have much more intriguing pieces of code. ACG, for example, or ClassInfo. Not to mention MCI, EMC and around. If someone asks what we do in let say ClassInfo and synchronize here but not there... you know it is an interesting discussion. BTW, if you want some real challenge - read ClassInfo. I am (almost) sure we have deep synchronization bug somewhere around. I saw recently several reports on deadlock which makes me think so. Some fresh eye reading might help. On Tue, Nov 30, 2010 at 11:13 AM, Hamlet DArcy < [hidden email] > wrote: >> This is trivial bytecode shortcut for creating array out of objects on >> top of stack What's wrong with it? > > > The problem is that people don't understand why it exists, how it was created, or where it is used. If you saw this source file in a typical enterprise application then you would probably go find the developer responsible and ask some questions because there are easier ways (from user code) to manipulate Arrays. I'm sorry I tweeted about this file. What a pointless mess I needlessly created. > > -- > Hamlet D'Arcy > [hidden email] > > ----- Original Message ----- >> This is trivial bytecode shortcut for creating array out of objects on >> top of stack What's wrong with it? >> >> On Tue, Nov 30, 2010 at 4:37 AM, Behrang Saeedzadeh >> < [hidden email] > wrote: >> > Hi all, >> > >> > Something seems to be wrong here: >> > >> > http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/runtime/ArrayUtil.java >> > >> > Any ideas what's going on here? >> > >> > Cheers, >> > Behrang Saeedzadeh >> > http://www.behrang.org >> > >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email -- Thanks, Michael Antonov --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
In reply to this post by Mikhail Antonov
Михаил Антонов wrote:
[...] > Following piece of code probably has a bug and needs to be reviewed. So > we start a contest :) first one who described correctly what the bug is > (if it is) will be..you know.. winner of that contest :) > > This way you may involve more developers into that reviews, just making > that some sort of programming competition. > > What do you think? basically a good idea, but doesn't "following piece of code probably has a bug and needs to be reviewed" potentially apply to each and every code file? bye blackdrag -- Jochen "blackdrag" Theodorou The Groovy Project Tech Lead http://blackdragsview.blogspot.com/ For Groovy programming sources visit http://groovy.codehaus.org --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
I meant actually, that some groovy core developers identify such places where the possibility of a bug is highest.
For example above if was mentioned that there could be a deep sync. bug in a particular place (whereas, in other places there could be also bugs, but the possibility is much lower).
My main idea is, let me restate in another words: there are groovy core developers, who know most about that groovy codebase. And they know that there are some most suspicious places in the code in terms of potential bugs. And you guys want fresh eyes to see that.
Well, play with the people natural here :) -- make finding bugs and reviewing code a contest! People spend time on TopCoder as this is a contest. So, why not you try that this way: ok, here is a code in ACG which likely contains a bug, we ourselves don't know, but we just have a gutfeeling. So, first who discover it will be placed at the wall of shame (damn, wall of fame I should have said :)))) on the groovy site.
That is. Thanks,
Michael 2010/11/30 Jochen Theodorou <[hidden email]> Михаил Антонов wrote: -- Thanks, Michael Antonov |
|
In reply to this post by Alex Tkachman
Personally I think the problem with the class is the name. ArrayUtils
is a common class name and for an internal class it should be named something more mysterious ;-) Cheers On Tue, Nov 30, 2010 at 10:32 AM, Alex Tkachman <[hidden email]> wrote: > No problem, Hamlet. I think we have much more intriguing pieces of > code. ACG, for example, or ClassInfo. Not to mention MCI, EMC and > around. If someone asks what we do in let say ClassInfo and > synchronize here but not there... you know it is an interesting > discussion. > > BTW, if you want some real challenge - read ClassInfo. I am (almost) > sure we have deep synchronization bug somewhere around. I saw recently > several reports on deadlock which makes me think so. Some fresh eye > reading might help. > > On Tue, Nov 30, 2010 at 11:13 AM, Hamlet DArcy <[hidden email]> wrote: >>> This is trivial bytecode shortcut for creating array out of objects on >>> top of stack What's wrong with it? >> >> >> The problem is that people don't understand why it exists, how it was created, or where it is used. If you saw this source file in a typical enterprise application then you would probably go find the developer responsible and ask some questions because there are easier ways (from user code) to manipulate Arrays. I'm sorry I tweeted about this file. What a pointless mess I needlessly created. >> >> -- >> Hamlet D'Arcy >> [hidden email] >> >> ----- Original Message ----- >>> This is trivial bytecode shortcut for creating array out of objects on >>> top of stack What's wrong with it? >>> >>> On Tue, Nov 30, 2010 at 4:37 AM, Behrang Saeedzadeh >>> <[hidden email]> wrote: >>> > Hi all, >>> > >>> > Something seems to be wrong here: >>> > >>> > http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/runtime/ArrayUtil.java >>> > >>> > Any ideas what's going on here? >>> > >>> > Cheers, >>> > Behrang Saeedzadeh >>> > http://www.behrang.org >>> > >>> >>> --------------------------------------------------------------------- >>> To unsubscribe from this list, please visit: >>> >>> http://xircles.codehaus.org/manage_email >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> >> > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > -- Graeme Rocher Grails Project Lead SpringSource - A Division of VMware http://www.springsource.com --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
LOL, very good point about the "mysterious" name :-D
On Tue, Nov 30, 2010 at 17:05, Graeme Rocher <[hidden email]> wrote: Personally I think the problem with the class is the name. ArrayUtils -- Guillaume Laforge Groovy Project Manager Head of Groovy Development at SpringSource http://www.springsource.com/g2one |
|
I totally agree. Unfortunately it is too late to change without
breaking already compiled code. On Tue, Nov 30, 2010 at 6:08 PM, Guillaume Laforge <[hidden email]> wrote: > LOL, very good point about the "mysterious" name :-D > > On Tue, Nov 30, 2010 at 17:05, Graeme Rocher <[hidden email]> wrote: >> >> Personally I think the problem with the class is the name. ArrayUtils >> is a common class name and for an internal class it should be named >> something more mysterious ;-) >> >> Cheers >> >> On Tue, Nov 30, 2010 at 10:32 AM, Alex Tkachman <[hidden email]> >> wrote: >> > No problem, Hamlet. I think we have much more intriguing pieces of >> > code. ACG, for example, or ClassInfo. Not to mention MCI, EMC and >> > around. If someone asks what we do in let say ClassInfo and >> > synchronize here but not there... you know it is an interesting >> > discussion. >> > >> > BTW, if you want some real challenge - read ClassInfo. I am (almost) >> > sure we have deep synchronization bug somewhere around. I saw recently >> > several reports on deadlock which makes me think so. Some fresh eye >> > reading might help. >> > >> > On Tue, Nov 30, 2010 at 11:13 AM, Hamlet DArcy <[hidden email]> >> > wrote: >> >>> This is trivial bytecode shortcut for creating array out of objects on >> >>> top of stack What's wrong with it? >> >> >> >> >> >> The problem is that people don't understand why it exists, how it was >> >> created, or where it is used. If you saw this source file in a typical >> >> enterprise application then you would probably go find the developer >> >> responsible and ask some questions because there are easier ways (from user >> >> code) to manipulate Arrays. I'm sorry I tweeted about this file. What a >> >> pointless mess I needlessly created. >> >> >> >> -- >> >> Hamlet D'Arcy >> >> [hidden email] >> >> >> >> ----- Original Message ----- >> >>> This is trivial bytecode shortcut for creating array out of objects on >> >>> top of stack What's wrong with it? >> >>> >> >>> On Tue, Nov 30, 2010 at 4:37 AM, Behrang Saeedzadeh >> >>> <[hidden email]> wrote: >> >>> > Hi all, >> >>> > >> >>> > Something seems to be wrong here: >> >>> > >> >>> > >> >>> > http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/runtime/ArrayUtil.java >> >>> > >> >>> > Any ideas what's going on here? >> >>> > >> >>> > Cheers, >> >>> > Behrang Saeedzadeh >> >>> > http://www.behrang.org >> >>> > >> >>> >> >>> --------------------------------------------------------------------- >> >>> To unsubscribe from this list, please visit: >> >>> >> >>> http://xircles.codehaus.org/manage_email >> >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe from this list, please visit: >> >> >> >> http://xircles.codehaus.org/manage_email >> >> >> >> >> >> >> > >> > --------------------------------------------------------------------- >> > To unsubscribe from this list, please visit: >> > >> > http://xircles.codehaus.org/manage_email >> > >> > >> > >> >> >> >> -- >> Graeme Rocher >> Grails Project Lead >> SpringSource - A Division of VMware >> http://www.springsource.com >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> > > > > -- > Guillaume Laforge > Groovy Project Manager > Head of Groovy Development at SpringSource > http://www.springsource.com/g2one > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
Alex Tkachman wrote:
> I totally agree. Unfortunately it is too late to change without > breaking already compiled code. actually... are you really sure it is used in the bytecode part? Do you have a pointer? bye blackdrag -- Jochen "blackdrag" Theodorou The Groovy Project Tech Lead http://blackdragsview.blogspot.com/ For Groovy programming sources visit http://groovy.codehaus.org --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
Jochen Theodorou wrote:
> Alex Tkachman wrote: >> I totally agree. Unfortunately it is too late to change without >> breaking already compiled code. > > actually... are you really sure it is used in the bytecode part? Do you > have a pointer? Guillaume pointed me to some code in CallsiteWriter where it is used.... so question answered bye blackdrag -- Jochen "blackdrag" Theodorou The Groovy Project Tech Lead http://blackdragsview.blogspot.com/ For Groovy programming sources visit http://groovy.codehaus.org --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
You should switch to IntelliJ as Guillaume, myself and many others :)
On Tue, Nov 30, 2010 at 6:53 PM, Jochen Theodorou <[hidden email]> wrote: > Jochen Theodorou wrote: >> >> Alex Tkachman wrote: >>> >>> I totally agree. Unfortunately it is too late to change without >>> breaking already compiled code. >> >> actually... are you really sure it is used in the bytecode part? Do you >> have a pointer? > > Guillaume pointed me to some code in CallsiteWriter where it is used.... so > question answered > > bye blackdrag > > > -- > Jochen "blackdrag" Theodorou > The Groovy Project Tech Lead > http://blackdragsview.blogspot.com/ > For Groovy programming sources visit http://groovy.codehaus.org > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
In reply to this post by Alex Tkachman
If we were to start the
"I-think-there-are-many-bugs-in-here-let's-see-who-can-find-them" competition, my
first submission to it will be ConfigSlurper code.
Great initial boost to the competition. Very high on the list of code pieces I dislike most. -- Roshan http://roshandawrani.wordpress.com/ http://twitter.com/roshandawrani On Tue, Nov 30, 2010 at 3:02 PM, Alex Tkachman <[hidden email]> wrote: No problem, Hamlet. I think we have much more intriguing pieces of |
|
Great, we have one submission already :)
Roshan, do you think that make sense to keep a list of "most buggy code pieces" hosted somewhere on groovy site? Mike
2010/11/30 Roshan Dawrani <[hidden email]> If we were to start the "I-think-there-are-many-bugs-in-here-let's-see-who-can-find-them" competition, my first submission to it will be ConfigSlurper code. -- Thanks, Michael Antonov |
|
Can we put a positive spin on this?
How about a 100% test coverage contest and then we can be safe to refactor it :) -- Hamlet D'Arcy [hidden email] Great, we have one submission already :) |
|
In reply to this post by Mikhail Antonov
No, Mike, a bit of fun apart, it doesn't make sense to me.
There are many issues in Groovy defect tracker system. If there are enthusiastic people around, I will much more prefer to invite them to have a crack at those issues and submit patches rather than starting a competition that has seemingly negative roots.... :-) On Wed, Dec 1, 2010 at 12:08 AM, Михаил Антонов <[hidden email]> wrote: Great, we have one submission already :) -- Roshan http://roshandawrani.wordpress.com/ http://twitter.com/roshandawrani |
| Powered by Nabble | See how NAML generates this page |
