conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
import ai.grakn.factory.SystemKeyspace;
import static ai.grakn.graql.Graql.var;
=======
import ai.grakn.engine.SystemKeyspace;
import ai.grakn.util.EmbeddedKafka;
>>>>>>>
import ai.grakn.engine.SystemKeyspace;
import ai.grakn.util.EmbeddedKafka;
<<<<<<<
import java.util.UUID;
import org.slf4j.LoggerFactory;
import spark.Service;
=======
import static ai.grakn.engine.GraknEngineConfig.JWT_SECRET_PROPERTY;
import static ai.grakn.engine.GraknEngineConfig.REDIS_SERVER_PORT;
import static ai.grakn.engine.GraknEngineServer.configureSpark;
import static ai.grakn.graql.Graql.var;
>>>>>>>
import static ai.grakn.graql.Graql.var;
import org.slf4j.LoggerFactory;
import spark.Service; |
<<<<<<<
import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.lib.AnyObjectId;
=======
>>>>>>>
import org.eclipse.jgit.errors.MissingObjectException; |
<<<<<<<
import static ai.grakn.graql.internal.reasoner.utils.ReasonerUtils.getCompatibleRelationTypesWithRoles;
import static ai.grakn.graql.internal.reasoner.utils.ReasonerUtils.getSupers;
=======
import static ai.grakn.graql.internal.reasoner.utils.ReasonerUtils.areDisjointTypes;
import static ai.grakn.graql.internal.reasoner.utils.ReasonerUtils.compatibleRelationTypesWithRoles;
import static ai.grakn.graql.internal.reasoner.utils.ReasonerUtils.supers;
>>>>>>>
import static ai.grakn.graql.internal.reasoner.utils.ReasonerUtils.compatibleRelationTypesWithRoles;
import static ai.grakn.graql.internal.reasoner.utils.ReasonerUtils.supers; |
<<<<<<<
Unifier combinedUnifier = ruleUnifier.combine(permutationUnifier);
ReasonerQueryIterator baseIterator = rule.getBody().iterator(partialSubPrime, subGoals, cache);
=======
Iterable<Answer> baseIterable = () -> rule.getBody().iterator(partialSubPrime, subGoals, cache);
Stream<Answer> iteratorStream = StreamSupport.stream(baseIterable.spliterator(), false);
>>>>>>>
Unifier combinedUnifier = ruleUnifier.combine(permutationUnifier);
Iterable<Answer> baseIterable = () -> rule.getBody().iterator(partialSubPrime, subGoals, cache);
Stream<Answer> iteratorStream = StreamSupport.stream(baseIterable.spliterator(), false); |
<<<<<<<
=======
import static ai.grakn.GraknTxType.WRITE;
import static ai.grakn.engine.controller.util.Requests.mandatoryBody;
import static ai.grakn.engine.controller.util.Requests.mandatoryQueryParameter;
import static ai.grakn.engine.controller.util.Requests.queryParameter;
import static ai.grakn.graql.internal.hal.HALBuilder.renderHALArrayData;
import static ai.grakn.graql.internal.hal.HALBuilder.renderHALConceptData;
import static ai.grakn.util.REST.Request.Graql.INFER;
import static ai.grakn.util.REST.Request.Graql.LIMIT_EMBEDDED;
import static ai.grakn.util.REST.Request.Graql.MATERIALISE;
import static ai.grakn.util.REST.Request.Graql.QUERY;
import static ai.grakn.util.REST.Request.KEYSPACE;
import static ai.grakn.util.REST.Response.ContentType.APPLICATION_HAL;
import static ai.grakn.util.REST.Response.ContentType.APPLICATION_JSON_GRAQL;
import static ai.grakn.util.REST.Response.ContentType.APPLICATION_TEXT;
import static java.lang.Boolean.parseBoolean;
>>>>>>>
<<<<<<<
@POST
@Path("/")
@ApiOperation(
value = "Executes graql insert query on the server and returns the IDs of the inserted concepts.")
@ApiImplicitParams({
@ApiImplicitParam(name = KEYSPACE, value = "Name of graph to use", required = true, dataType = "string", paramType = "query"),
@ApiImplicitParam(name = QUERY, value = "Insert query to execute", required = true, dataType = "string", paramType = "body"),
})
private Object executeGraqlPOST(Request request, Response response){
String queryString = mandatoryBody(request);
String keyspace = mandatoryQueryParameter(request, KEYSPACE);
String acceptType = getAcceptType(request);
final Timer.Context context = executeGraqlPostTimer.time();
try(GraknGraph graph = factory.getGraph(keyspace, WRITE)){
Query<?> query = graph.graql().materialise(false).infer(false).parse(queryString);
if(!(query instanceof InsertQuery)) throw GraknServerException.invalidQuery("INSERT");
Object responseBody = executeQuery(request, query, acceptType);
// Persist the transaction results TODO This should use a within-engine commit
graph.commit();
return respond(response, acceptType, responseBody);
} finally {
context.stop();
}
}
@POST
@Path("/")
@ApiOperation(value = "Executes graql delete query on the server.")
@ApiImplicitParams({
@ApiImplicitParam(name = KEYSPACE, value = "Name of graph to use", required = true, dataType = "string", paramType = "query"),
@ApiImplicitParam(name = QUERY, value = "Insert query to execute", required = true, dataType = "string", paramType = "body"),
})
private Object executeGraqlDELETE(Request request, Response response){
String queryString = mandatoryBody(request);
String keyspace = mandatoryQueryParameter(request, KEYSPACE);
final Timer.Context context = executeGraqlDeleteTimer.time();
try(GraknGraph graph = factory.getGraph(keyspace, WRITE)){
Query<?> query = graph.graql().materialise(false).infer(false).parse(queryString);
if(!(query instanceof DeleteQuery)) throw GraknServerException.invalidQuery("DELETE");
// Execute the query
((DeleteQuery) query).execute();
// Persist the transaction results TODO This should use a within-engine commit
graph.commit();
return respond(response, APPLICATION_TEXT, Json.object());
} finally {
context.stop();
}
}
=======
>>>>>>> |
<<<<<<<
import ai.grakn.graphs.MovieGraph;
import static ai.grakn.graql.internal.hal.HALBuilder.renderHALConceptData;
=======
>>>>>>>
<<<<<<<
=======
import ai.grakn.test.graphs.MovieGraph;
import ai.grakn.util.REST;
import com.jayway.restassured.response.Response;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;
import static ai.grakn.graql.internal.hal.HALBuilder.renderHALConceptData;
>>>>>>>
import ai.grakn.test.graphs.MovieGraph;
import ai.grakn.util.REST;
import com.jayway.restassured.response.Response;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;
import static ai.grakn.graql.internal.hal.HALBuilder.renderHALConceptData; |
<<<<<<<
import ai.grakn.engine.tasks.manager.TaskManager;
import ai.grakn.engine.tasks.connection.RedisCountStorage;
import ai.grakn.engine.tasks.manager.redisqueue.RedisTaskManager;
=======
import ai.grakn.engine.factory.EngineGraknGraphFactory;
import ai.grakn.engine.tasks.TaskManager;
import ai.grakn.engine.tasks.connection.RedisConnection;
import ai.grakn.engine.tasks.manager.StandaloneTaskManager;
import ai.grakn.engine.tasks.manager.singlequeue.SingleQueueTaskManager;
>>>>>>>
import ai.grakn.engine.factory.EngineGraknGraphFactory;
import ai.grakn.engine.tasks.manager.TaskManager;
import ai.grakn.engine.tasks.connection.RedisCountStorage;
import ai.grakn.engine.tasks.manager.redisqueue.RedisTaskManager;
<<<<<<<
taskManagerToReturn.getConstructor(EngineID.class, GraknEngineConfig.class, RedisCountStorage.class, MetricRegistry.class);
// TODO this doesn't take a Redis connection. Make sure this is what we expect
taskManagers.put(taskManagerToReturn, constructor.newInstance(EngineID.me(), config, redisCountStorage, new MetricRegistry()));
=======
taskManagerToReturn.getConstructor(EngineID.class, GraknEngineConfig.class, RedisConnection.class, EngineGraknGraphFactory.class);
taskManagers.put(taskManagerToReturn, constructor.newInstance(EngineID.me(), config, null, null));
>>>>>>>
taskManagerToReturn.getConstructor(EngineID.class, GraknEngineConfig.class, RedisCountStorage.class, MetricRegistry.class);
// TODO this doesn't take a Redis connection. Make sure this is what we expect
taskManagers.put(taskManagerToReturn, constructor.newInstance(EngineID.me(), config, redisCountStorage, null, new MetricRegistry())); |
<<<<<<<
private @Nullable GraphTraversalSource graphTraversalSource = null;
private final TxRuleCache ruleCache;
=======
private @Nullable
GraphTraversalSource graphTraversalSource = null;
>>>>>>>
private @Nullable GraphTraversalSource graphTraversalSource = null;
private final TxRuleCache ruleCache;
<<<<<<<
@Override
public void delete() {
closeSession();
clearGraph();
txCache().closeTx(ErrorMessage.CLOSED_CLEAR.getMessage());
ruleCache().closeTx();
//TODO We should not hit the REST endpoint when deleting keyspaces through a graph
// retrieved from and EngineGraknGraphFactory
//Remove the graph from the system keyspace
EngineCommunicator.contactEngine(getDeleteKeyspaceEndpoint(), REST.HttpConn.DELETE_METHOD);
}
=======
>>>>>>> |
<<<<<<<
String queryString = "match (role1:$x, role2:$x) isa relation1;";
String queryString2 = "match (role1:$x, role2:$y) isa relation1;";
List<Answer> answers = qb.<MatchQuery>parse(queryString).execute();
List<Answer> answers2 = qb.<MatchQuery>parse(queryString2).execute();
=======
String queryString = "match (role1:$x, role2:$x) isa relation1;";
String queryString2 = "match (role1:$x, role2:$y) isa relation1;";
List<Answer> answers = qb.<MatchQuery>parse(queryString).execute();
List<Answer> answers2 = qb.<MatchQuery>parse(queryString2).execute();
>>>>>>>
String queryString = "match (role1:$x, role2:$x) isa relation1;";
String queryString2 = "match (role1:$x, role2:$y) isa relation1;";
List<Answer> answers = qb.<MatchQuery>parse(queryString).execute();
List<Answer> answers2 = qb.<MatchQuery>parse(queryString2).execute();
<<<<<<<
}
@Test
public void whenReasoningWithResourcesWithRelationVar_ResultsAreComplete() {
QueryBuilder qb = testSet14.tx().graql().infer(true);
VarPattern has = var("x").has(Label.of("res1"), var("y"), var("r"));
List<Answer> answers = qb.match(has).execute();
assertEquals(answers.size(), 2);
answers.forEach(a -> assertTrue(a.vars().contains(var("r"))));
=======
>>>>>>>
}
@Test
public void whenReasoningWithResourcesWithRelationVar_ResultsAreComplete() {
QueryBuilder qb = testSet14.tx().graql().infer(true);
VarPattern has = var("x").has(Label.of("res1"), var("y"), var("r"));
List<Answer> answers = qb.match(has).execute();
assertEquals(answers.size(), 2);
answers.forEach(a -> assertTrue(a.vars().contains(var("r")))); |
<<<<<<<
=======
import org.slf4j.LoggerFactory;
import com.jayway.restassured.RestAssured;
import redis.embedded.RedisServer;
>>>>>>>
import org.slf4j.LoggerFactory;
import com.jayway.restassured.RestAssured;
import redis.embedded.RedisServer; |
<<<<<<<
public IdPredicate(Var varName, LabelProperty prop, ReasonerQuery par){
this(createIdVar(varName, prop, par.tx()), par);
}
private IdPredicate(IdPredicate a) { super(a);}
public IdPredicate(Var varName, ConceptId cId, ReasonerQuery par) {
super(createIdVar(varName, cId), par);
}
=======
>>>>>>> |
<<<<<<<
import static ai.grakn.engine.controller.util.Requests.mandatoryQueryParameter;
import static ai.grakn.engine.tasks.TaskSchedule.recurring;
import static ai.grakn.util.ErrorMessage.MISSING_MANDATORY_REQUEST_PARAMETERS;
import static ai.grakn.util.REST.WebPath.Tasks.GET;
import static ai.grakn.util.REST.WebPath.Tasks.STOP;
import static ai.grakn.util.REST.WebPath.Tasks.TASKS;
import static ai.grakn.util.REST.WebPath.Tasks.TASKS_BULK;
import static java.lang.Long.parseLong;
import static java.time.Instant.ofEpochMilli;
import static java.util.stream.Collectors.toList;
import ai.grakn.engine.TaskId;
=======
import ai.grakn.engine.TaskId;
>>>>>>>
import static ai.grakn.engine.controller.util.Requests.mandatoryQueryParameter;
import static ai.grakn.engine.tasks.TaskSchedule.recurring;
import static ai.grakn.util.ErrorMessage.MISSING_MANDATORY_REQUEST_PARAMETERS;
import static ai.grakn.util.REST.WebPath.Tasks.GET;
import static ai.grakn.util.REST.WebPath.Tasks.STOP;
import static ai.grakn.util.REST.WebPath.Tasks.TASKS;
import static ai.grakn.util.REST.WebPath.Tasks.TASKS_BULK;
import static java.lang.Long.parseLong;
import static java.time.Instant.ofEpochMilli;
import static java.util.stream.Collectors.toList;
import ai.grakn.engine.TaskId;
<<<<<<<
import ai.grakn.exception.EngineStorageException;
import ai.grakn.exception.GraknEngineServerException;
import ai.grakn.graql.internal.analytics.GraknVertexProgram;
import ai.grakn.util.ErrorMessage;
=======
import ai.grakn.exception.GraknBackendException;
import ai.grakn.exception.GraknServerException;
>>>>>>>
import ai.grakn.exception.EngineStorageException;
import ai.grakn.exception.GraknEngineServerException;
import ai.grakn.graql.internal.analytics.GraknVertexProgram;
import ai.grakn.util.ErrorMessage;
<<<<<<<
if (manager == null) {
throw new GraknEngineServerException(HttpStatus.SC_INTERNAL_SERVER_ERROR,
"Task manager has not been instantiated.");
=======
if (manager==null) {
throw GraknServerException.internalError("Task manager has not been instantiated.");
>>>>>>>
if (manager==null) {
throw GraknServerException.internalError("Task manager has not been instantiated.");
<<<<<<<
priority = Optional.ofNullable(priorityParam).map(TaskState.Priority::valueOf)
.orElse(DEFAULT_TASK_PRIORITY);
} catch (Exception e) {
throw new GraknEngineServerException(400, e);
=======
priority = Optional.ofNullable(priorityParam).map(TaskState.Priority::valueOf).orElse(DEFAULT_TASK_PRIORITY);
// Get the configuration of the task
configuration = TaskConfiguration.of(request.body().isEmpty() ? Json.object() : Json.read(request.body()));
} catch (Exception e){
throw GraknServerException.serverException(400, e);
>>>>>>>
priority = Optional.ofNullable(priorityParam).map(TaskState.Priority::valueOf)
.orElse(DEFAULT_TASK_PRIORITY);
} catch (Exception e) {
throw GraknServerException.serverException(400, e);
<<<<<<<
if (!BackgroundTask.class.isAssignableFrom(clazz)) {
throw new GraknEngineServerException(400, ErrorMessage.UNAVAILABLE_TASK_CLASS,
className);
}
=======
if (!BackgroundTask.class.isAssignableFrom(clazz)) throw GraknServerException.invalidTask(className);
>>>>>>>
if (!BackgroundTask.class.isAssignableFrom(clazz)) {
throw GraknServerException.invalidTask(className);
}
<<<<<<<
private void handleNotFoundInStorage(Exception exception, Response response) {
response.status(404);
=======
private void handleNotFoundInStorage(Exception exception, Response response){
//TODO: Fix this. This is needed because of a mixture of exceptions being thrown within the context of this controller
if(exception instanceof GraknServerException){
response.status(((GraknServerException) exception).getStatus());
} else {
response.status(404);
}
>>>>>>>
private void handleNotFoundInStorage(Exception exception, Response response){
//TODO: Fix this. This is needed because of a mixture of exceptions being thrown within the context of this controller
if(exception instanceof GraknServerException){
response.status(((GraknServerException) exception).getStatus());
} else {
response.status(404);
} |
<<<<<<<
if (var.isPresent() && !var.get().var().isUserDefinedName() && bothRolePlayersAreSelected(atom, getQuery)) {
roleTypes.put(varAdmin, pairVarNamesRelationType(atom));
=======
if (var.isPresent() && !var.get().var().isUserDefinedName() && bothRolePlayersAreSelected(atom, matchQuery)) {
roleTypes.put(varAdmin, pairVarNamesRelationshipType(atom));
>>>>>>>
if (var.isPresent() && !var.get().var().isUserDefinedName() && bothRolePlayersAreSelected(atom, getQuery)) {
roleTypes.put(varAdmin, pairVarNamesRelationshipType(atom));
<<<<<<<
Set<Var> selectedVars = getQuery.vars();
//If all the role players contained in the current relation are also selected in the user query
=======
Set<Var> selectedVars = matchQuery.admin().getSelectedNames();
//If all the role players contained in the current relationship are also selected in the user query
>>>>>>>
Set<Var> selectedVars = getQuery.vars();
//If all the role players contained in the current relationship are also selected in the user query
<<<<<<<
Set<Var> selectedVars = getQuery.vars();
//If all the role players contained in the current relation are also selected in the user query
=======
Set<Var> selectedVars = matchQuery.admin().getSelectedNames();
//If all the role players contained in the current relationship are also selected in the user query
>>>>>>>
Set<Var> selectedVars = getQuery.vars();
//If all the role players contained in the current relationship are also selected in the user query |
<<<<<<<
final UnnormalizedSphericalHarmonicsProvider.UnnormalizedSphericalHarmonics harmonics)
throws OrekitException {
this(initialOrbit, attitude, mass, provider.getAe(), initialOrbit.getA().getField().getZero().add(provider.getMu()),
=======
final UnnormalizedSphericalHarmonicsProvider.UnnormalizedSphericalHarmonics harmonics) {
this(initialOrbit, attitude, mass, provider.getAe(), provider.getMu(),
>>>>>>>
final UnnormalizedSphericalHarmonicsProvider.UnnormalizedSphericalHarmonics harmonics) {
this(initialOrbit, attitude, mass, provider.getAe(), initialOrbit.getA().getField().getZero().add(provider.getMu()),
<<<<<<<
final double referenceRadius, final T mu, final double[] ck0)
throws OrekitException {
=======
final double referenceRadius, final double mu, final double[] ck0) {
>>>>>>>
final double referenceRadius, final T mu, final double[] ck0) { |
<<<<<<<
public Model(final IntegratedPropagatorBuilder[] builders,
final List<ObservedMeasurement<?>> measurements,
final ParameterDriversList estimatedMeasurementsParameters,
final ModelObserver observer)
throws OrekitException {
=======
Model(final NumericalPropagatorBuilder[] builders,
final List<ObservedMeasurement<?>> measurements, final ParameterDriversList estimatedMeasurementsParameters,
final ModelObserver observer) {
>>>>>>>
public Model(final IntegratedPropagatorBuilder[] builders,
final List<ObservedMeasurement<?>> measurements,
final ParameterDriversList estimatedMeasurementsParameters,
final ModelObserver observer) {
<<<<<<<
/** {@inheritDoc} */
public ParameterDriversList getSelectedPropagationDriversForBuilder(final int iBuilder)
throws OrekitException {
=======
/** Get the selected propagation drivers for a propagatorBuilder.
* @param iBuilder index of the builder in the builders' array
* @return the list of selected propagation drivers for propagatorBuilder of index iBuilder
*/
public ParameterDriversList getSelectedPropagationDriversForBuilder(final int iBuilder) {
>>>>>>>
/** {@inheritDoc} */
public ParameterDriversList getSelectedPropagationDriversForBuilder(final int iBuilder) {
<<<<<<<
/** {@inheritDoc} */
public NumericalPropagator[] createPropagators(final RealVector point)
throws OrekitException {
=======
/** Create the propagators and parameters corresponding to an evaluation point.
* @param point evaluation point
* @return an array of new propagators
*/
public NumericalPropagator[] createPropagators(final RealVector point) {
>>>>>>>
/** {@inheritDoc} */
public NumericalPropagator[] createPropagators(final RealVector point) {
<<<<<<<
private JacobiansMapper configureDerivatives(final NumericalPropagator propagators)
throws OrekitException {
=======
private JacobiansMapper configureDerivatives(final NumericalPropagator propagator) {
>>>>>>>
private JacobiansMapper configureDerivatives(final NumericalPropagator propagators) {
<<<<<<<
/** {@inheritDoc} */
public void fetchEvaluatedMeasurement(final int index, final EstimatedMeasurement<?> evaluation)
throws OrekitException {
=======
/** Fetch a measurement that was evaluated during propagation.
* @param index index of the measurement first component
* @param evaluation measurement evaluation
*/
void fetchEvaluatedMeasurement(final int index, final EstimatedMeasurement<?> evaluation) {
>>>>>>>
/** {@inheritDoc} */
public void fetchEvaluatedMeasurement(final int index, final EstimatedMeasurement<?> evaluation) { |
<<<<<<<
/**
* Get the non-resonant tesseral terms in the central body spherical harmonic field.
* @param <T> type of the elements
* @param type type of the elements used during the propagation
* @param context container for attributes
* @param field field used by default
=======
/** Computes the potential U derivatives.
* <p>The following elements are computed from expression 3.3 - (4).
* <pre>
* dU / da
* dU / dh
* dU / dk
* dU / dλ
* dU / dα
* dU / dβ
* dU / dγ
* </pre>
* </p>
*
* @param date current date
* @return potential derivatives
>>>>>>>
/**
* Get the non-resonant tesseral terms in the central body spherical harmonic field.
* @param <T> type of the elements
* @param type type of the elements used during the propagation
* @param context container for attributes
* @param field field used by default
<<<<<<<
* @param context container for attributes
* @param hansenObjects initialization of hansen objects
=======
>>>>>>>
* @param context container for attributes
* @param hansenObjects initialization of hansen objects
<<<<<<<
* @param context container for attributes
* @param hansenObjects initialization of hansen objects
=======
>>>>>>>
* @param context container for attributes
* @param hansenObjects initialization of hansen objects |
<<<<<<<
@Test
public void testPosition() {
// Initial GPS orbital elements (Ref: IGS)
GPSOrbitalElements goe = new GPSEphemeris(7, 0, 288000, 5153.599830627441,
0.012442796607501805, 4.419469802942352E-9,0.9558937988021613,
-2.4608167886110235E-10, 1.0479401362158658, -7.967117576712062E-9,
-2.4719019944000538, -1.0899023379614294, 4.3995678424835205E-6,
1.002475619316101E-5, 183.40625, 87.03125, 3.203749656677246E-7,
4.0978193283081055E-8);
// Date of the GPS orbital elements
final AbsoluteDate target = goe.getDate();
// Build the GPS propagator
final GPSPropagator propagator = new GPSPropagator.Builder(goe).build();
// Compute the PV coordinates at the date of the GPS orbital elements
final PVCoordinates pv = propagator.getPVCoordinates(target, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
// Computed position
final Vector3D computedPos = pv.getPosition();
// Expected position (reference from IGS file igu20484_00.sp3)
final Vector3D expectedPos = new Vector3D(-4920705.292, 24248099.200, 9236130.101);
Assert.assertEquals(0., Vector3D.distance(expectedPos, computedPos), 3.2);
}
private class GPSEphemeris implements GPSOrbitalElements {
private int prn;
private int week;
private double toe;
private double sma;
private double deltaN;
private double ecc;
private double inc;
private double iDot;
private double om0;
private double dom;
private double aop;
private double anom;
private double cuc;
private double cus;
private double crc;
private double crs;
private double cic;
private double cis;
/**
* Build a new instance.
*/
GPSEphemeris(int prn, int week, double toe, double sqa, double ecc,
double deltaN, double inc, double iDot, double om0,
double dom, double aop, double anom, double cuc,
double cus, double crc, double crs, double cic, double cis) {
this.prn = prn;
this.week = week;
this.toe = toe;
this.sma = sqa * sqa;
this.ecc = ecc;
this.deltaN = deltaN;
this.inc = inc;
this.iDot = iDot;
this.om0 = om0;
this.dom = dom;
this.aop = aop;
this.anom = anom;
this.cuc = cuc;
this.cus = cus;
this.crc = crc;
this.crs = crs;
this.cic = cic;
this.cis = cis;
}
@Override
public int getPRN() {
return prn;
}
@Override
public int getWeek() {
return week;
}
@Override
public double getTime() {
return toe;
}
@Override
public double getSma() {
return sma;
}
@Override
public double getMeanMotion() {
final double absA = FastMath.abs(sma);
return FastMath.sqrt(GPS_MU / absA) / absA + deltaN;
}
@Override
public double getE() {
return ecc;
}
@Override
public double getI0() {
return inc;
}
@Override
public double getIDot() {
return iDot;
}
@Override
public double getOmega0() {
return om0;
}
@Override
public double getOmegaDot() {
return dom;
}
@Override
public double getPa() {
return aop;
}
@Override
public double getM0() {
return anom;
}
@Override
public double getCuc() {
return cuc;
}
@Override
public double getCus() {
return cus;
}
@Override
public double getCrc() {
return crc;
}
@Override
public double getCrs() {
return crs;
}
@Override
public double getCic() {
return cic;
}
@Override
public double getCis() {
return cis;
}
@Override
public AbsoluteDate getDate() {
return new GNSSDate(week, toe * 1000., SatelliteSystem.GPS).getDate();
}
}
=======
@Test
public void testIssue544() {
// Builds the GPSPropagator from the almanac
final GPSPropagator propagator = new GPSPropagator.Builder(almanacs.get(0)).build();
// In order to test the issue, we volontary set a Double.NaN value in the date.
final AbsoluteDate date0 = new AbsoluteDate(2010, 5, 7, 7, 50, Double.NaN, TimeScalesFactory.getUTC());
final PVCoordinates pv0 = propagator.propagateInEcef(date0);
// Verify that an infinite loop did not occur
Assert.assertEquals(Vector3D.NaN, pv0.getPosition());
Assert.assertEquals(Vector3D.NaN, pv0.getVelocity());
}
>>>>>>>
@Test
public void testPosition() {
// Initial GPS orbital elements (Ref: IGS)
GPSOrbitalElements goe = new GPSEphemeris(7, 0, 288000, 5153.599830627441,
0.012442796607501805, 4.419469802942352E-9,0.9558937988021613,
-2.4608167886110235E-10, 1.0479401362158658, -7.967117576712062E-9,
-2.4719019944000538, -1.0899023379614294, 4.3995678424835205E-6,
1.002475619316101E-5, 183.40625, 87.03125, 3.203749656677246E-7,
4.0978193283081055E-8);
// Date of the GPS orbital elements
final AbsoluteDate target = goe.getDate();
// Build the GPS propagator
final GPSPropagator propagator = new GPSPropagator.Builder(goe).build();
// Compute the PV coordinates at the date of the GPS orbital elements
final PVCoordinates pv = propagator.getPVCoordinates(target, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
// Computed position
final Vector3D computedPos = pv.getPosition();
// Expected position (reference from IGS file igu20484_00.sp3)
final Vector3D expectedPos = new Vector3D(-4920705.292, 24248099.200, 9236130.101);
Assert.assertEquals(0., Vector3D.distance(expectedPos, computedPos), 3.2);
}
@Test
public void testIssue544() {
// Builds the GPSPropagator from the almanac
final GPSPropagator propagator = new GPSPropagator.Builder(almanacs.get(0)).build();
// In order to test the issue, we volontary set a Double.NaN value in the date.
final AbsoluteDate date0 = new AbsoluteDate(2010, 5, 7, 7, 50, Double.NaN, TimeScalesFactory.getUTC());
final PVCoordinates pv0 = propagator.propagateInEcef(date0);
// Verify that an infinite loop did not occur
Assert.assertEquals(Vector3D.NaN, pv0.getPosition());
Assert.assertEquals(Vector3D.NaN, pv0.getVelocity());
}
private class GPSEphemeris implements GPSOrbitalElements {
private int prn;
private int week;
private double toe;
private double sma;
private double deltaN;
private double ecc;
private double inc;
private double iDot;
private double om0;
private double dom;
private double aop;
private double anom;
private double cuc;
private double cus;
private double crc;
private double crs;
private double cic;
private double cis;
/**
* Build a new instance.
*/
GPSEphemeris(int prn, int week, double toe, double sqa, double ecc,
double deltaN, double inc, double iDot, double om0,
double dom, double aop, double anom, double cuc,
double cus, double crc, double crs, double cic, double cis) {
this.prn = prn;
this.week = week;
this.toe = toe;
this.sma = sqa * sqa;
this.ecc = ecc;
this.deltaN = deltaN;
this.inc = inc;
this.iDot = iDot;
this.om0 = om0;
this.dom = dom;
this.aop = aop;
this.anom = anom;
this.cuc = cuc;
this.cus = cus;
this.crc = crc;
this.crs = crs;
this.cic = cic;
this.cis = cis;
}
@Override
public int getPRN() {
return prn;
}
@Override
public int getWeek() {
return week;
}
@Override
public double getTime() {
return toe;
}
@Override
public double getSma() {
return sma;
}
@Override
public double getMeanMotion() {
final double absA = FastMath.abs(sma);
return FastMath.sqrt(GPS_MU / absA) / absA + deltaN;
}
@Override
public double getE() {
return ecc;
}
@Override
public double getI0() {
return inc;
}
@Override
public double getIDot() {
return iDot;
}
@Override
public double getOmega0() {
return om0;
}
@Override
public double getOmegaDot() {
return dom;
}
@Override
public double getPa() {
return aop;
}
@Override
public double getM0() {
return anom;
}
@Override
public double getCuc() {
return cuc;
}
@Override
public double getCus() {
return cus;
}
@Override
public double getCrc() {
return crc;
}
@Override
public double getCrs() {
return crs;
}
@Override
public double getCic() {
return cic;
}
@Override
public double getCis() {
return cis;
}
@Override
public AbsoluteDate getDate() {
return new GNSSDate(week, toe * 1000., SatelliteSystem.GPS).getDate();
}
} |
<<<<<<<
final PropagationType type)
throws OrekitException {
// the parameter type is ignored for the Numerical Propagator
=======
final boolean meanOnly) {
// the parameter meanOnly is ignored for the Numerical Propagator
>>>>>>>
final PropagationType type) {
// the parameter type is ignored for the Numerical Propagator |
<<<<<<<
import org.orekit.attitudes.FieldAttitude;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitInternalError;
=======
>>>>>>>
import org.orekit.attitudes.FieldAttitude;
<<<<<<<
*
* @param state current state
* @param gauss Gauss quadrature
* @param low lower bound of the integral interval
* @param high upper bound of the integral interval
* @param context container for attributes
* @param parameters values of the force model parameters
* @return the mean element rates
*/
=======
*
* @param state current state
* @param gauss Gauss quadrature
* @param low lower bound of the integral interval
* @param high upper bound of the integral interval
* @return the mean element rates
*/
>>>>>>>
*
* @param state current state
* @param gauss Gauss quadrature
* @param low lower bound of the integral interval
* @param high upper bound of the integral interval
* @param context container for attributes
* @param parameters values of the force model parameters
* @return the mean element rates
*/
<<<<<<<
* @param context container for attributes
* @param parameters values of the force model parameters
=======
>>>>>>>
* @param context container for attributes
* @param parameters values of the force model parameters
<<<<<<<
* @param context container for attributes
* @param parameters values of the force model parameters
=======
>>>>>>>
* @param context container for attributes
* @param parameters values of the force model parameters |
<<<<<<<
CANNOT_COMPUTE_AIMING_AT_SINGULAR_POINT("cannot compute aiming direction at singular point: latitude = {0}, longitude = {1}"),
STEC_INTEGRATION_DID_NOT_CONVERGE("STEC integration did not converge"),
MODIP_GRID_NOT_LOADED("MODIP grid not be loaded from {0}"),
NEQUICK_F2_FM3_NOT_LOADED("NeQuick coefficient f2 or fm3 not be loaded from {0}");
=======
CANNOT_COMPUTE_AIMING_AT_SINGULAR_POINT("cannot compute aiming direction at singular point: latitude = {0}, longitude = {1}"),
NOT_A_SUPPORTED_HATANAKA_COMPRESSED_FILE("file {0} is not a supported Hatanaka-compressed file");
>>>>>>>
CANNOT_COMPUTE_AIMING_AT_SINGULAR_POINT("cannot compute aiming direction at singular point: latitude = {0}, longitude = {1}"),
STEC_INTEGRATION_DID_NOT_CONVERGE("STEC integration did not converge"),
MODIP_GRID_NOT_LOADED("MODIP grid not be loaded from {0}"),
NEQUICK_F2_FM3_NOT_LOADED("NeQuick coefficient f2 or fm3 not be loaded from {0}"),
NOT_A_SUPPORTED_HATANAKA_COMPRESSED_FILE("file {0} is not a supported Hatanaka-compressed file"); |
<<<<<<<
/**
* Simple constructor with default reference values and spherical spacecraft.
* <p>
* When this constructor is used, the reference values are:
* </p>
* <ul>
* <li>d<sub>ref</sub> = 149597870000.0 m</li>
* <li>p<sub>ref</sub> = 4.56 10<sup>-6</sup> N/m²</li>
* </ul>
* <p>
* The spacecraft has a spherical shape.
* </p>
*
* @param cr satellite radiation pressure coefficient (assuming total specular reflection)
* @param area cross sectional area of satellite
* @param sun Sun model
* @param equatorialRadius central body equatorial radius (for shadow computation)
* @param mu central attraction coefficient
* @deprecated as of 9.2 replaced by {@link #DSSTSolarRadiationPressure(double, double,
* ExtendedPVCoordinatesProvider, double)}
*/
@Deprecated
public DSSTSolarRadiationPressure(final double cr, final double area,
final PVCoordinatesProvider sun,
final double equatorialRadius,
final double mu) {
this(D_REF, P_REF, cr, area, sun, equatorialRadius, mu);
}
=======
>>>>>>>
<<<<<<<
* @param mu central attraction coefficient
* @deprecated as of 9.2 replaced by {{@link #DSSTSolarRadiationPressure(ExtendedPVCoordinatesProvider,
* double, RadiationSensitive)}
*/
public DSSTSolarRadiationPressure(final PVCoordinatesProvider sun,
final double equatorialRadius,
final RadiationSensitive spacecraft,
final double mu) {
this(D_REF, P_REF, sun, equatorialRadius, spacecraft, mu);
}
/**
* Simple constructor with default reference values, but custom spacecraft.
* <p>
* When this constructor is used, the reference values are:
* </p>
* <ul>
* <li>d<sub>ref</sub> = 149597870000.0 m</li>
* <li>p<sub>ref</sub> = 4.56 10<sup>-6</sup> N/m²</li>
* </ul>
*
* @param sun Sun model
* @param equatorialRadius central body equatorial radius (for shadow computation)
* @param spacecraft spacecraft model
* @param mu central attraction coefficient
=======
>>>>>>>
* @param mu central attraction coefficient
<<<<<<<
* @param mu central attraction coefficient
* @deprecated as of 9.2 replaced by {@link #DSSTSolarRadiationPressure(double, double,
* double, double, ExtendedPVCoordinatesProvider, double)
*/
@Deprecated
public DSSTSolarRadiationPressure(final double dRef, final double pRef,
final double cr, final double area,
final PVCoordinatesProvider sun,
final double equatorialRadius,
final double mu) {
// cR being the DSST SRP coef and assuming a spherical spacecraft,
// the conversion is:
// cR = 1 + (1 - kA) * (1 - kR) * 4 / 9
// with kA arbitrary sets to 0
this(dRef, pRef, sun, equatorialRadius, new IsotropicRadiationSingleCoefficient(area, cr), mu);
}
/**
* Constructor with customizable reference values but spherical spacecraft.
* <p>
* Note that reference solar radiation pressure <code>pRef</code> in N/m² is linked
* to solar flux SF in W/m² using formula pRef = SF/c where c is the speed of light
* (299792458 m/s). So at 1UA a 1367 W/m² solar flux is a 4.56 10<sup>-6</sup>
* N/m² solar radiation pressure.
* </p>
*
* @param dRef reference distance for the solar radiation pressure (m)
* @param pRef reference solar radiation pressure at dRef (N/m²)
* @param cr satellite radiation pressure coefficient (assuming total specular reflection)
* @param area cross sectional area of satellite
* @param sun Sun model
* @param equatorialRadius central body equatorial radius (for shadow computation)
* @param mu central attraction coefficient
=======
>>>>>>>
* @param mu central attraction coefficient
<<<<<<<
* @param mu central attraction coefficient
* @deprecated as of 9.2 replaced by {@link #DSSTSolarRadiationPressure(double, double,
* ExtendedPVCoordinatesProvider, double, RadiationSensitive)
*/
@Deprecated
public DSSTSolarRadiationPressure(final double dRef, final double pRef,
final PVCoordinatesProvider sun, final double equatorialRadius,
final RadiationSensitive spacecraft,
final double mu) {
//Call to the constructor from superclass using the numerical SRP model as ForceModel
super(PREFIX, GAUSS_THRESHOLD,
new SolarRadiationPressure(dRef, pRef, sun, equatorialRadius, spacecraft), mu);
if (sun instanceof ExtendedPVCoordinatesProvider) {
this.sun = (ExtendedPVCoordinatesProvider) sun;
} else {
this.sun = new ExtendedPVCoordinatesProvider() {
/** {@inheritDoc} */
@Override
public TimeStampedPVCoordinates getPVCoordinates(final AbsoluteDate date, final Frame frame) {
// delegate to raw Sun provider
return sun.getPVCoordinates(date, frame);
}
/** {@inheritDoc} */
@Override
public <T extends RealFieldElement<T>> TimeStampedFieldPVCoordinates<T>
getPVCoordinates(final FieldAbsoluteDate<T> date, final Frame frame) {
// SRP was created with a provider that does not support fields,
// but the fields methods are called
throw new OrekitIllegalArgumentException(LocalizedCoreFormats.UNSUPPORTED_OPERATION);
}
};
};
this.ae = equatorialRadius;
this.spacecraft = spacecraft;
}
/**
* Complete constructor.
* <p>
* Note that reference solar radiation pressure <code>pRef</code> in N/m² is linked
* to solar flux SF in W/m² using formula pRef = SF/c where c is the speed of light
* (299792458 m/s). So at 1UA a 1367 W/m² solar flux is a 4.56 10<sup>-6</sup>
* N/m² solar radiation pressure.
* </p>
*
* @param dRef reference distance for the solar radiation pressure (m)
* @param pRef reference solar radiation pressure at dRef (N/m²)
* @param sun Sun model
* @param equatorialRadius central body equatorial radius (for shadow computation)
* @param spacecraft spacecraft model
* @param mu central attraction coefficient
=======
>>>>>>>
* @param mu central attraction coefficient |
<<<<<<<
/** {@inheritDoc} */
public void getStateJacobian(final SpacecraftState state, final double[][] dYdY0)
throws OrekitException {
=======
/** Get the Jacobian with respect to state from a one-dimensional additional state array.
* <p>
* This method extract the data from the {@code state} and put it in the
* {@code dYdY0} array.
* </p>
* @param state spacecraft state
* @param dYdY0 placeholder where to put the Jacobian with respect to state
* @see #getParametersJacobian(SpacecraftState, double[][])
*/
public void getStateJacobian(final SpacecraftState state, final double[][] dYdY0) {
>>>>>>>
/** {@inheritDoc} */
public void getStateJacobian(final SpacecraftState state, final double[][] dYdY0) {
<<<<<<<
/** {@inheritDoc} */
public void getParametersJacobian(final SpacecraftState state, final double[][] dYdP)
throws OrekitException {
=======
/** Get theJacobian with respect to parameters from a one-dimensional additional state array.
* <p>
* This method extract the data from the {@code state} and put it in the
* {@code dYdP} array.
* </p>
* <p>
* If no parameters have been set in the constructor, the method returns immediately and
* does not reference {@code dYdP} which can safely be null in this case.
* </p>
* @param state spacecraft state
* @param dYdP placeholder where to put the Jacobian with respect to parameters
* @see #getStateJacobian(SpacecraftState, double[][])
*/
public void getParametersJacobian(final SpacecraftState state, final double[][] dYdP) {
>>>>>>>
/** {@inheritDoc} */
public void getParametersJacobian(final SpacecraftState state, final double[][] dYdP) { |
<<<<<<<
try {
sample.forEach(state -> {
try {
final double deltaT = state.getDate().durationFrom(date);
if (isOrbitDefined()) {
orbits.add(state.getOrbit());
} else {
absPvas.add(state.getAbsPVA());
}
attitudes.add(state.getAttitude());
massInterpolator.addSamplePoint(deltaT,
new double[] {
state.getMass()
});
for (final Map.Entry<String, HermiteInterpolator> entry : additionalInterpolators.entrySet()) {
entry.getValue().addSamplePoint(deltaT, state.getAdditionalState(entry.getKey()));
}
} catch (OrekitException oe) {
throw new OrekitExceptionWrapper(oe);
}
});
} catch (OrekitExceptionWrapper oew) {
throw oew.getException();
}
=======
sample.forEach(state -> {
final double deltaT = state.getDate().durationFrom(date);
orbits.add(state.getOrbit());
attitudes.add(state.getAttitude());
massInterpolator.addSamplePoint(deltaT,
new double[] {
state.getMass()
});
for (final Map.Entry<String, HermiteInterpolator> entry : additionalInterpolators.entrySet()) {
entry.getValue().addSamplePoint(deltaT, state.getAdditionalState(entry.getKey()));
}
});
>>>>>>>
sample.forEach(state -> {
final double deltaT = state.getDate().durationFrom(date);
if (isOrbitDefined()) {
orbits.add(state.getOrbit());
} else {
absPvas.add(state.getAbsPVA());
}
attitudes.add(state.getAttitude());
massInterpolator.addSamplePoint(deltaT,
new double[] {
state.getMass()
});
for (final Map.Entry<String, HermiteInterpolator> entry : additionalInterpolators.entrySet()) {
entry.getValue().addSamplePoint(deltaT, state.getAdditionalState(entry.getKey()));
}
});
<<<<<<<
/** Get the true latitude argument (as per equinoctial parameters).
* @return v + ω + Ω true latitude argument (rad), or {code Double.NaN} if the
* state is contains an absolute position-velocity-acceleration rather
* than an orbit
=======
/** Get the true longitude argument (as per equinoctial parameters).
* @return v + ω + Ω true longitude argument (rad)
>>>>>>>
/** Get the true latitude argument (as per equinoctial parameters).
* @return v + ω + Ω true longitude argument (rad), or {code Double.NaN} if the
* state is contains an absolute position-velocity-acceleration rather
* than an orbit
<<<<<<<
/** Get the eccentric latitude argument (as per equinoctial parameters).
* @return E + ω + Ω eccentric latitude argument (rad), or {code Double.NaN} if the
* state is contains an absolute position-velocity-acceleration rather
* than an orbit
=======
/** Get the eccentric longitude argument (as per equinoctial parameters).
* @return E + ω + Ω eccentric longitude argument (rad)
>>>>>>>
/** Get the eccentric latitude argument (as per equinoctial parameters).
* @return E + ω + Ω eccentric longitude argument (rad), or {code Double.NaN} if the
* state is contains an absolute position-velocity-acceleration rather
* than an orbit
<<<<<<<
/** Get the mean latitude argument (as per equinoctial parameters).
* @return M + ω + Ω mean latitude argument (rad), or {code Double.NaN} if the
* state is contains an absolute position-velocity-acceleration rather
* than an orbit
=======
/** Get the mean longitude argument (as per equinoctial parameters).
* @return M + ω + Ω mean longitude argument (rad)
>>>>>>>
/** Get the mean longitude argument (as per equinoctial parameters).
* @return M + ω + Ω mean latitude argument (rad), or {code Double.NaN} if the
* state is contains an absolute position-velocity-acceleration rather
* than an orbit
<<<<<<<
public TimeStampedPVCoordinates getPVCoordinates(final Frame outputFrame)
throws OrekitException {
return (absPva == null) ? orbit.getPVCoordinates(outputFrame) : absPva.getPVCoordinates(outputFrame);
=======
public TimeStampedPVCoordinates getPVCoordinates(final Frame outputFrame) {
return orbit.getPVCoordinates(outputFrame);
>>>>>>>
public TimeStampedPVCoordinates getPVCoordinates(final Frame outputFrame) {
return (absPva == null) ? orbit.getPVCoordinates(outputFrame) : absPva.getPVCoordinates(outputFrame);
<<<<<<<
/** Internal class used only for serialization. */
private static class DTOA implements Serializable {
/** Serializable UID. */
private static final long serialVersionUID = 20150916L;
/** Absolute position-velocity-acceleration. */
private final AbsolutePVCoordinates absPva;
/** Attitude and mass double values. */
private double[] d;
/** Additional states. */
private final Map<String, double[]> additional;
/** Simple constructor.
* @param state instance to serialize
*/
private DTOA(final SpacecraftState state) {
this.absPva = state.absPva;
this.additional = state.additional.isEmpty() ? null : state.additional;
final Rotation rotation = state.attitude.getRotation();
final Vector3D spin = state.attitude.getSpin();
final Vector3D rotationAcceleration = state.attitude.getRotationAcceleration();
this.d = new double[] {
rotation.getQ0(), rotation.getQ1(), rotation.getQ2(), rotation.getQ3(),
spin.getX(), spin.getY(), spin.getZ(),
rotationAcceleration.getX(), rotationAcceleration.getY(), rotationAcceleration.getZ(),
state.mass
};
}
/** Replace the deserialized data transfer object with a {@link SpacecraftState}.
* @return replacement {@link SpacecraftState}
*/
private Object readResolve() {
return new SpacecraftState(absPva,
new Attitude(absPva.getFrame(),
new TimeStampedAngularCoordinates(absPva.getDate(),
new Rotation(d[0], d[1], d[2], d[3], false),
new Vector3D(d[4], d[5], d[6]),
new Vector3D(d[7], d[8], d[9]))),
d[10], additional);
}
}
=======
@Override
public String toString() {
return "SpacecraftState{" +
"orbit=" + orbit +
", attitude=" + attitude +
", mass=" + mass +
", additional=" + additional +
'}';
}
>>>>>>>
/** Internal class used only for serialization. */
private static class DTOA implements Serializable {
/** Serializable UID. */
private static final long serialVersionUID = 20150916L;
/** Absolute position-velocity-acceleration. */
private final AbsolutePVCoordinates absPva;
/** Attitude and mass double values. */
private double[] d;
/** Additional states. */
private final Map<String, double[]> additional;
/** Simple constructor.
* @param state instance to serialize
*/
private DTOA(final SpacecraftState state) {
this.absPva = state.absPva;
this.additional = state.additional.isEmpty() ? null : state.additional;
final Rotation rotation = state.attitude.getRotation();
final Vector3D spin = state.attitude.getSpin();
final Vector3D rotationAcceleration = state.attitude.getRotationAcceleration();
this.d = new double[] {
rotation.getQ0(), rotation.getQ1(), rotation.getQ2(), rotation.getQ3(),
spin.getX(), spin.getY(), spin.getZ(),
rotationAcceleration.getX(), rotationAcceleration.getY(), rotationAcceleration.getZ(),
state.mass
};
}
/** Replace the deserialized data transfer object with a {@link SpacecraftState}.
* @return replacement {@link SpacecraftState}
*/
private Object readResolve() {
return new SpacecraftState(absPva,
new Attitude(absPva.getFrame(),
new TimeStampedAngularCoordinates(absPva.getDate(),
new Rotation(d[0], d[1], d[2], d[3], false),
new Vector3D(d[4], d[5], d[6]),
new Vector3D(d[7], d[8], d[9]))),
d[10], additional);
}
}
@Override
public String toString() {
return "SpacecraftState{" +
"orbit=" + orbit +
", attitude=" + attitude +
", mass=" + mass +
", additional=" + additional +
'}';
} |
<<<<<<<
* @param observer occurred event observer
* @param orbitType orbit type
* @param angleType position angle type
* @param attitudeProvider attitude provider
=======
* @param mapper mapper between spacecraft state and simple array
>>>>>>>
* @param orbitType orbit type
* @param angleType position angle type
* @param attitudeProvider attitude provider
<<<<<<<
public AdaptedEventDetector(final EventDetector detector, final EventObserver observer,
final OrbitType orbitType, final PositionAngle angleType,
final AttitudeProvider attitudeProvider,
final AbsoluteDate referenceDate,
=======
public AdaptedEventDetector(final EventDetector detector,
final StateMapper mapper, final AbsoluteDate referenceDate,
>>>>>>>
public AdaptedEventDetector(final EventDetector detector,
final OrbitType orbitType, final PositionAngle angleType,
final AttitudeProvider attitudeProvider,
final AbsoluteDate referenceDate,
<<<<<<<
this.observer = observer;
this.orbitType = orbitType;
this.angleType = angleType;
this.attitudeProvider = attitudeProvider;
=======
this.mapper = mapper;
>>>>>>>
this.orbitType = orbitType;
this.angleType = angleType;
this.attitudeProvider = attitudeProvider; |
<<<<<<<
final boolean firing = ((Maneuver) forceModel).getManeuverTriggers().isFiring(new double[] {});
final Vector3D thrustVector = ((ConstantThrustManeuver) forceModel).getThrustVector();
final double thrust = thrustVector.getNorm();
final Vector3D direction = thrustVector.normalize();
if (firing) {
=======
double thrust = forceModel.getParameterDriver(ConstantThrustManeuver.THRUST).getValue();
java.lang.reflect.Field directionField = ConstantThrustManeuver.class.getDeclaredField("direction");
directionField.setAccessible(true);
Vector3D direction;
direction = (Vector3D) directionField.get(forceModel);
if (((ConstantThrustManeuver) forceModel).isFiring(date)) {
>>>>>>>
final boolean firing = ((ConstantThrustManeuver) forceModel).isFiring(date);
final Vector3D thrustVector = ((ConstantThrustManeuver) forceModel).getThrustVector();
final double thrust = thrustVector.getNorm();
final Vector3D direction = thrustVector.normalize();
if (firing) {
<<<<<<<
} catch (IllegalArgumentException e) {
=======
} catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException e) {
Assert.fail(e.getLocalizedMessage());
>>>>>>>
} catch (IllegalArgumentException | SecurityException e) {
Assert.fail(e.getLocalizedMessage()); |
<<<<<<<
final IntegratedPropagatorBuilder... propagatorBuilder)
throws OrekitException {
=======
final NumericalPropagatorBuilder... propagatorBuilder) {
>>>>>>>
final IntegratedPropagatorBuilder... propagatorBuilder) {
<<<<<<<
public AbstractIntegratedPropagator[] estimate() throws OrekitException {
=======
public NumericalPropagator[] estimate() {
>>>>>>>
public AbstractIntegratedPropagator[] estimate() { |
<<<<<<<
import org.orekit.errors.OrekitIllegalArgumentException;
import org.orekit.errors.OrekitIllegalStateException;
=======
>>>>>>>
<<<<<<<
* a simple keplerian model for orbit, a Taylor expansion for absolute
* position-velocity-acceleration, a linear extrapolation for attitude
* taking the spin rate into account and neither mass nor additional states
* changes. It is <em>not</em> intended as a replacement for proper orbit
=======
* simple models. For orbits, the model is a Keplerian one if no derivatives
* are available in the orbit, or Keplerian plus quadratic effect of the
* non-Keplerian acceleration if derivatives are available. For attitude,
* a polynomial model is used. Neither mass nor additional states change.
* Shifting is <em>not</em> intended as a replacement for proper orbit
>>>>>>>
* simple models. For orbits, the model is a Keplerian one if no derivatives
* are available in the orbit, or Keplerian plus quadratic effect of the
* non-Keplerian acceleration if derivatives are available. For attitude,
* a polynomial model is used. Neither mass nor additional states change.
* Shifting is <em>not</em> intended as a replacement for proper orbit
<<<<<<<
final Collection<SpacecraftState> sample)
throws OrekitException, OrekitIllegalStateException {
=======
final Stream<SpacecraftState> sample)
throws OrekitException {
>>>>>>>
final Stream<SpacecraftState> sample)
throws OrekitException {
<<<<<<<
final List<Orbit> orbits;
final List<AbsolutePVCoordinates> absPvas;
if (isOrbitDefined()) {
orbits = new ArrayList<Orbit>(sample.size());
absPvas = null;
} else {
orbits = null;
absPvas = new ArrayList<AbsolutePVCoordinates>(sample.size());
}
final List<Attitude> attitudes = new ArrayList<Attitude>(sample.size());
=======
final List<Orbit> orbits = new ArrayList<>();
final List<Attitude> attitudes = new ArrayList<>();
>>>>>>>
final List<Orbit> orbits;
final List<AbsolutePVCoordinates> absPvas;
if (isOrbitDefined()) {
orbits = new ArrayList<Orbit>();
absPvas = null;
} else {
orbits = null;
absPvas = new ArrayList<AbsolutePVCoordinates>();
}
final List<Attitude> attitudes = new ArrayList<Attitude>();
<<<<<<<
for (final SpacecraftState state : sample) {
final double deltaT = state.getDate().durationFrom(date);
if (isOrbitDefined()) {
orbits.add(state.getOrbit());
} else {
absPvas.add(state.getAbsPVA());
}
attitudes.add(state.getAttitude());
massInterpolator.addSamplePoint(deltaT,
new double[] {
state.getMass()
});
for (final Map.Entry<String, HermiteInterpolator> entry : additionalInterpolators.entrySet()) {
entry.getValue().addSamplePoint(deltaT, state.getAdditionalState(entry.getKey()));
}
=======
try {
sample.forEach(state -> {
try {
final double deltaT = state.getDate().durationFrom(date);
orbits.add(state.getOrbit());
attitudes.add(state.getAttitude());
massInterpolator.addSamplePoint(deltaT,
new double[] {
state.getMass()
});
for (final Map.Entry<String, HermiteInterpolator> entry : additionalInterpolators.entrySet()) {
entry.getValue().addSamplePoint(deltaT, state.getAdditionalState(entry.getKey()));
}
} catch (OrekitException oe) {
throw new OrekitExceptionWrapper(oe);
}
});
} catch (OrekitExceptionWrapper oew) {
throw oew.getException();
>>>>>>>
try {
sample.forEach(state -> {
try {
final double deltaT = state.getDate().durationFrom(date);
if (isOrbitDefined()) {
orbits.add(state.getOrbit());
} else {
absPvas.add(state.getAbsPVA());
}
attitudes.add(state.getAttitude());
massInterpolator.addSamplePoint(deltaT,
new double[] {
state.getMass()
});
for (final Map.Entry<String, HermiteInterpolator> entry : additionalInterpolators.entrySet()) {
entry.getValue().addSamplePoint(deltaT, state.getAdditionalState(entry.getKey()));
}
} catch (OrekitException oe) {
throw new OrekitExceptionWrapper(oe);
}
});
} catch (OrekitExceptionWrapper oew) {
throw oew.getException();
<<<<<<<
* @return keplerian period in seconds, or {code Double.NaN} if the
* state is contains an absolute position-velocity-acceleration rather
* than an orbit
=======
* @return Keplerian period in seconds
>>>>>>>
* @return keplerian period in seconds, or {code Double.NaN} if the
* state is contains an absolute position-velocity-acceleration rather
* than an orbit
<<<<<<<
* @return keplerian mean motion in radians per second, or {code Double.NaN} if the
* state is contains an absolute position-velocity-acceleration rather
* than an orbit
=======
* @return Keplerian mean motion in radians per second
>>>>>>>
* @return keplerian mean motion in radians per second, or {code Double.NaN} if the
* state is contains an absolute position-velocity-acceleration rather
* than an orbit |
<<<<<<<
SP3_UNSUPPORTED_VERSION("unsupported sp3 file version {0}"),
SP3_UNSUPPORTED_TIMESYSTEM("unsupported time system {0}"),
=======
DSST_ECC_NO_NUMERICAL_AVERAGING_METHOD("The current orbit has an eccentricity ({0} > 0.5). DSST needs an unimplemented time dependent numerical method to compute the averaged rates"),
SP3_UNSUPPORTED_VERSION("SP3 format version {0} is not supported"),
SP3_UNSUPPORTED_TIMESYSTEM("time system {0} it not supported"),
>>>>>>>
DSST_ECC_NO_NUMERICAL_AVERAGING_METHOD("The current orbit has an eccentricity ({0} > 0.5). DSST needs an unimplemented time dependent numerical method to compute the averaged rates"),
SP3_UNSUPPORTED_VERSION("unsupported sp3 file version {0}"),
SP3_UNSUPPORTED_TIMESYSTEM("unsupported time system {0}"), |
<<<<<<<
final String[] stationNames = parser.getStringArray(ParameterKey.GROUND_STATION_NAME);
final double[] stationLatitudes = parser.getAngleArray(ParameterKey.GROUND_STATION_LATITUDE);
final double[] stationLongitudes = parser.getAngleArray(ParameterKey.GROUND_STATION_LONGITUDE);
final double[] stationAltitudes = parser.getDoubleArray(ParameterKey.GROUND_STATION_ALTITUDE);
final boolean[] stationPositionEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_POSITION_ESTIMATED);
final double[] stationRangeSigma = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_SIGMA);
final double[] stationRangeBias = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_BIAS);
final double[] stationRangeBiasMin = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_BIAS_MIN);
final double[] stationRangeBiasMax = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_BIAS_MAX);
final boolean[] stationRangeBiasEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_RANGE_BIAS_ESTIMATED);
final double[] stationRangeRateSigma = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_RATE_SIGMA);
final double[] stationRangeRateBias = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_RATE_BIAS);
final double[] stationRangeRateBiasMin = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_RATE_BIAS_MIN);
final double[] stationRangeRateBiasMax = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_RATE_BIAS_MAX);
final boolean[] stationRangeRateBiasEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_RANGE_RATE_BIAS_ESTIMATED);
final double[] stationAzimuthSigma = parser.getAngleArray(ParameterKey.GROUND_STATION_AZIMUTH_SIGMA);
final double[] stationAzimuthBias = parser.getAngleArray(ParameterKey.GROUND_STATION_AZIMUTH_BIAS);
final double[] stationAzimuthBiasMin = parser.getAngleArray(ParameterKey.GROUND_STATION_AZIMUTH_BIAS_MIN);
final double[] stationAzimuthBiasMax = parser.getAngleArray(ParameterKey.GROUND_STATION_AZIMUTH_BIAS_MAX);
final double[] stationElevationSigma = parser.getAngleArray(ParameterKey.GROUND_STATION_ELEVATION_SIGMA);
final double[] stationElevationBias = parser.getAngleArray(ParameterKey.GROUND_STATION_ELEVATION_BIAS);
final double[] stationElevationBiasMin = parser.getAngleArray(ParameterKey.GROUND_STATION_ELEVATION_BIAS_MIN);
final double[] stationElevationBiasMax = parser.getAngleArray(ParameterKey.GROUND_STATION_ELEVATION_BIAS_MAX);
final boolean[] stationAzElBiasesEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_AZ_EL_BIASES_ESTIMATED);
final boolean[] stationElevationRefraction = parser.getBooleanArray(ParameterKey.GROUND_STATION_ELEVATION_REFRACTION_CORRECTION);
final boolean[] stationTroposphericModelEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_TROPOSPHERIC_MODEL_ESTIMATED);
final double[] stationTroposphericZenithDelay = parser.getDoubleArray(ParameterKey.GROUND_STATION_TROPOSPHERIC_ZENITH_DELAY);
final boolean[] stationZenithDelayEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_TROPOSPHERIC_DELAY_ESTIMATED);
final boolean[] stationGlobalMappingFunction = parser.getBooleanArray(ParameterKey.GROUND_STATION_GLOBAL_MAPPING_FUNCTION);
final boolean[] stationNiellMappingFunction = parser.getBooleanArray(ParameterKey.GROUND_STATION_NIELL_MAPPING_FUNCTION);
final boolean[] stationRangeTropospheric = parser.getBooleanArray(ParameterKey.GROUND_STATION_RANGE_TROPOSPHERIC_CORRECTION);
=======
final String[] stationNames = parser.getStringArray(ParameterKey.GROUND_STATION_NAME);
final double[] stationLatitudes = parser.getAngleArray(ParameterKey.GROUND_STATION_LATITUDE);
final double[] stationLongitudes = parser.getAngleArray(ParameterKey.GROUND_STATION_LONGITUDE);
final double[] stationAltitudes = parser.getDoubleArray(ParameterKey.GROUND_STATION_ALTITUDE);
final double[] stationClockOffsets = parser.getDoubleArray(ParameterKey.GROUND_STATION_CLOCK_OFFSET);
final double[] stationClockOffsetsMin = parser.getDoubleArray(ParameterKey.GROUND_STATION_CLOCK_OFFSET_MIN);
final double[] stationClockOffsetsMax = parser.getDoubleArray(ParameterKey.GROUND_STATION_CLOCK_OFFSET_MAX);
final boolean[] stationClockOffsetEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_CLOCK_OFFSET_ESTIMATED);
final boolean[] stationPositionEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_POSITION_ESTIMATED);
final double[] stationRangeSigma = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_SIGMA);
final double[] stationRangeBias = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_BIAS);
final double[] stationRangeBiasMin = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_BIAS_MIN);
final double[] stationRangeBiasMax = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_BIAS_MAX);
final boolean[] stationRangeBiasEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_RANGE_BIAS_ESTIMATED);
final double[] stationRangeRateSigma = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_RATE_SIGMA);
final double[] stationRangeRateBias = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_RATE_BIAS);
final double[] stationRangeRateBiasMin = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_RATE_BIAS_MIN);
final double[] stationRangeRateBiasMax = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_RATE_BIAS_MAX);
final boolean[] stationRangeRateBiasEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_RANGE_RATE_BIAS_ESTIMATED);
final double[] stationAzimuthSigma = parser.getAngleArray(ParameterKey.GROUND_STATION_AZIMUTH_SIGMA);
final double[] stationAzimuthBias = parser.getAngleArray(ParameterKey.GROUND_STATION_AZIMUTH_BIAS);
final double[] stationAzimuthBiasMin = parser.getAngleArray(ParameterKey.GROUND_STATION_AZIMUTH_BIAS_MIN);
final double[] stationAzimuthBiasMax = parser.getAngleArray(ParameterKey.GROUND_STATION_AZIMUTH_BIAS_MAX);
final double[] stationElevationSigma = parser.getAngleArray(ParameterKey.GROUND_STATION_ELEVATION_SIGMA);
final double[] stationElevationBias = parser.getAngleArray(ParameterKey.GROUND_STATION_ELEVATION_BIAS);
final double[] stationElevationBiasMin = parser.getAngleArray(ParameterKey.GROUND_STATION_ELEVATION_BIAS_MIN);
final double[] stationElevationBiasMax = parser.getAngleArray(ParameterKey.GROUND_STATION_ELEVATION_BIAS_MAX);
final boolean[] stationAzElBiasesEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_AZ_EL_BIASES_ESTIMATED);
final boolean[] stationElevationRefraction = parser.getBooleanArray(ParameterKey.GROUND_STATION_ELEVATION_REFRACTION_CORRECTION);
final boolean[] stationRangeTropospheric = parser.getBooleanArray(ParameterKey.GROUND_STATION_RANGE_TROPOSPHERIC_CORRECTION);
>>>>>>>
final String[] stationNames = parser.getStringArray(ParameterKey.GROUND_STATION_NAME);
final double[] stationLatitudes = parser.getAngleArray(ParameterKey.GROUND_STATION_LATITUDE);
final double[] stationLongitudes = parser.getAngleArray(ParameterKey.GROUND_STATION_LONGITUDE);
final double[] stationAltitudes = parser.getDoubleArray(ParameterKey.GROUND_STATION_ALTITUDE);
final double[] stationClockOffsets = parser.getDoubleArray(ParameterKey.GROUND_STATION_CLOCK_OFFSET);
final double[] stationClockOffsetsMin = parser.getDoubleArray(ParameterKey.GROUND_STATION_CLOCK_OFFSET_MIN);
final double[] stationClockOffsetsMax = parser.getDoubleArray(ParameterKey.GROUND_STATION_CLOCK_OFFSET_MAX);
final boolean[] stationClockOffsetEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_CLOCK_OFFSET_ESTIMATED);
final boolean[] stationPositionEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_POSITION_ESTIMATED);
final double[] stationRangeSigma = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_SIGMA);
final double[] stationRangeBias = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_BIAS);
final double[] stationRangeBiasMin = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_BIAS_MIN);
final double[] stationRangeBiasMax = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_BIAS_MAX);
final boolean[] stationRangeBiasEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_RANGE_BIAS_ESTIMATED);
final double[] stationRangeRateSigma = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_RATE_SIGMA);
final double[] stationRangeRateBias = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_RATE_BIAS);
final double[] stationRangeRateBiasMin = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_RATE_BIAS_MIN);
final double[] stationRangeRateBiasMax = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_RATE_BIAS_MAX);
final boolean[] stationRangeRateBiasEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_RANGE_RATE_BIAS_ESTIMATED);
final double[] stationAzimuthSigma = parser.getAngleArray(ParameterKey.GROUND_STATION_AZIMUTH_SIGMA);
final double[] stationAzimuthBias = parser.getAngleArray(ParameterKey.GROUND_STATION_AZIMUTH_BIAS);
final double[] stationAzimuthBiasMin = parser.getAngleArray(ParameterKey.GROUND_STATION_AZIMUTH_BIAS_MIN);
final double[] stationAzimuthBiasMax = parser.getAngleArray(ParameterKey.GROUND_STATION_AZIMUTH_BIAS_MAX);
final double[] stationElevationSigma = parser.getAngleArray(ParameterKey.GROUND_STATION_ELEVATION_SIGMA);
final double[] stationElevationBias = parser.getAngleArray(ParameterKey.GROUND_STATION_ELEVATION_BIAS);
final double[] stationElevationBiasMin = parser.getAngleArray(ParameterKey.GROUND_STATION_ELEVATION_BIAS_MIN);
final double[] stationElevationBiasMax = parser.getAngleArray(ParameterKey.GROUND_STATION_ELEVATION_BIAS_MAX);
final boolean[] stationAzElBiasesEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_AZ_EL_BIASES_ESTIMATED);
final boolean[] stationElevationRefraction = parser.getBooleanArray(ParameterKey.GROUND_STATION_ELEVATION_REFRACTION_CORRECTION);
final boolean[] stationTroposphericModelEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_TROPOSPHERIC_MODEL_ESTIMATED);
final double[] stationTroposphericZenithDelay = parser.getDoubleArray(ParameterKey.GROUND_STATION_TROPOSPHERIC_ZENITH_DELAY);
final boolean[] stationZenithDelayEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_TROPOSPHERIC_DELAY_ESTIMATED);
final boolean[] stationGlobalMappingFunction = parser.getBooleanArray(ParameterKey.GROUND_STATION_GLOBAL_MAPPING_FUNCTION);
final boolean[] stationNiellMappingFunction = parser.getBooleanArray(ParameterKey.GROUND_STATION_NIELL_MAPPING_FUNCTION);
final boolean[] stationRangeTropospheric = parser.getBooleanArray(ParameterKey.GROUND_STATION_RANGE_TROPOSPHERIC_CORRECTION); |
<<<<<<<
public <T extends RealFieldElement<T>> List<FieldShortPeriodTerms<T>> initialize(final FieldAuxiliaryElements<T> auxiliaryElements,
final PropagationType type,
final T[] parameters)
throws OrekitException {
// Field used by default
final Field<T> field = auxiliaryElements.getDate().getField();
if (pendingInitialization == true) {
// Initializes specific parameters.
final FieldDSSTThirdBodyContext<T> context = initializeStep(auxiliaryElements, parameters);
maxFieldFreqF = context.getMaxFreqF();
fieldHansen.put(field, new FieldHansenObjects<>(field));
pendingInitialization = false;
}
final int jMax = maxFieldFreqF;
final FieldThirdBodyShortPeriodicCoefficients<T> ftbspc =
new FieldThirdBodyShortPeriodicCoefficients<>(jMax, INTERPOLATION_POINTS,
maxFieldFreqF, body.getName(),
new FieldTimeSpanMap<>(new FieldSlot<>(jMax,
INTERPOLATION_POINTS),
field));
fieldShortPeriods.put(field, ftbspc);
return Collections.singletonList(ftbspc);
}
/** Performs initialization at each integration step for the current force model.
* <p>
* This method aims at being called before mean elements rates computation.
* </p>
* @param auxiliaryElements auxiliary elements related to the current orbit
* @param parameters values of the force model parameters
* @return new force model context
* @throws OrekitException if some specific error occurs
*/
private DSSTThirdBodyContext initializeStep(final AuxiliaryElements auxiliaryElements, final double[] parameters)
throws OrekitException {
return new DSSTThirdBodyContext(auxiliaryElements, body, parameters);
}
/** Performs initialization at each integration step for the current force model.
* <p>
* This method aims at being called before mean elements rates computation.
* </p>
* @param <T> type of the elements
* @param auxiliaryElements auxiliary elements related to the current orbit
* @param parameters values of the force model parameters
* @return new force model context
* @throws OrekitException if some specific error occurs
*/
private <T extends RealFieldElement<T>> FieldDSSTThirdBodyContext<T> initializeStep(final FieldAuxiliaryElements<T> auxiliaryElements,
final T[] parameters)
throws OrekitException {
return new FieldDSSTThirdBodyContext<>(auxiliaryElements, body, parameters);
=======
public void initializeStep(final AuxiliaryElements aux) {
// Equinoctial elements
a = aux.getSma();
k = aux.getK();
h = aux.getH();
q = aux.getQ();
p = aux.getP();
// Eccentricity
ecc = aux.getEcc();
// Distance from center of mass of the central body to the 3rd body
final Vector3D bodyPos = body.getPVCoordinates(aux.getDate(), aux.getFrame()).getPosition();
R3 = bodyPos.getNorm();
// Direction cosines
final Vector3D bodyDir = bodyPos.normalize();
alpha = bodyDir.dotProduct(aux.getVectorF());
beta = bodyDir.dotProduct(aux.getVectorG());
gamma = bodyDir.dotProduct(aux.getVectorW());
// Equinoctial coefficients
A = aux.getA();
B = aux.getB();
C = aux.getC();
meanMotion = aux.getMeanMotion();
//Χ<sup>-2</sup>.
BB = B * B;
//Χ<sup>-3</sup>.
BBB = BB * B;
//b = 1 / (1 + B)
b = 1. / (1. + B);
// Χ
X = 1. / B;
XX = X * X;
XXX = X * XX;
// -2 * a / A
m2aoA = -2. * a / A;
// B / A
BoA = B / A;
// 1 / AB
ooAB = 1. / (A * B);
// -C / 2AB
mCo2AB = -C * ooAB / 2.;
// B / A(1 + B)
BoABpo = BoA / (1. + B);
// mu3 / R3
muoR3 = gm / R3;
//h * Χ³
hXXX = h * XXX;
//k * Χ³
kXXX = k * XXX;
>>>>>>>
public <T extends RealFieldElement<T>> List<FieldShortPeriodTerms<T>> initialize(final FieldAuxiliaryElements<T> auxiliaryElements,
final PropagationType type,
final T[] parameters) {
// Field used by default
final Field<T> field = auxiliaryElements.getDate().getField();
if (pendingInitialization == true) {
// Initializes specific parameters.
final FieldDSSTThirdBodyContext<T> context = initializeStep(auxiliaryElements, parameters);
maxFieldFreqF = context.getMaxFreqF();
fieldHansen.put(field, new FieldHansenObjects<>(field));
pendingInitialization = false;
}
final int jMax = maxFieldFreqF;
final FieldThirdBodyShortPeriodicCoefficients<T> ftbspc =
new FieldThirdBodyShortPeriodicCoefficients<>(jMax, INTERPOLATION_POINTS,
maxFieldFreqF, body.getName(),
new FieldTimeSpanMap<>(new FieldSlot<>(jMax,
INTERPOLATION_POINTS),
field));
fieldShortPeriods.put(field, ftbspc);
return Collections.singletonList(ftbspc);
}
/** Performs initialization at each integration step for the current force model.
* <p>
* This method aims at being called before mean elements rates computation.
* </p>
* @param auxiliaryElements auxiliary elements related to the current orbit
* @param parameters values of the force model parameters
* @return new force model context
*/
private DSSTThirdBodyContext initializeStep(final AuxiliaryElements auxiliaryElements, final double[] parameters) {
return new DSSTThirdBodyContext(auxiliaryElements, body, parameters);
}
/** Performs initialization at each integration step for the current force model.
* <p>
* This method aims at being called before mean elements rates computation.
* </p>
* @param <T> type of the elements
* @param auxiliaryElements auxiliary elements related to the current orbit
* @param parameters values of the force model parameters
* @return new force model context
*/
private <T extends RealFieldElement<T>> FieldDSSTThirdBodyContext<T> initializeStep(final FieldAuxiliaryElements<T> auxiliaryElements,
final T[] parameters) {
return new FieldDSSTThirdBodyContext<>(auxiliaryElements, body, parameters);
<<<<<<<
public <T extends RealFieldElement<T>> T[] getMeanElementRate(final FieldSpacecraftState<T> currentState,
final FieldAuxiliaryElements<T> auxiliaryElements,
final T[] parameters)
throws OrekitException {
// Parameters for array building
final Field<T> field = currentState.getDate().getField();
final T zero = field.getZero();
// Container for attributes
final FieldDSSTThirdBodyContext<T> context = initializeStep(auxiliaryElements, parameters);
@SuppressWarnings("unchecked")
final FieldHansenObjects<T> fho = (FieldHansenObjects<T>) fieldHansen.get(field);
// Access to potential U derivatives
final FieldUAnddU<T> udu = new FieldUAnddU<>(context, fho);
// Compute cross derivatives [Eq. 2.2-(8)]
// U(alpha,gamma) = alpha * dU/dgamma - gamma * dU/dalpha
final T UAlphaGamma = udu.getdUdGa().multiply(context.getAlpha()).subtract(udu.getdUdAl().multiply(context.getGamma()));
// U(beta,gamma) = beta * dU/dgamma - gamma * dU/dbeta
final T UBetaGamma = udu.getdUdGa().multiply(context.getBeta()).subtract(udu.getdUdBe().multiply(context.getGamma()));
// Common factor
final T pUAGmIqUBGoAB = (UAlphaGamma.multiply(auxiliaryElements.getP()).subtract(UBetaGamma.multiply(auxiliaryElements.getQ()).multiply(I))).multiply(context.getOoAB());
// Compute mean elements rates [Eq. 3.1-(1)]
final T da = zero;
final T dh = udu.getdUdk().multiply(context.getBoA()).add(pUAGmIqUBGoAB.multiply(auxiliaryElements.getK()));
final T dk = ((udu.getdUdh().multiply(context.getBoA())).negate()).subtract(pUAGmIqUBGoAB.multiply(auxiliaryElements.getH()));
final T dp = UBetaGamma.multiply(context.getMCo2AB());
final T dq = UAlphaGamma.multiply(I).multiply(context.getMCo2AB());
final T dM = pUAGmIqUBGoAB.add(udu.getdUda().multiply(context.getM2aoA())).add((udu.getdUdh().multiply(auxiliaryElements.getH()).add(udu.getdUdk().multiply(auxiliaryElements.getK()))).multiply(context.getBoABpo()));
final T[] elements = MathArrays.buildArray(field, 6);
elements[0] = da;
elements[1] = dk;
elements[2] = dh;
elements[3] = dq;
elements[4] = dp;
elements[5] = dM;
return elements;
}
/** {@inheritDoc} */
@Override
public void updateShortPeriodTerms(final double[] parameters, final SpacecraftState... meanStates)
throws OrekitException {
=======
public void updateShortPeriodTerms(final SpacecraftState... meanStates) {
>>>>>>>
public <T extends RealFieldElement<T>> T[] getMeanElementRate(final FieldSpacecraftState<T> currentState,
final FieldAuxiliaryElements<T> auxiliaryElements,
final T[] parameters) {
// Parameters for array building
final Field<T> field = currentState.getDate().getField();
final T zero = field.getZero();
// Container for attributes
final FieldDSSTThirdBodyContext<T> context = initializeStep(auxiliaryElements, parameters);
@SuppressWarnings("unchecked")
final FieldHansenObjects<T> fho = (FieldHansenObjects<T>) fieldHansen.get(field);
// Access to potential U derivatives
final FieldUAnddU<T> udu = new FieldUAnddU<>(context, fho);
// Compute cross derivatives [Eq. 2.2-(8)]
// U(alpha,gamma) = alpha * dU/dgamma - gamma * dU/dalpha
final T UAlphaGamma = udu.getdUdGa().multiply(context.getAlpha()).subtract(udu.getdUdAl().multiply(context.getGamma()));
// U(beta,gamma) = beta * dU/dgamma - gamma * dU/dbeta
final T UBetaGamma = udu.getdUdGa().multiply(context.getBeta()).subtract(udu.getdUdBe().multiply(context.getGamma()));
// Common factor
final T pUAGmIqUBGoAB = (UAlphaGamma.multiply(auxiliaryElements.getP()).subtract(UBetaGamma.multiply(auxiliaryElements.getQ()).multiply(I))).multiply(context.getOoAB());
// Compute mean elements rates [Eq. 3.1-(1)]
final T da = zero;
final T dh = udu.getdUdk().multiply(context.getBoA()).add(pUAGmIqUBGoAB.multiply(auxiliaryElements.getK()));
final T dk = ((udu.getdUdh().multiply(context.getBoA())).negate()).subtract(pUAGmIqUBGoAB.multiply(auxiliaryElements.getH()));
final T dp = UBetaGamma.multiply(context.getMCo2AB());
final T dq = UAlphaGamma.multiply(I).multiply(context.getMCo2AB());
final T dM = pUAGmIqUBGoAB.add(udu.getdUda().multiply(context.getM2aoA())).add((udu.getdUdh().multiply(auxiliaryElements.getH()).add(udu.getdUdk().multiply(auxiliaryElements.getK()))).multiply(context.getBoABpo()));
final T[] elements = MathArrays.buildArray(field, 6);
elements[0] = da;
elements[1] = dk;
elements[2] = dh;
elements[3] = dq;
elements[4] = dp;
elements[5] = dM;
return elements;
}
/** {@inheritDoc} */
@Override
public void updateShortPeriodTerms(final double[] parameters, final SpacecraftState... meanStates) {
<<<<<<<
public Map<String, T[]> getCoefficients(final FieldAbsoluteDate<T> date, final Set<String> selected)
throws OrekitException {
=======
public Map<String, double[]> getCoefficients(final AbsoluteDate date, final Set<String> selected) {
>>>>>>>
public Map<String, T[]> getCoefficients(final FieldAbsoluteDate<T> date, final Set<String> selected) { |
<<<<<<<
/** Build an instance corresponding to a GPS date.
* <p>GPS dates are provided as a week number starting at
* {@link #GPS_EPOCH GPS epoch} and as a number of milliseconds
* since week start.</p>
* @param weekNumber week number since {@link #GPS_EPOCH GPS epoch}
* @param milliInWeek number of milliseconds since week start
* @return a new instant
* @deprecated as of 9.3, replaced by {@link GNSSDate#GNSSDate(int, double, SatelliteSystem)}.{@link GNSSDate#getDate()}
*/
@Deprecated
public static AbsoluteDate createGPSDate(final int weekNumber, final double milliInWeek) {
return new GNSSDate(weekNumber, milliInWeek, SatelliteSystem.GPS).getDate();
}
=======
>>>>>>> |
<<<<<<<
import org.orekit.data.DataContext;
=======
import org.orekit.attitudes.InertialProvider;
>>>>>>>
import org.orekit.data.DataContext;
import org.orekit.attitudes.InertialProvider;
<<<<<<<
final SBASPropagator propagator = new SBASPropagator.Builder(soe, frames).build();
=======
final SBASPropagator propagator = new SBASPropagator.
Builder(soe).
attitudeProvider(InertialProvider.EME2000_ALIGNED).
mu(SBASOrbitalElements.SBAS_MU).
mass(SBASPropagator.DEFAULT_MASS).
eci(FramesFactory.getEME2000()).
ecef(FramesFactory.getITRF(IERSConventions.IERS_2010, true)).
build();
>>>>>>>
final SBASPropagator propagator = new SBASPropagator.
Builder(soe, frames).
attitudeProvider(InertialProvider.EME2000_ALIGNED).
mu(SBASOrbitalElements.SBAS_MU).
mass(SBASPropagator.DEFAULT_MASS).
eci(FramesFactory.getEME2000()).
ecef(FramesFactory.getITRF(IERSConventions.IERS_2010, true)).
build(); |
<<<<<<<
import org.orekit.errors.OrekitExceptionWrapper;
import org.orekit.errors.OrekitInternalError;
=======
>>>>>>>
import org.orekit.errors.OrekitInternalError;
<<<<<<<
final PropagationType stateType)
throws OrekitException {
switch (stateType) {
case MEAN:
initialIsOsculating = false;
break;
case OSCULATING:
initialIsOsculating = true;
break;
default:
throw new OrekitInternalError(null);
}
=======
final boolean isOsculating) {
initialIsOsculating = isOsculating;
>>>>>>>
final PropagationType stateType) {
switch (stateType) {
case MEAN:
initialIsOsculating = false;
break;
case OSCULATING:
initialIsOsculating = true;
break;
default:
throw new OrekitInternalError(null);
}
<<<<<<<
final PropagationType type)
throws OrekitException {
=======
final boolean meanOnly) {
>>>>>>>
final PropagationType type) {
<<<<<<<
public void handleStep(final ODEStateInterpolator interpolator, final boolean isLast)
throws OrekitExceptionWrapper {
try {
// Get the grid points to compute
final double[] interpolationPoints =
interpolationgrid.getGridPoints(interpolator.getPreviousState().getTime(),
interpolator.getCurrentState().getTime());
final SpacecraftState[] meanStates = new SpacecraftState[interpolationPoints.length];
for (int i = 0; i < interpolationPoints.length; ++i) {
// Build the mean state interpolated at grid point
final double time = interpolationPoints[i];
final ODEStateAndDerivative sd = interpolator.getInterpolatedState(time);
meanStates[i] = mapper.mapArrayToState(time,
sd.getPrimaryState(),
sd.getPrimaryDerivative(),
PropagationType.MEAN);
=======
public void handleStep(final ODEStateInterpolator interpolator, final boolean isLast) {
>>>>>>>
public void handleStep(final ODEStateInterpolator interpolator, final boolean isLast) {
<<<<<<<
// Computate short periodic coefficients for this step
for (DSSTForceModel forceModel : forceModels) {
forceModel.updateShortPeriodTerms(forceModel.getParameters(), meanStates);
}
=======
final SpacecraftState[] meanStates = new SpacecraftState[interpolationPoints.length];
for (int i = 0; i < interpolationPoints.length; ++i) {
// Build the mean state interpolated at grid point
final double time = interpolationPoints[i];
final ODEStateAndDerivative sd = interpolator.getInterpolatedState(time);
meanStates[i] = mapper.mapArrayToState(time,
sd.getPrimaryState(),
sd.getPrimaryDerivative(),
true);
>>>>>>>
final SpacecraftState[] meanStates = new SpacecraftState[interpolationPoints.length];
for (int i = 0; i < interpolationPoints.length; ++i) {
// Build the mean state interpolated at grid point
final double time = interpolationPoints[i];
final ODEStateAndDerivative sd = interpolator.getInterpolatedState(time);
meanStates[i] = mapper.mapArrayToState(time,
sd.getPrimaryState(),
sd.getPrimaryDerivative(),
PropagationType.MEAN); |
<<<<<<<
private <T extends RealFieldElement<T>> void doTestNonKeplerianDerivatives(Field<T> field) throws OrekitException {
final T zero = field.getZero();
=======
private <T extends RealFieldElement<T>> void doTestNonKeplerianDerivatives(Field<T> field) {
>>>>>>>
private <T extends RealFieldElement<T>> void doTestNonKeplerianDerivatives(Field<T> field) {
final T zero = field.getZero();
<<<<<<<
private <T extends RealFieldElement<T>> void doTestPositionAngleDerivatives(final Field<T> field) throws OrekitException {
final T zero = field.getZero();
=======
private <T extends RealFieldElement<T>> void doTestPositionAngleDerivatives(final Field<T> field) {
>>>>>>>
private <T extends RealFieldElement<T>> void doTestPositionAngleDerivatives(final Field<T> field) {
final T zero = field.getZero(); |
<<<<<<<
/** Reference epoch for QZSS weeks: 1980-01-06. */
public static final DateComponents QZSS_EPOCH;
=======
/** Reference epoch for BeiDou weeks: 2006-01-01. */
public static final DateComponents BEIDOU_EPOCH;
>>>>>>>
/** Reference epoch for QZSS weeks: 1980-01-06. */
public static final DateComponents QZSS_EPOCH;
/** Reference epoch for BeiDou weeks: 2006-01-01. */
public static final DateComponents BEIDOU_EPOCH;
<<<<<<<
QZSS_EPOCH = new DateComponents(1980, 1, 6);
=======
BEIDOU_EPOCH = new DateComponents(2006, 1, 1);
>>>>>>>
QZSS_EPOCH = new DateComponents(1980, 1, 6);
BEIDOU_EPOCH = new DateComponents(2006, 1, 1); |
<<<<<<<
DSST_VMSN_COEFFICIENT_ERROR_NS("Cannot compute the Vmsn coefficient with s > n ({0} > {1})"),
DSST_VMSN_COEFFICIENT_ERROR_MS("Cannot compute the Vmsn coefficient with m > s ({0} > {1})"),
DSST_SPR_SHADOW_INCONSISTENT("inconsistent shadow computation: entry = {0} whereas exit = {1}");
=======
DSST_VMSN_COEFFICIENT_ERROR_MS("Cannot compute the Vmsn coefficient with m > s ({0} > {1})");
>>>>>>>
DSST_VMSN_COEFFICIENT_ERROR_MS("Cannot compute the Vmsn coefficient with m > s ({0} > {1})"),
DSST_SPR_SHADOW_INCONSISTENT("inconsistent shadow computation: entry = {0} whereas exit = {1}"); |
<<<<<<<
final List<SpacecraftState> neighbors = cache.getNeighbors(date);
return neighbors.get(0).interpolate(date, neighbors);
} catch (TimeStampedCacheException tce) {
=======
final SpacecraftState[] neighbors = cache.getNeighbors(date);
return neighbors[0].interpolate(date, Arrays.asList(neighbors));
} catch (OrekitException tce) {
>>>>>>>
final List<SpacecraftState> neighbors = cache.getNeighbors(date);
return neighbors.get(0).interpolate(date, neighbors);
} catch (OrekitException tce) { |
<<<<<<<
int index = 0;
for (final ParameterDriver driver : getParametersDrivers()) {
if (driver.isSelected()) {
// update estimated derivatives with derivative of the modification wrt tropospheric parameters
double parameterDerivative = estimated.getParameterDerivatives(driver)[0];
final double[] dDelaydP = rangeErrorParameterDerivative(derivatives, converter.getFreeStateParameters());
parameterDerivative += dDelaydP[index];
estimated.setParameterDerivatives(driver, parameterDerivative);
index = index + 1;
}
}
for (final ParameterDriver driver : Arrays.asList(station.getEastOffsetDriver(),
=======
for (final ParameterDriver driver : Arrays.asList(station.getClockOffsetDriver(),
station.getEastOffsetDriver(),
>>>>>>>
int index = 0;
for (final ParameterDriver driver : getParametersDrivers()) {
if (driver.isSelected()) {
// update estimated derivatives with derivative of the modification wrt tropospheric parameters
double parameterDerivative = estimated.getParameterDerivatives(driver)[0];
final double[] dDelaydP = rangeErrorParameterDerivative(derivatives, converter.getFreeStateParameters());
parameterDerivative += dDelaydP[index];
estimated.setParameterDerivatives(driver, parameterDerivative);
index = index + 1;
}
}
for (final ParameterDriver driver : Arrays.asList(station.getClockOffsetDriver(),
station.getEastOffsetDriver(), |
<<<<<<<
public void testSmallNegativeBeta() throws OrekitException {
doTestAxes("beta-small-negative-GLONASS.txt", 7.6e-5, 7.6e-5, 8.0e-16);
=======
public void testSmallNegativeBeta() {
// the differences with the reference Kouba models are due to the following changes:
// - Orekit computes angular velocity taking eccentricity into account
// Kouba assumes a perfectly circular orbit
// - Orekit uses spherical geometry to solve some triangles (cos μ = cos α / cos β)
// Kouba uses projected planar geometry (μ² = α² - β²)
// when using the Kouba equations, the order of magnitudes of the differences is about 10⁻¹²
doTestAxes("beta-small-negative-GLONASS.txt", 1.6e-4, 1.6e-4, 8.0e-16);
>>>>>>>
public void testSmallNegativeBeta() {
doTestAxes("beta-small-negative-GLONASS.txt", 7.6e-5, 7.6e-5, 8.0e-16);
<<<<<<<
public void testSmallPositiveBeta() throws OrekitException {
doTestAxes("beta-small-positive-GLONASS.txt", 5.9e-5, 5.9e-5, 4.1e-16);
=======
public void testSmallPositiveBeta() {
// the differences with the reference Kouba models are due to the following changes:
// - Orekit computes angular velocity taking eccentricity into account
// Kouba assumes a perfectly circular orbit
// - Orekit uses spherical geometry to solve some triangles (cos μ = cos α / cos β)
// Kouba uses projected planar geometry (μ² = α² - β²)
// when using the Kouba equations, the order of magnitudes of the differences is about 10⁻¹²
doTestAxes("beta-small-positive-GLONASS.txt", 1.6e-4, 1.6e-4, 3.9e-16);
>>>>>>>
public void testSmallPositiveBeta() {
doTestAxes("beta-small-positive-GLONASS.txt", 5.9e-5, 5.9e-5, 4.1e-16); |
<<<<<<<
Account.Id newId = new Account.Id(sequences.nextAccountId());
=======
Account.Id newId = new Account.Id(db.nextAccountId());
log.debug("Assigning new Id {} to account", newId);
Account account = new Account(newId, TimeUtil.nowTs());
>>>>>>>
Account.Id newId = new Account.Id(sequences.nextAccountId());
log.debug("Assigning new Id {} to account", newId);
<<<<<<<
=======
log.debug("Created external Id: {}", extId);
account.setFullName(who.getDisplayName());
account.setPreferredEmail(extId.email());
>>>>>>>
log.debug("Created external Id: {}", extId);
<<<<<<<
=======
IdentifiedUser user = userFactory.create(newId);
log.debug("Identified user {} was created from {}", user, who.getUserName());
>>>>>>> |
<<<<<<<
new AdaptedEventDetector(osf, this, orbitType, angleType, attitudeProvider,
referenceDate, newtonianAttraction.getMu(),
initialState.getFrame());
=======
new AdaptedEventDetector(osf, mapper, referenceDate,
newtonianAttraction.getMu(), initialState.getFrame());
>>>>>>>
new AdaptedEventDetector(osf, orbitType, angleType, attitudeProvider,
referenceDate, newtonianAttraction.getMu(),
initialState.getFrame()); |
<<<<<<<
// Compute natural resonant terms
final double tolerance = 1. / FastMath.max(MIN_PERIOD_IN_SAT_REV, MIN_PERIOD_IN_SECONDS / period);
// Search the resonant orders in the tesseral harmonic field
resOrders.clear();
for (int m = 1; m <= provider.getMaxOrder(); m++) {
final double resonance = ratio * m;
final int jComputedRes = (int) FastMath.round(resonance);
if (jComputedRes > 0 && jComputedRes <= maxFrequencyShortPeriodics &&
FastMath.abs(resonance - jComputedRes) <= tolerance) {
// Store each resonant index and order
this.resOrders.add(m);
}
}
}
/** Get the list of resonant orders.
* @return resOrders
*/
public List<Integer> getResOrders() {
return resOrders;
=======
>>>>>>>
<<<<<<<
/**
* Get the maximum power of the eccentricity to use in summation over s.
* @return maxEccPow
*/
public int getMaxEccPow() {
return maxEccPow;
}
/**
* Get the Keplerian period.
* <p>
* The Keplerian period is computed directly from semi major axis and central
* acceleration constant.
* </p>
* @return Keplerian period in seconds, or positive infinity for hyperbolic
* orbits
=======
/** Get the Keplerian period.
* <p>The Keplerian period is computed directly from semi major axis
* and central acceleration constant.</p>
* @return Keplerian period in seconds, or positive infinity for hyperbolic orbits
>>>>>>>
/**
* Get the Keplerian period.
* <p>
* The Keplerian period is computed directly from semi major axis and central
* acceleration constant.
* </p>
* @return Keplerian period in seconds, or positive infinity for hyperbolic
* orbits |
<<<<<<<
final PropagationType type)
throws OrekitException {
// the parameter type is ignored for the Numerical Propagator
=======
final boolean meanOnly) {
// the parameter meanOnly is ignored for the Numerical Propagator
>>>>>>>
final PropagationType type) {
// the parameter type is ignored for the Numerical Propagator |
<<<<<<<
private <T extends RealFieldElement<T>> void doTestNonKeplerianDerivatives(Field<T> field) throws OrekitException {
final T zero = field.getZero();
=======
private <T extends RealFieldElement<T>> void doTestNonKeplerianDerivatives(Field<T> field) {
>>>>>>>
private <T extends RealFieldElement<T>> void doTestNonKeplerianDerivatives(Field<T> field) {
final T zero = field.getZero();
<<<<<<<
private <T extends RealFieldElement<T>> void doTestPositionAngleDerivatives(final Field<T> field) throws OrekitException {
final T zero = field.getZero();
=======
private <T extends RealFieldElement<T>> void doTestPositionAngleDerivatives(final Field<T> field) {
>>>>>>>
private <T extends RealFieldElement<T>> void doTestPositionAngleDerivatives(final Field<T> field) {
final T zero = field.getZero(); |
<<<<<<<
import org.apache.commons.math3.util.FastMath;
=======
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
>>>>>>>
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import org.apache.commons.math3.util.FastMath;
<<<<<<<
import org.junit.Before;
import org.junit.BeforeClass;
=======
import org.junit.Ignore;
>>>>>>>
<<<<<<<
=======
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.utils.Constants;
>>>>>>>
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.utils.Constants;
<<<<<<<
@BeforeClass
public static void setUpGlobal() {
Utils.setDataRoot("atmosphere");
}
@Before
public void setUp() throws Exception {
model = SaastamoinenModel.getStandardModel();
}
=======
@Test
@Ignore
public void testPerformance() throws OrekitException {
final double elevation = 10d;
Utils.setDataRoot("atmosphere");
SaastamoinenModel model = SaastamoinenModel.getStandardModel();
long RUNS = 100000;
long start = System.currentTimeMillis();
for (int i = 0; i < RUNS; i++) {
model.calculateSignalDelay(elevation, 350);
}
System.out.println(RUNS + " runs took " + (System.currentTimeMillis() - start) + "ms");
}
>>>>>>> |
<<<<<<<
eventFactory.addPatchSets(db, rw, c, d.patchSets(),
=======
eventFactory.addPatchSets(db.get(), rw, c, d.visiblePatchSets(),
>>>>>>>
eventFactory.addPatchSets(db, rw, c, d.visiblePatchSets(),
<<<<<<<
eventFactory.addPatchSets(db, rw, c, d.patchSets(),
=======
eventFactory.addPatchSets(db.get(), rw, c, d.visiblePatchSets(),
>>>>>>>
eventFactory.addPatchSets(db, rw, c, d.visiblePatchSets(), |
<<<<<<<
/** Get the state vector dimension.
* @return state vector dimension
* @deprecated as of 9.0, replaced with {@link #STATE_DIMENSION}
*/
@Deprecated
public int getStateDimension() {
return STATE_DIMENSION;
}
/** {@inheritDoc} */
protected double[][] getJacobianConversion(final SpacecraftState state) {
=======
/** Get the number of parameters.
* @return number of parameters
*/
public int getParameters() {
return parameters.getNbParams();
}
/** Get the conversion Jacobian between state parameters and Cartesian parameters.
* @param state spacecraft state
* @return conversion Jacobian
*/
private double[][] getdYdC(final SpacecraftState state) {
>>>>>>>
/** {@inheritDoc} */
protected double[][] getJacobianConversion(final SpacecraftState state) { |
<<<<<<<
CoefficientsFactory.getVmns(12, 26, 20,
CombinatoricsUtils.factorialDouble(26 + 20),
CombinatoricsUtils.factorialDouble(26 - 12)),
FastMath.abs(eps12 * vmnsp));
=======
CoefficientsFactory.getVmns(12, 26, 20),
Math.abs(eps12 * vmnsp));
>>>>>>>
CoefficientsFactory.getVmns(12, 26, 20),
FastMath.abs(eps12 * vmnsp));
<<<<<<<
CoefficientsFactory.getVmns(12, 27, -21,
CombinatoricsUtils.factorialDouble(27 + 21),
CombinatoricsUtils.factorialDouble(27 - 12)),
FastMath.abs(eps12 * vmnsm));
=======
CoefficientsFactory.getVmns(12, 27, -21),
Math.abs(eps12 * vmnsm));
>>>>>>>
CoefficientsFactory.getVmns(12, 27, -21),
Math.abs(eps12 * vmnsm)); |
<<<<<<<
public FieldKeplerianPropagator(final FieldOrbit<T> initialFieldOrbit, final T mu)
throws OrekitException {
=======
public FieldKeplerianPropagator(final FieldOrbit<T> initialFieldOrbit, final double mu) {
>>>>>>>
public FieldKeplerianPropagator(final FieldOrbit<T> initialFieldOrbit, final T mu) {
<<<<<<<
final T mu)
throws OrekitException {
=======
final double mu) {
>>>>>>>
final T mu) {
<<<<<<<
final T mu, final T mass)
throws OrekitException {
=======
final double mu, final T mass) {
>>>>>>>
final T mu, final T mass) { |
<<<<<<<
assertQueryEquals( CYPHER+"START n=node(3,1) WHERE n.name=~'Tob.*' RETURN n",
=======
assertEquals( CYPHER+"START n=node(3,1) WHERE n.name=~\"Tob.*\" RETURN n",
>>>>>>>
assertQueryEquals( CYPHER+"START n=node(3,1) WHERE n.name=~\"Tob.*\" RETURN n",
<<<<<<<
assertQueryEquals( CYPHER+"START n=node(3,1) WHERE n.name=~'Some/thing' RETURN n",
=======
assertEquals( CYPHER+"START n=node(3,1) WHERE n.name=~\"Some/thing\" RETURN n",
>>>>>>>
assertQueryEquals( CYPHER+"START n=node(3,1) WHERE n.name=~\"Some/thing\" RETURN n",
<<<<<<<
assertQueryEquals( CYPHER+"START n=node(3,1) WHERE n.name=~'(?i)ANDR.*' RETURN n",
=======
assertEquals( CYPHER+"START n=node(3,1) WHERE n.name=~\"(?i)ANDR.*\" RETURN n",
>>>>>>>
assertQueryEquals( CYPHER+"START n=node(3,1) WHERE n.name=~\"(?i)ANDR.*\" RETURN n",
<<<<<<<
assertQueryEquals( CYPHER+"START n=node(3) MATCH (n)-[r]->() WHERE type(r)=~'K.*' RETURN r",
=======
assertEquals( CYPHER+"START n=node(3) MATCH (n)-[r]->() WHERE type(r)=~\"K.*\" RETURN r",
>>>>>>>
assertQueryEquals( CYPHER+"START n=node(3) MATCH (n)-[r]->() WHERE type(r)=~\"K.*\" RETURN r",
<<<<<<<
assertQueryEquals( CYPHER+"START n=node(3,1) WHERE n.belt?=\"white\" RETURN n",
=======
assertEquals( CYPHER+"START n=node(3,1) WHERE n.belt? =\"white\" RETURN n",
>>>>>>>
assertQueryEquals( CYPHER+"START n=node(3,1) WHERE n.belt? =\"white\" RETURN n",
<<<<<<<
assertQueryEquals( CYPHER+"START n=node(3,1) WHERE n.belt! =\"white\" RETURN n",
=======
assertEquals( CYPHER+"START n=node(3,1) WHERE n.belt! =\"white\" RETURN n",
>>>>>>>
assertQueryEquals( CYPHER+"START n=node(3,1) WHERE n.belt! =\"white\" RETURN n",
<<<<<<<
assertQueryEquals( CYPHER+"START n=node(1,2) RETURN n.age?",
=======
assertEquals( CYPHER+"START n=node(1,2) RETURN n.age? ",
>>>>>>>
assertQueryEquals( CYPHER+"START n=node(1,2) RETURN n.age? ",
<<<<<<<
assertQueryEquals( CYPHER+"START n=node(2,3,4,1) RETURN count(n.property?)",
=======
assertEquals( CYPHER+"START n=node(2,3,4,1) RETURN count(n.property? )",
>>>>>>>
assertQueryEquals( CYPHER+"START n=node(2,3,4,1) RETURN count(n.property? )",
<<<<<<<
assertQueryEquals( CYPHER+"START n=node(3,1,2) RETURN n.length?,n ORDER BY n.length?",
=======
assertEquals( CYPHER+"START n=node(3,1,2) RETURN n.length? ,n ORDER BY n.length? ",
>>>>>>>
assertQueryEquals( CYPHER+"START n=node(3,1,2) RETURN n.length? ,n ORDER BY n.length? ",
<<<<<<<
assertQueryEquals( CYPHER+"START a=node(3) RETURN coalesce(a.hairColour?,a.eyes?)",
=======
assertEquals( CYPHER+"START a=node(3) RETURN coalesce(a.hairColour? ,a.eyes? )",
>>>>>>>
assertQueryEquals( CYPHER+"START a=node(3) RETURN coalesce(a.hairColour? ,a.eyes? )", |
<<<<<<<
assertQueryEquals( CYPHER+"START john=node({name}) RETURN john", start( nodeByParameter( "john", "name" )).returns( identifier("john" )).toString());
=======
assertEquals( CYPHER+"START john=node({name}) RETURN john", start( nodesByParameter( "john", "name" )).returns( identifier("john" )).toString());
>>>>>>>
assertQueryEquals( CYPHER+"START john=node({name}) RETURN john", start( nodesByParameter( "john", "name" )).returns( identifier("john" )).toString()); |
<<<<<<<
for (int i = 0; i < BATCHES_PER_SEGMENT; i++) {
futures.add(context.container.createBatch(segmentName, UUID.randomUUID(), TIMEOUT));
=======
for (int i = 0; i < TRANSACTIONS_PER_SEGMENT; i++) {
futures.add(context.container.createTransaction(segmentName, TIMEOUT));
>>>>>>>
for (int i = 0; i < TRANSACTIONS_PER_SEGMENT; i++) {
futures.add(context.container.createTransaction(segmentName, UUID.randomUUID(), TIMEOUT)); |
<<<<<<<
import com.google.common.collect.Sets;
=======
import com.emc.pravega.stream.Api;
>>>>>>>
import com.google.common.collect.Sets;
import com.emc.pravega.stream.Api; |
<<<<<<<
import java.util.Collection;
=======
import java.util.List;
>>>>>>>
import java.util.Collection;
import java.util.List;
<<<<<<<
import java.util.Set;
import java.util.stream.Stream;
=======
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
>>>>>>>
import java.util.Set;
import java.util.stream.Stream;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId; |
<<<<<<<
=======
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.gerrit.server.extensions.events.ChangeDeleted;
>>>>>>>
import com.google.gerrit.server.extensions.events.ChangeDeleted;
<<<<<<<
=======
private final boolean allowDrafts;
private final ChangeDeleted changeDeleted;
>>>>>>>
private final ChangeDeleted changeDeleted;
<<<<<<<
DynamicItem<AccountPatchReviewStore> accountPatchReviewStore) {
=======
DynamicItem<AccountPatchReviewStore> accountPatchReviewStore,
@GerritServerConfig Config cfg,
ChangeDeleted changeDeleted) {
>>>>>>>
DynamicItem<AccountPatchReviewStore> accountPatchReviewStore,
ChangeDeleted changeDeleted) {
<<<<<<<
=======
this.allowDrafts = allowDrafts(cfg);
this.changeDeleted = changeDeleted;
>>>>>>>
this.changeDeleted = changeDeleted; |
<<<<<<<
import static com.emc.pravega.common.concurrent.FutureHelpers.getAndHandleExceptions;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import org.apache.commons.lang.NotImplementedException;
=======
>>>>>>> |
<<<<<<<
await(this.streamSegmentStore.createBatch(parentName, UUID.randomUUID(), defaultTimeout), r -> log(startTime, "Created BatchStreamSegment %s with parent %s.", r, parentName));
=======
await(this.streamSegmentStore.createTransaction(parentName, defaultTimeout), r -> log(startTime, "Created Transaction %s with parent %s.", r, parentName));
>>>>>>>
await(this.streamSegmentStore.createTransaction(parentName, UUID.randomUUID(), defaultTimeout), r -> log(startTime, "Created Transaction %s with parent %s.", r, parentName)); |
<<<<<<<
import com.emc.pravega.service.server.UpdateableSegmentMetadata;
import com.emc.pravega.service.server.OperationLog;
import com.emc.pravega.service.server.logs.operations.BatchMapOperation;
=======
import com.emc.pravega.service.server.UpdateableSegmentMetadata;
import com.emc.pravega.service.server.OperationLog;
import com.emc.pravega.service.server.logs.operations.TransactionMapOperation;
>>>>>>>
import com.emc.pravega.service.server.UpdateableSegmentMetadata;
import com.emc.pravega.service.server.OperationLog;
import com.emc.pravega.service.server.logs.operations.TransactionMapOperation;
<<<<<<<
for (int j = 0; j < batchesPerSegment; j++) {
String batchName = context.mapper.createNewBatchStreamSegment(name, UUID.randomUUID(), TIMEOUT).join();
assertBatchSegmentCreated(batchName, name, context);
=======
for (int j = 0; j < transactionsPerSegment; j++) {
String transactionName = context.mapper.createNewTransactionStreamSegment(name, TIMEOUT).join();
assertTransactionCreated(transactionName, name, context);
>>>>>>>
for (int j = 0; j < transactionsPerSegment; j++) {
String transactionName = context.mapper.createNewTransactionStreamSegment(name, UUID.randomUUID(), TIMEOUT).join();
assertTransactionCreated(transactionName, name, context);
<<<<<<<
"createNewBatchStreamSegment did not fail when Segment already exists.",
context.mapper.createNewBatchStreamSegment(segmentName, UUID.randomUUID(), TIMEOUT)::join,
=======
"createNewTransactionStreamSegment did not fail when Segment already exists.",
context.mapper.createNewTransactionStreamSegment(segmentName, TIMEOUT)::join,
>>>>>>>
"createNewTransactionStreamSegment did not fail when Segment already exists.",
context.mapper.createNewTransactionStreamSegment(segmentName, UUID.randomUUID(), TIMEOUT)::join,
<<<<<<<
"createNewBatchStreamSegment did not fail when random exception was thrown.",
context.mapper.createNewBatchStreamSegment(segmentName, UUID.randomUUID(), TIMEOUT)::join,
=======
"createNewTransactionStreamSegment did not fail when random exception was thrown.",
context.mapper.createNewTransactionStreamSegment(segmentName, TIMEOUT)::join,
>>>>>>>
"createNewTransactionStreamSegment did not fail when random exception was thrown.",
context.mapper.createNewTransactionStreamSegment(segmentName, UUID.randomUUID(), TIMEOUT)::join,
<<<<<<<
"createNewBatchStreamSegment did not fail when OperationLog threw an exception.",
context.mapper.createNewBatchStreamSegment(segmentName, UUID.randomUUID(), TIMEOUT)::join,
=======
"createNewTransactionStreamSegment did not fail when OperationLog threw an exception.",
context.mapper.createNewTransactionStreamSegment(segmentName, TIMEOUT)::join,
>>>>>>>
"createNewTransactionStreamSegment did not fail when OperationLog threw an exception.",
context.mapper.createNewTransactionStreamSegment(segmentName, UUID.randomUUID(), TIMEOUT)::join,
<<<<<<<
// batch per segment, we should be fine.
String batchName = StreamSegmentNameUtils.getBatchNameFromId(segmentName, UUID.randomUUID());
storageSegments.add(batchName);
=======
// Transaction per segment, we should be fine.
String transactionName = StreamSegmentNameUtils.generateTransactionStreamSegmentName(segmentName);
storageSegments.add(transactionName);
>>>>>>>
// Transaction per segment, we should be fine.
String transactionName = StreamSegmentNameUtils.getTransactionNameFromId(segmentName, UUID.randomUUID());
storageSegments.add(transactionName);
<<<<<<<
final String batchName = StreamSegmentNameUtils.getBatchNameFromId(segmentName, UUID.randomUUID());
=======
final String transactionName = StreamSegmentNameUtils.generateTransactionStreamSegmentName(segmentName);
>>>>>>>
final String transactionName = StreamSegmentNameUtils.getTransactionNameFromId(segmentName, UUID.randomUUID());
<<<<<<<
// 2b. Batch does not exist.
final String inexistentBatchName = StreamSegmentNameUtils.getBatchNameFromId(segmentName, UUID.randomUUID());
=======
// 2b. Transaction does not exist.
final String inexistentTransactionName = StreamSegmentNameUtils.generateTransactionStreamSegmentName(segmentName);
>>>>>>>
// 2b. Transaction does not exist.
final String inexistentTransactionName = StreamSegmentNameUtils.getTransactionNameFromId(segmentName, UUID.randomUUID());
<<<<<<<
// 2c. Batch exists, but not its parent.
final String noValidParentBatchName = StreamSegmentNameUtils.getBatchNameFromId("foo", UUID.randomUUID());
storageSegments.add(noValidParentBatchName);
=======
// 2c. Transaction exists, but not its parent.
final String noValidParentTransactionName = StreamSegmentNameUtils.generateTransactionStreamSegmentName("foo");
storageSegments.add(noValidParentTransactionName);
>>>>>>>
// 2c. Transaction exists, but not its parent.
final String noValidParentTransactionName = StreamSegmentNameUtils.getTransactionNameFromId("foo", UUID.randomUUID());
storageSegments.add(noValidParentTransactionName); |
<<<<<<<
public void setPrivate(boolean value, @Nullable String message) {
throw new NotImplementedException();
}
@Override
public void setWorkInProgress(String message) {
throw new NotImplementedException();
}
@Override
public void setReadyForReview(String message) {
throw new NotImplementedException();
}
@Override
public ChangeApi revert() {
=======
public ChangeApi revert() throws RestApiException {
>>>>>>>
public void setPrivate(boolean value, @Nullable String message) throws RestApiException {
throw new NotImplementedException();
}
@Override
public void setWorkInProgress(String message) throws RestApiException {
throw new NotImplementedException();
}
@Override
public void setReadyForReview(String message) throws RestApiException {
throw new NotImplementedException();
}
@Override
public ChangeApi revert() throws RestApiException {
<<<<<<<
public void setMessage(String message) {
throw new NotImplementedException();
}
@Override
public EditInfo getEdit() {
=======
public EditInfo getEdit() throws RestApiException {
>>>>>>>
public void setMessage(String message) throws RestApiException {
throw new NotImplementedException();
}
@Override
public EditInfo getEdit() throws RestApiException { |
<<<<<<<
=======
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import com.emc.pravega.controller.task.Stream.StreamMetadataTasks;
import com.emc.pravega.controller.task.Stream.StreamTransactionMetadataTasks;
import com.emc.pravega.stream.Segment;
import com.emc.pravega.stream.StreamConfiguration;
import org.apache.thrift.TException;
>>>>>>>
<<<<<<<
public CompletableFuture<Boolean> isSegmentValid(String scope, String stream, int segmentNumber, String caller) throws TException {
return streamStore.getSegment(stream, segmentNumber).handle((ok, ex) -> {
if (ex != null) {
if(ex instanceof SegmentNotFoundException)
return false;
else throw new RuntimeException(ex);
} else
return SegmentHelper.getSegmentUri(scope, stream, segmentNumber, hostStore).getEndpoint().equals(caller);
});
}
private void notifyNewSegment(String scope, String stream, int segmentNumber) {
NodeUri uri = SegmentHelper.getSegmentUri(scope, stream, segmentNumber, hostStore);
// async call, dont wait for its completion or success. Host will contact controller if it does not know
// about some segment even if this call fails
CompletableFuture.runAsync(() -> SegmentHelper.createSegment(scope, stream, segmentNumber, ModelHelper.encode(uri), connectionFactory));
=======
private SegmentRange convert(String scope, String stream, com.emc.pravega.controller.store.stream.Segment segment) {
return new SegmentRange(
new SegmentId(scope, stream, segment.getNumber()), segment.getKeyStart(), segment.getKeyEnd());
>>>>>>>
public CompletableFuture<Boolean> isSegmentValid(String scope, String stream, int segmentNumber, String caller) throws TException {
return streamStore.getSegment(stream, segmentNumber).handle((ok, ex) -> {
if (ex != null) {
if (ex instanceof SegmentNotFoundException)
return false;
else throw new RuntimeException(ex);
} else
return SegmentHelper.getSegmentUri(scope, stream, segmentNumber, hostStore).getEndpoint().equals(caller);
});
}
private SegmentRange convert(String scope, String stream, com.emc.pravega.controller.store.stream.Segment segment) {
return new SegmentRange(
new SegmentId(scope, stream, segment.getNumber()), segment.getKeyStart(), segment.getKeyEnd()); |
<<<<<<<
this.serviceBuilder = new HDFSServicebuilder(this.serviceConfig);
//this.serviceBuilder = new DistributedLogServiceBuilder(this.serviceConfig);
//this.serviceBuilder = new InMemoryServiceBuilder(this.serviceConfig);
=======
this.serviceBuilder = createServiceBuilder(this.serviceConfig, true);
}
private ServiceBuilder createServiceBuilder(ServiceBuilderConfig config, boolean inMemory) {
if (inMemory) {
return ServiceBuilder.newInMemoryBuilder(config);
} else {
// Real (Distributed Log) Data Log.
return attachDistributedLog(ServiceBuilder.newInMemoryBuilder(config));
}
>>>>>>>
this.serviceBuilder = new HDFSServicebuilder(this.serviceConfig);
//this.serviceBuilder = new DistributedLogServiceBuilder(this.serviceConfig);
//this.serviceBuilder = new InMemoryServiceBuilder(this.serviceConfig);
this.serviceBuilder = createServiceBuilder(this.serviceConfig, true);
}
private ServiceBuilder createServiceBuilder(ServiceBuilderConfig config, boolean inMemory) {
if (inMemory) {
return ServiceBuilder.newInMemoryBuilder(config);
} else {
// Real (Distributed Log) Data Log.
return attachDistributedLog(ServiceBuilder.newInMemoryBuilder(config));
} |
<<<<<<<
import com.mapbox.mapboxandroiddemo.examples.LocationTrackingActivity;
=======
import com.mapbox.mapboxandroiddemo.examples.LocationPickerActivity;
>>>>>>>
import com.mapbox.mapboxandroiddemo.examples.LocationTrackingActivity;
import com.mapbox.mapboxandroiddemo.examples.LocationPickerActivity; |
<<<<<<<
final double value = channels.getChannelValue(c);
final RealLUTConverter<? extends RealType<?>> converter =
converters.get(c);
final double min = converter.getMin();
final double max = converter.getMax();
double relativeValue = (value - min) / (max - min);
if (relativeValue < 0) relativeValue = 0;
if (relativeValue > 1) relativeValue = 1;
final int grayValue = (int) (relativeValue * 255);
final ColorTable8 colorTable = converter.getLUT();
rSum += colorTable.get(0, grayValue);
gSum += colorTable.get(1, grayValue);
bSum += colorTable.get(2, grayValue);
=======
double value = channels.getChannelValue(c);
RealLUTConverter<? extends RealType<?>> converter = converters.get(c);
double min = converter.getMin();
double max = converter.getMax();
int grayValue = Binning.valueToBin(256, min, max, value);
ColorTable colorTable = converter.getLUT();
rSum += colorTable.getResampled(ColorTable.RED, 256, grayValue);
gSum += colorTable.getResampled(ColorTable.GREEN, 256, grayValue);
bSum += colorTable.getResampled(ColorTable.BLUE, 256, grayValue);
>>>>>>>
final double value = channels.getChannelValue(c);
final RealLUTConverter<? extends RealType<?>> converter =
converters.get(c);
final double min = converter.getMin();
final double max = converter.getMax();
final int grayValue = Binning.valueToBin(256, min, max, value);
final ColorTable colorTable = converter.getLUT();
rSum += colorTable.getResampled(ColorTable.RED, 256, grayValue);
gSum += colorTable.getResampled(ColorTable.GREEN, 256, grayValue);
bSum += colorTable.getResampled(ColorTable.BLUE, 256, grayValue);
<<<<<<<
final long currChannel = getLongPosition(Axes.CHANNEL);
final double value = channels.getChannelValue(currChannel);
final RealLUTConverter<? extends RealType<?>> converter =
converters.get((int) currChannel);
final double min = converter.getMin();
final double max = converter.getMax();
double relativeValue = (value - min) / (max - min);
if (relativeValue < 0) relativeValue = 0;
if (relativeValue > 1) relativeValue = 1;
final int grayValue = (int) Math.round(relativeValue * 255);
=======
long currChannel = getLongPosition(Axes.CHANNEL);
double value = channels.getChannelValue(currChannel);
RealLUTConverter<? extends RealType<?>> converter =
converters.get((int) currChannel);
double min = converter.getMin();
double max = converter.getMax();
int grayValue = Binning.valueToBin(256, min, max, value);
>>>>>>>
final long currChannel = getLongPosition(Axes.CHANNEL);
final double value = channels.getChannelValue(currChannel);
final RealLUTConverter<? extends RealType<?>> converter =
converters.get((int) currChannel);
final double min = converter.getMin();
final double max = converter.getMax();
final int grayValue = Binning.valueToBin(256, min, max, value);
<<<<<<<
final ColorTable8 colorTable = converter.getLUT();
r = colorTable.get(0, grayValue);
g = colorTable.get(1, grayValue);
b = colorTable.get(2, grayValue);
=======
ColorTable colorTable = converter.getLUT();
r = colorTable.getResampled(ColorTable.RED, 256, grayValue);
g = colorTable.getResampled(ColorTable.GREEN, 256, grayValue);
b = colorTable.getResampled(ColorTable.BLUE, 256, grayValue);
>>>>>>>
final ColorTable colorTable = converter.getLUT();
r = colorTable.getResampled(ColorTable.RED, 256, grayValue);
g = colorTable.getResampled(ColorTable.GREEN, 256, grayValue);
b = colorTable.getResampled(ColorTable.BLUE, 256, grayValue); |
<<<<<<<
import imagej.ValidityProblem;
import imagej.module.DefaultModuleInfo;
import imagej.module.DefaultModuleItem;
=======
import imagej.module.DefaultMutableModuleInfo;
import imagej.module.DefaultMutableModuleItem;
>>>>>>>
import imagej.ValidityProblem;
import imagej.module.DefaultMutableModuleInfo;
import imagej.module.DefaultMutableModuleItem; |
<<<<<<<
SourceEventMapper sourceEventMapper = new SourceEventMapper(mockYouTrackInstance);
List<ProcessEventChange> recentChanges;
=======
SourceEventMapper sourceEventMapper = new SourceEventMapper(mockYouTrackInstance, UrlStreamProvider.instance());
List<ProcessEventChange> recentChanges = null;
>>>>>>>
SourceEventMapper sourceEventMapper = new SourceEventMapper(mockYouTrackInstance, UrlStreamProvider.instance());
List<ProcessEventChange> recentChanges; |
<<<<<<<
Date minDate = new DateBuilder().day(14).month(Calendar.JULY).hour(16)
.minutes(0).build();
List<ProcessEvent> latestEvents = editSessionsExtractor.getLatestEvents(minDate);
assertThat(latestEvents.size(), is(10));
=======
editSessionsExtractor.setLastEventDate(new DateBuilder().day(14).month(Calendar.JULY).hour(16)
.minutes(0).build());
List<ProcessEvent> latestEvents = editSessionsExtractor.getLatestEvents();
assertThat(latestEvents, hasSize(10));
>>>>>>>
Date minDate = new DateBuilder().day(14).month(Calendar.JULY).hour(16)
.minutes(0).build();
List<ProcessEvent> latestEvents = editSessionsExtractor.getLatestEvents(minDate);
assertThat(latestEvents, hasSize(10)); |
<<<<<<<
return cmd + " " + path + userName;
=======
return cmd + " " + path;
} else {
return req.getMethod() + " " + uri;
>>>>>>>
return cmd + " " + path; |
<<<<<<<
ElasticTestUtils.configure(
elasticsearchConfig, nodeInfo.hostname, nodeInfo.port, indicesPrefix);
return Guice.createInjector(new InMemoryModule(elasticsearchConfig));
=======
ElasticTestUtils.configure(elasticsearchConfig, container, indicesPrefix);
return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration));
>>>>>>>
ElasticTestUtils.configure(elasticsearchConfig, container, indicesPrefix);
return Guice.createInjector(new InMemoryModule(elasticsearchConfig)); |
<<<<<<<
private String expectedAnswer;
private final int maxAttempts = 2;
private boolean hardDiff = false;
private boolean isBool;
@Override
public boolean onStart(GameLobby lobby) {
try {
String json = Utils.wget("https://opentdb.com/api.php?amount=1&encode=base64", null);
if(json == null) {
lobby.getChannel().sendMessage(EmoteReference.ERROR + "Error while starting trivia. Seemingly Open Trivia DB is having trouble.").queue();
return false;
}
EmbedBuilder eb = new EmbedBuilder();
JSONObject ob = new JSONObject(json);
JSONObject question = ob.getJSONArray("results").getJSONObject(0);
List<Object> incorrectAnswers = question.getJSONArray("incorrect_answers").toList();
List<String> l = new ArrayList<>();
for(Object o : incorrectAnswers) {
l.add("**" + fromB64(String.valueOf(o)) + "**\n");
}
String qu = fromB64(question.getString("question"));
String category = fromB64(question.getString("category"));
String diff = fromB64(question.getString("difficulty"));
if(diff.equalsIgnoreCase("hard")) hardDiff = true;
if(fromB64(question.getString("type")).equalsIgnoreCase("boolean")) isBool = true;
//Why was this returning an extra space at the end? otdb pls?
expectedAnswer = fromB64(question.getString("correct_answer")).trim();
l.add("**" + expectedAnswer + "**\n");
Collections.shuffle(l);
StringBuilder sb = new StringBuilder();
for(String s : l) sb.append(s);
eb.setAuthor("Trivia Game", null, lobby.getEvent().getAuthor().getAvatarUrl())
.setThumbnail("https://cdn.pixabay.com/photo/2012/04/14/16/26/question-34499_960_720.png")
.setDescription("**" + qu + "**")
.addField("Possibilities", sb.toString(), false)
.addField("Difficulty", "`" + Utils.capitalize(diff) + "`", true)
.addField("Category", "`" + category + "`", true)
.setFooter("This times out in 2 minutes.", lobby.getEvent().getAuthor().getAvatarUrl());
lobby.getChannel().sendMessage(eb.build()).queue();
return true;
} catch (Exception e) {
lobby.getChannel().sendMessage(EmoteReference.ERROR + "Error while starting trivia.").queue();
log.warn("Error while starting a trivia game", e);
return false;
}
}
@Override
public void call(GameLobby lobby, List<String> players) {
InteractiveOperations.createOverriding(lobby.getChannel(), 120, new InteractiveOperation() {
@Override
public int run(GuildMessageReceivedEvent event) {
return callDefault(event, lobby, players, expectedAnswer, getAttempts(), isBool ? 1 : maxAttempts, hardDiff ? 10 : 0);
}
@Override
public void onExpire() {
lobby.getChannel().sendMessage(EmoteReference.ERROR + "The time ran out! The answer was: " + expectedAnswer).queue();
GameLobby.LOBBYS.remove(lobby.getChannel());
}
});
}
private String fromB64(String b64) {
return new String(Base64.getDecoder().decode(b64), StandardCharsets.UTF_8);
}
=======
private final int maxAttempts = 2;
private String expectedAnswer;
private boolean hardDiff = false;
private boolean isBool;
@Override
public boolean onStart(GameLobby lobby) {
try {
String json = Utils.wget("https://opentdb.com/api.php?amount=1&encode=base64", null);
if(json == null) {
lobby.getChannel().sendMessage(EmoteReference.ERROR + "Error while starting trivia. Seemingly Open Trivia DB is having trouble.").queue();
return false;
}
EmbedBuilder eb = new EmbedBuilder();
JSONObject ob = new JSONObject(json);
JSONObject question = ob.getJSONArray("results").getJSONObject(0);
List<Object> incorrectAnswers = question.getJSONArray("incorrect_answers").toList();
List<String> l = new ArrayList<>();
for(Object o : incorrectAnswers) {
l.add("**" + fromB64(String.valueOf(o)) + "**\n");
}
String qu = fromB64(question.getString("question"));
String category = fromB64(question.getString("category"));
String diff = fromB64(question.getString("difficulty"));
if(diff.equalsIgnoreCase("hard")) hardDiff = true;
if(fromB64(question.getString("type")).equalsIgnoreCase("boolean")) isBool = true;
//Why was this returning an extra space at the end? otdb pls?
expectedAnswer = fromB64(question.getString("correct_answer")).trim();
l.add("**" + expectedAnswer + "**\n");
Collections.shuffle(l);
StringBuilder sb = new StringBuilder();
for(String s : l) sb.append(s);
eb.setAuthor("Trivia Game", null, lobby.getEvent().getAuthor().getAvatarUrl())
.setThumbnail("https://cdn.pixabay.com/photo/2012/04/14/16/26/question-34499_960_720.png")
.setDescription("**" + qu + "**")
.addField("Possibilities", sb.toString(), false)
.addField("Difficulty", "`" + Utils.capitalize(diff) + "`", true)
.addField("Category", "`" + category + "`", true)
.setFooter("This times out in 2 minutes.", lobby.getEvent().getAuthor().getAvatarUrl());
lobby.getChannel().sendMessage(eb.build()).queue();
return true;
} catch(Exception e) {
lobby.getChannel().sendMessage(EmoteReference.ERROR + "Error while starting trivia.").queue();
log.warn("Error while starting a trivia game", e);
return false;
}
}
@Override
public void call(GameLobby lobby, HashMap<Member, Player> players) {
InteractiveOperations.createOverriding(lobby.getChannel(), 120, new InteractiveOperation() {
@Override
public int run(GuildMessageReceivedEvent event) {
return callDefault(event, lobby, players, expectedAnswer, getAttempts(), isBool ? 1 : maxAttempts, hardDiff ? 10 : 0);
}
@Override
public void onExpire() {
lobby.getChannel().sendMessage(EmoteReference.ERROR + "The time ran out! The answer was: " + expectedAnswer).queue();
GameLobby.LOBBYS.remove(lobby.getChannel());
}
});
}
private String fromB64(String b64) {
return new String(Base64.getDecoder().decode(b64), StandardCharsets.UTF_8);
}
>>>>>>>
private final int maxAttempts = 2;
private String expectedAnswer;
private boolean hardDiff = false;
private boolean isBool;
@Override
public boolean onStart(GameLobby lobby) {
try {
String json = Utils.wget("https://opentdb.com/api.php?amount=1&encode=base64", null);
if(json == null) {
lobby.getChannel().sendMessage(EmoteReference.ERROR + "Error while starting trivia. Seemingly Open Trivia DB is having trouble.").queue();
return false;
}
EmbedBuilder eb = new EmbedBuilder();
JSONObject ob = new JSONObject(json);
JSONObject question = ob.getJSONArray("results").getJSONObject(0);
List<Object> incorrectAnswers = question.getJSONArray("incorrect_answers").toList();
List<String> l = new ArrayList<>();
for(Object o : incorrectAnswers) {
l.add("**" + fromB64(String.valueOf(o)) + "**\n");
}
String qu = fromB64(question.getString("question"));
String category = fromB64(question.getString("category"));
String diff = fromB64(question.getString("difficulty"));
if(diff.equalsIgnoreCase("hard")) hardDiff = true;
if(fromB64(question.getString("type")).equalsIgnoreCase("boolean")) isBool = true;
//Why was this returning an extra space at the end? otdb pls?
expectedAnswer = fromB64(question.getString("correct_answer")).trim();
l.add("**" + expectedAnswer + "**\n");
Collections.shuffle(l);
StringBuilder sb = new StringBuilder();
for(String s : l) sb.append(s);
eb.setAuthor("Trivia Game", null, lobby.getEvent().getAuthor().getAvatarUrl())
.setThumbnail("https://cdn.pixabay.com/photo/2012/04/14/16/26/question-34499_960_720.png")
.setDescription("**" + qu + "**")
.addField("Possibilities", sb.toString(), false)
.addField("Difficulty", "`" + Utils.capitalize(diff) + "`", true)
.addField("Category", "`" + category + "`", true)
.setFooter("This times out in 2 minutes.", lobby.getEvent().getAuthor().getAvatarUrl());
lobby.getChannel().sendMessage(eb.build()).queue();
return true;
} catch(Exception e) {
lobby.getChannel().sendMessage(EmoteReference.ERROR + "Error while starting trivia.").queue();
log.warn("Error while starting a trivia game", e);
return false;
}
}
@Override
public void call(GameLobby lobby, List<String> players) {
InteractiveOperations.createOverriding(lobby.getChannel(), 120, new InteractiveOperation() {
@Override
public int run(GuildMessageReceivedEvent event) {
return callDefault(event, lobby, players, expectedAnswer, getAttempts(), isBool ? 1 : maxAttempts, hardDiff ? 10 : 0);
}
@Override
public void onExpire() {
lobby.getChannel().sendMessage(EmoteReference.ERROR + "The time ran out! The answer was: " + expectedAnswer).queue();
GameLobby.LOBBYS.remove(lobby.getChannel());
}
});
}
private String fromB64(String b64) {
return new String(Base64.getDecoder().decode(b64), StandardCharsets.UTF_8);
} |
<<<<<<<
import net.kodehawa.mantarobot.db.entities.helpers.quests.Quest;
=======
import net.kodehawa.mantarobot.utils.Utils;
>>>>>>>
import net.kodehawa.mantarobot.utils.Utils;
import net.kodehawa.mantarobot.db.entities.helpers.quests.Quest; |
<<<<<<<
import java.util.Map;
import java.util.Optional;
import java.util.Random;
=======
import java.util.*;
>>>>>>>
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Random;
<<<<<<<
=======
private final String[] boomQuotes = {
"Seemingly Megumin exploded our castle...", "Uh-oh, seemingly my master forgot some zeros and ones on the floor :<",
"W-Wait, what just happened?", "I-I think we got some fire going on here... you might want to tell my master to take a look.",
"I've mastered explosion magic, you see?", "Maybe something just went wrong on here, but, u-uh, I can fix it!",
"U-Uhh.. What did you want?"
};
private final ICommandProcessor commandProcessor;
private final Random rand = new Random();
private final Random random = new Random();
private final MantaroShard shard;
private final int shardId;
public CommandListener(int shardId, MantaroShard shard, ICommandProcessor processor) {
this.shardId = shardId;
this.shard = shard;
commandProcessor = processor;
}
>>>>>>>
private final String[] boomQuotes = {
"Seemingly Megumin exploded our castle...", "Uh-oh, seemingly my master forgot some zeros and ones on the floor :<",
"W-Wait, what just happened?", "I-I think we got some fire going on here... you might want to tell my master to take a look.",
"I've mastered explosion magic, you see?", "Maybe something just went wrong on here, but, u-uh, I can fix it!",
"U-Uhh.. What did you want?"
};
private final ICommandProcessor commandProcessor;
private final Random rand = new Random();
private final Random random = new Random();
private final MantaroShard shard;
private final int shardId;
public CommandListener(int shardId, MantaroShard shard, ICommandProcessor processor) {
this.shardId = shardId;
this.shard = shard;
commandProcessor = processor;
}
<<<<<<<
if (event instanceof ShardMonitorEvent) {
if (MantaroBot.getInstance().getShardedMantaro().getShards()[shardId].getEventManager().getLastJDAEventTimeDiff() > 30000) return;
=======
if(event instanceof ShardMonitorEvent) {
if(MantaroBot.getInstance().getShardedMantaro().getShards()[shardId].getEventManager().getLastJDAEventTimeDiff() > 30000)
return;
>>>>>>>
if(event instanceof ShardMonitorEvent) {
if(MantaroBot.getInstance().getShardedMantaro().getShards()[shardId].getEventManager().getLastJDAEventTimeDiff() > 30000)
return;
<<<<<<<
if (player.getLevel() > 1 && event.getGuild().getMemberById(player.getUserId()) != null) {
GuildData guildData = MantaroData.db().getGuild(event.getGuild()).getData();
if (guildData.isEnabledLevelUpMessages()) {
=======
if(player.getLevel() > 1 && event.getGuild().getMemberById(player.getUserId()) != null) {
if(guildData.isEnabledLevelUpMessages()) {
>>>>>>>
if(player.getLevel() > 1 && event.getGuild().getMemberById(player.getUserId()) != null) {
if(guildData.isEnabledLevelUpMessages()) {
<<<<<<<
if (levelUpMessage != null && levelUpChannel != null) {
=======
//Player has leveled up!
if(levelUpMessage != null && levelUpChannel != null) {
>>>>>>>
//Player has leveled up!
if(levelUpMessage != null && levelUpChannel != null) {
<<<<<<<
String.format("%s%s\n(Error ID: `%s`)\n" +
"If you want, join our **support guild** (Link on `~>about`), or check out our GitHub page (/Mantaro/MantaroBot). " +
"Please tell them to quit exploding me and please don't forget the Error ID when reporting!",
EmoteReference.ERROR, boomQuotes[rand.nextInt(boomQuotes.length)], id
)
=======
String.format("%s%s\n(Error ID: `%s`)\n" +
"If you want, join our **support guild** (Link on `~>about`), or check out our GitHub page (/Mantaro/MantaroBot). " +
"Please tell them to quit exploding me and please don't forget the Error ID when reporting!",
EmoteReference.ERROR, boomQuotes[rand.nextInt(boomQuotes.length)], id)
>>>>>>>
String.format("%s%s\n(Error ID: `%s`)\n" +
"If you want, join our **support guild** (Link on `~>about`), or check out our GitHub page (/Mantaro/MantaroBot). " +
"Please tell them to quit exploding me and please don't forget the Error ID when reporting!",
EmoteReference.ERROR, boomQuotes[rand.nextInt(boomQuotes.length)], id)
<<<<<<<
SentryHelper.captureException(
String.format("Unexpected Exception on Command: %s | (Error ID: ``%s``)", event.getMessage().getRawContent(), id), e, this.getClass());
log.error("Error happened with id: {} (Command: {})", event.getMessage().getRawContent(), id, e);
=======
SentryHelper.captureException(String.format("Unexpected Exception on Command: %s | (Error ID: ``%s``)", event.getMessage().getContentRaw(), id), e, this.getClass());
log.error("Error happened with id: {} (Within command: {})", event.getMessage().getContentRaw(), id, e);
>>>>>>>
SentryHelper.captureException(String.format("Unexpected Exception on Command: %s | (Error ID: ``%s``)", event.getMessage().getContentRaw(), id), e, this.getClass());
log.error("Error happened with id: {} (Within command: {})", event.getMessage().getContentRaw(), id, e); |
<<<<<<<
import eu.mihosoft.freerouting.constants.Constants;
=======
import eu.mihosoft.freerouting.interactive.InteractiveActionThread;
>>>>>>>
import eu.mihosoft.freerouting.constants.Constants;
import eu.mihosoft.freerouting.interactive.InteractiveActionThread;
<<<<<<<
static final String VERSION_NUMBER_STRING =
"v" + Constants.FREEROUTING_VERSION
+ " (version by mihosoft.eu, build-date: "
+ Constants.FREEROUTING_BUILD_DATE +")";
=======
/**
* Change this string when creating a new version
* todo: maybe migrate to 2020.03 version convention?
*/
static final String VERSION_NUMBER_STRING = "v1.4.1";
>>>>>>>
static final String VERSION_NUMBER_STRING =
"v" + Constants.FREEROUTING_VERSION
+ " (version by mihosoft.eu, build-date: "
+ Constants.FREEROUTING_BUILD_DATE +")"; |
<<<<<<<
=======
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.server.cache.CacheBackend;
>>>>>>>
import com.google.gerrit.server.cache.CacheBackend; |
<<<<<<<
@TargetApi(24)
public int[] getPackageGids(String s, int i) throws NameNotFoundException {
return mHostPackageManager.getPackageGids(s);
}
public int getPackageUid(String s, int i) throws NameNotFoundException {
Object uid = ReflectUtil.invokeNoException(PackageManager.class, mHostPackageManager, "getPackageUid",
new Class[]{String.class, int.class}, s, i);
if (uid != null) {
return (int) uid;
} else {
throw new NameNotFoundException(s);
}
}
@TargetApi(23)
public boolean isPermissionRevokedByPolicy(String s, String s1) {
return false;
}
@TargetApi(24)
public boolean hasSystemFeature(String s, int i) {
return mHostPackageManager.hasSystemFeature(s);
}
public Drawable loadItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo) {
if (itemInfo == null) {
return null;
}
return itemInfo.loadIcon(this.mHostPackageManager);
}
=======
>>>>>>>
public Drawable loadItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo) {
if (itemInfo == null) {
return null;
}
return itemInfo.loadIcon(this.mHostPackageManager);
} |
<<<<<<<
import org.apache.commons.io.filefilter.FileFilterUtils;
import org.apache.commons.io.filefilter.IOFileFilter;
=======
import org.eclipse.egit.github.core.Repository;
import org.eclipse.jgit.api.errors.GitAPIException;
>>>>>>>
import org.apache.commons.io.filefilter.FileFilterUtils;
import org.apache.commons.io.filefilter.IOFileFilter;
import org.eclipse.egit.github.core.Repository;
import org.eclipse.jgit.api.errors.GitAPIException;
<<<<<<<
private void extractResources(AppDetails appDetails) {
try {
File resourcesDir = fileHelper.getKickstartrResourcesDir();
if (resourcesDir.exists() || resourcesDir.list() == null || resourcesDir.list().length == 0) {
ResourcesUtils.copyResourcesTo(resourcesDir, "org.eclipse.jdt.apt.core.prefs");
}
} catch (IOException e) {
LOGGER.error("an error occured during the resources extraction", e);
}
}
public File start() {
LOGGER.info("generation of " + appDetails + " : " + appDetails);
if (appDetails.isRestTemplate() || appDetails.isAcra()) {
List<String> permissions = appDetails.getPermissions();
permissions.add("android.permission.INTERNET");
}
try {
generateSourceCode();
LOGGER.debug("source code generated from templates.");
} catch (IOException e) {
LOGGER.error("generated code file not generated", e);
return null;
}
try {
copyResDir();
LOGGER.debug("res dir copied.");
} catch (IOException e) {
LOGGER.error("problem occurs during the resources copying", e);
return null;
}
if (appDetails.isMaven()) {
// create src/text/java - it avoids an error when import to Eclipse
File targetTestDir = fileHelper.getTargetTestDir();
File removeMe = new File(targetTestDir, "REMOVE.ME");
try {
removeMe.createNewFile();
} catch (IOException e) {
LOGGER.error("an error occured during the REMOVE.ME file creation", e);
}
}
try {
TemplatesFileHelper templatesFileHelper = new TemplatesFileHelper(appDetails, fileHelper);
templatesFileHelper.generate();
LOGGER.debug("files generated from templates.");
} catch (IOException e) {
LOGGER.error("problem during ftl files loading", e);
return null;
} catch (TemplateException e) {
LOGGER.error("problem during template processing", e);
return null;
}
try {
if (appDetails.isEclipse()) {
if (appDetails.isAndroidAnnotations()) {
File targetEclipseJdtAptCorePrefsFile = fileHelper.getTargetEclipseJdtAptCorePrefsFile();
File eclipseJdtAptCorePrefs = fileHelper.getEclipseJdtAptCorePrefs();
FileUtils.copyFile(eclipseJdtAptCorePrefs, targetEclipseJdtAptCorePrefsFile);
LOGGER.debug("org.eclipse.jdt.apt.core.prefs copied");
}
File targetEclipseJdtCorePrefsFile = fileHelper.getTargetEclipseJdtCorePrefsFile();
File eclipseJdtCorePrefs = fileHelper.getEclipseJdtCorePrefs();
FileUtils.copyFile(eclipseJdtCorePrefs, targetEclipseJdtCorePrefsFile);
LOGGER.debug("org.eclipse.jdt.core.prefs copied");
}
} catch (IOException e) {
LOGGER.error("a problem occured during the org.eclipse.jdt.apt.core.prefs copying", e);
return null;
}
LibraryHelper libraryManager = new LibraryHelper(appDetails, fileHelper);
libraryManager.go();
LOGGER.debug("libraries copied");
File zipFile = null;
try {
File targetDir = fileHelper.getTargetDir();
zipFile = new File(targetDir, appDetails.getName() + "-AndroidKickstartr.zip");
Zipper.zip(fileHelper.getFinalDir(), zipFile);
LOGGER.debug("application sources zipped");
} catch (IOException e) {
LOGGER.error("a problem occured during the compression", e);
return null;
}
LOGGER.debug("AndroidKickstartR generation done");
return zipFile;
}
private void generateSourceCode() throws IOException {
=======
public File zipify() {
createDirectory();
File zipFile = null;
try {
File targetDir = fileHelper.getTargetDir();
zipFile = new File(targetDir, appDetails.getName() + "-AndroidKickstartr.zip");
Zipper.zip(fileHelper.getFinalDir(), zipFile);
LOGGER.debug("application sources zipped");
} catch (IOException e) {
LOGGER.error("a problem occured during the compression", e);
return null;
}
LOGGER.debug("AndroidKickstartR generation done");
return zipFile;
}
public Repository githubify(String accessToken) throws IOException, GitAPIException {
LOGGER.debug("Github creation started");
createDirectory();
GitHubber gitHubber = new GitHubber(accessToken);
Repository repository = gitHubber.createCommit(fileHelper.getFinalDir(), fileHelper.getProjectDir().getName());
return repository;
}
private void extractResources(AppDetails appDetails) {
try {
File resourcesDir = fileHelper.getKickstartrResourcesDir();
if (resourcesDir.exists() || resourcesDir.list() == null || resourcesDir.list().length == 0) {
ResourcesUtils.copyResourcesTo(resourcesDir, "org.eclipse.jdt.apt.core.prefs");
}
} catch (IOException e) {
LOGGER.error("an error occured during the resources extraction", e);
}
}
private void createDirectory() {
LOGGER.info("generation of " + appDetails + " : " + appDetails);
if (appDetails.isRestTemplate() || appDetails.isAcra()) {
List<String> permissions = appDetails.getPermissions();
permissions.add("android.permission.INTERNET");
}
try {
generateSourceCode();
LOGGER.debug("source code generated from templates.");
} catch (IOException e) {
LOGGER.error("generated code file not generated", e);
}
try {
File androidResDir = fileHelper.getTargetAndroidResDir();
File sourceResDir = fileHelper.getResDir();
FileUtils.copyDirectory(sourceResDir, androidResDir);
LOGGER.debug("res dir copied.");
} catch (IOException e) {
LOGGER.error("problem occurs during the resources copying", e);
}
if (appDetails.isMaven()) {
// create src/text/java - it avoids an error when import to Eclipse
File targetTestDir = fileHelper.getTargetTestDir();
File removeMe = new File(targetTestDir, "REMOVE.ME");
try {
removeMe.createNewFile();
} catch (IOException e) {
LOGGER.error("an error occured during the REMOVE.ME file creation", e);
}
}
try {
TemplatesFileHelper templatesFileHelper = new TemplatesFileHelper(appDetails, fileHelper);
templatesFileHelper.generate();
LOGGER.debug("files generated from templates.");
} catch (IOException e) {
LOGGER.error("problem during ftl files loading", e);
} catch (TemplateException e) {
LOGGER.error("problem during template processing", e);
}
try {
if (appDetails.isEclipse()) {
if (appDetails.isAndroidAnnotations()) {
File targetEclipseJdtAptCorePrefsFile = fileHelper.getTargetEclipseJdtAptCorePrefsFile();
File eclipseJdtAptCorePrefs = fileHelper.getEclipseJdtAptCorePrefs();
FileUtils.copyFile(eclipseJdtAptCorePrefs, targetEclipseJdtAptCorePrefsFile);
LOGGER.debug("org.eclipse.jdt.apt.core.prefs copied");
}
File targetEclipseJdtCorePrefsFile = fileHelper.getTargetEclipseJdtCorePrefsFile();
File eclipseJdtCorePrefs = fileHelper.getEclipseJdtCorePrefs();
FileUtils.copyFile(eclipseJdtCorePrefs, targetEclipseJdtCorePrefsFile);
LOGGER.debug("org.eclipse.jdt.core.prefs copied");
}
} catch (IOException e) {
LOGGER.error("a problem occured during the org.eclipse.jdt.apt.core.prefs copying", e);
}
LibraryHelper libraryManager = new LibraryHelper(appDetails, fileHelper);
libraryManager.go();
LOGGER.debug("libraries copied");
}
private void generateSourceCode() throws IOException {
>>>>>>>
public File zipify() {
createDirectory();
File zipFile = null;
try {
File targetDir = fileHelper.getTargetDir();
zipFile = new File(targetDir, appDetails.getName() + "-AndroidKickstartr.zip");
Zipper.zip(fileHelper.getFinalDir(), zipFile);
LOGGER.debug("application sources zipped");
} catch (IOException e) {
LOGGER.error("a problem occured during the compression", e);
return null;
}
LOGGER.debug("AndroidKickstartR generation done");
return zipFile;
}
public Repository githubify(String accessToken) throws IOException, GitAPIException {
LOGGER.debug("Github creation started");
createDirectory();
GitHubber gitHubber = new GitHubber(accessToken);
Repository repository = gitHubber.createCommit(fileHelper.getFinalDir(), fileHelper.getProjectDir().getName());
return repository;
}
private void extractResources(AppDetails appDetails) {
try {
File resourcesDir = fileHelper.getKickstartrResourcesDir();
if (resourcesDir.exists() || resourcesDir.list() == null || resourcesDir.list().length == 0) {
ResourcesUtils.copyResourcesTo(resourcesDir, "org.eclipse.jdt.apt.core.prefs");
}
} catch (IOException e) {
LOGGER.error("an error occured during the resources extraction", e);
}
}
private void createDirectory() {
LOGGER.info("generation of " + appDetails + " : " + appDetails);
if (appDetails.isRestTemplate() || appDetails.isAcra()) {
List<String> permissions = appDetails.getPermissions();
permissions.add("android.permission.INTERNET");
}
try {
copyResDir();
LOGGER.debug("res dir copied.");
} catch (IOException e) {
LOGGER.error("problem occurs during the resources copying", e);
}
try {
generateSourceCode();
LOGGER.debug("source code generated from templates.");
} catch (IOException e) {
LOGGER.error("generated code file not generated", e);
}
try {
File androidResDir = fileHelper.getTargetAndroidResDir();
File sourceResDir = fileHelper.getResDir();
FileUtils.copyDirectory(sourceResDir, androidResDir);
LOGGER.debug("res dir copied.");
} catch (IOException e) {
LOGGER.error("problem occurs during the resources copying", e);
}
if (appDetails.isMaven()) {
// create src/text/java - it avoids an error when import to Eclipse
File targetTestDir = fileHelper.getTargetTestDir();
File removeMe = new File(targetTestDir, "REMOVE.ME");
try {
removeMe.createNewFile();
} catch (IOException e) {
LOGGER.error("an error occured during the REMOVE.ME file creation", e);
}
}
try {
TemplatesFileHelper templatesFileHelper = new TemplatesFileHelper(appDetails, fileHelper);
templatesFileHelper.generate();
LOGGER.debug("files generated from templates.");
} catch (IOException e) {
LOGGER.error("problem during ftl files loading", e);
} catch (TemplateException e) {
LOGGER.error("problem during template processing", e);
}
try {
if (appDetails.isEclipse()) {
if (appDetails.isAndroidAnnotations()) {
File targetEclipseJdtAptCorePrefsFile = fileHelper.getTargetEclipseJdtAptCorePrefsFile();
File eclipseJdtAptCorePrefs = fileHelper.getEclipseJdtAptCorePrefs();
FileUtils.copyFile(eclipseJdtAptCorePrefs, targetEclipseJdtAptCorePrefsFile);
LOGGER.debug("org.eclipse.jdt.apt.core.prefs copied");
}
File targetEclipseJdtCorePrefsFile = fileHelper.getTargetEclipseJdtCorePrefsFile();
File eclipseJdtCorePrefs = fileHelper.getEclipseJdtCorePrefs();
FileUtils.copyFile(eclipseJdtCorePrefs, targetEclipseJdtCorePrefsFile);
LOGGER.debug("org.eclipse.jdt.core.prefs copied");
}
} catch (IOException e) {
LOGGER.error("a problem occured during the org.eclipse.jdt.apt.core.prefs copying", e);
}
LibraryHelper libraryManager = new LibraryHelper(appDetails, fileHelper);
libraryManager.go();
LOGGER.debug("libraries copied");
}
private void generateSourceCode() throws IOException { |
<<<<<<<
import org.apache.http.entity.ContentType;
=======
import com.mashape.unirest.request.HttpRequest;
import org.apache.commons.io.IOUtils;
>>>>>>>
import org.apache.commons.io.IOUtils;
import org.apache.http.entity.ContentType;
<<<<<<<
@Test
public void testObjectMapper() throws UnirestException, IOException {
final String responseJson = "{\"locale\": \"english\"}";
Unirest.setObjectMapper(new ObjectMapper() {
public Object readValue(String ignored) {
return Locale.ENGLISH;
}
public String writeValue(Object ignored) {
return responseJson;
}
});
HttpResponse<Locale> getResponse = Unirest.get("http://httpbin.org/get").asObject(Locale.class);
assertEquals(200, getResponse.getStatus());
assertEquals(getResponse.getBody(), Locale.ENGLISH);
HttpResponse<JsonNode> postResponse = Unirest.post("http://httpbin.org/post")
.header("accept", "application/json")
.header("Content-Type", "application/json")
.body(Locale.ENGLISH)
.asJson();
assertEquals(200, postResponse.getStatus());
assertEquals(postResponse.getBody().getObject().getString("data"), responseJson);
}
=======
@Test
public void testPostProvidesSortedParams() throws IOException {
// Verify that fields are encoded into the body in sorted order.
HttpRequest httpRequest = Unirest.post("test")
.field("z", "Z")
.field("y", "Y")
.field("x", "X")
.getHttpRequest();
InputStream content = httpRequest.getBody().getEntity().getContent();
String body = IOUtils.toString(content, "UTF-8");
assertEquals("x=X&y=Y&z=Z", body);
}
>>>>>>>
@Test
public void testObjectMapper() throws UnirestException, IOException {
final String responseJson = "{\"locale\": \"english\"}";
Unirest.setObjectMapper(new ObjectMapper() {
public Object readValue(String ignored) {
return Locale.ENGLISH;
}
public String writeValue(Object ignored) {
return responseJson;
}
});
HttpResponse<Locale> getResponse = Unirest.get("http://httpbin.org/get").asObject(Locale.class);
assertEquals(200, getResponse.getStatus());
assertEquals(getResponse.getBody(), Locale.ENGLISH);
HttpResponse<JsonNode> postResponse = Unirest.post("http://httpbin.org/post")
.header("accept", "application/json")
.header("Content-Type", "application/json")
.body(Locale.ENGLISH)
.asJson();
assertEquals(200, postResponse.getStatus());
assertEquals(postResponse.getBody().getObject().getString("data"), responseJson);
}
@Test
public void testPostProvidesSortedParams() throws IOException {
// Verify that fields are encoded into the body in sorted order.
HttpRequest httpRequest = Unirest.post("test")
.field("z", "Z")
.field("y", "Y")
.field("x", "X")
.getHttpRequest();
InputStream content = httpRequest.getBody().getEntity().getContent();
String body = IOUtils.toString(content, "UTF-8");
assertEquals("x=X&y=Y&z=Z", body);
} |
<<<<<<<
import org.egov.infra.admin.master.service.RoleService;
=======
>>>>>>>
import org.egov.infra.admin.master.service.RoleService;
<<<<<<<
import org.egov.lib.rjbac.user.UserRole;
=======
import org.egov.lib.rjbac.role.Role;
import org.egov.lib.rjbac.role.ejb.api.RoleService;
>>>>>>> |
<<<<<<<
import static org.egov.model.bills.EgBillregister.SEQ_EG_BILLREGISTER;
=======
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.OrderBy;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import org.egov.commons.EgwStatus;
import org.egov.infra.admin.master.entity.User;
import org.egov.infra.workflow.entity.StateAware;
import org.egov.utils.CheckListHelper;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.validator.constraints.Length;
>>>>>>>
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.OrderBy;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import org.egov.commons.EgwStatus;
import org.egov.infra.admin.master.entity.User;
import org.egov.infra.workflow.entity.StateAware;
import org.egov.utils.CheckListHelper;
import org.hibernate.validator.constraints.Length;
<<<<<<<
@Inheritance(strategy = InheritanceType.JOINED)
@SequenceGenerator(name = SEQ_EG_BILLREGISTER, sequenceName = SEQ_EG_BILLREGISTER, allocationSize = 1)
=======
@Inheritance(strategy = InheritanceType.JOINED)
@SequenceGenerator(name = EgBillregister.SEQ_EG_BILLREGISTER, sequenceName = EgBillregister.SEQ_EG_BILLREGISTER, allocationSize = 1)
>>>>>>>
@Inheritance(strategy = InheritanceType.JOINED)
@SequenceGenerator(name = EgBillregister.SEQ_EG_BILLREGISTER, sequenceName = EgBillregister.SEQ_EG_BILLREGISTER, allocationSize = 1)
<<<<<<<
=======
@Transient
private List<EgBilldetails> billDetails = new ArrayList<EgBilldetails>(0);
@Transient
private List<EgBilldetails> debitDetails = new ArrayList<EgBilldetails>(0);
@Transient
private List<EgBilldetails> creditDetails = new ArrayList<EgBilldetails>(0);
@Transient
private List<EgBilldetails> netPayableDetails = new ArrayList<EgBilldetails>(0);
@Transient
private List<EgBillPayeedetails> billPayeedetails = new ArrayList<EgBillPayeedetails>(0);
@Transient
private List<CheckListHelper> checkLists = new ArrayList<CheckListHelper>(0);
/**
* @return the worksdetail
*/
public String getWorksdetailId() {
return worksdetailId;
}
/**
* @param worksdetail the worksdetail to set
*/
public void setWorksdetailId(final String worksdetail) {
worksdetailId = worksdetail;
}
>>>>>>>
@Transient
private List<EgBilldetails> billDetails = new ArrayList<EgBilldetails>(0);
@Transient
private List<EgBilldetails> debitDetails = new ArrayList<EgBilldetails>(0);
@Transient
private List<EgBilldetails> creditDetails = new ArrayList<EgBilldetails>(0);
@Transient
private List<EgBilldetails> netPayableDetails = new ArrayList<EgBilldetails>(0);
@Transient
private List<EgBillPayeedetails> billPayeedetails = new ArrayList<EgBillPayeedetails>(0);
@Transient
private List<CheckListHelper> checkLists = new ArrayList<CheckListHelper>(0);
/**
* @return the worksdetail
*/
public String getWorksdetailId() {
return worksdetailId;
}
/**
* @param worksdetail the worksdetail to set
*/
public void setWorksdetailId(final String worksdetail) {
worksdetailId = worksdetail;
}
<<<<<<<
public EgBillregister(final String billnumber, final Date billdate,
final BigDecimal billamount, final String billstatus, final String expendituretype,
final BigDecimal createdby, final Date createddate) {
=======
public EgBillregister(final String billnumber, final Date billdate, final BigDecimal billamount,
final String billstatus, final String expendituretype, final BigDecimal createdby, final Date createddate) {
>>>>>>>
public EgBillregister(final String billnumber, final Date billdate, final BigDecimal billamount,
final String billstatus, final String expendituretype, final BigDecimal createdby, final Date createddate) {
<<<<<<<
public EgBillregister(final String billnumber,
final Date billdate, final BigDecimal billamount, final BigDecimal fieldid,
final String billstatus, final String narration, final BigDecimal passedamount,
final String billtype, final String expendituretype,
final BigDecimal advanceadjusted, final BigDecimal createdby, final Date createddate,
final BigDecimal lastmodifiedby, final Date lastmodifieddate, final String zone,
final String division, final String workordernumber, final String billapprovalstatus,
final Boolean isactive, final Date billpasseddate, final Date workorderdate,
final EgBillregistermis egBillregistermis, final Set<EgBilldetails> egBilldetailes, final EgwStatus status) {
=======
public EgBillregister(final String billnumber, final Date billdate, final BigDecimal billamount,
final BigDecimal fieldid, final String billstatus, final String narration, final BigDecimal passedamount,
final String billtype, final String expendituretype, final BigDecimal advanceadjusted,
final BigDecimal createdby, final Date createddate, final BigDecimal lastmodifiedby,
final Date lastmodifieddate, final String zone, final String division, final String workordernumber,
final String billapprovalstatus, final Boolean isactive, final Date billpasseddate,
final Date workorderdate, final EgBillregistermis egBillregistermis,
final Set<EgBilldetails> egBilldetailes, final EgwStatus status) {
>>>>>>>
public EgBillregister(final String billnumber, final Date billdate, final BigDecimal billamount,
final BigDecimal fieldid, final String billstatus, final String narration, final BigDecimal passedamount,
final String billtype, final String expendituretype, final BigDecimal advanceadjusted,
final BigDecimal createdby, final Date createddate, final BigDecimal lastmodifiedby,
final Date lastmodifieddate, final String zone, final String division, final String workordernumber,
final String billapprovalstatus, final Boolean isactive, final Date billpasseddate,
final Date workorderdate, final EgBillregistermis egBillregistermis,
final Set<EgBilldetails> egBilldetailes, final EgwStatus status) { |
<<<<<<<
import org.apache.commons.lang3.StringUtils;
=======
import org.egov.commons.Accountdetailtype;
>>>>>>>
import org.apache.commons.lang3.StringUtils;
import org.egov.commons.Accountdetailtype; |
<<<<<<<
import com.google.gwt.user.client.DOM;
=======
import com.google.gwt.user.client.ui.Anchor;
>>>>>>>
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Anchor;
<<<<<<<
=======
import com.google.gwt.user.client.ui.UIObject;
import com.google.gwt.user.client.ui.VerticalPanel;
>>>>>>>
import com.google.gwt.user.client.ui.VerticalPanel;
<<<<<<<
@UiField TableCellElement webLinkCell;
=======
@UiField AnchorElement browserLink;
@UiField Element parents;
@UiField FlowPanel parentCommits;
@UiField VerticalPanel parentWebLinks;
>>>>>>>
@UiField TableCellElement webLinkCell;
@UiField Element parents;
@UiField FlowPanel parentCommits;
@UiField VerticalPanel parentWebLinks; |
<<<<<<<
addDropdownData("fundList", persistenceService.findAllBy(" from Fund where isactive=true and isnotleaf=false order by name"));
addDropdownData("departmentList", persistenceService.findAllBy("from Department order by deptName"));
addDropdownData("fundsourceList",
persistenceService.findAllBy(" from Fundsource where isactive=true and isnotleaf=false order by name"));
=======
addDropdownData("fundList", persistenceService.findAllBy(" from Fund where isactive=1 and isnotleaf=0 order by name"));
addDropdownData("departmentList", persistenceService.findAllBy("from Department order by name"));
addDropdownData("functionList", masterCache.get("egi-function"));
>>>>>>>
addDropdownData("fundList", persistenceService.findAllBy(" from Fund where isactive=true and isnotleaf=false order by name"));
addDropdownData("fundsourceList",
persistenceService.findAllBy(" from Fundsource where isactive=true and isnotleaf=false order by name"));
addDropdownData("departmentList", persistenceService.findAllBy("from Department order by name"));
addDropdownData("functionList", masterCache.get("egi-function")); |
<<<<<<<
import bibliothek.extension.gui.dock.preference.PreferenceEditor;
import bibliothek.extension.gui.dock.preference.PreferenceEditorCallback;
import bibliothek.extension.gui.dock.preference.PreferenceEditorFactory;
import bibliothek.extension.gui.dock.preference.PreferenceModel;
import bibliothek.extension.gui.dock.preference.PreferenceModelListener;
import bibliothek.extension.gui.dock.preference.PreferenceOperation;
import bibliothek.extension.gui.dock.preference.PreferenceOperationView;
import bibliothek.extension.gui.dock.preference.PreferenceOperationViewListener;
import bibliothek.extension.gui.dock.preference.editor.BooleanEditor;
import bibliothek.extension.gui.dock.preference.editor.ChoiceEditor;
import bibliothek.extension.gui.dock.preference.editor.KeyStrokeEditor;
import bibliothek.extension.gui.dock.preference.editor.LabelEditor;
import bibliothek.extension.gui.dock.preference.editor.ModifierMaskEditor;
import bibliothek.extension.gui.dock.preference.editor.StringEditor;
import bibliothek.gui.dock.action.ActionContentModifier;
=======
import bibliothek.extension.gui.dock.preference.PreferenceEditor;
import bibliothek.extension.gui.dock.preference.PreferenceEditorCallback;
import bibliothek.extension.gui.dock.preference.PreferenceEditorFactory;
import bibliothek.extension.gui.dock.preference.PreferenceModel;
import bibliothek.extension.gui.dock.preference.PreferenceModelListener;
import bibliothek.extension.gui.dock.preference.PreferenceOperation;
import bibliothek.extension.gui.dock.preference.PreferenceOperationView;
import bibliothek.extension.gui.dock.preference.PreferenceOperationViewListener;
import bibliothek.extension.gui.dock.preference.editor.BooleanEditor;
import bibliothek.extension.gui.dock.preference.editor.ChoiceEditor;
import bibliothek.extension.gui.dock.preference.editor.KeyStrokeEditor;
import bibliothek.extension.gui.dock.preference.editor.LabelEditor;
import bibliothek.extension.gui.dock.preference.editor.ModifierMaskEditor;
import bibliothek.extension.gui.dock.preference.editor.StringEditor;
import bibliothek.gui.Dockable;
import bibliothek.gui.dock.action.DockAction;
>>>>>>>
import bibliothek.extension.gui.dock.preference.PreferenceEditor;
import bibliothek.extension.gui.dock.preference.PreferenceEditorCallback;
import bibliothek.extension.gui.dock.preference.PreferenceEditorFactory;
import bibliothek.extension.gui.dock.preference.PreferenceModel;
import bibliothek.extension.gui.dock.preference.PreferenceModelListener;
import bibliothek.extension.gui.dock.preference.PreferenceOperation;
import bibliothek.extension.gui.dock.preference.PreferenceOperationView;
import bibliothek.extension.gui.dock.preference.PreferenceOperationViewListener;
import bibliothek.extension.gui.dock.preference.editor.BooleanEditor;
import bibliothek.extension.gui.dock.preference.editor.ChoiceEditor;
import bibliothek.extension.gui.dock.preference.editor.KeyStrokeEditor;
import bibliothek.extension.gui.dock.preference.editor.LabelEditor;
import bibliothek.extension.gui.dock.preference.editor.ModifierMaskEditor;
import bibliothek.extension.gui.dock.preference.editor.StringEditor;
import bibliothek.gui.Dockable;
import bibliothek.gui.dock.action.ActionContentModifier;
import bibliothek.gui.dock.action.DockAction; |
<<<<<<<
Inserter inserter = getInserter();
=======
StationDropItem item = createStationDropItem( mouseX, mouseY, titleX, titleY, dockable );
>>>>>>>
Inserter inserter = getInserter();
StationDropItem item = createStationDropItem( mouseX, mouseY, titleX, titleY, dockable );
<<<<<<<
StationDropOperation operation = null;
DefaultInserterSource inserterSource = new DefaultInserterSource( station, dockable, mouseX, mouseY, titleX, titleY );
if( inserter != null ){
operation = inserter.before( inserterSource );
}
if( operation == null ){
operation = station.prepareDrop( mouseX, mouseY, titleX, titleY, dockable );
if( inserter != null ){
inserterSource.setOperation( operation );
operation = inserter.after( inserterSource );
if( operation == null ){
operation = inserterSource.getOperation();
}
}
}
=======
StationDropOperation operation = station.prepareDrop( item );
>>>>>>>
StationDropOperation operation = null;
DefaultInserterSource inserterSource = new DefaultInserterSource( station, item );
if( inserter != null ){
operation = inserter.before( inserterSource );
}
if( operation == null ){
operation = station.prepareDrop( item );
if( inserter != null ){
inserterSource.setOperation( operation );
operation = inserter.after( inserterSource );
if( operation == null ){
operation = inserterSource.getOperation();
}
}
} |
<<<<<<<
import bibliothek.gui.dock.util.DockUtilities;
import bibliothek.gui.dock.util.IconManager;
import bibliothek.gui.dock.util.PropertyValue;
import bibliothek.gui.dock.util.Transparency;
=======
import bibliothek.gui.dock.util.color.ColorCodes;
>>>>>>>
import bibliothek.gui.dock.util.Transparency;
import bibliothek.gui.dock.util.color.ColorCodes; |
<<<<<<<
import bibliothek.util.FrameworkOnly;
=======
import bibliothek.gui.dock.util.property.DynamicPropertyFactory;
>>>>>>>
import bibliothek.gui.dock.util.property.DynamicPropertyFactory;
import bibliothek.util.FrameworkOnly;
<<<<<<<
/** This id is forwarded to {@link Extension}s which load additional {@link DisplayerFactory}s */
public static final String DISPLAYER_ID = "split";
=======
>>>>>>>
/** This id is forwarded to {@link Extension}s which load additional {@link DisplayerFactory}s */
public static final String DISPLAYER_ID = "split"; |
<<<<<<<
import java.awt.Insets;
import java.awt.LayoutManager;
=======
>>>>>>>
import java.awt.Insets;
import java.awt.LayoutManager;
<<<<<<<
import javax.swing.JSeparator;
import javax.swing.JToolBar;
import javax.swing.SwingConstants;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.EtchedBorder;
=======
>>>>>>>
import javax.swing.JSeparator;
import javax.swing.JToolBar;
import javax.swing.SwingConstants;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.EtchedBorder;
<<<<<<<
=======
import bibliothek.gui.dock.station.support.PlaceholderStrategy;
import bibliothek.gui.dock.station.toolbar.Position;
import bibliothek.gui.dock.station.toolbar.ToolbarDockStationFactory;
>>>>>>>
import bibliothek.gui.dock.station.support.PlaceholderStrategy;
import bibliothek.gui.dock.station.toolbar.ToolbarDockStationFactory;
<<<<<<<
private ArrayList<Dockable> dockables = new ArrayList<Dockable>();
/** Graphical position of the group on components (NORTH, SOUTH, WEST, EAST) */
private Position position = Position.NORTH;
=======
private DockablePlaceholderList<Dockable> dockables = new DockablePlaceholderList<Dockable>();
/**
* Graphical orientation of the group of components (vertical or horizontal)
*/
private Orientation orientation = null;
>>>>>>>
private DockablePlaceholderList<Dockable> dockables = new DockablePlaceholderList<Dockable>();
/** Graphical position of the group on components (NORTH, SOUTH, WEST, EAST) */
private Position position = Position.NORTH;
<<<<<<<
ToolbarDockStation.this.indexBeneathMouse = ToolbarDockStation.this
.getDockables().indexOf(
this.getDockableBeneathMouse());
ToolbarDockStation.this.sideBeneathMouse = this
.getSideDockableBeneathMouse();
=======
ToolbarDockStation.this.indexBeneathMouse = indexOf( getDockableBeneathMouse() );
ToolbarDockStation.this.sideBeneathMouse = this.getSideDockableBeneathMouse();
>>>>>>>
ToolbarDockStation.this.indexBeneathMouse = indexOf(getDockableBeneathMouse());
ToolbarDockStation.this.sideBeneathMouse = this
.getSideDockableBeneathMouse();
<<<<<<<
dockable.setDockParent(this);
if (dockable instanceof PositionedDockStation){
if (getPosition() != null){
// it would be possible that this station was not already
// positioned. This is the case when this station is
// instantiated but not drop in any station (e.g.
// ToolbarContainerDockStation) which could give it a
// position
((PositionedDockStation) dockable)
.setPosition(getPosition());
}
}
getDockables().add(index, dockable);
mainPanel.getContentPane().add(dockable.getComponent(), index);
=======
dockables.dockables().add(index, dockable);
insertAt( dockable, index );
>>>>>>>
insertAt(dockable, index);
dockables.dockables().add(index, dockable);
<<<<<<<
Rectangle rect = dockables.get(indexBeneathMouse)
.getComponent().getBounds();
=======
Rectangle rect = dockables.dockables().get(indexBeneathMouse).getComponent()
.getBounds();
>>>>>>>
Rectangle rect = dockables.dockables().get(indexBeneathMouse)
.getComponent().getBounds();
<<<<<<<
protected Dimension computeBaseOptimalSize(){
Dimension optimalSize = new Dimension();
Dimension currentSize;
if (getOrientation() != null){
if (getDockables().size() != 0){
switch (getOrientation()) {
case VERTICAL:
optimalSize.width = Integer.MIN_VALUE;
for (Dockable dockable : getDockables()){
currentSize = dockable.getComponent()
.getPreferredSize();
optimalSize.height += currentSize.height;
if (currentSize.width > optimalSize.width){
optimalSize.width = currentSize.width;
}
}
System.out.println("Computation... " + optimalSize.height
+ " / " + optimalSize.width);
return optimalSize;
case HORIZONTAL:
optimalSize.height = Integer.MIN_VALUE;
for (Dockable dockable : getDockables()){
currentSize = dockable.getComponent()
.getPreferredSize();
optimalSize.width += currentSize.width;
if (currentSize.height > optimalSize.height){
optimalSize.height = currentSize.height;
}
}
return optimalSize;
}
}
}
return this.mainPanel.getContentPane().getPreferredSize();
}
=======
>>>>>>> |
<<<<<<<
public static String PREF_KEY_MENU_ORDER;
=======
public static String PREF_KEY_AUTO_START_NEW_GAME;
>>>>>>>
public static String PREF_KEY_MENU_ORDER;
public static String PREF_KEY_AUTO_START_NEW_GAME; |
<<<<<<<
import cucumber.runner.TimeService;
import cucumber.runtime.Backend;
=======
import cucumber.runtime.*;
>>>>>>>
import cucumber.runner.TimeService;
import cucumber.runtime.Backend;
<<<<<<<
import cucumber.runtime.RuntimeGlue;
import cucumber.runtime.RuntimeOptions;
=======
>>>>>>>
import cucumber.runtime.RuntimeGlue;
import cucumber.runtime.RuntimeOptions;
import cucumber.runtime.UndefinedStepsTracker;
<<<<<<<
import static org.mockito.Mockito.times;
=======
import static org.mockito.Mockito.when;
>>>>>>>
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.when;
<<<<<<<
final TimeService timeServiceStub = new TimeService() {
@Override
public long time() {
return 0l;
}
};
final Runtime runtime = new Runtime(resourceLoader, classLoader, asList(mock(Backend.class)), runtimeOptions, timeServiceStub, glue);
return new FeatureRunner(cucumberFeature, runtime, new JUnitReporter(runtime.getEventBus(), false, junitOption));
=======
when(glue.getTracker()).thenReturn(new UndefinedStepsTracker());
final Runtime runtime = new Runtime(resourceLoader, classLoader, asList(mock(Backend.class)), runtimeOptions, new StopWatch.Stub(0l), glue);
FormatterSpy formatterSpy = new FormatterSpy();
FeatureRunner runner = new FeatureRunner(cucumberFeature, runtime, new JUnitReporter(formatterSpy, formatterSpy, false, new JUnitOptions(Collections.<String>emptyList())));
runner.run(mock(RunNotifier.class));
return formatterSpy.toString();
>>>>>>>
when(glue.getTracker()).thenReturn(new UndefinedStepsTracker());
final TimeService timeServiceStub = new TimeService() {
@Override
public long time() {
return 0l;
}
};
final Runtime runtime = new Runtime(resourceLoader, classLoader, asList(mock(Backend.class)), runtimeOptions, timeServiceStub, glue);
return new FeatureRunner(cucumberFeature, runtime, new JUnitReporter(runtime.getEventBus(), false, junitOption)); |
<<<<<<<
if (gluedPaths.add(gluePath)) {
for (Resource resource : resourceLoader.resources(gluePath, ".rb")) {
runScriptlet(resource);
}
=======
for (Resource resource : resourceLoader.resources(gluePath, ".rb")) {
if (loadedResources.add(resource.getPath())) {
runScriptlet(resource);
}
>>>>>>>
if (gluedPaths.add(gluePath)) {
for (Resource resource : resourceLoader.resources(gluePath, ".rb")) {
if (loadedResources.add(resource.getPath())) {
runScriptlet(resource);
}
} |
<<<<<<<
import cucumber.api.formatter.ColorAware;
import cucumber.api.formatter.Formatter;
import cucumber.api.formatter.StrictAware;
import cucumber.runner.EventBus;
=======
import cucumber.deps.com.thoughtworks.xstream.annotations.XStreamConverter;
import cucumber.runtime.formatter.ColorAware;
>>>>>>>
import cucumber.api.formatter.ColorAware;
import cucumber.api.formatter.Formatter;
import cucumber.api.formatter.StrictAware;
import cucumber.runner.EventBus;
import cucumber.deps.com.thoughtworks.xstream.annotations.XStreamConverter;
<<<<<<<
import static cucumber.util.FixJava.join;
import static cucumber.util.FixJava.map;
import static java.util.Arrays.asList;
=======
import static java.util.Collections.unmodifiableList;
>>>>>>>
import static cucumber.util.FixJava.join;
import static cucumber.util.FixJava.map;
import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList;
<<<<<<<
private void addLineFilters(Map<String, List<Long>> parsedLineFilters, String key, List<Long> lines) {
if (parsedLineFilters.containsKey(key)) {
parsedLineFilters.get(key).addAll(lines);
} else {
parsedLineFilters.put(key, lines);
}
}
=======
RuntimeOptions withConverters(List<XStreamConverter> converters) {
this.converters.addAll(converters);
return this;
}
>>>>>>>
RuntimeOptions withConverters(List<XStreamConverter> converters) {
this.converters.addAll(converters);
return this;
}
private void addLineFilters(Map<String, List<Long>> parsedLineFilters, String key, List<Long> lines) {
if (parsedLineFilters.containsKey(key)) {
parsedLineFilters.get(key).addAll(lines);
} else {
parsedLineFilters.put(key, lines);
}
} |
<<<<<<<
import static io.cucumber.junit.SkippedThrowable.NotificationLevel.SCENARIO;
import static io.cucumber.junit.SkippedThrowable.NotificationLevel.STEP;
class JUnitReporter {
=======
final class JUnitReporter {
>>>>>>>
import static io.cucumber.junit.SkippedThrowable.NotificationLevel.SCENARIO;
import static io.cucumber.junit.SkippedThrowable.NotificationLevel.STEP;
final class JUnitReporter { |
<<<<<<<
import io.cucumber.core.reflection.Reflections;
=======
import org.apiguardian.api.API;
>>>>>>>
import io.cucumber.core.reflection.Reflections;
import org.apiguardian.api.API; |
<<<<<<<
import cucumber.Table;
import cucumber.classpath.Classpath;
import cucumber.classpath.Consumer;
import cucumber.io.Resource;
import cucumber.runtime.Backend;
import cucumber.runtime.CucumberException;
import cucumber.runtime.StepDefinition;
=======
>>>>>>>
import cucumber.Table;
import cucumber.classpath.Classpath;
import cucumber.classpath.Consumer;
import cucumber.io.Resource;
import cucumber.runtime.Backend;
import cucumber.runtime.CucumberException;
import cucumber.runtime.StepDefinition; |
<<<<<<<
public void runStep(String uri, Locale locale, String stepString) throws Throwable {
Step s = new Step(Collections.<Comment>emptyList(), "Given ", stepString, 0, null, null);
world.runUnreportedStep(uri, s, locale);
}
=======
public void pending(String reason) throws PendingException {
throw new PendingException(reason);
}
>>>>>>>
public void pending(String reason) throws PendingException {
throw new PendingException(reason);
}
public void runStep(String uri, Locale locale, String stepString) throws Throwable {
Step s = new Step(Collections.<Comment>emptyList(), "Given ", stepString, 0, null, null);
world.runUnreportedStep(uri, s, locale);
} |
<<<<<<<
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
=======
>>>>>>>
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
<<<<<<<
private void addConstructorDependencies(Class<?> clazz) {
for (Constructor constructor : clazz.getConstructors())
{
for(Class paramClazz : constructor.getParameterTypes())
{
// TODO: Check if class was already registered to prevent endless recursion
objectFactory.addClass(paramClazz);
addConstructorDependencies(paramClazz);
}
}
}
public Object invoke(Method method, Object[] javaArgs) {
try {
if (method.isAnnotationPresent(Pending.class)) {
throw new PendingException(method.getAnnotation(Pending.class).value());
} else {
return method.invoke(this.objectFactory.getInstance(method.getDeclaringClass()), javaArgs);
}
} catch (IllegalArgumentException e) {
throw new CucumberException(errorMessage(method, javaArgs), e);
} catch (InvocationTargetException e) {
throw new CucumberException(errorMessage(method, javaArgs), e.getTargetException());
} catch (IllegalAccessException e) {
throw new CucumberException(errorMessage(method, javaArgs), e);
}
}
private String errorMessage(Method method, Object[] javaArgs) {
StringBuilder m = new StringBuilder("Couldn't invoke ").append(method.toGenericString()).append(" with ").append(Utils.join(javaArgs, ",")).append(" (");
boolean comma = false;
for (Object javaArg : javaArgs) {
if (comma) m.append(",");
m.append(javaArg.getClass());
comma = true;
}
m.append(")");
return m.toString();
}
=======
>>>>>>> |
<<<<<<<
formatter.endOfScenarioLifeCycle((Scenario) getGherkinModel());
runtime.disposeBackendWorlds();
=======
try {
formatter.endOfScenarioLifeCycle((Scenario) getGherkinModel());
} catch (Throwable ignore) {
// IntelliJ has its own formatter which doesn't yet implement this.
}
runtime.disposeBackendWorlds(createScenarioDesignation());
}
private String createScenarioDesignation() {
return cucumberFeature.getPath() + ":" + Integer.toString(scenario.getLine()) + " # " +
scenario.getKeyword() + ": " + scenario.getName();
>>>>>>>
formatter.endOfScenarioLifeCycle((Scenario) getGherkinModel());
runtime.disposeBackendWorlds(createScenarioDesignation());
}
private String createScenarioDesignation() {
return cucumberFeature.getPath() + ":" + Integer.toString(scenario.getLine()) + " # " +
scenario.getKeyword() + ": " + scenario.getName(); |
<<<<<<<
public boolean isMonochrome() {
return monochrome;
}
=======
private void setFormatterOptions() {
for (Formatter formatter : formatters) {
setMonochromeOnColorAwareFormatters(formatter);
setStrictOnStrictAwareFormatters(formatter);
}
}
private void setMonochromeOnColorAwareFormatters(Formatter formatter) {
if (formatter instanceof ColorAware) {
ColorAware colorAware = (ColorAware) formatter;
colorAware.setMonochrome(monochrome);
}
}
private void setStrictOnStrictAwareFormatters(Formatter formatter) {
if (formatter instanceof StrictAware) {
StrictAware strictAware = (StrictAware) formatter;
strictAware.setStrict(strict);
}
}
public List<String> getGlue() {
return glue;
}
public boolean isStrict() {
return strict;
}
public boolean isDryRun() {
return dryRun;
}
public List<String> getFeaturePaths() {
return featurePaths;
}
public URL getDotCucumber() {
return dotCucumber;
}
public List<Formatter> getFormatters() {
return formatters;
}
public List<Object> getFilters() {
return filters;
}
>>>>>>>
private void setFormatterOptions() {
for (Formatter formatter : formatters) {
setMonochromeOnColorAwareFormatters(formatter);
setStrictOnStrictAwareFormatters(formatter);
}
}
private void setMonochromeOnColorAwareFormatters(Formatter formatter) {
if (formatter instanceof ColorAware) {
ColorAware colorAware = (ColorAware) formatter;
colorAware.setMonochrome(monochrome);
}
}
private void setStrictOnStrictAwareFormatters(Formatter formatter) {
if (formatter instanceof StrictAware) {
StrictAware strictAware = (StrictAware) formatter;
strictAware.setStrict(strict);
}
}
public List<String> getGlue() {
return glue;
}
public boolean isStrict() {
return strict;
}
public boolean isDryRun() {
return dryRun;
}
public List<String> getFeaturePaths() {
return featurePaths;
}
public URL getDotCucumber() {
return dotCucumber;
}
public List<Formatter> getFormatters() {
return formatters;
}
public List<Object> getFilters() {
return filters;
}
public boolean isMonochrome() {
return monochrome;
} |
<<<<<<<
Glue glue = optionalGlue != null ? optionalGlue : new RuntimeGlue(undefinedStepsTracker, new LocalizedXStreams(classLoader));
=======
this.stopWatch = stopWatch;
this.glue = optionalGlue != null ? optionalGlue : new RuntimeGlue(undefinedStepsTracker, new LocalizedXStreams(classLoader, runtimeOptions.getConverters()));
>>>>>>>
Glue glue = optionalGlue != null ? optionalGlue : new RuntimeGlue(undefinedStepsTracker, new LocalizedXStreams(classLoader, runtimeOptions.getConverters())); |
<<<<<<<
private FrameOnStackMarker getMarker(final MaterializedFrame ctx) {
try {
return (FrameOnStackMarker) ctx.getObject(MethodGenerationContext.
getStandardNonLocalReturnMarkerSlot());
} catch (FrameSlotTypeException e) {
throw new RuntimeException("This should never happen! really!");
}
}
private SBlock getBlockFromVirtual(final VirtualFrame frame) {
try {
return (SBlock) frame.getObject(MethodGenerationContext.getStandardSelfSlot());
} catch (FrameSlotTypeException e) {
throw new RuntimeException("This should never happen! really!");
}
}
private Object getSelf(final MaterializedFrame ctx) {
try {
return ctx.getObject(MethodGenerationContext.getStandardSelfSlot());
} catch (FrameSlotTypeException e) {
throw new RuntimeException("This should never happen! really!");
}
}
=======
>>>>>>>
<<<<<<<
public Object executeGeneric(final VirtualFrame frame) {
MaterializedFrame ctx = determineContext(frame.materialize());
FrameOnStackMarker marker = getMarker(ctx);
=======
public SAbstractObject executeGeneric(final VirtualFrame frame) {
Arguments outer = determineOuterArguments(frame);
FrameOnStackMarker marker = outer.getFrameOnStackMarker();
>>>>>>>
public Object executeGeneric(final VirtualFrame frame) {
Arguments outer = determineOuterArguments(frame);
FrameOnStackMarker marker = outer.getFrameOnStackMarker();
<<<<<<<
SBlock block = getBlockFromVirtual(frame);
Object self = getSelf(ctx);
return SAbstractObject.sendEscapedBlock(self, block, universe, frame.pack());
=======
SBlock block = (SBlock) Arguments.get(frame).getSelf();
SAbstractObject self = outer.getSelf();
// TODO: mark this as an exceptional path
return self.sendEscapedBlock(block, universe, frame.pack());
>>>>>>>
SBlock block = (SBlock) Arguments.get(frame).getSelf();
Object self = outer.getSelf();
// TODO: mark this as an exceptional path
return SAbstractObject.sendEscapedBlock(self, block, universe, frame.pack()); |
<<<<<<<
} else if (obj instanceof SMethod) {
return Classes.methodClass;
} else if (obj instanceof SPrimitive) {
return Classes.primitiveClass;
} else if (obj instanceof SBlock1) {
return Blocks.blockClass1;
} else if (obj instanceof SBlock2) {
return Blocks.blockClass2;
} else if (obj instanceof SBlock3) {
return Blocks.blockClass3;
} else if (obj instanceof Object[]) {
return Classes.arrayClass;
} else if (obj instanceof ReentrantLock) {
return ThreadClasses.mutexClass;
} else if (obj instanceof Condition) {
return ThreadClasses.conditionClass;
} else if (obj instanceof Thread) {
return ThreadClasses.threadClass;
=======
>>>>>>>
} else if (obj instanceof ReentrantLock) {
return ThreadClasses.mutexClass;
} else if (obj instanceof Condition) {
return ThreadClasses.conditionClass;
} else if (obj instanceof Thread) {
return ThreadClasses.threadClass; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.