Activity for opencsv

  • Jo Navy Jo Navy modified a comment on ticket #265

    No, it can hang with Java 25 too: just create a bigger CSV. Try to duplicate the lines of my CSV (excluding the first 5 headerlines) to get a CSV of 7000+ lines and zip it again. This means that tests might pass but the application could hang in production when it gets a CSV bigger that the one used in tests. A very nasty scenario. I suspect a deadlock: I have noted that method ZipFile.stream() is internally synchronized in recent Java versions (not in Java 8) and that you are using threads, even...

  • Jo Navy Jo Navy posted a comment on ticket #265

    No, it can hang with Java 25 too: just create a bigger CSV. Try to duplicate the lines of my CSV (excluding the first 5 headerlines) to get a CSV of 7000+ lines and zip it again. This means that tests might pass but the application could hang in production when it get a CSV bigger that the one used in tests. A very nasty scenario. I suspect a deadlock: I have noted that method ZipFile.stream() is internally synchronized in recent Java versions (not in Java 8) and that you are using threads, even...

  • Scott Conway Scott Conway posted a comment on ticket #265

    Jo - I am going to throw you a curve ball that for me lowers the priority of this. I just downloaded Java 25, which is also noted as an LTS version and it works. So: Java 8 - test passes Java 11 - test fails Java 17 - test fails Java 21- test fails Java 25 - test passes

  • Scott Conway Scott Conway posted a comment on ticket #265

    For giggles I did recompile and ran the code in both java 11 and java 21 (other LTS versions of java) and both had the same issue. But it does tell me the issue started with java version > 8 and <= 11 instead of <= 17.

  • Scott Conway Scott Conway posted a comment on ticket #265

    Hello Jo. This is a most interesting issue. Like your own comment stated I was able to port the tests directly into opencsv which I always run in Java 8 by replacing the var in testOKnoStream with List<? extends ZipEntry> and it runs without issue. Which tells me this is not an opencsv issue per se but a change in one of the later versions of java after java 8 that is not backwards compatible. I will try and play with it this weekend some to open up my debugging settings in IntelliJ to be able to...

  • Scott Conway Scott Conway modified a wiki page

    What's new

  • Scott Conway Scott Conway modified ticket #174

    Upgrade to commons-text 1.15.0

  • Scott Conway Scott Conway posted a comment on ticket #174

    Done - changes merged in and will be in the next release.

  • Scott Conway Scott Conway committed [877e13] on Source

    Feature Request #174 - update dependencies (specifically commons-text)

  • Adrian Adrian created ticket #174

    Upgrade to commons-text 1.15.0

  • Scott Conway Scott Conway modified ticket #265

    Opencsv may hang when reading from zip file

  • Jo Navy Jo Navy created ticket #265

    Opencsv may hang when reading from zip file

  • Daniel Dimov Daniel Dimov created ticket #173

    Quotation for numbers and booleans

  • Scott Conway Scott Conway modified ticket #158

    CsvBindByName capitalizes headers when writing

  • Scott Conway Scott Conway posted a comment on ticket #158

    Hello Seprfu There are no updates on this as it was fixed a long time ago. If you google or search through the tickets you will see this was brought up in 2020 in Support Request #87 which referenced the Stackoverflow ticket that posted a fix for the issue. And Seprfu while I agree that flexibility is NOT a dirty word there is one thing that trumps flexibility and that is backwards compatibility! Anyone who has worked on a highly used library (opencsv is downloaded millions of times a month last...

  • seprfu seprfu posted a comment on ticket #158

    Any updates on that? This is a library, whatever reasoning the original developer had, it shouldn't act as a policeman and enforce its own rules. It should be flexible. There are many dirty workarounds for this issue on the internet because this is what users need.

  • eltonsandre eltonsandre created ticket #129

    Add column name or index information in CsvException

  • Jakub Skibiak Jakub Skibiak posted a comment on ticket #153

    hi, since https://mvnrepository.com/artifact/org.apache.commons/commons-beanutils2 has been released, can we consider getting rid of commons-collections4?

  • Scott Conway Scott Conway modified a comment on ticket #264

    Sorry Michael for the delay again - work, family, and all the life stuff again as always :) I see your frustration but I do not believe it is hard to differentiate - just confusing because it happened before what you think a read has happened. But the error stated that a mandatory field is missing information. That said what surporised me reading the code is that internally it very specifically reads the first record after reading the header. Unfortunately it was done in a private inner class with...

  • Scott Conway Scott Conway posted a comment on ticket #264

    Sorry Michael for the delay again - work, family, and all the life stuff again as always :) I see your frustration but I do not believe it is hard to differentiate - just confusing because it happened before what you think a read has happened. But the error stated that a mandatory field is missing information. That said what surporised me reading the code is that internally it very specifically reads the first record after reading the header. Unfortunately it was done in a private inner class with...

  • Michael Heitkamp Michael Heitkamp posted a comment on ticket #264

    Of course you are right: the implementation of the iterator() interface is up to the implementor. But the current implementation makes it very hard to differentiate between an error in the header line and an error in the first content line. file1.csv COLUMN_A, COLUMN_B ,b throws java.lang.RuntimeException: com.opencsv.exceptions.CsvRequiredFieldEmptyException: Field 'columnA' is mandatory but no value was provided. file2.csv COLUMN_A, COLUMN_C a, b throws java.lang.RuntimeException: Error capturing...

  • Scott Conway Scott Conway modified ticket #264

    OpenCsvReader.iterator() parses content line

  • Scott Conway Scott Conway posted a comment on ticket #264

    Sorry for the delay in the response but work happens :) My rejection is based around your last statement. The iterator() call should not read a content line. Only the first iterator.next() call should parse the content line and throw an exeption. Iterator is an interface - how it is implemented is wholly up to whomever implements the class. Which allows for the implementor to add desired features like caching/buffering. Besides what's the best way to implement the hasNext method? Go ahead and read...

  • Michael Heitkamp Michael Heitkamp created ticket #264

    OpenCsvReader.iterator() parses content line

  • Kamil Wal Kamil Wal posted a comment on ticket #172

    Yes, you are of course right, but maybe I haven't been precise enough. What I really wanted to say by hidden is that, my code cannot access that method from outside of the converter itself, but this is the method that gets the actual value that will be set in field. While I can override that method I can never call it by myself and that is problem in my approach to make records work. If you check mapping strategies that I created they are now using reflections to call the convert method in order...

  • Scott Conway Scott Conway committed [af5dfd] on Source

    Added tests for Bug261

  • Scott Conway Scott Conway posted a comment on ticket #172

    convert is not hidden - it is an abstract method that is defined by whomever extends the AbstractBeanField. You can see examples of that in BeanFieldSplit, BeanFieldSingleValue, ConvertLanguageToBoolean. That said I can change preProcessValue and validateValue in AbstractBeanField from private to protected if you want to call them directly from the class you are using that extends the AbstractBeanField. Short term you can copy out the two methods and put them in your class. Or if you do not use the...

  • Kamil Wal Kamil Wal posted a comment on ticket #172

    hi, I checked and it is public, however for some reason dot was added as part of url. This should work fine: https://github.com/Svanar/opencsv-record-strategy

  • Scott Conway Scott Conway posted a comment on ticket #172

    Kamil is your github project private because I am getting a 404 when I try and view it.

  • Scott Conway Scott Conway modified ticket #261

    Quote read as part of the value when using keepCarriageReturn

  • Scott Conway Scott Conway posted a comment on ticket #261

    Closing this as works for me. This is not a bug because the CsvParser typically reads a field as all the characters to the next comma which is why the carriage return was being added. Enabling strict quotes reads from quote to quote.

  • Kamil Wal Kamil Wal posted a comment on ticket #172

    Hi Scott, thank you for taking your time to look into my request. I fully understand why you don't want to add support for records due to compatibility reasons. In order to provide more details (and to make sure that my approach would work) I created this simple POC: https://github.com/Svanar/opencsv-record-strategy. Main logic part is in classes RecordColumnPositionMappingStrategy and RecordHeaderColumnNameMappingStrategy. The core functionality being method: private Object extractValue( BeanField<T,...

  • Scott Conway Scott Conway modified ticket #172

    java record support/value extraction

  • Scott Conway Scott Conway posted a comment on ticket #172

    Hello Kamil Sorry but there is no plans to support Java Records in opencsv. Java Records was added in Java 14 and standardized in Java 16 while we are committed to maintaining compatibility with Java 8. Now for the second part I am very happy to open access (as little as possible - Least Privlege and all that) to allow you to override as neccessary. But I would like a definitive list as to what you want opened and why. The reason I am being picky is your request actually confused me.... okay that...

  • Kamil Wal Kamil Wal created ticket #172

    java record support/value extraction

  • Scott Conway Scott Conway posted a comment on ticket #261

    This goes back to what I pondered earlier that about getting a file from a system where the default newline is \r\n because if I change the string to this it works. @Test void test_whenValueIsMonoLine_andOnlyOneChar_withNewlineOutsideQuotes() throws CsvValidationException, IOException { final String csv = "\"Text with commas, and\r\nnew lines\"\n" + "\"Text with commas, and\r\nnew lines\""; final CSVReader reader = new CSVReaderBuilder(new StringReader((csv))) .withKeepCarriageReturn(true) .build();...

  • CHU Minh Toan CHU Minh Toan posted a comment on ticket #170

    Hello Scott, Thank you for your information. Hope we will have a production release of commons-beanutils2 soon for this to be merged. Sincerely, CHU Minh Toan

  • Mika ds Mika ds posted a comment on ticket #261

    My examples were actually the two add behaviour I noticed when trying to pinpoint were the problem was. Here is an example that uses a more explicit content, hoping it will be clearer. This is a single column CSV with two lines, each value having commas and new lines : @Test void test_whenValueIsMonoLine_andOnlyOneChar() throws CsvValidationException, IOException { final String csv = "\"Text with commas, and\r\nnew lines\"\r\n" + "\"Text with commas, and\r\nnew lines\""; final CSVReader reader =...

  • Scott Conway Scott Conway modified ticket #263

    Strip UTF-8/16 BOM

  • Scott Conway Scott Conway posted a comment on ticket #263

    Sorry this must be a duplicate or something because I swore I responded to this already. I am rejecting this because the purpose of opencsv is to parse csv data. Not csv in utf form or ascii or ebcdic or whatever character formats. It is the duty of the developer using opencsv to handle the vulgarities of whatever file/stream/character types they are using. For UTF characters you can use the apache-commons commons-io BOMInputStream. If you check out the latest code there is an example in BomHandlingTest....

  • Scott Conway Scott Conway committed [df5e28] on Source

    Added tests for Bug261

  • Scott Conway Scott Conway modified ticket #170

    commons-collections transitive dependency in opencsv:5.10

  • Scott Conway Scott Conway posted a comment on ticket #170

    Hello Kiran First off thanks for the work - I will try and remember your merge when there is a production release of commons-beanutils2. But until there is a production release I am not going to make the change. M2 is a Milestone version - meaning it is potentially feature incomplete, not even a Release Candidate (RC). I have been burned in other projects using non production versions in projects I have worked on so I do everything in my power to not rely on non production versions in my final releases....

  • CHU Minh Toan CHU Minh Toan posted a comment on ticket #170

    Hi, here is my pull request for this update : https://sourceforge.net/p/toan-opencsv/code/ci/updat_to_use_commons-beanutils2/tree/ https://toan@git.code.sf.net/p/toan-opencsv/code updat_to_use_commons-beanutils2 for you to fetch changes up to 75fce13c4ffb0d80c94c54fd9f253f65a02b899f: Update to use commons-beanutils2 (2025-09-05 19:30:19 +0200) Toan Chu (1): Update to use commons-beanutils2 pom.xml | 8 ++++---- src/main/java/com/opencsv/bean/ConverterPrimitiveTypes.java | 8 ++++---- .../bean/customconverter/ConverterLanguageToBoolean.java...

  • CHU Minh Toan CHU Minh Toan posted a comment on ticket #170

    Hello, do you think there will be a next release soon to solve this vulnerability? Thanks

  • Scott Conway Scott Conway posted a comment on ticket #261

    I was also wondering if it could be that you got your original data from a system where the default line separator was \r\n and was processing it on a system where the line separator was \n but in that case both lines should have had a \r in your first test and when I created a copy that did that it passed as well. @Test void test_whenValueIsMonoLine_andOnlyOneCharAndDifferentNewline() throws CsvValidationException, IOException { final String csv = "\"a\"\r\nx\r\n"; final CSVReader reader = new CSVReaderBuilder(new...

  • Scott Conway Scott Conway posted a comment on ticket #261

    Hello Mika Ohhhhhhhkay - thank you for sending the unit test as your expectations in the asserts really clarified to me what you are missing. I will go back to my original statement that what you are sending was not legal csv and that you had to escape the quotation marks to make it legal. Now from the asserts I see that you did not want the quotes at all. So the issue is with your literal blocks. If you read https://www.baeldung.com/java-text-blocks you will see that quotes and newlines are automatically...

  • Mika ds Mika ds modified a comment on ticket #261

    Hello, I have checked again using the 5.12.0, I still have the issue. I am not sure what is not legal in the examples : they are csvs with one column and two rows. I did some Junit tests that reproduces the two cases, with one passing and one faulty test each, I hope they will make things clearer.

  • Mika ds Mika ds posted a comment on ticket #261

    Hello, I have checked again using the 5.12.0, I still have the issue. I am not sure what is not legal in the examples : they are csvs with one column and two rows. I did some Junit tests that reproduces the two cases, with one passing and one faulty test each, I hope they will make things clearer.

  • Scott Conway Scott Conway committed [ba44cb] on Source

    Added code from John Sooter for Feature Request 159 showing how to use the BOMInputStream for handling UTF files with the BOM character.

  • SuperPat SuperPat created ticket #263

    Strip UTF-8/16 BOM

  • Scott Conway Scott Conway modified ticket #171

    Default StringProcessor

  • Scott Conway Scott Conway posted a comment on ticket #171

    I am closing this ticket. My apologies but as I stated before changing the default behavior is disruptive and I have felt that backlash on many, many occasions so unless it is an actual bug I am extremely hesitant about changing defaults, behaviors, apis.

  • Scott Conway Scott Conway modified ticket #127

    commons-beanutils update to 1.10.1

  • Scott Conway Scott Conway posted a comment on ticket #127

    Updated to 1.11.0 so closing down this ticket. I am not going to upgrade to commons-beanutils2 because the latest release is still a milestone release (M2). I do not use milestone, beta, or release candidate versions because I have been burned by that in the past so I treat it like a SNAPSHOT version - good to learn from but not for a production release.

  • Scott Conway Scott Conway modified ticket #262

    Create a git tag for 5.12.0

  • Scott Conway Scott Conway posted a comment on ticket #262

    tagged and pushed :)

  • Robert Robert created ticket #262

    Create a git tag for 5.12.0

  • Filipe Filipe posted a comment on ticket #259

    Thanks for the quick turnaround @sconway!

  • Markus Spann Markus Spann posted a comment on merge request #40

    Thanks, @sconway

  • Scott Conway Scott Conway posted a comment on ticket #261

    Mika please help me understand the string you are trying to parse. If possible please send me a running JUnit test showing your expectations. My issue is when I looked at the following line String csv = """ "ab"\r "x" """; it is not a legal csv line to the CSVParser or the RFC4180Parser. If you want the quotes as part of the data you need to escape it with double quotes. Also please re-run you code using the 5.12.0 release that was just released today. I am wondering if the fix for bug#259 will solve...

  • Scott Conway Scott Conway modified ticket #259

    Reader with RFC-4180 Parser returns null for blank row

  • Scott Conway Scott Conway posted a comment on ticket #259

    The fix has been merged with version 5.12.0

  • Scott Conway Scott Conway committed [2ece60] on Source

    create version 5.12.1-SNAPSHOT

  • Scott Conway Scott Conway committed [661715] on Source

    create version 5.12.0

  • Scott Conway Scott Conway created a blog post

    Version 5.12.0 has been released

  • Scott Conway Scott Conway modified a wiki page

    What's new

  • opencsv opencsv released /opencsv/5.12.0/opencsv-5.12.0.tar

  • opencsv opencsv released /opencsv/5.12.0/opencsv-5.12.0.jar

  • Scott Conway Scott Conway modified ticket #259

    Reader with RFC-4180 Parser returns null for blank row

  • Scott Conway Scott Conway posted a comment on ticket #259

    fixed in 5.12.0 release.

  • Scott Conway Scott Conway modified ticket #260

    opencsv 5.11.1 includes junit-vintage-engine as a compile-time dependency

  • Scott Conway Scott Conway posted a comment on ticket #260

    fixed in 5.11.2 release.

  • Scott Conway Scott Conway modified a wiki page

    What's new

  • Scott Conway committed [c794bc] on Source

    Merge /u/amukherjee9/opencsv/ branch master into master

  • Scott Conway Scott Conway merged merge request #41 on Source

    Updated commons-lang3 version for fixing CVE-2025-48924

  • Scott Conway committed [de4cfa] on Source

    Merge /u/markussp/opencsv/ branch feature--misc-updates-2 into master

  • Scott Conway Scott Conway merged merge request #40 on Source

    Remove duplicate Maven JAR plugin version definitions

  • Scott Conway Scott Conway committed [5f042f] on Source

    Bug #259 - modify RFC4180Parser to handle lines with no data that was introduced in the fix for Bug#257.

  • Ankur Mukherjee Ankur Mukherjee created merge request #41 on Source

    Updated commons-lang3 version for fixing CVE-2025-48924

  • James Cooper James Cooper posted a comment on ticket #259

    That's great, thanks. Here's a simple test: public class Bug259Test { @Test public void parseUsingRFC4180Parser() throws IOException { ICSVParser parser = new RFC4180Parser(); assertEquals(Collections.singletonList(""), Arrays.asList(parser.parseLine(""))); } } You can't split something and get nothing, unless you're commons-lang I suppose.

  • Scott Conway Scott Conway modified ticket #259

    Reader with RFC-4180 Parser returns null for blank row

  • Scott Conway Scott Conway posted a comment on ticket #259

    Will try and create a unit test to duplicate this issue this weekend.

  • Filipe Filipe modified a comment on ticket #259

    This broke liquibase for some users: https://github.com/liquibase/liquibase/issues/7020

  • Filipe Filipe posted a comment on ticket #259

    This broke liquibase for somem users: https://github.com/liquibase/liquibase/issues/7020

  • James Cooper James Cooper posted a comment on ticket #259

    Finding this bug just cost me half a day :/ An empty string in the input causes the reader to premature stop parsing. If you want to avoid the overhead of using a regex based split in 5.10, then rather than use commons-lang's StringUtils.splitPreserveAllTokens, what about a simple character based split method inside RFC4180Parser, e.g. private String[] tokenizeStringIntoArray(String nextLine) { List<String> tokens = new ArrayList<>(); int nextIndex = 0; while (true) { int lastIndex = nextIndex; nextIndex...

  • Scott Conway Scott Conway modified ticket #261

    Quote read as part of the value when using keepCarriageReturn

  • Scott Conway Scott Conway posted a comment on ticket #261

    Hello Mika - I will attempt to create a JUnit test that replicates this issue this weekend and work on it as time permits.

  • Mika ds Mika ds created ticket #261

    Quote read as part of the value when using keepCarriageReturn

  • Markus Spann Markus Spann posted a comment on merge request #40

    Could one of the maintainers please check and merge?

  • Scott Conway Scott Conway posted a comment on merge request #39

    No there is no need. I see the use of it but honestly I am happy when someone has unit tests for the features/fixes in their merge requests and don't want to add any sort of real or imagined complexity.

  • Markus Spann Markus Spann posted a comment on merge request #39

    Thanks for merging. The file showed as an uncommited resource after execution of the tests. I like writing test temp files to a subdir of target/ and name the file after the test class/method. In a test base class you could control whether to clean up after tests or not etc. If this sound interesting I'll put together a pull request.

  • Markus Spann Markus Spann created merge request #40 on Source

    Remove duplicate Maven JAR plugin version definitions

  • Scott Conway Scott Conway modified a wiki page

    What's new

  • Scott Conway Scott Conway posted a comment on merge request #39

    Sorry it took so long to merge but I had family in this week :) Thank you for all the work. The only thing I found contentious was the deleteOnExit for files created in unit tests because if there is an issue the files are gone. But that test has been around for years without issue so I just merged it - if an issue ever arises we can just comment out the delete.

  • Scott Conway Scott Conway merged merge request #39 on Source

    Improve build and test setup

  • Markus Spann Markus Spann posted a comment on merge request #1

    Hi Scott, oh ah ... the state of the repo did seem a little odd :) I've closed this merge request (if it can be deleted, please go ahead), forked the correct repo and sent in a new merge request: https://sourceforge.net/p/opencsv/source/merge-requests/39/ Markus

  • Markus Spann Markus Spann created merge request #39 on Source

    Improve build and test setup

  • Markus Spann Markus Spann updated merge request #1

    Modernize build setup

  • Scott Conway Scott Conway posted a comment on merge request #1

    Oh Markus I am so sorry. I have been meaning to get rid of the code repo for the longest time since I accidentally created it but never got around to it. All the code for opencsv is in the source repo. https://sourceforge.net/p/opencsv/source/ci/master/tree/ That has the latest code. Please look over it and see if anything is missing.

1 >