[jira] [Commented] (JEXL-342) Support for Java Optional.
[ https://issues.apache.org/jira/browse/JEXL-342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17289743#comment-17289743 ] Dmitri Blinov commented on JEXL-342: I've made some fiddling with new features for JEXL the other day, but many of them were not accepted at that time even with Jira tasks and PRs on github, so generally this is not an easy task, it's kind of making an omelette without breaking eggs job. Nevertheless the desire to get something done, to fill the gaps between JEXL and well-accepted modern ideas in other languages (Java 8 itself to start with) brought me to idea to get a fork, so anyone interesting in evolving JEXL could look at ([link to repository|https://github.com/dmitri-blinov/commons-jexl]). I'd love to have all or any of those features to be part of the upstream one day, though as I have said before, I fully understand that not everyone would be happy to get the eggs broken. But the progress is inevitable, and for the long run choice is tough - either JEXL will evolve or stall as a project. The solution in my opinion is well known and would be to have a major version bump for some modern experimental stuff and stable version for current implementation. > Support for Java Optional. > -- > > Key: JEXL-342 > URL: https://issues.apache.org/jira/browse/JEXL-342 > Project: Commons JEXL > Issue Type: New Feature >Affects Versions: 3.1 >Reporter: Garret Wilson >Priority: Major > > Does JEXL provide any native support for Java 8+ {{Optional<>}}? If not can > this this easily be added as some sort of plugin, or better yet can it be > added to the library? > h3. {{Optional}} Traversal > I need to create an API that works well for application developers as for > those using templates with JEXL expressions. Let's say that the {{Bar}} class > has a {{Bar.getName()}}. And the {{Foo}} class has this method: > {code:java} > Optional getBar(String barId); > {code} > In code getting the "test" foo-bar name would be like this: > {code:java} > String fooBarName=foo.getBar("test").map(Bar::getName).orElse(null); > {code} > I want the navigation across {{Optional<>}} to work just as if it were a > nullable variable. That is, I want the following JEXL expression to give the > same result as {{fooBarName}} above: > {code} > foo.bar("test").name > {code} > If {{Foo.getBar(String)}} returned a nullable rather than an {{Optional<>}}, > I think JEXL would work for this already. but the whole point of > {{Optional<>}} is that I keep nullables out of my code, so I don't want to > create inferior APIs inconsistent with the rest of my project just to work > with JEXL. > h3. {{Optional}} Getter Name > As icing on the cake, I would like to have {{Optional<>}} returning getter > discovery to recognize the {{findXXX}} pattern, as [Stephen Colebourne > suggested|https://blog.joda.org/2015/09/naming-optional-query-methods.html]. > I've been using this pattern for several years, and I really like it. Thus to > indicate that the {{Foo.getBar(String)}} "getter" doesn't return a nullable > but an {{Optional<>}}, I would name it {{Foo.findBar(String)}}, like this: > {code:java} > Optional findBar(String barId); > {code} > I would thus want the exact same JEXL expression above to still work: > {code} > foo.bar("test").name > {code} > Otherwise I'll have to forego use of modern Java constructs and make an > outdated style and less safe API just to get JEXL to work. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-lang] coveralls edited a comment on pull request #717: Feature/not null or empty aux
coveralls edited a comment on pull request #717: URL: https://github.com/apache/commons-lang/pull/717#issuecomment-784398687 [![Coverage Status](https://coveralls.io/builds/37400580/badge)](https://coveralls.io/builds/37400580) Coverage decreased (-0.004%) to 94.915% when pulling **793aaca0d5f541086719f8bd2b5269a50a4163e5 on arturobernalg:feature/not_null_or_empty_aux** into **b57f292cdf14fef72e68d60c580cb80d794be7e0 on apache:master**. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] coveralls edited a comment on pull request #717: Feature/not null or empty aux
coveralls edited a comment on pull request #717: URL: https://github.com/apache/commons-lang/pull/717#issuecomment-784398687 [![Coverage Status](https://coveralls.io/builds/37400553/badge)](https://coveralls.io/builds/37400553) Coverage decreased (-0.004%) to 94.915% when pulling **793aaca0d5f541086719f8bd2b5269a50a4163e5 on arturobernalg:feature/not_null_or_empty_aux** into **b57f292cdf14fef72e68d60c580cb80d794be7e0 on apache:master**. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] coveralls edited a comment on pull request #717: Feature/not null or empty aux
coveralls edited a comment on pull request #717: URL: https://github.com/apache/commons-lang/pull/717#issuecomment-784398687 [![Coverage Status](https://coveralls.io/builds/37399729/badge)](https://coveralls.io/builds/37399729) Coverage decreased (-0.004%) to 94.915% when pulling **81107d4597583d4a93dd43fe6dded7aba35c1290 on arturobernalg:feature/not_null_or_empty_aux** into **b57f292cdf14fef72e68d60c580cb80d794be7e0 on apache:master**. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] coveralls edited a comment on pull request #717: Feature/not null or empty aux
coveralls edited a comment on pull request #717: URL: https://github.com/apache/commons-lang/pull/717#issuecomment-784398687 [![Coverage Status](https://coveralls.io/builds/37399699/badge)](https://coveralls.io/builds/37399699) Coverage decreased (-0.004%) to 94.915% when pulling **81107d4597583d4a93dd43fe6dded7aba35c1290 on arturobernalg:feature/not_null_or_empty_aux** into **b57f292cdf14fef72e68d60c580cb80d794be7e0 on apache:master**. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-functor] kinow merged pull request #17: Bump wagon-ssh from 3.4.2 to 3.4.3
kinow merged pull request #17: URL: https://github.com/apache/commons-functor/pull/17 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-functor] dependabot[bot] opened a new pull request #17: Bump wagon-ssh from 3.4.2 to 3.4.3
dependabot[bot] opened a new pull request #17: URL: https://github.com/apache/commons-functor/pull/17 Bumps wagon-ssh from 3.4.2 to 3.4.3. [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=org.apache.maven.wagon:wagon-ssh=maven=3.4.2=3.4.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-parent] dependabot[bot] opened a new pull request #32: Bump wagon-ssh from 3.4.2 to 3.4.3
dependabot[bot] opened a new pull request #32: URL: https://github.com/apache/commons-parent/pull/32 Bumps wagon-ssh from 3.4.2 to 3.4.3. [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=org.apache.maven.wagon:wagon-ssh=maven=3.4.2=3.4.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-io] XenoAmess commented on pull request #208: fix ci error on jdk17
XenoAmess commented on pull request #208: URL: https://github.com/apache/commons-io/pull/208#issuecomment-784737023 > Is the mix of changing mockito AND adding a Maven profile intentional? yes. that is needed as mockito use older version of buddy which cannot deal with jdk17 binary 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-io] XenoAmess closed pull request #208: fix ci error on jdk17
XenoAmess closed pull request #208: URL: https://github.com/apache/commons-io/pull/208 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (IMAGING-280) Length specifier for ByteSourceArray.
[ https://issues.apache.org/jira/browse/IMAGING-280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17289604#comment-17289604 ] Garret Wilson commented on IMAGING-280: --- {quote}Taking a very quick look through the commons imaging source code, I didn't find anyplace obvious where the alternate constructor could be applied.{quote} Your library doesn't necessarily have cases where it needs that constructor to provide a {{ByteSource}}, because it's the developer who will normally be supplying the bytes. {quote}Are you thinking of using this in applications outside the Commons Imaging package itself?{quote} Exactly. Your library _requests_ a {{ByteSource}}; that is, you request the _caller_ to provide one when they process images (e.g. {{ExifRewriter.updateExifMetadataLossy(byteSource, outputStream, tiffOutputSet)}}). You want to make it flexible for the developer to supply the bytes in whatever form they have them. You don't want to force the developer to copy huge arrays just to because your {{ByteSourceArray}} doesn't provide a way to specify a portion of an existing buffer. See the internal {{BufByteSource}} class inside [{{BaseImageMummifier}}|https://bitbucket.org/globalmentor/guise/src/master/mummy/src/main/java/io/guise/mummy/mummify/image/BaseImageMummifier.java] as an example. Note the class API comment referring to this ticket. > Length specifier for ByteSourceArray. > - > > Key: IMAGING-280 > URL: https://issues.apache.org/jira/browse/IMAGING-280 > Project: Commons Imaging > Issue Type: Improvement >Reporter: Garret Wilson >Priority: Major > > Many of the library processing methods take a {{ByteSource}}. The > {{ByteSourceArray}} allows a byte source from an array of bytes, but > unfortunately it does not allow specification of the number of bytes, > assuming that the entire byte array is used; e.g.: > {code:java} > public ByteSourceArray(final byte[] bytes) { > this(null, bytes); > } > {code} > This severely impedes the use of the class if the code using > {{ByteSourceArray}} has a byte array partially filled. The obvious case is > processing data in a pipeline, when the producer has written to a > {{ByteArrayOutputStream}}. Although {{ByteArrayOutputStream.toByteArray()}} > provides a copy of the internal data, it is possible to subclass > {{ByteArrayOutputStream}} to get access to the underlying bytes to prevent > copying. Because {{ByteArrayOutputStream}} grows dynamically, the internal > byte array may not be full. > Thus {{ByteSourceArray}} needs a separate constructor to indicate the length > (and even the offset), just like {{ByteArrayInputStream}} does: > {code:java} > public ByteArrayInputStream(byte buf[], int offset, int length) {…} > {code} > Moreover this is extremely trivial to add. Without it, however, the developer > is forced to basically reimplement the entire class. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-lang] coveralls edited a comment on pull request #717: Feature/not null or empty aux
coveralls edited a comment on pull request #717: URL: https://github.com/apache/commons-lang/pull/717#issuecomment-784398687 [![Coverage Status](https://coveralls.io/builds/37391215/badge)](https://coveralls.io/builds/37391215) Coverage decreased (-0.004%) to 94.957% when pulling **3bcf2b72f106d7bdf9ebf923bf698469c1e36279 on arturobernalg:feature/not_null_or_empty_aux** into **b03b21b4491567f0dbb1043d3e4156a51ffd5da0 on apache:master**. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] arturobernalg commented on pull request #717: Feature/not null or empty aux
arturobernalg commented on pull request #717: URL: https://github.com/apache/commons-lang/pull/717#issuecomment-784571316 HI @garydgregory Fix javadoc. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] garydgregory commented on a change in pull request #717: Feature/not null or empty aux
garydgregory commented on a change in pull request #717: URL: https://github.com/apache/commons-lang/pull/717#discussion_r581430243 ## File path: src/main/java/org/apache/commons/lang3/ObjectUtils.java ## @@ -1237,6 +1243,37 @@ public static String toString(final Object obj, final String nullStr) { return obj == null ? nullStr : obj.toString(); } +/** + * Validate that the specified argument object is neither {@code null} + * nor a length of zero (no elements); otherwise throwing an exception. + * + * The message of the exception is The object is null or empty. + * + * @param object the object to check + * + * @throws IllegalArgumentException if {@code array} is {@code null} + * @throws IllegalArgumentException if {@code array} is empty. + */ Review comment: Javadoc Add at since 3.12.0 for new public and protected APIs. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] garydgregory commented on a change in pull request #717: Feature/not null or empty aux
garydgregory commented on a change in pull request #717: URL: https://github.com/apache/commons-lang/pull/717#discussion_r581429641 ## File path: src/main/java/org/apache/commons/lang3/ObjectUtils.java ## @@ -1237,6 +1243,37 @@ public static String toString(final Object obj, final String nullStr) { return obj == null ? nullStr : obj.toString(); } +/** + * Validate that the specified argument object is neither {@code null} Review comment: Please close HTML tags. The FIRST sentence in a Javadoc does not need to be in a paragraph, it is implied. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (IO-663) FileUtils.copyDirectory(File srcDir, File destDir) fails on Windows
[ https://issues.apache.org/jira/browse/IO-663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17289392#comment-17289392 ] Gary D. Gregory commented on IO-663: It seems hard to believe that an IO request be completely ignored. I am happy to test and debug on Windows, if someone provides a test. Note that we have unit tests already, but there is something different about this particular environment. > FileUtils.copyDirectory(File srcDir, File destDir) fails on Windows > --- > > Key: IO-663 > URL: https://issues.apache.org/jira/browse/IO-663 > Project: Commons IO > Issue Type: Bug >Reporter: Elliotte Rusty Harold >Priority: Critical > > This bug is shared (likely because of code copied from one place to another) > between the similar methods in commons IO, codehaus-plexus-utils, and > maven-shared-utils. > I don't have an isolated test case because this bug is platform specific and > I've only seen it in Jenkins CI builds on Windows using JDK 7 through 15. I > don't have a Windows system handy to test it. However it is reproducible. > Typical code that triggers it is in RestoreBackupPomsPhaseTest in > maven-release: > {{// copy poms so tests are valid without clean}} > {{ File sourceDir = getTestFile( "src/test/resources" + projectPath );}} > {{ File testDir = getTestFile( "target/test-classes" + projectPath );}} > {{ FileUtils.copyDirectoryStructure( sourceDir, testDir );}} > I don't know whether there might be something weird in the setup of those two > directories that's involved. > Typical error message is: > Caused by: java.nio.file.FileSystemException: > > F:\jenkins\jenkins-slave\workspace\maven-box_maven-release_windows@2@2\windows-jdk8-m3.6.x_build\maven-release-manager\target\test-classes\projects\restore-backup-poms\basic-pom\pom.xml: > The process cannot access the file because it is being used by another > process > "The process cannot access the file because it is being used by another > process" I think points to the root of the bug. This is a Windows file system > error message. > Some history is here where I noticed it: > [https://github.com/apache/maven-release/pull/42] > In this case, I started with plexus-utils 3.1.0 which worked, upgraded to > plexus-utils 3.3.0, which didn't. And then tried the FileUtils.copyDirectory > from both maven-shared-utils and commons-io, all of which failed in the same > way. > I think this is caused by the use of NIO, which doesn't work quite the same > when copying files on Windows as on Linux and Mac OS X. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-io] garydgregory commented on pull request #208: fix ci error on jdk17
garydgregory commented on pull request #208: URL: https://github.com/apache/commons-io/pull/208#issuecomment-784550389 Hi @XenoAmess -1 for several reasons: Nits: The title of this PR ("fix ci error on jdk17") is misleading as (1) the PR does not fix anything, it just ignores a part of the build and (2) this is also for an Early Access Java build (jdk17-ea) and not a released Java version of 17 which is not there yet. Main: The 17-ea build is marked in our GitHub action as "experimental" and is allowed to fail by definition. The whole point (in my mind at least) for testing on EA builds is exactly what we are seeing now: a failure. In this case, it is quite nice to see that JaCoCo is not ready for Java 17 yet; this lets anyone who cares about the FOSS ecosystem go and help JaCoCo get up to speed on Java 17. If by these efforts we can get a new release of JaCoCo out sooner for us EA adventurers, then we are all better off. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-io] garydgregory commented on pull request #208: fix ci error on jdk17
garydgregory commented on pull request #208: URL: https://github.com/apache/commons-io/pull/208#issuecomment-784542399 Is the mix of changing mockito AND adding a Maven profile intentional? 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-io] garydgregory merged pull request #207: Bump mockito-inline from 3.7.7 to 3.8.0
garydgregory merged pull request #207: URL: https://github.com/apache/commons-io/pull/207 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] coveralls commented on pull request #717: Feature/not null or empty aux
coveralls commented on pull request #717: URL: https://github.com/apache/commons-lang/pull/717#issuecomment-784398687 [![Coverage Status](https://coveralls.io/builds/37381355/badge)](https://coveralls.io/builds/37381355) Coverage decreased (-0.004%) to 94.957% when pulling **00c952898e37129a8a3f646149eab93ad5e15330 on arturobernalg:feature/not_null_or_empty_aux** into **b03b21b4491567f0dbb1043d3e4156a51ffd5da0 on apache:master**. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-io] coveralls commented on pull request #208: fix ci error on jdk17
coveralls commented on pull request #208: URL: https://github.com/apache/commons-io/pull/208#issuecomment-784387349 [![Coverage Status](https://coveralls.io/builds/37380904/badge)](https://coveralls.io/builds/37380904) Coverage remained the same at 89.257% when pulling **54e10c431b129adc89a42e315b4d675b90624aa3 on xenoamess-fork:fix_ci_error_on_jdk17** into **6db5a0750a4e7f82ce32e61d9f9c94c75080f3c0 on apache:master**. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] arturobernalg commented on pull request #716: Reuse the boolean array validations.
arturobernalg commented on pull request #716: URL: https://github.com/apache/commons-lang/pull/716#issuecomment-784384205 > Hi @arturobernalg > Thank you for your PR. Please see my comments. > Ses if you can reuse: > > * `ObjectUtils.isEmpty(Object)` > * `ObjectUtils.isNotEmpty(Object)` > We could add: > * `ObjectUtils.requireNotEmpty(Object)` > * `ObjectUtils.requireNotEmpty(Object, String)` Hi @garydgregory I'll check how > Hi @arturobernalg > Thank you for your PR. Please see my comments. > Ses if you can reuse: > > * `ObjectUtils.isEmpty(Object)` > * `ObjectUtils.isNotEmpty(Object)` > We could add: > * `ObjectUtils.requireNotEmpty(Object)` > * `ObjectUtils.requireNotEmpty(Object, String)` Hi @garydgregory Thank you for your tips. Is this what you are looking for? I've created a new PR to maintain clean the other one in case I screwed up ;) https://github.com/apache/commons-lang/pull/717 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] arturobernalg opened a new pull request #717: Feature/not null or empty aux
arturobernalg opened a new pull request #717: URL: https://github.com/apache/commons-lang/pull/717 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-io] XenoAmess commented on pull request #208: fix ci error on jdk17
XenoAmess commented on pull request #208: URL: https://github.com/apache/commons-io/pull/208#issuecomment-784380141 @garydgregory please review. thanks. this one should be very easy to review. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-io] XenoAmess opened a new pull request #208: fix ci error on jdk17
XenoAmess opened a new pull request #208: URL: https://github.com/apache/commons-io/pull/208 As title. Not a great thing, so do not think need a JIRA ticket., 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (IO-663) FileUtils.copyDirectory(File srcDir, File destDir) fails on Windows
[ https://issues.apache.org/jira/browse/IO-663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17289171#comment-17289171 ] Elliotte Rusty Harold commented on IO-663: -- I'd guess that it doesn't throw any exception or report failure. It simply doesn't copy any files. I think this big should be easy to reproduce, but it will require a Windows box, not a Mac or Linux. > FileUtils.copyDirectory(File srcDir, File destDir) fails on Windows > --- > > Key: IO-663 > URL: https://issues.apache.org/jira/browse/IO-663 > Project: Commons IO > Issue Type: Bug >Reporter: Elliotte Rusty Harold >Priority: Critical > > This bug is shared (likely because of code copied from one place to another) > between the similar methods in commons IO, codehaus-plexus-utils, and > maven-shared-utils. > I don't have an isolated test case because this bug is platform specific and > I've only seen it in Jenkins CI builds on Windows using JDK 7 through 15. I > don't have a Windows system handy to test it. However it is reproducible. > Typical code that triggers it is in RestoreBackupPomsPhaseTest in > maven-release: > {{// copy poms so tests are valid without clean}} > {{ File sourceDir = getTestFile( "src/test/resources" + projectPath );}} > {{ File testDir = getTestFile( "target/test-classes" + projectPath );}} > {{ FileUtils.copyDirectoryStructure( sourceDir, testDir );}} > I don't know whether there might be something weird in the setup of those two > directories that's involved. > Typical error message is: > Caused by: java.nio.file.FileSystemException: > > F:\jenkins\jenkins-slave\workspace\maven-box_maven-release_windows@2@2\windows-jdk8-m3.6.x_build\maven-release-manager\target\test-classes\projects\restore-backup-poms\basic-pom\pom.xml: > The process cannot access the file because it is being used by another > process > "The process cannot access the file because it is being used by another > process" I think points to the root of the bug. This is a Windows file system > error message. > Some history is here where I noticed it: > [https://github.com/apache/maven-release/pull/42] > In this case, I started with plexus-utils 3.1.0 which worked, upgraded to > plexus-utils 3.3.0, which didn't. And then tried the FileUtils.copyDirectory > from both maven-shared-utils and commons-io, all of which failed in the same > way. > I think this is caused by the use of NIO, which doesn't work quite the same > when copying files on Windows as on Linux and Mac OS X. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (IMAGING-280) Length specifier for ByteSourceArray.
[ https://issues.apache.org/jira/browse/IMAGING-280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17289156#comment-17289156 ] Gary Lucas commented on IMAGING-280: This is an interesting idea. Taking a very quick look through the commons imaging source code, I didn't find anyplace obvious where the alternate constructor could be applied. Do you have a specific area in mind? Are you thinking of using this in applications outside the Commons Imaging package itself? I agree that this would be fairly easy to implement... I think it would probably take more effort to write the JUnit tests than the code itself. > Length specifier for ByteSourceArray. > - > > Key: IMAGING-280 > URL: https://issues.apache.org/jira/browse/IMAGING-280 > Project: Commons Imaging > Issue Type: Improvement >Reporter: Garret Wilson >Priority: Major > > Many of the library processing methods take a {{ByteSource}}. The > {{ByteSourceArray}} allows a byte source from an array of bytes, but > unfortunately it does not allow specification of the number of bytes, > assuming that the entire byte array is used; e.g.: > {code:java} > public ByteSourceArray(final byte[] bytes) { > this(null, bytes); > } > {code} > This severely impedes the use of the class if the code using > {{ByteSourceArray}} has a byte array partially filled. The obvious case is > processing data in a pipeline, when the producer has written to a > {{ByteArrayOutputStream}}. Although {{ByteArrayOutputStream.toByteArray()}} > provides a copy of the internal data, it is possible to subclass > {{ByteArrayOutputStream}} to get access to the underlying bytes to prevent > copying. Because {{ByteArrayOutputStream}} grows dynamically, the internal > byte array may not be full. > Thus {{ByteSourceArray}} needs a separate constructor to indicate the length > (and even the offset), just like {{ByteArrayInputStream}} does: > {code:java} > public ByteArrayInputStream(byte buf[], int offset, int length) {…} > {code} > Moreover this is extremely trivial to add. Without it, however, the developer > is forced to basically reimplement the entire class. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-lang] garydgregory commented on pull request #713: Let mid(null), left(null) and right(null) return empty
garydgregory commented on pull request #713: URL: https://github.com/apache/commons-lang/pull/713#issuecomment-784256584 Not sure about the impact here of changing the behavior... needs a bit more study... 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] garydgregory merged pull request #715: Bump biz.aQute.bndlib from 5.2.0 to 5.3.0
garydgregory merged pull request #715: URL: https://github.com/apache/commons-lang/pull/715 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] garydgregory commented on a change in pull request #716: Reuse the boolean array validations.
garydgregory commented on a change in pull request #716: URL: https://github.com/apache/commons-lang/pull/716#discussion_r581096583 ## File path: src/main/java/org/apache/commons/lang3/BooleanUtils.java ## @@ -263,6 +267,23 @@ public static Boolean negate(final Boolean bool) { return bool.booleanValue() ? Boolean.FALSE : Boolean.TRUE; } +/** + * Validate that the specified argument array is neither {@code null} + * nor a length of zero (no elements); otherwise throwing an exception. + * + * @param array an array of {@code boolean}s + * @throws IllegalArgumentException if {@code array} is {@code null} + * @throws IllegalArgumentException if {@code array} is empty. + */ +private static void notNullOrEmpty(final boolean... array){ +if (array == null) { Review comment: Hi @arturobernalg I think we should converge all null checks to `Objects.requireNonNull(arg, "arg")`, which also avoids making our exception messages too English-centric. In the same vein, I'd call this new method `requireNotEmpty`. ## File path: src/main/java/org/apache/commons/lang3/BooleanUtils.java ## @@ -29,7 +29,18 @@ * @since 2.0 */ public class BooleanUtils { - +/** + * The default message for null array. + * + * @since 3.12.0 Review comment: No need for since tag for private elements. ## File path: src/main/java/org/apache/commons/lang3/BooleanUtils.java ## @@ -29,7 +29,18 @@ * @since 2.0 */ public class BooleanUtils { - +/** + * The default message for null array. + * + * @since 3.12.0 + */ +private static final String DEFAULT_NULL_ARRAY_EX_MESSAGE = "The Array must not be null"; +/** + * The default message for empty array. + * + * @since 3.12.0 + */ +private static final String DEFAULT_EMPTY_ARRAY_EX_MESSAGE = "Array is empty"; Review comment: Simplify to "Empty array". ## File path: src/main/java/org/apache/commons/lang3/BooleanUtils.java ## @@ -29,7 +29,18 @@ * @since 2.0 */ public class BooleanUtils { - +/** + * The default message for null array. + * + * @since 3.12.0 + */ +private static final String DEFAULT_NULL_ARRAY_EX_MESSAGE = "The Array must not be null"; +/** + * The default message for empty array. + * + * @since 3.12.0 Review comment: No need for since tag for private elements. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] coveralls edited a comment on pull request #716: Reuse the boolean array validations.
coveralls edited a comment on pull request #716: URL: https://github.com/apache/commons-lang/pull/716#issuecomment-784230341 [![Coverage Status](https://coveralls.io/builds/37372989/badge)](https://coveralls.io/builds/37372989) Coverage decreased (-0.002%) to 94.959% when pulling **6c0ddd5270b94014dabac5683ae99cdaadf9d424 on arturobernalg:feature/not_null_or_empty** into **fa0a793d3dc02f6f8a29a409de6a5a1b8c96ec50 on apache:master**. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] coveralls commented on pull request #716: Reuse the boolean array validations.
coveralls commented on pull request #716: URL: https://github.com/apache/commons-lang/pull/716#issuecomment-784230341 [![Coverage Status](https://coveralls.io/builds/37372966/badge)](https://coveralls.io/builds/37372966) Coverage decreased (-0.008%) to 94.953% when pulling **6c0ddd5270b94014dabac5683ae99cdaadf9d424 on arturobernalg:feature/not_null_or_empty** into **fa0a793d3dc02f6f8a29a409de6a5a1b8c96ec50 on apache:master**. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] arturobernalg opened a new pull request #716: Reuse the boolean array validations.
arturobernalg opened a new pull request #716: URL: https://github.com/apache/commons-lang/pull/716 The idea it's reuse a single method validate that the specified argument array is neither null nor a length of zero (no elements). otherwise throwing an exception 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-daemon] jfclere merged pull request #23: Fix for https://issues.apache.org/jira/browse/DAEMON-314
jfclere merged pull request #23: URL: https://github.com/apache/commons-daemon/pull/23 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org