[jira] [Updated] (IO-679) input.AbstractCharacterFilterReader passes count of chars read to filter, not the filter char
[ https://issues.apache.org/jira/browse/IO-679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Proneel Guptan updated IO-679: -- Description: Ran into a bug with AbstractCharacterFilterReader where I noticed that my filter was not receiving the actual characters, but was instead receiving an int value corresponding to the number of chars in my input stream buffer. I looked at the [source file|https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java] and realized that on line 64: {{if (filter(read)) {}} should have been: {{if (filter(cbuf[readPos])) {}} 'read` has the number of chars read from the source reader, not the code point of the character read. I have attached a sample program that illustrates the issue. I can work on a patch and submit it when done. I will add a test case in the patch. was: Ran into a bug with AbstractCharacterFilterReader where I noticed that my filter was not receiving the actual characters, but was instead receiving an int value corresponding to the number of chars in my input stream buffer. I looked at the [source file|https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java] and realized that on line 64: {{if (filter(read)) {}} should have been: {{if (filter(cbuf[readPos])) {}} 'read` has the number of chars read from the source reader, not the code point of the character read. I have attached a sample program that illustrates the issue. I can work on a patch and submit it when done. I will add a test case in the patch. > input.AbstractCharacterFilterReader passes count of chars read to filter, not > the filter char > - > > Key: IO-679 > URL: https://issues.apache.org/jira/browse/IO-679 > Project: Commons IO > Issue Type: Bug > Components: Streams/Writers >Affects Versions: 2.7 >Reporter: Proneel Guptan >Priority: Major > Fix For: 2.8 > > Attachments: AbstractCharacterFilterIssue.java > > > Ran into a bug with AbstractCharacterFilterReader where I noticed that my > filter was not receiving the actual characters, but was instead receiving an > int value corresponding to the number of chars in my input stream buffer. > I looked at the [source > file|https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java] > and realized that on line 64: > {{if (filter(read)) {}} > should have been: > {{if (filter(cbuf[readPos])) {}} > 'read` has the number of chars read from the source reader, not the code > point of the character read. > I have attached a sample program that illustrates the issue. > I can work on a patch and submit it when done. I will add a test case in the > patch. > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Closed] (IO-679) input.AbstractCharacterFilterReader passes count of chars read to filter, not the filter char
[ https://issues.apache.org/jira/browse/IO-679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Proneel Guptan closed IO-679. - Verified as fixed in git master. [~ggregory] Thank you for the prompt response! > input.AbstractCharacterFilterReader passes count of chars read to filter, not > the filter char > - > > Key: IO-679 > URL: https://issues.apache.org/jira/browse/IO-679 > Project: Commons IO > Issue Type: Bug > Components: Streams/Writers >Affects Versions: 2.7 >Reporter: Proneel Guptan >Priority: Major > Fix For: 2.8 > > Attachments: AbstractCharacterFilterIssue.java > > > Ran into a bug with AbstractCharacterFilterReader where I noticed that my > filter was not receiving the actual characters, but was instead receiving an > int value corresponding to the number of chars in my input stream buffer. > I looked at the [source > file|https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java] > and realized that on line 64: > {{if (filter(read)) {}} > should have been: > {{if (filter(cbuf[readPos])) {}} > 'read` has the number of chars read from the source reader, not the code > point of the character read. > I have attached a sample program that illustrates the issue. > I can work on a patch and submit it when done. I will add a test case in the > patch. > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (IO-679) input.AbstractCharacterFilterReader passes count of chars read to filter, not the filter char
[ https://issues.apache.org/jira/browse/IO-679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17167435#comment-17167435 ] Proneel Guptan commented on IO-679: --- Hi Gary, I created a PR [https://github.com/apache/commons-io/pull/132] It has the source fix as well as 2 test cases. I also ran all test cases to ensure they passed. Thx, Proneel. > input.AbstractCharacterFilterReader passes count of chars read to filter, not > the filter char > - > > Key: IO-679 > URL: https://issues.apache.org/jira/browse/IO-679 > Project: Commons IO > Issue Type: Bug > Components: Streams/Writers >Affects Versions: 2.7 >Reporter: Proneel Guptan >Priority: Major > Attachments: AbstractCharacterFilterIssue.java > > > Ran into a bug with AbstractCharacterFilterReader where I noticed that my > filter was not receiving the actual characters, but was instead receiving an > int value corresponding to the number of chars in my input stream buffer. > I looked at the [source > file|https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java] > and realized that on line 64: > {{if (filter(read)) {}} > should have been: > {{if (filter(cbuf[readPos])) {}} > 'read` has the number of chars read from the source reader, not the code > point of the character read. > I have attached a sample program that illustrates the issue. > I can work on a patch and submit it when done. I will add a test case in the > patch. > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (IO-679) input.AbstractCharacterFilterReader passes count of chars read to filter, not the filter char
[ https://issues.apache.org/jira/browse/IO-679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17167356#comment-17167356 ] Proneel Guptan commented on IO-679: --- One more thing to add, CharacterSetFilterReaderTest.java and CharacterFilterReaderTest.java do not test the {{read(final char[] cbuf, final int off, final int len)}} method, which has the bug. The method they test {{read()}} does not have an issue. > input.AbstractCharacterFilterReader passes count of chars read to filter, not > the filter char > - > > Key: IO-679 > URL: https://issues.apache.org/jira/browse/IO-679 > Project: Commons IO > Issue Type: Bug > Components: Streams/Writers >Affects Versions: 2.7 >Reporter: Proneel Guptan >Priority: Major > Attachments: AbstractCharacterFilterIssue.java > > > Ran into a bug with AbstractCharacterFilterReader where I noticed that my > filter was not receiving the actual characters, but was instead receiving an > int value corresponding to the number of chars in my input stream buffer. > I looked at the [source > file|https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java] > and realized that on line 64: > {{if (filter(read)) {}} > should have been: > {{if (filter(cbuf[readPos])) {}} > 'read` has the number of chars read from the source reader, not the code > point of the character read. > I have attached a sample program that illustrates the issue. > I can work on a patch and submit it when done. I will add a test case in the > patch. > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (IO-679) input.AbstractCharacterFilterReader passes count of chars read to filter, not the filter char
[ https://issues.apache.org/jira/browse/IO-679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Proneel Guptan updated IO-679: -- Description: Ran into a bug with AbstractCharacterFilterReader where I noticed that my filter was not receiving the actual characters, but was instead receiving an int value corresponding to the number of chars in my input stream buffer. I looked at the [source file|https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java] and realized that on line 64: {{if (filter(read)) {}} should have been: {{if (filter(cbuf[readPos])) {}} 'read` has the number of chars read from the source reader, not the code point of the character read. I have attached a sample program that illustrates the issue. I can work on a patch and submit it when done. I will add a test case in the patch. was: Ran into a bug with AbstractCharacterFilterReader where I noticed that my filter was not receiving the actual characters, but was instead receiving an int value corresponding to the number of chars in my input stream buffer. I looked at the [source file|https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java] and realized that on line 64: {{if (filter(read)) {}} should have been: {{if (filter(cbuf[readPos])) {}} 'read` has the number of chars read from the source reader, not the code point of the character read. I have attached a sample program that illustrates the issue. I can work on a patch and submit it when done. I will add a test case in the patch. > input.AbstractCharacterFilterReader passes count of chars read to filter, not > the filter char > - > > Key: IO-679 > URL: https://issues.apache.org/jira/browse/IO-679 > Project: Commons IO > Issue Type: Bug > Components: Streams/Writers >Affects Versions: 2.7 >Reporter: Proneel Guptan >Priority: Major > Attachments: AbstractCharacterFilterIssue.java > > > Ran into a bug with AbstractCharacterFilterReader where I noticed that my > filter was not receiving the actual characters, but was instead receiving an > int value corresponding to the number of chars in my input stream buffer. > I looked at the [source > file|https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java] > and realized that on line 64: > {{if (filter(read)) {}} > should have been: > {{if (filter(cbuf[readPos])) {}} > 'read` has the number of chars read from the source reader, not the code > point of the character read. > I have attached a sample program that illustrates the issue. > I can work on a patch and submit it when done. I will add a test case in the > patch. > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (IO-679) input.AbstractCharacterFilterReader passes count of chars read to filter, not the filter char
[ https://issues.apache.org/jira/browse/IO-679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Proneel Guptan updated IO-679: -- Description: Ran into a bug with AbstractCharacterFilterReader where I noticed that my filter was not receiving the actual characters, but was instead receiving an int value corresponding to the number of chars in my input stream buffer. I looked at the [source file|https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java] and realized that on line 64: {{if (filter(read)) {}} should have been: {{if (filter(cbuf[readPos])) {}} 'read` has the number of chars read from the source reader, not the code point of the character read. I have attached a sample program that illustrates the issue. I can work on a patch and submit it when done. I will add a test case in the patch. was: Ran into a bug with AbstractCharacterFilterReader where I noticed that my filter was not receiving the actual characters, but was instead receiving an int value corresponding to the number of chars in my input stream buffer. I looked at the [source file|https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java] and realized that on line 64: {{if (filter(read)) {}} should have been: {{if (filter(cbuf[readPos])) {}} 'read` has the number of bytes read from the source reader, not the code point of the character read. I have attached a sample program that illustrates the issue. I can work on a patch and submit it when done. I will add a test case in the patch. > input.AbstractCharacterFilterReader passes count of chars read to filter, not > the filter char > - > > Key: IO-679 > URL: https://issues.apache.org/jira/browse/IO-679 > Project: Commons IO > Issue Type: Bug > Components: Streams/Writers >Affects Versions: 2.7 >Reporter: Proneel Guptan >Priority: Major > Attachments: AbstractCharacterFilterIssue.java > > > Ran into a bug with AbstractCharacterFilterReader where I noticed that my > filter was not receiving the actual characters, but was instead receiving an > int value corresponding to the number of chars in my input stream buffer. > I looked at the [source > file|https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java] > and realized that on line 64: > {{if (filter(read)) {}} > should have been: > {{if (filter(cbuf[readPos])) {}} > 'read` has the number of chars read from the source reader, not the code > point of the character read. > I have attached a sample program that illustrates the issue. > I can work on a patch and submit it when done. I will add a test case in the > patch. > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (IO-679) input.AbstractCharacterFilterReader passes count of chars read to filter, not the filter char
[ https://issues.apache.org/jira/browse/IO-679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Proneel Guptan updated IO-679: -- Description: Ran into a bug with AbstractCharacterFilterReader where I noticed that my filter was not receiving the actual characters, but was instead receiving an int value corresponding to the number of chars in my input stream buffer. I looked at the [source file|https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java] and realized that on line 64: {{if (filter(read)) {}} should have been: {{if (filter(cbuf[readPos])) {}} 'read` has the number of bytes read from the source reader, not the code point of the character read. I have attached a sample program that illustrates the issue. I can work on a patch and submit it when done. I will add a test case in the patch. was: Ran into a bug with AbstractCharacterFilterReader where I noticed that my filter was not receiving the actual characters, but was instead receiving an int value corresponding to the number of chars in my input stream buffer. I looked at the [source file|[https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java]] and realized that on line 64: {{if (filter(read)) {}} should have been: {{if (filter(cbuf[readPos])) {}} 'read` has the number of bytes read from the source reader, not the code point of the character read. I have attached a sample program that illustrates the issue. I can work on a patch and submit it when done. I will add a test case in the patch. > input.AbstractCharacterFilterReader passes count of chars read to filter, not > the filter char > - > > Key: IO-679 > URL: https://issues.apache.org/jira/browse/IO-679 > Project: Commons IO > Issue Type: Bug > Components: Streams/Writers >Affects Versions: 2.7 >Reporter: Proneel Guptan >Priority: Major > Attachments: AbstractCharacterFilterIssue.java > > > Ran into a bug with AbstractCharacterFilterReader where I noticed that my > filter was not receiving the actual characters, but was instead receiving an > int value corresponding to the number of chars in my input stream buffer. > I looked at the [source > file|https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java] > and realized that on line 64: > {{if (filter(read)) {}} > should have been: > {{if (filter(cbuf[readPos])) {}} > 'read` has the number of bytes read from the source reader, not the code > point of the character read. > I have attached a sample program that illustrates the issue. > I can work on a patch and submit it when done. I will add a test case in the > patch. > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Created] (IO-679) input.AbstractCharacterFilterReader passes count of chars read to filter, not the filter char
Proneel Guptan created IO-679: - Summary: input.AbstractCharacterFilterReader passes count of chars read to filter, not the filter char Key: IO-679 URL: https://issues.apache.org/jira/browse/IO-679 Project: Commons IO Issue Type: Bug Components: Streams/Writers Affects Versions: 2.7 Reporter: Proneel Guptan Attachments: AbstractCharacterFilterIssue.java Ran into a bug with AbstractCharacterFilterReader where I noticed that my filter was not receiving the actual characters, but was instead receiving an int value corresponding to the number of chars in my input stream buffer. I looked at the [source file|[https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/AbstractCharacterFilterReader.java]] and realized that on line 64: {{if (filter(read)) {}} should have been: {{if (filter(cbuf[readPos])) {}} 'read` has the number of bytes read from the source reader, not the code point of the character read. I have attached a sample program that illustrates the issue. I can work on a patch and submit it when done. I will add a test case in the patch. -- This message was sent by Atlassian Jira (v8.3.4#803005)