[GitHub] [commons-io] code-ferry commented on pull request #327: Fix incollect value in field currentBufferIndex when creating new buffer first time.
code-ferry commented on pull request #327: URL: https://github.com/apache/commons-io/pull/327#issuecomment-1041191843 @garydgregory I had privided a test that fails without the change to the main tree. But some checks were not successful because the unit test of FileUtilsWaitForTest.testWaitForInterrupted may fail randomly. It's not my problem. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-functor] dependabot[bot] opened a new pull request #22: Bump maven-pmd-plugin from 3.15.0 to 3.16.0
dependabot[bot] opened a new pull request #22: URL: https://github.com/apache/commons-functor/pull/22 Bumps [maven-pmd-plugin](https://github.com/apache/maven-pmd-plugin) from 3.15.0 to 3.16.0. Release notes Sourced from https://github.com/apache/maven-pmd-plugin/releases;>maven-pmd-plugin's releases. 3.16.0 Bug Fixes https://issues.apache.org/jira/browse/MPMD-325;>[MPMD-325] Could not find class due to IncompatibleClassChangeError warning https://issues.apache.org/jira/browse/MPMD-324;>[MPMD-324] Ruleset URLs have hyphen replaced with forwardslash https://issues.apache.org/jira/browse/MPMD-323;>[MPMD-323] ResourceManager should use project base dir instead of pom location Build https://issues.apache.org/jira/browse/MPMD-328;>[MPMD-328] Shared GitHub Actions New features and improvements https://issues.apache.org/jira/browse/MPMD-327;>[MPMD-327] Upgrade to PMD 6.42.0 Dependency updates https://issues.apache.org/jira/browse/MPMD-326;>[MPMD-326] Set Maven 3.1.1 as minimum version Commits https://github.com/apache/maven-pmd-plugin/commit/b8a794e37e4cb3bb986ce044f3ef8df0dd392ed1;>b8a794e [maven-release-plugin] prepare release maven-pmd-plugin-3.16.0 https://github.com/apache/maven-pmd-plugin/commit/6fc39ec2428a9fd68319da39f89d2191ac3ad25b;>6fc39ec [MPMD-323] ResourceManager should use project base dir instead of pom https://github.com/apache/maven-pmd-plugin/commit/4eae72c6c6f394c0c65fc4994eead9d06a6544f2;>4eae72c [MPMD-324] Ruleset URLs have hyphen replaced with forwardslash https://github.com/apache/maven-pmd-plugin/commit/64e35f73c27107c192b33b856f549fa66953b305;>64e35f7 Make maven core provided scope https://github.com/apache/maven-pmd-plugin/commit/1dd8d0007fcf5d48571b9483bd3865a57d8e5383;>1dd8d00 [MPMD-327] Upgrade to PMD 6.42.0 https://github.com/apache/maven-pmd-plugin/commit/fae45251df926bb2e91ac14914b374c5f0ed28ed;>fae4525 [MPMD-327] Upgrade to PMD 6.41.0 https://github.com/apache/maven-pmd-plugin/commit/80e8aabe537063ddb64887c4dc18ca6c91be19e8;>80e8aab (doc) Update README.md https://github.com/apache/maven-pmd-plugin/commit/3fffd9cc7c0bea9ddd8489c9a7b4fee264d2d2c0;>3fffd9c [MPMD-328] Shared Github Actions (https://github-redirect.dependabot.com/apache/maven-pmd-plugin/issues/48;>#48) https://github.com/apache/maven-pmd-plugin/commit/2175d5e3936d0f4718da6f890a442cfc60cd617e;>2175d5e [MPMD-327] Upgrade to PMD 6.40.0 https://github.com/apache/maven-pmd-plugin/commit/b8ac1fbc41b2b7e69bb6d8c0a336119e8fdd2d26;>b8ac1fb [MPMD-327] Upgrade to PMD 6.39.0 Additional commits viewable in https://github.com/apache/maven-pmd-plugin/compare/maven-pmd-plugin-3.15.0...maven-pmd-plugin-3.16.0;>compare view [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=org.apache.maven.plugins:maven-pmd-plugin=maven=3.15.0=3.16.0)](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. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-codec] garydgregory edited a comment on pull request #64: Add form feed and vertical tab whitespace to isWhiteSpace()
garydgregory edited a comment on pull request #64: URL: https://github.com/apache/commons-codec/pull/64#issuecomment-1040311595 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] garydgregory commented on pull request #770: Removed use of restricted identifier
garydgregory commented on pull request #770: URL: https://github.com/apache/commons-lang/pull/770#issuecomment-1040652309 Closing: No action/feedback from OP since the last query. The build is green on GitHub for Java 17 anyway. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-io] garydgregory closed pull request #277: Refactoring
garydgregory closed pull request #277: URL: https://github.com/apache/commons-io/pull/277 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] garydgregory closed pull request #789: Improve Travis CI build Performance
garydgregory closed pull request #789: URL: https://github.com/apache/commons-lang/pull/789 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] garydgregory commented on pull request #845: Fix a flaky test in org.apache.commons.lang3.time.StopWatchTest.testStopWatchSuspend
garydgregory commented on pull request #845: URL: https://github.com/apache/commons-lang/pull/845#issuecomment-1040471464 -1: This does not fix anything, it merely hides the problem, the test should be made more robust IMO. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] garydgregory closed pull request #770: Removed use of restricted identifier
garydgregory closed pull request #770: URL: https://github.com/apache/commons-lang/pull/770 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] garydgregory commented on pull request #789: Improve Travis CI build Performance
garydgregory commented on pull request #789: URL: https://github.com/apache/commons-lang/pull/789#issuecomment-1040472939 Closing: We no longer support Travis CI. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-codec] garydgregory commented on pull request #64: Add form feed and vertical tab whitespace to isWhiteSpace()
garydgregory commented on pull request #64: URL: https://github.com/apache/commons-codec/pull/64#issuecomment-1040311595 Ping. Also how does this square with the RFCs for Base64, Base32, and Base16? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] garydgregory commented on pull request #850: improve DateUtils by adding calenda.month in comparison in considerin…
garydgregory commented on pull request #850: URL: https://github.com/apache/commons-lang/pull/850#issuecomment-1040469851 Ping? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-io] garydgregory commented on pull request #277: Refactoring
garydgregory commented on pull request #277: URL: https://github.com/apache/commons-io/pull/277#issuecomment-1040384803 Closing, no feedback from OP. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Work logged] (CSV-288) String delimiter (||) is not working as expected.
[ https://issues.apache.org/jira/browse/CSV-288?focusedWorklogId=727617=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-727617 ] ASF GitHub Bot logged work on CSV-288: -- Author: ASF GitHub Bot Created on: 15/Feb/22 19:05 Start Date: 15/Feb/22 19:05 Worklog Time Spent: 10m Work Description: angusdev opened a new pull request #216: URL: https://github.com/apache/commons-csv/pull/216 Jira Issue: https://issues.apache.org/jira/browse/CSV-288 When checking if last token is delimiter in below line of code ```java // did we reach eof during the last iteration already ? EOF if (isEndOfFile(lastChar) || !isDelimiter(lastChar) && isEndOfFile(c)) { ``` `isDelimiter(lastChar)` unintentionally advance the buffer pointer and consume the first `"|"` when it comes to the `"b"` in `"a||b||c"` (lastChar is `"|"`, nextChar is also `"|"`, make it `"||"`). Subsequent read will see `"|c"` instead of `"||c"` so the second token is `"b|c"` To fix it, create a new indicator `isLastTokenDelimiter` instead of using `isDelimiter(lastChar)`, the indicator is set/reset in `isDelimiter()` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 727617) Time Spent: 20m (was: 10m) > String delimiter (||) is not working as expected. > - > > Key: CSV-288 > URL: https://issues.apache.org/jira/browse/CSV-288 > Project: Commons CSV > Issue Type: Bug >Reporter: Santhsoh >Priority: Major > Time Spent: 20m > Remaining Estimate: 0h > > Steps to reproduce : > 1. Parse CSV file with || as delimiter and having empty columns > 2. Print the CSVRecord resulting from CSVParser > > //Expected : a,b,c,d,,f,g > // Actual : a,b|c,d,|f,g > public static void main(String[] args) throws Exception\{ > String row = "a||b||c||df||g"; > StringBuilder stringBuilder = new StringBuilder(); > try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, > CSVFormat.EXCEL); > CSVParser csvParser = CSVParser.parse(new StringInputStream(row), > StandardCharsets.UTF_8, > CSVFormat.Builder.create().setDelimiter("||").build())) { > for (CSVRecord csvRecord : csvParser) { > for (int i = 0; i < csvRecord.size(); i++) { > csvPrinter.print(csvRecord.get(i)); > } > System.out.println(stringBuilder.toString()); > //Expected : a,b,c,d,,f,g > // Actual : a,b|c,d,|f,g > } > } > } > With the snippet provided above, actual value is not same as expected value -- This message was sent by Atlassian Jira (v8.20.1#820001)
[GitHub] [commons-io] garydgregory commented on pull request #327: Fix incollect value in field currentBufferIndex when creating new buffer first time.
garydgregory commented on pull request #327: URL: https://github.com/apache/commons-io/pull/327#issuecomment-1040382861 Hi @code-ferry Thank you for your PR. This change needs a test that fails without the change to the main tree; otherwise, a future change can regress this 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. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-io] garydgregory edited a comment on pull request #327: Fix incollect value in field currentBufferIndex when creating new buffer first time.
garydgregory edited a comment on pull request #327: URL: https://github.com/apache/commons-io/pull/327#issuecomment-1040382861 Hi @code-ferry Thank you for your PR. This PR needs a test that fails without the change to the main tree; otherwise, a future change can regress this 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. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-compress] garydgregory commented on pull request #242: bzip2: calculate median-of-3 on unsigned values
garydgregory commented on pull request #242: URL: https://github.com/apache/commons-compress/pull/242#issuecomment-1039250469 @kinow , any thoughts here? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Work logged] (COMPRESS-514) SevenZFile fails with encoded header over 2GiB
[ https://issues.apache.org/jira/browse/COMPRESS-514?focusedWorklogId=727535=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-727535 ] ASF GitHub Bot logged work on COMPRESS-514: --- Author: ASF GitHub Bot Created on: 15/Feb/22 18:59 Start Date: 15/Feb/22 18:59 Worklog Time Spent: 10m Work Description: garydgregory commented on a change in pull request #98: URL: https://github.com/apache/commons-compress/pull/98#discussion_r805984987 ## File path: src/main/java/org/apache/commons/compress/archivers/sevenz/HeaderChannelBuffer.java ## @@ -0,0 +1,174 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.commons.compress.archivers.sevenz; + +import org.apache.commons.compress.utils.IOUtils; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.BufferUnderflowException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.channels.Channels; +import java.nio.channels.ReadableByteChannel; +import java.util.zip.CRC32; + +/** + * Enables little-endian primitive type reads from a {@link ReadableByteChannel} + * or {@link InputStream}, internally using a paged-in {@link ByteBuffer}. + * + * Access is serial only but does allow a + * virtual buffer capacity of {@code Long.MAX_VALUE}. + * If the requested capacity is within the maximum page size (default 16MiB) + * the buffer will be fully read and held in a {@link HeaderInMemoryBuffer}. + * + * @NotThreadSafe + * @since 1.21 + */ +class HeaderChannelBuffer implements HeaderBuffer { +private static final int DEFAULT_PAGE_MAX = 16_777_216; +// This must match the largest get (currently getLong) +private static final int MAX_GET_ELEMENT_SIZE = 8; +private final ReadableByteChannel channel; +private final ByteBuffer buffer; +private long remaining; + +private HeaderChannelBuffer(final ReadableByteChannel channel, final long capacity, final int maxPageBytes) { +this.channel = channel; +int limit = (int) Math.min(maxPageBytes, capacity); +this.buffer = ByteBuffer.allocate(limit).order(ByteOrder.LITTLE_ENDIAN); +this.remaining = capacity; +} + +public static HeaderBuffer create(final ReadableByteChannel channel, final long capacity, final int maxPageBytes) +throws IOException { +if (maxPageBytes < MAX_GET_ELEMENT_SIZE) { +throw new IllegalArgumentException("Page size must be at least " + MAX_GET_ELEMENT_SIZE); +} +if (capacity <= maxPageBytes) { +ByteBuffer buf = ByteBuffer.allocate((int) capacity).order(ByteOrder.LITTLE_ENDIAN); +IOUtils.readFully(channel, buf); +buf.flip(); +return new HeaderInMemoryBuffer(buf); +} +HeaderChannelBuffer channelBuffer = new HeaderChannelBuffer(channel, capacity, maxPageBytes); +channelBuffer.fill(); +return channelBuffer; +} + +public static HeaderBuffer create(final ReadableByteChannel channel, final long capacity) throws IOException { +return HeaderChannelBuffer.create(channel, capacity, DEFAULT_PAGE_MAX); +} + +public static HeaderBuffer create(final InputStream inputStream, final long capacity, final int maxPageBytes) +throws IOException { +return create(Channels.newChannel(inputStream), capacity, maxPageBytes); +} + +public static HeaderBuffer create(final InputStream inputStream, final long capacity) throws IOException { +return create(Channels.newChannel(inputStream), capacity, DEFAULT_PAGE_MAX); +} + +@Override +public boolean hasCRC() { +return false; +} + +@Override +public CRC32 getCRC() throws IOException { +throw new IOException("CRC is not implemented for this header type"); +} + +@Override +public void get(byte[] dst) throws IOException { +int remainingBytes = dst.length; +do { +int length = Math.min(buffer.remaining(), remainingBytes); +buffer.get(dst, dst.length - remainingBytes, length); +
[GitHub] [commons-compress] garydgregory commented on a change in pull request #98: COMPRESS-514: SevenZFile header buffers over 2G
garydgregory commented on a change in pull request #98: URL: https://github.com/apache/commons-compress/pull/98#discussion_r805984987 ## File path: src/main/java/org/apache/commons/compress/archivers/sevenz/HeaderChannelBuffer.java ## @@ -0,0 +1,174 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.commons.compress.archivers.sevenz; + +import org.apache.commons.compress.utils.IOUtils; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.BufferUnderflowException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.channels.Channels; +import java.nio.channels.ReadableByteChannel; +import java.util.zip.CRC32; + +/** + * Enables little-endian primitive type reads from a {@link ReadableByteChannel} + * or {@link InputStream}, internally using a paged-in {@link ByteBuffer}. + * + * Access is serial only but does allow a + * virtual buffer capacity of {@code Long.MAX_VALUE}. + * If the requested capacity is within the maximum page size (default 16MiB) + * the buffer will be fully read and held in a {@link HeaderInMemoryBuffer}. + * + * @NotThreadSafe + * @since 1.21 + */ +class HeaderChannelBuffer implements HeaderBuffer { +private static final int DEFAULT_PAGE_MAX = 16_777_216; +// This must match the largest get (currently getLong) +private static final int MAX_GET_ELEMENT_SIZE = 8; +private final ReadableByteChannel channel; +private final ByteBuffer buffer; +private long remaining; + +private HeaderChannelBuffer(final ReadableByteChannel channel, final long capacity, final int maxPageBytes) { +this.channel = channel; +int limit = (int) Math.min(maxPageBytes, capacity); +this.buffer = ByteBuffer.allocate(limit).order(ByteOrder.LITTLE_ENDIAN); +this.remaining = capacity; +} + +public static HeaderBuffer create(final ReadableByteChannel channel, final long capacity, final int maxPageBytes) +throws IOException { +if (maxPageBytes < MAX_GET_ELEMENT_SIZE) { +throw new IllegalArgumentException("Page size must be at least " + MAX_GET_ELEMENT_SIZE); +} +if (capacity <= maxPageBytes) { +ByteBuffer buf = ByteBuffer.allocate((int) capacity).order(ByteOrder.LITTLE_ENDIAN); +IOUtils.readFully(channel, buf); +buf.flip(); +return new HeaderInMemoryBuffer(buf); +} +HeaderChannelBuffer channelBuffer = new HeaderChannelBuffer(channel, capacity, maxPageBytes); +channelBuffer.fill(); +return channelBuffer; +} + +public static HeaderBuffer create(final ReadableByteChannel channel, final long capacity) throws IOException { +return HeaderChannelBuffer.create(channel, capacity, DEFAULT_PAGE_MAX); +} + +public static HeaderBuffer create(final InputStream inputStream, final long capacity, final int maxPageBytes) +throws IOException { +return create(Channels.newChannel(inputStream), capacity, maxPageBytes); +} + +public static HeaderBuffer create(final InputStream inputStream, final long capacity) throws IOException { +return create(Channels.newChannel(inputStream), capacity, DEFAULT_PAGE_MAX); +} + +@Override +public boolean hasCRC() { +return false; +} + +@Override +public CRC32 getCRC() throws IOException { +throw new IOException("CRC is not implemented for this header type"); +} + +@Override +public void get(byte[] dst) throws IOException { +int remainingBytes = dst.length; +do { +int length = Math.min(buffer.remaining(), remainingBytes); +buffer.get(dst, dst.length - remainingBytes, length); +remainingBytes -= length; +} while (refilled(remainingBytes)); +} + +private boolean refilled(final int remainingBytes) throws IOException { +if (remainingBytes <= 0) { +return false; + } Review comment: Fix formatting please. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL
[GitHub] [commons-compress] garydgregory commented on a change in pull request #247: Use Math.min and Math.max calculations.
garydgregory commented on a change in pull request #247: URL: https://github.com/apache/commons-compress/pull/247#discussion_r806121231 ## File path: src/main/java/org/apache/commons/compress/harmony/pack200/BHSDCodec.java ## @@ -308,11 +308,8 @@ public boolean encodes(final long value) { } } else if (z < 0) { // Need to use integer overflow here to represent negatives. -if (cardinality < 4294967296L) { -z += cardinality; -} else { -z += 4294967296L; // this value is equal to (1 << 32). -} +// this value is equal to (1 << 32). Review comment: I think you'd want to use jshell here, not python... -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-codec] garydgregory commented on a change in pull request #78: Validate byte and string
garydgregory commented on a change in pull request #78: URL: https://github.com/apache/commons-codec/pull/78#discussion_r806300692 ## File path: src/main/java/org/apache/commons/codec/binary/StringUtils.java ## @@ -269,6 +269,25 @@ public static ByteBuffer getByteBufferUtf8(final String string) { return getBytes(string, StandardCharsets.UTF_8); } +/** + * Checks if a CharSequence is empty ("") or null. + * + * + * StringUtils.isEmpty(null) = true + * StringUtils.isEmpty("")= true + * StringUtils.isEmpty(" ") = false + * StringUtils.isEmpty("bob") = false + * StringUtils.isEmpty(" bob ") = false + * + * + * @param cs the CharSequence to check, may be null + * @return {@code true} if the CharSequence is empty or null + * @since 1.16 + */ +public static boolean isEmpty(final CharSequence cs) { Review comment: Make this package-private and move it somewhere in the language package since it is the only place where it seems to be called, which will help as noted in my other comment. ## File path: src/main/java/org/apache/commons/codec/binary/BinaryCodec.java ## @@ -136,8 +136,10 @@ * @param array *the source array * @return {@code true} if the given array is {@code null} or empty (size 0.) + * + * @since 1.16 change visibility to public */ -private static boolean isEmpty(final byte[] array) { +public static boolean isEmpty(final byte[] array) { Review comment: Hello @arturobernalg Please make this package private instead of public, this helps minimize the API footprint we will need to maintain for BC, especially since this is just for internal use. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-codec] garydgregory merged pull request #39: CODEC-285 upgrade to JUnit v5.6.0
garydgregory merged pull request #39: URL: https://github.com/apache/commons-codec/pull/39 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-collections] aherbert commented on a change in pull request #258: Simplify bloom filters
aherbert commented on a change in pull request #258: URL: https://github.com/apache/commons-collections/pull/258#discussion_r806265481 ## File path: src/main/java/org/apache/commons/collections4/bloomfilter/SparseBloomFilter.java ## @@ -0,0 +1,256 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.collections4.bloomfilter; + +import java.util.Objects; +import java.util.TreeSet; +import java.util.function.IntPredicate; +import java.util.function.LongPredicate; + +/** + * A bloom filter using a TreeSet of integers to track enabled bits. This is a standard + * implementation and should work well for most low cardinality Bloom filters. + * @since 4.5 + */ +public class SparseBloomFilter implements BloomFilter { + +/** + * The bitSet that defines this BloomFilter. + */ +private final TreeSet indices; + +/** + * The shape of this BloomFilter. + */ +private final Shape shape; + +/** + * Constructs an empty BitSetBloomFilter. + * + * @param shape The shape of the filter. + */ +public SparseBloomFilter(Shape shape) { +Objects.requireNonNull(shape, "shape"); +this.shape = shape; +this.indices = new TreeSet<>(); +} + +/** + * Creates an instance that is equivalent to {@code other}. + * + * @param other The bloom filter to copy. + */ +public SparseBloomFilter(BloomFilter other) { +Objects.requireNonNull(other, "other"); +this.shape = other.getShape(); +this.indices = new TreeSet<>(); +if (other.isSparse()) { +mergeInPlace((IndexProducer) other); +} else { +mergeInPlace(IndexProducer.fromBitMapProducer(other)); +} +} + +private void checkIndices(Shape shape) { +if (this.indices.floor(-1) != null || this.indices.ceiling(shape.getNumberOfBits()) != null) { +throw new IllegalArgumentException( +String.format("Filter only accepts values in the [0,%d) range", shape.getNumberOfBits())); +} +} + +/** + * Constructs a populated Bloom filter. + * @param shape the shape for the bloom filter. + * @param hasher the hasher to provide the initial data. + */ +public SparseBloomFilter(final Shape shape, Hasher hasher) { +this(shape); +Objects.requireNonNull(hasher, "hasher"); +hasher.indices(shape).forEachIndex(this::add); +checkIndices(shape); +} + +/** + * Constructs a populated Bloom filter. + * @param shape the shape of the filter. + * @param indices an index producer for the indices to to enable. + * @throws IllegalArgumentException if indices contains a value greater than the number + * of bits in the shape. + */ +public SparseBloomFilter(Shape shape, IndexProducer indices) { +this(shape); +Objects.requireNonNull(indices, "indices"); +indices.forEachIndex(this::add); +checkIndices(shape); +} + +/** + * Constructs a populated Bloom filter. + * @param shape the shape of the filter. + * @param bitMaps a BitMapProducer for the bit maps to add. + * @throws IllegalArgumentException if the bit maps contain a value greater than the number + * of bits in the shape. + */ +public SparseBloomFilter(Shape shape, BitMapProducer bitMaps) { +this(shape); +Objects.requireNonNull(bitMaps, "bitMaps"); +mergeInPlace(IndexProducer +.fromBitMapProducer(new CheckBitMapCount(bitMaps, BitMap.numberOfBitMaps(shape.getNumberOfBits(); +} + +@Override +public long[] asBitMapArray() { +long[] result = new long[BitMap.numberOfBitMaps(shape.getNumberOfBits())]; +LongPredicate filler = new LongPredicate() { +int idx = 0; + +@Override +public boolean test(long value) { +result[idx++] = value; +return true; +} +}; +forEachBitMap(filler); +return result; +} + +@Override +public SparseBloomFilter copy() { +SparseBloomFilter result = new SparseBloomFilter(shape); +
[GitHub] [commons-text] garydgregory commented on pull request #298: Make more clear passing null value.
garydgregory commented on pull request #298: URL: https://github.com/apache/commons-text/pull/298#issuecomment-1039576597 For me, this just clutter's up the code. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-beanutils] JKLedzion commented on pull request #106: BEANUTILS-550: correction of returning default value by StringConverter
JKLedzion commented on pull request #106: URL: https://github.com/apache/commons-beanutils/pull/106#issuecomment-1039928021 > @JKLedzion Thank you for the PR. Don't use Javadoc comments for comments that are not Javadoc. Inline comments would be more appropriate. Corrected. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-codec] garydgregory commented on pull request #92: Avoid inefficient usage of arraylist
garydgregory commented on pull request #92: URL: https://github.com/apache/commons-codec/pull/92#issuecomment-1039581068 Closing, no reply from OP. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-compress] kinow commented on a change in pull request #247: Use Math.min and Math.max calculations.
kinow commented on a change in pull request #247: URL: https://github.com/apache/commons-compress/pull/247#discussion_r806110136 ## File path: src/main/java/org/apache/commons/compress/harmony/pack200/BHSDCodec.java ## @@ -308,11 +308,8 @@ public boolean encodes(final long value) { } } else if (z < 0) { // Need to use integer overflow here to represent negatives. -if (cardinality < 4294967296L) { -z += cardinality; -} else { -z += 4294967296L; // this value is equal to (1 << 32). -} +// this value is equal to (1 << 32). Review comment: Wrong comment, I think. `1 << 32` is `4294967296L`. ![image](https://user-images.githubusercontent.com/304786/153921096-1dfa799e-b6ce-4bad-aa39-54d7546a6dc8.png) After this change it could be interpreted as `z` being `1 << 32`. Maybe change the text to `4294967296 is 1 << 32` (which helps devs with the magic-numbers issue) ## File path: src/main/java/org/apache/commons/compress/harmony/pack200/BHSDCodec.java ## @@ -308,11 +308,8 @@ public boolean encodes(final long value) { } } else if (z < 0) { // Need to use integer overflow here to represent negatives. -if (cardinality < 4294967296L) { -z += cardinality; -} else { -z += 4294967296L; // this value is equal to (1 << 32). -} +// this value is equal to (1 << 32). Review comment: ![image](https://user-images.githubusercontent.com/304786/153921096-1dfa799e-b6ce-4bad-aa39-54d7546a6dc8.png) After this change it could be interpreted as `z` being `1 << 32`. Maybe change the text to `4294967296 is 1 << 32` (which helps devs with the magic-numbers issue) ## File path: src/main/java/org/apache/commons/compress/harmony/pack200/BHSDCodec.java ## @@ -308,11 +308,8 @@ public boolean encodes(final long value) { } } else if (z < 0) { // Need to use integer overflow here to represent negatives. -if (cardinality < 4294967296L) { -z += cardinality; -} else { -z += 4294967296L; // this value is equal to (1 << 32). -} +// this value is equal to (1 << 32). Review comment: True! I have to get used to jshell. Looks like the integer overflow resets the value to `1`. But using longs works the same way as in Python. ![image](https://user-images.githubusercontent.com/304786/153925028-9d9c2d94-209c-4e6e-a136-e3f5776d68cf.png) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-compress] garydgregory merged pull request #248: Fix thread safety issues when encoding 7z password
garydgregory merged pull request #248: URL: https://github.com/apache/commons-compress/pull/248 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-compress] garydgregory commented on a change in pull request #206: Minor changes
garydgregory commented on a change in pull request #206: URL: https://github.com/apache/commons-compress/pull/206#discussion_r805995048 ## File path: src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java ## @@ -777,7 +777,7 @@ public String getName() { @Override public boolean isDirectory() { final String n = getName(); -return n != null && n.endsWith("/"); +return n.endsWith("/"); Review comment: It does seem that `getName()` can never be null, so maybe just `return getName().endsWith("/");` ? Same for other getName() call sites? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-codec] garydgregory closed pull request #92: Avoid inefficient usage of arraylist
garydgregory closed pull request #92: URL: https://github.com/apache/commons-codec/pull/92 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-compress] garydgregory commented on pull request #247: Use Math.min and Math.max calculations.
garydgregory commented on pull request #247: URL: https://github.com/apache/commons-compress/pull/247#issuecomment-1039261822 It does seem to me that this makes the code easier to read, what do others think? @kinow ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (JEXL-360) Add missing bitshift operators ( >>, >>>, <<)
[ https://issues.apache.org/jira/browse/JEXL-360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17492758#comment-17492758 ] Dmitri Blinov commented on JEXL-360: It seems you've already done most of the work. I've added some tests and type-aware shifts arithmetic > Add missing bitshift operators ( >>, >>>, <<) > - > > Key: JEXL-360 > URL: https://issues.apache.org/jira/browse/JEXL-360 > Project: Commons JEXL > Issue Type: Improvement >Affects Versions: 3.2.1 >Reporter: Ian Hawkins >Priority: Minor > Labels: newbie > > Hi! > Jexl appears to be missing the >> << >>> <<< bit shift operators - it > would be really useful to have them so we can do things like (b >> > bitnumber), etc. > Thanks! > -- This message was sent by Atlassian Jira (v8.20.1#820001)
[GitHub] [commons-jexl] dmitri-blinov opened a new pull request #77: Type checks; more tests
dmitri-blinov opened a new pull request #77: URL: https://github.com/apache/commons-jexl/pull/77 The propose is to honor argument types to make shift operators more aligned with java implementation -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Created] (NUMBERS-184) Reduce number of operations in Precision.equals using a maxUlps
Alex Herbert created NUMBERS-184: Summary: Reduce number of operations in Precision.equals using a maxUlps Key: NUMBERS-184 URL: https://issues.apache.org/jira/browse/NUMBERS-184 Project: Commons Numbers Issue Type: Improvement Components: core Affects Versions: 1.0 Reporter: Alex Herbert Fix For: 1.1 The Precision class has a method to test if two arguments are equal using a maximum number of representable float values between two arguments. This is performed on the IEEE 754 bit layout of the floats. When the two inputs have opposite signs there is a lot of code to compute the distance of the values from the bit representation of +0.0 or -0.0. This is redundant. If the signs are opposite then the distance from the bit representation of 0.0 only requires dropping the sign bit from the bit representation. Here is an extract from the current method: {code:java} final int xInt = Float.floatToRawIntBits(x); final int yInt = Float.floatToRawIntBits(y); final boolean isEqual; if (((xInt ^ yInt) & SGN_MASK_FLOAT) == 0) { // number have same sign, there is no risk of overflow isEqual = Math.abs(xInt - yInt) <= maxUlps; } else { // number have opposite signs, take care of overflow final int deltaPlus; final int deltaMinus; if (xInt < yInt) { deltaPlus = yInt - POSITIVE_ZERO_FLOAT_BITS; deltaMinus = xInt - NEGATIVE_ZERO_FLOAT_BITS; } else { deltaPlus = xInt - POSITIVE_ZERO_FLOAT_BITS; deltaMinus = yInt - NEGATIVE_ZERO_FLOAT_BITS; } if (deltaPlus > maxUlps) { isEqual = false; } else { isEqual = deltaMinus <= (maxUlps - deltaPlus); } }{code} The second branch can be simplified using bit masking. {code:java} final int deltaPlus = xInt & Integer.MAX_VALUE; final int deltaMinus = yInt & Integer.MAX_VALUE; isEqual = (long) deltaPlus + deltaMinus <= maxUlps;{code} For the float method overflow can be avoid by using a long to sum the two deltas eliminating a further branch condition. An different optimisation can be performed for the double argument method. Since the ulp argument is an integer, when the signs are opposite then a NaN bit value would be at least (2047L << 52) above zero. Thus there is no need to check for NaN if the numbers are equal within the max ULPs and have opposite signs. This optimisation could be made if using a short for the float equals method but would require breaking API changes and cannot be done. For reference the max difference for doubles is approximately 2^31 / 2^52 of the mantissa for double values with the same exponent. This is a relative error of approximately 4.77e-7. Using a short for floats would be 2^15 / 2^24 of the mantissa for a relative error of approximately 3.8e-3. Using an int argument allows an extreme relative error of 1 when both arguments are the same sign, and an absolute error of more than Float.MAX_VALUE. It makes no sense to compare two float values with a maximum possible ULP difference of more than the range from zero to infinity. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Work logged] (CSV-288) String delimiter (||) is not working as expected.
[ https://issues.apache.org/jira/browse/CSV-288?focusedWorklogId=727141=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-727141 ] ASF GitHub Bot logged work on CSV-288: -- Author: ASF GitHub Bot Created on: 15/Feb/22 16:43 Start Date: 15/Feb/22 16:43 Worklog Time Spent: 10m Work Description: angusdev opened a new pull request #216: URL: https://github.com/apache/commons-csv/pull/216 Jira Issue: https://issues.apache.org/jira/browse/CSV-288 When checking if last token is delimiter in below line of code ```java // did we reach eof during the last iteration already ? EOF if (isEndOfFile(lastChar) || !isDelimiter(lastChar) && isEndOfFile(c)) { ``` `isDelimiter(lastChar)` unintentionally advance the buffer pointer and consume the first `"|"` when it comes to the `"b"` in `"a||b||c"` (lastChar is `"|"`, nextChar is also `"|"`, make it `"||"`). Subsequent read will see `"|c"` instead of `"||c"` so the second token is `"b|c"` To fix it, create a new indicator `isLastTokenDelimiter` instead of using `isDelimiter(lastChar)`, the indicator is set/reset in `isDelimiter()` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 727141) Remaining Estimate: 0h Time Spent: 10m > String delimiter (||) is not working as expected. > - > > Key: CSV-288 > URL: https://issues.apache.org/jira/browse/CSV-288 > Project: Commons CSV > Issue Type: Bug >Reporter: Santhsoh >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > Steps to reproduce : > 1. Parse CSV file with || as delimiter and having empty columns > 2. Print the CSVRecord resulting from CSVParser > > //Expected : a,b,c,d,,f,g > // Actual : a,b|c,d,|f,g > public static void main(String[] args) throws Exception\{ > String row = "a||b||c||df||g"; > StringBuilder stringBuilder = new StringBuilder(); > try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, > CSVFormat.EXCEL); > CSVParser csvParser = CSVParser.parse(new StringInputStream(row), > StandardCharsets.UTF_8, > CSVFormat.Builder.create().setDelimiter("||").build())) { > for (CSVRecord csvRecord : csvParser) { > for (int i = 0; i < csvRecord.size(); i++) { > csvPrinter.print(csvRecord.get(i)); > } > System.out.println(stringBuilder.toString()); > //Expected : a,b,c,d,,f,g > // Actual : a,b|c,d,|f,g > } > } > } > With the snippet provided above, actual value is not same as expected value -- This message was sent by Atlassian Jira (v8.20.1#820001)
[GitHub] [commons-csv] angusdev opened a new pull request #216: CSV-288 Fix for double char delimiter (e.g. ||) not working as expected
angusdev opened a new pull request #216: URL: https://github.com/apache/commons-csv/pull/216 Jira Issue: https://issues.apache.org/jira/browse/CSV-288 When checking if last token is delimiter in below line of code ```java // did we reach eof during the last iteration already ? EOF if (isEndOfFile(lastChar) || !isDelimiter(lastChar) && isEndOfFile(c)) { ``` `isDelimiter(lastChar)` unintentionally advance the buffer pointer and consume the first `"|"` when it comes to the `"b"` in `"a||b||c"` (lastChar is `"|"`, nextChar is also `"|"`, make it `"||"`). Subsequent read will see `"|c"` instead of `"||c"` so the second token is `"b|c"` To fix it, create a new indicator `isLastTokenDelimiter` instead of using `isDelimiter(lastChar)`, the indicator is set/reset in `isDelimiter()` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] garydgregory commented on pull request #789: Improve Travis CI build Performance
garydgregory commented on pull request #789: URL: https://github.com/apache/commons-lang/pull/789#issuecomment-1040472939 Closing: We no longer support Travis CI. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] garydgregory closed pull request #789: Improve Travis CI build Performance
garydgregory closed pull request #789: URL: https://github.com/apache/commons-lang/pull/789 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] garydgregory commented on pull request #845: Fix a flaky test in org.apache.commons.lang3.time.StopWatchTest.testStopWatchSuspend
garydgregory commented on pull request #845: URL: https://github.com/apache/commons-lang/pull/845#issuecomment-1040471464 -1: This does not fix anything, it merely hides the problem, the test should be made more robust IMO. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-lang] garydgregory commented on pull request #850: improve DateUtils by adding calenda.month in comparison in considerin…
garydgregory commented on pull request #850: URL: https://github.com/apache/commons-lang/pull/850#issuecomment-1040469851 Ping? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Updated] (JEXL-360) Add missing bitshift operators ( >>, >>>, <<)
[ https://issues.apache.org/jira/browse/JEXL-360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Biestro updated JEXL-360: --- Summary: Add missing bitshift operators ( >>, >>>, <<) (was: Add missing bitwise operators ( >>, >>>, <<)) > Add missing bitshift operators ( >>, >>>, <<) > - > > Key: JEXL-360 > URL: https://issues.apache.org/jira/browse/JEXL-360 > Project: Commons JEXL > Issue Type: Improvement >Affects Versions: 3.2.1 >Reporter: Ian Hawkins >Priority: Minor > Labels: newbie > > Hi! > Jexl appears to be missing the >> << >>> <<< bit shift operators - it > would be really useful to have them so we can do things like (b >> > bitnumber), etc. > Thanks! > -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (JEXL-360) Add missing bitwise operators ( >>, >>>, etc)
[ https://issues.apache.org/jira/browse/JEXL-360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17492677#comment-17492677 ] Henri Biestro commented on JEXL-360: Vision is that we should probably target including all Java/C operators; a refactor to reduce the boiler-plate code in the AST nodes is probably needed at some point. Let's try and move forward with this first. Created a branch [JEXL-360|https://github.com/apache/commons-jexl/tree/JEXL-360] so we can create/review PRs. > Add missing bitwise operators ( >>, >>>, etc) > - > > Key: JEXL-360 > URL: https://issues.apache.org/jira/browse/JEXL-360 > Project: Commons JEXL > Issue Type: Improvement >Affects Versions: 3.2.1 >Reporter: Ian Hawkins >Priority: Minor > Labels: newbie > > Hi! > Jexl appears to be missing the >> << >>> <<< bit shift operators - it > would be really useful to have them so we can do things like (b >> > bitnumber), etc. > Thanks! > -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Updated] (JEXL-360) Add missing bitwise operators ( >>, >>>, <<)
[ https://issues.apache.org/jira/browse/JEXL-360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Biestro updated JEXL-360: --- Summary: Add missing bitwise operators ( >>, >>>, <<) (was: Add missing bitwise operators ( >>, >>>, etc)) > Add missing bitwise operators ( >>, >>>, <<) > > > Key: JEXL-360 > URL: https://issues.apache.org/jira/browse/JEXL-360 > Project: Commons JEXL > Issue Type: Improvement >Affects Versions: 3.2.1 >Reporter: Ian Hawkins >Priority: Minor > Labels: newbie > > Hi! > Jexl appears to be missing the >> << >>> <<< bit shift operators - it > would be really useful to have them so we can do things like (b >> > bitnumber), etc. > Thanks! > -- This message was sent by Atlassian Jira (v8.20.1#820001)
[GitHub] [commons-io] garydgregory closed pull request #277: Refactoring
garydgregory closed pull request #277: URL: https://github.com/apache/commons-io/pull/277 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-io] garydgregory commented on pull request #277: Refactoring
garydgregory commented on pull request #277: URL: https://github.com/apache/commons-io/pull/277#issuecomment-1040384803 Closing, no feedback from OP. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-io] garydgregory edited a comment on pull request #327: Fix incollect value in field currentBufferIndex when creating new buffer first time.
garydgregory edited a comment on pull request #327: URL: https://github.com/apache/commons-io/pull/327#issuecomment-1040382861 Hi @code-ferry Thank you for your PR. This PR needs a test that fails without the change to the main tree; otherwise, a future change can regress this 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. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-io] garydgregory commented on pull request #327: Fix incollect value in field currentBufferIndex when creating new buffer first time.
garydgregory commented on pull request #327: URL: https://github.com/apache/commons-io/pull/327#issuecomment-1040382861 Hi @code-ferry Thank you for your PR. This change needs a test that fails without the change to the main tree; otherwise, a future change can regress this 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. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-io] code-ferry opened a new pull request #327: Fix incollect value in field currentBufferIndex when creating new buffer first time.
code-ferry opened a new pull request #327: URL: https://github.com/apache/commons-io/pull/327 The currentBufferIndex means the index of the current buffer in the class AbstractByteArrayOutputStream. when creating new buffer first time and the write size , currentBufferIndex should not change. Luckily, this mistable does not affect any public methods and the result. After my modification, all the unit tests also pass. ``` @Test public void testCurrentBufferIndex() throws IOException, IllegalAccessException, InstantiationException, NoSuchFieldException { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); outputStream.write(new byte[]{0x31, 0x32}); // Get Field currentBufferIndex Field field = ByteArrayOutputStream.class.getSuperclass().getDeclaredField("currentBufferIndex"); field.setAccessible(true); int currentBufferIndex = (int) field.get(outputStream); // print 1. I think the right value is 0. // // Only 2 bytes are written, less than the default value 1024. // The size of array buffers is only 1, and currentBufferIndex should be 0. System.out.println(currentBufferIndex); } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-codec] garydgregory edited a comment on pull request #64: Add form feed and vertical tab whitespace to isWhiteSpace()
garydgregory edited a comment on pull request #64: URL: https://github.com/apache/commons-codec/pull/64#issuecomment-1040311595 Ping. Also, how does this square with the RFCs for Base64, Base32, and Base16 (all the subclasses we implement)? IOW, what C/C++ does is completely irrelevant, it's the RFCs that matter. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-codec] garydgregory edited a comment on pull request #64: Add form feed and vertical tab whitespace to isWhiteSpace()
garydgregory edited a comment on pull request #64: URL: https://github.com/apache/commons-codec/pull/64#issuecomment-1040311595 Ping. Also, how does this square with the RFCs for Base64, Base32, and Base16 -- all the subclasses we implement? IOW, What C/C++ does is completely irrelevant, it's the RFCs that matter. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-codec] garydgregory edited a comment on pull request #64: Add form feed and vertical tab whitespace to isWhiteSpace()
garydgregory edited a comment on pull request #64: URL: https://github.com/apache/commons-codec/pull/64#issuecomment-1040311595 Ping. Also, how does this square with the RFCs for Base64, Base32, and Base16? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [commons-codec] garydgregory commented on pull request #64: Add form feed and vertical tab whitespace to isWhiteSpace()
garydgregory commented on pull request #64: URL: https://github.com/apache/commons-codec/pull/64#issuecomment-1040311595 Ping. Also how does this square with the RFCs for Base64, Base32, and Base16? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Comment Edited] (JEXL-360) Add missing bitwise operators ( >>, >>>, etc)
[ https://issues.apache.org/jira/browse/JEXL-360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17492400#comment-17492400 ] Dmitri Blinov edited comment on JEXL-360 at 2/15/22, 9:24 AM: -- This is what, among many other things, that I have added in the experimental fork ([See https://github.com/dmitri-blinov/commons-jexl|https://github.com/dmitri-blinov/commons-jexl]), you can look at it and tell what you think. I could prepare PR for this if Henri would be so kind to accept it. Henri, what is your current vision about further language extensions (new operators / refactoring) ? was (Author: dmitri_blinov): This is what, among many other things, that I have added in the experimental fork ([See https://github.com/dmitri-blinov/commons-jexl|https://github.com/dmitri-blinov/commons-jexl]), you can look at it and tell what you think. I could prepare PR for this if Henry would be so kind to accept it. Henry, what is your current vision about further language extensions (new operators / refactoring) ? > Add missing bitwise operators ( >>, >>>, etc) > - > > Key: JEXL-360 > URL: https://issues.apache.org/jira/browse/JEXL-360 > Project: Commons JEXL > Issue Type: Improvement >Affects Versions: 3.2.1 >Reporter: Ian Hawkins >Priority: Minor > Labels: newbie > > Hi! > Jexl appears to be missing the >> << >>> <<< bit shift operators - it > would be really useful to have them so we can do things like (b >> > bitnumber), etc. > Thanks! > -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (VFS-816) Apache commons VFS2 code is taking 5 min to resolve the file in SFTP
[ https://issues.apache.org/jira/browse/VFS-816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17492470#comment-17492470 ] Veeraswamy Naidu Pulaparti commented on VFS-816: [~ggregory] i added my sample java code used to test the same in RTF file with line by line comments. There i observed in resolveFile it is taking 5 min time . > Apache commons VFS2 code is taking 5 min to resolve the file in SFTP > > > Key: VFS-816 > URL: https://issues.apache.org/jira/browse/VFS-816 > Project: Commons VFS > Issue Type: Bug >Affects Versions: 2.7.0 >Reporter: Veeraswamy Naidu Pulaparti >Priority: Major > Attachments: SFTPTest.rtf > > > Hi Team, when i used the commons-vfs2-2.7.0.jar file in my application it is > taking around 5 min to resolve the file for 1kb as well. > when the same code is used by changing the packages from vf2 -> vfs and using > the jar commons-vfs-2.0.jar it is working normally and the same step is > coming out within milliseconds. > Could you please check the same and let me know if i am missing anything > here. For reference i am attaching reference java code. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Comment Edited] (CSV-288) String delimiter (||) is not working as expected.
[ https://issues.apache.org/jira/browse/CSV-288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17492428#comment-17492428 ] Angus C edited comment on CSV-288 at 2/15/22, 8:15 AM: --- In below line in Lexer.java, the isDelimiter() unintentionally advance the buffer pointer and "eat" the first "|" when it comes to the "b" in "|b|" (lastChar is "|", nextChar is also "|", make it "||"). So "a||bc||d " doesn't fail (lastChar is "|", but next char is "c"), neither if the delimiter is two different char (e.g. |!). The checking is used to detect the last empty column (e.g. in "a,b,") {code:java} // did we reach eof during the last iteration already ? EOF if (isEndOfFile(lastChar) || !isDelimiter(lastChar) && isEndOfFile(c)) { {code} was (Author: JIRAUSER285196): In below line in Lexar.java, the isDelimiter() unintentionally advance the buffer pointer and "eat" the first "|" when it comes to the "b" in "|b|" (lastChar is "|", nextChar is also "|", make it "||"). So "a||bc||d " doesn't fail (lastChar is "|", but next char is "c"), neither if the delimiter is two different char (e.g. |!). The checking is used to detect the last empty column (e.g. in "a,b,") {code:java} // did we reach eof during the last iteration already ? EOF if (isEndOfFile(lastChar) || !isDelimiter(lastChar) && isEndOfFile(c)) { {code} > String delimiter (||) is not working as expected. > - > > Key: CSV-288 > URL: https://issues.apache.org/jira/browse/CSV-288 > Project: Commons CSV > Issue Type: Bug >Reporter: Santhsoh >Priority: Major > > Steps to reproduce : > 1. Parse CSV file with || as delimiter and having empty columns > 2. Print the CSVRecord resulting from CSVParser > > //Expected : a,b,c,d,,f,g > // Actual : a,b|c,d,|f,g > public static void main(String[] args) throws Exception\{ > String row = "a||b||c||df||g"; > StringBuilder stringBuilder = new StringBuilder(); > try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, > CSVFormat.EXCEL); > CSVParser csvParser = CSVParser.parse(new StringInputStream(row), > StandardCharsets.UTF_8, > CSVFormat.Builder.create().setDelimiter("||").build())) { > for (CSVRecord csvRecord : csvParser) { > for (int i = 0; i < csvRecord.size(); i++) { > csvPrinter.print(csvRecord.get(i)); > } > System.out.println(stringBuilder.toString()); > //Expected : a,b,c,d,,f,g > // Actual : a,b|c,d,|f,g > } > } > } > With the snippet provided above, actual value is not same as expected value -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (CSV-288) String delimiter (||) is not working as expected.
[ https://issues.apache.org/jira/browse/CSV-288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17492428#comment-17492428 ] Angus C commented on CSV-288: - In below line in Lexar.java, the isDelimiter() unintentionally advance the buffer pointer and "eat" the first "|" when it comes to the "b" in "|b|" (lastChar is "|", nextChar is also "|", make it "||"). So "a||bc||d " doesn't fail (lastChar is "|", but next char is "c"), neither if the delimiter is two different char (e.g. |!). The checking is used to detect the last empty column (e.g. in "a,b,") {code:java} // did we reach eof during the last iteration already ? EOF if (isEndOfFile(lastChar) || !isDelimiter(lastChar) && isEndOfFile(c)) { {code} > String delimiter (||) is not working as expected. > - > > Key: CSV-288 > URL: https://issues.apache.org/jira/browse/CSV-288 > Project: Commons CSV > Issue Type: Bug >Reporter: Santhsoh >Priority: Major > > Steps to reproduce : > 1. Parse CSV file with || as delimiter and having empty columns > 2. Print the CSVRecord resulting from CSVParser > > //Expected : a,b,c,d,,f,g > // Actual : a,b|c,d,|f,g > public static void main(String[] args) throws Exception\{ > String row = "a||b||c||df||g"; > StringBuilder stringBuilder = new StringBuilder(); > try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, > CSVFormat.EXCEL); > CSVParser csvParser = CSVParser.parse(new StringInputStream(row), > StandardCharsets.UTF_8, > CSVFormat.Builder.create().setDelimiter("||").build())) { > for (CSVRecord csvRecord : csvParser) { > for (int i = 0; i < csvRecord.size(); i++) { > csvPrinter.print(csvRecord.get(i)); > } > System.out.println(stringBuilder.toString()); > //Expected : a,b,c,d,,f,g > // Actual : a,b|c,d,|f,g > } > } > } > With the snippet provided above, actual value is not same as expected value -- This message was sent by Atlassian Jira (v8.20.1#820001)