Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-bcel]

2024-02-16 Thread via GitHub


garydgregory merged PR #274:
URL: https://github.com/apache/commons-bcel/pull/274


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [CLI-323] Added Supplier defaults for getParsedOptionValue [commons-cli]

2024-02-16 Thread via GitHub


garydgregory merged PR #229:
URL: https://github.com/apache/commons-cli/pull/229


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Resolved] (CLI-323) Add methods to accept Supplier for getParsedOptionValue

2024-02-16 Thread Gary D. Gregory (Jira)


 [ 
https://issues.apache.org/jira/browse/CLI-323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary D. Gregory resolved CLI-323.
-
Resolution: Fixed

[~claude] 

In git master.

 

> Add methods to accept Supplier for getParsedOptionValue
> --
>
> Key: CLI-323
> URL: https://issues.apache.org/jira/browse/CLI-323
> Project: Commons CLI
>  Issue Type: Improvement
>  Components: CLI-1.x
>Affects Versions: 1.6.0
>Reporter: Claude Warren
>Priority: Minor
> Fix For: 1.7.0
>
>
> Currently a Supplier is accepted as the default for getOptionValue() 
> calls but a Supplier is not accepted as the default for 
> getDefaultOptionValue
> This change is to add the Supplier to those methods.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Closed] (CLI-292) Girhub vs apache

2024-02-16 Thread Gary D. Gregory (Jira)


 [ 
https://issues.apache.org/jira/browse/CLI-292?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary D. Gregory closed CLI-292.
---
Resolution: Not A Bug

> Girhub vs apache
> 
>
> Key: CLI-292
> URL: https://issues.apache.org/jira/browse/CLI-292
> Project: Commons CLI
>  Issue Type: Bug
>  Components: Documentation
>Affects Versions: 1.5.0
>Reporter: Elliotte Rusty Harold
>Priority: Major
>
> From CONTRIBUTING.md it appears that development now happens on Github. 
> However pom.xml still lists the Apache repos:
>   
> 
> scm:git:http://git-wip-us.apache.org/repos/asf/commons-cli.git
> 
> scm:git:https://git-wip-us.apache.org/repos/asf/commons-cli.git
> https://git-wip-us.apache.org/repos/asf?p=commons-cli.git
> HEAD
>   
> and this finds its way into the generated docs. I suspect the correct answer 
> is to change pom.xml. However either way these should be consistent. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-fileupload]

2024-02-16 Thread via GitHub


garydgregory merged PR #276:
URL: https://github.com/apache/commons-fileupload/pull/276


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-jxpath]

2024-02-16 Thread via GitHub


garydgregory merged PR #114:
URL: https://github.com/apache/commons-jxpath/pull/114


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-rdf]

2024-02-16 Thread via GitHub


garydgregory merged PR #195:
URL: https://github.com/apache/commons-rdf/pull/195


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-text]

2024-02-16 Thread via GitHub


garydgregory merged PR #504:
URL: https://github.com/apache/commons-text/pull/504


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [CLI-312] Illustrate inconsistent behaviour in key/value pairs (Java property style) [commons-cli]

2024-02-16 Thread via GitHub


garydgregory closed pull request #189: [CLI-312] Illustrate inconsistent 
behaviour in key/value pairs (Java property style)
URL: https://github.com/apache/commons-cli/pull/189


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Updated] (CLI-244) Non-existing option is not reported as a failure when it follows an option that accepts multiple values

2024-02-16 Thread Gary D. Gregory (Jira)


 [ 
https://issues.apache.org/jira/browse/CLI-244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary D. Gregory updated CLI-244:

Priority: Major  (was: Critical)

> Non-existing option is not reported as a failure when it follows an option 
> that accepts multiple values
> ---
>
> Key: CLI-244
> URL: https://issues.apache.org/jira/browse/CLI-244
> Project: Commons CLI
>  Issue Type: Bug
>  Components: CLI-1.x
>Affects Versions: 1.2
> Environment: Java 7
> Linux/Windows
>Reporter: Ivan C
>Priority: Major
>
> If I define the following options:
> {code:java}
> Option dest = OptionBuilder
> .withArgName("-d")
> .withDescription("Destination")
> .hasArg()
> .create("-d");
> dest.setRequired(true);
> Option filenames = OptionBuilder
> .withArgName("-f")
> .withDescription("Filenames; comma separated")
> .hasArgs()
> .withValueSeparator(',')
> .create("-f");
> {code}
> when I parse the following arguments
> {code}
> -d c:\development\test -f abc.txt -qa hello
> {code}
> rather than getting a ParseException, the code thinks abc.txt, -qa, hello are 
> the values for the -f option.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] CLI-324 Make adding OptionGroups and Options to existing Options easier [commons-cli]

2024-02-16 Thread via GitHub


garydgregory merged PR #230:
URL: https://github.com/apache/commons-cli/pull/230


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-daemon]

2024-02-16 Thread via GitHub


garydgregory merged PR #141:
URL: https://github.com/apache/commons-daemon/pull/141


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Resolved] (CLI-312) Inconsistent behaviour in key/value pairs (Java property style)

2024-02-16 Thread Gary D. Gregory (Jira)


 [ 
https://issues.apache.org/jira/browse/CLI-312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary D. Gregory resolved CLI-312.
-
Fix Version/s: 1.7.0
   Resolution: Fixed

[~mthmulders]
Fixed in git master with PR https://github.com/apache/commons-cli/pull/233
Please verify and close.

> Inconsistent behaviour in key/value pairs (Java property style)
> ---
>
> Key: CLI-312
> URL: https://issues.apache.org/jira/browse/CLI-312
> Project: Commons CLI
>  Issue Type: Bug
>  Components: Parser
>Affects Versions: 1.5.0
>Reporter: Maarten Mulders
>Priority: Minor
> Fix For: 1.7.0
>
>
> In the Apache Maven project, we used to have an {{Option}} defined like this:
> {code:java}
> Option.builder("D").longOpt("define").hasArg().build()
> {code}
> This allowed our users to define properties using all of these:
> * {{-Dx=1}}
> * {{-Dx}}
> * {{-D x}}
> * {{--define x=1}}
> * {{--define x}}
> Splitting the key/value pairs was something that we did inside Maven 
> ([{{MavenCli.java 
> #1733}}|https://github.com/apache/maven/blob/master/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java#L1733]
>  and [{{MavenCli.java 
> #1762}}|https://github.com/apache/maven/blob/master/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java#L1762]).
> In the process of upgrading to Commons CLI 1.5 and moving away from the 
> deprecated {{GnuParser}}, we found out that Commons CLI can split argument 
> values thanks to the {{valueSeparator}}. We've changed our option declaration 
> accordingly:
> {code:java}
> Option.builder("D").longOpt("define").numberOfArgs(2).valueSeparator('=').build()
>  );
> {code}
> Unfortunately, this breaks our accepted inputs: {{-Dv -Dw=1 -D x=2 -D y -D 
> z=3}} breaks the parsing in Commons CLI:
> {code}
> org.apache.commons.cli.MissingArgumentException: Missing argument for option: 
> D
>   at 
> org.apache.commons.cli.DefaultParser.checkRequiredArgs(DefaultParser.java:231)
>   at 
> org.apache.commons.cli.DefaultParser.handleOption(DefaultParser.java:394)
>   at 
> org.apache.commons.cli.DefaultParser.handleShortAndLongOption(DefaultParser.java:467)
>   at 
> org.apache.commons.cli.DefaultParser.handleToken(DefaultParser.java:542)
>   at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:714)
>   at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:681)
>   at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:662)
> {code}
> From debugging, I've learned that it breaks at the *fifth* occurrence of 
> {{-D}} (the one followed by {{z=3}}). It considers the *fourth* occurrence of 
> {{-D}} incomplete (having only one value and not two). The strange thing is 
> that the *first* occurrence of {{-D}} also has just one value ({{v}}) but 
> parsing {{-Dw=1}} does not break over that.
> I can submit a pull request for a bug that demonstrates this, but I have no 
> clue how to address it. Also, I don't know if this is actually supposed to 
> work. Looking forward to your reaction.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (CLI-324) Make adding OptionGroups and Options to existing Options easier

2024-02-16 Thread Gary D. Gregory (Jira)


 [ 
https://issues.apache.org/jira/browse/CLI-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary D. Gregory resolved CLI-324.
-
Resolution: Fixed

[~claude] 

In git master.

 

> Make adding OptionGroups and Options to existing Options easier
> ---
>
> Key: CLI-324
> URL: https://issues.apache.org/jira/browse/CLI-324
> Project: Commons CLI
>  Issue Type: Improvement
>  Components: CLI-1.x
>Affects Versions: 1.6.0
>Reporter: Claude Warren
>Priority: Minor
> Fix For: 1.7.0
>
>
> Currently it is not possible to add one Options to another Options nor is is 
> possible to retrieve the collection of OptionGroups from the Options.  This 
> change fixes both of those issues.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Closed] (CLI-293) Associate parse priority with Option flags

2024-02-16 Thread Gary D. Gregory (Jira)


 [ 
https://issues.apache.org/jira/browse/CLI-293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary D. Gregory closed CLI-293.
---
Resolution: Abandoned

PR is closed.

> Associate parse priority with Option flags
> --
>
> Key: CLI-293
> URL: https://issues.apache.org/jira/browse/CLI-293
> Project: Commons CLI
>  Issue Type: New Feature
>  Components: CLI-1.x, Options definition
>Affects Versions: 1.5.0
>Reporter: Triston Chavez
>Priority: Minor
>  Labels: newbie, pull-request-available, usability
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> By associating a priority with Option instances, the task of parsing each 
> option in a prioritized manner is greatly simplified. This is the first time 
> I have ever submitted a pull request to a project I did not create, but I did 
> my honest best to keep aligned with the standards of this project. I 
> submitted a pull request on github. It failed for openjdk6 on the Travis-CI 
> test, but the logs lead me to believe that it due to a problem with the test 
> and not my patch. The meat of the patch is only around 65 LOC so it is very 
> minimally invasive. The pull request can be found 
> [here|https://github.com/apache/commons-cli/pull/28]. Any feedback is much 
> appreciated! 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-exec]

2024-02-16 Thread via GitHub


garydgregory merged PR #159:
URL: https://github.com/apache/commons-exec/pull/159


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-imaging]

2024-02-16 Thread via GitHub


garydgregory merged PR #362:
URL: https://github.com/apache/commons-imaging/pull/362


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-email]

2024-02-16 Thread via GitHub


garydgregory merged PR #215:
URL: https://github.com/apache/commons-email/pull/215


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Closed] (CLI-242) PATCH: Util Class Cleaning

2024-02-16 Thread Gary D. Gregory (Jira)


 [ 
https://issues.apache.org/jira/browse/CLI-242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary D. Gregory closed CLI-242.
---
Resolution: Fixed

Old ticket, class updated since.

> PATCH: Util Class Cleaning
> --
>
> Key: CLI-242
> URL: https://issues.apache.org/jira/browse/CLI-242
> Project: Commons CLI
>  Issue Type: Improvement
>Affects Versions: 1.2
>Reporter: David Mollitor
>Priority: Minor
> Attachments: Util.java.patch
>
>
> Some cleaning up of the Util Class



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [CLI-312] Inconsistent behaviour in key/value pairs (Java property style) [commons-cli]

2024-02-16 Thread via GitHub


garydgregory merged PR #233:
URL: https://github.com/apache/commons-cli/pull/233


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-lang]

2024-02-16 Thread via GitHub


garydgregory merged PR #1174:
URL: https://github.com/apache/commons-lang/pull/1174


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-codec]

2024-02-16 Thread via GitHub


garydgregory merged PR #244:
URL: https://github.com/apache/commons-codec/pull/244


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump slf4j.version from 2.0.11 to 2.0.12 [commons-configuration]

2024-02-16 Thread via GitHub


garydgregory merged PR #358:
URL: https://github.com/apache/commons-configuration/pull/358


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-configuration]

2024-02-16 Thread via GitHub


garydgregory merged PR #363:
URL: https://github.com/apache/commons-configuration/pull/363


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Updated] (JEXL-418) Add try-catch support

2024-02-16 Thread Henri Biestro (Jira)


 [ 
https://issues.apache.org/jira/browse/JEXL-418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Henri Biestro updated JEXL-418:
---
Assignee: Henri Biestro

> Add try-catch support
> -
>
> Key: JEXL-418
> URL: https://issues.apache.org/jira/browse/JEXL-418
> Project: Commons JEXL
>  Issue Type: New Feature
>Reporter: Xu Pengcheng
>Assignee: Henri Biestro
>Priority: Minor
>
> Hi,
> Is it possible to add try-catch support?
> Thanks!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-logging]

2024-02-16 Thread via GitHub


garydgregory merged PR #214:
URL: https://github.com/apache/commons-logging/pull/214


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump com.github.siom79.japicmp:japicmp-maven-plugin from 0.18.3 to 0.18.4 [commons-parent]

2024-02-16 Thread via GitHub


garydgregory merged PR #365:
URL: https://github.com/apache/commons-parent/pull/365


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump org.apache.commons:commons-parent from 64 to 66 [commons-pool]

2024-02-16 Thread via GitHub


garydgregory closed pull request #278: Bump org.apache.commons:commons-parent 
from 64 to 66
URL: https://github.com/apache/commons-pool/pull/278


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-jcs]

2024-02-16 Thread via GitHub


garydgregory merged PR #214:
URL: https://github.com/apache/commons-jcs/pull/214


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-dbcp]

2024-02-16 Thread via GitHub


garydgregory merged PR #350:
URL: https://github.com/apache/commons-dbcp/pull/350


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-build-plugin]

2024-02-16 Thread via GitHub


garydgregory merged PR #224:
URL: https://github.com/apache/commons-build-plugin/pull/224


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-cli]

2024-02-16 Thread via GitHub


garydgregory merged PR #235:
URL: https://github.com/apache/commons-cli/pull/235


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-pool]

2024-02-16 Thread via GitHub


garydgregory merged PR #281:
URL: https://github.com/apache/commons-pool/pull/281


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CLI-323: Added Supplier defaults for getParsedOptionValue [commons-cli]

2024-02-16 Thread via GitHub


Claudenw commented on code in PR #229:
URL: https://github.com/apache/commons-cli/pull/229#discussion_r1492516030


##
src/test/java/org/apache/commons/cli/CommandLineTest.java:
##
@@ -166,7 +179,27 @@ public void testGetParsedOptionValueWithOption() throws 
Exception {
 }
 
 @Test
-public void testNullhOption() throws Exception {
+public void testGetParsedOptionValueUsingDefault() throws Exception {
+final Options options = new Options();
+final Option optI = 
Option.builder("i").hasArg().type(Number.class).build();
+final Option optF = Option.builder("f").hasArg().build();
+options.addOption(optI);
+options.addOption(optF);
+
+final CommandLineParser parser = new DefaultParser();
+final CommandLine cmd = parser.parse(options, new String[] {"-i", 
"123"});
+
+assertEquals(123, ((Number) 
cmd.getParsedOptionValue(optI)).intValue());
+assertEquals("foo", cmd.getParsedOptionValue(optF, "foo"));
+assertEquals("foo", cmd.getParsedOptionValue(optF, () -> "foo"));
+assertEquals("foo", cmd.getParsedOptionValue("f", "foo"));
+assertEquals("foo", cmd.getParsedOptionValue("f", () -> "foo"));
+assertEquals("foo", cmd.getParsedOptionValue('f', "foo"));
+assertEquals("foo", cmd.getParsedOptionValue('f', () -> "foo"));

Review Comment:
   Added tests.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-jexl]

2024-02-16 Thread via GitHub


garydgregory merged PR #227:
URL: https://github.com/apache/commons-jexl/pull/227


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-collections]

2024-02-16 Thread via GitHub


garydgregory merged PR #454:
URL: https://github.com/apache/commons-collections/pull/454


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump jackrabbit2.version from 2.20.14 to 2.21.23 [commons-vfs]

2024-02-16 Thread via GitHub


garydgregory commented on PR #481:
URL: https://github.com/apache/commons-vfs/pull/481#issuecomment-1948399453

   Closing: This is an unstable version as documented.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-crypto]

2024-02-16 Thread via GitHub


garydgregory merged PR #301:
URL: https://github.com/apache/commons-crypto/pull/301


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-skin]

2024-02-16 Thread via GitHub


garydgregory merged PR #109:
URL: https://github.com/apache/commons-skin/pull/109


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-bsf]

2024-02-16 Thread via GitHub


garydgregory merged PR #123:
URL: https://github.com/apache/commons-bsf/pull/123


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump jackrabbit2.version from 2.20.14 to 2.21.23 [commons-vfs]

2024-02-16 Thread via GitHub


garydgregory closed pull request #481: Bump jackrabbit2.version from 2.20.14 to 
2.21.23
URL: https://github.com/apache/commons-vfs/pull/481


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-vfs]

2024-02-16 Thread via GitHub


garydgregory merged PR #485:
URL: https://github.com/apache/commons-vfs/pull/485


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-csv]

2024-02-16 Thread via GitHub


garydgregory merged PR #394:
URL: https://github.com/apache/commons-csv/pull/394


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-parent]

2024-02-16 Thread via GitHub


garydgregory merged PR #367:
URL: https://github.com/apache/commons-parent/pull/367


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump com.github.spotbugs:spotbugs-maven-plugin from 4.8.3.0 to 4.8.3.1 [commons-parent]

2024-02-16 Thread via GitHub


garydgregory merged PR #366:
URL: https://github.com/apache/commons-parent/pull/366


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump org.slf4j:slf4j-simple from 2.0.11 to 2.0.12 [commons-vfs]

2024-02-16 Thread via GitHub


garydgregory merged PR #484:
URL: https://github.com/apache/commons-vfs/pull/484


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-release-plugin]

2024-02-16 Thread via GitHub


garydgregory merged PR #240:
URL: https://github.com/apache/commons-release-plugin/pull/240


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-dbutils]

2024-02-16 Thread via GitHub


garydgregory merged PR #240:
URL: https://github.com/apache/commons-dbutils/pull/240


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CLI-312 fix [commons-cli]

2024-02-16 Thread via GitHub


garydgregory commented on code in PR #233:
URL: https://github.com/apache/commons-cli/pull/233#discussion_r1492449672


##
src/test/java/org/apache/commons/cli/bug/BugCLI312Test.java:
##
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.cli.bug;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+import java.util.Properties;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.DefaultParser;
+import org.apache.commons.cli.MissingArgumentException;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.junit.Test;
+
+/**
+ * Demonstrates inconsistencies in parsing Java property-style options.
+ */
+public class BugCLI312Test {
+@Test
+public void testPropertyStyleOption_withGetOptionProperties() throws 
ParseException {
+final Option o1 = 
Option.builder().option("D").longOpt("define").numberOfArgs(2).valueSeparator('=').build();
+
+final Options options = new Options();
+options.addOption(o1);
+
+final CommandLineParser parser = new DefaultParser();
+
+final CommandLine cl = parser.parse(options, "-Dv -Dw=1 -D x=2 -D y -D 
z=3 other".split(" "));
+assertArrayEquals(new String[] {"v", "w", "1", "x", "2", "y", "z", 
"3"}, cl.getOptionValues('D'));
+
+Properties properties = cl.getOptionProperties("D");
+assertEquals("true", properties.getProperty("v"));
+assertEquals("1", properties.getProperty("w"));
+assertEquals("2", properties.getProperty("x"));
+assertEquals("true", properties.getProperty("y"));
+assertEquals("3", properties.getProperty("z"));
+assertEquals(5, properties.size());
+assertEquals("other", cl.getArgList().get(0));
+}
+
+@Test
+public void testPropertyStyleOption_withGetOptions() throws ParseException 
{
+final Option o1 = 
Option.builder().option("D").longOpt("define").numberOfArgs(2).valueSeparator('=').build();
+
+final Options options = new Options();
+options.addOption(o1);
+
+final CommandLineParser parser = new DefaultParser();
+
+final CommandLine cl = parser.parse(options, "-Dv -Dw=1 -D x=2 -D y -D 
z=3 other".split(" "));
+assertArrayEquals(new String[] {"v", "w", "1", "x", "2", "y", "z", 
"3"}, cl.getOptionValues('D'));
+
+int defineOptionsFound = 0;
+for (final Option o : cl.getOptions()) {
+if ("D".equals(o.getOpt())) {
+defineOptionsFound++;
+
+if (defineOptionsFound == 1) {
+assertArrayEquals(new String[] {"v"}, o.getValues());
+} else if (defineOptionsFound == 2) {
+assertArrayEquals(new String[] {"w", "1"}, o.getValues());
+} else if (defineOptionsFound == 3) {
+assertArrayEquals(new String[] {"x", "2"}, o.getValues());
+} else if (defineOptionsFound == 4) {
+assertArrayEquals(new String[] {"y"}, o.getValues());
+} else if (defineOptionsFound == 5) {
+assertArrayEquals(new String[] {"z", "3"}, o.getValues());
+} else {
+fail("Didn't expect " + defineOptionsFound + " occurrences 
of -D");
+}
+}
+}
+assertEquals("other", cl.getArgList().get(0));
+}
+
+@Test
+public void testNoOptionValues() throws ParseException {

Review Comment:
   `ParseException` is not thrown by this method, please remove it from the 
method signature.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CLI-312 fix [commons-cli]

2024-02-16 Thread via GitHub


Claudenw commented on code in PR #233:
URL: https://github.com/apache/commons-cli/pull/233#discussion_r1492487725


##
src/test/java/org/apache/commons/cli/bug/BugCLI312Test.java:
##
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.cli.bug;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+import java.util.Properties;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.DefaultParser;
+import org.apache.commons.cli.MissingArgumentException;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.junit.Test;
+
+/**
+ * Demonstrates inconsistencies in parsing Java property-style options.
+ */
+public class BugCLI312Test {
+@Test
+public void testPropertyStyleOption_withGetOptionProperties() throws 
ParseException {
+final Option o1 = 
Option.builder().option("D").longOpt("define").numberOfArgs(2).valueSeparator('=').build();
+
+final Options options = new Options();
+options.addOption(o1);
+
+final CommandLineParser parser = new DefaultParser();
+
+final CommandLine cl = parser.parse(options, "-Dv -Dw=1 -D x=2 -D y -D 
z=3 other".split(" "));
+assertArrayEquals(new String[] {"v", "w", "1", "x", "2", "y", "z", 
"3"}, cl.getOptionValues('D'));
+
+Properties properties = cl.getOptionProperties("D");
+assertEquals("true", properties.getProperty("v"));
+assertEquals("1", properties.getProperty("w"));
+assertEquals("2", properties.getProperty("x"));
+assertEquals("true", properties.getProperty("y"));
+assertEquals("3", properties.getProperty("z"));
+assertEquals(5, properties.size());
+assertEquals("other", cl.getArgList().get(0));
+}
+
+@Test
+public void testPropertyStyleOption_withGetOptions() throws ParseException 
{
+final Option o1 = 
Option.builder().option("D").longOpt("define").numberOfArgs(2).valueSeparator('=').build();
+
+final Options options = new Options();
+options.addOption(o1);
+
+final CommandLineParser parser = new DefaultParser();
+
+final CommandLine cl = parser.parse(options, "-Dv -Dw=1 -D x=2 -D y -D 
z=3 other".split(" "));
+assertArrayEquals(new String[] {"v", "w", "1", "x", "2", "y", "z", 
"3"}, cl.getOptionValues('D'));
+
+int defineOptionsFound = 0;
+for (final Option o : cl.getOptions()) {
+if ("D".equals(o.getOpt())) {
+defineOptionsFound++;
+
+if (defineOptionsFound == 1) {
+assertArrayEquals(new String[] {"v"}, o.getValues());
+} else if (defineOptionsFound == 2) {
+assertArrayEquals(new String[] {"w", "1"}, o.getValues());
+} else if (defineOptionsFound == 3) {
+assertArrayEquals(new String[] {"x", "2"}, o.getValues());
+} else if (defineOptionsFound == 4) {
+assertArrayEquals(new String[] {"y"}, o.getValues());
+} else if (defineOptionsFound == 5) {
+assertArrayEquals(new String[] {"z", "3"}, o.getValues());
+} else {
+fail("Didn't expect " + defineOptionsFound + " occurrences 
of -D");
+}
+}
+}
+assertEquals("other", cl.getArgList().get(0));
+}
+
+@Test
+public void testNoOptionValues() throws ParseException {

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CLI-324 Make adding OptionGroups and Options to existing Options easier [commons-cli]

2024-02-16 Thread via GitHub


Claudenw commented on code in PR #230:
URL: https://github.com/apache/commons-cli/pull/230#discussion_r1492652231


##
src/test/java/org/apache/commons/cli/OptionsTest.java:
##
@@ -78,6 +79,26 @@ public void testGetOptionsGroups() {
 assertEquals(2, options.getOptionGroups().size());
 }
 
+@Test
+public void testAddOptions() {
+final Options options = new Options();
+
+final OptionGroup group1 = new OptionGroup();
+group1.addOption(Option.builder("a").build());
+group1.addOption(Option.builder("b").build());
+
+options.addOptionGroup(group1);
+
+options.addOption(Option.builder("X").build());
+options.addOption(Option.builder("y").build());
+
+final Options underTest = new Options();
+underTest.addOptions(options);

Review Comment:
   Updated.  I think I got them nailed down.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Commented] (JEXL-418) Add try-catch support

2024-02-16 Thread Henri Biestro (Jira)


[ 
https://issues.apache.org/jira/browse/JEXL-418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17818106#comment-17818106
 ] 

Henri Biestro commented on JEXL-418:


Development started in 
[JEXL-418|https://github.com/apache/commons-jexl/tree/JEXL-418]

Syntax is in (try/try-with-resource/catch/finally); only one catch clause. More 
tests to follow.

> Add try-catch support
> -
>
> Key: JEXL-418
> URL: https://issues.apache.org/jira/browse/JEXL-418
> Project: Commons JEXL
>  Issue Type: New Feature
>Reporter: Xu Pengcheng
>Assignee: Henri Biestro
>Priority: Minor
>
> Hi,
> Is it possible to add try-catch support?
> Thanks!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[PR] Merge master [commons-jexl]

2024-02-16 Thread via GitHub


henrib opened a new pull request, #229:
URL: https://github.com/apache/commons-jexl/pull/229

   (no comment)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Merge master [commons-jexl]

2024-02-16 Thread via GitHub


github-advanced-security[bot] commented on PR #229:
URL: https://github.com/apache/commons-jexl/pull/229#issuecomment-1949420019

   This pull request sets up GitHub code scanning for this repository. Once the 
scans have completed and the checks have passed, the analysis results for this 
pull request branch will appear on [this 
overview](/apache/commons-jexl/security/code-scanning?query=pr%3A229+is%3Aopen).
 Once you merge this pull request, the 'Security' tab will show more code 
scanning analysis results (for example, for the default branch). Depending on 
your configuration and choice of analysis tool, future pull requests will be 
annotated with code scanning analysis results. For more information about 
GitHub code scanning, check out [the 
documentation](https://docs.github.com/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning).
 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Merge master [commons-jexl]

2024-02-16 Thread via GitHub


henrib merged PR #229:
URL: https://github.com/apache/commons-jexl/pull/229


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-validator]

2024-02-16 Thread via GitHub


garydgregory merged PR #185:
URL: https://github.com/apache/commons-validator/pull/185


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump github/codeql-action from 3.24.0 to 3.24.3 [commons-beanutils]

2024-02-16 Thread via GitHub


garydgregory merged PR #213:
URL: https://github.com/apache/commons-beanutils/pull/213


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CLI-312 fix [commons-cli]

2024-02-16 Thread via GitHub


Claudenw commented on code in PR #233:
URL: https://github.com/apache/commons-cli/pull/233#discussion_r1492094707


##
src/main/java/org/apache/commons/cli/DefaultParser.java:
##
@@ -228,6 +228,9 @@ private DefaultParser(final boolean allowPartialMatching,
  */
 private void checkRequiredArgs() throws ParseException {
 if (currentOption != null && currentOption.requiresArg()) {
+if (isJavaProperty(currentOption.getKey()) && 
currentOption.numberOfValues() == 1) {

Review Comment:
   I missed `getValuesList()` when I was implementing.  I saw that 
`getValues()` would return `null` and that threw me off.  Good catch.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org