[CSV] Remove duplicate exception class name from message

2023-08-30 Thread Buddhi De Silva
Hi Commons-Devs,
I have one exception message optimization request for commons - CSV package.

Issue:
When a parsing error occurs during the CSV data parsing, an
'UncheckedIOException' is thrown with a detailed message like below.

"java.io.UncheckedIOException: IOException reading next record:
java.io.IOException: (line 2) invalid char between encapsulated token and
delimiter"

If you inspect the above error message carefully, you would see that the
exception type (IOException in this case) is printed twice in the first
message.
I think we could better format this error message as below.

"java.io.UncheckedIOException: Error in reading next record:
java.io.IOException: (line 2) invalid char between encapsulated token and
delimiter"

What causes this issue?
In 'CSVParser.CSVRecordIterator.getNextRecord()' method has the following
format defined.

private CSVRecord getNextRecord() {
try {
return CSVParser.this.nextRecord();
} catch (final IOException e) {
throw new UncheckedIOException(e.getClass().getSimpleName() + "
reading next record: " + e.toString(), e);
}
}

we could do a simple modification to the throw clause as follows to make
this more meaningful.

"throw new UncheckedIOException("Error in reading next record: " +
e.toString(), e);"

GitHub PR Link: https://github.com/apache/commons-csv/pull/348
Jira issue: https://issues.apache.org/jira/browse/CSV-309

Appreciate your help in this!

Thank You.
Buddhi De Silva.


[CSV-147] - Include parsed content in exception message up to the error point

2023-08-30 Thread Buddhi De Silva
Hello Commons-Devs,

I was looking into the issue and possible fixes reported in Jira issue:
https://issues.apache.org/jira/browse/CSV-147

I have created a PR with possible code optimization to include more details
into the exception message as discussed in the issue.

PR link: https://github.com/apache/commons-csv/pull/347

Your effort in carrying this forward is appreciated.

Thank you.
Buddhi De Silva


Re: [JCS] GitHub builds broken and Java 17

2023-08-30 Thread Gary Gregory
Please fix the git master build.

Gary

On Sat, Aug 26, 2023 at 4:12 PM Gary Gregory  wrote:

> I think you should consider reverting to the last green build and go from
> there.
>
> Gary
>
> On Sat, Aug 26, 2023, 4:10 PM Thomas Vandahl  wrote:
>
>> Hi Gary,
>>
>> > Am 26.08.2023 um 19:58 schrieb Gary Gregory :
>> >
>> > Does anyone know why it's broken?
>> If anyone broke it, that was me. I tried to fix the build configurations
>> but I simply don't understand what there doing. I never put them up in the
>> first place.
>>
>> > And why is was switched to Java 17 only without warning?
>>
>> Because it's about time? There's a major release necessary anyway because
>> so much deprecated code needs to be removed, so when if not now?
>>
>> Bye, Thomas
>> -
>> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
>> For additional commands, e-mail: dev-h...@commons.apache.org
>>
>>