[jira] [Work logged] (COMPRESS-542) Corrupt 7z allocates huge amount of SevenZEntries

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/COMPRESS-542?focusedWorklogId=467072=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-467072
 ]

ASF GitHub Bot logged work on COMPRESS-542:
---

Author: ASF GitHub Bot
Created on: 06/Aug/20 04:48
Start Date: 06/Aug/20 04:48
Worklog Time Spent: 10m 
  Work Description: theobisproject commented on pull request #120:
URL: https://github.com/apache/commons-compress/pull/120#issuecomment-669688765


   Just a short update. I will try to generate a reproducting file via fuzzing 
which is hopefully successful. This might take some days but I think at the end 
of the weekend I can share somthing.



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: 467072)
Time Spent: 1h 40m  (was: 1.5h)

> Corrupt 7z allocates huge amount of SevenZEntries
> -
>
> Key: COMPRESS-542
> URL: https://issues.apache.org/jira/browse/COMPRESS-542
> Project: Commons Compress
>  Issue Type: Bug
>Affects Versions: 1.20
>Reporter: Robin Schimpf
>Priority: Major
> Attachments: Reduced_memory_allocation_for_corrupted_7z_archives.patch
>
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> We ran into a problem where a 1.43GB corrupt 7z file tried to allocate about 
> 138 million SevenZArchiveEntries which will use about 12GB of memory. Sadly 
> I'm unable to share the file. If you have enough Memory available the 
> following exception is thrown.
> {code:java}
> java.io.IOException: Start header corrupt and unable to guess end Header
>   at 
> org.apache.commons.compress.archivers.sevenz.SevenZFile.tryToLocateEndHeader(SevenZFile.java:511)
>   at 
> org.apache.commons.compress.archivers.sevenz.SevenZFile.readHeaders(SevenZFile.java:470)
>   at 
> org.apache.commons.compress.archivers.sevenz.SevenZFile.(SevenZFile.java:336)
>   at 
> org.apache.commons.compress.archivers.sevenz.SevenZFile.(SevenZFile.java:128)
>   at 
> org.apache.commons.compress.archivers.sevenz.SevenZFile.(SevenZFile.java:369)
> {code}
> 7z itself aborts really quick when I'm trying to list the content of the file.
> {code:java}
> 7z l "corrupt.7z"
> 7-Zip 18.01 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2018-01-28
> Scanning the drive for archives:
> 1 file, 1537752212 bytes (1467 MiB)
> Listing archive: corrupt.7z
> ERROR: corrupt.7z : corrupt.7z
> Open ERROR: Can not open the file as [7z] archive
> ERRORS:
> Is not archive
> Errors: 1
> {code}
> I hacked together the attached patch which will reduce the memory allocation 
> to about 1GB. So lazy instantiation of the entries could be a good solution 
> to the problem. Optimal would be to only create the entries if the headers 
> could be parsed correctly.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-compress] theobisproject commented on pull request #120: COMPRESS-542: Lazy allocation of SevenZArchiveEntry to prevent OOM on corrupt files

2020-08-05 Thread GitBox


theobisproject commented on pull request #120:
URL: https://github.com/apache/commons-compress/pull/120#issuecomment-669688765


   Just a short update. I will try to generate a reproducting file via fuzzing 
which is hopefully successful. This might take some days but I think at the end 
of the weekend I can share somthing.



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-vfs] PeterAlfredLee commented on pull request #107: Fix some test error when jvm's default language is not en

2020-08-05 Thread GitBox


PeterAlfredLee commented on pull request #107:
URL: https://github.com/apache/commons-vfs/pull/107#issuecomment-669631008


   > Which asserts do this which which locale? 
   
   It's in the `ParseXmlInZipTestCase.testResolveAndParseInvalidXml` and 
`ParseXmlInZipTestCase.testResolveAndParseNotWellFormedXml`.
   
   > I am wondering if there is an simple fix in the test code. 
   
   I think it's possible. Will push later.



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] (COMPRESS-542) Corrupt 7z allocates huge amount of SevenZEntries

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/COMPRESS-542?focusedWorklogId=467002=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-467002
 ]

ASF GitHub Bot logged work on COMPRESS-542:
---

Author: ASF GitHub Bot
Created on: 05/Aug/20 22:28
Start Date: 05/Aug/20 22:28
Worklog Time Spent: 10m 
  Work Description: akelday commented on pull request #120:
URL: https://github.com/apache/commons-compress/pull/120#issuecomment-669553548


   > avoid the entry allocation completely before we are sure the header is not 
corrupted
   
   Probably not possible with the current code... **tryToLocateEndHeader** is 
the real cause because it does no CRC check and cannot, because by definition 
it's already a corrupt file.
   
   I have crafted a 233 byte malformed 7z which would attempt to allocate 
268,435,455 files but I'm not certain it's wise to post it here. This is in 
some way related to my own problems with a very large 7z because the "kName" 
section allocates an enormous buffer for filenames (fixable by streaming the 
bytes 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


Issue Time Tracking
---

Worklog Id: (was: 467002)
Time Spent: 1.5h  (was: 1h 20m)

> Corrupt 7z allocates huge amount of SevenZEntries
> -
>
> Key: COMPRESS-542
> URL: https://issues.apache.org/jira/browse/COMPRESS-542
> Project: Commons Compress
>  Issue Type: Bug
>Affects Versions: 1.20
>Reporter: Robin Schimpf
>Priority: Major
> Attachments: Reduced_memory_allocation_for_corrupted_7z_archives.patch
>
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> We ran into a problem where a 1.43GB corrupt 7z file tried to allocate about 
> 138 million SevenZArchiveEntries which will use about 12GB of memory. Sadly 
> I'm unable to share the file. If you have enough Memory available the 
> following exception is thrown.
> {code:java}
> java.io.IOException: Start header corrupt and unable to guess end Header
>   at 
> org.apache.commons.compress.archivers.sevenz.SevenZFile.tryToLocateEndHeader(SevenZFile.java:511)
>   at 
> org.apache.commons.compress.archivers.sevenz.SevenZFile.readHeaders(SevenZFile.java:470)
>   at 
> org.apache.commons.compress.archivers.sevenz.SevenZFile.(SevenZFile.java:336)
>   at 
> org.apache.commons.compress.archivers.sevenz.SevenZFile.(SevenZFile.java:128)
>   at 
> org.apache.commons.compress.archivers.sevenz.SevenZFile.(SevenZFile.java:369)
> {code}
> 7z itself aborts really quick when I'm trying to list the content of the file.
> {code:java}
> 7z l "corrupt.7z"
> 7-Zip 18.01 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2018-01-28
> Scanning the drive for archives:
> 1 file, 1537752212 bytes (1467 MiB)
> Listing archive: corrupt.7z
> ERROR: corrupt.7z : corrupt.7z
> Open ERROR: Can not open the file as [7z] archive
> ERRORS:
> Is not archive
> Errors: 1
> {code}
> I hacked together the attached patch which will reduce the memory allocation 
> to about 1GB. So lazy instantiation of the entries could be a good solution 
> to the problem. Optimal would be to only create the entries if the headers 
> could be parsed correctly.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-compress] akelday commented on pull request #120: COMPRESS-542: Lazy allocation of SevenZArchiveEntry to prevent OOM on corrupt files

2020-08-05 Thread GitBox


akelday commented on pull request #120:
URL: https://github.com/apache/commons-compress/pull/120#issuecomment-669553548


   > avoid the entry allocation completely before we are sure the header is not 
corrupted
   
   Probably not possible with the current code... **tryToLocateEndHeader** is 
the real cause because it does no CRC check and cannot, because by definition 
it's already a corrupt file.
   
   I have crafted a 233 byte malformed 7z which would attempt to allocate 
268,435,455 files but I'm not certain it's wise to post it here. This is in 
some way related to my own problems with a very large 7z because the "kName" 
section allocates an enormous buffer for filenames (fixable by streaming the 
bytes 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-crypto] aremily commented on pull request #103: Standardize the release build process with Docker.

2020-08-05 Thread GitBox


aremily commented on pull request #103:
URL: https://github.com/apache/commons-crypto/pull/103#issuecomment-669442387


   Fair enough.  I'll make the update.
   
   On Wed, Aug 5, 2020 at 3:14 PM Geoffrey Blake 
   wrote:
   
   > *@geoffreyblake* commented on this pull request.
   > --
   >
   > In Dockerfile
   > :
   >
   > > +# 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.
   > +
   > +# This file builds the Linux-x86_64, Linux-arm, Linux-armfh. Linux 
aarch64 and Win64 jnilibs.  It copies the contents of
   > +# the build host's project directory (commons-crypto) into the docker 
image and cross compiles the remaining builds. If
   > +# you run this script from a Mac after a successful build, the build in 
the resuing Docker image will include the Mac
   > +# build.
   > +
   > +FROM ubuntu:18.04
   >
   > Sure, though for purposes of a release, it'd be best to take a distro that
   > is 'old'. The main concern is libc compatibility as compiling against newer
   > versions *is not* backward compatible to older versions, whereas
   > compiling against an old version of libc *is* forward compatible.
   >
   > Ubuntu 14.04 is still supported by Canonical according to their Docker hub
   > info page, and is old enough for Arm builds, but for x86, it'd be better to
   > go further back to something like CentOS7 or even 6.
   >
   > —
   > You are receiving this because you were mentioned.
   > Reply to this email directly, view it on GitHub
   > ,
   > or unsubscribe
   > 

   > .
   >
   



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-beanutils] melloware commented on pull request #27: [BEANUTILS-539] use Concurrent(Weak)HashMap (or anything both faster and have better thread safety) insteadof WeakFastHashMap

2020-08-05 Thread GitBox


melloware commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-669441952


   Looks like Inifinispan is Apache 2.0 licensed if that matters and it looks 
like they no longer even use this class? Looks like it was removed in 
Infinispan 10.0
   
   
https://github.com/infinispan/infinispan/blob/0cbb18f426c803a3b769047da10d520b8e8b5fea/commons/all/src/main/java/org/infinispan/commons/util/concurrent/ConcurrentWeakKeyHashMap.java
   



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-bcel] garydgregory commented on pull request #46: improve test case coverage; fix Utility.encode bug

2020-08-05 Thread GitBox


garydgregory commented on pull request #46:
URL: https://github.com/apache/commons-bcel/pull/46#issuecomment-669430582


   @markro49 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.

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




[GitHub] [commons-crypto] garydgregory commented on a change in pull request #103: Standardize the release build process with Docker.

2020-08-05 Thread GitBox


garydgregory commented on a change in pull request #103:
URL: https://github.com/apache/commons-crypto/pull/103#discussion_r465948671



##
File path: Dockerfile
##
@@ -0,0 +1,35 @@
+# 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.
+
+# This file builds the Linux-x86_64, Linux-arm, Linux-armfh. Linux aarch64 and 
Win64 jnilibs.  It copies the contents of
+# the build host's project directory (commons-crypto) into the docker image 
and cross compiles the remaining builds. If 
+# you run this script from a Mac after a successful build, the build in the 
resuing Docker image will include the Mac 
+# build.
+
+FROM ubuntu:18.04

Review comment:
   FWIW, what I have working now for my local builds is based on 14.04 
which is what I'll use to cut a release candidate hopefully soon(ish).





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 #103: Standardize the release build process with Docker.

2020-08-05 Thread GitBox


geoffreyblake commented on a change in pull request #103:
URL: https://github.com/apache/commons-crypto/pull/103#discussion_r465946010



##
File path: Dockerfile
##
@@ -0,0 +1,35 @@
+# 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.
+
+# This file builds the Linux-x86_64, Linux-arm, Linux-armfh. Linux aarch64 and 
Win64 jnilibs.  It copies the contents of
+# the build host's project directory (commons-crypto) into the docker image 
and cross compiles the remaining builds. If 
+# you run this script from a Mac after a successful build, the build in the 
resuing Docker image will include the Mac 
+# build.
+
+FROM ubuntu:18.04

Review comment:
   Sure, though for purposes of a release, it'd be best to take a distro 
that is 'old'.  The main concern is libc compatibility as compiling against 
newer versions **is not** backward compatible to older versions, whereas 
compiling against an old version of libc **is** forward compatible.  
   
   Ubuntu 14.04 is still supported by Canonical according to their Docker hub 
info page, and is old enough for Arm builds, but for x86, it'd be better to go 
further back to something like CentOS7 or even 6.





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] (CSV-206) Allow to use multiple-characters delimiter to separate column as withColumnSeparator: withDelimiter

2020-08-05 Thread Nikita Salapura (Jira)


[ 
https://issues.apache.org/jira/browse/CSV-206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17171634#comment-17171634
 ] 

Nikita Salapura commented on CSV-206:
-

[~ggregory], thank you for info and for work.

> Allow to use multiple-characters delimiter to separate column as 
> withColumnSeparator: withDelimiter
> ---
>
> Key: CSV-206
> URL: https://issues.apache.org/jira/browse/CSV-206
> Project: Commons CSV
>  Issue Type: Improvement
>Reporter: jefferyyuan
>Priority: Major
>  Labels: commons, commons-csv, csv, csvparser
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> It's not uncommon that we use multiple-characters delimiter to separate 
> columns in CVS: such as: [|]
> Sometimes, we have no choice as third-party defines the csv format like that.
> It would be great if apache commons.csv supports this function.
> I did some google search: seems there is no java library that supports use 
> multiple-characters as the column separator.
> But the C# CsvHelper does
> https://github.com/JoshClose/CsvHelper



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (VFS-662) SftpFileSystem has Thread-safe issue about idleChannel

2020-08-05 Thread Manish Bansal (Jira)


[ 
https://issues.apache.org/jira/browse/VFS-662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17171620#comment-17171620
 ] 

Manish Bansal commented on VFS-662:
---

Already did. https://github.com/apache/commons-vfs/pull/98

> SftpFileSystem  has Thread-safe issue about idleChannel
> ---
>
> Key: VFS-662
> URL: https://issues.apache.org/jira/browse/VFS-662
> Project: Commons VFS
>  Issue Type: Bug
>Reporter: qxo
>Priority: Critical
> Fix For: 2.4
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> {code}
> {code:java}
> Caused by: org.apache.commons.vfs2.FileSystemException: Could not connect to 
> SFTP server at
> at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel 
> (SftpFileSystem.java:149)
> at org.apache.commons.vfs2.provider.sftp.SftpFileObject.statSelf 
> (SftpFileObject.java:152)
> at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetType 
> (SftpFileObject.java:113)
> at org.apache.commons.vfs2.provider.AbstractFileObject.getType 
> (AbstractFileObject.java:1517)
> at org.apache.commons.vfs2.provider.sftp.SftpFileObject.refresh 
> (SftpFileObject.java:90)
> at org.apache.commons.vfs2.provider.AbstractFileSystem.resolveFile 
> (AbstractFileSystem.java:364)
> at org.apache.commons.vfs2.provider.AbstractFileSystem.resolveFile 
> (AbstractFileSystem.java:317)
> at org.apache.commons.vfs2.provider.AbstractFileObject.resolveFile 
> (AbstractFileObject.java:2039)
> at org.apache.commons.vfs2.FileObject$resolveFile$23.call (Unknown Source)
> Caused by: com.jcraft.jsch.JSchException: java.io.IOException: channel is 
> broken
> at com.jcraft.jsch.ChannelSftp.start (ChannelSftp.java:315)
> at com.jcraft.jsch.Channel.connect (Channel.java:152)
> at com.jcraft.jsch.Channel.connect (Channel.java:145)
> at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel 
> (SftpFileSystem.java:113)
> at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetOutputStream 
> (SftpFileObject.java:635)
> at org.apache.commons.vfs2.provider.AbstractFileObject.getOutputStream 
> (AbstractFileObject.java:1399)
> at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream 
> (DefaultFileContent.java:479)
> at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream 
> (DefaultFileContent.java:457)
> Caused by: com.jcraft.jsch.JSchException: java.net.SocketException: Broken 
> pipe (Write failed)
> at com.jcraft.jsch.Channel.connect (Channel.java:159)
> at com.jcraft.jsch.Channel.connect (Channel.java:145)
> at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel 
> (SftpFileSystem.java:113)
> at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetOutputStream 
> (SftpFileObject.java:635)
> at org.apache.commons.vfs2.provider.AbstractFileObject.getOutputStream 
> (AbstractFileObject.java:1399)
> at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream 
> (DefaultFileContent.java:479)
> at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream 
> (DefaultFileContent.java:457)
> Caused by: java.io.IOException: inputstream is closed
> at com.jcraft.jsch.ChannelSftp.fill (ChannelSftp.java:2911)
> at com.jcraft.jsch.ChannelSftp.header (ChannelSftp.java:2935)
> at com.jcraft.jsch.ChannelSftp.checkStatus (ChannelSftp.java:2473)
> at com.jcraft.jsch.ChannelSftp.access$300 (ChannelSftp.java:36)
> at com.jcraft.jsch.ChannelSftp$1.flush (ChannelSftp.java:851)
> at java.io.BufferedOutputStream.flush (BufferedOutputStream.java:141)
> at org.apache.commons.vfs2.util.MonitorOutputStream.flush 
> (MonitorOutputStream.java:134)
> at java.io.BufferedOutputStream.flush (BufferedOutputStream.java:141)
> at org.apache.commons.vfs2.util.MonitorOutputStream.flush 
> (MonitorOutputStream.java:134)
> Caused by: com.jcraft.jsch.JSchException: session is down
> at com.jcraft.jsch.Channel.sendChannelOpen (Channel.java:762)
> at com.jcraft.jsch.Channel.connect (Channel.java:151)
> at com.jcraft.jsch.Channel.connect (Channel.java:145)
> at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel 
> (SftpFileSystem.java:113)
> at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetOutputStream 
> (SftpFileObject.java:635)
> at org.apache.commons.vfs2.provider.AbstractFileObject.getOutputStream 
> (AbstractFileObject.java:1399)
> at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream 
> (DefaultFileContent.java:479)
> at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream 
> (DefaultFileContent.java:457)
> Caused by: java.net.SocketException: Broken pipe (Write failed)
> at java.net.SocketOutputStream.socketWrite0 (Native Method)
> at java.net.SocketOutputStream.socketWrite (SocketOutputStream.java:111)
> at java.net.SocketOutputStream.write (SocketOutputStream.java:155)
> at com.jcraft.jsch.IO.put 

[jira] [Work logged] (IO-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466848=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466848
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 15:38
Start Date: 05/Aug/20 15:38
Worklog Time Spent: 10m 
  Work Description: coveralls edited a comment on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-636980413


   
   [![Coverage 
Status](https://coveralls.io/builds/32560038/badge)](https://coveralls.io/builds/32560038)
   
   Coverage increased (+0.4%) to 90.17% when pulling 
**a247cfc7e50d6afa5d01597051e258ca4762ec9f on XenoAmess:refine_contentEquals** 
into **0dbe95715197c3c9b8c983c0b9acbe87d5cee34d 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: 466848)
Time Spent: 12h 10m  (was: 12h)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 12h 10m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] coveralls edited a comment on pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


coveralls edited a comment on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-636980413


   
   [![Coverage 
Status](https://coveralls.io/builds/32560038/badge)](https://coveralls.io/builds/32560038)
   
   Coverage increased (+0.4%) to 90.17% when pulling 
**a247cfc7e50d6afa5d01597051e258ca4762ec9f on XenoAmess:refine_contentEquals** 
into **0dbe95715197c3c9b8c983c0b9acbe87d5cee34d on apache:master**.
   



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

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




[GitHub] [commons-io] XenoAmess edited a comment on pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


XenoAmess edited a comment on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669180712


   @sebbASF 
   > Do you have any proof that using UnsyncBufferedReader etc in contentEquals 
will result in a slow-down unless further changes are made to contentEquals?
   
   Yes, I ran a rough performance test on a same pc, and the result be time 
9e8.(the current version of this pr shows 4.6e8, and master 2.8e9)
   If you need a full detailed performance test I can find some time to run one.

   > If so, what further changes are needed to contentEquals, and what is the 
speed improvement?
   
   That trick only be possible when we comparing two(or several) InputReaders.
   I shared an index on them, thus the two buffer's index be a same local 
variable.



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

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




[GitHub] [commons-io] XenoAmess edited a comment on pull request #137: [IO-680] add more tests for IOUtils.contentEqualsIgnoreEOL

2020-08-05 Thread GitBox


XenoAmess edited a comment on pull request #137:
URL: https://github.com/apache/commons-io/pull/137#issuecomment-669194030


   @sebbASF 
   > What conditions are missed by the existing tests?
   
   In short, it lacks situations I added.
   In details, it lacks:
   
   1. "" and "\n" (also includes "" and "\r", "" and "\r\n"...)
   because "" is very tricky, and it is hard to say it for sure whether we 
think them equal.
   
   2. "a\n" and "a\n\n"
   This might sounds stupid, but actually very tricky. because. this function 
think "a" equals "a\n", but it thinks "a\n" not equals "a\n\n".
   Only a non-CRLF char can be follow a ending CRLF and cause no difference to 
original, in this function.
   and another related tricky example is "a\n" and "a\r\n"be equal.
   
   3. some Readers who same to itself.
   The existing tests only have some examples for a same Object, who will be 
killed exit at the first == check.
   But it lacks some real same input test.
   
   4. for every tests, it lacks verse.
   whenever check `contentEqualsIgnoreEOF(input1,input2)` be true, must make 
sure it `contentEqualsIgnoreEOF(input2,input1)` also be true.
   
   5. some \r, \n, \r\n examples.
   the original only have one \r\n example, but have no tests for \r and \n.
   
   6. non-equal-length examples.
   like "123" and "1234" be false.
   they share common prefix, but a longer one is not same.
   
   7. some really not equal examples.
   like "1235" and "1234", they really differ on some char, and should return 
false.



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

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




[GitHub] [commons-io] XenoAmess commented on pull request #137: [IO-680] add more tests for IOUtils.contentEqualsIgnoreEOL

2020-08-05 Thread GitBox


XenoAmess commented on pull request #137:
URL: https://github.com/apache/commons-io/pull/137#issuecomment-669194030


   @sebbASF 
   > What conditions are missed by the existing tests?
   > In any case, if new tests are needed, they should follow the existing 
syntax.
   > Or better, such tests should be independent.
   
   In short, it lacks situations I added.
   In details, it lacks:
   
   1. "" and "\n"
   because "" is very tricky, and it is hard to say it for sure whether we 
think them equal.
   
   2. "a\n" and "a\n\n"
   This might sounds stupid, but actually very tricky. because. this function 
think "a" equals "a\n", but it thinks "a\n" not equals "a\n\n".
   Only a non-CRLF char can be follow a ending CRLF and cause no difference to 
original, in this function.
   
   3. some Readers who same to itself.
   The existing tests only have some examples for a same Object, who will be 
killed exit at the first == check.
   But it lacks some real same input test.
   
   4. for every tests, it lacks verse.
   whenever check `contentEqualsIgnoreEOF(input1,input2)` be true, must make 
sure it `contentEqualsIgnoreEOF(input2,input1)` also be true.
   
   5. some \r, \n, \r\n examples.
   the original only have one \r\n example, but have no tests for \r and \n.
   
   6. non-equal-length examples.
   like "123" and "1234" be false.
   they share common prefix, but a longer one is not same.
   
   7. some really not equal examples.
   like "1235" and "1234", they really differ on some char, and should return 
false.



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

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




[GitHub] [commons-io] XenoAmess edited a comment on pull request #137: [IO-680] add more tests for IOUtils.contentEqualsIgnoreEOL

2020-08-05 Thread GitBox


XenoAmess edited a comment on pull request #137:
URL: https://github.com/apache/commons-io/pull/137#issuecomment-669194030







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-release-plugin] garydgregory merged pull request #7: Bump commons-parent from 51 to 52

2020-08-05 Thread GitBox


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


   



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] garydgregory merged pull request #145: Bump commons-parent from 51 to 52

2020-08-05 Thread GitBox


garydgregory merged pull request #145:
URL: https://github.com/apache/commons-text/pull/145


   



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

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




[GitHub] [commons-parent] garydgregory commented on pull request #8: enable Dependabot v2

2020-08-05 Thread GitBox


garydgregory commented on pull request #8:
URL: https://github.com/apache/commons-parent/pull/8#issuecomment-669252207


   Done elsewhere.
   



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

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




[GitHub] [commons-parent] garydgregory closed pull request #8: enable Dependabot v2

2020-08-05 Thread GitBox


garydgregory closed pull request #8:
URL: https://github.com/apache/commons-parent/pull/8


   



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-pool] garydgregory merged pull request #38: Bump commons-parent from 51 to 52

2020-08-05 Thread GitBox


garydgregory merged pull request #38:
URL: https://github.com/apache/commons-pool/pull/38


   



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-net] garydgregory merged pull request #55: Bump commons-parent from 51 to 52

2020-08-05 Thread GitBox


garydgregory merged pull request #55:
URL: https://github.com/apache/commons-net/pull/55


   



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-logging] garydgregory merged pull request #7: Bump jdepend-maven-plugin from 2.0-beta-1 to 2.0

2020-08-05 Thread GitBox


garydgregory merged pull request #7:
URL: https://github.com/apache/commons-logging/pull/7


   



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-logging] garydgregory merged pull request #9: Bump actions/checkout from v1 to v2.3.1

2020-08-05 Thread GitBox


garydgregory merged pull request #9:
URL: https://github.com/apache/commons-logging/pull/9


   



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

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




[GitHub] [commons-lang] garydgregory merged pull request #598: Bump commons-parent from 51 to 52

2020-08-05 Thread GitBox


garydgregory merged pull request #598:
URL: https://github.com/apache/commons-lang/pull/598


   



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-dbutils] garydgregory merged pull request #22: Bump commons-parent from 51 to 52

2020-08-05 Thread GitBox


garydgregory merged pull request #22:
URL: https://github.com/apache/commons-dbutils/pull/22


   



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-csv] garydgregory merged pull request #89: Bump commons-parent from 51 to 52

2020-08-05 Thread GitBox


garydgregory merged pull request #89:
URL: https://github.com/apache/commons-csv/pull/89


   



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-dbcp] garydgregory merged pull request #49: Bump commons-parent from 51 to 52

2020-08-05 Thread GitBox


garydgregory merged pull request #49:
URL: https://github.com/apache/commons-dbcp/pull/49


   



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-configuration] garydgregory merged pull request #57: Bump maven-checkstyle-plugin from 3.1.0 to 3.1.1

2020-08-05 Thread GitBox


garydgregory merged pull request #57:
URL: https://github.com/apache/commons-configuration/pull/57


   



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-configuration] garydgregory merged pull request #58: Bump servlet-api from 2.4 to 2.5

2020-08-05 Thread GitBox


garydgregory merged pull request #58:
URL: https://github.com/apache/commons-configuration/pull/58


   



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-compress] garydgregory merged pull request #121: Bump commons-parent from 48 to 52

2020-08-05 Thread GitBox


garydgregory merged pull request #121:
URL: https://github.com/apache/commons-compress/pull/121


   



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-collections] garydgregory merged pull request #172: Bump commons-parent from 51 to 52

2020-08-05 Thread GitBox


garydgregory merged pull request #172:
URL: https://github.com/apache/commons-collections/pull/172


   



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-cli] garydgregory merged pull request #45: Bump commons-parent from 51 to 52

2020-08-05 Thread GitBox


garydgregory merged pull request #45:
URL: https://github.com/apache/commons-cli/pull/45


   



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-build-plugin] garydgregory merged pull request #8: Bump commons-parent from 51 to 52

2020-08-05 Thread GitBox


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


   



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-bcel] garydgregory merged pull request #56: Bump commons-parent from 51 to 52

2020-08-05 Thread GitBox


garydgregory merged pull request #56:
URL: https://github.com/apache/commons-bcel/pull/56


   



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 merged pull request #53: Bump commons-parent from 51 to 52

2020-08-05 Thread GitBox


garydgregory merged pull request #53:
URL: https://github.com/apache/commons-codec/pull/53


   



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] (CSV-206) Allow to use multiple-characters delimiter to separate column as withColumnSeparator: withDelimiter

2020-08-05 Thread Gary D. Gregory (Jira)


[ 
https://issues.apache.org/jira/browse/CSV-206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17171508#comment-17171508
 ] 

Gary D. Gregory commented on CSV-206:
-

[~NikitaSalapura]

We do not have a release date. A guess that a release will take place within a 
month or so would be a fair guess.

> Allow to use multiple-characters delimiter to separate column as 
> withColumnSeparator: withDelimiter
> ---
>
> Key: CSV-206
> URL: https://issues.apache.org/jira/browse/CSV-206
> Project: Commons CSV
>  Issue Type: Improvement
>Reporter: jefferyyuan
>Priority: Major
>  Labels: commons, commons-csv, csv, csvparser
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> It's not uncommon that we use multiple-characters delimiter to separate 
> columns in CVS: such as: [|]
> Sometimes, we have no choice as third-party defines the csv format like that.
> It would be great if apache commons.csv supports this function.
> I did some google search: seems there is no java library that supports use 
> multiple-characters as the column separator.
> But the C# CsvHelper does
> https://github.com/JoshClose/CsvHelper



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-beanutils] garydgregory merged pull request #32: Bump commons-parent from 51 to 52

2020-08-05 Thread GitBox


garydgregory merged pull request #32:
URL: https://github.com/apache/commons-beanutils/pull/32


   



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-680) add more tests for IOUtils.contentEqualsIgnoreEOL

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-680?focusedWorklogId=466787=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466787
 ]

ASF GitHub Bot logged work on IO-680:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 13:31
Start Date: 05/Aug/20 13:31
Worklog Time Spent: 10m 
  Work Description: XenoAmess edited a comment on pull request #137:
URL: https://github.com/apache/commons-io/pull/137#issuecomment-669194030


   @sebbASF 
   > What conditions are missed by the existing tests?
   
   In short, it lacks situations I added.
   In details, it lacks:
   
   1. "" and "\n" (also includes "" and "\r", "" and "\r\n"...)
   because "" is very tricky, and it is hard to say it for sure whether we 
think them equal.
   
   2. "a\n" and "a\n\n"
   This might sounds stupid, but actually very tricky. because. this function 
think "a" equals "a\n", but it thinks "a\n" not equals "a\n\n".
   Only a non-CRLF char can be follow a ending CRLF and cause no difference to 
original, in this function.
   and another related tricky example is "a\n" and "a\r\n"be equal.
   
   3. some Readers who same to itself.
   The existing tests only have some examples for a same Object, who will be 
killed exit at the first == check.
   But it lacks some real same input test.
   
   4. for every tests, it lacks verse.
   whenever check `contentEqualsIgnoreEOF(input1,input2)` be true, must make 
sure it `contentEqualsIgnoreEOF(input2,input1)` also be true.
   
   5. some \r, \n, \r\n examples.
   the original only have one \r\n example, but have no tests for \r and \n.
   
   6. non-equal-length examples.
   like "123" and "1234" be false.
   they share common prefix, but a longer one is not same.
   
   7. some really not equal examples.
   like "1235" and "1234", they really differ on some char, and should return 
false.



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: 466787)
Time Spent: 40m  (was: 0.5h)

> add more tests for IOUtils.contentEqualsIgnoreEOL
> -
>
> Key: IO-680
> URL: https://issues.apache.org/jira/browse/IO-680
> Project: Commons IO
>  Issue Type: Test
>Reporter: Jin Xu
>Priority: Minor
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/137]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-680) add more tests for IOUtils.contentEqualsIgnoreEOL

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-680?focusedWorklogId=466786=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466786
 ]

ASF GitHub Bot logged work on IO-680:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 13:31
Start Date: 05/Aug/20 13:31
Worklog Time Spent: 10m 
  Work Description: XenoAmess commented on pull request #137:
URL: https://github.com/apache/commons-io/pull/137#issuecomment-669194030


   @sebbASF 
   > What conditions are missed by the existing tests?
   > In any case, if new tests are needed, they should follow the existing 
syntax.
   > Or better, such tests should be independent.
   
   In short, it lacks situations I added.
   In details, it lacks:
   
   1. "" and "\n"
   because "" is very tricky, and it is hard to say it for sure whether we 
think them equal.
   
   2. "a\n" and "a\n\n"
   This might sounds stupid, but actually very tricky. because. this function 
think "a" equals "a\n", but it thinks "a\n" not equals "a\n\n".
   Only a non-CRLF char can be follow a ending CRLF and cause no difference to 
original, in this function.
   
   3. some Readers who same to itself.
   The existing tests only have some examples for a same Object, who will be 
killed exit at the first == check.
   But it lacks some real same input test.
   
   4. for every tests, it lacks verse.
   whenever check `contentEqualsIgnoreEOF(input1,input2)` be true, must make 
sure it `contentEqualsIgnoreEOF(input2,input1)` also be true.
   
   5. some \r, \n, \r\n examples.
   the original only have one \r\n example, but have no tests for \r and \n.
   
   6. non-equal-length examples.
   like "123" and "1234" be false.
   they share common prefix, but a longer one is not same.
   
   7. some really not equal examples.
   like "1235" and "1234", they really differ on some char, and should return 
false.



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: 466786)
Time Spent: 0.5h  (was: 20m)

> add more tests for IOUtils.contentEqualsIgnoreEOL
> -
>
> Key: IO-680
> URL: https://issues.apache.org/jira/browse/IO-680
> Project: Commons IO
>  Issue Type: Test
>Reporter: Jin Xu
>Priority: Minor
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/137]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-680) add more tests for IOUtils.contentEqualsIgnoreEOL

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-680?focusedWorklogId=466785=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466785
 ]

ASF GitHub Bot logged work on IO-680:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 13:31
Start Date: 05/Aug/20 13:31
Worklog Time Spent: 10m 
  Work Description: XenoAmess edited a comment on pull request #137:
URL: https://github.com/apache/commons-io/pull/137#issuecomment-669194030







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: 466785)
Time Spent: 20m  (was: 10m)

> add more tests for IOUtils.contentEqualsIgnoreEOL
> -
>
> Key: IO-680
> URL: https://issues.apache.org/jira/browse/IO-680
> Project: Commons IO
>  Issue Type: Test
>Reporter: Jin Xu
>Priority: Minor
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/137]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466788=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466788
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 13:33
Start Date: 05/Aug/20 13:33
Worklog Time Spent: 10m 
  Work Description: XenoAmess edited a comment on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669180712


   @sebbASF 
   > Do you have any proof that using UnsyncBufferedReader etc in contentEquals 
will result in a slow-down unless further changes are made to contentEquals?
   
   Yes, I ran a rough performance test on a same pc, and the result be time 
9e8.(the current version of this pr shows 4.6e8, and master 2.8e9)
   If you need a full detailed performance test I can find some time to run one.

   > If so, what further changes are needed to contentEquals, and what is the 
speed improvement?
   
   That trick only be possible when we comparing two(or several) InputReaders.
   I shared an index on them, thus the two buffer's index be a same local 
variable.



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: 466788)
Time Spent: 12h  (was: 11h 50m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 12h
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466777=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466777
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 13:04
Start Date: 05/Aug/20 13:04
Worklog Time Spent: 10m 
  Work Description: XenoAmess edited a comment on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669180712







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: 466777)
Time Spent: 11h 50m  (was: 11h 40m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 11h 50m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466775=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466775
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 13:04
Start Date: 05/Aug/20 13:04
Worklog Time Spent: 10m 
  Work Description: XenoAmess commented on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669180712


   > Do you have any proof that using UnsyncBufferedReader etc in contentEquals 
will result in a slow-down unless further changes are made to contentEquals?
   
   Yes, I ran a rough performance test on a same pc, and the result be time 
9e8.(the current version of this pr shows 4.6e8, and master 2.8e9)

   > If so, what further changes are needed to contentEquals, and what is the 
speed improvement?
   
   That trick only be possible when we comparing two(or several) InputReaders.
   I shared an index on them, thus the two buffer's index be a same local 
variable.



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: 466775)
Time Spent: 11h 40m  (was: 11.5h)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 11h 40m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] XenoAmess edited a comment on pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


XenoAmess edited a comment on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669180712







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

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




[GitHub] [commons-io] XenoAmess commented on pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


XenoAmess commented on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669180712


   > Do you have any proof that using UnsyncBufferedReader etc in contentEquals 
will result in a slow-down unless further changes are made to contentEquals?
   
   Yes, I ran a rough performance test on a same pc, and the result be time 
9e8.(the current version of this pr shows 4.6e8, and master 2.8e9)

   > If so, what further changes are needed to contentEquals, and what is the 
speed improvement?
   
   That trick only be possible when we comparing two(or several) InputReaders.
   I shared an index on them, thus the two buffer's index be a same local 
variable.



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] (CSV-206) Allow to use multiple-characters delimiter to separate column as withColumnSeparator: withDelimiter

2020-08-05 Thread Nikita Salapura (Jira)


[ 
https://issues.apache.org/jira/browse/CSV-206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17171483#comment-17171483
 ] 

Nikita Salapura commented on CSV-206:
-

Hi!
I'm looking forward to this issue too, because it's useful for me.

Could you provide any info about its realease date, please?

Thank you:)

> Allow to use multiple-characters delimiter to separate column as 
> withColumnSeparator: withDelimiter
> ---
>
> Key: CSV-206
> URL: https://issues.apache.org/jira/browse/CSV-206
> Project: Commons CSV
>  Issue Type: Improvement
>Reporter: jefferyyuan
>Priority: Major
>  Labels: commons, commons-csv, csv, csvparser
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> It's not uncommon that we use multiple-characters delimiter to separate 
> columns in CVS: such as: [|]
> Sometimes, we have no choice as third-party defines the csv format like that.
> It would be great if apache commons.csv supports this function.
> I did some google search: seems there is no java library that supports use 
> multiple-characters as the column separator.
> But the C# CsvHelper does
> https://github.com/JoshClose/CsvHelper



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-vfs] garydgregory commented on pull request #107: Fix some test error when jvm's default language is not en

2020-08-05 Thread GitBox


garydgregory commented on pull request #107:
URL: https://github.com/apache/commons-vfs/pull/107#issuecomment-669177864


   @PeterAlfredLee 
   Which asserts do this which which locale? I am wondering if there is an 
simple fix in the test code. As well, do we need to configure some tests with 
different different locales instead of forcing single locale build-wide?



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-vfs] garydgregory merged pull request #96: Modify some loop using stream API

2020-08-05 Thread GitBox


garydgregory merged pull request #96:
URL: https://github.com/apache/commons-vfs/pull/96


   



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-vfs] garydgregory commented on a change in pull request #96: Modify some loop using stream API

2020-08-05 Thread GitBox


garydgregory commented on a change in pull request #96:
URL: https://github.com/apache/commons-vfs/pull/96#discussion_r465702883



##
File path: 
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractVfsContainer.java
##
@@ -81,11 +82,7 @@ public void close() {
 }
 
 // Close all components
-for (final Object component : toclose) {
-if (component instanceof VfsComponent) {
-final VfsComponent vfsComponent = (VfsComponent) component;
-vfsComponent.close();
-}
-}
+Arrays.stream(toclose).filter(component -> component instanceof 
VfsComponent)
+  .forEach(component -> ((VfsComponent) 
component).close());

Review comment:
   You're right, no need for the extra layer.





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-vfs] garydgregory commented on a change in pull request #93: [VFS-624] Fix for read() in constructors of LocalFileRandomAccessContent and RamFileRandomAccessContent

2020-08-05 Thread GitBox


garydgregory commented on a change in pull request #93:
URL: https://github.com/apache/commons-vfs/pull/93#discussion_r465702259



##
File path: 
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileRandomAccessContent.java
##
@@ -45,7 +45,7 @@
 @Override
 public int read() throws IOException {
 try {
-return raf.readByte();
+return raf.readByte() & 0xFF;

Review comment:
   For now I would just add it as a constant in 
`RamFileRandomAccessContent`. The only other place I see it used, is once in an 
unrelated sandbox class.





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-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466770=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466770
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 12:41
Start Date: 05/Aug/20 12:41
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669170277


   > Undynchronized should presumably be Unsynchronized?
   
   Phone keyboard! Right, today we have:
   - org.apache.commons.io.input.UnsynchronizedByteArrayInputStream
   - org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream
   
   > 
   > However, I think that makes the class names rather long.
   > I think Unsync is clear enough as a prefix (and avoids the issue of 
whether to use -ized or -ised)
   
   



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: 466770)
Time Spent: 11.5h  (was: 11h 20m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 11.5h
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] garydgregory commented on pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


garydgregory commented on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669170277


   > Undynchronized should presumably be Unsynchronized?
   
   Phone keyboard! Right, today we have:
   - org.apache.commons.io.input.UnsynchronizedByteArrayInputStream
   - org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream
   
   > 
   > However, I think that makes the class names rather long.
   > I think Unsync is clear enough as a prefix (and avoids the issue of 
whether to use -ized or -ised)
   
   



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-680) add more tests for IOUtils.contentEqualsIgnoreEOL

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-680?focusedWorklogId=466760=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466760
 ]

ASF GitHub Bot logged work on IO-680:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 12:12
Start Date: 05/Aug/20 12:12
Worklog Time Spent: 10m 
  Work Description: sebbASF commented on pull request #137:
URL: https://github.com/apache/commons-io/pull/137#issuecomment-669157338


   What conditions are missed by the existing tests?
   In any case, if new tests are needed, they should follow the existing syntax.
   Or better, such tests should be independent.



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: 466760)
Remaining Estimate: 0h
Time Spent: 10m

> add more tests for IOUtils.contentEqualsIgnoreEOL
> -
>
> Key: IO-680
> URL: https://issues.apache.org/jira/browse/IO-680
> Project: Commons IO
>  Issue Type: Test
>Reporter: Jin Xu
>Priority: Minor
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/137]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] sebbASF commented on pull request #137: [IO-680] add more tests for IOUtils.contentEqualsIgnoreEOL

2020-08-05 Thread GitBox


sebbASF commented on pull request #137:
URL: https://github.com/apache/commons-io/pull/137#issuecomment-669157338


   What conditions are missed by the existing tests?
   In any case, if new tests are needed, they should follow the existing syntax.
   Or better, such tests should be independent.



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

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




[jira] [Commented] (IO-680) add more tests for IOUtils.contentEqualsIgnoreEOL

2020-08-05 Thread Sebb (Jira)


[ 
https://issues.apache.org/jira/browse/IO-680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17171453#comment-17171453
 ] 

Sebb commented on IO-680:
-

What is the reason for the new tests?
I'm not clear what conditions are missed by the existing tests.

> add more tests for IOUtils.contentEqualsIgnoreEOL
> -
>
> Key: IO-680
> URL: https://issues.apache.org/jira/browse/IO-680
> Project: Commons IO
>  Issue Type: Test
>Reporter: Jin Xu
>Priority: Minor
>
> [https://github.com/apache/commons-io/pull/137]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466757=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466757
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 12:06
Start Date: 05/Aug/20 12:06
Worklog Time Spent: 10m 
  Work Description: sebbASF commented on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669154882


   Do you have any proof that using UnsyncBufferedReader etc in contentEquals 
will result in a slow-down unless further changes are made to contentEquals?
   
   If so, what further changes are needed to contentEquals, and what is the 
speed improvement?
   
   As to any renaming, that can be done later.



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: 466757)
Time Spent: 11h 20m  (was: 11h 10m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 11h 20m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] sebbASF commented on pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


sebbASF commented on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669154882


   Do you have any proof that using UnsyncBufferedReader etc in contentEquals 
will result in a slow-down unless further changes are made to contentEquals?
   
   If so, what further changes are needed to contentEquals, and what is the 
speed improvement?
   
   As to any renaming, that can be done later.



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-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466753=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466753
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 11:44
Start Date: 05/Aug/20 11:44
Worklog Time Spent: 10m 
  Work Description: XenoAmess edited a comment on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669144943


   @sebbASF @garydgregory 
   
   > Also, the existing prefix we use is Undynchronized, not Unsync. Gary
   
   > Undynchronized should presumably be Unsynchronized?
   > 
   > However, I think that makes the class names rather long.
   > I think Unsync is clear enough as a prefix (and avoids the issue of 
whether to use -ized or -ised)
   
   I'm neutral on the naming question.
   If you get an agreement about it, I'm glad to rename the two classes 
according to the result.



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: 466753)
Time Spent: 11h 10m  (was: 11h)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 11h 10m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466751=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466751
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 11:43
Start Date: 05/Aug/20 11:43
Worklog Time Spent: 10m 
  Work Description: XenoAmess edited a comment on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669143244


   @sebbASF
   
   > AFAICT the new classes UnsyncBufferedReader etc are not actually used 
(except in test code).
   
   yes, they are not quite used, but used for being parent class of 
LineEndUnifiedBufferedReader
   
   I also have a plan to use them insteadof BufferedReader in some other places 
in this repo.
   
   But this pr is already large, and I don't think it good to change too much 
more things.
   
   > I would expect all the contentEquals methods to remain exactly the same 
except for changes to the input sources.
   > The logic should remain unchanged (otherwise the new classes are not 
proper replacements).
   
   It can, but have huge performance lost.
   
   I also used another trick in those contentEquals functions, which cannot be 
used if we use that classes.
   And if we use the two classes there, will be 1 time slower than the 
functions we used in this pr (still be about 2 times faster than original)
   
   > Likewise I would not expect to see any changes to test cases, only new 
ones for the new classes, and perhaps a few new samples for existing methods 
where the coverage is incomplete.
   
   The changes in test are already moved to another pr, at 
https://github.com/apache/commons-io/pull/137
   



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: 466751)
Time Spent: 11h  (was: 10h 50m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 11h
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] XenoAmess edited a comment on pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


XenoAmess edited a comment on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669143244


   @sebbASF
   
   > AFAICT the new classes UnsyncBufferedReader etc are not actually used 
(except in test code).
   
   yes, they are not quite used, but used for being parent class of 
LineEndUnifiedBufferedReader
   
   I also have a plan to use them insteadof BufferedReader in some other places 
in this repo.
   
   But this pr is already large, and I don't think it good to change too much 
more things.
   
   > I would expect all the contentEquals methods to remain exactly the same 
except for changes to the input sources.
   > The logic should remain unchanged (otherwise the new classes are not 
proper replacements).
   
   It can, but have huge performance lost.
   
   I also used another trick in those contentEquals functions, which cannot be 
used if we use that classes.
   And if we use the two classes there, will be 1 time slower than the 
functions we used in this pr (still be about 2 times faster than original)
   
   > Likewise I would not expect to see any changes to test cases, only new 
ones for the new classes, and perhaps a few new samples for existing methods 
where the coverage is incomplete.
   
   The changes in test are already moved to another pr, at 
https://github.com/apache/commons-io/pull/137
   



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

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




[GitHub] [commons-io] XenoAmess edited a comment on pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


XenoAmess edited a comment on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669144943


   @sebbASF @garydgregory 
   
   > Also, the existing prefix we use is Undynchronized, not Unsync. Gary
   
   > Undynchronized should presumably be Unsynchronized?
   > 
   > However, I think that makes the class names rather long.
   > I think Unsync is clear enough as a prefix (and avoids the issue of 
whether to use -ized or -ised)
   
   I'm neutral on the naming question.
   If you get an agreement about it, I'm glad to rename the two classes 
according to the result.



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-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466750=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466750
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 11:42
Start Date: 05/Aug/20 11:42
Worklog Time Spent: 10m 
  Work Description: XenoAmess edited a comment on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669143244


   @sebbASF
   
   > AFAICT the new classes UnsyncBufferedReader etc are not actually used 
(except in test code).
   
   yes, they are not quite used, but used for being parent class of 
   
   > I would expect all the contentEquals methods to remain exactly the same 
except for changes to the input sources.
   > The logic should remain unchanged (otherwise the new classes are not 
proper replacements).
   
   It can, but have huge performance lost.
   
   I also used another trick in those contentEquals functions, which cannot be 
used if we use that classes.
   And if we use the two classes there, will be 1 time slower than the 
functions we used in this pr (still be about 2 times faster than original)
   
   > Likewise I would not expect to see any changes to test cases, only new 
ones for the new classes, and perhaps a few new samples for existing methods 
where the coverage is incomplete.
   
   The changes in test are already moved to another pr, at 
https://github.com/apache/commons-io/pull/137
   



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: 466750)
Time Spent: 10h 50m  (was: 10h 40m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 10h 50m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466748=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466748
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 11:42
Start Date: 05/Aug/20 11:42
Worklog Time Spent: 10m 
  Work Description: XenoAmess commented on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669144943


   > Also, the existing prefix we use is Undynchronized, not Unsync. Gary
   
   > Undynchronized should presumably be Unsynchronized?
   > 
   > However, I think that makes the class names rather long.
   > I think Unsync is clear enough as a prefix (and avoids the issue of 
whether to use -ized or -ised)
   
   I'm neutral on the naming question.
   If you get an agreement about it, I'm glad to rename the two classes 
according to the result.



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: 466748)
Time Spent: 10h 40m  (was: 10.5h)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 10h 40m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] XenoAmess edited a comment on pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


XenoAmess edited a comment on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669143244


   @sebbASF
   
   > AFAICT the new classes UnsyncBufferedReader etc are not actually used 
(except in test code).
   
   yes, they are not quite used, but used for being parent class of 
   
   > I would expect all the contentEquals methods to remain exactly the same 
except for changes to the input sources.
   > The logic should remain unchanged (otherwise the new classes are not 
proper replacements).
   
   It can, but have huge performance lost.
   
   I also used another trick in those contentEquals functions, which cannot be 
used if we use that classes.
   And if we use the two classes there, will be 1 time slower than the 
functions we used in this pr (still be about 2 times faster than original)
   
   > Likewise I would not expect to see any changes to test cases, only new 
ones for the new classes, and perhaps a few new samples for existing methods 
where the coverage is incomplete.
   
   The changes in test are already moved to another pr, at 
https://github.com/apache/commons-io/pull/137
   



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

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




[GitHub] [commons-io] XenoAmess commented on pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


XenoAmess commented on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669144943


   > Also, the existing prefix we use is Undynchronized, not Unsync. Gary
   
   > Undynchronized should presumably be Unsynchronized?
   > 
   > However, I think that makes the class names rather long.
   > I think Unsync is clear enough as a prefix (and avoids the issue of 
whether to use -ized or -ised)
   
   I'm neutral on the naming question.
   If you get an agreement about it, I'm glad to rename the two classes 
according to the result.



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-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466745=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466745
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 11:37
Start Date: 05/Aug/20 11:37
Worklog Time Spent: 10m 
  Work Description: XenoAmess commented on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669143244


   > AFAICT the new classes UnsyncBufferedReader etc are not actually used 
(except in test code).
   
   yes, they are not quite used, but used for being parent class of 
   
   > I would expect all the contentEquals methods to remain exactly the same 
except for changes to the input sources.
   > The logic should remain unchanged (otherwise the new classes are not 
proper replacements).
   
   It can, but have huge performance lost.
   
   I also used another trick in those contentEquals functions, which cannot be 
used if we use that classes.
   And if we use the two classes there, will be 1 time slower than the 
functions we used in this pr (still be about 2 times faster than original)
   
   > Likewise I would not expect to see any changes to test cases, only new 
ones for the new classes, and perhaps a few new samples for existing methods 
where the coverage is incomplete.
   
   The changes in test are already moved to another pr, at 
https://github.com/apache/commons-io/pull/137
   



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: 466745)
Time Spent: 10.5h  (was: 10h 20m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 10.5h
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-codec] rickyma removed a comment on pull request #54: [CODEC-292] Misspelling in comments 'They' -> 'The'

2020-08-05 Thread GitBox


rickyma removed a comment on pull request #54:
URL: https://github.com/apache/commons-codec/pull/54#issuecomment-668675430







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

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




[GitHub] [commons-io] XenoAmess commented on pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


XenoAmess commented on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669143244


   > AFAICT the new classes UnsyncBufferedReader etc are not actually used 
(except in test code).
   
   yes, they are not quite used, but used for being parent class of 
   
   > I would expect all the contentEquals methods to remain exactly the same 
except for changes to the input sources.
   > The logic should remain unchanged (otherwise the new classes are not 
proper replacements).
   
   It can, but have huge performance lost.
   
   I also used another trick in those contentEquals functions, which cannot be 
used if we use that classes.
   And if we use the two classes there, will be 1 time slower than the 
functions we used in this pr (still be about 2 times faster than original)
   
   > Likewise I would not expect to see any changes to test cases, only new 
ones for the new classes, and perhaps a few new samples for existing methods 
where the coverage is incomplete.
   
   The changes in test are already moved to another pr, at 
https://github.com/apache/commons-io/pull/137
   



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-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466741=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466741
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 11:28
Start Date: 05/Aug/20 11:28
Worklog Time Spent: 10m 
  Work Description: XenoAmess commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465659496



##
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##
@@ -311,28 +314,38 @@ public synchronized void close() throws IOException {
 assertTrue(IOUtils.contentEqualsIgnoreEOL(input1, input1));
 }
 
-Reader r1;
-Reader r2;
-
-r1 = new CharArrayReader("".toCharArray());
-r2 = new CharArrayReader("".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("1".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("2".toCharArray());
-assertFalse(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("123\rabc".toCharArray());
-r2 = new CharArrayReader("123\nabc".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("321".toCharArray());
-r2 = new CharArrayReader("321\r\n".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
+testSingleEOL("", "", true);
+testSingleEOL("", "\n", true);
+testSingleEOL("", "\r", true);
+testSingleEOL("", "\r\n", true);
+testSingleEOL("", "\r\r", false);
+testSingleEOL("", "\n\n", false);
+testSingleEOL("1", "1", true);
+testSingleEOL("1", "2", false);
+testSingleEOL("123\rabc", "123\nabc", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\naabb", false);
+testSingleEOL("321", "321\n", true);
+testSingleEOL("321", "321\r", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\r", false);
+testSingleEOL("321", "321\n\r", false);
+testSingleEOL("321\n", "321", true);
+testSingleEOL("321\n", "321\n\r", false);
+testSingleEOL("321\n", "321\r\n", true);
+testSingleEOL("321\r", "321\r\n", true);
+testSingleEOL("321\r\n", "321\r\n\r", false);
+testSingleEOL("123", "1234", false);
+}
+

Review comment:
   @sebbASF 
   pr created at
   https://github.com/apache/commons-io/pull/137





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: 466741)
Time Spent: 10h 20m  (was: 10h 10m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 10h 20m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466740=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466740
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 11:28
Start Date: 05/Aug/20 11:28
Worklog Time Spent: 10m 
  Work Description: sebbASF commented on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669139532


   Undynchronized should presumably be Unsynchronized?
   
   However, I think that makes the class names rather long.
   I think Unsync is clear enough as a prefix (and avoids the issue of whether 
to use -ized or -ised)



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: 466740)
Time Spent: 10h 10m  (was: 10h)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 10h 10m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] XenoAmess commented on a change in pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


XenoAmess commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465659496



##
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##
@@ -311,28 +314,38 @@ public synchronized void close() throws IOException {
 assertTrue(IOUtils.contentEqualsIgnoreEOL(input1, input1));
 }
 
-Reader r1;
-Reader r2;
-
-r1 = new CharArrayReader("".toCharArray());
-r2 = new CharArrayReader("".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("1".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("2".toCharArray());
-assertFalse(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("123\rabc".toCharArray());
-r2 = new CharArrayReader("123\nabc".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("321".toCharArray());
-r2 = new CharArrayReader("321\r\n".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
+testSingleEOL("", "", true);
+testSingleEOL("", "\n", true);
+testSingleEOL("", "\r", true);
+testSingleEOL("", "\r\n", true);
+testSingleEOL("", "\r\r", false);
+testSingleEOL("", "\n\n", false);
+testSingleEOL("1", "1", true);
+testSingleEOL("1", "2", false);
+testSingleEOL("123\rabc", "123\nabc", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\naabb", false);
+testSingleEOL("321", "321\n", true);
+testSingleEOL("321", "321\r", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\r", false);
+testSingleEOL("321", "321\n\r", false);
+testSingleEOL("321\n", "321", true);
+testSingleEOL("321\n", "321\n\r", false);
+testSingleEOL("321\n", "321\r\n", true);
+testSingleEOL("321\r", "321\r\n", true);
+testSingleEOL("321\r\n", "321\r\n\r", false);
+testSingleEOL("123", "1234", false);
+}
+

Review comment:
   @sebbASF 
   pr created at
   https://github.com/apache/commons-io/pull/137





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

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




[GitHub] [commons-io] sebbASF commented on pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


sebbASF commented on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669139532


   Undynchronized should presumably be Unsynchronized?
   
   However, I think that makes the class names rather long.
   I think Unsync is clear enough as a prefix (and avoids the issue of whether 
to use -ized or -ised)



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] (IO-680) add more tests for IOUtils.contentEqualsIgnoreEOL

2020-08-05 Thread Jin Xu (Jira)
Jin Xu created IO-680:
-

 Summary: add more tests for IOUtils.contentEqualsIgnoreEOL
 Key: IO-680
 URL: https://issues.apache.org/jira/browse/IO-680
 Project: Commons IO
  Issue Type: Test
Reporter: Jin Xu


[https://github.com/apache/commons-io/pull/137]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] XenoAmess opened a new pull request #137: add more tests for IOUtils.contentEqualsIgnoreEOL

2020-08-05 Thread GitBox


XenoAmess opened a new pull request #137:
URL: https://github.com/apache/commons-io/pull/137


   



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-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466737=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466737
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 11:23
Start Date: 05/Aug/20 11:23
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669137557


   Also, the existing prefix we use is Undynchronized, not Unsync.
   
   Gary
   
   On Wed, Aug 5, 2020, 05:48 sebbASF  wrote:
   
   > AFAICT the new classes UnsyncBufferedReader etc are not actually used
   > (except in test code).
   >
   > I would expect all the contentEquals methods to remain exactly the same
   > except for changes to the input sources.
   > The logic should remain unchanged (otherwise the new classes are not
   > proper replacements).
   >
   > Likewise I would not expect to see any changes to test cases, only new
   > ones for the new classes, and perhaps a few new samples for existing
   > methods where the coverage is incomplete.
   >
   > —
   > You are receiving this because you were mentioned.
   > Reply to this email directly, view it on GitHub
   > ,
   > or unsubscribe
   > 

   > .
   >
   



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: 466737)
Time Spent: 10h  (was: 9h 50m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 10h
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] garydgregory commented on pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


garydgregory commented on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-669137557


   Also, the existing prefix we use is Undynchronized, not Unsync.
   
   Gary
   
   On Wed, Aug 5, 2020, 05:48 sebbASF  wrote:
   
   > AFAICT the new classes UnsyncBufferedReader etc are not actually used
   > (except in test code).
   >
   > I would expect all the contentEquals methods to remain exactly the same
   > except for changes to the input sources.
   > The logic should remain unchanged (otherwise the new classes are not
   > proper replacements).
   >
   > Likewise I would not expect to see any changes to test cases, only new
   > ones for the new classes, and perhaps a few new samples for existing
   > methods where the coverage is incomplete.
   >
   > —
   > You are receiving this because you were mentioned.
   > Reply to this email directly, view it on GitHub
   > ,
   > or unsubscribe
   > 

   > .
   >
   



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-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466731=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466731
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 10:49
Start Date: 05/Aug/20 10:49
Worklog Time Spent: 10m 
  Work Description: sebbASF commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465638699



##
File path: 
src/main/java/org/apache/commons/io/input/buffer/UnsyncBufferedInputStream.java
##
@@ -0,0 +1,207 @@
+/*
+ * 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.io.input.buffer;
+
+import java.io.IOException;
+import java.io.InputStream;
+import org.apache.commons.io.IOUtils;
+import static org.apache.commons.io.IOUtils.EOF;
+
+/**
+ * A BufferedReader class who does not care about thread safety, but very much 
faster.
+ *
+ * Should be able to replace java.io.BufferedReader in nearly every use-cases 
when you
+ * need the Reader be buffered, but do not need it have thread safety.
+ */
+public class UnsyncBufferedInputStream extends InputStream {
+protected final InputStream inputStream;
+protected final byte[] byteBuffer;
+
+protected int nowIndex = 0;
+protected int nowLimit = 0;
+

Review comment:
   AFAICT UnsyncBufferedInputStream does not need to expose any 
getter/setter methods, not does it need to expose eat().
   As to UnsyncBufferedReader, AFAICT LineEndUnifiedBufferedReader could be 
rewritten to act as a Filter which would then make it more versatile.





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: 466731)
Time Spent: 9h 50m  (was: 9h 40m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 9h 50m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] sebbASF commented on a change in pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


sebbASF commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465638699



##
File path: 
src/main/java/org/apache/commons/io/input/buffer/UnsyncBufferedInputStream.java
##
@@ -0,0 +1,207 @@
+/*
+ * 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.io.input.buffer;
+
+import java.io.IOException;
+import java.io.InputStream;
+import org.apache.commons.io.IOUtils;
+import static org.apache.commons.io.IOUtils.EOF;
+
+/**
+ * A BufferedReader class who does not care about thread safety, but very much 
faster.
+ *
+ * Should be able to replace java.io.BufferedReader in nearly every use-cases 
when you
+ * need the Reader be buffered, but do not need it have thread safety.
+ */
+public class UnsyncBufferedInputStream extends InputStream {
+protected final InputStream inputStream;
+protected final byte[] byteBuffer;
+
+protected int nowIndex = 0;
+protected int nowLimit = 0;
+

Review comment:
   AFAICT UnsyncBufferedInputStream does not need to expose any 
getter/setter methods, not does it need to expose eat().
   As to UnsyncBufferedReader, AFAICT LineEndUnifiedBufferedReader could be 
rewritten to act as a Filter which would then make it more versatile.





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-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466721=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466721
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 10:18
Start Date: 05/Aug/20 10:18
Worklog Time Spent: 10m 
  Work Description: XenoAmess commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465623190



##
File path: 
src/main/java/org/apache/commons/io/input/buffer/UnsyncBufferedInputStream.java
##
@@ -0,0 +1,207 @@
+/*
+ * 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.io.input.buffer;
+
+import java.io.IOException;
+import java.io.InputStream;
+import org.apache.commons.io.IOUtils;
+import static org.apache.commons.io.IOUtils.EOF;
+
+/**
+ * A BufferedReader class who does not care about thread safety, but very much 
faster.
+ *
+ * Should be able to replace java.io.BufferedReader in nearly every use-cases 
when you
+ * need the Reader be buffered, but do not need it have thread safety.
+ */
+public class UnsyncBufferedInputStream extends InputStream {
+protected final InputStream inputStream;
+protected final byte[] byteBuffer;
+
+protected int nowIndex = 0;
+protected int nowLimit = 0;
+

Review comment:
   @sebbASF
   Hi.
   for the protected fields:
   OK, I can change them to private.
   for the public functions:
   they are already as less as can.





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: 466721)
Time Spent: 9h 40m  (was: 9.5h)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 9h 40m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] XenoAmess commented on a change in pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


XenoAmess commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465623190



##
File path: 
src/main/java/org/apache/commons/io/input/buffer/UnsyncBufferedInputStream.java
##
@@ -0,0 +1,207 @@
+/*
+ * 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.io.input.buffer;
+
+import java.io.IOException;
+import java.io.InputStream;
+import org.apache.commons.io.IOUtils;
+import static org.apache.commons.io.IOUtils.EOF;
+
+/**
+ * A BufferedReader class who does not care about thread safety, but very much 
faster.
+ *
+ * Should be able to replace java.io.BufferedReader in nearly every use-cases 
when you
+ * need the Reader be buffered, but do not need it have thread safety.
+ */
+public class UnsyncBufferedInputStream extends InputStream {
+protected final InputStream inputStream;
+protected final byte[] byteBuffer;
+
+protected int nowIndex = 0;
+protected int nowLimit = 0;
+

Review comment:
   @sebbASF
   Hi.
   for the protected fields:
   OK, I can change them to private.
   for the public functions:
   they are already as less as can.





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-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466718=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466718
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 10:16
Start Date: 05/Aug/20 10:16
Worklog Time Spent: 10m 
  Work Description: XenoAmess commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465622006



##
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##
@@ -311,28 +314,38 @@ public synchronized void close() throws IOException {
 assertTrue(IOUtils.contentEqualsIgnoreEOL(input1, input1));
 }
 
-Reader r1;
-Reader r2;
-
-r1 = new CharArrayReader("".toCharArray());
-r2 = new CharArrayReader("".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("1".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("2".toCharArray());
-assertFalse(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("123\rabc".toCharArray());
-r2 = new CharArrayReader("123\nabc".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("321".toCharArray());
-r2 = new CharArrayReader("321\r\n".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
+testSingleEOL("", "", true);
+testSingleEOL("", "\n", true);
+testSingleEOL("", "\r", true);
+testSingleEOL("", "\r\n", true);
+testSingleEOL("", "\r\r", false);
+testSingleEOL("", "\n\n", false);
+testSingleEOL("1", "1", true);
+testSingleEOL("1", "2", false);
+testSingleEOL("123\rabc", "123\nabc", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\naabb", false);
+testSingleEOL("321", "321\n", true);
+testSingleEOL("321", "321\r", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\r", false);
+testSingleEOL("321", "321\n\r", false);
+testSingleEOL("321\n", "321", true);
+testSingleEOL("321\n", "321\n\r", false);
+testSingleEOL("321\n", "321\r\n", true);
+testSingleEOL("321\r", "321\r\n", true);
+testSingleEOL("321\r\n", "321\r\n\r", false);
+testSingleEOL("123", "1234", false);
+}
+

Review comment:
   @sebbASF OK, I will create a new pr for the changes in 
IOUtilsTestCase.java





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: 466718)
Time Spent: 9.5h  (was: 9h 20m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 9.5h
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466717=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466717
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 10:16
Start Date: 05/Aug/20 10:16
Worklog Time Spent: 10m 
  Work Description: XenoAmess commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465622006



##
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##
@@ -311,28 +314,38 @@ public synchronized void close() throws IOException {
 assertTrue(IOUtils.contentEqualsIgnoreEOL(input1, input1));
 }
 
-Reader r1;
-Reader r2;
-
-r1 = new CharArrayReader("".toCharArray());
-r2 = new CharArrayReader("".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("1".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("2".toCharArray());
-assertFalse(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("123\rabc".toCharArray());
-r2 = new CharArrayReader("123\nabc".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("321".toCharArray());
-r2 = new CharArrayReader("321\r\n".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
+testSingleEOL("", "", true);
+testSingleEOL("", "\n", true);
+testSingleEOL("", "\r", true);
+testSingleEOL("", "\r\n", true);
+testSingleEOL("", "\r\r", false);
+testSingleEOL("", "\n\n", false);
+testSingleEOL("1", "1", true);
+testSingleEOL("1", "2", false);
+testSingleEOL("123\rabc", "123\nabc", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\naabb", false);
+testSingleEOL("321", "321\n", true);
+testSingleEOL("321", "321\r", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\r", false);
+testSingleEOL("321", "321\n\r", false);
+testSingleEOL("321\n", "321", true);
+testSingleEOL("321\n", "321\n\r", false);
+testSingleEOL("321\n", "321\r\n", true);
+testSingleEOL("321\r", "321\r\n", true);
+testSingleEOL("321\r\n", "321\r\n\r", false);
+testSingleEOL("123", "1234", false);
+}
+

Review comment:
   @sebbASF OK, I will create a new pr for the changes IOUtilsTestCase.java





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: 466717)
Time Spent: 9h 20m  (was: 9h 10m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 9h 20m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] XenoAmess commented on a change in pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


XenoAmess commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465622006



##
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##
@@ -311,28 +314,38 @@ public synchronized void close() throws IOException {
 assertTrue(IOUtils.contentEqualsIgnoreEOL(input1, input1));
 }
 
-Reader r1;
-Reader r2;
-
-r1 = new CharArrayReader("".toCharArray());
-r2 = new CharArrayReader("".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("1".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("2".toCharArray());
-assertFalse(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("123\rabc".toCharArray());
-r2 = new CharArrayReader("123\nabc".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("321".toCharArray());
-r2 = new CharArrayReader("321\r\n".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
+testSingleEOL("", "", true);
+testSingleEOL("", "\n", true);
+testSingleEOL("", "\r", true);
+testSingleEOL("", "\r\n", true);
+testSingleEOL("", "\r\r", false);
+testSingleEOL("", "\n\n", false);
+testSingleEOL("1", "1", true);
+testSingleEOL("1", "2", false);
+testSingleEOL("123\rabc", "123\nabc", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\naabb", false);
+testSingleEOL("321", "321\n", true);
+testSingleEOL("321", "321\r", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\r", false);
+testSingleEOL("321", "321\n\r", false);
+testSingleEOL("321\n", "321", true);
+testSingleEOL("321\n", "321\n\r", false);
+testSingleEOL("321\n", "321\r\n", true);
+testSingleEOL("321\r", "321\r\n", true);
+testSingleEOL("321\r\n", "321\r\n\r", false);
+testSingleEOL("123", "1234", false);
+}
+

Review comment:
   @sebbASF OK, I will create a new pr for the changes in 
IOUtilsTestCase.java





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

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




[GitHub] [commons-io] XenoAmess commented on a change in pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


XenoAmess commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465622006



##
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##
@@ -311,28 +314,38 @@ public synchronized void close() throws IOException {
 assertTrue(IOUtils.contentEqualsIgnoreEOL(input1, input1));
 }
 
-Reader r1;
-Reader r2;
-
-r1 = new CharArrayReader("".toCharArray());
-r2 = new CharArrayReader("".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("1".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("2".toCharArray());
-assertFalse(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("123\rabc".toCharArray());
-r2 = new CharArrayReader("123\nabc".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("321".toCharArray());
-r2 = new CharArrayReader("321\r\n".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
+testSingleEOL("", "", true);
+testSingleEOL("", "\n", true);
+testSingleEOL("", "\r", true);
+testSingleEOL("", "\r\n", true);
+testSingleEOL("", "\r\r", false);
+testSingleEOL("", "\n\n", false);
+testSingleEOL("1", "1", true);
+testSingleEOL("1", "2", false);
+testSingleEOL("123\rabc", "123\nabc", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\naabb", false);
+testSingleEOL("321", "321\n", true);
+testSingleEOL("321", "321\r", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\r", false);
+testSingleEOL("321", "321\n\r", false);
+testSingleEOL("321\n", "321", true);
+testSingleEOL("321\n", "321\n\r", false);
+testSingleEOL("321\n", "321\r\n", true);
+testSingleEOL("321\r", "321\r\n", true);
+testSingleEOL("321\r\n", "321\r\n\r", false);
+testSingleEOL("123", "1234", false);
+}
+

Review comment:
   @sebbASF OK, I will create a new pr for the changes IOUtilsTestCase.java





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-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466705=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466705
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 10:06
Start Date: 05/Aug/20 10:06
Worklog Time Spent: 10m 
  Work Description: sebbASF commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465616775



##
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##
@@ -311,28 +314,38 @@ public synchronized void close() throws IOException {
 assertTrue(IOUtils.contentEqualsIgnoreEOL(input1, input1));
 }
 
-Reader r1;
-Reader r2;
-
-r1 = new CharArrayReader("".toCharArray());
-r2 = new CharArrayReader("".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("1".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("2".toCharArray());
-assertFalse(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("123\rabc".toCharArray());
-r2 = new CharArrayReader("123\nabc".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("321".toCharArray());
-r2 = new CharArrayReader("321\r\n".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
+testSingleEOL("", "", true);
+testSingleEOL("", "\n", true);
+testSingleEOL("", "\r", true);
+testSingleEOL("", "\r\n", true);
+testSingleEOL("", "\r\r", false);
+testSingleEOL("", "\n\n", false);
+testSingleEOL("1", "1", true);
+testSingleEOL("1", "2", false);
+testSingleEOL("123\rabc", "123\nabc", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\naabb", false);
+testSingleEOL("321", "321\n", true);
+testSingleEOL("321", "321\r", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\r", false);
+testSingleEOL("321", "321\n\r", false);
+testSingleEOL("321\n", "321", true);
+testSingleEOL("321\n", "321\n\r", false);
+testSingleEOL("321\n", "321\r\n", true);
+testSingleEOL("321\r", "321\r\n", true);
+testSingleEOL("321\r\n", "321\r\n\r", false);
+testSingleEOL("123", "1234", false);
+}
+

Review comment:
   Issues with existing tests are should be handled by a separate PR.
   For new code, I would only expect to see new tests.





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

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


Issue Time Tracking
---

Worklog Id: (was: 466705)
Time Spent: 9h 10m  (was: 9h)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 9h 10m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] sebbASF commented on a change in pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


sebbASF commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465616775



##
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##
@@ -311,28 +314,38 @@ public synchronized void close() throws IOException {
 assertTrue(IOUtils.contentEqualsIgnoreEOL(input1, input1));
 }
 
-Reader r1;
-Reader r2;
-
-r1 = new CharArrayReader("".toCharArray());
-r2 = new CharArrayReader("".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("1".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("2".toCharArray());
-assertFalse(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("123\rabc".toCharArray());
-r2 = new CharArrayReader("123\nabc".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("321".toCharArray());
-r2 = new CharArrayReader("321\r\n".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
+testSingleEOL("", "", true);
+testSingleEOL("", "\n", true);
+testSingleEOL("", "\r", true);
+testSingleEOL("", "\r\n", true);
+testSingleEOL("", "\r\r", false);
+testSingleEOL("", "\n\n", false);
+testSingleEOL("1", "1", true);
+testSingleEOL("1", "2", false);
+testSingleEOL("123\rabc", "123\nabc", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\naabb", false);
+testSingleEOL("321", "321\n", true);
+testSingleEOL("321", "321\r", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\r", false);
+testSingleEOL("321", "321\n\r", false);
+testSingleEOL("321\n", "321", true);
+testSingleEOL("321\n", "321\n\r", false);
+testSingleEOL("321\n", "321\r\n", true);
+testSingleEOL("321\r", "321\r\n", true);
+testSingleEOL("321\r\n", "321\r\n\r", false);
+testSingleEOL("123", "1234", false);
+}
+

Review comment:
   Issues with existing tests are should be handled by a separate PR.
   For new code, I would only expect to see new tests.





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

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




[jira] [Work logged] (IO-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466703=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466703
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 10:01
Start Date: 05/Aug/20 10:01
Worklog Time Spent: 10m 
  Work Description: XenoAmess commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465612559



##
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##
@@ -311,28 +314,38 @@ public synchronized void close() throws IOException {
 assertTrue(IOUtils.contentEqualsIgnoreEOL(input1, input1));
 }
 
-Reader r1;
-Reader r2;
-
-r1 = new CharArrayReader("".toCharArray());
-r2 = new CharArrayReader("".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("1".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("2".toCharArray());
-assertFalse(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("123\rabc".toCharArray());
-r2 = new CharArrayReader("123\nabc".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("321".toCharArray());
-r2 = new CharArrayReader("321\r\n".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
+testSingleEOL("", "", true);
+testSingleEOL("", "\n", true);
+testSingleEOL("", "\r", true);
+testSingleEOL("", "\r\n", true);
+testSingleEOL("", "\r\r", false);
+testSingleEOL("", "\n\n", false);
+testSingleEOL("1", "1", true);
+testSingleEOL("1", "2", false);
+testSingleEOL("123\rabc", "123\nabc", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\naabb", false);
+testSingleEOL("321", "321\n", true);
+testSingleEOL("321", "321\r", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\r", false);
+testSingleEOL("321", "321\n\r", false);
+testSingleEOL("321\n", "321", true);
+testSingleEOL("321\n", "321\n\r", false);
+testSingleEOL("321\n", "321\r\n", true);
+testSingleEOL("321\r", "321\r\n", true);
+testSingleEOL("321\r\n", "321\r\n\r", false);
+testSingleEOL("123", "1234", false);
+}
+

Review comment:
   > Please don't make unrelated changes to test code.
   
   @sebbASF but the original tests are too loose, it did not cover some 
situations.
   in other words, codes which can pass the original tests might be wrong.
   So I added some test codes.
   If you want me to move them to a seperate new file, I'll do 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


Issue Time Tracking
---

Worklog Id: (was: 466703)
Time Spent: 9h  (was: 8h 50m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 9h
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466701=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466701
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 10:00
Start Date: 05/Aug/20 10:00
Worklog Time Spent: 10m 
  Work Description: sebbASF commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465613818



##
File path: 
src/main/java/org/apache/commons/io/input/buffer/UnsyncBufferedInputStream.java
##
@@ -0,0 +1,207 @@
+/*
+ * 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.io.input.buffer;
+
+import java.io.IOException;
+import java.io.InputStream;
+import org.apache.commons.io.IOUtils;
+import static org.apache.commons.io.IOUtils.EOF;
+
+/**
+ * A BufferedReader class who does not care about thread safety, but very much 
faster.
+ *
+ * Should be able to replace java.io.BufferedReader in nearly every use-cases 
when you
+ * need the Reader be buffered, but do not need it have thread safety.
+ */
+public class UnsyncBufferedInputStream extends InputStream {
+protected final InputStream inputStream;
+protected final byte[] byteBuffer;
+
+protected int nowIndex = 0;
+protected int nowLimit = 0;
+

Review comment:
   Fields should be private, otherwise they become part of the API and 
cannot be changed easily.
   They also make thorough testing much harder.
   
   If necessary, getters and/or setters can be added.
   But only if necessary, as they increase the testing requirements, and cannot 
be dropped once added.
   
   Similarly elsewhere.





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: 466701)
Time Spent: 8h 50m  (was: 8h 40m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 8h 50m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] XenoAmess commented on a change in pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


XenoAmess commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465612559



##
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##
@@ -311,28 +314,38 @@ public synchronized void close() throws IOException {
 assertTrue(IOUtils.contentEqualsIgnoreEOL(input1, input1));
 }
 
-Reader r1;
-Reader r2;
-
-r1 = new CharArrayReader("".toCharArray());
-r2 = new CharArrayReader("".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("1".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("2".toCharArray());
-assertFalse(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("123\rabc".toCharArray());
-r2 = new CharArrayReader("123\nabc".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("321".toCharArray());
-r2 = new CharArrayReader("321\r\n".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
+testSingleEOL("", "", true);
+testSingleEOL("", "\n", true);
+testSingleEOL("", "\r", true);
+testSingleEOL("", "\r\n", true);
+testSingleEOL("", "\r\r", false);
+testSingleEOL("", "\n\n", false);
+testSingleEOL("1", "1", true);
+testSingleEOL("1", "2", false);
+testSingleEOL("123\rabc", "123\nabc", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\naabb", false);
+testSingleEOL("321", "321\n", true);
+testSingleEOL("321", "321\r", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\r", false);
+testSingleEOL("321", "321\n\r", false);
+testSingleEOL("321\n", "321", true);
+testSingleEOL("321\n", "321\n\r", false);
+testSingleEOL("321\n", "321\r\n", true);
+testSingleEOL("321\r", "321\r\n", true);
+testSingleEOL("321\r\n", "321\r\n\r", false);
+testSingleEOL("123", "1234", false);
+}
+

Review comment:
   > Please don't make unrelated changes to test code.
   
   @sebbASF but the original tests are too loose, it did not cover some 
situations.
   in other words, codes which can pass the original tests might be wrong.
   So I added some test codes.
   If you want me to move them to a seperate new file, I'll do 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-io] sebbASF commented on a change in pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


sebbASF commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465613818



##
File path: 
src/main/java/org/apache/commons/io/input/buffer/UnsyncBufferedInputStream.java
##
@@ -0,0 +1,207 @@
+/*
+ * 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.io.input.buffer;
+
+import java.io.IOException;
+import java.io.InputStream;
+import org.apache.commons.io.IOUtils;
+import static org.apache.commons.io.IOUtils.EOF;
+
+/**
+ * A BufferedReader class who does not care about thread safety, but very much 
faster.
+ *
+ * Should be able to replace java.io.BufferedReader in nearly every use-cases 
when you
+ * need the Reader be buffered, but do not need it have thread safety.
+ */
+public class UnsyncBufferedInputStream extends InputStream {
+protected final InputStream inputStream;
+protected final byte[] byteBuffer;
+
+protected int nowIndex = 0;
+protected int nowLimit = 0;
+

Review comment:
   Fields should be private, otherwise they become part of the API and 
cannot be changed easily.
   They also make thorough testing much harder.
   
   If necessary, getters and/or setters can be added.
   But only if necessary, as they increase the testing requirements, and cannot 
be dropped once added.
   
   Similarly elsewhere.





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

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




[GitHub] [commons-io] XenoAmess commented on a change in pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


XenoAmess commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465613411



##
File path: 
src/test/java/org/apache/commons/io/input/buffer/CircularBufferInputStreamTest.java
##
@@ -70,6 +70,8 @@ public void testRandomRead() throws Exception {
throw new IllegalStateException("Unexpected 
random choice value");
}
}
+   bais.close();
+   cbis.close();
}

Review comment:
   @sebbASF agreed.





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-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466698=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466698
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 10:00
Start Date: 05/Aug/20 10:00
Worklog Time Spent: 10m 
  Work Description: XenoAmess commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465613411



##
File path: 
src/test/java/org/apache/commons/io/input/buffer/CircularBufferInputStreamTest.java
##
@@ -70,6 +70,8 @@ public void testRandomRead() throws Exception {
throw new IllegalStateException("Unexpected 
random choice value");
}
}
+   bais.close();
+   cbis.close();
}

Review comment:
   @sebbASF agreed.





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: 466698)
Time Spent: 8h 40m  (was: 8.5h)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 8h 40m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466697=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466697
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 09:58
Start Date: 05/Aug/20 09:58
Worklog Time Spent: 10m 
  Work Description: XenoAmess commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465612559



##
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##
@@ -311,28 +314,38 @@ public synchronized void close() throws IOException {
 assertTrue(IOUtils.contentEqualsIgnoreEOL(input1, input1));
 }
 
-Reader r1;
-Reader r2;
-
-r1 = new CharArrayReader("".toCharArray());
-r2 = new CharArrayReader("".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("1".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("2".toCharArray());
-assertFalse(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("123\rabc".toCharArray());
-r2 = new CharArrayReader("123\nabc".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("321".toCharArray());
-r2 = new CharArrayReader("321\r\n".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
+testSingleEOL("", "", true);
+testSingleEOL("", "\n", true);
+testSingleEOL("", "\r", true);
+testSingleEOL("", "\r\n", true);
+testSingleEOL("", "\r\r", false);
+testSingleEOL("", "\n\n", false);
+testSingleEOL("1", "1", true);
+testSingleEOL("1", "2", false);
+testSingleEOL("123\rabc", "123\nabc", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\naabb", false);
+testSingleEOL("321", "321\n", true);
+testSingleEOL("321", "321\r", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\r", false);
+testSingleEOL("321", "321\n\r", false);
+testSingleEOL("321\n", "321", true);
+testSingleEOL("321\n", "321\n\r", false);
+testSingleEOL("321\n", "321\r\n", true);
+testSingleEOL("321\r", "321\r\n", true);
+testSingleEOL("321\r\n", "321\r\n\r", false);
+testSingleEOL("123", "1234", false);
+}
+

Review comment:
   > Please don't make unrelated changes to test code.
   
   @sebbASF but the original tests are too loose, it did not cover some 
situations.
   in other words, codes which can pass the original tests might be wrong.
   So I added some test codes.
   If you want me to move them to another file, I'll do 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


Issue Time Tracking
---

Worklog Id: (was: 466697)
Time Spent: 8.5h  (was: 8h 20m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 8.5h
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] XenoAmess commented on a change in pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


XenoAmess commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465612559



##
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##
@@ -311,28 +314,38 @@ public synchronized void close() throws IOException {
 assertTrue(IOUtils.contentEqualsIgnoreEOL(input1, input1));
 }
 
-Reader r1;
-Reader r2;
-
-r1 = new CharArrayReader("".toCharArray());
-r2 = new CharArrayReader("".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("1".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("2".toCharArray());
-assertFalse(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("123\rabc".toCharArray());
-r2 = new CharArrayReader("123\nabc".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("321".toCharArray());
-r2 = new CharArrayReader("321\r\n".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
+testSingleEOL("", "", true);
+testSingleEOL("", "\n", true);
+testSingleEOL("", "\r", true);
+testSingleEOL("", "\r\n", true);
+testSingleEOL("", "\r\r", false);
+testSingleEOL("", "\n\n", false);
+testSingleEOL("1", "1", true);
+testSingleEOL("1", "2", false);
+testSingleEOL("123\rabc", "123\nabc", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\naabb", false);
+testSingleEOL("321", "321\n", true);
+testSingleEOL("321", "321\r", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\r", false);
+testSingleEOL("321", "321\n\r", false);
+testSingleEOL("321\n", "321", true);
+testSingleEOL("321\n", "321\n\r", false);
+testSingleEOL("321\n", "321\r\n", true);
+testSingleEOL("321\r", "321\r\n", true);
+testSingleEOL("321\r\n", "321\r\n\r", false);
+testSingleEOL("123", "1234", false);
+}
+

Review comment:
   > Please don't make unrelated changes to test code.
   
   @sebbASF but the original tests are too loose, it did not cover some 
situations.
   in other words, codes which can pass the original tests might be wrong.
   So I added some test codes.
   If you want me to move them to another file, I'll do 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




[jira] [Work logged] (IO-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466692=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466692
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 09:51
Start Date: 05/Aug/20 09:51
Worklog Time Spent: 10m 
  Work Description: sebbASF commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465608459



##
File path: 
src/test/java/org/apache/commons/io/input/buffer/CircularBufferInputStreamTest.java
##
@@ -70,6 +70,8 @@ public void testRandomRead() throws Exception {
throw new IllegalStateException("Unexpected 
random choice value");
}
}
+   bais.close();
+   cbis.close();
}

Review comment:
   This should be the subject of a separate 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


Issue Time Tracking
---

Worklog Id: (was: 466692)
Time Spent: 8h 10m  (was: 8h)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 8h 10m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-670) IOUtils.contentEquals is of low performance. I will refine it.

2020-08-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466694=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466694
 ]

ASF GitHub Bot logged work on IO-670:
-

Author: ASF GitHub Bot
Created on: 05/Aug/20 09:51
Start Date: 05/Aug/20 09:51
Worklog Time Spent: 10m 
  Work Description: sebbASF commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465608614



##
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##
@@ -311,28 +314,38 @@ public synchronized void close() throws IOException {
 assertTrue(IOUtils.contentEqualsIgnoreEOL(input1, input1));
 }
 
-Reader r1;
-Reader r2;
-
-r1 = new CharArrayReader("".toCharArray());
-r2 = new CharArrayReader("".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("1".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("2".toCharArray());
-assertFalse(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("123\rabc".toCharArray());
-r2 = new CharArrayReader("123\nabc".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("321".toCharArray());
-r2 = new CharArrayReader("321\r\n".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
+testSingleEOL("", "", true);
+testSingleEOL("", "\n", true);
+testSingleEOL("", "\r", true);
+testSingleEOL("", "\r\n", true);
+testSingleEOL("", "\r\r", false);
+testSingleEOL("", "\n\n", false);
+testSingleEOL("1", "1", true);
+testSingleEOL("1", "2", false);
+testSingleEOL("123\rabc", "123\nabc", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\naabb", false);
+testSingleEOL("321", "321\n", true);
+testSingleEOL("321", "321\r", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\r", false);
+testSingleEOL("321", "321\n\r", false);
+testSingleEOL("321\n", "321", true);
+testSingleEOL("321\n", "321\n\r", false);
+testSingleEOL("321\n", "321\r\n", true);
+testSingleEOL("321\r", "321\r\n", true);
+testSingleEOL("321\r\n", "321\r\n\r", false);
+testSingleEOL("123", "1234", false);
+}
+

Review comment:
   Please don't make unrelated changes to test 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.

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


Issue Time Tracking
---

Worklog Id: (was: 466694)
Time Spent: 8h 20m  (was: 8h 10m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --
>
> Key: IO-670
> URL: https://issues.apache.org/jira/browse/IO-670
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: Jin Xu
>Priority: Critical
> Attachments: jmh-result.org.apache.json
>
>  Time Spent: 8h 20m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] sebbASF commented on a change in pull request #118: [IO-670] refine IOUtils.contentEquals(Reader, Reader)

2020-08-05 Thread GitBox


sebbASF commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465608614



##
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##
@@ -311,28 +314,38 @@ public synchronized void close() throws IOException {
 assertTrue(IOUtils.contentEqualsIgnoreEOL(input1, input1));
 }
 
-Reader r1;
-Reader r2;
-
-r1 = new CharArrayReader("".toCharArray());
-r2 = new CharArrayReader("".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("1".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("1".toCharArray());
-r2 = new CharArrayReader("2".toCharArray());
-assertFalse(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("123\rabc".toCharArray());
-r2 = new CharArrayReader("123\nabc".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
-
-r1 = new CharArrayReader("321".toCharArray());
-r2 = new CharArrayReader("321\r\n".toCharArray());
-assertTrue(IOUtils.contentEqualsIgnoreEOL(r1, r2));
+testSingleEOL("", "", true);
+testSingleEOL("", "\n", true);
+testSingleEOL("", "\r", true);
+testSingleEOL("", "\r\n", true);
+testSingleEOL("", "\r\r", false);
+testSingleEOL("", "\n\n", false);
+testSingleEOL("1", "1", true);
+testSingleEOL("1", "2", false);
+testSingleEOL("123\rabc", "123\nabc", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\naabb", false);
+testSingleEOL("321", "321\n", true);
+testSingleEOL("321", "321\r", true);
+testSingleEOL("321", "321\r\n", true);
+testSingleEOL("321", "321\r\r", false);
+testSingleEOL("321", "321\n\r", false);
+testSingleEOL("321\n", "321", true);
+testSingleEOL("321\n", "321\n\r", false);
+testSingleEOL("321\n", "321\r\n", true);
+testSingleEOL("321\r", "321\r\n", true);
+testSingleEOL("321\r\n", "321\r\n\r", false);
+testSingleEOL("123", "1234", false);
+}
+

Review comment:
   Please don't make unrelated changes to test 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.

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




  1   2   >