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

Fix "reference to Record is ambiguous" build error on JDK 16 and above #502

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Apr 4, 2022

  1. Fix "reference to Record is ambiguous" for JDK 16+

    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 <gentoo@pogatzki.net>
    Signed-off-by: Yuan Liao <liaoyuan@gmail.com>
    Leo3418 committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    6dffca7 View commit details
    Browse the repository at this point in the history