conflict_resolution
stringlengths
27
16k
<<<<<<< public String apply(Role role) { return role.getName(); ======= public JValue ap(Role role) { return roleToJson(role); >>>>>>> public JValue apply(Role role) { return roleToJson(role); <<<<<<< public JString apply(String string) { return v(string); ======= public String ap(Role role) { return role.getName(); >>>>>>> public String apply(Role role) { return role.getName();
<<<<<<< if (searchProvider.getClient() == null) { return; } ======= if (searchProvider instanceof DevNullSearchProvider) { return; } >>>>>>> if (searchProvider instanceof DevNullSearchProvider) { return; } if (searchProvider.getClient() == null) { return; }
<<<<<<< import com.gentics.mesh.core.data.diff.FieldChangeTypes; import com.gentics.mesh.core.data.diff.FieldContainerChange; ======= import com.gentics.mesh.core.data.generic.MeshVertexImpl; >>>>>>> import com.gentics.mesh.core.data.diff.FieldChangeTypes; import com.gentics.mesh.core.data.diff.FieldContainerChange; import com.gentics.mesh.core.data.generic.MeshVertexImpl;
<<<<<<< ======= import com.gentics.mesh.util.URIUtils; import io.vertx.core.http.HttpClientOptions; >>>>>>> import com.gentics.mesh.util.URIUtils; import io.vertx.core.http.HttpClientOptions; <<<<<<< public MeshRequest<WebRootResponse> webroot(String projectName, String[] pathSegments, ParameterProvider... parameters) { Objects.requireNonNull(projectName, "projectName must not be null"); Objects.requireNonNull(pathSegments, "pathSegments must not be null"); StringBuilder path = new StringBuilder(); path.append("/"); for (String segment : pathSegments) { if (path.length() > 0) { path.append("/"); } path.append(encodeSegment(segment)); } return webroot(projectName, path.toString(), parameters); } @Override ======= >>>>>>> public MeshRequest<WebRootResponse> webroot(String projectName, String[] pathSegments, ParameterProvider... parameters) { Objects.requireNonNull(projectName, "projectName must not be null"); Objects.requireNonNull(pathSegments, "pathSegments must not be null"); StringBuilder path = new StringBuilder(); path.append("/"); for (String segment : pathSegments) { if (path.length() > 0) { path.append("/"); } path.append(encodeSegment(segment)); } return webroot(projectName, path.toString(), parameters); } @Override
<<<<<<< public static final String MESH_CLUSTER_TOPOLOGY_LOCK_TIMEOUT_ENV = "MESH_CLUSTER_TOPOLOGY_LOCK_TIMEOUT"; ======= public static final String MESH_CLUSTER_COORDINATOR_TOPOLOGY_ENV = "MESH_CLUSTER_COORDINATOR_TOPOLOGY"; >>>>>>> public static final String MESH_CLUSTER_TOPOLOGY_LOCK_TIMEOUT_ENV = "MESH_CLUSTER_TOPOLOGY_LOCK_TIMEOUT"; public static final String MESH_CLUSTER_COORDINATOR_TOPOLOGY_ENV = "MESH_CLUSTER_COORDINATOR_TOPOLOGY"; <<<<<<< @JsonProperty(required = false) @JsonPropertyDescription("Define the timeout in ms for the topology lock. The topology lock will lock all transactions whenever the cluster topology changes. Default: " + DEFAULT_TOPOLOGY_LOCK_TIMEOUT + ". A value of 0 will disable the locking mechanism.") @EnvironmentVariable(name = MESH_CLUSTER_TOPOLOGY_LOCK_TIMEOUT_ENV, description = "Override the cluster topology lock timeout in ms.") private long topologyLockTimeout = DEFAULT_TOPOLOGY_LOCK_TIMEOUT; ======= @JsonProperty(required = false) @JsonPropertyDescription("The coordinator topology setting controls whether the coordinator should manage the cluster topology. By default no cluster topology management will be done.") @EnvironmentVariable(name = MESH_CLUSTER_COORDINATOR_TOPOLOGY_ENV, description = "Override the cluster coordinator topology management mode.") private CoordinationTopology coordinatorTopology = CoordinationTopology.UNMANAGED; >>>>>>> @JsonProperty(required = false) @JsonPropertyDescription("Define the timeout in ms for the topology lock. The topology lock will lock all transactions whenever the cluster topology changes. Default: " + DEFAULT_TOPOLOGY_LOCK_TIMEOUT + ". A value of 0 will disable the locking mechanism.") @EnvironmentVariable(name = MESH_CLUSTER_TOPOLOGY_LOCK_TIMEOUT_ENV, description = "Override the cluster topology lock timeout in ms.") private long topologyLockTimeout = DEFAULT_TOPOLOGY_LOCK_TIMEOUT; @JsonProperty(required = false) @JsonPropertyDescription("The coordinator topology setting controls whether the coordinator should manage the cluster topology. By default no cluster topology management will be done.") @EnvironmentVariable(name = MESH_CLUSTER_COORDINATOR_TOPOLOGY_ENV, description = "Override the cluster coordinator topology management mode.") private CoordinationTopology coordinatorTopology = CoordinationTopology.UNMANAGED; <<<<<<< public long getTopologyLockTimeout() { return topologyLockTimeout; } public ClusterOptions setTopologyLockTimeout(long topologyLockTimeout) { this.topologyLockTimeout = topologyLockTimeout; return this; } ======= public CoordinationTopology getCoordinatorTopology() { return coordinatorTopology; } public ClusterOptions setCoordinatorTopology(CoordinationTopology coordinatorTopology) { this.coordinatorTopology = coordinatorTopology; return this; } >>>>>>> public long getTopologyLockTimeout() { return topologyLockTimeout; } public ClusterOptions setTopologyLockTimeout(long topologyLockTimeout) { this.topologyLockTimeout = topologyLockTimeout; return this; } public CoordinationTopology getCoordinatorTopology() { return coordinatorTopology; } public ClusterOptions setCoordinatorTopology(CoordinationTopology coordinatorTopology) { this.coordinatorTopology = coordinatorTopology; return this; }
<<<<<<< ======= import static com.gentics.mesh.core.rest.admin.consistency.InconsistencySeverity.MEDIUM; import static com.gentics.mesh.core.rest.error.Errors.conflict; import static com.gentics.mesh.core.rest.error.Errors.error; >>>>>>> <<<<<<< ======= public Tag findByName(String name) { return out(getRootLabel()).mark().has(TagImpl.TAG_VALUE_KEY, name).back().nextOrDefaultExplicit(TagImpl.class, null); } @Override public Tag create(String name, Project project, User creator, String uuid) { TagImpl tag = getGraph().addFramedVertex(TagImpl.class); if (uuid != null) { tag.setUuid(uuid); } tag.setName(name); tag.setCreated(creator); tag.setProject(project); tag.generateBucketId(); // Add the tag to the global tag root mesh().boot().meshRoot().getTagRoot().addTag(tag); // And to the tag family addTag(tag); // Set the tag family for the tag tag.setTagFamily(this); return tag; } @Override >>>>>>>
<<<<<<< import static com.gentics.mesh.core.data.relationship.GraphRelationships.HAS_MICROSCHEMA_CONTAINER; import static com.gentics.mesh.core.data.search.SearchQueueEntryAction.DELETE_ACTION; import java.io.IOException; import java.util.List; import org.apache.commons.lang.NotImplementedException; import com.gentics.mesh.context.InternalActionContext; import com.gentics.mesh.core.data.MicroschemaContainer; import com.gentics.mesh.core.data.node.Micronode; import com.gentics.mesh.core.data.node.impl.MicronodeImpl; ======= import com.gentics.mesh.core.data.root.MeshRoot; import com.gentics.mesh.core.data.root.RootVertex; import com.gentics.mesh.core.data.schema.MicroschemaContainer; import com.gentics.mesh.core.data.schema.MicroschemaContainerVersion; >>>>>>> import static com.gentics.mesh.core.data.relationship.GraphRelationships.HAS_MICROSCHEMA_CONTAINER; import static com.gentics.mesh.core.data.search.SearchQueueEntryAction.DELETE_ACTION; import java.io.IOException; import java.util.List; import org.apache.commons.lang.NotImplementedException; import com.gentics.mesh.context.InternalActionContext; import com.gentics.mesh.core.data.node.Micronode; import com.gentics.mesh.core.data.node.impl.MicronodeImpl; import static com.gentics.mesh.core.data.relationship.GraphRelationships.HAS_MICROSCHEMA_CONTAINER; import static com.gentics.mesh.core.data.search.SearchQueueEntryAction.DELETE_ACTION; import java.io.IOException; import java.util.List; import org.apache.commons.lang.NotImplementedException; import com.gentics.mesh.core.data.node.Micronode; import com.gentics.mesh.core.data.node.impl.MicronodeImpl; import com.gentics.mesh.core.data.root.MeshRoot; import com.gentics.mesh.core.data.root.RootVertex; import com.gentics.mesh.core.data.schema.MicroschemaContainer; import com.gentics.mesh.core.data.schema.MicroschemaContainerVersion; <<<<<<< import com.gentics.mesh.json.JsonUtil; import com.gentics.mesh.util.RestModelHelper; ======= >>>>>>> import com.gentics.mesh.json.JsonUtil; import com.gentics.mesh.util.RestModelHelper; import com.gentics.mesh.json.JsonUtil; import com.gentics.mesh.util.RestModelHelper;
<<<<<<< // Overwrite the details with the vlaues generated by the diagram algorithm details.x.center = GeomAttribute.makeFunction("scale_x(d.x)"); details.y.center = GeomAttribute.makeFunction("scale_y(d.y)"); details.overallSize = GeomAttribute.makeFunction("scale_x(d.r) - scale_x(0)"); // Simple circles, with classes defined for CSS out.addChained("attr('class', function(d) { return (d.children ? 'element L' + d.depth : 'leaf element " + element.name() + "') })"); D3ElementBuilder.definePointLikeMark(details, vis, out); ======= writeHierarchicalClass(); out.addChained("attr('cx', function(d) { return scale_x(d.x) })") .addChained("attr('cy', function(d) { return scale_y(d.y) })") .addChained("attr('r', function(d) { return scale_x(d.r) - scale_x(0) })"); >>>>>>> writeHierarchicalClass(); out.addChained("attr('cx', function(d) { return scale_x(d.x) })") .addChained("attr('cy', function(d) { return scale_y(d.y) })") .addChained("attr('r', function(d) { return scale_x(d.r) - scale_x(0) })"); // Overwrite the details with the vlaues generated by the diagram algorithm details.x.center = GeomAttribute.makeFunction("scale_x(d.x)"); details.y.center = GeomAttribute.makeFunction("scale_y(d.y)"); details.overallSize = GeomAttribute.makeFunction("scale_x(d.r) - scale_x(0)"); // Simple circles, with classes defined for CSS out.addChained("attr('class', function(d) { return (d.children ? 'element L' + d.depth : 'leaf element " + element.name() + "') })"); D3ElementBuilder.definePointLikeMark(details, vis, out);
<<<<<<< public TemporalPartialWorldGenerator(Model model, Collection queryTemplates) { this.model = model; currentPartialWorld = new DefaultPartialWorld(); queryInstantiator = new TemporalQueriesInstantiator(model, queryTemplates); } /** * Augments and returns the current world based on the instantiation of the * query templates for the time step next to the last one used, or 0 if this * is the first generation. */ public void moveOn() { moveOn(++lastTimeStep); } /** * Augments and returns the current world based on the instantiation of the * query templates for the given value of t. */ public void moveOn(int t) { moveOn(queryInstantiator.getQueries(lastTimeStep = t)); } /** * Augments the current world based on the given queries. */ public void moveOn(Collection queries) { for (Iterator it = queries.iterator(); it.hasNext();) { ArgSpecQuery query = (ArgSpecQuery) it.next(); BLOGUtil.ensureDetAndSupported(query.getVariable(), currentPartialWorld); } latestQueries = queries; if (afterMove != null) afterMove.evaluate(latestQueries); uninstantiatePreviousTimeslices(currentPartialWorld); BLOGUtil.removeAllDerivedVars(currentPartialWorld); } /** Provides the latest instantiated queries. */ public Collection getLatestQueries() { return latestQueries; } /** Returns the template that generated a given query in the last advance. */ public String getTemplateOf(ArgSpecQuery query) { return (String) queryInstantiator.getTemplateOf(query); } protected Model model; public Model getModel() { return model; } public static int findLargestTimestepIndex(PartialWorld world) { int largest = -1; Iterator timestepIndexIt = DBLOGUtil.getTimestepIndicesIterator(world); while (timestepIndexIt.hasNext()) { Integer timestepIndex = (Integer) timestepIndexIt.next(); if (timestepIndex.intValue() > largest) largest = timestepIndex.intValue(); } return largest; } /** * Identifies the largest time step in a world and uninstantiates all temporal * random variables with a different time step. */ public static void uninstantiatePreviousTimeslices(PartialWorld world) { int largestTimestepIndex = findLargestTimestepIndex(world); if (largestTimestepIndex != -1) DBLOGUtil.removeVarsAtDiffTimestep(Timestep.at(largestTimestepIndex), world); } /** * The current world. */ public PartialWorld currentPartialWorld; public int lastTimeStep = -1; private Collection latestQueries; protected TemporalQueriesInstantiator queryInstantiator; // Cheng: changed visibility of queryInstantiator to protected. /** * If present, this function is evaluated on the query map (indexed by * templates) right after it is supported in the current world. */ public UnaryProcedure afterMove = null; public static void main(String[] args) { Util.initRandom(true); Model model = Model .readFromFile("examples/ParticleFilteringVsLikelihoodWeightingMay2008Experiment.mblog"); final TemporalPartialWorldGenerator gen = new TemporalPartialWorldGenerator( model, Util.list("query #{Blip r: Time(r) = t};")); final ArgSpecQuery aircraft = (ArgSpecQuery) BLOGUtil.parseQuery_NE( "query #{Aircraft a};", model); gen.afterMove = new UnaryProcedure() { public void evaluate(Object queriesObj) { Collection queries = (Collection) queriesObj; ArgSpecQuery query = (ArgSpecQuery) Util.getFirst(queries); query.updateStats(gen.currentPartialWorld); query.printResults(System.out); aircraft.updateStats(gen.currentPartialWorld); aircraft.printResults(System.out); } }; for (int t = 0; t < 10000; t++) { gen.moveOn(t); } } ======= public TemporalPartialWorldGenerator(Model model, Collection queryTemplates) { this.model = model; currentPartialWorld = new DefaultPartialWorld(); queryInstantiator = new TemporalQueriesInstantiator(model, queryTemplates); } /** * Augments and returns the current world based on the instantiation of the * query templates for the time step next to the last one used, or 0 if this * is the first generation. */ public void moveOn() { moveOn(++lastTimeStep); } /** * Augments and returns the current world based on the instantiation of the * query templates for the given value of t. */ public void moveOn(int t) { moveOn(queryInstantiator.getQueries(lastTimeStep = t)); } /** * Augments the current world based on the given queries. */ public void moveOn(Collection queries) { for (Iterator it = queries.iterator(); it.hasNext();) { ArgSpecQuery query = (ArgSpecQuery) it.next(); BLOGUtil.ensureDetAndSupported(query.getVariable(), currentPartialWorld); } latestQueries = queries; if (afterMove != null) afterMove.evaluate(latestQueries); DBLOGUtil.uninstantiatePreviousTimeslices(currentPartialWorld); BLOGUtil.removeAllDerivedVars(currentPartialWorld); } /** Provides the latest instantiated queries. */ public Collection getLatestQueries() { return latestQueries; } /** Returns the template that generated a given query in the last advance. */ public String getTemplateOf(ArgSpecQuery query) { return (String) queryInstantiator.getTemplateOf(query); } protected Model model; public Model getModel() { return model; } /** * The current world. */ public PartialWorld currentPartialWorld; public int lastTimeStep = -1; private Collection latestQueries; protected TemporalQueriesInstantiator queryInstantiator; // Cheng: changed visibility of queryInstantiator to protected. /** * If present, this function is evaluated on the query map (indexed by * templates) right after it is supported in the current world. */ public UnaryProcedure afterMove = null; public static void main(String[] args) { Util.initRandom(true); Model model = Model .readFromFile("examples/ParticleFilteringVsLikelihoodWeightingMay2008Experiment.mblog"); final TemporalPartialWorldGenerator gen = new TemporalPartialWorldGenerator( model, Util.list("query #{Blip r: Time(r) = t};")); final ArgSpecQuery aircraft = (ArgSpecQuery) BLOGUtil.parseQuery_NE( "query #{Aircraft a};", model); gen.afterMove = new UnaryProcedure() { public void evaluate(Object queriesObj) { Collection queries = (Collection) queriesObj; ArgSpecQuery query = (ArgSpecQuery) Util.getFirst(queries); query.updateStats(gen.currentPartialWorld); TableWriter tableWriter = new TableWriter(Util.list(query)); tableWriter.writeResults(System.out); aircraft.updateStats(gen.currentPartialWorld); tableWriter = new TableWriter(Util.list(aircraft)); tableWriter.writeResults(System.out); } }; for (int t = 0; t < 10000; t++) { gen.moveOn(t); } } >>>>>>> public TemporalPartialWorldGenerator(Model model, Collection queryTemplates) { this.model = model; currentPartialWorld = new DefaultPartialWorld(); queryInstantiator = new TemporalQueriesInstantiator(model, queryTemplates); } /** * Augments and returns the current world based on the instantiation of the * query templates for the time step next to the last one used, or 0 if this * is the first generation. */ public void moveOn() { moveOn(++lastTimeStep); } /** * Augments and returns the current world based on the instantiation of the * query templates for the given value of t. */ public void moveOn(int t) { moveOn(queryInstantiator.getQueries(lastTimeStep = t)); } /** * Augments the current world based on the given queries. */ public void moveOn(Collection queries) { for (Iterator it = queries.iterator(); it.hasNext();) { ArgSpecQuery query = (ArgSpecQuery) it.next(); BLOGUtil.ensureDetAndSupported(query.getVariable(), currentPartialWorld); } latestQueries = queries; if (afterMove != null) afterMove.evaluate(latestQueries); uninstantiatePreviousTimeslices(currentPartialWorld); BLOGUtil.removeAllDerivedVars(currentPartialWorld); } /** Provides the latest instantiated queries. */ public Collection getLatestQueries() { return latestQueries; } /** Returns the template that generated a given query in the last advance. */ public String getTemplateOf(ArgSpecQuery query) { return (String) queryInstantiator.getTemplateOf(query); } protected Model model; public Model getModel() { return model; } public static int findLargestTimestepIndex(PartialWorld world) { int largest = -1; Iterator timestepIndexIt = DBLOGUtil.getTimestepIndicesIterator(world); while (timestepIndexIt.hasNext()) { Integer timestepIndex = (Integer) timestepIndexIt.next(); if (timestepIndex.intValue() > largest) largest = timestepIndex.intValue(); } return largest; } /** * Identifies the largest time step in a world and uninstantiates all temporal * random variables with a different time step. */ public static void uninstantiatePreviousTimeslices(PartialWorld world) { int largestTimestepIndex = findLargestTimestepIndex(world); if (largestTimestepIndex != -1) DBLOGUtil.removeVarsAtDiffTimestep(Timestep.at(largestTimestepIndex), world); } /** * The current world. */ public PartialWorld currentPartialWorld; public int lastTimeStep = -1; private Collection latestQueries; protected TemporalQueriesInstantiator queryInstantiator; // Cheng: changed visibility of queryInstantiator to protected. /** * If present, this function is evaluated on the query map (indexed by * templates) right after it is supported in the current world. */ public UnaryProcedure afterMove = null; public static void main(String[] args) { Util.initRandom(true); Model model = Model .readFromFile("examples/ParticleFilteringVsLikelihoodWeightingMay2008Experiment.mblog"); final TemporalPartialWorldGenerator gen = new TemporalPartialWorldGenerator( model, Util.list("query #{Blip r: Time(r) = t};")); final ArgSpecQuery aircraft = (ArgSpecQuery) BLOGUtil.parseQuery_NE( "query #{Aircraft a};", model); gen.afterMove = new UnaryProcedure() { public void evaluate(Object queriesObj) { Collection queries = (Collection) queriesObj; ArgSpecQuery query = (ArgSpecQuery) Util.getFirst(queries); query.updateStats(gen.currentPartialWorld); TableWriter tableWriter = new TableWriter(Util.list(query)); tableWriter.writeResults(System.out); aircraft.updateStats(gen.currentPartialWorld); tableWriter = new TableWriter(Util.list(aircraft)); tableWriter.writeResults(System.out); } }; for (int t = 0; t < 10000; t++) { gen.moveOn(t); } }
<<<<<<< /** * Return the element from a singleton set. */ public static FixedFunction IOTA; ======= /** * Interpret the case expression in fixed function, also used for if then else * in fixed function */ public static TemplateFunction CASE_IN_FIXED_FUNC; >>>>>>> /** * Return the element from a singleton set. */ public static FixedFunction IOTA; /** * Interpret the case expression in fixed function, also used for if then else * in fixed function */ public static TemplateFunction CASE_IN_FIXED_FUNC; <<<<<<< /** * return the element in a singleton set */ FunctionInterp iotaInterp = new AbstractFunctionInterp() { public Object getValue(List args) { Collection<?> set = (Collection<?>) args.get(0); return ((set.size() == 1) ? set.iterator().next() : Model.NULL); } }; argTypes.clear(); argTypes.add(BuiltInTypes.SET); retType = BuiltInTypes.ANY; IOTA = new FixedFunction(IOTA_NAME, argTypes, retType, iotaInterp); addFunction(IOTA); ======= /** * defining size(set) function */ FunctionInterp setSizeInterp = new AbstractFunctionInterp() { public Object getValue(List args) { Collection<?> set = (Collection<?>) args.get(0); return set.size(); } }; argTypes.clear(); argTypes.add(BuiltInTypes.SET); retType = BuiltInTypes.INTEGER; SET_SIZE = new FixedFunction(SIZE_NAME, argTypes, retType, setSizeInterp); addFunction(SET_SIZE); >>>>>>> /** * defining size(set) function */ FunctionInterp setSizeInterp = new AbstractFunctionInterp() { public Object getValue(List args) { Collection<?> set = (Collection<?>) args.get(0); return set.size(); } }; argTypes.clear(); argTypes.add(BuiltInTypes.SET); retType = BuiltInTypes.INTEGER; SET_SIZE = new FixedFunction(SIZE_NAME, argTypes, retType, setSizeInterp); addFunction(SET_SIZE); /** * return the element in a singleton set */ FunctionInterp iotaInterp = new AbstractFunctionInterp() { public Object getValue(List args) { Collection<?> set = (Collection<?>) args.get(0); return ((set.size() == 1) ? set.iterator().next() : Model.NULL); } }; argTypes.clear(); argTypes.add(BuiltInTypes.SET); retType = BuiltInTypes.ANY; IOTA = new FixedFunction(IOTA_NAME, argTypes, retType, iotaInterp); addFunction(IOTA);
<<<<<<< import static blog.BLOGUtil.parseQuery_NE; import junit.framework.TestCase; ======= import static blog.BLOGUtil.parseEvidence_NE; import static blog.BLOGUtil.parseQuery_NE; import java.util.List; import java.util.Set; import junit.framework.TestCase; import blog.BLOGUtil; import blog.DBLOGUtil; >>>>>>> import static blog.BLOGUtil.parseQuery_NE; import junit.framework.TestCase; <<<<<<< ======= import blog.io.TableWriter; import blog.model.ArgSpec; >>>>>>> import blog.io.TableWriter; <<<<<<< public static void main(String[] args) throws Exception { junit.textui.TestRunner.run(MiscTest.class); } public void testParsingTupleSetSpec() { // to be removed Util.initRandom(true); Model model = Model.readFromString("random Boolean Weather(Timestep);" + "Weather(t) ~ Bernoulli(0.8);"); ArgSpecQuery query = parseQuery_NE( "query {Weather(t) for Timestep t : t = @0 | t = @1 | t = @2};", model); InferenceEngine engine = new SamplingEngine(model); engine.solve(query); query.printResults(System.out); assertEquals( 0.512, query.getProb(Util.multiset(Util.list(true), Util.list(true), Util.list(true))), 0.1); } public void testLogSum() { double got = Util.logSum(-2000, -2000); double expected = -2000 + java.lang.Math.log(2); assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(-2000, -2010); expected = -1999.99995460110085332417; assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(-2000, -1000); expected = -1000; assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(-1000, -2000); expected = -1000; assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(-1000, Double.NEGATIVE_INFINITY); expected = -1000; assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(Double.NEGATIVE_INFINITY, -1000); expected = -1000; assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY); expected = Double.NEGATIVE_INFINITY; assertEquals(got, expected); } ======= public static void main(String[] args) throws Exception { junit.textui.TestRunner.run(MiscTest.class); } public void testDBLOGUtilGetTimestepTermsIn() { Model model = Model .readFromString("random Boolean Weather(Timestep t) = true;"); ArgSpec a; ArgSpec at10 = BLOGUtil.parseTerm_NE("@10", model); ArgSpec at13 = BLOGUtil.parseTerm_NE("@13", model); Set timesteps; a = BLOGUtil.parseArgSpec_NE("{Weather(@10), @13}", model); timesteps = Util.set(at10, at13); assertEquals(timesteps, DBLOGUtil.getTimestepTermsIn(a, Util.set())); } public void testSplitEvidenceByMaxTimestep() { Model model = Model.readFromString("random Boolean Weather(Timestep);" + "Weather(t) = true;" + "random Boolean Dummy;" + "Dummy = true;"); Evidence evidence; String evidenceDescription = "obs Weather(@15) = true;" + "obs Weather(@2) = true;" + "obs Dummy = true;" + "obs (Weather(@15)=true & Weather(@1)=false)=true;" + "obs (Weather(@1)=true & Weather(@2)=false)=true;"; evidence = parseEvidence_NE(evidenceDescription, model); List sortedEvidence = DBLOGUtil.splitEvidenceByMaxTimestep(evidence); System.out.println(Util.join(sortedEvidence, "\n")); } public void testParsingTupleSetSpec() { // to be removed Util.initRandom(true); Model model = Model.readFromString("random Boolean Weather(Timestep);" + "Weather(t) ~ Bernoulli(0.8);"); ArgSpecQuery query = parseQuery_NE( "query {Weather(t) for Timestep t : t = @0 | t = @1 | t = @2};", model); InferenceEngine engine = new SamplingEngine(model); engine.solve(query); TableWriter tableWriter = new TableWriter(query); tableWriter.writeResults(System.out); assertEquals( 0.512, query.getProb(Util.multiset(Util.list(true), Util.list(true), Util.list(true))), 0.1); } public void testLogSum() { double got = Util.logSum(-2000, -2000); double expected = -2000 + java.lang.Math.log(2); assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(-2000, -2010); expected = -1999.99995460110085332417; assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(-2000, -1000); expected = -1000; assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(-1000, -2000); expected = -1000; assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(-1000, Double.NEGATIVE_INFINITY); expected = -1000; assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(Double.NEGATIVE_INFINITY, -1000); expected = -1000; assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY); expected = Double.NEGATIVE_INFINITY; assertEquals(got, expected); } >>>>>>> public static void main(String[] args) throws Exception { junit.textui.TestRunner.run(MiscTest.class); } public void testParsingTupleSetSpec() { // to be removed Util.initRandom(true); Model model = Model.readFromString("random Boolean Weather(Timestep);" + "Weather(t) ~ Bernoulli(0.8);"); ArgSpecQuery query = parseQuery_NE( "query {Weather(t) for Timestep t : t = @0 | t = @1 | t = @2};", model); InferenceEngine engine = new SamplingEngine(model); engine.solve(query); TableWriter tableWriter = new TableWriter(query); tableWriter.writeResults(System.out); assertEquals( 0.512, query.getProb(Util.multiset(Util.list(true), Util.list(true), Util.list(true))), 0.1); } public void testLogSum() { double got = Util.logSum(-2000, -2000); double expected = -2000 + java.lang.Math.log(2); assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(-2000, -2010); expected = -1999.99995460110085332417; assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(-2000, -1000); expected = -1000; assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(-1000, -2000); expected = -1000; assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(-1000, Double.NEGATIVE_INFINITY); expected = -1000; assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(Double.NEGATIVE_INFINITY, -1000); expected = -1000; assertTrue(java.lang.Math.abs(got - expected) < 1e-10); got = Util.logSum(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY); expected = Double.NEGATIVE_INFINITY; assertEquals(got, expected); }
<<<<<<< static public MatrixLib createVector(double... args) { double[][] ary = new double[1][args.length]; for (int i = 0; i < args.length; i++) { ary[0][i] = args[i]; } return MatrixFactory.fromArray(ary); } ======= static public MatrixLib createRowVector(double... args) { double[][] ary = new double[1][args.length]; for (int i = 0; i < args.length; i++) { ary[0][i] = args[i]; } return MatrixFactory.fromArray(ary); } >>>>>>> static public MatrixLib createVector(double... args) { double[][] ary = new double[1][args.length]; for (int i = 0; i < args.length; i++) { ary[0][i] = args[i]; } return MatrixFactory.fromArray(ary); } static public MatrixLib createRowVector(double... args) { double[][] ary = new double[1][args.length]; for (int i = 0; i < args.length; i++) { ary[0][i] = args[i]; } return MatrixFactory.fromArray(ary); }
<<<<<<< import hudson.model.AbstractProject; import hudson.model.EnvironmentContributingAction; import jenkins.model.Jenkins; ======= import hudson.model.Result; >>>>>>> import hudson.model.AbstractProject; import hudson.model.EnvironmentContributingAction; import jenkins.model.Jenkins; import hudson.model.Result; <<<<<<< private final AbstractBuild<?, ?> parentBuild; public BuildInfoExporterAction(String buildName, int buildNumber, AbstractBuild<?,?> parentBuild) { ======= private Result buildResult; public BuildInfoExporterAction(String buildName, int buildNumber, Result buildResult) { >>>>>>> private final AbstractBuild<?, ?> parentBuild; private Result buildResult; public BuildInfoExporterAction(String buildName, int buildNumber, AbstractBuild<?,?> parentBuild, Result buildResult) { <<<<<<< this.parentBuild = parentBuild; ======= this.buildResult = buildResult; >>>>>>> this.parentBuild = parentBuild; this.buildResult = buildResult; <<<<<<< env.put(BUILD_NUMBER_VARIABLE_PREFIX + sanatizedBuildName, Integer.toString(buildNumber)); // handle case where multiple builds are triggered String buildVariable = ALL_BUILD_NUMBER_VARIABLE_PREFIX + sanatizedBuildName; originalvalue = env.get(buildVariable); if(originalvalue == null) { env.put(buildVariable, Integer.toString(buildNumber)); ======= env.put(triggeredBuildRunKey, Integer.toString(triggeredBuildRun)); String tiggeredBuildNumberKey = BUILD_NUMBER_VARIABLE_PREFIX + sanatizedBuildName; String tiggeredBuildRunNumberKey = BUILD_NUMBER_VARIABLE_PREFIX + sanatizedBuildName + RUN + triggeredBuildRun; String tiggeredBuildResultKey = BUILD_RESULT_VARIABLE_PREFIX + sanatizedBuildName; String tiggeredBuildRunResultKey = BUILD_RESULT_VARIABLE_PREFIX + sanatizedBuildName + RUN + triggeredBuildRun; env.put(tiggeredBuildNumberKey, Integer.toString(buildNumber)); env.put(tiggeredBuildRunNumberKey, Integer.toString(buildNumber)); env.put(tiggeredBuildResultKey, buildResult.toString()); env.put(tiggeredBuildRunResultKey, buildResult.toString()); // Store a list of all jobs which have been run, along with numbers and results String buildNumberVariable = ALL_BUILD_NUMBER_VARIABLE_PREFIX + sanatizedBuildName; String buildResultVariable = ALL_BUILD_RESULT_VARIABLE_PREFIX + sanatizedBuildName; if (jobHasRanBefore) { // do not need to add it to list of job names // need to record this build number env.put(buildNumberVariable, env.get(buildNumberVariable) + "," + Integer.toString(buildNumber)); // need to record this build result env.put(buildResultVariable, env.get(buildResultVariable) + "," + buildResult.toString()); >>>>>>> env.put(triggeredBuildRunKey, Integer.toString(triggeredBuildRun)); String tiggeredBuildNumberKey = BUILD_NUMBER_VARIABLE_PREFIX + sanatizedBuildName; String tiggeredBuildRunNumberKey = BUILD_NUMBER_VARIABLE_PREFIX + sanatizedBuildName + RUN + triggeredBuildRun; String tiggeredBuildResultKey = BUILD_RESULT_VARIABLE_PREFIX + sanatizedBuildName; String tiggeredBuildRunResultKey = BUILD_RESULT_VARIABLE_PREFIX + sanatizedBuildName + RUN + triggeredBuildRun; env.put(tiggeredBuildNumberKey, Integer.toString(buildNumber)); env.put(tiggeredBuildRunNumberKey, Integer.toString(buildNumber)); env.put(tiggeredBuildResultKey, buildResult.toString()); env.put(tiggeredBuildRunResultKey, buildResult.toString()); // Store a list of all jobs which have been run, along with numbers and results String buildNumberVariable = ALL_BUILD_NUMBER_VARIABLE_PREFIX + sanatizedBuildName; String buildResultVariable = ALL_BUILD_RESULT_VARIABLE_PREFIX + sanatizedBuildName; if (jobHasRanBefore) { // do not need to add it to list of job names // need to record this build number env.put(buildNumberVariable, env.get(buildNumberVariable) + "," + Integer.toString(buildNumber)); // need to record this build result env.put(buildResultVariable, env.get(buildResultVariable) + "," + buildResult.toString());
<<<<<<< private static final int MINIMUM_DX_FOR_HORIZONTAL_DRAG = 5; private static final int MINIMUM_DY_FOR_VERTICAL_DRAG = 15; private static final float X_MIN_VELOCITY = 1300; private static final float Y_MIN_VELOCITY = 1300; private DraggableView draggableView; private View draggedView; /** * Main constructor. * * @param draggableView instance used to apply some animations or visual effects. * @param draggedView */ public DraggableViewCallback(DraggableView draggableView, View draggedView) { this.draggableView = draggableView; this.draggedView = draggedView; ======= private static final int MINIMUN_DX_FOR_HORIZONTAL_DRAG = 25; private static final int MINIMUM_DY_FOR_VERTICAL_DRAG = 15; private static final float X_MIN_VELOCITY = 1300; private static final float Y_MIN_VELOCITY = 1300; private DraggableView draggableView; private View draggedView; /** * Main constructor. * * @param draggableView instance used to apply some animations or visual effects. */ public DraggableViewCallback(DraggableView draggableView, View draggedView) { this.draggableView = draggableView; this.draggedView = draggedView; } /** * Override method used to apply different scale and alpha effects while the view is being * dragged. * * @param left position. * @param top position. * @param dx change in X position from the last call. * @param dy change in Y position from the last call. */ @Override public void onViewPositionChanged(View changedView, int left, int top, int dx, int dy) { draggableView.updateLastDragViewPosition(top, left); if (draggableView.isDragViewAtBottom()) { draggableView.changeDragViewViewAlpha(); } else { draggableView.restoreAlpha(); draggableView.changeDragViewScale(); draggableView.changeDragViewPosition(); draggableView.changeSecondViewAlpha(); draggableView.changeSecondViewPosition(); draggableView.changeBackgroundAlpha(); >>>>>>> private static final int MINIMUN_DX_FOR_HORIZONTAL_DRAG = 5; private static final int MINIMUM_DY_FOR_VERTICAL_DRAG = 15; private static final float X_MIN_VELOCITY = 1300; private static final float Y_MIN_VELOCITY = 1300; private DraggableView draggableView; private View draggedView; /** * Main constructor. * * @param draggableView instance used to apply some animations or visual effects. */ public DraggableViewCallback(DraggableView draggableView, View draggedView) { this.draggableView = draggableView; this.draggedView = draggedView; } /** * Override method used to apply different scale and alpha effects while the view is being * dragged. * * @param left position. * @param top position. * @param dx change in X position from the last call. * @param dy change in Y position from the last call. */ @Override public void onViewPositionChanged(View changedView, int left, int top, int dx, int dy) { draggableView.updateLastDragViewPosition(top, left); if (draggableView.isDragViewAtBottom()) { draggableView.changeDragViewViewAlpha(); } else { draggableView.restoreAlpha(); draggableView.changeDragViewScale(); draggableView.changeDragViewPosition(); draggableView.changeSecondViewAlpha(); draggableView.changeSecondViewPosition(); draggableView.changeBackgroundAlpha();
<<<<<<< //list.add("sudo -u " + shellUserName + " sh "+shellFilePath); list.add("sudo -u " + shellUid + " sh "+shellFilePath); list.add("sudo -u " + shellUid + " sh "+shellFilePath); ======= list.add(shellPrefix + " sh "+shellFilePath); >>>>>>> list.add("sudo -u " + shellUid + " sh "+shellFilePath); list.add(shellPrefix + " sh "+shellFilePath);
<<<<<<< ======= @Override public void removeJob(Long actionId) throws ZeusException{ try{ JobPersistence action = (JobPersistence)getHibernateTemplate().get(JobPersistence.class, actionId); if(action != null){ getHibernateTemplate().delete(action); } }catch(DataAccessException e){ throw new ZeusException(e); } } >>>>>>> @Override public void removeJob(Long actionId) throws ZeusException{ try{ JobPersistence action = (JobPersistence)getHibernateTemplate().get(JobPersistence.class, actionId); if(action != null){ getHibernateTemplate().delete(action); } }catch(DataAccessException e){ throw new ZeusException(e); } }
<<<<<<< //System.out.println("worker start:"+holder.getDebugRunnings().size()); ======= System.out.println("schedule worker start:"+holder.getDebugRunnings().size()); >>>>>>> System.out.println("worker start:"+holder.getDebugRunnings().size()); System.out.println("schedule worker start:"+holder.getDebugRunnings().size()); <<<<<<< //System.out.println("worker end:"+holder.getDebugRunnings().size()); ======= System.out.println("schedule worker end:"+holder.getDebugRunnings().size()); >>>>>>> System.out.println("worker end:"+holder.getDebugRunnings().size()); System.out.println("schedule worker end:"+holder.getDebugRunnings().size());
<<<<<<< tmp.autoRegister = prefs.getBoolean(PreferencesUtils.AUTO_REGISTER, tmp.autoRegister); tmp.debugIntent = prefs.getBoolean(PreferencesUtils.KEY_DEBUG_INTENT, tmp.debugIntent); tmp.foregroundNotification = prefs.getBoolean(PreferencesUtils.KEY_FOREGROUND_NOTIFICATION, tmp.foregroundNotification); tmp.enableWakeupTarget = prefs.getBoolean(PreferencesUtils.KEY_ENABLE_WAKEUP_TARGET, tmp.enableWakeupTarget); tmp.enableGroupNotification = prefs.getBoolean(PreferencesUtils.KEY_ENABLE_GROUP_NOTIFICATION, tmp.enableGroupNotification); ======= tmp.autoRegister = prefs.getBoolean(PreferencesUtils.KeyAutoRegister, tmp.autoRegister); tmp.foregroundNotification = prefs.getBoolean(PreferencesUtils.KeyForegroundNotification, tmp.foregroundNotification); tmp.enableWakeupTarget = prefs.getBoolean(PreferencesUtils.KeyEnableWakeupTarget, tmp.enableWakeupTarget); >>>>>>> tmp.autoRegister = prefs.getBoolean(PreferencesUtils.AUTO_REGISTER, tmp.autoRegister); tmp.foregroundNotification = prefs.getBoolean(PreferencesUtils.KEY_FOREGROUND_NOTIFICATION, tmp.foregroundNotification); tmp.enableWakeupTarget = prefs.getBoolean(PreferencesUtils.KEY_ENABLE_WAKEUP_TARGET, tmp.enableWakeupTarget);
<<<<<<< import org.junit.Test; import reactor.core.Scannable; ======= import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; import reactor.core.Scannable; <<<<<<< import static org.assertj.core.api.Assertions.assertThat; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThat;
<<<<<<< import java.util.function.Supplier; import org.junit.Test; ======= import org.junit.jupiter.api.Test; >>>>>>> import java.util.function.Supplier; import org.junit.jupiter.api.Test;
<<<<<<< import static org.assertj.core.api.Assertions.assertThat; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThat;
<<<<<<< import com.pivovarit.function.ThrowingRunnable; import org.junit.Test; ======= import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; import com.pivovarit.function.ThrowingRunnable; <<<<<<< ======= @Test public void negativeParallelism() throws Exception { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { Schedulers.newParallel("test", -1); }); } >>>>>>>
<<<<<<< public CoreSubscriber<? super T> subscribeOrReturn(CoreSubscriber<? super R> actual) { if (FluxFlatMap.trySubscribeScalarMap(source, actual, mapper, false)) { return null; ======= public void subscribe(CoreSubscriber<? super R> actual) { if (FluxFlatMap.trySubscribeScalarMap(source, actual, mapper, false, true)) { return; >>>>>>> public CoreSubscriber<? super T> subscribeOrReturn(CoreSubscriber<? super R> actual) { if (FluxFlatMap.trySubscribeScalarMap(source, actual, mapper, false, true)) { return null;
<<<<<<< import org.junit.Test; import org.reactivestreams.Subscriber; ======= import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; import org.reactivestreams.Subscriber;
<<<<<<< import java.util.function.Supplier; import org.junit.Test; ======= import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; import java.util.function.Supplier;
<<<<<<< import static org.assertj.core.api.Assertions.assertThat; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThat;
<<<<<<< import org.junit.Test; ======= import org.junit.Assert; import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; <<<<<<< import static reactor.core.publisher.Sinks.EmitFailureHandler.FAIL_FAST; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static reactor.core.publisher.Sinks.EmitFailureHandler.FAIL_FAST; import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
<<<<<<< import org.junit.Test; import reactor.core.Scannable; ======= import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; import reactor.core.Scannable; <<<<<<< import static org.assertj.core.api.Assertions.assertThat; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThat;
<<<<<<< import org.junit.Test; import reactor.core.Scannable; ======= import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; import reactor.core.Scannable; <<<<<<< import static org.assertj.core.api.Assertions.assertThat; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThat;
<<<<<<< // TODO return subscriber (tail-call optimization)? FluxIterable.subscribe(actual, it); return null; ======= FluxIterable.subscribe(actual, it, knownToBeFinite); return; >>>>>>> // TODO return subscriber (tail-call optimization)? FluxIterable.subscribe(actual, it, knownToBeFinite); return null; <<<<<<< current = null; Operators.onDiscardQueueWithClear(q, actual.currentContext(), null); ======= resetCurrent(); Operators.onDiscardQueueWithClear(q, ctx, null); >>>>>>> resetCurrent(); Operators.onDiscardQueueWithClear(q, actual.currentContext(), null); <<<<<<< current = null; Operators.onDiscardQueueWithClear(q, actual.currentContext(), null); ======= resetCurrent(); Operators.onDiscardQueueWithClear(q, ctx, null); >>>>>>> resetCurrent(); Operators.onDiscardQueueWithClear(q, actual.currentContext(), null); <<<<<<< Context ctx = actual.currentContext(); Throwable e_ = Operators.onNextError(t, exc, ctx, s); ======= itFinite = false; //reset explicitly onError(Operators.onOperatorError(s, exc, t, ctx)); >>>>>>> itFinite = false; //reset explicitly Context ctx = actual.currentContext(); Throwable e_ = Operators.onNextError(t, exc, ctx, s); <<<<<<< current = null; Operators.onDiscardQueueWithClear(queue, actual.currentContext(), null); ======= resetCurrent(); final Context context = actual.currentContext(); Operators.onDiscardQueueWithClear(queue, context, null); Operators.onDiscardMultiple(it, itFinite, context); >>>>>>> resetCurrent(); final Context context = actual.currentContext(); Operators.onDiscardQueueWithClear(queue, context, null); Operators.onDiscardMultiple(it, itFinite, context); <<<<<<< current = null; a.onError(Operators.onOperatorError(s, exc, actual.currentContext())); ======= resetCurrent(); a.onError(Operators.onOperatorError(s, exc, ctx)); >>>>>>> resetCurrent(); a.onError(Operators.onOperatorError(s, exc, actual.currentContext())); <<<<<<< current = null; Operators.onDiscardQueueWithClear(queue, actual.currentContext(), null); ======= resetCurrent(); final Context context = actual.currentContext(); Operators.onDiscardQueueWithClear(queue, context, null); Operators.onDiscardMultiple(it, itFinite, context); >>>>>>> resetCurrent(); final Context context = actual.currentContext(); Operators.onDiscardQueueWithClear(queue, context, null); Operators.onDiscardMultiple(it, itFinite, context); <<<<<<< ======= boolean itFinite; Context ctx = actual.currentContext(); >>>>>>> boolean itFinite;
<<<<<<< boolean onNextNewBuffer() { ======= private void onNextNewBuffer() { >>>>>>> private void onNextNewBuffer() { <<<<<<< cleanup(); DrainUtils.postComplete(actual, this, REQUESTED, this, this); } boolean emit(C b) { if (fastpath) { actual.onNext(b); return false; } long r = REQUESTED.getAndDecrement(this); if(r > 0){ actual.onNext(b); return requested > 0; } cancel(); actual.onError(Exceptions.failWithOverflow("Could not emit buffer due to lack of requests")); return false; ======= DrainUtils.postComplete(actual, this, REQUESTED_BUFFERS, this, this); >>>>>>> cleanup(); DrainUtils.postComplete(actual, this, REQUESTED_BUFFERS, this, this);
<<<<<<< import static org.junit.Assert.assertFalse; import static reactor.core.publisher.Sinks.EmitFailureHandler.FAIL_FAST; ======= >>>>>>> import static reactor.core.publisher.Sinks.EmitFailureHandler.FAIL_FAST; <<<<<<< assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); ======= assertThat(sp1.hasDownstreams()).isFalse(); >>>>>>> assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); <<<<<<< assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); ======= assertThat(sp1.hasDownstreams()).isFalse(); >>>>>>> assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); <<<<<<< assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); ======= assertThat(sp1.hasDownstreams()).isFalse(); >>>>>>> assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); <<<<<<< assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); ======= assertThat(sp1.hasDownstreams()).isFalse(); >>>>>>> assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); <<<<<<< assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); ======= assertThat(sp1.hasDownstreams()).isFalse(); >>>>>>> assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); <<<<<<< assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); ======= assertThat(sp1.hasDownstreams()).isFalse(); >>>>>>> assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); <<<<<<< assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); ======= assertThat(sp1.hasDownstreams()).isFalse(); >>>>>>> assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); <<<<<<< .expectSubscription() .expectNoEvent(Duration.ofMillis(10)) .then(() -> sp1.emitNext(1, FAIL_FAST)) .then(() -> sp1.emitNext(2, FAIL_FAST)) .then(() -> sp1.emitNext(3, FAIL_FAST)) .expectNoEvent(Duration.ofMillis(10)) .then(() -> sp1.emitNext(4, FAIL_FAST)) .expectNext(Arrays.asList(3)) //emission of 4 triggers the buffer emit .then(() -> sp1.emitNext(5, FAIL_FAST)) .then(() -> sp1.emitNext(6, FAIL_FAST)) .expectNoEvent(Duration.ofMillis(10)) .then(() -> sp1.emitNext(7, FAIL_FAST)) // emission of 7 triggers the buffer emit .expectNext(Arrays.asList(6)) .then(() -> sp1.emitNext(8, FAIL_FAST)) .then(() -> sp1.emitNext(9, FAIL_FAST)) .expectNoEvent(Duration.ofMillis(10)) .then(() -> sp1.emitComplete(FAIL_FAST)) // completion triggers the buffer emit .expectNext(Collections.singletonList(9)) .expectComplete() .verify(Duration.ofSeconds(1)); assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); ======= .expectSubscription() .expectNoEvent(Duration.ofMillis(10)) .then(() -> sp1.onNext(1)) .then(() -> sp1.onNext(2)) .then(() -> sp1.onNext(3)) .expectNoEvent(Duration.ofMillis(10)) .then(() -> sp1.onNext(4)) .expectNext(Arrays.asList(3)) //emission of 4 triggers the buffer emit .then(() -> sp1.onNext(5)) .then(() -> sp1.onNext(6)) .expectNoEvent(Duration.ofMillis(10)) .then(() -> sp1.onNext(7)) // emission of 7 triggers the buffer emit .expectNext(Arrays.asList(6)) .then(() -> sp1.onNext(8)) .then(() -> sp1.onNext(9)) .expectNoEvent(Duration.ofMillis(10)) .then(sp1::onComplete) // completion triggers the buffer emit .expectNext(Collections.singletonList(9)) .expectComplete() .verify(Duration.ofSeconds(1)); assertThat(sp1.hasDownstreams()).isFalse(); >>>>>>> .expectSubscription() .expectNoEvent(Duration.ofMillis(10)) .then(() -> sp1.emitNext(1, FAIL_FAST)) .then(() -> sp1.emitNext(2, FAIL_FAST)) .then(() -> sp1.emitNext(3, FAIL_FAST)) .expectNoEvent(Duration.ofMillis(10)) .then(() -> sp1.emitNext(4, FAIL_FAST)) .expectNext(Arrays.asList(3)) //emission of 4 triggers the buffer emit .then(() -> sp1.emitNext(5, FAIL_FAST)) .then(() -> sp1.emitNext(6, FAIL_FAST)) .expectNoEvent(Duration.ofMillis(10)) .then(() -> sp1.emitNext(7, FAIL_FAST)) // emission of 7 triggers the buffer emit .expectNext(Arrays.asList(6)) .then(() -> sp1.emitNext(8, FAIL_FAST)) .then(() -> sp1.emitNext(9, FAIL_FAST)) .expectNoEvent(Duration.ofMillis(10)) .then(() -> sp1.emitComplete(FAIL_FAST)) // completion triggers the buffer emit .expectNext(Collections.singletonList(9)) .expectComplete() .verify(Duration.ofSeconds(1)); assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); <<<<<<< assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); ======= assertThat(sp1.hasDownstreams()).isFalse(); >>>>>>> assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); <<<<<<< assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); ======= assertThat(sp1.hasDownstreams()).isFalse(); >>>>>>> assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); <<<<<<< assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); ======= assertThat(sp1.hasDownstreams()).isFalse(); >>>>>>> assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); <<<<<<< assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); ======= assertThat(sp1.hasDownstreams()).as("sp1 has subscribers?").isFalse(); >>>>>>> assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); <<<<<<< assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); ======= assertThat(sp1.hasDownstreams()).as("sp1 has subscribers?").isFalse(); >>>>>>> assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); <<<<<<< assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero(); ======= assertThat(sp1.hasDownstreams()).as("sp1 has subscribers?").isFalse(); >>>>>>> assertThat(sp1.currentSubscriberCount()).as("sp1 has subscriber").isZero();
<<<<<<< import org.junit.Test; import reactor.core.CoreSubscriber; ======= import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; import reactor.core.CoreSubscriber; <<<<<<< import reactor.core.Disposables; import reactor.core.Exceptions; import reactor.core.Scannable; ======= >>>>>>> import reactor.core.Disposables; import reactor.core.Exceptions; import reactor.core.Scannable;
<<<<<<< import org.junit.Before; import org.junit.function.ThrowingRunnable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.TestFactory; import org.junit.jupiter.api.function.ThrowingConsumer; ======= import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; >>>>>>> import org.junit.function.ThrowingRunnable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.TestFactory; import org.junit.jupiter.api.function.ThrowingConsumer; <<<<<<< import reactor.util.function.Tuple2; import reactor.util.function.Tuples; ======= >>>>>>> import reactor.util.function.Tuple2; import reactor.util.function.Tuples;
<<<<<<< import reactor.core.CorePublisher; import reactor.core.CoreSubscriber; ======= >>>>>>> import reactor.core.CorePublisher; import reactor.core.CoreSubscriber; <<<<<<< @Test public void hooks() throws Exception { String key = UUID.randomUUID().toString(); try { Hooks.onLastOperator(key, p -> new CorePublisher<Object>() { @Override public void subscribe(CoreSubscriber<? super Object> subscriber) { ((CorePublisher<?>) p).subscribe(subscriber); } @Override public void subscribe(Subscriber<? super Object> s) { throw new IllegalStateException("Should not be called"); } }); List<Integer> results = new CopyOnWriteArrayList<>(); CountDownLatch latch = new CountDownLatch(1); Flux.just(1, 2, 3) .parallel() .doOnNext(results::add) .doOnComplete(latch::countDown) .subscribe(); latch.await(1, TimeUnit.SECONDS); assertThat(results).containsOnly(1, 2, 3); } finally { Hooks.resetOnLastOperator(key); } } @Test public void subscribeWithCoreSubscriber() throws Exception { List<Integer> results = new CopyOnWriteArrayList<>(); CountDownLatch latch = new CountDownLatch(1); Flux.just(1, 2, 3).parallel().subscribe(new CoreSubscriber<Integer>() { @Override public void onSubscribe(Subscription s) { s.request(Long.MAX_VALUE); } @Override public void onNext(Integer integer) { results.add(integer); } @Override public void onError(Throwable t) { t.printStackTrace(); } @Override public void onComplete() { latch.countDown(); } }); latch.await(1, TimeUnit.SECONDS); assertThat(results).containsOnly(1, 2, 3); } ======= // https://github.com/reactor/reactor-core/issues/1656 @Test public void doOnEachContext() { List<String> results = new CopyOnWriteArrayList<>(); Flux.just(1, 2, 3) .parallel(3) .doOnEach(s -> { String valueFromContext = s.getContext() .getOrDefault("test", null); results.add(s + " " + valueFromContext); }) .reduce(Integer::sum) .subscriberContext(Context.of("test", "Hello!")) .block(); assertThat(results).containsExactlyInAnyOrder( "onNext(1) Hello!", "onNext(2) Hello!", "onNext(3) Hello!", "onComplete() Hello!", "onComplete() Hello!", "onComplete() Hello!" ); } >>>>>>> @Test public void hooks() throws Exception { String key = UUID.randomUUID().toString(); try { Hooks.onLastOperator(key, p -> new CorePublisher<Object>() { @Override public void subscribe(CoreSubscriber<? super Object> subscriber) { ((CorePublisher<?>) p).subscribe(subscriber); } @Override public void subscribe(Subscriber<? super Object> s) { throw new IllegalStateException("Should not be called"); } }); List<Integer> results = new CopyOnWriteArrayList<>(); CountDownLatch latch = new CountDownLatch(1); Flux.just(1, 2, 3) .parallel() .doOnNext(results::add) .doOnComplete(latch::countDown) .subscribe(); latch.await(1, TimeUnit.SECONDS); assertThat(results).containsOnly(1, 2, 3); } finally { Hooks.resetOnLastOperator(key); } } @Test public void subscribeWithCoreSubscriber() throws Exception { List<Integer> results = new CopyOnWriteArrayList<>(); CountDownLatch latch = new CountDownLatch(1); Flux.just(1, 2, 3).parallel().subscribe(new CoreSubscriber<Integer>() { @Override public void onSubscribe(Subscription s) { s.request(Long.MAX_VALUE); } @Override public void onNext(Integer integer) { results.add(integer); } @Override public void onError(Throwable t) { t.printStackTrace(); } @Override public void onComplete() { latch.countDown(); } }); latch.await(1, TimeUnit.SECONDS); assertThat(results).containsOnly(1, 2, 3); } // https://github.com/reactor/reactor-core/issues/1656 @Test public void doOnEachContext() { List<String> results = new CopyOnWriteArrayList<>(); Flux.just(1, 2, 3) .parallel(3) .doOnEach(s -> { String valueFromContext = s.getContext() .getOrDefault("test", null); results.add(s + " " + valueFromContext); }) .reduce(Integer::sum) .subscriberContext(Context.of("test", "Hello!")) .block(); assertThat(results).containsExactlyInAnyOrder( "onNext(1) Hello!", "onNext(2) Hello!", "onNext(3) Hello!", "onComplete() Hello!", "onComplete() Hello!", "onComplete() Hello!" ); }
<<<<<<< import org.junit.Test; ======= import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; <<<<<<< @SuppressWarnings("deprecation") //retry with Predicate are deprecated, the underlying implementation is going to be removed ultimately ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @SuppressWarnings("deprecation") //retry with Predicate are deprecated, the underlying implementation is going to be removed ultimately <<<<<<< Flux.never() .retry((Predicate<? super Throwable>) null); ======= assertThatExceptionOfType(NullPointerException.class).isThrownBy(() -> { Flux.never() .retry(null); }); >>>>>>> assertThatExceptionOfType(NullPointerException.class).isThrownBy(() -> { Flux.never() .retry((Predicate<? super Throwable>) null); });
<<<<<<< public final CoreSubscriber<? super I> subscribeOrReturn(CoreSubscriber<? super O> actual) { ======= public String stepName() { if (source instanceof Scannable) { return Scannable.from(source).stepName(); } return Scannable.super.stepName(); } @Override public void subscribe(CoreSubscriber<? super O> actual) { >>>>>>> public String stepName() { if (source instanceof Scannable) { return Scannable.from(source).stepName(); } return Scannable.super.stepName(); } @Override public final CoreSubscriber<? super I> subscribeOrReturn(CoreSubscriber<? super O> actual) {
<<<<<<< import org.junit.Test; import reactor.core.Scannable; ======= import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; import reactor.core.Scannable;
<<<<<<< import static reactor.core.publisher.Sinks.EmitFailureHandler.FAIL_FAST; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static reactor.core.publisher.Sinks.EmitFailureHandler.FAIL_FAST;
<<<<<<< import org.junit.Ignore; import org.junit.Test; ======= import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; import org.reactivestreams.Processor; >>>>>>> import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; <<<<<<< import static org.assertj.core.api.Assertions.assertThat; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThat; <<<<<<< ======= //simplifies fluxFromXXXCallsAssemblyHook tests below @AfterEach public void resetHooks() { Hooks.resetOnEachOperator(); Hooks.resetOnLastOperator(); } >>>>>>> <<<<<<< ======= @Test @Disabled public void testDiamond() throws InterruptedException, IOException { Flux<Point> points = Flux.<Double, Random>generate(Random::new, (r, sub) -> { sub.next(r.nextDouble()); return r; }).log("points") .buffer(2) .map(pairs -> new Point(pairs.get(0), pairs.get(1))) .subscribeWith(TopicProcessor.<Point>builder().name("tee").bufferSize(32).build()); Flux<InnerSample> innerSamples = points.log("inner-1") .filter(Point::isInner) .map(InnerSample::new) .log("inner-2"); Flux<OuterSample> outerSamples = points.log("outer-1") .filter(p -> !p.isInner()) .map(OuterSample::new) .log("outer-2"); Flux.merge(innerSamples, outerSamples) .publishOn(asyncGroup) .scan(new SimulationState(0l, 0l), SimulationState::withNextSample) .log("result") .map(s -> System.out.printf("After %8d samples π is approximated as %.5f", s.totalSamples, s.pi())) .take(10000) .subscribe(); System.in.read(); } >>>>>>> <<<<<<< ======= * Should work with {@link Processor} but it doesn't. * @throws Exception for convenience */ //@Test public void multiplexUsingProcessors1000() throws Exception { for (int i = 0; i < 1000; i++) { System.out.println("new test " + i); multiplexUsingProcessors(); System.out.println(); } } @Test @Timeout(10) public void multiplexUsingProcessors() throws Exception { final Flux<Integer> forkStream = Flux.just(1, 2, 3) .log("begin-computation"); final Flux<Integer> forkStream2 = Flux.just(1, 2, 3) .log("begin-persistence"); final TopicProcessor<Integer> computationEmitterProcessor = TopicProcessor.<Integer>builder() .name("computation") .bufferSize(BACKLOG) .build(); final Flux<String> computationStream = computationEmitterProcessor .map(i -> Integer.toString(i)); final TopicProcessor<Integer> persistenceEmitterProcessor = TopicProcessor.<Integer>builder() .name("persistence") .bufferSize(BACKLOG) .build(); final Flux<String> persistenceStream = persistenceEmitterProcessor .map(i -> "done " + i); forkStream.subscribe(computationEmitterProcessor); forkStream2.subscribe(persistenceEmitterProcessor); final Semaphore doneSemaphore = new Semaphore(0); final Flux<List<String>> joinStream = Flux.zip(computationStream.log("log1"), persistenceStream.log("log2"), (a, b) -> Arrays.asList(a,b)); // Method chaining doesn't compile. joinStream.log("log-final") .subscribe(list -> println("Joined: ", list), t -> println("Join failed: ", t.getMessage()), () -> { println("Join complete."); doneSemaphore.release(); }); doneSemaphore.acquire(); } /** >>>>>>>
<<<<<<< @Test(timeout = TIMEOUT) public void multiplexUsingDispatchersAndSplit() { final Sinks.Many<Integer> forkEmitterProcessor = Sinks.many().multicast().onBackpressureBuffer(); final Sinks.Many<Integer> computationEmitterProcessor = Sinks.unsafe() .many() .multicast() .onBackpressureBuffer(256, false); ======= @Test @Timeout(10) public void multiplexUsingDispatchersAndSplit() throws Exception { final EmitterProcessor<Integer> forkEmitterProcessor = EmitterProcessor.create(); final EmitterProcessor<Integer> computationEmitterProcessor = EmitterProcessor.create(false); >>>>>>> @Test @Timeout(10) public void multiplexUsingDispatchersAndSplit() { final Sinks.Many<Integer> forkEmitterProcessor = Sinks.many().multicast().onBackpressureBuffer(); final Sinks.Many<Integer> computationEmitterProcessor = Sinks.unsafe() .many() .multicast() .onBackpressureBuffer(256, false);
<<<<<<< import org.eclipse.persistence.annotations.CascadeOnDelete; ======= import org.slf4j.Logger; import org.slf4j.LoggerFactory; >>>>>>> import org.eclipse.persistence.annotations.CascadeOnDelete; import org.slf4j.Logger; import org.slf4j.LoggerFactory; <<<<<<< import javax.persistence.FetchType; ======= import javax.persistence.EntityManager; >>>>>>> import javax.persistence.EntityManager; import javax.persistence.FetchType; <<<<<<< import javax.persistence.OneToMany; ======= import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; >>>>>>> import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.OneToMany;
<<<<<<< RaceTestUtils.race(r, r, Schedulers.boundedElastic()); ======= RaceTestUtils.race(Schedulers.elastic(), r, r); >>>>>>> RaceTestUtils.race(r, r); <<<<<<< RaceTestUtils.race(r, r, Schedulers.boundedElastic()); ======= RaceTestUtils.race(Schedulers.elastic(), r, r); >>>>>>> RaceTestUtils.race(r, r); <<<<<<< RaceTestUtils.race(r, r, Schedulers.boundedElastic()); ======= RaceTestUtils.race(Schedulers.elastic(), r, r); >>>>>>> RaceTestUtils.race(r, r);
<<<<<<< @Override public Object scanUnsafe(Attr key) { if (key == Attr.RUN_STYLE) return Attr.RunStyle.SYNC; return super.scanUnsafe(key); } static final class SingleSubscriber<T> extends Operators.MonoSubscriber<T, T> { ======= static final class SingleSubscriber<T> extends Operators.MonoInnerProducerBase<T> implements InnerConsumer<T> { >>>>>>> @Override public Object scanUnsafe(Attr key) { if (key == Attr.RUN_STYLE) return Attr.RunStyle.SYNC; return super.scanUnsafe(key); } static final class SingleSubscriber<T> extends Operators.MonoInnerProducerBase<T> implements InnerConsumer<T> {
<<<<<<< import org.junit.Test; ======= import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; <<<<<<< import static org.awaitility.Awaitility.await; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.awaitility.Awaitility.await;
<<<<<<< import org.junit.Test; ======= import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test;
<<<<<<< import static org.assertj.core.api.Assertions.assertThat; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThat;
<<<<<<< import org.junit.Test; ======= import org.junit.Assert; import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test;
<<<<<<< import org.junit.Test; ======= import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; <<<<<<< import static org.assertj.core.api.Assertions.assertThat; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.junit.jupiter.api.Assertions.assertThrows; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThat;
<<<<<<< import org.assertj.core.api.Assertions; import org.junit.AfterClass; ======= import org.junit.jupiter.api.AfterAll; >>>>>>> import org.junit.jupiter.api.AfterAll; <<<<<<< import static org.assertj.core.api.Assertions.assertThatIllegalStateException; import static org.assertj.core.api.AssertionsForClassTypes.*; ======= import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatCode; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatCode; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatIllegalStateException; import static org.assertj.core.api.AssertionsForClassTypes.*; <<<<<<< @Test public void blockingLastTimeout() { assertThatIllegalStateException().isThrownBy(() -> Flux.just(1).delayElements(Duration.ofMillis(100)) .blockLast(Duration.ofNanos(50))) .withMessage("Timeout on blocking read for 50 NANOSECONDS"); } @Test(expected = RuntimeException.class) ======= @Test >>>>>>> @Test public void blockingLastTimeout() { assertThatIllegalStateException().isThrownBy(() -> Flux.just(1).delayElements(Duration.ofMillis(100)) .blockLast(Duration.ofNanos(50))) .withMessage("Timeout on blocking read for 50 NANOSECONDS"); } @Test
<<<<<<< import org.junit.Test; import org.reactivestreams.Subscription; import reactor.core.CoreSubscriber; import reactor.core.Scannable; ======= import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; import org.reactivestreams.Subscription; import reactor.core.CoreSubscriber; import reactor.core.Scannable; <<<<<<< import static org.assertj.core.api.Assertions.assertThat; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThat;
<<<<<<< import static reactor.core.publisher.Sinks.EmitFailureHandler.FAIL_FAST; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static reactor.core.publisher.Sinks.EmitFailureHandler.FAIL_FAST;
<<<<<<< * Return the user provided context that was set at construction time. * * @return the user provided context that will be accessible via {@link RetrySignal#retryContextView()}. */ public ContextView retryContext() { return retryContext; } /** * State for a {@link Flux#retryWhen(Retry)} Flux retry} or {@link reactor.core.publisher.Mono#retryWhen(Retry) Mono retry}. * A flux of states is passed to the user, which gives information about the {@link #failure()} that potentially triggers * a retry as well as two indexes: the number of errors that happened so far (and were retried) and the same number, * but only taking into account <strong>subsequent</strong> errors (see {@link #totalRetriesInARow()}). ======= * State used in {@link Flux#retryWhen(Retry)} and {@link reactor.core.publisher.Mono#retryWhen(Retry)}, * providing the {@link Throwable} that caused the source to fail as well as counters keeping track of retries. >>>>>>> * Return the user provided context that was set at construction time. * * @return the user provided context that will be accessible via {@link RetrySignal#retryContextView()}. */ public ContextView retryContext() { return retryContext; } /** * State used in {@link Flux#retryWhen(Retry)} and {@link reactor.core.publisher.Mono#retryWhen(Retry)}, * providing the {@link Throwable} that caused the source to fail as well as counters keeping track of retries. <<<<<<< * Return a read-only view of the user provided context, which may be used to store * objects to be reset/rollbacked or otherwise mutated before or after a retry. * * @return a read-only view of a user provided context. */ default ContextView retryContextView() { return Context.empty(); } /** * Return an immutable copy of this {@link RetrySignal} which is guaranteed to give a consistent view ======= * An immutable copy of this {@link RetrySignal} which is guaranteed to give a consistent view >>>>>>> * Return a read-only view of the user provided context, which may be used to store * objects to be reset/rolled-back or otherwise mutated before or after a retry. * * @return a read-only view of a user provided context. */ default ContextView retryContextView() { return Context.empty(); } /** * An immutable copy of this {@link RetrySignal} which is guaranteed to give a consistent view
<<<<<<< import org.junit.Test; import reactor.core.Scannable; ======= import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; import reactor.core.Scannable;
<<<<<<< import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; ======= import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; >>>>>>> import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; <<<<<<< import java.util.stream.Collectors; ======= import java.util.stream.StreamSupport; >>>>>>> import java.util.stream.Collectors; <<<<<<< import reactor.test.MemoryUtils; ======= import reactor.core.scheduler.Schedulers; >>>>>>> import reactor.core.scheduler.Schedulers; import reactor.test.MemoryUtils; <<<<<<< import reactor.test.publisher.TestPublisher; ======= import reactor.test.publisher.TestPublisher; import reactor.test.util.RaceTestUtils; >>>>>>> import reactor.test.publisher.TestPublisher; import reactor.test.util.RaceTestUtils;
<<<<<<< import org.junit.Test; import org.mockito.Mockito; import org.reactivestreams.Subscription; ======= import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.reactivestreams.Subscription;
<<<<<<< * <ul> * <li>{@link #parallel()}: Optimized for fast {@link Runnable} non-blocking executions </li> * <li>{@link #single}: Optimized for low-latency {@link Runnable} one-off executions </li> * <li>{@link #elastic()}: Optimized for longer executions, an alternative for blocking tasks where the number of active tasks (and threads) can grow indefinitely</li> * <li>{@link #boundedElastic()}: Optimized for longer executions, an alternative for blocking tasks where the number of active tasks (and threads) is capped</li> * <li>{@link #immediate}: to run a task on the caller {@link Thread}</li> * <li>{@link #fromExecutorService(ExecutorService)} to create new instances around {@link java.util.concurrent.Executors} </li> * </ul> ======= * <ul> * <li>{@link #parallel()}: Optimized for fast {@link Runnable} non-blocking executions </li> * <li>{@link #single}: Optimized for low-latency {@link Runnable} one-off executions </li> * <li>{@link #elastic()}: Optimized for longer executions, an alternative for blocking tasks where the number of active tasks (and threads) can grow indefinitely</li> * <li>{@link #immediate}: to immediately run submitted {@link Runnable} instead of scheduling them (somewhat of a no-op or "null object" {@link Scheduler})</li> * <li>{@link #fromExecutorService(ExecutorService)} to create new instances around {@link java.util.concurrent.Executors} </li> * </ul> >>>>>>> * <ul> * <li>{@link #parallel()}: Optimized for fast {@link Runnable} non-blocking executions </li> * <li>{@link #single}: Optimized for low-latency {@link Runnable} one-off executions </li> * <li>{@link #elastic()}: Optimized for longer executions, an alternative for blocking tasks where the number of active tasks (and threads) can grow indefinitely</li> * <li>{@link #boundedElastic()}: Optimized for longer executions, an alternative for blocking tasks where the number of active tasks (and threads) is capped</li> * <li>{@link #immediate}: to immediately run submitted {@link Runnable} instead of scheduling them (somewhat of a no-op or "null object" {@link Scheduler})</li> * <li>{@link #fromExecutorService(ExecutorService)} to create new instances around {@link java.util.concurrent.Executors} </li> * </ul>
<<<<<<< import static reactor.core.publisher.Sinks.EmitFailureHandler.FAIL_FAST; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static reactor.core.publisher.Sinks.EmitFailureHandler.FAIL_FAST;
<<<<<<< import org.junit.Ignore; import org.junit.Test; ======= import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; <<<<<<< import static reactor.core.publisher.Sinks.EmitFailureHandler.FAIL_FAST; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static reactor.core.publisher.Sinks.EmitFailureHandler.FAIL_FAST;
<<<<<<< @Reference(name = "UserDetailsService") ======= /** concurrent attemtps saved in a cache */ private LoadingCache<String, Object> userDetailsCache; /** A token to store in the miss cache */ private Object nullToken = null; >>>>>>> /** concurrent attemtps saved in a cache */ private LoadingCache<String, Object> userDetailsCache; /** A token to store in the miss cache */ private Object nullToken = null; @Reference(name = "UserDetailsService")
<<<<<<< import static reactor.core.publisher.Sinks.EmitFailureHandler.FAIL_FAST; ======= import static org.assertj.core.api.Assertions.assertThatExceptionOfType; >>>>>>> import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static reactor.core.publisher.Sinks.EmitFailureHandler.FAIL_FAST;
<<<<<<< import org.assertj.core.api.Assertions; import org.junit.Test; ======= import org.junit.jupiter.api.Test; >>>>>>> import org.junit.jupiter.api.Test; import org.assertj.core.api.Assertions;
<<<<<<< import org.hawkular.metrics.core.api.Gauge; import org.hawkular.metrics.core.api.GaugeData; ======= import org.hawkular.metrics.core.api.DataPoint; import org.hawkular.metrics.core.api.Metric; >>>>>>> import org.hawkular.metrics.core.api.DataPoint; import org.hawkular.metrics.core.api.Metric; <<<<<<< private void listSeries(AsyncResponse asyncResponse, String tenantId, ListSeriesContext listSeriesContext) { ListSeriesDefinitionsParser definitionsParser = new ListSeriesDefinitionsParser(); parseTreeWalker.walk(definitionsParser, listSeriesContext); RegularExpression regularExpression = definitionsParser.getRegularExpression(); final Pattern pattern; if (regularExpression != null) { int flag = regularExpression.isCaseSensitive() ? 0 : Pattern.CASE_INSENSITIVE; try { pattern = Pattern.compile(regularExpression.getExpression(), flag); } catch (Exception e) { asyncResponse.resume(errorResponse(BAD_REQUEST, Throwables.getRootCause(e).getMessage())); return; } } else { pattern = null; } metricsService.findMetrics(tenantId, MetricType.GAUGE) .map(metric -> metric.getId().getName()) .filter(name -> pattern == null || pattern.matcher(name).find()) ======= private void listSeries(AsyncResponse asyncResponse, String tenantId) { metricsService.findMetrics(tenantId, GAUGE) >>>>>>> private void listSeries(AsyncResponse asyncResponse, String tenantId, ListSeriesContext listSeriesContext) { ListSeriesDefinitionsParser definitionsParser = new ListSeriesDefinitionsParser(); parseTreeWalker.walk(definitionsParser, listSeriesContext); RegularExpression regularExpression = definitionsParser.getRegularExpression(); final Pattern pattern; if (regularExpression != null) { int flag = regularExpression.isCaseSensitive() ? 0 : Pattern.CASE_INSENSITIVE; try { pattern = Pattern.compile(regularExpression.getExpression(), flag); } catch (Exception e) { asyncResponse.resume(errorResponse(BAD_REQUEST, Throwables.getRootCause(e).getMessage())); return; } } else { pattern = null; } metricsService.findMetrics(tenantId, GAUGE) .map(metric -> metric.getId().getName()) .filter(name -> pattern == null || pattern.matcher(name).find()) <<<<<<< private static List<InfluxObject> metricsListToListSeries(List<String> metrics) { ======= private static List<InfluxObject> metricsListToListSeries(List<Metric> metrics) { >>>>>>> private static List<InfluxObject> metricsListToListSeries(List<String> metrics) {
<<<<<<< import com.shootoff.camera.AutoCalibration.AutoCalibrationManager; import com.shootoff.camera.ShotDetection.ShotDetectionManager; ======= import com.shootoff.camera.shotdetection.ShotDetectionManager; >>>>>>> import com.shootoff.camera.shotdetection.ShotDetectionManager;import com.shootoff.camera.AutoCalibration.AutoCalibrationManager; <<<<<<< private AutoCalibrationManager acm = null; private boolean autoCalibrationEnabled = false; public boolean cameraAutoCalibrated = false; private ShootOFFController controller; public int getFrameCount() { return frameCount; } public void setFrameCount(int i) { frameCount = i; } public double getFPS() { return webcamFPS; } ======= >>>>>>> private AutoCalibrationManager acm = null; private boolean autoCalibrationEnabled = false; public boolean cameraAutoCalibrated = false; private ShootOFFController controller; public int getFrameCount() { return frameCount; } <<<<<<< ======= >>>>>>> <<<<<<< } Pair<Boolean, BufferedImage> pFramePair = processFrame(currentFrame); ======= } >>>>>>> } Pair<Boolean, BufferedImage> pFramePair = processFrame(currentFrame); <<<<<<< incFrameCount(); ======= frameCount++; logger.trace("processFrame {}", getFrameCount()); >>>>>>> frameCount++; <<<<<<< ======= if (debuggerListener.isPresent()) { debuggerListener.get().updateFeedData(webcamFPS, Optional.empty()); } >>>>>>> if (debuggerListener.isPresent()) { debuggerListener.get().updateFeedData(webcamFPS, Optional.empty()); } <<<<<<< public void enableAutoCalibration() { acm = new AutoCalibrationManager(); autoCalibrationEnabled = true; cameraAutoCalibrated = false; } public void setController(ShootOFFController controller) { this.controller = controller; } ======= >>>>>>> public void enableAutoCalibration() { acm = new AutoCalibrationManager(); autoCalibrationEnabled = true; cameraAutoCalibrated = false; } public void setController(ShootOFFController controller) { this.controller = controller; }
<<<<<<< ======= private static final DeduplicationProcessor deduplicationProcessor = new DeduplicationProcessor(); >>>>>>> <<<<<<< ======= this.shotDetectionManager = new ShotDetectionManager(this, config, canvas); >>>>>>> <<<<<<< ======= this.shotDetectionManager = new ShotDetectionManager(this, config, canvas); >>>>>>> <<<<<<< this.shotDetectionManager = new ShotDetectionManager(this, config, canvas); IMediaReader reader = ToolFactory.makeReader(videoFile.getAbsolutePath()); reader.setBufferedImageTypeToGenerate(BufferedImage.TYPE_3BYTE_BGR); reader.addListener(detector); logger.debug("opening {}", videoFile.getAbsolutePath()); setSectorStatuses(sectorStatuses); while (reader.readPacket() == null) do {} while (false); ======= IMediaReader reader = ToolFactory.makeReader(videoFile.getAbsolutePath()); reader.setBufferedImageTypeToGenerate(BufferedImage.TYPE_3BYTE_BGR); reader.addListener(detector); logger.debug("opening {}", videoFile.getAbsolutePath()); setSectorStatuses(sectorStatuses); while (reader.readPacket() == null) do {} while (false); >>>>>>> this.shotDetectionManager = new ShotDetectionManager(this, config, canvas); IMediaReader reader = ToolFactory.makeReader(videoFile.getAbsolutePath()); reader.setBufferedImageTypeToGenerate(BufferedImage.TYPE_3BYTE_BGR); reader.addListener(detector); logger.debug("opening {}", videoFile.getAbsolutePath()); setSectorStatuses(sectorStatuses); while (reader.readPacket() == null) do {} while (false); <<<<<<< rollingRecorder = new RollingRecorder(ICodec.ID.CODEC_ID_MPEG4, ".mp4", sessionName, cameraName, this); ======= rollingRecorder = new RollingRecorder(ICodec.ID.CODEC_ID_MPEG4, ".mp4", sessionName, cameraName); >>>>>>> rollingRecorder = new RollingRecorder(ICodec.ID.CODEC_ID_MPEG4, ".mp4", sessionName, cameraName, this); <<<<<<< ======= public boolean isRecordingShots() { return recordingShots; } >>>>>>> <<<<<<< logger.debug("autoCalibrateSuccess {} {} {} {}", (int) bounds.getMinX(), (int) bounds.getMinY(), (int) bounds.getWidth(), (int) bounds.getHeight()); Platform.runLater(() -> { controller.calibrate(bounds, false); }); ======= logger.debug("autoCalibrateSuccess {} {} {} {}", (int) bounds.getMinX(), (int) bounds.getMinY(), (int) bounds.getWidth(), (int) bounds.getHeight()); Platform.runLater(() -> { controller.calibrate(bounds); }); >>>>>>> logger.debug("autoCalibrateSuccess {} {} {} {}", (int) bounds.getMinX(), (int) bounds.getMinY(), (int) bounds.getWidth(), (int) bounds.getHeight()); Platform.runLater(() -> { controller.calibrate(bounds, false); }); <<<<<<< private final static int brightnessDiagnosticLengthMS = 1000; private volatile boolean showingBrightnessWarning = false; ======= >>>>>>> <<<<<<< if (!showingBrightnessWarning) { showingBrightnessWarning = true; ======= if (!TimerPool.isWaiting(brightnessDiagnosticFuture)) { >>>>>>> if (!TimerPool.isWaiting(brightnessDiagnosticFuture)) { <<<<<<< brightnessDiagnosticTimer = new Timer("Brightness Diagnostic"); brightnessDiagnosticTimer.schedule(new TimerTask() { public void run() { Platform.runLater(new Runnable() { public void run() { if (brightnessDiagnosticWarning != null) { canvasManager.removeDiagnosticMessage(brightnessDiagnosticWarning); brightnessDiagnosticWarning = null; } showingBrightnessWarning = false; } }); } }, brightnessDiagnosticLengthMS); if (!webcam.isPresent() || shownBrightnessWarning) return; ======= brightnessDiagnosticFuture = TimerPool.schedule(() -> { Platform.runLater(() -> { if (brightnessDiagnosticWarning != null) { canvasManager.removeDiagnosticMessage(brightnessDiagnosticWarning); brightnessDiagnosticWarning = null; } }); } , DIAGNOSTIC_MESSAGE_DURATION); if (!webcam.isPresent() || shownBrightnessWarning) return; >>>>>>> brightnessDiagnosticFuture = TimerPool.schedule(() -> { Platform.runLater(() -> { if (brightnessDiagnosticWarning != null) { canvasManager.removeDiagnosticMessage(brightnessDiagnosticWarning); brightnessDiagnosticWarning = null; } }); } , DIAGNOSTIC_MESSAGE_DURATION); if (!webcam.isPresent() || shownBrightnessWarning) return; <<<<<<< private final static int motionDiagnosticLengthMS = 1000; private volatile boolean showingMotionDiagnosticWarning = false; ======= >>>>>>> <<<<<<< if (!showingMotionDiagnosticWarning) { showingMotionDiagnosticWarning = true; ======= if (!TimerPool.isWaiting(motionDiagnosticFuture)) { >>>>>>> if (!TimerPool.isWaiting(motionDiagnosticFuture)) { <<<<<<< acm = new AutoCalibrationManager(this); autoCalibrationEnabled = true; ======= acm = new AutoCalibrationManager(); autoCalibrationEnabled = true; >>>>>>> acm = new AutoCalibrationManager(this); autoCalibrationEnabled = true;
<<<<<<< ======= @FXML private GridPane buttonsGridPane; >>>>>>> @FXML private GridPane buttonsGridPane; <<<<<<< if (autoCalibrationTimer != null) { autoCalibrationTimer.cancel(); autoCalibrationTimer = null; } if (disableShotDetectionTimer != null) { disableShotDetectionTimer.cancel(); disableShotDetectionTimer = null; } ======= >>>>>>> <<<<<<< ======= TimerPool.close(); >>>>>>> TimerPool.close(); <<<<<<< @Override public void onChanged(Change<? extends ShotEntry> change) { while (change.next()) { for (ShotEntry unselected : change.getRemoved()) { unselected.getShot().getMarker().setFill(unselected.getShot().getColor()); } for (ShotEntry selected : change.getAddedSubList()) { selected.getShot().getMarker().setFill(TargetRegion.SELECTED_STROKE_COLOR); // Move all selected shots to top the of their // z-stack to ensure visibility for (CanvasManager cm : camerasSupervisor.getCanvasManagers()) { Shape marker = selected.getShot().getMarker(); if (cm.getCanvasGroup().getChildren() .indexOf(marker) < cm.getCanvasGroup().getChildren().size() - 1) { cm.getCanvasGroup().getChildren().remove(marker); cm.getCanvasGroup().getChildren().add(cm.getCanvasGroup().getChildren().size(), marker); } } } } } }); ======= @Override public void onChanged(Change<? extends ShotEntry> change) { while (change.next()) { for (ShotEntry unselected : change.getRemoved()) { unselected.getShot().getMarker().setFill(unselected.getShot().getColor()); } for (ShotEntry selected : change.getAddedSubList()) { selected.getShot().getMarker().setFill(TargetRegion.SELECTED_STROKE_COLOR); // Move all selected shots to top the of their z-stack // to ensure visibility for (CanvasManager cm : camerasSupervisor.getCanvasManagers()) { Shape marker = selected.getShot().getMarker(); if (cm.getCanvasGroup().getChildren() .indexOf(marker) < cm.getCanvasGroup().getChildren().size() - 1) { cm.getCanvasGroup().getChildren().remove(marker); cm.getCanvasGroup().getChildren().add(cm.getCanvasGroup().getChildren().size(), marker); } } } } } }); >>>>>>> @Override public void onChanged(Change<? extends ShotEntry> change) { while (change.next()) { for (ShotEntry unselected : change.getRemoved()) { unselected.getShot().getMarker().setFill(unselected.getShot().getColor()); } for (ShotEntry selected : change.getAddedSubList()) { selected.getShot().getMarker().setFill(TargetRegion.SELECTED_STROKE_COLOR); // Move all selected shots to top the of their z-stack // to ensure visibility for (CanvasManager cm : camerasSupervisor.getCanvasManagers()) { Shape marker = selected.getShot().getMarker(); if (cm.getCanvasGroup().getChildren() .indexOf(marker) < cm.getCanvasGroup().getChildren().size() - 1) { cm.getCanvasGroup().getChildren().remove(marker); cm.getCanvasGroup().getChildren().add(cm.getCanvasGroup().getChildren().size(), marker); } } } } } }); <<<<<<< ======= public GridPane getButtonsPane() { return buttonsGridPane; } public TableView<ShotEntry> getShotEntryTable() { return shotTimerTable; } >>>>>>> public GridPane getButtonsPane() { return buttonsGridPane; } public TableView<ShotEntry> getShotEntryTable() { return shotTimerTable; } <<<<<<< TrainingExercise newExercise = (TrainingExercise) ctor.newInstance(knownTargets); ((TrainingExerciseBase) newExercise).init(config, camerasSupervisor, shotTimerTable); newExercise.init(); config.setExercise(newExercise); } catch (Exception ex) { ex.printStackTrace(); } }); ======= TrainingExercise newExercise = (TrainingExercise) ctor.newInstance(knownTargets); ((TrainingExerciseBase) newExercise).init(config, camerasSupervisor, this); newExercise.init(); config.setExercise(newExercise); } catch (Exception ex) { ex.printStackTrace(); } }); >>>>>>> TrainingExercise newExercise = (TrainingExercise) ctor.newInstance(knownTargets); ((TrainingExerciseBase) newExercise).init(config, camerasSupervisor, this); newExercise.init(); config.setExercise(newExercise); } catch (Exception ex) { ex.printStackTrace(); } }); <<<<<<< try { Constructor<?> ctor = exercise.getClass().getConstructor(List.class); TrainingExercise newExercise = (TrainingExercise) ctor .newInstance(arenaController.getCanvasManager().getTargetGroups()); ((ProjectorTrainingExerciseBase) newExercise).init(config, camerasSupervisor, shotTimerTable, arenaController); newExercise.init(); config.setExercise(newExercise); } catch (Exception ex) { ex.printStackTrace(); } }); ======= try { Constructor<?> ctor = exercise.getClass().getConstructor(List.class); TrainingExercise newExercise = (TrainingExercise) ctor .newInstance(arenaController.getCanvasManager().getTargetGroups()); ((ProjectorTrainingExerciseBase) newExercise).init(config, camerasSupervisor, this, arenaController); newExercise.init(); config.setExercise(newExercise); } catch (Exception ex) { ex.printStackTrace(); } }); >>>>>>> try { Constructor<?> ctor = exercise.getClass().getConstructor(List.class); TrainingExercise newExercise = (TrainingExercise) ctor .newInstance(arenaController.getCanvasManager().getTargetGroups()); ((ProjectorTrainingExerciseBase) newExercise).init(config, camerasSupervisor, this, arenaController); newExercise.init(); config.setExercise(newExercise); } catch (Exception ex) { ex.printStackTrace(); } }); <<<<<<< arenaStage.setTitle("Projector Arena"); arenaStage.setScene(new Scene(loader.getRoot())); arenaController = (ProjectorArenaController) loader.getController(); arenaController.init(this, config, camerasSupervisor); arenaController.getCanvasManager().setShowShots(false); arenaStage.setOnCloseRequest((e) -> { if (config.getExercise().isPresent() && config.getExercise().get() instanceof ProjectorTrainingExerciseBase) { noneTrainingMenuItem.setSelected(true); noneTrainingMenuItem.fire(); } toggleArenaShotsMenuItem.setText("Show Shot Markers"); if (isCalibrating) { stopCalibration(); } toggleProjectorMenus(true); startArenaMenuItem.setDisable(false); arenaCameraManager.setProjectionBounds(null); // We can't remove this until stopCalibration's // runlaters finish Platform.runLater(() -> { arenaCameraManager = null; arenaController.setFeedCanvasManager(null); arenaController = null; }); }); ======= arenaStage.setTitle("Projector Arena"); arenaStage.setScene(new Scene(loader.getRoot())); arenaController = (ProjectorArenaController) loader.getController(); arenaController.init(this, config, camerasSupervisor); arenaController.getCanvasManager().setShowShots(false); arenaStage.setOnCloseRequest((e) -> { if (config.getExercise().isPresent() && config.getExercise().get() instanceof ProjectorTrainingExerciseBase) { noneTrainingMenuItem.setSelected(true); noneTrainingMenuItem.fire(); } toggleArenaShotsMenuItem.setText("Show Shot Markers"); if (isCalibrating) { stopCalibration(); } toggleProjectorMenus(true); startArenaMenuItem.setDisable(false); arenaCameraManager.setProjectionBounds(null); // We can't remove this until stopCalibration's runlaters finish Platform.runLater(() -> { arenaCameraManager = null; arenaController.setFeedCanvasManager(null); arenaController = null; }); }); >>>>>>> arenaStage.setTitle("Projector Arena"); arenaStage.setScene(new Scene(loader.getRoot())); arenaController = (ProjectorArenaController) loader.getController(); arenaController.init(this, config, camerasSupervisor); arenaController.getCanvasManager().setShowShots(false); arenaStage.setOnCloseRequest((e) -> { if (config.getExercise().isPresent() && config.getExercise().get() instanceof ProjectorTrainingExerciseBase) { noneTrainingMenuItem.setSelected(true); noneTrainingMenuItem.fire(); } toggleArenaShotsMenuItem.setText("Show Shot Markers"); if (isCalibrating) { stopCalibration(); } toggleProjectorMenus(true); startArenaMenuItem.setDisable(false); arenaCameraManager.setProjectionBounds(null); // We can't remove this until stopCalibration's runlaters finish Platform.runLater(() -> { arenaCameraManager = null; arenaController.setFeedCanvasManager(null); arenaController = null; }); }); <<<<<<< private Timer autoCalibrationTimer = null; private final static int autoCalibrationTime = 10 * 1000; private void enableAutoCalibration() { ======= private ScheduledFuture<?> autoCalibrationFuture = null; private final static int AUTO_CALIBRATION_TIME = 10 * 1000; private void enableAutoCalibration() { >>>>>>> private ScheduledFuture<?> autoCalibrationFuture = null; private final static int AUTO_CALIBRATION_TIME = 10 * 1000; private void enableAutoCalibration() { <<<<<<< arenaCameraManager.enableAutoCalibration(); showAutoCalibrationMessage(); cancelAutoCalibrationTimer(); autoCalibrationTimer = new Timer("Auto Calibration"); autoCalibrationTimer.schedule(new TimerTask() { public void run() { Platform.runLater(new Runnable() { public void run() { if (isCalibrating) { arenaCameraManager.disableAutoCalibration(); enableManualCalibration(); } } }); } }, autoCalibrationTime); } private void cancelAutoCalibrationTimer() { if (autoCalibrationTimer != null) autoCalibrationTimer.cancel(); autoCalibrationTimer = null; ======= arenaCameraManager.enableAutoCalibration(); showAutoCalibrationMessage(); TimerPool.cancelTimer(autoCalibrationFuture); autoCalibrationFuture = TimerPool.schedule(() -> { Platform.runLater(() -> { if (isCalibrating) { arenaCameraManager.disableAutoCalibration(); enableManualCalibration(); } }); } , AUTO_CALIBRATION_TIME); >>>>>>> arenaCameraManager.enableAutoCalibration(); showAutoCalibrationMessage(); TimerPool.cancelTimer(autoCalibrationFuture); autoCalibrationFuture = TimerPool.schedule(() -> { Platform.runLater(() -> { if (isCalibrating) { arenaCameraManager.disableAutoCalibration(); enableManualCalibration(); } }); } , AUTO_CALIBRATION_TIME); <<<<<<< public void calibrate(Bounds bounds, boolean calibratedFromCanvas) { ======= public void calibrate(Bounds bounds) { >>>>>>> public void calibrate(Bounds bounds, boolean calibratedFromCanvas) { <<<<<<< configureArenaCamera(getSelectedCalibrationOption(), bounds, calibratedFromCanvas); ======= configureArenaCamera(getSelectedCalibrationOption(), bounds); >>>>>>> configureArenaCamera(getSelectedCalibrationOption(), bounds, calibratedFromCanvas); <<<<<<< cancelAutoCalibrationTimer(); ======= TimerPool.cancelTimer(autoCalibrationFuture); >>>>>>> TimerPool.cancelTimer(autoCalibrationFuture); <<<<<<< private void configureArenaCamera(CalibrationOption option, Bounds bounds, boolean calibratedFromCanvas) { Bounds translatedToCanvasBounds; if (bounds != null && !calibratedFromCanvas) translatedToCanvasBounds = arenaCameraManager.getCanvasManager().translateCameraToCanvas(bounds); else translatedToCanvasBounds = bounds; Bounds translatedToCameraBounds; if (bounds != null && calibratedFromCanvas) translatedToCameraBounds = arenaCameraManager.getCanvasManager().translateCanvasToCamera(bounds); else translatedToCameraBounds = bounds; arenaCameraManager.getCanvasManager().setProjectorArena(arenaController, translatedToCanvasBounds); ======= private void configureArenaCamera(CalibrationOption option, Bounds bounds) { arenaCameraManager.getCanvasManager().setProjectorArena(arenaController, bounds); >>>>>>> private void configureArenaCamera(CalibrationOption option, Bounds bounds, boolean calibratedFromCanvas) { Bounds translatedToCanvasBounds; if (bounds != null && !calibratedFromCanvas) translatedToCanvasBounds = arenaCameraManager.getCanvasManager().translateCameraToCanvas(bounds); else translatedToCanvasBounds = bounds; Bounds translatedToCameraBounds; if (bounds != null && calibratedFromCanvas) translatedToCameraBounds = arenaCameraManager.getCanvasManager().translateCanvasToCamera(bounds); else translatedToCameraBounds = bounds; arenaCameraManager.getCanvasManager().setProjectorArena(arenaController, translatedToCanvasBounds); <<<<<<< private Timer disableShotDetectionTimer = null; private volatile boolean disableShotDetectionTimerEnabled = false; ======= >>>>>>> <<<<<<< public void disableShotDetectionForPeriod(int msPeriod) { if (disableShotDetectionTimerEnabled) { disableShotDetectionTimer.cancel(); } disableShotDetectionTimerEnabled = true; ======= public void disableShotDetectionForPeriod(int msPeriod) { // Don't disable the cameras if they are already disabled (e.g. because // a training protocol paused shot detection) if (!camerasSupervisor.areDetecting()) return; >>>>>>> public void disableShotDetectionForPeriod(int msPeriod) { // Don't disable the cameras if they are already disabled (e.g. because // a training protocol paused shot detection) if (!camerasSupervisor.areDetecting()) return; <<<<<<< disableShotDetectionTimer = new Timer("Disable Shot Detect"); disableShotDetectionTimer.schedule(new TimerTask() { public void run() { Platform.runLater(new Runnable() { public void run() { if (!isCalibrating) { camerasSupervisor.setDetectingAll(true); } else { logger.info( "disableShotDetectionTimer did not re-enable shot detection, isCalibrating is true"); } disableShotDetectionTimerEnabled = false; } }); } }, msPeriod); ======= Runnable restartDetection = () -> { if (!isCalibrating) { camerasSupervisor.setDetectingAll(true); } else { logger.info("disableShotDetectionTimer did not re-enable shot detection, isCalibrating is true"); } }; TimerPool.schedule(restartDetection, msPeriod); >>>>>>> Runnable restartDetection = () -> { if (!isCalibrating) { camerasSupervisor.setDetectingAll(true); } else { logger.info("disableShotDetectionTimer did not re-enable shot detection, isCalibrating is true"); } }; TimerPool.schedule(restartDetection, msPeriod);
<<<<<<< protected long lastCameraTimestamp = -1; protected long lastFrameCount = 0; ======= private long lastCameraTimestamp = -1; private long lastFrameCount = 0; >>>>>>> private long lastCameraTimestamp = -1; private long lastFrameCount = 0; <<<<<<< private final Optional<CameraErrorView> cameraErrorView; ======= >>>>>>> private final Optional<CameraErrorView> cameraErrorView; <<<<<<< private CalibrationManager calibrationManager; ======= public ShootOFFController getController() { return controller; } >>>>>>> private CalibrationManager calibrationManager; <<<<<<< ======= private void showMissingCameraError() { Platform.runLater(() -> { Alert cameraAlert = new Alert(AlertType.ERROR); Optional<String> cameraName = config.getWebcamsUserName(webcam.get()); String messageFormat = "ShootOFF can no longer communicate with the webcam %s. Was it unplugged?"; String message; if (cameraName.isPresent()) { message = String.format(messageFormat, cameraName.get()); } else { message = String.format(messageFormat, webcam.get().getName()); } cameraAlert.setTitle("Webcam Missing"); cameraAlert.setHeaderText("Cannot Communicate with Camera!"); cameraAlert.setResizable(true); cameraAlert.setContentText(message); if (controller != null) cameraAlert.initOwner(controller.getStage()); cameraAlert.show(); }); } private void showFPSWarning(double fps) { Platform.runLater(() -> { Alert cameraAlert = new Alert(AlertType.WARNING); Optional<String> cameraName = config.getWebcamsUserName(webcam.get()); String messageFormat = "The FPS from %s has dropped to %f, which is too low for reliable shot detection. Some" + " shots may be missed. You may be able to raise the FPS by closing other applications."; String message; if (cameraName.isPresent()) { message = String.format(messageFormat, cameraName.get(), fps); } else { message = String.format(messageFormat, webcam.get().getName(), fps); } cameraAlert.setTitle("Webcam FPS Too Low"); cameraAlert.setHeaderText("Webcam FPS is too low!"); cameraAlert.setResizable(true); cameraAlert.setContentText(message); if (controller != null) cameraAlert.initOwner(controller.getStage()); cameraAlert.show(); }); } >>>>>>> <<<<<<< calibrationManager.setArenaMaskManager(arenaMaskManager); ======= controller.setArenaMaskManager(arenaMaskManager); >>>>>>> calibrationManager.setArenaMaskManager(arenaMaskManager);
<<<<<<< private BufferedImage bImage; ======= >>>>>>> <<<<<<< @Override public void run() { final CountDownLatch latch = new CountDownLatch(1); Platform.runLater(new Runnable() { @Override public void run() { try { bImage = getCanvasManager().getBufferedImage(); } finally { latch.countDown(); } } }); try { ======= @Override public void run() { //final CountDownLatch latch = new CountDownLatch(1); Platform.runLater(new Runnable() { @Override public void run() { try { arenaMaskManager.sem.acquire(); } catch (InterruptedException e) { return; } try{ arenaMaskManager.maskFromArena = new Mask(getCanvasManager().getBufferedImage(), System.currentTimeMillis()); }finally{ arenaMaskManager.sem.release(); } } }); /*try { >>>>>>> @Override public void run() { //final CountDownLatch latch = new CountDownLatch(1); Platform.runLater(new Runnable() { @Override public void run() { try { arenaMaskManager.sem.acquire(); } catch (InterruptedException e) { return; } try{ arenaMaskManager.maskFromArena = new Mask(getCanvasManager().getBufferedImage(), System.currentTimeMillis()); }finally{ arenaMaskManager.sem.release(); } } }); /*try { <<<<<<< } arenaMaskManager.insert(bImage, System.currentTimeMillis()); } ======= } */ //arenaMaskManager.insert(bImage, System.currentTimeMillis()); } >>>>>>> } */ //arenaMaskManager.insert(bImage, System.currentTimeMillis()); }
<<<<<<< import javafx.util.Callback; ======= import javafx.scene.paint.Color; >>>>>>> import javafx.scene.paint.Color; <<<<<<< private final ExecutorService detectionExecutor = Executors.newFixedThreadPool(200); ======= >>>>>>> <<<<<<< ======= >>>>>>> <<<<<<< ======= >>>>>>> <<<<<<< private void setFPS(double newFPS) { webcamFPS = Math.min(newFPS,DEFAULT_FPS); DeduplicationProcessor.setThreshold((int)(webcamFPS/DeduplicationProcessor.DEDUPE_THRESHOLD_DIVISION_FACTOR)); } ======= private void setFPS(double newFPS) { webcamFPS = Math.min(newFPS, DEFAULT_FPS); DeduplicationProcessor.setThreshold((int)(webcamFPS/DeduplicationProcessor.DEDUPE_THRESHOLD_DIVISION_FACTOR)); } private void checkIfMinimumFPS() { if (webcamFPS < MIN_SHOT_DETECTION_FPS && !showedFPSWarning) { logger.warn("[{}] Current webcam FPS is {}, which is too low for reliable shot detection", webcam.get().getName(), webcamFPS); showFPSWarning(webcamFPS); showedFPSWarning = true; } } >>>>>>> private void setFPS(double newFPS) { webcamFPS = Math.min(newFPS, DEFAULT_FPS); DeduplicationProcessor.setThreshold((int)(webcamFPS/DeduplicationProcessor.DEDUPE_THRESHOLD_DIVISION_FACTOR)); }
<<<<<<< subPool.increaseObjects(1); // increase objects and return one, it will return null if reach max size } if (freeObject == null) { // no more free objects in this parition, wait then ======= // try other partitions for (int i = 0; i < this.partitions.length; i++) { if (i != partition) { freeObject = this.partitions[i].getObjectQueue().poll(); if (freeObject != null) { break; // found one, stop } } } } if (freeObject == null) { // increase objects and return one, it will return null if reach max size subPool.increaseObjects(1); >>>>>>> // increase objects and return one, it will return null if reach max size subPool.increaseObjects(1);
<<<<<<< int height = chunk.getHeight(dx & 0xf, dz & 0xf) + 1; while (height > 3 && IGNORED_COVER_BLOCKS.contains(chunk.getBlock(dx, height, dz))) { height--; ======= int h = chunk.getHeightValue(dx & 0xf, dz & 0xf) + 1; while (h > 3 && IGNORED_COVER_BLOCKS.contains(chunk.getBlock(dx, h, dz))) { h--; >>>>>>> int height = chunk.getHeightValue(dx & 0xf, dz & 0xf) + 1; while (height > 3 && IGNORED_COVER_BLOCKS.contains(chunk.getBlock(dx, height, dz))) { height--; <<<<<<< int height = chunk.getHeight(dx & 0xf, dz & 0xf) + 1; ======= int h = chunk.getHeightValue(dx & 0xf, dz & 0xf) + 1; >>>>>>> int height = chunk.getHeightValue(dx & 0xf, dz & 0xf) + 1;
<<<<<<< import static com.android.launcher3.notification.NotificationMainView.NOTIFICATION_ITEM_INFO; import static com.android.launcher3.popup.PopupPopulator.MAX_SHORTCUTS; import static com.android.launcher3.popup.PopupPopulator.MAX_SHORTCUTS_IF_NOTIFICATIONS; import static com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; import static com.android.launcher3.userevent.nano.LauncherLogProto.ItemType; import static com.android.launcher3.userevent.nano.LauncherLogProto.Target; ======= >>>>>>> <<<<<<< ======= import static com.android.launcher3.notification.NotificationMainView.NOTIFICATION_ITEM_INFO; import static com.android.launcher3.popup.PopupPopulator.MAX_SHORTCUTS; import static com.android.launcher3.popup.PopupPopulator.MAX_SHORTCUTS_IF_NOTIFICATIONS; import static com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; import static com.android.launcher3.userevent.nano.LauncherLogProto.ItemType; import static com.android.launcher3.userevent.nano.LauncherLogProto.Target; >>>>>>> <<<<<<< * A container for shortcuts to deep links and notifications associated with an app. ======= * A container for shortcuts to deep links and notifications associated with an app. * * 长按图标弹出的扩展框 >>>>>>> <<<<<<< public class PopupContainerWithArrow extends ArrowPopup implements DragSource, DragController.DragListener, View.OnLongClickListener, View.OnTouchListener { private final List<DeepShortcutView> mShortcuts = new ArrayList<>(); private final PointF mInterceptTouchDown = new PointF(); private final Point mIconLastTouchPos = new Point(); ======= public class PopupContainerWithArrow extends ArrowPopup implements DragSource, DragController.DragListener, View.OnLongClickListener, View.OnTouchListener { >>>>>>> <<<<<<< ======= private final List<DeepShortcutView> mShortcuts = new ArrayList<>(); private final PointF mInterceptTouchDown = new PointF(); private final Point mIconLastTouchPos = new Point(); >>>>>>> <<<<<<< this, shortcutIds, mShortcuts, notificationKeys)); } private String getTitleForAccessibility() { return getContext().getString(mNumNotifications == 0 ? R.string.action_deep_shortcut : R.string.shortcuts_menu_with_notifications_description); ======= this, shortcutIds, mShortcuts, notificationKeys)); } private String getTitleForAccessibility() { return getContext().getString(mNumNotifications == 0 ? R.string.action_deep_shortcut : R.string.shortcuts_menu_with_notifications_description); >>>>>>> <<<<<<< protected Pair<View, String> getAccessibilityTarget() { return Pair.create(this, ""); } @Override protected void getTargetObjectLocation(Rect outPos) { mLauncher.getDragLayer().getDescendantRectRelativeToSelf(mOriginalIcon, outPos); outPos.top += mOriginalIcon.getPaddingTop(); outPos.left += mOriginalIcon.getPaddingLeft(); outPos.right -= mOriginalIcon.getPaddingRight(); outPos.bottom = outPos.top + (mOriginalIcon.getIcon() != null ? mOriginalIcon.getIcon().getBounds().height() : mOriginalIcon.getHeight()); } public void applyNotificationInfos(List<NotificationInfo> notificationInfos) { mNotificationItemView.applyNotificationInfos(notificationInfos); } private void updateHiddenShortcuts() { int allowedCount = mNotificationItemView != null ? MAX_SHORTCUTS_IF_NOTIFICATIONS : MAX_SHORTCUTS; int originalHeight = getResources().getDimensionPixelSize(R.dimen.bg_popup_item_height); int itemHeight = mNotificationItemView != null ? getResources().getDimensionPixelSize(R.dimen.bg_popup_item_condensed_height) : originalHeight; float iconScale = ((float) itemHeight) / originalHeight; int total = mShortcuts.size(); for (int i = 0; i < total; i++) { DeepShortcutView view = mShortcuts.get(i); view.setVisibility(i >= allowedCount ? GONE : VISIBLE); view.getLayoutParams().height = itemHeight; view.getIconView().setScaleX(iconScale); view.getIconView().setScaleY(iconScale); } } private void updateDividers() { int count = getChildCount(); DeepShortcutView lastView = null; for (int i = 0; i < count; i++) { View view = getChildAt(i); if (view.getVisibility() == VISIBLE && view instanceof DeepShortcutView) { if (lastView != null) { lastView.setDividerVisibility(VISIBLE); } lastView = (DeepShortcutView) view; lastView.setDividerVisibility(INVISIBLE); } ======= protected Pair<View, String> getAccessibilityTarget() { return Pair.create(this, ""); } @Override protected void getTargetObjectLocation(Rect outPos) { mLauncher.getDragLayer().getDescendantRectRelativeToSelf(mOriginalIcon, outPos); outPos.top += mOriginalIcon.getPaddingTop(); outPos.left += mOriginalIcon.getPaddingLeft(); outPos.right -= mOriginalIcon.getPaddingRight(); outPos.bottom = outPos.top + (mOriginalIcon.getIcon() != null ? mOriginalIcon.getIcon().getBounds().height() : mOriginalIcon.getHeight()); } public void applyNotificationInfos(List<NotificationInfo> notificationInfos) { mNotificationItemView.applyNotificationInfos(notificationInfos); } private void updateHiddenShortcuts() { int allowedCount = mNotificationItemView != null ? MAX_SHORTCUTS_IF_NOTIFICATIONS : MAX_SHORTCUTS; int originalHeight = getResources().getDimensionPixelSize(R.dimen.bg_popup_item_height); int itemHeight = mNotificationItemView != null ? getResources().getDimensionPixelSize(R.dimen.bg_popup_item_condensed_height) : originalHeight; float iconScale = ((float) itemHeight) / originalHeight; int total = mShortcuts.size(); for (int i = 0; i < total; i++) { DeepShortcutView view = mShortcuts.get(i); view.setVisibility(i >= allowedCount ? GONE : VISIBLE); view.getLayoutParams().height = itemHeight; view.getIconView().setScaleX(iconScale); view.getIconView().setScaleY(iconScale); } } private void updateDividers() { int count = getChildCount(); DeepShortcutView lastView = null; for (int i = 0; i < count; i++) { View view = getChildAt(i); if (view.getVisibility() == VISIBLE && view instanceof DeepShortcutView) { if (lastView != null) { lastView.setDividerVisibility(VISIBLE); } lastView = (DeepShortcutView) view; lastView.setDividerVisibility(INVISIBLE); } >>>>>>> <<<<<<< } @Override public void onDropCompleted(View target, DragObject d, boolean success) { } ======= } @Override public void onDropCompleted(View target, DragObject d, boolean success) { } >>>>>>>
<<<<<<< import lu.nowina.nexu.flow.StageHelper; ======= import lu.nowina.nexu.NexuException; import lu.nowina.nexu.api.Feedback; import lu.nowina.nexu.generic.DebugHelper; >>>>>>> import lu.nowina.nexu.flow.StageHelper; import lu.nowina.nexu.NexuException; import lu.nowina.nexu.api.Feedback; import lu.nowina.nexu.generic.DebugHelper; <<<<<<< ok.setOnAction(e -> { getFeedback().setUserComment(userComment.getText()); sendFeedback(); }); cancel.setOnAction(e -> signalUserCancel()); ======= ok.setOnAction(e -> { DebugHelper dh = new DebugHelper(); Feedback feedback = null; try { feedback = dh.processError(new NexuException()); } catch (IOException |JAXBException ex) { LOGGER.warn(ex.getMessage(), ex); } new Thread(() -> { try { Desktop.getDesktop().browse(new URI(getAppConfig().getTicketUrl())); } catch (IOException | URISyntaxException ioe) { LOGGER.error(ioe.getMessage()); } }).start(); signalEnd(feedback); }); cancel.setOnAction(e -> signalUserCancel()); >>>>>>> ok.setOnAction(e -> { DebugHelper dh = new DebugHelper(); Feedback feedback = null; try { feedback = dh.processError(new NexuException()); } catch (IOException |JAXBException ex) { LOGGER.warn(ex.getMessage(), ex); } new Thread(() -> { try { Desktop.getDesktop().browse(new URI(getAppConfig().getTicketUrl())); } catch (IOException | URISyntaxException ioe) { LOGGER.error(ioe.getMessage()); } }).start(); signalEnd(feedback); }); cancel.setOnAction(e -> signalUserCancel()); <<<<<<< StageHelper.getInstance().setTitle(getApplicationName(), "feedback.title"); Platform.runLater(() -> message.setText(MessageFormat.format( ResourceBundle.getBundle("bundles/nexu").getString("feedback.message"), getApplicationName())) ); ======= Platform.runLater(() -> message.setText(MessageFormat.format( ResourceBundle.getBundle("bundles/nexu").getString("feedback.message"), ResourceBundle.getBundle("bundles/nexu").getString("button.report.incident"), getApplicationName()))); >>>>>>> Platform.runLater(() -> message.setText(MessageFormat.format( ResourceBundle.getBundle("bundles/nexu").getString("feedback.message"), ResourceBundle.getBundle("bundles/nexu").getString("button.report.incident"), getApplicationName())));
<<<<<<< private static final String CORS_ALLOWED_ORIGIN = "cors_allowed_origin"; ======= private static final String TICKET_URL = "ticket_url"; private static final String ENABLE_INCIDENT_REPORT = "enable_incident_report"; >>>>>>> private static final String CORS_ALLOWED_ORIGIN = "cors_allowed_origin"; private static final String TICKET_URL = "ticket_url"; private static final String ENABLE_INCIDENT_REPORT = "enable_incident_report"; <<<<<<< setCorsAllowedOrigin(props.getProperty(CORS_ALLOWED_ORIGIN, "*")); ======= setTicketUrl(props.getProperty(TICKET_URL, "https://github.com/nowina-solutions/nexu/issues/new")); setEnableIncidentReport(Boolean.parseBoolean(props.getProperty(ENABLE_INCIDENT_REPORT, "true"))); >>>>>>> setCorsAllowedOrigin(props.getProperty(CORS_ALLOWED_ORIGIN, "*")); setTicketUrl(props.getProperty(TICKET_URL, "https://github.com/nowina-solutions/nexu/issues/new")); setEnableIncidentReport(Boolean.parseBoolean(props.getProperty(ENABLE_INCIDENT_REPORT, "true"))); <<<<<<< public String getCorsAllowedOrigin() { return corsAllowedOrigin; } public void setCorsAllowedOrigin(String corsAllowedOrigin) { this.corsAllowedOrigin = corsAllowedOrigin; } ======= public String getTicketUrl() { return ticketUrl; } public void setTicketUrl(String ticketUrl) { this.ticketUrl = ticketUrl; } public boolean isEnableIncidentReport() { return enableIncidentReport; } public void setEnableIncidentReport(boolean enableIncidentReport) { this.enableIncidentReport = enableIncidentReport; } >>>>>>> public String getCorsAllowedOrigin() { return corsAllowedOrigin; } public void setCorsAllowedOrigin(String corsAllowedOrigin) { this.corsAllowedOrigin = corsAllowedOrigin; } public String getTicketUrl() { return ticketUrl; } public void setTicketUrl(String ticketUrl) { this.ticketUrl = ticketUrl; } public boolean isEnableIncidentReport() { return enableIncidentReport; } public void setEnableIncidentReport(boolean enableIncidentReport) { this.enableIncidentReport = enableIncidentReport; }
<<<<<<< import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.cfg.GeneratorSettings; ======= import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.PropertyName; import com.fasterxml.jackson.databind.SerializationConfig; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; >>>>>>> import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.cfg.GeneratorSettings; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; <<<<<<< ======= @Override // since 2.11.1, was missing before public void serializeValue(JsonGenerator gen, Object value, JavaType rootType) throws IOException { serializeValue(gen, value, rootType, null); } // @since 2.1 >>>>>>> @Override public void serializeValue(JsonGenerator gen, Object value, JavaType rootType) throws IOException { serializeValue(gen, value, rootType, null); }
<<<<<<< .enableDefaultTyping(DefaultTyping.NON_FINAL, JsonTypeInfo.As.WRAPPER_OBJECT) ======= .enableDefaultTyping(NoCheckSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.WRAPPER_OBJECT) >>>>>>> .enableDefaultTyping(NoCheckSubTypeValidator.instance, DefaultTyping.NON_FINAL, JsonTypeInfo.As.WRAPPER_OBJECT) <<<<<<< ======= >>>>>>>
<<<<<<< @Override // since 3.0 public XMLStreamReader2 getInputSource() { return _xmlTokens.getXmlReader(); } ======= /* /********************************************************************** /* Overrides: capability introspection methods /********************************************************************** */ >>>>>>> @Override // since 3.0 public XMLStreamReader2 getInputSource() { return _xmlTokens.getXmlReader(); } /* /********************************************************************** /* Overrides: capability introspection methods /********************************************************************** */ <<<<<<< ======= @Override public boolean canReadObjectId() { return false; } @Override public boolean canReadTypeId() { return false; } @Override public JacksonFeatureSet<StreamReadCapability> getReadCapabilities() { return XML_READ_CAPABILITIES; } /* /********************************************************** /* Extended API, configuration /********************************************************** */ public FromXmlParser enable(Feature f) { _formatFeatures |= f.getMask(); _xmlTokens.setFormatFeatures(_formatFeatures); return this; } public FromXmlParser disable(Feature f) { _formatFeatures &= ~f.getMask(); _xmlTokens.setFormatFeatures(_formatFeatures); return this; } public final boolean isEnabled(Feature f) { return (_formatFeatures & f.getMask()) != 0; } public FromXmlParser configure(Feature f, boolean state) { if (state) { enable(f); } else { disable(f); } return this; } >>>>>>> @Override public boolean canReadObjectId() { return false; } @Override public boolean canReadTypeId() { return false; } @Override public JacksonFeatureSet<StreamReadCapability> getReadCapabilities() { return XML_READ_CAPABILITIES; }
<<<<<<< // @since 2.1 @Override public final String getValueAsString() throws IOException { return getValueAsString(null); } @Override public String getValueAsString(String defValue) throws IOException { JsonToken t = _currToken; if (t == null) { return null; } switch (t) { case FIELD_NAME: return currentName(); case VALUE_STRING: return _currText; case START_OBJECT: // the interesting case; may be able to convert certain kinds of // elements (specifically, ones with attributes, CDATA only content) // into VALUE_STRING try { String str = _xmlTokens.convertToString(); if (str != null) { // need to convert token, as well as "undo" START_OBJECT // note: Should NOT update context, because we will still be getting // matching END_OBJECT, which will undo contexts properly _parsingContext = _parsingContext.getParent(); _currToken = JsonToken.VALUE_STRING; _nextToken = null; // One more thing: must explicitly skip the END_OBJECT that would follow _skipEndElement(); //System.out.println(" FromXmlParser.getValueAsString() on START_OBJECT, str == '"+str+"'"); return (_currText = str); } } catch (XMLStreamException e) { StaxUtil.throwAsParseException(e, this); } return null; default: if (_currToken.isScalarValue()) { return _currToken.asString(); } } return defValue; } ======= >>>>>>>
<<<<<<< ObjectMapper mapper = XmlMapper.builder() .enableDefaultTyping(DefaultTyping.NON_FINAL, JsonTypeInfo.As.WRAPPER_OBJECT) ======= ObjectMapper mapper = mapperBuilder() >>>>>>> ObjectMapper mapper = mapperBuilder() .enableDefaultTyping(DefaultTyping.NON_FINAL, JsonTypeInfo.As.WRAPPER_OBJECT)
<<<<<<< sw = _xmlOutputFactory.createXMLStreamWriter(out, "UTF-8"); } catch (XMLStreamException e) { return StaxUtil.throwAsGenerationException(e, null); ======= sw = _xmlOutputFactory.createXMLStreamWriter(_decorate(ctxt, out), "UTF-8"); } catch (Exception e) { throw new JsonGenerationException(e.getMessage(), e, null); >>>>>>> sw = _xmlOutputFactory.createXMLStreamWriter(out, "UTF-8"); } catch (XMLStreamException e) { throw new JsonGenerationException(e.getMessage(), e, null); <<<<<<< sw = _xmlOutputFactory.createXMLStreamWriter(w); } catch (XMLStreamException e) { return StaxUtil.throwAsGenerationException(e, null); ======= sw = _xmlOutputFactory.createXMLStreamWriter(_decorate(ctxt, w)); } catch (Exception e) { throw new JsonGenerationException(e.getMessage(), e, null); >>>>>>> sw = _xmlOutputFactory.createXMLStreamWriter(w); } catch (XMLStreamException e) { throw new JsonGenerationException(e.getMessage(), e, null);
<<<<<<< final List<Execution> executionList, final RdClientConfig config ======= final AppConfig config, final Stream<Execution> executions >>>>>>> final RdClientConfig config, final Stream<Execution> executions
<<<<<<< out = client.getService().getOutput(id, 0L, 0L, max, compacted); ======= out = serviceClient.getService().getOutput(id, 0L, 0L, max); >>>>>>> out = serviceClient.getService().getOutput(id, 0L, 0L, max, compacted); <<<<<<< return followOutput(client, output, id, max, true, entries -> { ======= return followOutput(serviceClient, output, id, max, entries -> { >>>>>>> return followOutput(serviceClient, output, id, max, true, entries -> { <<<<<<< ExecOutput execOutput = client.checkError(callOutput); receiver.accept(execOutput.decompactEntries()); ======= ExecOutput execOutput = serviceClient.checkError(callOutput); receiver.accept(execOutput.entries); >>>>>>> ExecOutput execOutput = serviceClient.checkError(callOutput); receiver.accept(execOutput.decompactEntries()); <<<<<<< callOutput = client.getService().getOutput( id, execOutput.offset, execOutput.lastModified, max, compacted ); ======= callOutput = serviceClient.getService().getOutput(id, execOutput.offset, execOutput.lastModified, max); >>>>>>> callOutput = serviceClient.getService().getOutput( id, execOutput.offset, execOutput.lastModified, max, compacted );
<<<<<<< List<String> referrerChain = new ArrayList<String>(1); String parentUrl = navigationUrl.get(); referrerChain.add(parentUrl); ======= getProvider().waitForReady(); List<String> referrerChain = new ArrayList<>(1); referrerChain.add(url); String parentUrl = url; >>>>>>> List<String> referrerChain = new ArrayList<>(1); String parentUrl = navigationUrl.get(); referrerChain.add(parentUrl);
<<<<<<< private List<EngineCreatedListener> engineCreatedListeners = new CopyOnWriteArrayList<>(); private List<EngineDisposedListener> engineDisposedListeners = new CopyOnWriteArrayList<>(); ======= private List<EngineCreatedListener> engineCreatedListeners = new CopyOnWriteArrayList<EngineCreatedListener>(); private List<BeforeEngineDisposedListener> beforeEngineDisposedListeners = new CopyOnWriteArrayList<BeforeEngineDisposedListener>(); private List<EngineDisposedListener> engineDisposedListeners = new CopyOnWriteArrayList<EngineDisposedListener>(); >>>>>>> private List<EngineCreatedListener> engineCreatedListeners = new CopyOnWriteArrayList<>(); private List<BeforeEngineDisposedListener> beforeEngineDisposedListeners = new CopyOnWriteArrayList<>(); private List<EngineDisposedListener> engineDisposedListeners = new CopyOnWriteArrayList<>();
<<<<<<< import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Scanner; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.zip.GZIPInputStream; import java.util.zip.InflaterInputStream; import java.util.zip.Inflater; import net.lightbody.bmp.core.har.Har; import net.lightbody.bmp.core.har.HarCookie; import net.lightbody.bmp.core.har.HarEntry; import net.lightbody.bmp.core.har.HarNameValuePair; import net.lightbody.bmp.core.har.HarNameVersion; import net.lightbody.bmp.core.har.HarPostData; import net.lightbody.bmp.core.har.HarPostDataParam; import net.lightbody.bmp.core.har.HarRequest; import net.lightbody.bmp.core.har.HarResponse; import net.lightbody.bmp.core.har.HarTimings; import net.lightbody.bmp.proxy.util.Base64; import net.lightbody.bmp.proxy.util.CappedByteArrayOutputStream; import net.lightbody.bmp.proxy.util.ClonedOutputStream; import net.lightbody.bmp.proxy.util.IOUtils; import net.lightbody.bmp.proxy.util.Log; ======= import net.lightbody.bmp.core.har.*; import net.lightbody.bmp.proxy.BlacklistEntry; import net.lightbody.bmp.proxy.WhitelistEntry; import net.lightbody.bmp.proxy.util.*; import net.lightbody.bmp.proxy.util.Base64; >>>>>>> import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Scanner; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.zip.GZIPInputStream; import java.util.zip.InflaterInputStream; import java.util.zip.Inflater; import net.lightbody.bmp.core.har.*; import net.lightbody.bmp.proxy.BlacklistEntry; import net.lightbody.bmp.proxy.WhitelistEntry; import net.lightbody.bmp.proxy.util.*; <<<<<<< private PoolingHttpClientConnectionManager httpClientConnMgr; /** * Builders for httpClient * Each time you change their configuration you should call updateHttpClient() */ private Builder requestConfigBuilder; private HttpClientBuilder httpClientBuilder; /** * The current httpClient which will execute HTTP requests */ private CloseableHttpClient httpClient; private BasicCookieStore cookieStore = new BasicCookieStore(); /** * List of rejected URL patterns */ private List<BlacklistEntry> blacklistEntries = new CopyOnWriteArrayList<BrowserMobHttpClient.BlacklistEntry>(); /** * List of accepted URL patterns */ ======= private ThreadSafeClientConnManager httpClientConnMgr; private DefaultHttpClient httpClient; private List<BlacklistEntry> blacklistEntries = new CopyOnWriteArrayList<BlacklistEntry>(); >>>>>>> private PoolingHttpClientConnectionManager httpClientConnMgr; /** * Builders for httpClient * Each time you change their configuration you should call updateHttpClient() */ private Builder requestConfigBuilder; private HttpClientBuilder httpClientBuilder; /** * The current httpClient which will execute HTTP requests */ private CloseableHttpClient httpClient; private BasicCookieStore cookieStore = new BasicCookieStore(); /** * List of rejected URL patterns */ private List<BlacklistEntry> blacklistEntries = new CopyOnWriteArrayList<BrowserMobHttpClient.BlacklistEntry>(); /** * List of accepted URL patterns */ <<<<<<< // url does match whitelist, set the response code if (blacklistEntry.pattern.matcher(url).matches()) { mockResponseCode = blacklistEntry.responseCode; ======= if (blacklistEntry.getPattern().matcher(url).matches()) { mockResponseCode = blacklistEntry.getResponseCode(); >>>>>>> if (blacklistEntry.getPattern().matcher(url).matches()) { mockResponseCode = blacklistEntry.getResponseCode();
<<<<<<< import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Hashtable; import java.util.Map; import javax.script.Bindings; import javax.script.Compilable; import javax.script.CompiledScript; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; ======= >>>>>>> import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Hashtable; import java.util.Map; import javax.script.Bindings; import javax.script.Compilable; import javax.script.CompiledScript; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; <<<<<<< ======= import javax.script.*; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Hashtable; import java.util.Map; >>>>>>> <<<<<<< public Reply<?> newProxy(Request request) throws Exception { ======= public Reply<ProxyDescriptor> newProxy(Request request) { >>>>>>> public Reply<?> newProxy(Request request) {
<<<<<<< if (blacklistEntries != null) { for (BlacklistEntry blacklistEntry : blacklistEntries) { if (blacklistEntry.getPattern().matcher(url).matches() && blacklistEntry.getMethod().matcher(method.getMethod()).matches()) { mockResponseCode = blacklistEntry.getResponseCode(); break; } ======= for (BlacklistEntry blacklistEntry : blacklistEntries) { if (blacklistEntry.getPattern().matcher(url).matches()) { mockResponseCode = blacklistEntry.getResponseCode(); break; >>>>>>> for (BlacklistEntry blacklistEntry : blacklistEntries) { if (blacklistEntry.matches(url, method.getMethod())) { mockResponseCode = blacklistEntry.getResponseCode(); break; <<<<<<< // this method is provided for backwards compatibility before we renamed it to // blacklistRequests (note the plural) public void blacklistRequest(String pattern, int responseCode, String method) { blacklistRequests(pattern, responseCode, method); ======= /** * this method is provided for backwards compatibility before we renamed it to blacklistRequests (note the plural) * @deprecated use blacklistRequests(String pattern, int responseCode) */ @Deprecated public void blacklistRequest(String pattern, int responseCode) { blacklistRequests(pattern, responseCode); >>>>>>> /** * this method is provided for backwards compatibility before we renamed it to blacklistRequests (note the plural) * @deprecated use blacklistRequests(String pattern, int responseCode) */ @Deprecated public void blacklistRequest(String pattern, int responseCode, String method) { blacklistRequests(pattern, responseCode, method);
<<<<<<< import javax.net.ssl.SSLSocketFactory; ======= import javax.net.ssl.SSLContext; >>>>>>> import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.SSLContext; <<<<<<< private final SSLSocketFactory sslSocketFactory; ======= private final SSLContext sslContext; >>>>>>> private final SSLSocketFactory sslSocketFactory; private final SSLContext sslContext; <<<<<<< private SSLSocketFactory sslSocketFactory; ======= private SSLContext sslContext; >>>>>>> private SSLSocketFactory sslSocketFactory; private SSLContext sslContext; <<<<<<< public Builder sslSocketFactory(SSLSocketFactory sslSocketFactory) { this.sslSocketFactory = sslSocketFactory; return this; } ======= public Builder sslContext(SSLContext sslContext) { this.sslContext = sslContext; return this; } >>>>>>> public Builder sslSocketFactory(SSLSocketFactory sslSocketFactory) { this.sslSocketFactory = sslSocketFactory; return this; } public Builder sslContext(SSLContext sslContext) { this.sslContext = sslContext; return this; } <<<<<<< environment, hostnameVerifier, sslSocketFactory, ======= environment, hostnameVerifier, sslContext, >>>>>>> environment, hostnameVerifier, sslSocketFactory, sslContext, <<<<<<< SSLSocketFactory sslSocketFactory, WinRmClientContext context) { ======= SSLContext sslContext, WinRmClientContext context) { >>>>>>> SSLSocketFactory sslSocketFactory, SSLContext sslContext, WinRmClientContext context) { <<<<<<< this.sslSocketFactory = sslSocketFactory; ======= this.sslContext = sslContext; >>>>>>> this.sslSocketFactory = sslSocketFactory; this.sslContext = sslContext; <<<<<<< if (sslSocketFactory != null) { builder.sslSocketFactory(sslSocketFactory); } ======= if (sslContext != null) { builder.sslContext(sslContext); } >>>>>>> if (sslSocketFactory != null) { builder.sslSocketFactory(sslSocketFactory); } if (sslContext != null) { builder.sslContext(sslContext); }
<<<<<<< import static ninja.Aws4HashCalculator.AWS_AUTH4_PATTERN; import static ninja.AwsHashCalculator.AWS_AUTH_PATTERN; ======= import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.time.ZoneOffset; import java.time.chrono.IsoChronology; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.concurrent.locks.ReentrantLock; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; >>>>>>> import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.time.ZoneOffset; import java.time.chrono.IsoChronology; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.concurrent.locks.ReentrantLock; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; import static ninja.Aws4HashCalculator.AWS_AUTH4_PATTERN; import static ninja.AwsHashCalculator.AWS_AUTH_PATTERN; <<<<<<< @Part private AwsHashCalculator hashCalculator; ======= private Map<String, ReentrantLock> locks = Maps.newConcurrentMap(); /* * Computes the expected hash for the given request. */ private String computeHash(WebContext ctx, String pathPrefix) { try { Matcher aws4Header = AWS_AUTH4_PATTERN.matcher(ctx.getHeaderValue("Authorization").asString("")); if (aws4Header.matches()) { return computeAWS4Hash(ctx, aws4Header); } else { return computeAWSLegacyHash(ctx, pathPrefix); } } catch (Throwable e) { throw Exceptions.handle(UserContext.LOG, e); } } /* * Computes the "classic" authentication hash. */ private String computeAWSLegacyHash(WebContext ctx, String pathPrefix) throws Exception { StringBuilder stringToSign = new StringBuilder(ctx.getRequest().getMethod().name()); stringToSign.append("\n"); stringToSign.append(ctx.getHeaderValue("Content-MD5").asString("")); stringToSign.append("\n"); stringToSign.append(ctx.getHeaderValue("Content-Type").asString("")); stringToSign.append("\n"); stringToSign.append(ctx.get("Expires") .asString(ctx.getHeaderValue("x-amz-date") .asString(ctx.getHeaderValue("Date").asString("")))); stringToSign.append("\n"); List<String> headers = Lists.newArrayList(); for (String name : ctx.getRequest().headers().names()) { if (name.toLowerCase().startsWith("x-amz-") && !"x-amz-date".equals(name.toLowerCase())) { StringBuilder headerBuilder = new StringBuilder(name.toLowerCase().trim()); headerBuilder.append(":"); headerBuilder.append(Strings.join(ctx.getRequest().headers().getAll(name), ",").trim()); headers.add(headerBuilder.toString()); } } Collections.sort(headers); for (String header : headers) { stringToSign.append(header); stringToSign.append("\n"); } stringToSign.append(pathPrefix).append(ctx.getRequestedURI().substring(3)); >>>>>>> @Part private AwsHashCalculator hashCalculator;
<<<<<<< private final String _sourceName; private final String _sourceRepository; ======= private final Integer _mergeRequestIid; >>>>>>> private final Integer _mergeRequestIid; private final String _sourceName; private final String _sourceRepository; <<<<<<< public GitlabCause(Integer mergeRequestId, String sourceName, String sourceRepository, String sourceBranch, String targetBranch) { ======= public GitlabCause(Integer mergeRequestId, Integer mergeRequestIid, String sourceBranch, String targetBranch) { >>>>>>> public GitlabCause(Integer mergeRequestId, Integer mergeRequestIid, String sourceName, String sourceRepository, String sourceBranch, String targetBranch) { <<<<<<< _sourceName = sourceName; _sourceRepository = sourceRepository; ======= _mergeRequestIid = mergeRequestIid; >>>>>>> _mergeRequestIid = mergeRequestIid; _sourceName = sourceName; _sourceRepository = sourceRepository; <<<<<<< return "Gitlab Merge Request #" + _mergeRequestId + " : " + _sourceName + "/" + _sourceBranch + " => " + _targetBranch; ======= return "Gitlab Merge Request #" + _mergeRequestIid + " : " + _sourceBranch + " => " + _targetBranch; >>>>>>> return "Gitlab Merge Request #" + _mergeRequestIid + " : " + _sourceName + "/" + _sourceBranch + " => " + _targetBranch; <<<<<<< public String getSourceName() { return _sourceName; } public String getSourceRepository() { return _sourceRepository; } ======= public Integer getMergeRequestIid() { return _mergeRequestIid; } >>>>>>> public Integer getMergeRequestIid() { return _mergeRequestIid; } public String getSourceName() { return _sourceName; } public String getSourceRepository() { return _sourceRepository; }
<<<<<<< static final String JAVA_MAIN_CLASS_ENV_VAR = "JAVA_MAIN_CLASS"; ======= private static final String JAVA_MAIN_CLASS_ENV_VAR = "JAVA_MAIN_CLASS"; private static final String JAVA_OPTIONS = "JAVA_OPTIONS"; >>>>>>> static final String JAVA_MAIN_CLASS_ENV_VAR = "JAVA_MAIN_CLASS"; private static final String JAVA_OPTIONS = "JAVA_OPTIONS";
<<<<<<< protected final DefaultImageLookup imageLookup; protected final MavenProject project; ======= private final String[] NO_FILES = {}; protected MavenProject project; >>>>>>> protected final DefaultImageLookup imageLookup; protected final MavenProject project; private final String[] NO_FILES = {};
<<<<<<< ======= >>>>>>>
<<<<<<< import com.google.gwt.user.client.ui.FlexTable; import com.google.gwt.user.client.ui.Widget; import com.fasterxml.jackson.annotation.JsonTypeName; ======= >>>>>>> import com.fasterxml.jackson.annotation.JsonTypeName; <<<<<<< public void setCondition(ColumnCondition condition) { this.condition = condition; } @Override @XmlTransient public void sendResultTo(OmniscientResultReceiver resultReceiver) throws CouldNotReceiveResultException { resultReceiver.receiveResult(this); } public String buildPatternTableau() { ======= public String buildPatternTableauTable() { >>>>>>> public void setCondition(ColumnCondition condition) { this.condition = condition; } @XmlTransient @Override public void sendResultTo(OmniscientResultReceiver resultReceiver) throws CouldNotReceiveResultException { resultReceiver.receiveResult(this); } public String buildPatternTableauTable() { <<<<<<< public Widget buildPatternTableauTableHtml() { FlexTable table = new FlexTable(); //build header TreeSet<ColumnIdentifier> header = condition.getContainedColumns(); int i = 0; for (ColumnIdentifier headColumn : header) { table.setText(0, i, headColumn.toString()); i++; } int rowCount = 1; List<Map<ColumnIdentifier, String>> conditions = condition.getPatternConditions(); for (Map<ColumnIdentifier, String> condition : conditions) { int columnCount = 0; for (ColumnIdentifier column : header) { if (condition.containsKey(column)) { String value = condition.get(column); table.setText(rowCount, columnCount, value); } else { table.setText(rowCount, columnCount, "-"); } columnCount++; } rowCount++; } return table; } ======= @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append(columnCombination.toString()); builder.append(CUCC_SEPARATOR); builder.append(condition.toString()); builder.append(" Coverage: "); builder.append(this.condition.getCoverage()); return builder.toString(); } public String buildPatternTableau() { StringBuilder builder = new StringBuilder(); builder.append(columnCombination.toString()); builder.append(LINESEPARATOR); builder.append(this.buildPatternTableauTable()); builder.append(LINESEPARATOR); builder.append("Coverage: "); builder.append(this.condition.getCoverage()); builder.append(LINESEPARATOR); return builder.toString(); } >>>>>>>
<<<<<<< import org.hamcrest.collection.IsIterableContainingInAnyOrder; ======= >>>>>>> import org.hamcrest.collection.IsIterableContainingInAnyOrder; <<<<<<< import static org.junit.Assert.assertThat; ======= import static org.junit.Assert.assertSame; >>>>>>> import static org.junit.Assert.assertSame; import static org.junit.Assert.assertThat; <<<<<<< // Execute functionality // Check result new EqualsAndHashCodeTester<DatabaseConnection>() .performBasicEqualsAndHashCodeChecks(databaseConnection, equalDatabaseConnection, notEqualDatabaseConnection); } /** * Test method for {@link de.uni_potsdam.hpi.metanome.results_db.DatabaseConnection#retrieveAll()} */ @Test public void testRetrieveAll() throws EntityStorageException { // Setup HibernateUtil.clear(); // Expected values DatabaseConnection expectedConnection = new DatabaseConnection(); DatabaseConnection.store(expectedConnection); // Execute functionality List<DatabaseConnection> actualConncection = DatabaseConnection.retrieveAll(); // Check result assertThat(actualConncection, IsIterableContainingInAnyOrder .containsInAnyOrder(expectedConnection)); // Cleanup HibernateUtil.clear(); } ======= // Execute functionality // Check result new EqualsAndHashCodeTester<DatabaseConnection>() .performBasicEqualsAndHashCodeChecks(databaseConnection, equalDatabaseConnection, notEqualDatabaseConnection); } >>>>>>> // Execute functionality // Check result new EqualsAndHashCodeTester<DatabaseConnection>() .performBasicEqualsAndHashCodeChecks(databaseConnection, equalDatabaseConnection, notEqualDatabaseConnection); } /** * Test method for {@link de.uni_potsdam.hpi.metanome.results_db.DatabaseConnection#retrieveAll()} */ @Test public void testRetrieveAll() throws EntityStorageException { // Setup HibernateUtil.clear(); // Expected values DatabaseConnection expectedConnection = new DatabaseConnection() .store(); // Execute functionality List<DatabaseConnection> actualConnections = DatabaseConnection.retrieveAll(); // Check result assertThat(actualConnections, IsIterableContainingInAnyOrder .containsInAnyOrder(expectedConnection)); // Cleanup HibernateUtil.clear(); }
<<<<<<< fileListBox = new ListBoxInput(false, false); updateListbox(); ======= fileListBox = new ListBoxInput(false); updateListBox(); >>>>>>> fileListBox = new ListBoxInput(false, false); updateListBox();
<<<<<<< List<JSONObject> servers = new ArrayList<>(); ======= List<JSONObject> servers = new ArrayList<JSONObject>(); // Get service statistics for all hosts and services List<ServiceStatistics> servicesStatistics = serviceRegistry.getServiceStatistics(); >>>>>>> List<JSONObject> servers = new ArrayList<>(); // Get service statistics for all hosts and services List<ServiceStatistics> servicesStatistics = serviceRegistry.getServiceStatistics();
<<<<<<< private TableInputServiceAsync tableInputService; private TabWrapper messageReceiver; private TableInputTab parent; ======= >>>>>>> private TableInputServiceAsync tableInputService; private TabWrapper messageReceiver; private TableInputTab parent; <<<<<<< ======= private TabWrapper messageReceiver; private FlexTable layoutTable; >>>>>>> <<<<<<< if (result != null || result.size() > 0) { for (DatabaseConnection db : result) { String identifier = db.getSystem().name() + "; " + db.getUrl() + "; " + db.getUsername(); dbConnectionNames.add(identifier); dbMap.put(identifier, db); ======= public void onFailure(Throwable caught) { messageReceiver.addError("There are no database connections in the database!"); >>>>>>> public void onFailure(Throwable caught) { messageReceiver.addError("There are no database connections in the database!");
<<<<<<< /** A parser for handling JSON documents inside the body of a request. **/ private static final JSONParser parser = new JSONParser(); private final List<EventCatalogUIAdapter> eventCatalogUIAdapters = new ArrayList<>(); private final List<SeriesCatalogUIAdapter> seriesCatalogUIAdapters = new ArrayList<>(); ======= private final List<EventCatalogUIAdapter> eventCatalogUIAdapters = new ArrayList<EventCatalogUIAdapter>(); private final List<SeriesCatalogUIAdapter> seriesCatalogUIAdapters = new ArrayList<SeriesCatalogUIAdapter>(); >>>>>>> private final List<EventCatalogUIAdapter> eventCatalogUIAdapters = new ArrayList<>(); private final List<SeriesCatalogUIAdapter> seriesCatalogUIAdapters = new ArrayList<>();
<<<<<<< ResultsTablePage resultsTableContent = ======= // ScrollPanel resultsTab = new ScrollPanel(); ResultsTablePage resultsTableContent = >>>>>>> // ScrollPanel resultsTab = new ScrollPanel(); ResultsTablePage resultsTableContent = <<<<<<< // Execute algorithm and start fetching results executionService.executeAlgorithm(algorithmFileName, executionIdentifier, parameters, resultsTableContent.getCancelCallback()); ======= executionService.executeAlgorithm(algorithmFileName, executionIdentifier, parameters, resultsTableContent.getCancelCallback()); >>>>>>> executionService.executeAlgorithm(algorithmFileName, executionIdentifier, parameters, resultsTableContent.getCancelCallback()); // Execute algorithm and start fetching results executionService.executeAlgorithm(algorithmFileName, executionIdentifier, parameters, resultsTableContent.getCancelCallback()); <<<<<<< ======= * Generates a string representing all given data sources by concatenating their names. These are * used as titles for the result tabs. * * @param dataSources the list of InputParameterDataSources to be descirbed * @return a String with the names of all given data source parameters */ // private String getDataSourcesString( // List<ConfigurationSpecification> dataSources) { // String dataSourcesString = ""; // for (ConfigurationSpecification dataSource : dataSources){ // for (Object settingObject : dataSource.getSettings()) { // ConfigurationSettingDataSource setting = (ConfigurationSettingDataSource) settingObject; // dataSourcesString = dataSourcesString + setting.getValueAsString() + " - "; // } // } // return dataSourcesString; // } /** >>>>>>> * Generates a string representing all given data sources by concatenating their names. These are * used as titles for the result tabs. * * @param dataSources the list of InputParameterDataSources to be descirbed * @return a String with the names of all given data source parameters */ // private String getDataSourcesString( // List<ConfigurationSpecification> dataSources) { // String dataSourcesString = ""; // for (ConfigurationSpecification dataSource : dataSources){ // for (Object settingObject : dataSource.getSettings()) { // ConfigurationSettingDataSource setting = (ConfigurationSettingDataSource) settingObject; // dataSourcesString = dataSourcesString + setting.getValueAsString() + " - "; // } // } // return dataSourcesString; // } /**