Re: [m2] Can anyone explain this code

2007-02-19 Thread Jiaqi Guo
Hi Franz, I seemed to miss this mail until just now. Sorry for late response. I was trying to get some information of the plugin itself (A PluginDescriptor object). In Maven1 this is feasible if Jelly script refers something like ${plugin.get...} so I guessed there should be similar thing in

Re: [m2] Can anyone explain this code

2007-02-19 Thread franz see
Good day to you, Jiaqi, Feel free to file a jira issue :-) Cheers, Franz Jiaqi Guo wrote: Hi Franz, I seemed to miss this mail until just now. Sorry for late response. I was trying to get some information of the plugin itself (A PluginDescriptor object). In Maven1 this is feasible

Re: [m2] Can anyone explain this code

2007-02-19 Thread franz see
Good day to you, Jiaqi, Actually, the second if statement handles that ( the one after String expression = stripTokens( expr ); ). It takes in the contents of ${ and } and recursively evaluates it. If the expr passed to evaluate(...) is not a ${...}, then the actual substitution takes place.

Re: [m2] Can anyone explain this code

2007-02-14 Thread franz see
Good day to you, Jiaqi, Ah..yes. I also don't understand the purpose of that indexOf(/). The only use case I can think of for that is that when the / is inside the curly braceswhich I don't think is recommendable anyway. But like what you said, the first argument of ${x.y.z} is irrelevant

Re: [m2] Can anyone explain this code

2007-02-13 Thread franz see
Good day to you, Jiaqi, Why do you say that it will be evaluted to null? Cheers, Franz Jiaqi Guo wrote: Hi there, I'm trying to find out the build-in variables for a maven2 plugin and found the following code in

Re: [m2] Can anyone explain this code

2007-02-13 Thread Jiaqi Guo
Hi Franz, I tried to get PluginDescriptor within a mojo and got PluginParameterException, then I started looking at this code. Assume expression is string plugin, pathSeparator is -1, the expression.substring(1) becomes lugin. Did I miss anything here? And then looking at

Re: [m2] Can anyone explain this code

2007-02-13 Thread Jiaqi Guo
In fact, the ReflectionValueExtractor.evaluate(lugin, pluginDescriptor) does return null. The first token in while loop is lugin, which calls getLugin() of root object and returns null. I guess this is where the problem is. Maybe there should be another 'else if ( plugin.equals( expression )

Re: [m2] Can anyone explain this code

2007-02-13 Thread Wayne Fay
Without getting too far into the code myself, you seem to make some very good arguments about possible problems in this code. ;-) I have no idea if this PluginParameterExpressionEvaluator class (and the referenced code in Plexus) have proper unit tests etc, but it seems like you could make a

Re: [m2] Can anyone explain this code

2007-02-13 Thread Jiaqi Guo
Thanks Wayne, Although I found workaround for the tool that I'm working on, the patch for PluginParameterExpression could be really simple: sh-3.1$ svn diff Index: maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java

Re: [m2] Can anyone explain this code

2007-02-13 Thread Wayne Fay
Thanks for your contribution, Jiaqi! Wayne On 2/13/07, Jiaqi Guo [EMAIL PROTECTED] wrote: Thanks Wayne, Although I found workaround for the tool that I'm working on, the patch for PluginParameterExpression could be really simple: sh-3.1$ svn diff Index: