Commit 06c76b6d authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Removed unused method and updated reflection-based test.

parent 3be3ea64
......@@ -1951,19 +1951,6 @@ public class NRLMSISE00 implements Atmosphere {
return densities[index];
}
/** Get one of the stored temperatures.
* @param index one of the two elements :
* <ul>
* <li>{@link #EXOSPHERIC}</li>
* <li>{@link #ALTITUDE}</li>
* </ul>
* @return the requested temperature
*/
@SuppressWarnings("unused")
public double getTemperature(final int index) {
return temperatures[index];
}
/** Calculate G(L) function with upper thermosphere parameters.
* @param p array of parameters
* @return G(L) value
......
......@@ -688,13 +688,11 @@ public class NRLMSISE00Test {
private double getOutputTemperature(Object o, int index) {
try {
Method getTemperature = getOutputClass().
getDeclaredMethod("getTemperature", Integer.TYPE);
getTemperature.setAccessible(true);
return ((Double) getTemperature.invoke(o, index)).doubleValue();
} catch (NoSuchMethodException | SecurityException |
IllegalAccessException | IllegalArgumentException |
InvocationTargetException e) {
java.lang.reflect.Field temperaturesField = getOutputClass().getDeclaredField("temperatures");
temperaturesField.setAccessible(true);
return ((double[]) temperaturesField.get(o))[index];
} catch (NoSuchFieldException | SecurityException |
IllegalAccessException | IllegalArgumentException e) {
Assert.fail(e.getLocalizedMessage());
return Double.NaN;
}
......@@ -759,13 +757,11 @@ public class NRLMSISE00Test {
private double getFieldOutputTemperature(Object o, int index) {
try {
Method getTemperature = getFieldOutputClass().
getDeclaredMethod("getTemperature", Integer.TYPE);
getTemperature.setAccessible(true);
return ((RealFieldElement<?>) getTemperature.invoke(o, index)).getReal();
} catch (NoSuchMethodException | SecurityException |
IllegalAccessException | IllegalArgumentException |
InvocationTargetException e) {
java.lang.reflect.Field temperaturesField = getFieldOutputClass().getDeclaredField("temperatures");
temperaturesField.setAccessible(true);
return ((RealFieldElement[]) temperaturesField.get(o))[index].getReal();
} catch (NoSuchFieldException | SecurityException |
IllegalAccessException | IllegalArgumentException e) {
Assert.fail(e.getLocalizedMessage());
return Double.NaN;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment