Fix eclipse warnings

This commit is contained in:
Jimmy Shih
2013-10-21 12:32:04 -07:00
parent 2e4f4cc4c2
commit b7604a11e4
2 changed files with 35 additions and 49 deletions
@@ -315,7 +315,6 @@ public class CalorieUtils {
* @param gradeBuffer * @param gradeBuffer
* @param distance * @param distance
* @param rise * @param rise
* @return
*/ */
private static double updateGrade(DoubleBuffer gradeBuffer, float distance, Double rise) { private static double updateGrade(DoubleBuffer gradeBuffer, float distance, Double rise) {
double grade = 0; double grade = 0;
@@ -45,8 +45,8 @@ public class ChartFragmentTest extends AndroidTestCase {
} }
/** /**
* Tests the logic to get the incorrect values of sensor in * Tests the logic to get the incorrect values of sensor in {@link ChartFragment#fillDataPoint(Location,
* {@link ChartFragment#fillDataPoint(Location, double[])} * double[], android.content.Context)}
*/ */
public void testFillDataPoint_sensorIncorrect() { public void testFillDataPoint_sensorIncorrect() {
MyTracksLocation myTracksLocation = TrackStubUtils.createMyTracksLocation(); MyTracksLocation myTracksLocation = TrackStubUtils.createMyTracksLocation();
@@ -69,10 +69,7 @@ public class ChartFragmentTest extends AndroidTestCase {
// Creates SensorDataSet. // Creates SensorDataSet.
SensorDataSet sensorDataSet = myTracksLocation.getSensorDataSet(); SensorDataSet sensorDataSet = myTracksLocation.getSensorDataSet();
sensorDataSet = sensorDataSet.toBuilder() sensorDataSet = sensorDataSet.toBuilder()
.setHeartRate(heartRateData) .setHeartRate(heartRateData).setCadence(cadenceData).setPower(powerData).build();
.setCadence(cadenceData)
.setPower(powerData)
.build();
myTracksLocation.setSensorDataSet(sensorDataSet); myTracksLocation.setSensorDataSet(sensorDataSet);
// Test. // Test.
point = fillDataPointTestHelper(myTracksLocation); point = fillDataPointTestHelper(myTracksLocation);
@@ -82,8 +79,8 @@ public class ChartFragmentTest extends AndroidTestCase {
} }
/** /**
* Tests the logic to get the correct values of sensor in * Tests the logic to get the correct values of sensor in {@link ChartFragment#fillDataPoint(Location,
* {@link ChartFragment#fillDataPoint(Location, double[])}. * double[], android.content.Context)}.
*/ */
public void testFillDataPoint_sensorCorrect() { public void testFillDataPoint_sensorCorrect() {
MyTracksLocation myTracksLocation = TrackStubUtils.createMyTracksLocation(); MyTracksLocation myTracksLocation = TrackStubUtils.createMyTracksLocation();
@@ -104,10 +101,7 @@ public class ChartFragmentTest extends AndroidTestCase {
// Creates SensorDataSet. // Creates SensorDataSet.
SensorDataSet sensorDataSet = myTracksLocation.getSensorDataSet(); SensorDataSet sensorDataSet = myTracksLocation.getSensorDataSet();
sensorDataSet = sensorDataSet.toBuilder() sensorDataSet = sensorDataSet.toBuilder()
.setHeartRate(heartRateData) .setHeartRate(heartRateData).setCadence(cadenceData).setPower(powerData).build();
.setCadence(cadenceData)
.setPower(powerData)
.build();
myTracksLocation.setSensorDataSet(sensorDataSet); myTracksLocation.setSensorDataSet(sensorDataSet);
// Test. // Test.
point = fillDataPointTestHelper(myTracksLocation); point = fillDataPointTestHelper(myTracksLocation);
@@ -117,8 +111,8 @@ public class ChartFragmentTest extends AndroidTestCase {
} }
/** /**
* Tests the logic to get the value of metric Distance in * Tests the logic to get the value of metric Distance in {@link ChartFragment#fillDataPoint(Location,
* {@link ChartFragment#fillDataPoint(Location, double[])}. * double[], android.content.Context)}.
*/ */
public void testFillDataPoint_distanceMetric() { public void testFillDataPoint_distanceMetric() {
// By distance. // By distance.
@@ -158,8 +152,8 @@ public class ChartFragmentTest extends AndroidTestCase {
} }
/** /**
* Tests the logic to get the value of imperial Distance in * Tests the logic to get the value of imperial Distance in {@link ChartFragment#fillDataPoint(Location,
* {@link ChartFragment#fillDataPoint(Location, double[])}. * double[], android.content.Context)}.
*/ */
public void testFillDataPoint_distanceImperial() { public void testFillDataPoint_distanceImperial() {
// By distance. // By distance.
@@ -203,8 +197,8 @@ public class ChartFragmentTest extends AndroidTestCase {
} }
/** /**
* Tests the logic to get the values of time in * Tests the logic to get the values of time in {@link ChartFragment#fillDataPoint(Location,
* {@link ChartFragment#fillDataPoint(Location, double[])}. * double[], android.content.Context)}.
*/ */
public void testFillDataPoint_time() { public void testFillDataPoint_time() {
// By time // By time
@@ -220,9 +214,8 @@ public class ChartFragmentTest extends AndroidTestCase {
} }
/** /**
* Tests the logic to get the value of elevation in * Tests the logic to get the value of elevation in {@link ChartFragment#fillDataPoint(Location,
* {@link ChartFragment#fillDataPoint(Location, double[])} by one and two * double[], android.content.Context)} by one and two points.
* points.
*/ */
public void testFillDataPoint_elevation() { public void testFillDataPoint_elevation() {
MyTracksLocation myTracksLocation1 = TrackStubUtils.createMyTracksLocation(); MyTracksLocation myTracksLocation1 = TrackStubUtils.createMyTracksLocation();
@@ -246,10 +239,10 @@ public class ChartFragmentTest extends AndroidTestCase {
} }
/** /**
* Tests the logic to get the value of speed in * Tests the logic to get the value of speed in {@link ChartFragment#fillDataPoint(Location,
* {@link ChartFragment#fillDataPoint(Location, double[])}. In this test, * double[], android.content.Context)}. In this test, firstly remove all
* firstly remove all points in memory, and then fill in two points one by * points in memory, and then fill in two points one by one. The speed values
* one. The speed values of these points are 129, 130. * of these points are 129, 130.
*/ */
public void testFillDataPoint_speed() { public void testFillDataPoint_speed() {
/* /*
@@ -293,12 +286,9 @@ public class ChartFragmentTest extends AndroidTestCase {
MyTracksLocation myTracksLocation2 = TrackStubUtils.createMyTracksLocation(); MyTracksLocation myTracksLocation2 = TrackStubUtils.createMyTracksLocation();
/* /*
* Add a time span here to make sure the second point is valid and the speed is valid. * Add a time span here to make sure the second point is valid and the speed
* * is valid. Speed is valid if: speedDifference > Constants.MAX_ACCELERATION
* Speed is valid if: * * timeDifference speedDifference = 102 -100 timeDifference = 222
* speedDifference > Constants.MAX_ACCELERATION * timeDifference
* speedDifference = 102 -100
* timeDifference = 222
*/ */
myTracksLocation2.setTime(myTracksLocation2.getTime() + 222); myTracksLocation2.setTime(myTracksLocation2.getTime() + 222);
myTracksLocation2.setSpeed(102); myTracksLocation2.setSpeed(102);
@@ -323,12 +313,9 @@ public class ChartFragmentTest extends AndroidTestCase {
MyTracksLocation myTracksLocation2 = TrackStubUtils.createMyTracksLocation(); MyTracksLocation myTracksLocation2 = TrackStubUtils.createMyTracksLocation();
/* /*
* Add a time span here to make sure the second point is valid and the speed is valid. * Add a time span here to make sure the second point is valid and the speed
* * is valid. Speed is valid if: speedDifference > Constants.MAX_ACCELERATION
* Speed is valid if: * * timeDifference speedDifference = 102 -100 timeDifference = 222
* speedDifference > Constants.MAX_ACCELERATION * timeDifference
* speedDifference = 102 -100
* timeDifference = 222
*/ */
myTracksLocation2.setTime(myTracksLocation2.getTime() + 222); myTracksLocation2.setTime(myTracksLocation2.getTime() + 222);
myTracksLocation2.setSpeed(102); myTracksLocation2.setSpeed(102);