Fix some warnings against Java 1.8
authorNiki Roo <niki@nikiroo.be>
Thu, 24 Mar 2016 18:55:02 +0000 (19:55 +0100)
committerNiki Roo <niki@nikiroo.be>
Thu, 24 Mar 2016 18:55:02 +0000 (19:55 +0100)
Makefile
src/be/nikiroo/jvcard/launcher/Optional.java

index 009247227462df20a40d7953a3ae40d0fb98efc3..93dce6b60eb91fd9944f4537386b63ae8ca08b28 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -31,32 +31,32 @@ jvcard.jar: bin/be/nikiroo/jvcard/*/* bin/be/nikiroo/jvcard/*
        @echo 'Main-Class: be.nikiroo.jvcard.launcher.Main' > bin/manifest
        @echo >> bin/manifest
        @echo Creating jar file jvcard-`grep "APPLICATION_VERSION" src/be/nikiroo/jvcard/launcher/Main.java | cut -d'"' -f2`.jar...
-       jar -m bin/manifest -cf jvcard-`grep "APPLICATION_VERSION" src/be/nikiroo/jvcard/launcher/Main.java | cut -d'"' -f2`.jar -C bin/ be -C bin/ com
+       jar cf jvcard-`grep "APPLICATION_VERSION" src/be/nikiroo/jvcard/launcher/Main.java | cut -d'"' -f2`.jar bin/manifest -C bin/ be -C bin/ com
        @rm bin/manifest
        @echo Copying to jvcard.jar...
        @cp jvcard-`grep "APPLICATION_VERSION" src/be/nikiroo/jvcard/launcher/Main.java | cut -d'"' -f2`.jar jvcard.jar
 
 bin/5: lanterna bin/files
        @echo Compiling in Java 1.5 mode "('make bin/5')"...
-       javac -cp bin/ -encoding UTF-8 -Xlint -source 5 @bin/files -d bin/
+       javac -cp bin/ -encoding UTF-8 -Xlint -Xlint:-options -source 5 -target 5 @bin/files -d bin/
        @rm -f bin/[0-9]
        @touch bin/5
 
 bin/6: lanterna bin/files
        @echo Compiling in Java 1.6 mode "('make bin/6')"...
-       javac -cp bin/ -encoding UTF-8 -Xlint -source 6 @bin/files -d bin/
+       javac -cp bin/ -encoding UTF-8 -Xlint -Xlint:-options -source 6 -target 6 @bin/files -d bin/
        @rm -f bin/[0-9]
        @touch bin/6
 
 bin/7: lanterna bin/files
        @echo Compiling in Java 1.7 mode "('make bin/7')"...
-       javac -cp bin/ -encoding UTF-8 -Xlint -source 7 @bin/files -d bin/
+       javac -cp bin/ -encoding UTF-8 -Xlint -Xlint:-options -source 7 -target 7 @bin/files -d bin/
        @rm -f bin/[0-9]
        @touch bin/7
 
 bin/8: lanterna bin/files
        @echo Compiling in Java 1.8 mode "('make bin/8')"...
-       javac -cp bin/ -encoding UTF-8 -Xlint -source 8 @bin/files -d bin/
+       javac -cp bin/ -encoding UTF-8 -Xlint -Xlint:-options -source 8 -target 8 @bin/files -d bin/
        @rm -f bin/[0-9]
        @touch bin/8
 
index 9eb0d6b4085d997f964503671e026a529cfca0a9..cff57f953d34d3e36333531a423d1634ac554712 100644 (file)
@@ -54,7 +54,7 @@ class Optional {
                        InvocationTargetException {
                @SuppressWarnings("rawtypes")
                Class serverClass = Class.forName("be.nikiroo.jvcard.remote.Server");
-               Method run = serverClass.getDeclaredMethod("run", new Class[] {});
+               Method run = serverClass.getDeclaredMethod("run", new Class<?>[] {});
                run.invoke(serverClass.getConstructor(int.class).newInstance(port));
        }
 
@@ -93,7 +93,7 @@ class Optional {
                @SuppressWarnings("rawtypes")
                Class launcherClass = Class
                                .forName("be.nikiroo.jvcard.tui.TuiLauncher");
-               Method start = launcherClass.getDeclaredMethod("start", new Class[] {
+               Method start = launcherClass.getDeclaredMethod("start", new Class<?>[] {
                                Boolean.class, List.class });
                start.invoke(launcherClass.newInstance(), textMode, files);
        }
@@ -134,7 +134,7 @@ class Optional {
                        IllegalArgumentException, InvocationTargetException, IOException {
                @SuppressWarnings("rawtypes")
                Class syncClass = Class.forName("be.nikiroo.jvcard.remote.Sync");
-               Method sync = syncClass.getDeclaredMethod("sync", new Class[] {
+               Method sync = syncClass.getDeclaredMethod("sync", new Class<?>[] {
                                boolean.class, MergeCallback.class });
 
                Object o = syncClass.getConstructor(String.class).newInstance(input);