Skip to content

Commit

Permalink
Fixed issues found during 12.2-RC1 review
Browse files Browse the repository at this point in the history
  • Loading branch information
vcucchie committed Oct 11, 2024
1 parent 6ebafab commit 477d4c5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions spotbugs-exclude-filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@
<Class name="~.*\.Units$"/>
<Bug pattern="CNT_ROUGH_CONSTANT_VALUE" />
</Match>
<Match>
<Class name="~.*\.IonosphereKlobucharMessage$"/>
<Bug pattern="CNT_ROUGH_CONSTANT_VALUE" />
</Match>

<!-- The following is a false positive from SpotBugs -->
<Match>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public ShootingPropagationSettings getPropagationSettings() {
*/
protected NumericalPropagator buildPropagator(final SpacecraftState initialState) {
final ODEIntegrator integrator = buildIntegrator(initialState);
final NumericalPropagator propagator = new NumericalPropagator(integrator);
final NumericalPropagator propagator =
new NumericalPropagator(integrator, propagationSettings.getAttitudeProvider());
propagator.setIgnoreCentralAttraction(true);
propagator.setInitialState(initialState);
propagator.setIgnoreCentralAttraction(false);
Expand All @@ -93,7 +94,6 @@ protected NumericalPropagator buildPropagator(final SpacecraftState initialState
}
propagator.setOrbitType(null);
}
propagator.setAttitudeProvider(propagationSettings.getAttitudeProvider());
for (final ForceModel forceModel: propagationSettings.getForceModels()) {
propagator.addForceModel(forceModel);
}
Expand Down Expand Up @@ -126,7 +126,8 @@ private ODEIntegrator buildIntegrator(final SpacecraftState initialState) {
protected FieldNumericalPropagator<Gradient> buildFieldPropagator(final FieldSpacecraftState<Gradient> initialState) {
final Field<Gradient> field = initialState.getDate().getField();
final FieldODEIntegrator<Gradient> integrator = buildFieldIntegrator(initialState);
final FieldNumericalPropagator<Gradient> propagator = new FieldNumericalPropagator<>(field, integrator);
final FieldNumericalPropagator<Gradient> propagator =
new FieldNumericalPropagator<>(field, integrator, propagationSettings.getAttitudeProvider());
propagator.setIgnoreCentralAttraction(true);
propagator.removeForceModels();
propagator.setInitialState(initialState);
Expand All @@ -139,7 +140,6 @@ protected FieldNumericalPropagator<Gradient> buildFieldPropagator(final FieldSpa
propagator.setIgnoreCentralAttraction(true);
}
}
propagator.setAttitudeProvider(propagationSettings.getAttitudeProvider());
for (final ForceModel forceModel: propagationSettings.getForceModels()) {
propagator.addForceModel(forceModel);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public enum CenterName {
/** Celestial body getter.
* @return getter for celestial body
*/
private final Function<CelestialBodies, CelestialBody> celestialBodyGetter;
private final transient Function<CelestialBodies, CelestialBody> celestialBodyGetter;

/** Simple constructor.
* @param celestialBodyGetter getter for celestial body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.orekit.propagation.events;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -316,7 +317,7 @@ public <T extends CalculusFieldElement<T>> T combine(final T g1, final T g2) {
/** Comparator for field elements.
* @param <T> type of the field elements
*/
private static class FieldComparator<T extends CalculusFieldElement<T>> implements Comparator<T> {
private static class FieldComparator<T extends CalculusFieldElement<T>> implements Comparator<T>, Serializable {
public int compare(final T t1, final T t2) {
return Double.compare(t1.getReal(), t2.getReal());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,15 @@ public T g(final FieldSpacecraftState<T> s) {
private static class LocalHandler<D extends FieldEventDetector<T>, T extends CalculusFieldElement<T>> implements FieldEventHandler<T> {

/** {@inheritDoc} */
@SuppressWarnings("unchecked")
public Action eventOccurred(final FieldSpacecraftState<T> s, final FieldEventDetector<T> detector, final boolean increasing) {
final FieldEventSlopeFilter<D, T> esf = (FieldEventSlopeFilter<D, T>) detector;
return esf.rawDetector.getHandler().eventOccurred(s, esf.rawDetector, esf.filter.getTriggeredIncreasing());
}

/** {@inheritDoc} */
@Override
@SuppressWarnings("unchecked")
public FieldSpacecraftState<T> resetState(final FieldEventDetector<T> detector, final FieldSpacecraftState<T> oldState) {
final FieldEventSlopeFilter<D, T> esf = (FieldEventSlopeFilter<D, T>) detector;
return esf.rawDetector.getHandler().resetState(esf.rawDetector, oldState);
Expand Down

0 comments on commit 477d4c5

Please sign in to comment.