Re: Feedback on groovy.cli.Option annotation

2018-03-23 Thread Remko Popma
Understood, thanks for the clarification.


On Sat, Mar 24, 2018 at 12:23 PM, Paul King  wrote:

>
> We'd consider streamlining but with caveats.
>
> On the one hand, those attributes are influenced a little by what Commons
> CLI supports. It doesn't support ranges like "2..4" at all. However,
> CliBuilder is meant to be an abstraction layer above the CLI
> implementation, so we should assume we have some freedom to present the
> best possible api to CliBuilder users.
>
> On the other hand, we have backward compatibility constraints:
> * We have several 2.5 (albeit beta) releases already in the wild, so our
> preference would be to deprecate rather than remove any existing
> functionality. The desire to maintain backwards compatibility is slightly
> lower because it has only been betas so far but not by much.
> * More importantly, CliBuilder is meant to provide a similar feel whether
> using it via annotations or directly via the api. The api usage is much
> older and we'd probably prefer not to even deprecate functionality offered
> there (and hence via the annotations) without some big improvements. Any
> improvements would be offset by possible negatives, e.g. some users are
> going to prefer the tiny bit of extra type safety offered by an Integer vs
> a String. But I'd note that the direct api doesn't even support setting
> number of arguments via a String so we'd expect some evolution in the api.
>
> So, see how it unfolds, but my gut feel is that so long as the semantics
> are crystal clear, we'd want to keep the other alternatives even if we
> discourage there use a little via appropriate wording in the documentation.
> If it's looking extremely unwieldy, then the 2.5 release would be an
> appropriate streamlining point.
>
> Cheers, Paul.
>
>
> On Sat, Mar 24, 2018 at 11:46 AM, Remko Popma 
> wrote:
>
>> The groovy.cli.Option annotation currently has three attributes for
>> modeling the number of arguments (arity) of an option:
>>
>>
>>- boolean optionalArg() default false
>>- int numberOfArguments() default 1
>>- String numberOfArgumentsString() default ""
>>
>>
>> Are we open to changing this to a single attribute where the number of
>> arguments can be expressed as a range?
>>
>> For example, "0..1" for a single optional argument, "0..*" (or simply "*")
>> for an option with any number of arguments, "1..*" (or "+") for one or
>> more arguments. This would also allow users specifying ranges like "2..4"
>> for an option that has at least 2 but at most 4 arguments.
>>
>> Having a single attribute instead of three is cleaner and simpler IMO. Is
>> it too late to make this change?
>>
>> Thoughts?
>>
>
>


Feedback on groovy.cli.Option annotation

2018-03-23 Thread Remko Popma
The groovy.cli.Option annotation currently has three attributes for
modeling the number of arguments (arity) of an option:


   - boolean optionalArg() default false
   - int numberOfArguments() default 1
   - String numberOfArgumentsString() default ""


Are we open to changing this to a single attribute where the number of
arguments can be expressed as a range?

For example, "0..1" for a single optional argument, "0..*" (or simply "*")
for an option with any number of arguments, "1..*" (or "+") for one or more
arguments. This would also allow users specifying ranges like "2..4" for an
option that has at least 2 but at most 4 arguments.

Having a single attribute instead of three is cleaner and simpler IMO. Is
it too late to make this change?

Thoughts?


Re: [VOTE] Release Apache Groovy 2.4.15

2018-03-23 Thread Paul King
Yep, thanks everyone for the fast response!
But we still need to wait the 3 days as per Apache voting guidelines.
Just a reminder: a subsequent -1 vote would cancel out one of the already
cast +1 votes.

Cheers, Paul.

On Fri, Mar 23, 2018 at 10:40 PM, Daniel.Sun  wrote:

> 3 votes from PMC members have been collected :)
>
> Cheers,
> Daniel.Sun
>
>
>
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
>


Re: [VOTE] Release Apache Groovy 2.4.15

2018-03-23 Thread Jochen Theodorou



Am 23.03.2018 um 12:47 schrieb Paul King:
We temporarily reverted the ASM change but that ended up not being the 
problem, so I put it back the same as in 2.4.14.
The problem was that there was no Java8 plugin for 2_4_X so neither the 
code fixes from GROOVY-8338 nor the respective test ran - fixed now with 
an empty(*) Java8 plugin for 2_4_X.

(*) just returns the java version


ahhh ;) Now that clears the confusion. Thanks

bye Jochen


Re: [VOTE] Release Apache Groovy 2.4.15

2018-03-23 Thread Daniel.Sun
3 votes from PMC members have been collected :)

Cheers,
Daniel.Sun



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html


Re: Need Help to fix the error in Groovy Code

2018-03-23 Thread Jorge Aguilera Gonzalez
Hi Shekh

As and idea, if ArrayUserName is an OracleTypes.ARRAY, maybe it needs to
return something as a List at `getValue()` method

regards

2018-03-23 8:34 GMT+01:00 Ahmad, Shekh Shakeel 
:

> Hi All,
>
> Is that anyone can help ?
>
>
>
>
>
> Thanks & Regards
> *Shekh Shakeel Ahmad, ITIL Certified*
>
>
>
> *From:* Ahmad, Shekh Shakeel
> *Sent:* Thursday, March 22, 2018 4:34 PM
> *To:* 'comm...@groovy.apache.org' ; '
> us...@groovy.apache.org' ; 'dev@groovy.apache.org'
> ; 'notificati...@groovy.apache.org' <
> notificati...@groovy.apache.org>
> *Subject:* Need Help to fix the error in Groovy Code
>
>
>
> Hi All,
>
> I am new in Groovy and stuck on writing in script.
>
> I have a oracle stored proc and that proc using the Arry type input
> parameter
>
> Type Parameter :
>
> create or replace TYPE "ARR_HP_STU_CERT_USERNAME" as table of
> varchar2(32767);
>
> PROC:
>
> 1.  create or replace PROCEDURE sp_hp_stu_cert_status_chk (
>
> 2.  in_track_id IN NUMBER,
>
> 3.  in_username IN arr_hp_stu_cert_username,
>
> 4.  in_certification_id IN VARCHAR2,
>
> 5.  out_details OUT SYS_REFCURSOR,
>
> 6.  out_status_code OUT NUMBER,
>
> 7.  out_status_desc OUT VARCHAR2)
>
> 8.  AS
>
> 9.  v_prc_name VARCHAR2 (50) := 'sp_hp_stu_cert_status_chk';
>
> 10. v_count NUMBER;
>
> 11. v_user_id VARCHAR2 (500);
>
> 12. required_fields EXCEPTION;
>
> 13. BEGIN
>
> 14. {
>
> 15. ; doing stuff ;;
>
> 16. }
>
> I have written a groovy code to execute that proc but its giving error
> about casting :
>
> Groovy Script :
>
> 1.  /*import org.apache.commons.io.IOUtils
>
> 2.  import org.apache.nifi.controller.ControllerService
>
> 3.  import org.apache.nifi.processor.io.StreamCallback */
>
> 4.  import java.nio.charset.*
>
> 5.  import groovy.sql.OutParameter
>
> 6.  import groovy.sql.InParameter
>
> 7.  import groovy.sql.Sql
>
> 8.  import oracle.jdbc.OracleTypes
>
> 9.  import java.sql.ResultSet
>
> 10. //import java.sql.*
>
> 11.
>
> 12.
>
> 13.
>
> 14.
>
> 15. def sql = Sql.newInstance('jdbc:oracle:thin:@//X.itcs.entsvcs.
> net:1525/', '', 'X$', 'oracle.jdbc.OracleDriver')
>
> 16. in_track_id='1798'
>
> 17. in_certification_id='crtfy0003144'
>
> 18.
>
> 19.
>
> 20.
>
> 21.
>
> 22. OutParameter CURSOR_PARAMETER = new OutParameter() {
>
> 23. public int getType() {
>
> 24. return OracleTypes.CURSOR;
>
> 25. }
>
> 26. };
>
> 27.
>
> 28.
>
> 29. InParameter ArrayUserName = new InParameter() {
>
> 30. public int getType() {
>
> 31. return OracleTypes.ARRAY;
>
> 32. }
>
> 33. public Object getValue(){
>
> 34.
>
> 35.
>
> 36. }
>
> 37. };
>
> 38.
>
> 39.
>
> 40.
>
> 41.
>
> 42. def data = []
>
> 43. String sqlString ="""{call sp_hp_stu_cert_status_chk(?, ?, ?, ?, ?,
> ?)}""";
>
> 44. def status_desc
>
> 45. def status_code
>
> 46. def status_data
>
> 47. def testID
>
> 48. def parametersList = [in_track_id, ArrayUserName, in_certification_id,
> CURSOR_PARAMETER, Sql.NUMERIC ,Sql.VARCHAR];
>
> 49.
>
> 50.
>
> 51. sql.call(sqlString, parametersList) {out_details, out_status_code,
> out_status_desc ->
>
> 52. status_desc = out_status_desc
>
> 53. status_code = out_status_code
>
> 54. };
>
> 55.
>
> 56.
>
> 57. Print(status_desc)
>
> 58. Print(status_code)
>
> And this scripting giving error to of arry.type “ArrayUserName” could any
> help where I am making incorrect thing.
>
>
>
>
>
>
>
>
>
> Thanks & Regards
> *Shekh Shakeel Ahmad,*
>
>
>



-- 
Jorge Aguilera Gonzalez
CEO  PuraVida Software
http://www.puravida-software.com


Groovy and testing

2018-03-23 Thread Russel Winder
Hi,

With all the versions of Groovy currently released, there is a problem
that anyone using  Spock seems to be stuck on Groovy 2.4.x because the
latest version of Spock is 1.1-groovy-2.4 and so there is no reliable
Spock for Groovy 2.5.x, 2.6.x or 3.0.x.

-- 
Russel.
===
Dr Russel Winder  t: +44 20 7585 2200
41 Buckmaster Roadm: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


signature.asc
Description: This is a digitally signed message part


Re: [VOTE] Release Apache Groovy 2.4.15

2018-03-23 Thread Paul King
We temporarily reverted the ASM change but that ended up not being the
problem, so I put it back the same as in 2.4.14.
The problem was that there was no Java8 plugin for 2_4_X so neither the
code fixes from GROOVY-8338 nor the respective test ran - fixed now with an
empty(*) Java8 plugin for 2_4_X.
(*) just returns the java version

Cheers, Paul.

On Fri, Mar 23, 2018 at 9:10 PM, Jochen Theodorou  wrote:

>
>
> Am 23.03.2018 um 08:04 schrieb Paul King:
>
>>
>> Dear development community,
>>
>> I am happy to start the VOTE thread for a Groovy 2.4.15 release! This is
>> mainly to fix a regression in calling static methods in interfaces. We were
>> trying to improve the JDK9 experience but on the 2.4 branch it caused
>> existing functionality to be impacted even on JDK8.
>>
>> This release includes 6 bug fixes/improvements as outlined in the
>> changelog:
>> https://issues.apache.org/jira/secure/ReleaseNote.jspa?proje
>> ctId=12318123=12342853
>>
>
> wait... the upgrade to asm 6 was missing on 2.4.x I really thought I
> had checked that. I am puzzled. Or was it undone at some point? Maybe
> because it was not 6.0 final yet? I guess next time I should check the
> release dependencies as well ;)
>
> Anyway +1
>
> bye Jochen
>


Re: [VOTE] Release Apache Groovy 2.4.15

2018-03-23 Thread Jochen Theodorou



Am 23.03.2018 um 08:04 schrieb Paul King:


Dear development community,

I am happy to start the VOTE thread for a Groovy 2.4.15 release! This is 
mainly to fix a regression in calling static methods in interfaces. We 
were trying to improve the JDK9 experience but on the 2.4 branch it 
caused existing functionality to be impacted even on JDK8.


This release includes 6 bug fixes/improvements as outlined in the changelog:
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12318123=12342853


wait... the upgrade to asm 6 was missing on 2.4.x I really thought I 
had checked that. I am puzzled. Or was it undone at some point? Maybe 
because it was not 6.0 final yet? I guess next time I should check the 
release dependencies as well ;)


Anyway +1

bye Jochen


Re: [VOTE] Release Apache Groovy 2.4.15

2018-03-23 Thread Guillaume Laforge
+1

My smoke test (on JDK 8) went fine.
Nothing special to report.

Guillaume


On Fri, Mar 23, 2018 at 8:55 AM, Daniel Sun  wrote:

> +1
>
> Cheers,
> Daniel.Sun
>
>
>
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
>



-- 
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform

Blog: http://glaforge.appspot.com/
Social: @glaforge  / Google+



Re: [VOTE] Release Apache Groovy 2.4.15

2018-03-23 Thread Daniel Sun
+1

Cheers,
Daniel.Sun



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html


[VOTE] Release Apache Groovy 2.4.15

2018-03-23 Thread Paul King
Dear development community,

I am happy to start the VOTE thread for a Groovy 2.4.15 release! This is
mainly to fix a regression in calling static methods in interfaces. We were
trying to improve the JDK9 experience but on the 2.4 branch it caused
existing functionality to be impacted even on JDK8.

This release includes 6 bug fixes/improvements as outlined in the changelog:
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12318123=12342853

Tag:
https://git1-us-west.apache.org/repos/asf?p=groovy.git;a=tag;h=refs/tags/GROOVY_2_4_15
Tag commit id: 067f3d3f3ec660ceb86f6bf0ce38c4dfcef5c11c

The artifacts to be voted on are located as follows (r25897).
Source release: https://dist.apache.org/repos/dist/dev/groovy/2.4.15/sources
Convenience binaries:
https://dist.apache.org/repos/dist/dev/groovy/2.4.15/distribution

Release artifacts are signed with a key from the following file:
https://dist.apache.org/repos/dist/dev/groovy/KEYS

Please vote on releasing this package as Apache Groovy 2.4.15.

Reminder on ASF release approval requirements for PMC members:
http://www.apache.org/legal/release-policy.html#release-approval
Hints on validating checksums/signatures (but replace md5sum with
sha256sum):
https://www.apache.org/info/verification.html

The vote is open for the next 72 hours and passes if a majority of at least
three +1 PMC votes are cast.

[ ] +1 Release Apache Groovy 2.4.15
[ ]  0 I don't have a strong opinion about this, but I assume it's ok
[ ] -1 Do not release Apache Groovy 2.4.15 because...

Here is my vote:

+1 (binding)