Skip to content

Enable javac compiler warnings #34

Closed

Description

@bmarwell

Enable javac compiler warnings.

Configure the maven-compiler-plugin:

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgument>-Xlint:all</compilerArgument>
          <showWarnings>true</showWarnings>
          <showDeprecation>true</showDeprecation>
        </configuration>
      </plugin>

Activity

  1. added this to the Release 3.0.0 milestone on Apr 14, 2019
  2. bmarwell commented on Apr 14, 2019

    @bmarwell
    Author

    Currently this will yield on jdk8:

    [WARNING] bootstrap class path not set in conjunction with -source 1.6
    [WARNING] /home/user/git/jssc/src/java/jssc/SerialPortException.java:[31,8] serializable class jssc.SerialPortException has no definition of serialVersionUID
    [WARNING] /home/user/git/jssc/src/java/jssc/SerialPortTimeoutException.java:[31,8] serializable class jssc.SerialPortTimeoutException has no definition of serialVersionUID
    [WARNING] /home/user/git/jssc/src/java/jssc/SerialPort.java:[1017,89] found raw type: java.lang.Class
      missing type arguments for generic class java.lang.Class<T>
    

    On jdk11:

    [WARNING] source value 6 is obsolete and will be removed in a future release
    [WARNING] target value 1.6 is obsolete and will be removed in a future release
    [WARNING] To suppress warnings about obsolete options, use -Xlint:-options.
    

    I hate talking about "normal warnings" or even "normal errors", but we mitigate using java7+ API by using the animal sniffer plugin, so that will be fine.

    As soon as we target Java 12, we cannot build with java 8 anymore. Lowest would be java 9 then (using the -release 6 argument for javac). But that's okay for now.

  3. added a commit that references this issue on Apr 14, 2019
    abb5c75
  4. tresf commented on Apr 14, 2019

    @tresf

    Then let's avoid JDK12. JDK11 is LTS and should last us years.

  5. bmarwell commented on Apr 15, 2019

    @bmarwell
    Author

    Yes. Exactly. Just wanted to mention it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions