Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-java/univocity-parsers-2.9.1 fails with openjdk-17 #4

Closed
vaukai opened this issue Apr 4, 2022 · 1 comment
Closed

dev-java/univocity-parsers-2.9.1 fails with openjdk-17 #4

vaukai opened this issue Apr 4, 2022 · 1 comment

Comments

@vaukai
Copy link

vaukai commented Apr 4, 2022

 * univocity-parsers-2.9.1.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                                                                                           [ ok ]
 * Using: openjdk-17
>>> Unpacking source...
>>> Unpacking univocity-parsers-2.9.1.tar.gz to /var/tmp/portage/dev-java/univocity-parsers-2.9.1/work
>>> Source unpacked in /var/tmp/portage/dev-java/univocity-parsers-2.9.1/work
>>> Preparing source in /var/tmp/portage/dev-java/univocity-parsers-2.9.1/work/univocity-parsers-2.9.1 ...
Searching for bundled jars:
None found.
Searching for bundled classes (no output if none found):
Search done.
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-java/univocity-parsers-2.9.1/work/univocity-parsers-2.9.1 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-java/univocity-parsers-2.9.1/work/univocity-parsers-2.9.1 ...
 * Verbose logging for "ejavac" function
 * Compiler executable: javac
 * Extra arguments: -source 1.8 -target 1.8
 * Complete command:
 * javac -source 1.8 -target 1.8 -d target/classes -encoding UTF-8 @sources.lst
 * Compiling ...
warning: [options] bootstrap class path not set in conjunction with -source 8
src/main/java/com/univocity/parsers/common/Context.java:136: error: reference to Record is ambiguous
        Record toRecord(String[] row);
        ^
  both interface com.univocity.parsers.common.record.Record in com.univocity.parsers.common.record and class java.lang.Record in java.lang match
src/main/java/com/univocity/parsers/common/AbstractWriter.java:520: error: reference to Record is ambiguous
        public final <T extends Record> void processRecords(T[] records) {
                                ^
  both interface com.univocity.parsers.common.record.Record in com.univocity.parsers.common.record and class java.lang.Record in java.lang match
src/main/java/com/univocity/parsers/common/AbstractWriter.java:520: error: name clash: <T>processRecords(T[]) and processRecords(Object[]) have the same erasure
        public final <T extends Record> void processRecords(T[] records) {
                                             ^
  where T is a type-variable:
    T extends Record declared in method <T>processRecords(T[])
src/main/java/com/univocity/parsers/common/AbstractWriter.java:538: error: reference to Record is ambiguous
        public final <T extends Record> void processRecord(T record) {
                                ^
  both interface com.univocity.parsers.common.record.Record in com.univocity.parsers.common.record and class java.lang.Record in java.lang match
src/main/java/com/univocity/parsers/common/AbstractWriter.java:538: error: cannot declare both <T>processRecord(T) and processRecord(Object...) in AbstractWriter
        public final <T extends Record> void processRecord(T record) {
                                             ^
  where T is a type-variable:
    T extends Record declared in method <T>processRecord(T)
src/main/java/com/univocity/parsers/common/AbstractWriter.java:641: error: reference to Record is ambiguous
        public final void writeRecordsAndClose(Collection<? extends Record> allRows) {
                                                                    ^
  both interface com.univocity.parsers.common.record.Record in com.univocity.parsers.common.record and class java.lang.Record in java.lang match

@Leo3418 Leo3418 closed this as completed in e88e47a Apr 4, 2022
Leo3418 added a commit to Leo3418/univocity-parsers that referenced this issue Apr 4, 2022
Since Java 16, a new java.lang.Record class has been added to the Java
SE API.  Classes under the java.lang package, including this Record
class, are automatically imported in any Java source file.  Because this
project also has a com.univocity.parsers.common.record.Record interface,
when it is being compiled on JDK 16 and above, there would be an
ambiguity as to which class/interface to use for the 'Record' type:

src/main/java/com/univocity/parsers/common/Context.java:136: error: reference to Record is ambiguous
        Record toRecord(String[] row);
        ^
  both interface com.univocity.parsers.common.record.Record in com.univocity.parsers.common.record and class java.lang.Record in java.lang match

The resolution to this issue is simply to import the Record interface
under this project explicitly in every source file using it.

Bug: Leo3418/junit-5-ebuild-repo#4
Reported-by: Volkmar W. Pogatzki <[email protected]>
Signed-off-by: Yuan Liao <[email protected]>
@Leo3418
Copy link
Owner

Leo3418 commented Apr 4, 2022

Thanks for the report! I've forwarded the issue with the patch to the upstream ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants