Skip to content

Commit

Permalink
Fix some unchecked and deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
julianoes committed Oct 4, 2018
1 parent cb2d130 commit 5d983e9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
12 changes: 7 additions & 5 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
<classpath refid="libsclasspath"/>
<src path="src"/>
<src path="jMAVlib/src"/>
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xlint:unchecked"/>
</javac>
</target>

Expand All @@ -46,7 +48,7 @@
</fileset>
</jar>
</target>

<target name="create_run_jar" depends="compile" description="Creates standalone runnable JAR file including dependencies.">
<jar destfile="${build.dir}/jmavsim_run.jar">
<manifest>
Expand All @@ -72,7 +74,7 @@
<zipfileset dir="lib" includes="gluegen-rt-natives-linux-amd64.jar"/>
<zipfileset dir="lib" includes="joal-natives-linux-amd64.jar"/>
<zipfileset dir="lib" includes="jogl-all-natives-linux-amd64.jar"/>
<!--
<!--
<zipfileset dir="lib" includes="gluegen-rt-natives-linux-i586.jar"/>
<zipfileset dir="lib" includes="joal-natives-linux-i586.jar"/>
<zipfileset dir="lib" includes="jogl-all-natives-linux-i586.jar"/>
Expand All @@ -84,15 +86,15 @@
<zipfileset dir="lib" includes="gluegen-rt-natives-windows-amd64.jar"/>
<zipfileset dir="lib" includes="joal-natives-windows-amd64.jar"/>
<zipfileset dir="lib" includes="jogl-all-natives-windows-amd64.jar"/>
<!--
<!--
<zipfileset dir="lib" includes="gluegen-rt-natives-windows-i586.jar"/>
<zipfileset dir="lib" includes="joal-natives-windows-i586.jar"/>
<zipfileset dir="lib" includes="jogl-all-natives-windows-i586.jar"/>
<zipfileset dir="lib" includes="jogl-all-natives-windows-i586.jar"/>
-->
</jar>
</target>

<target name="copy_res"
<target name="copy_res"
description="Copies all supporting resource files into build folder, eg. to use jmavsim_run.jar or prepare for distro.">
<copy todir="${build.dir}/" preservelastmodified="true" overwrite="false">
<zipfileset dir="./" includes="${resource_list}" />
Expand Down
4 changes: 2 additions & 2 deletions src/me/drton/jmavsim/PeripherialBuzzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import javax.sound.sampled.SourceDataLine;

public class PeripherialBuzzer {
BlockingQueue<Note> notes = new LinkedBlockingQueue();
BlockingQueue<Note> notes = new LinkedBlockingQueue<>();
AudioFormat af;
SourceDataLine sdl;
float sample_rate = 44100; // assume a sample rate of 44.1 kHz
Expand All @@ -18,7 +18,7 @@ class Note {
public int frequency;
public int duration;
public Note(int frequency, int duration) {
this.frequency = new Integer(frequency);
this.frequency = Integer.valueOf(frequency);
this.duration = duration;
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/me/drton/jmavsim/SensorParamPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ public void setSensor(Sensors sensors) {
this.sensors = sensors;

// init value
accelSpinner.setValue(new Double(sensors.param("noise_Acc")));
gyroSpinner.setValue(new Double(sensors.param("noise_Gyo")));
magSpinner.setValue(new Double(sensors.param("noise_Mag")));
presSpinner.setValue(new Double(sensors.param("noise_Prs")));
gpsSpinner.setValue(new Double(sensors.param("gpsNoiseStdDev")));
massSpinner.setValue(new Double(sensors.param("mass")));
accelSpinner.setValue(Double.valueOf(sensors.param("noise_Acc")));
gyroSpinner.setValue(Double.valueOf(sensors.param("noise_Gyo")));
magSpinner.setValue(Double.valueOf(sensors.param("noise_Mag")));
presSpinner.setValue(Double.valueOf(sensors.param("noise_Prs")));
gpsSpinner.setValue(Double.valueOf(sensors.param("gpsNoiseStdDev")));
massSpinner.setValue(Double.valueOf(sensors.param("mass")));

}

Expand Down
4 changes: 2 additions & 2 deletions src/me/drton/jmavsim/Simulator.java
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ public static Vector3d magFieldLookup(LatLonAlt pos) {

if (vals.length > 3) {
try {
decl = new Double(vals[1]);
incl = new Double(vals[2]);
decl = Double.valueOf(vals[1]);
incl = Double.valueOf(vals[2]);
} catch (NumberFormatException e) {
System.err.println("Error parsing response: " + resp + "\n");
return magField;
Expand Down

0 comments on commit 5d983e9

Please sign in to comment.