[GitHub] [commons-lang] coveralls commented on issue #525: Correct Javadocs of methods that use Validate.notNull() and replace some uses of Validate.isTrue() with Validate.notNull().
coveralls commented on issue #525: URL: https://github.com/apache/commons-lang/pull/525#issuecomment-616961576 [![Coverage Status](https://coveralls.io/builds/30214870/badge)](https://coveralls.io/builds/30214870) Coverage remained the same at 95.091% when pulling **e675529b6bac87df86fc9ef95f3af6ebf00e079d on Isira-Seneviratne:Change_Javadoc_IllegalArgumentException_to_NullPointerException** into **f6923510352fc3fbfad68bc6c5ac5258a34671b7 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
[jira] [Work logged] (LANG-1540) Add startsAndEndsWith() functions to StringUtils.
[ https://issues.apache.org/jira/browse/LANG-1540?focusedWorklogId=425552=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-425552 ] ASF GitHub Bot logged work on LANG-1540: Author: ASF GitHub Bot Created on: 21/Apr/20 05:17 Start Date: 21/Apr/20 05:17 Worklog Time Spent: 10m Work Description: coveralls commented on issue #524: URL: https://github.com/apache/commons-lang/pull/524#issuecomment-616957260 [![Coverage Status](https://coveralls.io/builds/30214661/badge)](https://coveralls.io/builds/30214661) Coverage decreased (-0.007%) to 95.085% when pulling **48030c9bc28c53ee161dca2c00c25b64ab3c411a on Isira-Seneviratne:Add_startsAndEndsWith_methods** into **f6923510352fc3fbfad68bc6c5ac5258a34671b7 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 Issue Time Tracking --- Worklog Id: (was: 425552) Time Spent: 20m (was: 10m) > Add startsAndEndsWith() functions to StringUtils. > - > > Key: LANG-1540 > URL: https://issues.apache.org/jira/browse/LANG-1540 > Project: Commons Lang > Issue Type: New Feature > Components: lang.* >Reporter: Isira Seneviratne >Priority: Major > Time Spent: 20m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-lang] coveralls commented on issue #524: [LANG-1540] Add startsAndEndsWith() methods to StringUtils.
coveralls commented on issue #524: URL: https://github.com/apache/commons-lang/pull/524#issuecomment-616957260 [![Coverage Status](https://coveralls.io/builds/30214661/badge)](https://coveralls.io/builds/30214661) Coverage decreased (-0.007%) to 95.085% when pulling **48030c9bc28c53ee161dca2c00c25b64ab3c411a on Isira-Seneviratne:Add_startsAndEndsWith_methods** into **f6923510352fc3fbfad68bc6c5ac5258a34671b7 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
[jira] [Work logged] (IMAGING-251) Support TIFF standard floating point data
[ https://issues.apache.org/jira/browse/IMAGING-251?focusedWorklogId=425527=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-425527 ] ASF GitHub Bot logged work on IMAGING-251: -- Author: ASF GitHub Bot Created on: 21/Apr/20 02:38 Start Date: 21/Apr/20 02:38 Worklog Time Spent: 10m Work Description: kinow commented on issue #72: URL: https://github.com/apache/commons-imaging/pull/72#issuecomment-616916050 >Since I've already said that I've "finished" this Pull Request (pending your review), I won't burden you with more changes... But I may submit the change as a future PR, if you think it a good idea. No burden at all (but thanks for considering that), we should use the momentum to improve as much as we can IMO. @gwlucastrig do you think it fits into this PR? If so, feel free to add a new commit. Or, if you think this would be easier to review separately, feel free to create a new PR. Separate smaller pull requests would be easier to review, but only if you think it makes sense. Once a separate PR is done, then we can rebase this or other existing PR's to have the new changes. 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 Issue Time Tracking --- Worklog Id: (was: 425527) Time Spent: 6h 50m (was: 6h 40m) > Support TIFF standard floating point data > - > > Key: IMAGING-251 > URL: https://issues.apache.org/jira/browse/IMAGING-251 > Project: Commons Imaging > Issue Type: New Feature > Components: Format: TIFF >Affects Versions: 1.x >Reporter: Gary Lucas >Priority: Major > Fix For: 1.x > > Attachments: Imaging252_USGS_n38w077.jpg > > Time Spent: 6h 50m > Remaining Estimate: 0h > > Commons Imaging does not support the floating-point format included in the > TIFF specification. There are prominent data sources that issue products in > this format. The ability to support this information would open up new > application areas for Commons Imaging. > TIFF is often used as a mechanism for distributing data from geophysical > applications in the form of GeoTIFF files. Some of this is not imagery, but > data. For example, the US Geological Survey is currently releasing > high-resolution elevation data grids for the 3DEP program under the name > Cloud-Optimized GeoTIFF (COG). It is a substantial data set with significant > potential commercial and academic applications. > To access this data means modifying the TIFF DataReaderStrips and > DataReaderTile classes to recognize floating point data (which is typically > indicated using TIFF tag #339, SampleFormat). Also, returning the data in the > form of a BufferedImage makes no sense at all, so the API on the > TiffImageParser and supporting classes would need additional methods to > return arrays of floats. The good news here is that that requirement would > mean adding new methods to the classes rather than making significant changes > to existing classes. So the probability of unintended consequences or new > bugs in existing code would be minimized. > Specification details for floating-point are given in the main TIFF-6 > documentations and Adobe Photoshop TIFF Technical Note 3. > > I am willing to volunteer to make these changes provided that there is > interest and a high probability that my contributions would be evaluated and, > if suitable, integrated into the Commons Imaging code base. > Thank you for your attention in this matter. > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-imaging] kinow commented on issue #72: IMAGING-251 support for TIFF floating-point formats
kinow commented on issue #72: URL: https://github.com/apache/commons-imaging/pull/72#issuecomment-616916050 >Since I've already said that I've "finished" this Pull Request (pending your review), I won't burden you with more changes... But I may submit the change as a future PR, if you think it a good idea. No burden at all (but thanks for considering that), we should use the momentum to improve as much as we can IMO. @gwlucastrig do you think it fits into this PR? If so, feel free to add a new commit. Or, if you think this would be easier to review separately, feel free to create a new PR. Separate smaller pull requests would be easier to review, but only if you think it makes sense. Once a separate PR is done, then we can rebase this or other existing PR's to have the new changes. 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] [Work logged] (IMAGING-251) Support TIFF standard floating point data
[ https://issues.apache.org/jira/browse/IMAGING-251?focusedWorklogId=425524=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-425524 ] ASF GitHub Bot logged work on IMAGING-251: -- Author: ASF GitHub Bot Created on: 21/Apr/20 02:28 Start Date: 21/Apr/20 02:28 Worklog Time Spent: 10m Work Description: gwlucastrig commented on issue #72: URL: https://github.com/apache/commons-imaging/pull/72#issuecomment-616913125 I thought I should point out one aspect of the new API elements that I think is not optimal. When I added the getFloatingPointRasterData() method to the TiffDirectory class, I had it take ByteOrder as an argument. I took this approach because the existing "getTiffImage" methods did the same thing. But as I look at the unit tests and example applications that use it, it seems awkward to make the code handle a data element that is extraneous to the task that it is trying to accomplish. It's just one extra thing for a developer to have to keep track of and doesn't give him any added capability. I've done some research and studied the TIFF specification, and it's clear that byte order is only specified one place in a TIFF file and doesn't change once the header section of the file is read. So I think a better approach to the new functionality would be to make the TiffDirectory class have byte-order as a member element that was populated by the constructors. Then the getFloatingPointRasterData() would not need it as an argument. Since I've already said that I've "finished" this Pull Request (pending your review), I won't burden you with more changes... But I may submit the change as a future PR, if you think it a good idea. 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 Issue Time Tracking --- Worklog Id: (was: 425524) Time Spent: 6h 40m (was: 6.5h) > Support TIFF standard floating point data > - > > Key: IMAGING-251 > URL: https://issues.apache.org/jira/browse/IMAGING-251 > Project: Commons Imaging > Issue Type: New Feature > Components: Format: TIFF >Affects Versions: 1.x >Reporter: Gary Lucas >Priority: Major > Fix For: 1.x > > Attachments: Imaging252_USGS_n38w077.jpg > > Time Spent: 6h 40m > Remaining Estimate: 0h > > Commons Imaging does not support the floating-point format included in the > TIFF specification. There are prominent data sources that issue products in > this format. The ability to support this information would open up new > application areas for Commons Imaging. > TIFF is often used as a mechanism for distributing data from geophysical > applications in the form of GeoTIFF files. Some of this is not imagery, but > data. For example, the US Geological Survey is currently releasing > high-resolution elevation data grids for the 3DEP program under the name > Cloud-Optimized GeoTIFF (COG). It is a substantial data set with significant > potential commercial and academic applications. > To access this data means modifying the TIFF DataReaderStrips and > DataReaderTile classes to recognize floating point data (which is typically > indicated using TIFF tag #339, SampleFormat). Also, returning the data in the > form of a BufferedImage makes no sense at all, so the API on the > TiffImageParser and supporting classes would need additional methods to > return arrays of floats. The good news here is that that requirement would > mean adding new methods to the classes rather than making significant changes > to existing classes. So the probability of unintended consequences or new > bugs in existing code would be minimized. > Specification details for floating-point are given in the main TIFF-6 > documentations and Adobe Photoshop TIFF Technical Note 3. > > I am willing to volunteer to make these changes provided that there is > interest and a high probability that my contributions would be evaluated and, > if suitable, integrated into the Commons Imaging code base. > Thank you for your attention in this matter. > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-imaging] gwlucastrig commented on issue #72: IMAGING-251 support for TIFF floating-point formats
gwlucastrig commented on issue #72: URL: https://github.com/apache/commons-imaging/pull/72#issuecomment-616913125 I thought I should point out one aspect of the new API elements that I think is not optimal. When I added the getFloatingPointRasterData() method to the TiffDirectory class, I had it take ByteOrder as an argument. I took this approach because the existing "getTiffImage" methods did the same thing. But as I look at the unit tests and example applications that use it, it seems awkward to make the code handle a data element that is extraneous to the task that it is trying to accomplish. It's just one extra thing for a developer to have to keep track of and doesn't give him any added capability. I've done some research and studied the TIFF specification, and it's clear that byte order is only specified one place in a TIFF file and doesn't change once the header section of the file is read. So I think a better approach to the new functionality would be to make the TiffDirectory class have byte-order as a member element that was populated by the constructors. Then the getFloatingPointRasterData() would not need it as an argument. Since I've already said that I've "finished" this Pull Request (pending your review), I won't burden you with more changes... But I may submit the change as a future PR, if you think it a good idea. 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] Isira-Seneviratne opened a new pull request #525: Correct Javadocs of methods that use Validate.notNull() and replace some uses of Validate.isTrue() with Validate.notNull().
Isira-Seneviratne opened a new pull request #525: URL: https://github.com/apache/commons-lang/pull/525 The Javadocs of some methods that use the Validate.notNull() method incorrectly refer to IllegalArgumentException instead of NullPointerException as the exception thrown, while the methods' tests check for NullPointerException. In addition, some of said methods use Validate.isTrue() instead of Validate.notNull() for null checking. This PR fixes both issues as they are closely related. 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] [Work logged] (LANG-1540) Add startsAndEndsWith() functions to StringUtils.
[ https://issues.apache.org/jira/browse/LANG-1540?focusedWorklogId=425504=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-425504 ] ASF GitHub Bot logged work on LANG-1540: Author: ASF GitHub Bot Created on: 21/Apr/20 00:10 Start Date: 21/Apr/20 00:10 Worklog Time Spent: 10m Work Description: Isira-Seneviratne opened a new pull request #524: URL: https://github.com/apache/commons-lang/pull/524 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 Issue Time Tracking --- Worklog Id: (was: 425504) Remaining Estimate: 0h Time Spent: 10m > Add startsAndEndsWith() functions to StringUtils. > - > > Key: LANG-1540 > URL: https://issues.apache.org/jira/browse/LANG-1540 > Project: Commons Lang > Issue Type: New Feature > Components: lang.* >Reporter: Isira Seneviratne >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-lang] Isira-Seneviratne opened a new pull request #524: [LANG-1540] Add startsAndEndsWith() methods to StringUtils.
Isira-Seneviratne opened a new pull request #524: URL: https://github.com/apache/commons-lang/pull/524 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] [Created] (LANG-1540) Add startsAndEndsWith() functions to StringUtils.
Isira Seneviratne created LANG-1540: --- Summary: Add startsAndEndsWith() functions to StringUtils. Key: LANG-1540 URL: https://issues.apache.org/jira/browse/LANG-1540 Project: Commons Lang Issue Type: New Feature Components: lang.* Reporter: Isira Seneviratne -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Created] (COMPRESS-511) Decompress tar failed. java.io.IOException: Error detected parsing the header
Akhila Mangipudi created COMPRESS-511: - Summary: Decompress tar failed. java.io.IOException: Error detected parsing the header Key: COMPRESS-511 URL: https://issues.apache.org/jira/browse/COMPRESS-511 Project: Commons Compress Issue Type: Bug Components: Archivers Affects Versions: 1.20 Reporter: Akhila Mangipudi Attachments: layer1.tar public static void main(String args[]) throws Exception { //Send the TAR file as an argument String tarFileName = args[0]; /* Read TAR File into TarArchiveInputStream */ TarArchiveInputStream myTarFile=new TarArchiveInputStream(new FileInputStream(new File(tarFileName))); /* To read individual TAR file */ TarArchiveEntry entry = null; String individualFiles; int offset; FileOutputStream outputFile=null; /* Create a loop to read every single entry in TAR file */ while ((entry = myTarFile.getNextTarEntry()) != null) { /* Get the name of the file */ individualFiles = entry.getName(); /* Get Size of the file and create a byte array for the size */ byte[] content = new byte[(int) entry.getSize()]; offset=0; /* Some SOP statements to check progress */ System.out.println("File Name in TAR File is: " + individualFiles); System.out.println("Size of the File is: " + entry.getSize()); System.out.println("Byte Array length: " + content.length); /* Read file from the archive into byte array */ myTarFile.read(content, offset, content.length - offset); /* Define OutputStream for writing the file */ outputFile=new FileOutputStream(new File(individualFiles)); } I was able to decompress the tar file in the Linux environment using the tar command. Following is the error when I run the code: [ec2-user@ip-172-31-16-85 src]$ java TarToByteArray.java layer1.tar Error: Could not find or load main class TarToByteArray.java [ec2-user@ip-172-31-16-85 src]$ java TarToByteArray layer1.tar Exception in thread "main" java.io.IOException: Error detected parsing the header at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:371) at TarToByteArray.main(TarToByteArray.java:19) Caused by: java.lang.IllegalArgumentException: At offset 124, 12 byte binary number exceeds maximum signed long value at org.apache.commons.compress.archivers.tar.TarUtils.parseBinaryBigInteger(TarUtils.java:215) at org.apache.commons.compress.archivers.tar.TarUtils.parseOctalOrBinary(TarUtils.java:179) at org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1350) at org.apache.commons.compress.archivers.tar.TarArchiveEntry.(TarArchiveEntry.java:438) at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:369) ... 1 more Also attaching the tar file that I am using! -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-lang] kinow commented on a change in pull request #523: Rewrite the finding of matching Locales in LocaleUtils using the Streams API.
kinow commented on a change in pull request #523: URL: https://github.com/apache/commons-lang/pull/523#discussion_r411729884 ## File path: src/main/java/org/apache/commons/lang3/LocaleUtils.java ## @@ -295,14 +297,13 @@ public static boolean isAvailableLocale(final Locale locale) { } List langs = cLanguagesByCountry.get(countryCode); if (langs == null) { -langs = new ArrayList<>(); -final List locales = availableLocaleList(); -for (final Locale locale : locales) { -if (countryCode.equals(locale.getCountry()) && -locale.getVariant().isEmpty()) { -langs.add(locale); -} -} +// Allows Locales to be processed using multiple threads. +langs = availableLocaleList().parallelStream() Review comment: From what I remember (sorry, been doing more Python these days), the `parallelStream` could be good or bad. For a low level library, I think it would be bad. That method starts executors in the background, and I think it's either a fixed number of executors, or based on the number of cores. But anyway, the point was that if a library uses `parallelStream`, users of the API would have to be aware that there could be small performance peaks due to these extra executors being created. See [this SO question & answers](https://stackoverflow.com/questions/20375176/should-i-always-use-a-parallel-stream-when-possible). The place where I would use it, would be some small command line utility processing text/files with thousands or millions of lines in a single computer. There I could perhaps use a parallelStream to do some processing. So for that, for now, I'd be -1 to `parallelStream` here in common (the code looks nicer by the way :) 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] [Created] (CRYPTO-147) Link in OpenSslJnaCipher code or remove as option for OpenSslCipher
Geoffrey Blake created CRYPTO-147: - Summary: Link in OpenSslJnaCipher code or remove as option for OpenSslCipher Key: CRYPTO-147 URL: https://issues.apache.org/jira/browse/CRYPTO-147 Project: Commons Crypto Issue Type: Wish Affects Versions: 1.0.0 Environment: All supported environments. Reporter: Geoffrey Blake It appears while the JNA code is present, it will never actually be used by the common-crypto library when a user asks for a provider from the list of Cipher providers. Only the OpenSslNative JNI code or the JCE provider will be selected. The JNA code is currently not exposed for use by other packages in the repository. The JNA code should be exposed as an option, or be elided from the library as it is effectively dead code at the moment. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (LANG-1523) Avoid unnecessary allocation in StringUtils.wrapIfMissing
[ https://issues.apache.org/jira/browse/LANG-1523?focusedWorklogId=425463=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-425463 ] ASF GitHub Bot logged work on LANG-1523: Author: ASF GitHub Bot Created on: 20/Apr/20 21:06 Start Date: 20/Apr/20 21:06 Worklog Time Spent: 10m Work Description: garydgregory commented on issue #503: URL: https://github.com/apache/commons-lang/pull/503#issuecomment-616809005 No feedback for a couple of weeks, see comments. 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 Issue Time Tracking --- Worklog Id: (was: 425463) Time Spent: 2h (was: 1h 50m) > Avoid unnecessary allocation in StringUtils.wrapIfMissing > - > > Key: LANG-1523 > URL: https://issues.apache.org/jira/browse/LANG-1523 > Project: Commons Lang > Issue Type: Improvement > Components: lang.* >Affects Versions: 3.9 >Reporter: Edgar Asatryan >Priority: Major > Fix For: 3.10 > > Time Spent: 2h > Remaining Estimate: 0h > > The *StringUtils.wrapIfMissing* creates a new instance of *StringBuilder* > regardless of whether the input is wrapped or not. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-lang] garydgregory commented on issue #503: [LANG-1523] Avoid unnecessary allocation in StringUtils.wrapIfMissing
garydgregory commented on issue #503: URL: https://github.com/apache/commons-lang/pull/503#issuecomment-616809005 No feedback for a couple of weeks, see comments. 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] [Resolved] (LANG-1537) Simplify a null check in the private replaceEach() method of StringUtils
[ https://issues.apache.org/jira/browse/LANG-1537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gary D. Gregory resolved LANG-1537. --- Resolution: Fixed > Simplify a null check in the private replaceEach() method of StringUtils > > > Key: LANG-1537 > URL: https://issues.apache.org/jira/browse/LANG-1537 > Project: Commons Lang > Issue Type: Improvement > Components: lang.* >Affects Versions: 3.10 >Reporter: Bruno P. Kinoshita >Assignee: Bruno P. Kinoshita >Priority: Minor > Fix For: 3.10.1 > > Time Spent: 10m > Remaining Estimate: 0h > > Placeholder for https://github.com/apache/commons-lang/pull/514 -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-lang] arend-von-reinersdorff commented on a change in pull request #518: (doc) Fix throwable is returned, not index
arend-von-reinersdorff commented on a change in pull request #518: URL: https://github.com/apache/commons-lang/pull/518#discussion_r411685595 ## File path: src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java ## @@ -810,7 +810,7 @@ public static void removeCommonFrames(final List causeFrames, final List * @param the type of Throwable you are searching. * @param throwable the throwable to inspect, may be null * @param clazz the class to search for, subclasses do not match, null returns null - * @return the index into the throwable chain, null if no match or null input + * @return the first matching throwable form the throwable chain, null if no match or null input Review comment: Hi @kinow, fixed the typo. Thanks for spotting it :-) 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 #521: Simplify some if statements in StringUtils.
garydgregory commented on a change in pull request #521: URL: https://github.com/apache/commons-lang/pull/521#discussion_r411684196 ## File path: src/main/java/org/apache/commons/lang3/StringUtils.java ## @@ -330,11 +330,9 @@ public static String abbreviate(final String str, final String abbrevMarker, fin * @since 3.6 */ public static String abbreviate(final String str, final String abbrevMarker, int offset, final int maxWidth) { -if (isEmpty(str) && isEmpty(abbrevMarker)) { -return str; -} else if (isNotEmpty(str) && EMPTY.equals(abbrevMarker) && maxWidth > 0) { -return str.substring(0, maxWidth); -} else if (isEmpty(str) || isEmpty(abbrevMarker)) { +if (isNotEmpty(str) && EMPTY.equals(abbrevMarker) && maxWidth > 0) { Review comment: @Isira-Seneviratne You are correct! 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 issue #515: Remove unnecessary unboxing in BooleanUtils.
garydgregory commented on issue #515: URL: https://github.com/apache/commons-lang/pull/515#issuecomment-616799091 Closing... 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] [Work logged] (IO-661) FileUtils throws inconsistent exceptions
[ https://issues.apache.org/jira/browse/IO-661?focusedWorklogId=425424=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-425424 ] ASF GitHub Bot logged work on IO-661: - Author: ASF GitHub Bot Created on: 20/Apr/20 19:02 Start Date: 20/Apr/20 19:02 Worklog Time Spent: 10m Work Description: ecki commented on issue #111: URL: https://github.com/apache/commons-io/pull/111#issuecomment-616748354 @ferenc-csaky yes my reasoning applies all locations where an io check produces an IAE. (however I only reviewed the existing change) 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 Issue Time Tracking --- Worklog Id: (was: 425424) Time Spent: 1h 40m (was: 1.5h) > FileUtils throws inconsistent exceptions > > > Key: IO-661 > URL: https://issues.apache.org/jira/browse/IO-661 > Project: Commons IO > Issue Type: Bug > Components: Utilities >Affects Versions: 2.6 >Reporter: Hao Zhong >Priority: Major > Time Spent: 1h 40m > Remaining Estimate: 0h > > The FileUtils throws inconsistent exceptions, when an input is not a > directory. > The copyFileToDirectory throws IllegalArgumentException: > > {code:java} > public static void copyFileToDirectory(final File srcFile, final File > destDir, final boolean preserveFileDate) > throws IOException { > if (destDir == null) { > throw new NullPointerException("Destination must not be null"); > } > if (destDir.exists() && destDir.isDirectory() == false) { > throw new IllegalArgumentException("Destination '" + destDir + "' > is not a directory"); > } > final File destFile = new File(destDir, srcFile.getName()); > copyFile(srcFile, destFile, preserveFileDate); > } > {code} > The other methods throw IOException: > > > {code:java} > public static void moveFileToDirectory(final File srcFile, final File > destDir, final boolean createDestDir) > throws IOException { > validateMoveParameters(srcFile, destDir); > if (!destDir.exists() && createDestDir) { > destDir.mkdirs(); > } > if (!destDir.exists()) { > throw new FileNotFoundException("Destination directory '" + > destDir + > "' does not exist [createDestDir=" + createDestDir + "]"); > } > if (!destDir.isDirectory()) { > throw new IOException("Destination '" + destDir + "' is not a > directory"); > } > moveFile(srcFile, new File(destDir, srcFile.getName())); > } > {code} > I feel that IOException is more reasonable. Although the messages are the > same, the different exception can cause problems when programmers catch the > thrown exceptions. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-io] ecki commented on issue #111: [IO-661] FileUtils throws inconsistent exceptions
ecki commented on issue #111: URL: https://github.com/apache/commons-io/pull/111#issuecomment-616748354 @ferenc-csaky yes my reasoning applies all locations where an io check produces an IAE. (however I only reviewed the existing change) 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] [Work logged] (IO-661) FileUtils throws inconsistent exceptions
[ https://issues.apache.org/jira/browse/IO-661?focusedWorklogId=425407=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-425407 ] ASF GitHub Bot logged work on IO-661: - Author: ASF GitHub Bot Created on: 20/Apr/20 18:15 Start Date: 20/Apr/20 18:15 Worklog Time Spent: 10m Work Description: ferenc-csaky commented on issue #111: URL: https://github.com/apache/commons-io/pull/111#issuecomment-616725308 The change is not finished, I did not touch the `move` methods yet also. That parts still throws IOEs and that was the main difference the Jira pointed out. So my plan is to adapt that part as well. I just wanted to share the current state if everybody agrees with the direction. Although I should have been published a comment about it, so sorry for that. @garydgregory So should I document the exact behaviour changes on the Jira? @ecki By **this case** you mean the whole context, right? Because the scenario you mentioned can be applied to all the methods I changed. 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 Issue Time Tracking --- Worklog Id: (was: 425407) Time Spent: 1.5h (was: 1h 20m) > FileUtils throws inconsistent exceptions > > > Key: IO-661 > URL: https://issues.apache.org/jira/browse/IO-661 > Project: Commons IO > Issue Type: Bug > Components: Utilities >Affects Versions: 2.6 >Reporter: Hao Zhong >Priority: Major > Time Spent: 1.5h > Remaining Estimate: 0h > > The FileUtils throws inconsistent exceptions, when an input is not a > directory. > The copyFileToDirectory throws IllegalArgumentException: > > {code:java} > public static void copyFileToDirectory(final File srcFile, final File > destDir, final boolean preserveFileDate) > throws IOException { > if (destDir == null) { > throw new NullPointerException("Destination must not be null"); > } > if (destDir.exists() && destDir.isDirectory() == false) { > throw new IllegalArgumentException("Destination '" + destDir + "' > is not a directory"); > } > final File destFile = new File(destDir, srcFile.getName()); > copyFile(srcFile, destFile, preserveFileDate); > } > {code} > The other methods throw IOException: > > > {code:java} > public static void moveFileToDirectory(final File srcFile, final File > destDir, final boolean createDestDir) > throws IOException { > validateMoveParameters(srcFile, destDir); > if (!destDir.exists() && createDestDir) { > destDir.mkdirs(); > } > if (!destDir.exists()) { > throw new FileNotFoundException("Destination directory '" + > destDir + > "' does not exist [createDestDir=" + createDestDir + "]"); > } > if (!destDir.isDirectory()) { > throw new IOException("Destination '" + destDir + "' is not a > directory"); > } > moveFile(srcFile, new File(destDir, srcFile.getName())); > } > {code} > I feel that IOException is more reasonable. Although the messages are the > same, the different exception can cause problems when programmers catch the > thrown exceptions. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-io] ferenc-csaky commented on issue #111: [IO-661] FileUtils throws inconsistent exceptions
ferenc-csaky commented on issue #111: URL: https://github.com/apache/commons-io/pull/111#issuecomment-616725308 The change is not finished, I did not touch the `move` methods yet also. That parts still throws IOEs and that was the main difference the Jira pointed out. So my plan is to adapt that part as well. I just wanted to share the current state if everybody agrees with the direction. Although I should have been published a comment about it, so sorry for that. @garydgregory So should I document the exact behaviour changes on the Jira? @ecki By **this case** you mean the whole context, right? Because the scenario you mentioned can be applied to all the methods I changed. 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-crypto] adamretter commented on a change in pull request #96: CI Improvements
adamretter commented on a change in pull request #96: URL: https://github.com/apache/commons-crypto/pull/96#discussion_r411580510 ## File path: .travis.yml ## @@ -18,28 +18,84 @@ language: java matrix: include: -- name: "Ubuntu 14.04 / Java 8 / OpenSSL 1.0.x" + +- name: "x64 / Ubuntu 14.04 / Java 8 / OpenSSL 1.0.x" Review comment: Okay no worries. Could you explain? I am happy to change it if it makes sense... 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-crypto] geoffreyblake commented on a change in pull request #96: CI Improvements
geoffreyblake commented on a change in pull request #96: URL: https://github.com/apache/commons-crypto/pull/96#discussion_r411579110 ## File path: .travis.yml ## @@ -18,28 +18,84 @@ language: java matrix: include: -- name: "Ubuntu 14.04 / Java 8 / OpenSSL 1.0.x" + +- name: "x64 / Ubuntu 14.04 / Java 8 / OpenSSL 1.0.x" Review comment: I don't fully agree, but this is still a minor nit. Probably fine to keep as is. 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-codec] garydgregory commented on issue #46: Base16 Input and Output Streams
garydgregory commented on issue #46: URL: https://github.com/apache/commons-codec/pull/46#issuecomment-616642943 > through `abstract` methods)? Not that comes to mind. 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-crypto] adamretter commented on a change in pull request #96: CI Improvements
adamretter commented on a change in pull request #96: URL: https://github.com/apache/commons-crypto/pull/96#discussion_r411447054 ## File path: .travis.yml ## @@ -18,28 +18,84 @@ language: java matrix: include: -- name: "Ubuntu 14.04 / Java 8 / OpenSSL 1.0.x" + +- name: "x64 / Ubuntu 14.04 / Java 8 / OpenSSL 1.0.x" Review comment: I left it as 14.04 as that is what it was before. An arguable advantage of using an older Ubuntu is that it will have an older GCC so you can ensure wider compatibility. Unfortunately 14.04 isn't available for ppc64le and aarch64 on Travis, which is why I used 16.04 instead. 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-codec] aherbert commented on issue #46: Base16 Input and Output Streams
aherbert commented on issue #46: URL: https://github.com/apache/commons-codec/pull/46#issuecomment-616607708 Hi, Further to Gary's note here is some info on strict decoding. The strict decoding support applies to decodings where the length of the input characters to decode is incorrect. Strict decoding would reject these. Lenient decoding would allow it. Strict decoding is a contract that states the encoding can be round tripped via decode-encode to the same byte array (ignoring padding characters). So for Base16 this is simple. If you have an even number of Hex characters your encoding is good and you can decode everything. If the decoding leaves a final trailing character you have leftover bits. Strict decoding would reject this. Lenient decoding would allow it by discarding the leftover bits. 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-codec] adamretter commented on issue #46: Base16 Input and Output Streams
adamretter commented on issue #46: URL: https://github.com/apache/commons-codec/pull/46#issuecomment-616607129 Thanks @garydgregory from the API of `BaseNCodec` it was not at all clear that I had to support that. I can get that implemented soon. Are there any other things that I should consider that are perhaps non obvious (i.e. not enforced through `abstract` methods)? 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] [Resolved] (LANG-1534) Replace some usages of the ternary operator with calls to Math.max() and Math.min() in StringUtils.
[ https://issues.apache.org/jira/browse/LANG-1534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Isira Seneviratne resolved LANG-1534. - Fix Version/s: 3.10.1 Resolution: Fixed > Replace some usages of the ternary operator with calls to Math.max() and > Math.min() in StringUtils. > --- > > Key: LANG-1534 > URL: https://issues.apache.org/jira/browse/LANG-1534 > Project: Commons Lang > Issue Type: Improvement > Components: lang.* >Reporter: Isira Seneviratne >Priority: Trivial > Fix For: 3.10.1 > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-crypto] geoffreyblake commented on a change in pull request #96: CI Improvements
geoffreyblake commented on a change in pull request #96: URL: https://github.com/apache/commons-crypto/pull/96#discussion_r411425835 ## File path: .travis.yml ## @@ -18,28 +18,84 @@ language: java matrix: include: -- name: "Ubuntu 14.04 / Java 8 / OpenSSL 1.0.x" + +- name: "x64 / Ubuntu 14.04 / Java 8 / OpenSSL 1.0.x" Review comment: Should this be the same as ppc64le and aarch64 build and be Ubuntu 16.04? 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] Isira-Seneviratne commented on a change in pull request #521: Simplify some if statements in StringUtils.
Isira-Seneviratne commented on a change in pull request #521: URL: https://github.com/apache/commons-lang/pull/521#discussion_r411417616 ## File path: src/main/java/org/apache/commons/lang3/StringUtils.java ## @@ -330,11 +330,9 @@ public static String abbreviate(final String str, final String abbrevMarker, fin * @since 3.6 */ public static String abbreviate(final String str, final String abbrevMarker, int offset, final int maxWidth) { -if (isEmpty(str) && isEmpty(abbrevMarker)) { -return str; -} else if (isNotEmpty(str) && EMPTY.equals(abbrevMarker) && maxWidth > 0) { -return str.substring(0, maxWidth); -} else if (isEmpty(str) || isEmpty(abbrevMarker)) { +if (isNotEmpty(str) && EMPTY.equals(abbrevMarker) && maxWidth > 0) { Review comment: That change would mean that `abbrevMarker` is potentially null, according to SonarLint. 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] Isira-Seneviratne commented on a change in pull request #521: Simplify some if statements in StringUtils.
Isira-Seneviratne commented on a change in pull request #521: URL: https://github.com/apache/commons-lang/pull/521#discussion_r411417616 ## File path: src/main/java/org/apache/commons/lang3/StringUtils.java ## @@ -330,11 +330,9 @@ public static String abbreviate(final String str, final String abbrevMarker, fin * @since 3.6 */ public static String abbreviate(final String str, final String abbrevMarker, int offset, final int maxWidth) { -if (isEmpty(str) && isEmpty(abbrevMarker)) { -return str; -} else if (isNotEmpty(str) && EMPTY.equals(abbrevMarker) && maxWidth > 0) { -return str.substring(0, maxWidth); -} else if (isEmpty(str) || isEmpty(abbrevMarker)) { +if (isNotEmpty(str) && EMPTY.equals(abbrevMarker) && maxWidth > 0) { Review comment: That change would mean that `abbrevMarker` is potentially null. 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] Isira-Seneviratne commented on a change in pull request #523: Simplify the finding of matching Locales in LocaleUtils using the Streams API.
Isira-Seneviratne commented on a change in pull request #523: URL: https://github.com/apache/commons-lang/pull/523#discussion_r411409043 ## File path: src/main/java/org/apache/commons/lang3/LocaleUtils.java ## @@ -295,14 +297,13 @@ public static boolean isAvailableLocale(final Locale locale) { } List langs = cLanguagesByCountry.get(countryCode); if (langs == null) { -langs = new ArrayList<>(); -final List locales = availableLocaleList(); -for (final Locale locale : locales) { -if (countryCode.equals(locale.getCountry()) && -locale.getVariant().isEmpty()) { -langs.add(locale); -} -} +// Allows Locales to be processed using multiple threads. +langs = availableLocaleList().parallelStream() +.filter(locale -> countryCode.equals(locale.getCountry())) +.filter(locale -> locale.getVariant().isEmpty()) +.collect(Collectors.toList()); +// Collectors.toUnmodifiableList() is an alternative, but it is only +// available starting with Java 10. langs = Collections.unmodifiableList(langs); cLanguagesByCountry.putIfAbsent(countryCode, langs); Review comment: It does make use of parallelStream(), though, so there should be at least a decent performance improvement. 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] Isira-Seneviratne commented on a change in pull request #523: Simplify the finding of matching Locales in LocaleUtils using the Streams API.
Isira-Seneviratne commented on a change in pull request #523: URL: https://github.com/apache/commons-lang/pull/523#discussion_r411409043 ## File path: src/main/java/org/apache/commons/lang3/LocaleUtils.java ## @@ -295,14 +297,13 @@ public static boolean isAvailableLocale(final Locale locale) { } List langs = cLanguagesByCountry.get(countryCode); if (langs == null) { -langs = new ArrayList<>(); -final List locales = availableLocaleList(); -for (final Locale locale : locales) { -if (countryCode.equals(locale.getCountry()) && -locale.getVariant().isEmpty()) { -langs.add(locale); -} -} +// Allows Locales to be processed using multiple threads. +langs = availableLocaleList().parallelStream() +.filter(locale -> countryCode.equals(locale.getCountry())) +.filter(locale -> locale.getVariant().isEmpty()) +.collect(Collectors.toList()); +// Collectors.toUnmodifiableList() is an alternative, but it is only +// available starting with Java 10. langs = Collections.unmodifiableList(langs); cLanguagesByCountry.putIfAbsent(countryCode, langs); Review comment: It does make use of parallelStream(), though. 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] Isira-Seneviratne commented on a change in pull request #523: Simplify the finding of matching Locales in LocaleUtils using the Streams API.
Isira-Seneviratne commented on a change in pull request #523: URL: https://github.com/apache/commons-lang/pull/523#discussion_r411407941 ## File path: src/main/java/org/apache/commons/lang3/LocaleUtils.java ## @@ -295,14 +297,13 @@ public static boolean isAvailableLocale(final Locale locale) { } List langs = cLanguagesByCountry.get(countryCode); if (langs == null) { -langs = new ArrayList<>(); -final List locales = availableLocaleList(); -for (final Locale locale : locales) { -if (countryCode.equals(locale.getCountry()) && -locale.getVariant().isEmpty()) { -langs.add(locale); -} -} +// Allows Locales to be processed using multiple threads. +langs = availableLocaleList().parallelStream() +.filter(locale -> countryCode.equals(locale.getCountry())) +.filter(locale -> locale.getVariant().isEmpty()) +.collect(Collectors.toList()); +// Collectors.toUnmodifiableList() is an alternative, but it is only +// available starting with Java 10. langs = Collections.unmodifiableList(langs); cLanguagesByCountry.putIfAbsent(countryCode, langs); Review comment: It should be possible, but I'm not sure how complex the resulting lambda will be. 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 #523: Simplify the finding of matching Locales in LocaleUtils using the Streams API.
garydgregory commented on a change in pull request #523: URL: https://github.com/apache/commons-lang/pull/523#discussion_r411407968 ## File path: src/main/java/org/apache/commons/lang3/LocaleUtils.java ## @@ -295,14 +297,13 @@ public static boolean isAvailableLocale(final Locale locale) { } List langs = cLanguagesByCountry.get(countryCode); if (langs == null) { -langs = new ArrayList<>(); -final List locales = availableLocaleList(); -for (final Locale locale : locales) { -if (countryCode.equals(locale.getCountry()) && -locale.getVariant().isEmpty()) { -langs.add(locale); -} -} +// Allows Locales to be processed using multiple threads. +langs = availableLocaleList().parallelStream() +.filter(locale -> countryCode.equals(locale.getCountry())) +.filter(locale -> locale.getVariant().isEmpty()) +.collect(Collectors.toList()); +// Collectors.toUnmodifiableList() is an alternative, but it is only +// available starting with Java 10. langs = Collections.unmodifiableList(langs); cLanguagesByCountry.putIfAbsent(countryCode, langs); Review comment: It's also not "simpler", it's just different, without even thinking about performance consequences 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 #520: Implement Utils classes in Kotlin.
garydgregory commented on a change in pull request #520: URL: https://github.com/apache/commons-lang/pull/520#discussion_r411407080 ## File path: pom.xml ## @@ -74,7 +71,7 @@ Henri Yandell bayard bay...@apache.org - + Review comment: It does not matter who formatted what, it's still your PR ;-) 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-codec] garydgregory commented on issue #46: Base16 Input and Output Streams
garydgregory commented on issue #46: URL: https://github.com/apache/commons-codec/pull/46#issuecomment-616576416 Hi @adamretter Thank you for the PR! I do not see support for `org.apache.commons.codec.binary.BaseNCodec.isStrictDecoding()` which version 1.15 introduces for Base32 and Base64. The PR seems to silently ignore that stetting unless I am missing something. 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] Isira-Seneviratne commented on a change in pull request #520: Implement Utils classes in Kotlin.
Isira-Seneviratne commented on a change in pull request #520: URL: https://github.com/apache/commons-lang/pull/520#discussion_r411396858 ## File path: pom.xml ## @@ -74,7 +71,7 @@ Henri Yandell bayard bay...@apache.org - + Review comment: That was formatted by IntelliJ. 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] namannigam commented on a change in pull request #523: Simplify the finding of matching Locales in LocaleUtils using the Streams API.
namannigam commented on a change in pull request #523: URL: https://github.com/apache/commons-lang/pull/523#discussion_r411396657 ## File path: src/main/java/org/apache/commons/lang3/LocaleUtils.java ## @@ -295,14 +297,13 @@ public static boolean isAvailableLocale(final Locale locale) { } List langs = cLanguagesByCountry.get(countryCode); if (langs == null) { -langs = new ArrayList<>(); -final List locales = availableLocaleList(); -for (final Locale locale : locales) { -if (countryCode.equals(locale.getCountry()) && -locale.getVariant().isEmpty()) { -langs.add(locale); -} -} +// Allows Locales to be processed using multiple threads. +langs = availableLocaleList().parallelStream() +.filter(locale -> countryCode.equals(locale.getCountry())) +.filter(locale -> locale.getVariant().isEmpty()) +.collect(Collectors.toList()); +// Collectors.toUnmodifiableList() is an alternative, but it is only +// available starting with Java 10. langs = Collections.unmodifiableList(langs); cLanguagesByCountry.putIfAbsent(countryCode, langs); Review comment: curious, could all of this be replaced with any of the `compute..` variants in `Map`? 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-text] Isira-Seneviratne commented on issue #130: Use Lombok's NonNull annotation for null argument checks in LevenshteinDistance.
Isira-Seneviratne commented on issue #130: URL: https://github.com/apache/commons-text/pull/130#issuecomment-616564765 > > > Hi @Isira-Seneviratne > We have, so far, resisted using dependencies like Lombok in all of Apache Commons. If you think this is neccessary, feel free to start a discussion on the developer's mailing list https://commons.apache.org/mail-lists.html Ah, I see. Thank you for the information. In that case, I guess it's not necessary. 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 #520: Implement Utils classes in Kotlin.
garydgregory commented on a change in pull request #520: URL: https://github.com/apache/commons-lang/pull/520#discussion_r411388223 ## File path: pom.xml ## @@ -74,7 +71,7 @@ Henri Yandell bayard bay...@apache.org - + Review comment: @Isira-Seneviratne Please do not change this formatting. ## File path: pom.xml ## @@ -553,6 +550,12 @@ test + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + Review comment: -1, that's a bridge too far IMO. If we want to create a Kotlin Commons Lang, we can talk about that on the developer's mailing list... 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 #521: Simplify some if statements in StringUtils.
garydgregory commented on a change in pull request #521: URL: https://github.com/apache/commons-lang/pull/521#discussion_r411386416 ## File path: src/main/java/org/apache/commons/lang3/StringUtils.java ## @@ -330,11 +330,9 @@ public static String abbreviate(final String str, final String abbrevMarker, fin * @since 3.6 */ public static String abbreviate(final String str, final String abbrevMarker, int offset, final int maxWidth) { -if (isEmpty(str) && isEmpty(abbrevMarker)) { -return str; -} else if (isNotEmpty(str) && EMPTY.equals(abbrevMarker) && maxWidth > 0) { -return str.substring(0, maxWidth); -} else if (isEmpty(str) || isEmpty(abbrevMarker)) { +if (isNotEmpty(str) && EMPTY.equals(abbrevMarker) && maxWidth > 0) { Review comment: How about `EMPTY.equals(abbrevMarker)` -> `isEmpty(abbrevMarker)` ? 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] (GEOMETRY-94) ConvexSubPlane Subclasses
[ https://issues.apache.org/jira/browse/GEOMETRY-94?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17087736#comment-17087736 ] Gilles Sadowski commented on GEOMETRY-94: - Maybe the issue is just terminology: What does "sub" mean? If "subset", shouldn't "ConvexSubPlane" rather be "HyperplaneConvexSubset"? I.e. a composition of words that all have a standard meaning. > ConvexSubPlane Subclasses > - > > Key: GEOMETRY-94 > URL: https://issues.apache.org/jira/browse/GEOMETRY-94 > Project: Apache Commons Geometry > Issue Type: New Feature >Reporter: Matt Juntunen >Priority: Major > Labels: beta1 > > There should be specific subclasses of {{ConvexSubPlane}} to allow for > optimization and ease of use. > - {{OpenConvexSubPlane}} - extends {{ConvexSubPlane}}; represents a convex > subplane that is open on a least one side and has infinite size > - {{ClosedConvexSubPlane}} - extends {{ConvexSubPlane}}; represents a convex > subplane with finite size; the 2D subspace is a polygon > - {{Triangle3D}} - extends {{ClosedConvexSubPlane}}; represents a triangle > in 3D space; most 3D models are or can easily be represented with triangles > so it would be good to have a dedicated class for this. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-text] garydgregory commented on issue #130: Use Lombok's NonNull annotation for null argument checks in LevenshteinDistance.
garydgregory commented on issue #130: URL: https://github.com/apache/commons-text/pull/130#issuecomment-616551617 Hi @Isira-Seneviratne We have, so far, resisted using dependencies like Lombok in all of Apache Commons. If you think this is neccessary, feel free to start a discussion on the developer's mailing list https://commons.apache.org/mail-lists.html 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] (GEOMETRY-92) Segment is not mathematically correct
[ https://issues.apache.org/jira/browse/GEOMETRY-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17087707#comment-17087707 ] Gilles Sadowski commented on GEOMETRY-92: - {quote}Line3D.Span3D seems redundant to me. {quote} I fully agree. But the argument is that what is good for {{Span}} is IMHO equally good for {{Ray}}: {code:java} Line3.Ray {code} vs {code:java} Ray3D {code} (meaning that the "3D" suffix is at the "same" place for all subclasses of {{ConvexSubLine3D}}). And, to come back to a previous argument, the additional code for nested classes should not count as "bloating" when the enclosing class is used as a "namespace". {quote}An abscissa value with that range would not be a ray since "start" is an end point and not a start point. {quote} What got me wondering is that when looking at {{Ray3D}} and {{TerminatedLine3D}}, it seems that their implementation is the same with (mutatis mutandis) {{start}} <-> {{end}}. Hence it seems natural to ask whether there is something to share, implementation-wise, so as to make that fact explicit. A {{HalfLine3D}} class? > Segment is not mathematically correct > - > > Key: GEOMETRY-92 > URL: https://issues.apache.org/jira/browse/GEOMETRY-92 > Project: Apache Commons Geometry > Issue Type: Improvement >Reporter: Matt Juntunen >Priority: Major > Labels: beta1 > Time Spent: 10m > Remaining Estimate: 0h > > The {{Segment}} class is not mathematically correct because line segments are > defined as having distinct start and end points, whereas the start and end > points in {{Segment}} are optional. In other words, an instance of > {{Segment}} can represent an entire line, a ray, or a segment. I propose > renaming the existing {{Segment}} class to {{ConvexSubLine}} and creating > subclasses to represent the distinct types of sublines. > * {{ConvexSubLine}} - Abstract convex subline class. The factory methods > (such as fromPoints()), would examine the inputs and return one of the > specific subclasses below. Each subclass would also contain its own factory > methods that apply input validation (eg, no null points when creating a > {{Segment}}). This would also allow each subclass to optimize some > computations based on the known characteristics of the represented entity. > ** {{FullLine}} - no start or end points > ** {{Segment}} - contains non-null start point and end point > ** {{Ray}} - contains non-null start point and null end point > ** {{ReverseRay}} - contains non-null end point and null start point (not > sure if there is a more mathematical term for this) > These changes would also apply to the 3D classes: > * {{ConvexSubLine3D}} > ** {{FullLine3D}} > ** {{Segment3D}} > ** {{Ray3D}} > ** {{ReverseRay3D}} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (GEOMETRY-95) CSG Examples
[ https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17087650#comment-17087650 ] Gilles Sadowski commented on GEOMETRY-95: - Thanks for taking care of that. :-) Also adding link to the related [icosphere|https://blender.stackexchange.com/questions/72/what-is-the-difference-between-a-uv-sphere-and-an-icosphere] feature request mentioned in that [ML thread|https://markmail.org/message/ahqklekbsxk7j4os]. bq. Example Beyond describing the above steps in code, it could also be the opportunity for another "story", that is explaining, from bottom up (unlike the Javadoc), which classes one can use in order to achieve a given task, and along the way, how each perhaps provides additional functionalities (and perhaps represent a more general concept) that hint at further uses (that don't have to be explained in the flow of that particular example). > CSG Examples > > > Key: GEOMETRY-95 > URL: https://issues.apache.org/jira/browse/GEOMETRY-95 > Project: Apache Commons Geometry > Issue Type: New Feature >Reporter: Matt Juntunen >Priority: Major > Labels: beta1 > > Adding Constructive Solid Geometry examples and userguide entries to help new > users to the library use these features. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (GEOMETRY-92) Segment is not mathematically correct
[ https://issues.apache.org/jira/browse/GEOMETRY-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17087637#comment-17087637 ] Matt Juntunen commented on GEOMETRY-92: --- bq. Span is a nested class and it does not follow the same naming scheme (not ending with "3D") We could make it a separate class if needed. One reason for its current "special" status as a nested class is that it does not include any additional information beyond what's already in the line, either mathematically or programmatically; there are no start or end points present. As for the name not ending in "3D", I did not feel it necessary to duplicate the "3D" from the outer class, ex: {{Line3D.Span3D}} seems redundant to me. bq. I'm still puzzled by the absence of reference to that concept wherever "ray" is mentioned Are you talking about in the mathematics literature? bq. It makes me wonder whether we couldn't get away with Ray3D only, e.g. if the abscissa would take on values in the interval (-inf, start] An abscissa value with that range would not be a ray since "start" is an end point and not a start point. It's possible we don't see this concept in the literature because mathematical lines do not always have a defined direction. In that sense, any construct with a single boundary point could be considered a ray; you simply view the line as extending in whatever direction would make the boundary point the "start". In our situation, we explicitly include a direction in the definition a line. This is necessary in order to provide consistent conversions back and forth between 1D and 2D space. Therefore, when we construct a half-line with a single boundary point, we don't have the luxury of re-defining the line direction to whatever is convenient. We need a way to define half-lines with only a start ({{Ray}}) and half-lines with only an end ({{ReverseRay}}). > Segment is not mathematically correct > - > > Key: GEOMETRY-92 > URL: https://issues.apache.org/jira/browse/GEOMETRY-92 > Project: Apache Commons Geometry > Issue Type: Improvement >Reporter: Matt Juntunen >Priority: Major > Labels: beta1 > Time Spent: 10m > Remaining Estimate: 0h > > The {{Segment}} class is not mathematically correct because line segments are > defined as having distinct start and end points, whereas the start and end > points in {{Segment}} are optional. In other words, an instance of > {{Segment}} can represent an entire line, a ray, or a segment. I propose > renaming the existing {{Segment}} class to {{ConvexSubLine}} and creating > subclasses to represent the distinct types of sublines. > * {{ConvexSubLine}} - Abstract convex subline class. The factory methods > (such as fromPoints()), would examine the inputs and return one of the > specific subclasses below. Each subclass would also contain its own factory > methods that apply input validation (eg, no null points when creating a > {{Segment}}). This would also allow each subclass to optimize some > computations based on the known characteristics of the represented entity. > ** {{FullLine}} - no start or end points > ** {{Segment}} - contains non-null start point and end point > ** {{Ray}} - contains non-null start point and null end point > ** {{ReverseRay}} - contains non-null end point and null start point (not > sure if there is a more mathematical term for this) > These changes would also apply to the 3D classes: > * {{ConvexSubLine3D}} > ** {{FullLine3D}} > ** {{Segment3D}} > ** {{Ray3D}} > ** {{ReverseRay3D}} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (GEOMETRY-94) ConvexSubPlane Subclasses
[ https://issues.apache.org/jira/browse/GEOMETRY-94?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17087628#comment-17087628 ] Matt Juntunen commented on GEOMETRY-94: --- bq. I'm not suggesting to change those names at this point Ok. bq. something like PlanarConvexSubset might have been more adequate That may be acceptable for the 3D case but it becomes a bit more difficult when determining names for other dimensions and spaces. For example, what do you call a subset of the points on a great circle in spherical 2D space? The "Sub[Hyperplane name]" format can be used consistently throughout the library. > ConvexSubPlane Subclasses > - > > Key: GEOMETRY-94 > URL: https://issues.apache.org/jira/browse/GEOMETRY-94 > Project: Apache Commons Geometry > Issue Type: New Feature >Reporter: Matt Juntunen >Priority: Major > Labels: beta1 > > There should be specific subclasses of {{ConvexSubPlane}} to allow for > optimization and ease of use. > - {{OpenConvexSubPlane}} - extends {{ConvexSubPlane}}; represents a convex > subplane that is open on a least one side and has infinite size > - {{ClosedConvexSubPlane}} - extends {{ConvexSubPlane}}; represents a convex > subplane with finite size; the 2D subspace is a polygon > - {{Triangle3D}} - extends {{ClosedConvexSubPlane}}; represents a triangle > in 3D space; most 3D models are or can easily be represented with triangles > so it would be good to have a dedicated class for this. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Closed] (GEOMETRY-76) Example code module
[ https://issues.apache.org/jira/browse/GEOMETRY-76?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matt Juntunen closed GEOMETRY-76. - > Example code module > --- > > Key: GEOMETRY-76 > URL: https://issues.apache.org/jira/browse/GEOMETRY-76 > Project: Apache Commons Geometry > Issue Type: Task >Reporter: Matt Juntunen >Priority: Minor > > Add a module for example code. This can contain example code for users as > well as beta-level functionality that is not yet ready for inclusion in the > main modules. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Resolved] (GEOMETRY-76) Example code module
[ https://issues.apache.org/jira/browse/GEOMETRY-76?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matt Juntunen resolved GEOMETRY-76. --- Resolution: Invalid > Example code module > --- > > Key: GEOMETRY-76 > URL: https://issues.apache.org/jira/browse/GEOMETRY-76 > Project: Apache Commons Geometry > Issue Type: Task >Reporter: Matt Juntunen >Priority: Minor > > Add a module for example code. This can contain example code for users as > well as beta-level functionality that is not yet ready for inclusion in the > main modules. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (GEOMETRY-76) Example code module
[ https://issues.apache.org/jira/browse/GEOMETRY-76?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17087621#comment-17087621 ] Matt Juntunen commented on GEOMETRY-76: --- This will be handled via GEOEMTRY-95. Closing this issue. > Example code module > --- > > Key: GEOMETRY-76 > URL: https://issues.apache.org/jira/browse/GEOMETRY-76 > Project: Apache Commons Geometry > Issue Type: Task >Reporter: Matt Juntunen >Priority: Minor > > Add a module for example code. This can contain example code for users as > well as beta-level functionality that is not yet ready for inclusion in the > main modules. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (GEOMETRY-94) ConvexSubPlane Subclasses
[ https://issues.apache.org/jira/browse/GEOMETRY-94?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matt Juntunen updated GEOMETRY-94: -- Labels: beta1 (was: ) > ConvexSubPlane Subclasses > - > > Key: GEOMETRY-94 > URL: https://issues.apache.org/jira/browse/GEOMETRY-94 > Project: Apache Commons Geometry > Issue Type: New Feature >Reporter: Matt Juntunen >Priority: Major > Labels: beta1 > > There should be specific subclasses of {{ConvexSubPlane}} to allow for > optimization and ease of use. > - {{OpenConvexSubPlane}} - extends {{ConvexSubPlane}}; represents a convex > subplane that is open on a least one side and has infinite size > - {{ClosedConvexSubPlane}} - extends {{ConvexSubPlane}}; represents a convex > subplane with finite size; the 2D subspace is a polygon > - {{Triangle3D}} - extends {{ClosedConvexSubPlane}}; represents a triangle > in 3D space; most 3D models are or can easily be represented with triangles > so it would be good to have a dedicated class for this. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (GEOMETRY-95) CSG Examples
[ https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matt Juntunen updated GEOMETRY-95: -- Labels: beta1 (was: ) > CSG Examples > > > Key: GEOMETRY-95 > URL: https://issues.apache.org/jira/browse/GEOMETRY-95 > Project: Apache Commons Geometry > Issue Type: New Feature >Reporter: Matt Juntunen >Priority: Major > Labels: beta1 > > Adding Constructive Solid Geometry examples and userguide entries to help new > users to the library use these features. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (GEOMETRY-92) Segment is not mathematically correct
[ https://issues.apache.org/jira/browse/GEOMETRY-92?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matt Juntunen updated GEOMETRY-92: -- Labels: beta1 (was: ) > Segment is not mathematically correct > - > > Key: GEOMETRY-92 > URL: https://issues.apache.org/jira/browse/GEOMETRY-92 > Project: Apache Commons Geometry > Issue Type: Improvement >Reporter: Matt Juntunen >Priority: Major > Labels: beta1 > Time Spent: 10m > Remaining Estimate: 0h > > The {{Segment}} class is not mathematically correct because line segments are > defined as having distinct start and end points, whereas the start and end > points in {{Segment}} are optional. In other words, an instance of > {{Segment}} can represent an entire line, a ray, or a segment. I propose > renaming the existing {{Segment}} class to {{ConvexSubLine}} and creating > subclasses to represent the distinct types of sublines. > * {{ConvexSubLine}} - Abstract convex subline class. The factory methods > (such as fromPoints()), would examine the inputs and return one of the > specific subclasses below. Each subclass would also contain its own factory > methods that apply input validation (eg, no null points when creating a > {{Segment}}). This would also allow each subclass to optimize some > computations based on the known characteristics of the represented entity. > ** {{FullLine}} - no start or end points > ** {{Segment}} - contains non-null start point and end point > ** {{Ray}} - contains non-null start point and null end point > ** {{ReverseRay}} - contains non-null end point and null start point (not > sure if there is a more mathematical term for this) > These changes would also apply to the 3D classes: > * {{ConvexSubLine3D}} > ** {{FullLine3D}} > ** {{Segment3D}} > ** {{Ray3D}} > ** {{ReverseRay3D}} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (GEOMETRY-93) Better SubHyperplane Hierarchies
[ https://issues.apache.org/jira/browse/GEOMETRY-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matt Juntunen updated GEOMETRY-93: -- Labels: beta1 (was: ) > Better SubHyperplane Hierarchies > > > Key: GEOMETRY-93 > URL: https://issues.apache.org/jira/browse/GEOMETRY-93 > Project: Apache Commons Geometry > Issue Type: Improvement >Reporter: Matt Juntunen >Priority: Major > Labels: beta1 > > The current subhyperplane classes follow an awkward inheritance hierarchy > pattern for Euclidean 2D and 3D and spherical 2D. Each space has a > package-private base subhyperplane class (containing public methods), which > is extended by a public subhyperplane implementation class and a convex > subhyperplane implementation class. For example, in Euclidean 2D we have: > - {{AbstractSubLine}} - package-private base class containing public methods > such as {{getLine}} and {{getIntersection}} > - {{SubLine}} - extends {{AbstractSubLine}}; uses a {{RegionBSPTree1D}} to > represent arbitrary subsets of the line > - {{ConvexSubLine}} - extends {{AbstractSubLine}} > Not only is it awkward that public API methods are defined in a > package-private class, but the hierarchy does not make sense from a naming > point of view. For example, {{ConvexSubLine}} is a "subline" geometrically > but is not a {{SubLine}} from the class perspective. A better naming scheme > would be > - {{SubLine}} - public class; previously named {{AbstractSubLine}} > - {{RegionBSPTreeSubLine}} - extends {{SubLine}}; previously named > {{SubLine}} but now with a name that better describes its functionality and > implementation > - {{ConvexSubLine}} - extends {{SubLine}} > Similar changes should be made in Euclidean 3D and spherical 2D. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (GEOMETRY-50) Overflow in Vector norm and distance
[ https://issues.apache.org/jira/browse/GEOMETRY-50?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matt Juntunen updated GEOMETRY-50: -- Labels: beta1 (was: ) > Overflow in Vector norm and distance > > > Key: GEOMETRY-50 > URL: https://issues.apache.org/jira/browse/GEOMETRY-50 > Project: Apache Commons Geometry > Issue Type: Bug >Reporter: Baljit Singh >Priority: Major > Labels: beta1 > > In Euclidean Vector classes (Vector2D, Vector3D), norm() and distance() rely > on Math.sqrt(), which can overflow if the components of the vectors are > large. Instead, they should rely on SafeNorm. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (GEOMETRY-95) CSG Examples
[ https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17087617#comment-17087617 ] Matt Juntunen commented on GEOMETRY-95: --- Example requested by [~erans] (on the dev mailing list): - create a sphere (icosphere if possible), - access its mesh ("Triangle3D" ?), - apply a transform (possibly non-affine) to the set of vertices, - recreate a BSP tree representation of the resulting mesh (?), - do the above for a second shape, - compute the set of visible elements from some vantage point. > CSG Examples > > > Key: GEOMETRY-95 > URL: https://issues.apache.org/jira/browse/GEOMETRY-95 > Project: Apache Commons Geometry > Issue Type: New Feature >Reporter: Matt Juntunen >Priority: Major > > Adding Constructive Solid Geometry examples and userguide entries to help new > users to the library use these features. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Created] (GEOMETRY-95) CSG Examples
Matt Juntunen created GEOMETRY-95: - Summary: CSG Examples Key: GEOMETRY-95 URL: https://issues.apache.org/jira/browse/GEOMETRY-95 Project: Apache Commons Geometry Issue Type: New Feature Reporter: Matt Juntunen Adding Constructive Solid Geometry examples and userguide entries to help new users to the library use these features. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-lang] Isira-Seneviratne opened a new pull request #523: Simplify the finding of matching Locales in LocaleUtils using the Streams API.
Isira-Seneviratne opened a new pull request #523: URL: https://github.com/apache/commons-lang/pull/523 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-247) crash on reading tiff image
[ https://issues.apache.org/jira/browse/IMAGING-247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17087522#comment-17087522 ] Robin Morier commented on IMAGING-247: -- Gary, Thanks for looking into this. The .png you've attached is indeed what it should look like. > crash on reading tiff image > --- > > Key: IMAGING-247 > URL: https://issues.apache.org/jira/browse/IMAGING-247 > Project: Commons Imaging > Issue Type: Bug > Components: Format: TIFF >Affects Versions: 1.0-alpha1 >Reporter: Robin Morier >Priority: Major > Attachments: IMAGING-247.png, neutre.TIFF > > > I get an index out of bounds exception trying to load the attached image. > {noformat} > java.lang.ArrayIndexOutOfBoundsException: Index 255 out of bounds for length 2 > at > org.apache.commons.imaging.formats.tiff.photometricinterpreters.PhotometricInterpreterPalette.interpretPixel(PhotometricInterpreterPalette.java:53) > at > org.apache.commons.imaging.formats.tiff.datareaders.DataReaderStrips.interpretStrip(DataReaderStrips.java:179) > at > org.apache.commons.imaging.formats.tiff.datareaders.DataReaderStrips.readImageData(DataReaderStrips.java:212) > at > org.apache.commons.imaging.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:659) > at > org.apache.commons.imaging.formats.tiff.TiffDirectory.getTiffImage(TiffDirectory.java:163) > at > org.apache.commons.imaging.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:469) > at > org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1442) > at > org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1404){noformat} > > I'm calling getBufferedImage without any parameters. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (COMPRESS-510) Multiple retrievals of InputStream for same SevenZFile entry fails
[ https://issues.apache.org/jira/browse/COMPRESS-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17087411#comment-17087411 ] Robin Schimpf commented on COMPRESS-510: Sorry to come back at this issue. The testcase I provided works now fine but my application testcase now fails with a different exception. I generate a 7z file with commons-compress and then try to read the content multiple times. So this error seems to be archive dependent. Some reduced sample code to recreate the error {code:java} @Test public void retrieveInputStreamForAllEntriesMultipleTimes() throws IOException { try (final SevenZOutputFile out = new SevenZOutputFile(new File(dir, "test.7z"))) { final Path inputFile = Files.createTempFile("SevenZTestTemp", ""); SevenZArchiveEntry entry = out.createArchiveEntry(inputFile.toFile(), "test.txt"); out.putArchiveEntry(entry); out.write("Test".getBytes(StandardCharsets.UTF_8)); out.closeArchiveEntry(); Files.deleteIfExists(inputFile); } try (SevenZFile sevenZFile = new SevenZFile(new File(dir, "test.7z"))) { for (SevenZArchiveEntry entry : sevenZFile.getEntries()) { byte[] firstRead = IOUtils.toByteArray(sevenZFile.getInputStream(entry)); byte[] secondRead = IOUtils.toByteArray(sevenZFile.getInputStream(entry)); assertArrayEquals(firstRead, secondRead); } } } {code} This fails now with the following exception on Java 8 {code} java.lang.ClassCastException: org.apache.commons.compress.utils.BoundedInputStream cannot be cast to org.apache.commons.compress.utils.CRC32VerifyingInputStream at org.apache.commons.compress.archivers.sevenz.SevenZFile.skipEntriesWhenNeeded(SevenZFile.java:1278) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(SevenZFile.java:1204) at org.apache.commons.compress.archivers.sevenz.SevenZFile.getInputStream(SevenZFile.java:1437) at org.apache.commons.compress.archivers.sevenz.SevenZFileTest.retrieveInputStreamForAllEntriesMultipleTimes(SevenZFileTest.java:712) {code} And with the following exception on Java 11 {code} java.lang.ClassCastException: class org.apache.commons.compress.utils.BoundedInputStream cannot be cast to class org.apache.commons.compress.utils.CRC32VerifyingInputStream (org.apache.commons.compress.utils.BoundedInputStream and org.apache.commons.compress.utils.CRC32VerifyingInputStream are in unnamed module of loader 'app') at org.apache.commons.compress.archivers.sevenz.SevenZFile.skipEntriesWhenNeeded(SevenZFile.java:1278) at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(SevenZFile.java:1204) at org.apache.commons.compress.archivers.sevenz.SevenZFile.getInputStream(SevenZFile.java:1437) at org.apache.commons.compress.archivers.sevenz.SevenZFileTest.retrieveInputStreamForAllEntriesMultipleTimes(SevenZFileTest.java:712) {code} > Multiple retrievals of InputStream for same SevenZFile entry fails > -- > > Key: COMPRESS-510 > URL: https://issues.apache.org/jira/browse/COMPRESS-510 > Project: Commons Compress > Issue Type: Bug >Affects Versions: 1.20 >Reporter: Robin Schimpf >Priority: Major > > I was trying out the new random access for the 7z files and have one of our > tests failing where we are trying to read the same entry multiple times > without closing the archive. > Reproducing test case (I added this locally to the SevenZFileTest class) > {code:java} > @Test > public void retrieveInputStreamForEntryMultipleTimes() throws IOException { > try (SevenZFile sevenZFile = new SevenZFile(getFile("bla.7z"))) { > for (SevenZArchiveEntry entry : sevenZFile.getEntries()) { > byte[] firstRead = > IOUtils.toByteArray(sevenZFile.getInputStream(entry)); > byte[] secondRead = > IOUtils.toByteArray(sevenZFile.getInputStream(entry)); > assertArrayEquals(firstRead, secondRead); > } > } > } > {code} > The Exception thrown is > {code:java} > java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 2 > at > org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(SevenZFile.java:1183) > at > org.apache.commons.compress.archivers.sevenz.SevenZFile.getInputStream(SevenZFile.java:1436) > at > org.apache.commons.compress.archivers.sevenz.SevenZFileTest.retrieveInputStreamForEntryMultipleTimes(SevenZFileTest.java:688) > ... > {code} > A similar test case for e.g. zip works fine > {code:java} > @Test > public void retrieveInputStreamForEntryMultipleTimes() throws IOException { > try (ZipFile zipFile = new ZipFile(getFile("bla.zip"))) { > Enumeration entry =