conflict_resolution
stringlengths
27
16k
<<<<<<< ======= private static class A { String knownField; @JsonCreator private A(@JsonProperty("knownField") String knownField) { this.knownField = knownField; } } >>>>>>>
<<<<<<< import org.osgi.framework.FrameworkEvent; import org.osgi.framework.connect.FrameworkUtilHelper; ======= >>>>>>> import org.osgi.framework.connect.FrameworkUtilHelper;
<<<<<<< @Override public boolean setSwitchId(Long switchId) { this.switchId = switchId; return true; } @Override public boolean registerPort(Short ovxPortNumber, Long physicalSwitchId, Short physicalPortNumber) throws IllegalVirtualSwitchConfiguration { OVXPort ovxPort = getPort(ovxPortNumber); List<PhysicalSwitch> switchList = OVXMap.getInstance().getPhysicalSwitches(this); if (switchList.size() > 1) throw new IllegalVirtualSwitchConfiguration("Switch " + this.switchId + " is a single switch made up of multiple physical switches"); PhysicalSwitch physicalSwitch = switchList.get(0); assert(physicalSwitchId == this.switchId); PhysicalPort physicalPort = physicalSwitch.getPort(physicalPortNumber); // Map the two ports ovxPort.setPhysicalPort(physicalPort); physicalPort.setOVXPort(ovxPort); // If the ovxPort is an edgePort, set also the physicalPort as an edge physicalPort.isEdge(ovxPort.isEdge()); return true; }; ======= >>>>>>>
<<<<<<< ======= >>>>>>>
<<<<<<< import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; import android.provider.Settings; import android.support.annotation.NonNull; ======= import android.os.Bundle; >>>>>>> import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; import android.provider.Settings; import android.support.annotation.NonNull; import android.os.Bundle;
<<<<<<< import seemoo.fitbit.events.DumpProgressEvent; import seemoo.fitbit.miscellaneous.AuthValues; ======= import seemoo.fitbit.miscellaneous.FitbitDevice; >>>>>>> import seemoo.fitbit.events.DumpProgressEvent; import seemoo.fitbit.miscellaneous.FitbitDevice;
<<<<<<< // TODO configurable nb threads private ConcurrentHashMap<HostAndPort, Map<Interest, AppInstanceNotifier>> notifiers = new ConcurrentHashMap<HostAndPort, Map<Interest, AppInstanceNotifier>>(); // private List<ActorRef> instances = new ArrayList<ActorRef>(); ======= // TODO configurable # of threads // A mapping between the hostname:port string representing an app instance and its notifier in the server side // Key: The hostname and port as String in the form hostname:port // Value: The AppInstanceNotifer in charge of sending notifications to the corresponding app instance private ConcurrentHashMap<String, AppInstanceNotifier> notifiers = new ConcurrentHashMap<String, AppInstanceNotifier>(); >>>>>>> // TODO configurable nb threads private ConcurrentHashMap<HostAndPort, Map<Interest, AppInstanceNotifier>> notifiers = new ConcurrentHashMap<HostAndPort, Map<Interest, AppInstanceNotifier>>(); // private List<ActorRef> instances = new ArrayList<ActorRef>(); <<<<<<< ======= if (notifiers.putIfAbsent(hostnameAndPort, notifier) != null) { notifier.cancel(); } else { logger.info("Adding notifier to {} for application {}", hp.toString(), name); notifier.start(); >>>>>>> <<<<<<< public void removeInstance(String hostnameAndPort) { Map<Interest, AppInstanceNotifier> removed = notifiers.remove(hostnameAndPort); if (removed != null) { for (Map.Entry<Interest, AppInstanceNotifier> entry : removed.entrySet()) { entry.getValue().cancel(); logger.info("Cancelled notifier for app {} to {} for interest {}", new String[] { name, hostnameAndPort, entry.getKey().toString() }); } ======= public void removeInstance(PathAndNode pathAndNode) { String hostnameAndPort = pathAndNode.getNode(); AppInstanceNotifier notifier = notifiers.remove(hostnameAndPort); if (notifier != null) { notifier.cancel(); >>>>>>> public void removeInstance(PathAndNode pathAndNode) { String hostnameAndPort = pathAndNode.toString(); Map<Interest, AppInstanceNotifier> removed = notifiers.remove(hostnameAndPort); if (removed != null) { for (Map.Entry<Interest, AppInstanceNotifier> entry : removed.entrySet()) { entry.getValue().cancel(); logger.info("Cancelled notifier for app {} to {} for interest {}", new String[] { name, hostnameAndPort, entry.getKey().toString() }); }
<<<<<<< import com.yahoo.omid.client.CommitUnsuccessfulException; import com.yahoo.omid.transaction.TransactionManager; import com.yahoo.omid.transaction.TransactionState; import com.yahoo.omid.transaction.TTable; ======= import com.yahoo.omid.transaction.RollbackException; import com.yahoo.omid.transaction.TransactionManager; import com.yahoo.omid.transaction.Transaction; import com.yahoo.omid.transaction.TTable; >>>>>>> import com.yahoo.omid.transaction.RollbackException; import com.yahoo.omid.transaction.TTable; import com.yahoo.omid.transaction.Transaction; import com.yahoo.omid.transaction.TransactionManager;
<<<<<<< import com.yahoo.omid.transaction.TransactionManager; import com.yahoo.omid.transaction.TransactionState; import com.yahoo.omid.transaction.TTable; ======= import com.yahoo.omid.transaction.TransactionManager; import com.yahoo.omid.transaction.Transaction; import com.yahoo.omid.transaction.TTable; >>>>>>> import com.yahoo.omid.transaction.TTable; import com.yahoo.omid.transaction.Transaction; import com.yahoo.omid.transaction.TransactionManager; <<<<<<< TTable table1 = new TTable(hbaseConf, TEST_TABLE); TransactionState t=tm.beginTransaction(); ======= TTable table1 = new TTable(hbaseConf, TEST_TABLE); Transaction t=tm.begin(); >>>>>>> TTable table1 = new TTable(hbaseConf, TEST_TABLE); Transaction t=tm.begin(); <<<<<<< TTable table1 = new TTable(hbaseConf, TEST_TABLE); TransactionState t=tm.beginTransaction(); ======= TTable table1 = new TTable(hbaseConf, TEST_TABLE); Transaction t=tm.begin(); >>>>>>> TTable table1 = new TTable(hbaseConf, TEST_TABLE); Transaction t=tm.begin();
<<<<<<< private static final Logger LOG = LoggerFactory.getLogger(HBaseTransactionManager.class); static final byte[] SHADOW_CELL_SUFFIX = "\u0080".getBytes(Charsets.UTF_8); // Non printable char (128 ASCII) public enum PostCommitMode { SYNC, ASYNC } ======= >>>>>>> private static final Logger LOG = LoggerFactory.getLogger(HBaseTransactionManager.class); <<<<<<< public static class Builder { Configuration conf = new Configuration(); MetricsRegistry metricsRegistry = new NullMetricsProvider(); PostCommitMode postCommitMode = PostCommitMode.SYNC; TSOClient tsoClient; CommitTable.Client commitTableClient; PostCommitActions postCommitter; ======= // ---------------------------------------------------------------------------------------------------------------- // Construction // ---------------------------------------------------------------------------------------------------------------- >>>>>>> // ---------------------------------------------------------------------------------------------------------------- // Construction // ---------------------------------------------------------------------------------------------------------------- <<<<<<< public Builder postCommitter(PostCommitActions postCommitter) { this.postCommitter = postCommitter; return this; } public Builder postCommitMode(PostCommitMode postCommitMode) { this.postCommitMode = postCommitMode; return this; } public HBaseTransactionManager build() throws OmidInstantiationException { boolean ownsTsoClient = false; if (tsoClient == null) { tsoClient = TSOClient.newBuilder() .withConfiguration(convertToCommonsConf(conf)) .build(); ownsTsoClient = true; } boolean ownsCommitTableClient = false; if (commitTableClient == null) { try { String commitTableName = conf.get(COMMIT_TABLE_NAME_KEY, COMMIT_TABLE_DEFAULT_NAME); HBaseCommitTableConfig config = new HBaseCommitTableConfig(commitTableName); CommitTable commitTable = new HBaseCommitTable(conf, config); commitTableClient = commitTable.getClient(); ownsCommitTableClient = true; } catch (IOException e) { throw new OmidInstantiationException("Exception whilst getting the CommitTable client", e); } } if (postCommitter == null) { PostCommitActions syncPostCommitter = new HBaseSyncPostCommitter(metricsRegistry, commitTableClient); switch(postCommitMode) { case ASYNC: ListeningExecutorService postCommitExecutor = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor( new ThreadFactoryBuilder().setNameFormat("postCommit-%d").build())); postCommitter = new HBaseAsyncPostCommitter(syncPostCommitter, postCommitExecutor); break; case SYNC: default: postCommitter = syncPostCommitter; break; } } return new HBaseTransactionManager(metricsRegistry, postCommitter, tsoClient, ownsTsoClient, commitTableClient, ownsCommitTableClient, ======= HBaseTransactionManager build() throws IOException, InterruptedException { return new HBaseTransactionManager(hbaseOmidClientConf, tsoClient.or(buildTSOClient()).get(), commitTableClient.or(buildCommitTableClient().get()), >>>>>>> Builder postCommitter(PostCommitActions postCommitter) { this.postCommitter = Optional.of(postCommitter); return this; } HBaseTransactionManager build() throws IOException, InterruptedException { CommitTable.Client commitTableClient = this.commitTableClient.or(buildCommitTableClient()).get(); PostCommitActions postCommitter = this.postCommitter.or(buildPostCommitter(commitTableClient)).get(); TSOClient tsoClient = this.tsoClient.or(buildTSOClient()).get(); return new HBaseTransactionManager(hbaseOmidClientConf, postCommitter, tsoClient, commitTableClient, <<<<<<< private HBaseTransactionManager(MetricsRegistry metrics, PostCommitActions postCommitter, ======= private HBaseTransactionManager(HBaseOmidClientConfiguration hBaseOmidClientConfiguration, >>>>>>> private HBaseTransactionManager(HBaseOmidClientConfiguration hBaseOmidClientConfiguration, PostCommitActions postCommitter, <<<<<<< // TODO: move to hbase commons package static HBaseTransaction enforceHBaseTransactionAsParam(AbstractTransaction<? extends CellId> tx) { ======= private HBaseTransaction enforceHBaseTransactionAsParam(AbstractTransaction<? extends CellId> tx) { >>>>>>> static HBaseTransaction enforceHBaseTransactionAsParam(AbstractTransaction<? extends CellId> tx) {
<<<<<<< import com.yahoo.omid.transaction.TransactionManager; import com.yahoo.omid.transaction.TransactionState; import com.yahoo.omid.transaction.TTable; ======= import com.yahoo.omid.transaction.TransactionManager; import com.yahoo.omid.transaction.Transaction; import com.yahoo.omid.transaction.TTable; >>>>>>> import com.yahoo.omid.transaction.TTable; import com.yahoo.omid.transaction.Transaction; import com.yahoo.omid.transaction.TransactionManager;
<<<<<<< import com.yahoo.omid.transaction.TransactionManager; import com.yahoo.omid.transaction.TransactionState; import com.yahoo.omid.transaction.TTable; ======= import com.yahoo.omid.transaction.TransactionManager; import com.yahoo.omid.transaction.Transaction; import com.yahoo.omid.transaction.TTable; >>>>>>> import com.yahoo.omid.transaction.TTable; import com.yahoo.omid.transaction.Transaction; import com.yahoo.omid.transaction.TransactionManager;
<<<<<<< ======= import com.yahoo.omid.notifications.client.OmidDelta; >>>>>>> <<<<<<< ======= protected static OmidDelta registrationService; >>>>>>> <<<<<<< ======= registrationService = new OmidDelta("TestApp"); >>>>>>> <<<<<<< ======= if (registrationService != null) { registrationService.close(); } >>>>>>>
<<<<<<< import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; ======= >>>>>>> import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; <<<<<<< import com.yahoo.omid.metrics.NullMetricsProvider; import com.yahoo.omid.tsoclient.TSOClient; ======= >>>>>>> import com.yahoo.omid.metrics.NullMetricsProvider; <<<<<<< PostCommitActions syncPostCommitter = spy( new HBaseSyncPostCommitter(new NullMetricsProvider(), commitTableClient)); AbstractTransactionManager tm = HBaseTransactionManager.newBuilder() .withConfiguration(hbaseConf) .withCommitTableClient(commitTableClient) .withTSOClient(client) .postCommitter(syncPostCommitter) .build(); ======= AbstractTransactionManager tm = spy((AbstractTransactionManager) HBaseTransactionManager.builder(hbaseOmidClientConf) .commitTableClient(commitTableClient) .build()); >>>>>>> PostCommitActions syncPostCommitter = spy( new HBaseSyncPostCommitter(new NullMetricsProvider(), commitTableClient)); AbstractTransactionManager tm = HBaseTransactionManager.builder(hbaseOmidClientConf) .commitTableClient(commitTableClient) .postCommitter(syncPostCommitter) .build(); <<<<<<< PostCommitActions syncPostCommitter = spy( new HBaseSyncPostCommitter(new NullMetricsProvider(), commitTableClient)); AbstractTransactionManager tm = HBaseTransactionManager.newBuilder() .withConfiguration(hbaseConf) .withCommitTableClient(commitTableClient) .withTSOClient(client) .postCommitter(syncPostCommitter) .build(); ======= AbstractTransactionManager tm = spy((AbstractTransactionManager) HBaseTransactionManager.builder(hbaseOmidClientConf) .commitTableClient(commitTableClient) .build()); >>>>>>> PostCommitActions syncPostCommitter = spy( new HBaseSyncPostCommitter(new NullMetricsProvider(), commitTableClient)); AbstractTransactionManager tm = HBaseTransactionManager.builder(hbaseOmidClientConf) .commitTableClient(commitTableClient) .postCommitter(syncPostCommitter) .build();
<<<<<<< static class ExplicitBean { @JsonProperty("firstName") String userFirstName = "Peter"; @JsonProperty("lastName") String userLastName = "Venkman"; @JsonProperty String userAge = "35"; } public void testExplicitRename() throws Exception { ObjectMapper m = new ObjectMapper(); m.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES); m.enable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY); // by default, renaming will not take place on explicitly named fields assertEquals(aposToQuotes("{'firstName':'Peter','lastName':'Venkman','user_age':'35'}"), m.writeValueAsString(new ExplicitBean())); m = new ObjectMapper(); m.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES); m.enable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY); m.enable(MapperFeature.ALLOW_EXPLICIT_PROPERTY_RENAMING); // w/ feature enabled, ALL property names should get re-written assertEquals(aposToQuotes("{'first_name':'Peter','last_name':'Venkman','user_age':'35'}"), m.writeValueAsString(new ExplicitBean())); // test deserialization as well ExplicitBean bean = m.readValue(aposToQuotes("{'first_name':'Egon','last_name':'Spengler','user_age':'32'}"), ExplicitBean.class); assertNotNull(bean); assertEquals("Egon", bean.userFirstName); assertEquals("Spengler", bean.userLastName); assertEquals("32", bean.userAge); } ======= // Also verify that "no naming strategy" should be ok public void testExplicitNoNaming() throws Exception { ObjectMapper mapper = objectMapper(); String json = mapper.writeValueAsString(new DefaultNaming()); assertEquals(aposToQuotes("{'someValue':3}"), json); } >>>>>>> public void testExplicitRename() throws Exception { ObjectMapper m = new ObjectMapper(); m.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES); m.enable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY); // by default, renaming will not take place on explicitly named fields assertEquals(aposToQuotes("{'firstName':'Peter','lastName':'Venkman','user_age':'35'}"), m.writeValueAsString(new ExplicitBean())); m = new ObjectMapper(); m.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES); m.enable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY); m.enable(MapperFeature.ALLOW_EXPLICIT_PROPERTY_RENAMING); // w/ feature enabled, ALL property names should get re-written assertEquals(aposToQuotes("{'first_name':'Peter','last_name':'Venkman','user_age':'35'}"), m.writeValueAsString(new ExplicitBean())); // test deserialization as well ExplicitBean bean = m.readValue(aposToQuotes("{'first_name':'Egon','last_name':'Spengler','user_age':'32'}"), ExplicitBean.class); assertNotNull(bean); assertEquals("Egon", bean.userFirstName); assertEquals("Spengler", bean.userLastName); assertEquals("32", bean.userAge); } // Also verify that "no naming strategy" should be ok public void testExplicitNoNaming() throws Exception { ObjectMapper mapper = objectMapper(); String json = mapper.writeValueAsString(new DefaultNaming()); assertEquals(aposToQuotes("{'someValue':3}"), json); }
<<<<<<< mCameraThread = new HandlerThread("CAMERA"){ public void run(){ try{ ======= EasyApplication.module = DaggerMuxerModule.builder().mediaStream(this).build(); mCameraThread = new HandlerThread("CAMERA") { public void run() { try { >>>>>>> mCameraThread = new HandlerThread("CAMERA"){ public void run(){ try{ <<<<<<< ======= >>>>>>> <<<<<<< ======= try { SurfaceTexture holder = mSurfaceHolderRef.get(); if (holder != null) { mCamera.setPreviewTexture(holder); } } catch (IOException e) { e.printStackTrace(); } >>>>>>> try { SurfaceTexture holder = mSurfaceHolderRef.get(); if (holder != null) { mCamera.setPreviewTexture(holder); } } catch (IOException e) { e.printStackTrace(); }
<<<<<<< checkPendingWrites(); this.initialSize = unnamedTree.size(); this.initialNumTrees = unnamedTree.numTrees(); if (this.depth == 0) { LOGGER.debug("Normalization took {}. Changes: {}", sw.stop(), numPendingChanges); } return unnamedTree; } private void checkPendingWrites() { ======= checkPendingWrites(); this.initialSize = tree.size(); this.initialNumTrees = tree.numTrees(); if (this.depth == 0) { LOGGER.debug("Normalization took {}. Changes: {}", sw.stop(), numPendingChanges); } return tree; } private void checkPendingWrites() { >>>>>>> checkPendingWrites(); this.initialSize = tree.size(); this.initialNumTrees = tree.numTrees(); if (this.depth == 0) { LOGGER.debug("Normalization took {}. Changes: {}", sw.stop(), numPendingChanges); } return tree; } private void checkPendingWrites() { <<<<<<< newLeafTreesToSave = null; checkPendingWrites(); ======= checkPendingWrites(); >>>>>>> checkPendingWrites(); checkPendingWrites();
<<<<<<< import org.locationtech.geogig.model.RevFeatureType; import org.locationtech.geogig.model.RevObject; ======= import org.locationtech.geogig.model.RevObject; >>>>>>> import org.locationtech.geogig.model.RevFeatureType; import org.locationtech.geogig.model.RevObject; <<<<<<< import org.locationtech.geogig.plumbing.RevObjectParse; ======= import org.locationtech.geogig.plumbing.ResolveTreeish; import org.locationtech.geogig.plumbing.RevObjectParse; >>>>>>> import org.locationtech.geogig.plumbing.ResolveTreeish; import org.locationtech.geogig.plumbing.RevObjectParse; <<<<<<< import org.locationtech.geogig.repository.Hints; import org.locationtech.geogig.repository.NodeRef; import org.locationtech.geogig.repository.Repository; import org.locationtech.geogig.repository.RepositoryResolver; import org.locationtech.geogig.repository.WorkingTree; ======= import org.locationtech.geogig.repository.*; >>>>>>> import org.locationtech.geogig.repository.Hints; import org.locationtech.geogig.repository.IndexInfo; import org.locationtech.geogig.repository.NodeRef; import org.locationtech.geogig.repository.Repository; import org.locationtech.geogig.repository.RepositoryResolver; import org.locationtech.geogig.repository.WorkingTree; <<<<<<< private Map<String, String> variables = new HashMap<>(); ======= private Map<String, String> variables = new HashMap<>(); >>>>>>> private Map<String, String> variables = new HashMap<>(); <<<<<<< @Given("^I create a detached branch") public void I_create_a_detached_branch() throws Throwable { localRepo.runCommand(true, "log --oneline"); String actual = localRepo.stdOut.toString().replaceAll(LINE_SEPARATOR, "") .replaceAll("\\\\", "/"); String[] commitId = actual.split(" "); localRepo.runCommand(true, "checkout " + commitId[0]); } public void setVariable(String name, String value) { this.variables.put(name, value); } public String getVariable(String name) { return getVariable(name, this.variables); } static public String getVariable(String varName, Map<String, String> variables) { String varValue = variables.get(varName); Preconditions.checkState(varValue != null, "Variable " + varName + " does not exist"); return varValue; } public String replaceVariables(final String text) { return replaceVariables(text, this.variables, this); } public String replaceVariables(final String text, Map<String, String> variables, DefaultStepDefinitions defaultStepDefinitions) { String resource = text; int varIndex = -1; while ((varIndex = resource.indexOf("{@")) > -1) { for (int i = varIndex + 1; i < resource.length(); i++) { char c = resource.charAt(i); if (c == '}') { String varName = resource.substring(varIndex + 1, i); String varValue; if (defaultStepDefinitions != null && varName.startsWith("@ObjectId|")) { String[] parts = varName.split("\\|"); String repoName = parts[1]; // repoName for remote = "remoterepo", "localrepo" for local CLIContext context = contextProvider.getRepositoryContext(repoName); Repository repo = context.geogigCLI.getGeogig().getRepository(); String ref; Optional<RevObject> object; ref = parts[2]; object = repo.command(RevObjectParse.class).setRefSpec(ref).call(); if (object.isPresent()) { varValue = object.get().getId().toString(); } else { varValue = "specified ref doesn't exist"; } } else { varValue = getVariable(varName, variables); } String tmp = resource.replace("{" + varName + "}", varValue); resource = tmp; break; } } } return resource; } String replaceVariables(final String text, Map<String, String> variables) { return replaceVariables(text, variables, null); } ======= @Then("^the response should contain the index ID for tree \"([^\"]*)\"$") public void the_response_contains_indexID(String tree) throws Throwable { GeoGIG gig = localRepo.geogigCLI.getGeogig(); ObjectId canonicalTreeId = gig.command(ResolveTreeish.class).setTreeish("HEAD:" + tree).call().get(); Optional<IndexInfo> indexInfo = gig.getRepository().indexDatabase().getIndexInfo(tree,"pp"); Optional<ObjectId> indexedTree = gig.getRepository().indexDatabase().resolveIndexedTree(indexInfo.get(),canonicalTreeId); if (!indexedTree.isPresent()) { fail(); } String indexId = indexedTree.get().toString(); String actual = localRepo.stdOut.toString().replaceAll(LINE_SEPARATOR, "") .replaceAll("\\\\", "/"); assertTrue("'" + actual + "' does not contain ID '" + indexId.substring(0,8), actual.contains(indexId.toString().substring(0,8))); } @Then("^the response should contain index info ID for tree \"([^\"]*)\"$") public void the_response_contains_indexInfoID(String tree) throws Throwable { Repository repo = localRepo.geogigCLI.getGeogig().getRepository(); Optional<IndexInfo> indexInfo = repo.indexDatabase().getIndexInfo(tree,"pp"); ObjectId oid = null; if (indexInfo.isPresent()) { oid = indexInfo.get().getId(); } String actual = localRepo.stdOut.toString().replaceAll(LINE_SEPARATOR, "") .replaceAll("\\\\", "/"); if (oid == null) { fail(); } else { assertTrue("'" + actual + "' does not contain ID for '" + oid.toString(), actual.contains(oid.toString())); } } >>>>>>> @Given("^I create a detached branch") public void I_create_a_detached_branch() throws Throwable { localRepo.runCommand(true, "log --oneline"); String actual = localRepo.stdOut.toString().replaceAll(LINE_SEPARATOR, "") .replaceAll("\\\\", "/"); String[] commitId = actual.split(" "); localRepo.runCommand(true, "checkout " + commitId[0]); } @Then("^the response should contain the index ID for tree \"([^\"]*)\"$") public void the_response_contains_indexID(String tree) throws Throwable { GeoGIG gig = localRepo.geogigCLI.getGeogig(); ObjectId canonicalTreeId = gig.command(ResolveTreeish.class).setTreeish("HEAD:" + tree).call().get(); Optional<IndexInfo> indexInfo = gig.getRepository().indexDatabase().getIndexInfo(tree,"pp"); Optional<ObjectId> indexedTree = gig.getRepository().indexDatabase().resolveIndexedTree(indexInfo.get(),canonicalTreeId); if (!indexedTree.isPresent()) { fail(); } String indexId = indexedTree.get().toString(); String actual = localRepo.stdOut.toString().replaceAll(LINE_SEPARATOR, "") .replaceAll("\\\\", "/"); assertTrue("'" + actual + "' does not contain ID '" + indexId.substring(0,8), actual.contains(indexId.toString().substring(0,8))); } @Then("^the response should contain index info ID for tree \"([^\"]*)\"$") public void the_response_contains_indexInfoID(String tree) throws Throwable { Repository repo = localRepo.geogigCLI.getGeogig().getRepository(); Optional<IndexInfo> indexInfo = repo.indexDatabase().getIndexInfo(tree,"pp"); ObjectId oid = null; if (indexInfo.isPresent()) { oid = indexInfo.get().getId(); } String actual = localRepo.stdOut.toString().replaceAll(LINE_SEPARATOR, "") .replaceAll("\\\\", "/"); if (oid == null) { fail(); } else { assertTrue("'" + actual + "' does not contain ID for '" + oid.toString(), actual.contains(oid.toString())); } } public void setVariable(String name, String value) { this.variables.put(name, value); } public String getVariable(String name) { return getVariable(name, this.variables); } static public String getVariable(String varName, Map<String, String> variables) { String varValue = variables.get(varName); Preconditions.checkState(varValue != null, "Variable " + varName + " does not exist"); return varValue; } public String replaceVariables(final String text) { return replaceVariables(text, this.variables, this); } public String replaceVariables(final String text, Map<String, String> variables, DefaultStepDefinitions defaultStepDefinitions) { String resource = text; int varIndex = -1; while ((varIndex = resource.indexOf("{@")) > -1) { for (int i = varIndex + 1; i < resource.length(); i++) { char c = resource.charAt(i); if (c == '}') { String varName = resource.substring(varIndex + 1, i); String varValue; if (defaultStepDefinitions != null && varName.startsWith("@ObjectId|")) { String[] parts = varName.split("\\|"); String repoName = parts[1]; // repoName for remote = "remoterepo", "localrepo" for local CLIContext context = contextProvider.getRepositoryContext(repoName); Repository repo = context.geogigCLI.getGeogig().getRepository(); String ref; Optional<RevObject> object; ref = parts[2]; object = repo.command(RevObjectParse.class).setRefSpec(ref).call(); if (object.isPresent()) { varValue = object.get().getId().toString(); } else { varValue = "specified ref doesn't exist"; } } else { varValue = getVariable(varName, variables); } String tmp = resource.replace("{" + varName + "}", varValue); resource = tmp; break; } } } return resource; } String replaceVariables(final String text, Map<String, String> variables) { return replaceVariables(text, variables, null); }
<<<<<<< @ReactMethod public void removeTransmissionTargetEventProperty(String propertyKey, String targetToken, Promise promise) { AnalyticsTransmissionTarget transmissionTarget = mTransmissionTargets.get(targetToken); if (transmissionTarget != null) { PropertyConfigurator configurator = transmissionTarget.getPropertyConfigurator(); configurator.removeEventProperty(propertyKey); } promise.resolve(null); } @ReactMethod public void getChildTransmissionTarget(String childToken, String parentToken, Promise promise) { AnalyticsTransmissionTarget transmissionTarget = mTransmissionTargets.get(parentToken); if (transmissionTarget == null) { promise.resolve(null); return; } AnalyticsTransmissionTarget childTarget = transmissionTarget.getTransmissionTarget(childToken); if (childTarget == null) { promise.resolve(null); return; } mTransmissionTargets.put(childToken, childTarget); promise.resolve(childToken); } ======= @ReactMethod public void removeTransmissionTargetEventProperty(String propertyKey, String targetToken, Promise promise) { AnalyticsTransmissionTarget transmissionTarget = mTransmissionTargets.get(targetToken); if (transmissionTarget != null) { PropertyConfigurator configurator = transmissionTarget.getPropertyConfigurator(); configurator.removeEventProperty(propertyKey); } promise.resolve(null); } @ReactMethod public void setTransmissionTargetAppName(String appName, String targetToken, Promise promise) { AnalyticsTransmissionTarget transmissionTarget = mTransmissionTargets.get(targetToken); if (transmissionTarget != null) { PropertyConfigurator configurator = transmissionTarget.getPropertyConfigurator(); configurator.setAppName(appName); } promise.resolve(null); } @ReactMethod public void setTransmissionTargetAppVersion(String appVersion, String targetToken, Promise promise) { AnalyticsTransmissionTarget transmissionTarget = mTransmissionTargets.get(targetToken); if (transmissionTarget != null) { PropertyConfigurator configurator = transmissionTarget.getPropertyConfigurator(); configurator.setAppVersion(appVersion); } promise.resolve(null); } @ReactMethod public void setTransmissionTargetAppLocale(String appLocale, String targetToken, Promise promise) { AnalyticsTransmissionTarget transmissionTarget = mTransmissionTargets.get(targetToken); if (transmissionTarget != null) { PropertyConfigurator configurator = transmissionTarget.getPropertyConfigurator(); configurator.setAppLocale(appLocale); } promise.resolve(null); } >>>>>>> @ReactMethod public void removeTransmissionTargetEventProperty(String propertyKey, String targetToken, Promise promise) { AnalyticsTransmissionTarget transmissionTarget = mTransmissionTargets.get(targetToken); if (transmissionTarget != null) { PropertyConfigurator configurator = transmissionTarget.getPropertyConfigurator(); configurator.removeEventProperty(propertyKey); } promise.resolve(null); } @ReactMethod public void getChildTransmissionTarget(String childToken, String parentToken, Promise promise) { AnalyticsTransmissionTarget transmissionTarget = mTransmissionTargets.get(parentToken); if (transmissionTarget == null) { promise.resolve(null); return; } AnalyticsTransmissionTarget childTarget = transmissionTarget.getTransmissionTarget(childToken); if (childTarget == null) { promise.resolve(null); return; } mTransmissionTargets.put(childToken, childTarget); promise.resolve(childToken); } public void setTransmissionTargetAppName(String appName, String targetToken, Promise promise) { AnalyticsTransmissionTarget transmissionTarget = mTransmissionTargets.get(targetToken); if (transmissionTarget != null) { PropertyConfigurator configurator = transmissionTarget.getPropertyConfigurator(); configurator.setAppName(appName); } promise.resolve(null); } @ReactMethod public void setTransmissionTargetAppVersion(String appVersion, String targetToken, Promise promise) { AnalyticsTransmissionTarget transmissionTarget = mTransmissionTargets.get(targetToken); if (transmissionTarget != null) { PropertyConfigurator configurator = transmissionTarget.getPropertyConfigurator(); configurator.setAppVersion(appVersion); } promise.resolve(null); } @ReactMethod public void setTransmissionTargetAppLocale(String appLocale, String targetToken, Promise promise) { AnalyticsTransmissionTarget transmissionTarget = mTransmissionTargets.get(targetToken); if (transmissionTarget != null) { PropertyConfigurator configurator = transmissionTarget.getPropertyConfigurator(); configurator.setAppLocale(appLocale); } promise.resolve(null); }
<<<<<<< public final static int STD_PATH = 4; public final static int STD_CLASS = 5; public final static int STD_JAVA_TYPE = 6; public final static int STD_CURRENCY = 7; public final static int STD_PATTERN = 8; public final static int STD_LOCALE = 9; public final static int STD_CHARSET = 10; public final static int STD_TIME_ZONE = 11; public final static int STD_INET_ADDRESS = 12; public final static int STD_INET_SOCKET_ADDRESS = 13; public final static int STD_STRING_BUILDER = 14; ======= public final static int STD_CLASS = 4; public final static int STD_JAVA_TYPE = 5; public final static int STD_CURRENCY = 6; public final static int STD_PATTERN = 7; public final static int STD_LOCALE = 8; public final static int STD_CHARSET = 9; public final static int STD_TIME_ZONE = 10; public final static int STD_INET_ADDRESS = 11; public final static int STD_INET_SOCKET_ADDRESS = 12; // No longer implemented here since 2.12 // public final static int STD_STRING_BUILDER = 13; >>>>>>> public final static int STD_PATH = 4; public final static int STD_CLASS = 5; public final static int STD_JAVA_TYPE = 6; public final static int STD_CURRENCY = 7; public final static int STD_PATTERN = 8; public final static int STD_LOCALE = 9; public final static int STD_CHARSET = 10; public final static int STD_TIME_ZONE = 11; public final static int STD_INET_ADDRESS = 12; public final static int STD_INET_SOCKET_ADDRESS = 13; // No longer implemented here since 2.12 // public final static int STD_STRING_BUILDER = 14; <<<<<<< private static class NioPathHelper { private static final boolean areWindowsFilePathsSupported; static { boolean isWindowsRootFound = false; for (File file : File.listRoots()) { String path = file.getPath(); if (path.length() >= 2 && isLetter(path.charAt(0)) && path.charAt(1) == ':') { isWindowsRootFound = true; break; } } areWindowsFilePathsSupported = isWindowsRootFound; } public static Path deserialize(DeserializationContext ctxt, String value) throws IOException { // If someone gives us an input with no : at all, treat as local path, instead of failing // with invalid URI. if (value.indexOf(':') < 0) { return Paths.get(value); } if (areWindowsFilePathsSupported) { if (value.length() >= 2 && isLetter(value.charAt(0)) && value.charAt(1) == ':') { return Paths.get(value); } } final URI uri; try { uri = new URI(value); } catch (URISyntaxException e) { return (Path) ctxt.handleInstantiationProblem(Path.class, value, e); } try { return Paths.get(uri); } catch (FileSystemNotFoundException cause) { try { final String scheme = uri.getScheme(); // We want to use the current thread's context class loader, not system class loader that is used in Paths.get(): for (FileSystemProvider provider : ServiceLoader.load(FileSystemProvider.class)) { if (provider.getScheme().equalsIgnoreCase(scheme)) { return provider.getPath(uri); } } return (Path) ctxt.handleInstantiationProblem(Path.class, value, cause); } catch (Throwable e) { e.addSuppressed(cause); return (Path) ctxt.handleInstantiationProblem(Path.class, value, e); } } catch (Throwable e) { return (Path) ctxt.handleInstantiationProblem(Path.class, value, e); } } } ======= // @since 2.12 to simplify logic a bit: should not use coercions when reading // String Values static class StringBuilderDeserializer extends FromStringDeserializer<Object> { public StringBuilderDeserializer() { super(StringBuilder.class); } @Override public LogicalType logicalType() { return LogicalType.Textual; } @Override public Object getEmptyValue(DeserializationContext ctxt) throws JsonMappingException { return new StringBuilder(); } @Override public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { String text = p.getValueAsString(); if (text != null) { return _deserialize(text, ctxt); } return super.deserialize(p, ctxt); } @Override protected Object _deserialize(String value, DeserializationContext ctxt) throws IOException { return new StringBuilder(value); } } >>>>>>> // @since 2.12 to simplify logic a bit: should not use coercions when reading // String Values static class StringBuilderDeserializer extends FromStringDeserializer<Object> { public StringBuilderDeserializer() { super(StringBuilder.class); } @Override public LogicalType logicalType() { return LogicalType.Textual; } @Override public Object getEmptyValue(DeserializationContext ctxt) throws JsonMappingException { return new StringBuilder(); } @Override public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { String text = p.getValueAsString(); if (text != null) { return _deserialize(text, ctxt); } return super.deserialize(p, ctxt); } @Override protected Object _deserialize(String value, DeserializationContext ctxt) throws IOException { return new StringBuilder(value); } } private static class NioPathHelper { private static final boolean areWindowsFilePathsSupported; static { boolean isWindowsRootFound = false; for (File file : File.listRoots()) { String path = file.getPath(); if (path.length() >= 2 && isLetter(path.charAt(0)) && path.charAt(1) == ':') { isWindowsRootFound = true; break; } } areWindowsFilePathsSupported = isWindowsRootFound; } public static Path deserialize(DeserializationContext ctxt, String value) throws IOException { // If someone gives us an input with no : at all, treat as local path, instead of failing // with invalid URI. if (value.indexOf(':') < 0) { return Paths.get(value); } if (areWindowsFilePathsSupported) { if (value.length() >= 2 && isLetter(value.charAt(0)) && value.charAt(1) == ':') { return Paths.get(value); } } final URI uri; try { uri = new URI(value); } catch (URISyntaxException e) { return (Path) ctxt.handleInstantiationProblem(Path.class, value, e); } try { return Paths.get(uri); } catch (FileSystemNotFoundException cause) { try { final String scheme = uri.getScheme(); // We want to use the current thread's context class loader, not system class loader that is used in Paths.get(): for (FileSystemProvider provider : ServiceLoader.load(FileSystemProvider.class)) { if (provider.getScheme().equalsIgnoreCase(scheme)) { return provider.getPath(uri); } } return (Path) ctxt.handleInstantiationProblem(Path.class, value, cause); } catch (Throwable e) { e.addSuppressed(cause); return (Path) ctxt.handleInstantiationProblem(Path.class, value, e); } } catch (Throwable e) { return (Path) ctxt.handleInstantiationProblem(Path.class, value, e); } } }
<<<<<<< import android.support.annotation.Nullable; import android.support.annotation.StringRes; ======= import android.os.Build; >>>>>>> import android.support.annotation.Nullable; import android.support.annotation.StringRes; import android.os.Build; <<<<<<< @SuppressLint("StaticFieldLeak") // It is alright to store application context statically public class PocketPlaysApplication extends Application { private static Tracker mTracker; private static Context mContext; ======= public class PocketPlaysApplication extends MultiDexApplication { private Tracker mTracker; >>>>>>> @SuppressLint("StaticFieldLeak") // It is alright to store application context statically public class PocketPlaysApplication extends MultiDexApplication { private static Tracker mTracker; private static Context mContext; <<<<<<< initCastFunctionality(); mContext = this; ======= initNotificationChannels(); >>>>>>> mContext = this.getApplicationContext(); initCastFunctionality(); initNotificationChannels(); <<<<<<< public static void trackEvent(@StringRes int category, @StringRes int action, @Nullable String label) { PocketPlaysApplication.trackEvent(mContext.getString(category), mContext.getString(action), label, null); } public static void trackEvent(String category, String action, @Nullable String label, @Nullable Long value) { HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder().setCategory(category).setAction(action); if (label != null) { builder.setLabel(label); } if (value != null) { builder.setValue(value); } Tracker tracker = getDefaultTracker(); if (tracker != null && tracker.isInitialized() && !isCrawlerUpdate) { tracker.send(builder.build()); } } private void initCastFunctionality() { String applicationID = SecretKeys.CHROME_CAST_APPLICATION_ID; CastConfiguration options = new CastConfiguration.Builder(applicationID) .enableAutoReconnect() .enableDebug() .enableWifiReconnection() .setCastControllerImmersive(false) .setTargetActivity(LiveStreamActivity.class) .enableNotification() .addNotificationAction(CastConfiguration.NOTIFICATION_ACTION_PLAY_PAUSE, true) .addNotificationAction(CastConfiguration.NOTIFICATION_ACTION_DISCONNECT,true) .enableLockScreen() .build(); VideoCastManager castManager = VideoCastManager.initialize(getApplicationContext(), options); ======= private void initNotificationChannels() { NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O || notificationManager == null) { return; } notificationManager.createNotificationChannel( new NotificationChannel(getString(R.string.live_streamer_notification_id), "New Streamer is live", NotificationManager.IMPORTANCE_DEFAULT) ); notificationManager.createNotificationChannel( new NotificationChannel(getString(R.string.stream_cast_notification_id), "Stream Playback Control", NotificationManager.IMPORTANCE_DEFAULT) ); >>>>>>> public static void trackEvent(@StringRes int category, @StringRes int action, @Nullable String label) { PocketPlaysApplication.trackEvent(mContext.getString(category), mContext.getString(action), label, null); } public static void trackEvent(String category, String action, @Nullable String label, @Nullable Long value) { HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder().setCategory(category).setAction(action); if (label != null) { builder.setLabel(label); } if (value != null) { builder.setValue(value); } Tracker tracker = getDefaultTracker(); if (tracker != null && tracker.isInitialized() && !isCrawlerUpdate) { tracker.send(builder.build()); } } private void initCastFunctionality() { String applicationID = SecretKeys.CHROME_CAST_APPLICATION_ID; CastConfiguration options = new CastConfiguration.Builder(applicationID) .enableAutoReconnect() .enableDebug() .enableWifiReconnection() .setCastControllerImmersive(false) .setTargetActivity(LiveStreamActivity.class) .enableNotification() .addNotificationAction(CastConfiguration.NOTIFICATION_ACTION_PLAY_PAUSE, true) .addNotificationAction(CastConfiguration.NOTIFICATION_ACTION_DISCONNECT,true) .enableLockScreen() .build(); VideoCastManager castManager = VideoCastManager.initialize(getApplicationContext(), options); } private void initNotificationChannels() { NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O || notificationManager == null) { return; } notificationManager.createNotificationChannel( new NotificationChannel(getString(R.string.live_streamer_notification_id), "New Streamer is live", NotificationManager.IMPORTANCE_DEFAULT) ); notificationManager.createNotificationChannel( new NotificationChannel(getString(R.string.stream_cast_notification_id), "Stream Playback Control", NotificationManager.IMPORTANCE_DEFAULT) );
<<<<<<< ======= /* <!-- +++ import com.almalence.opencam_plus.MainScreen; import com.almalence.opencam_plus.PluginManager; import com.almalence.opencam_plus.PluginType; import com.almalence.opencam_plus.R; +++ --> */ // <!-- -+- import com.almalence.opencam.MainScreen; import com.almalence.opencam.PluginManager; import com.almalence.opencam.PluginType; import com.almalence.opencam.R; //-+- --> import com.almalence.ui.RotateDialog; import com.almalence.ui.RotateImageView; import com.almalence.ui.RotateLayout; >>>>>>> <<<<<<< np.setEnabled(false); ======= //np.setEnabled(false); bSet.setEnabled(false); >>>>>>> //np.setEnabled(false);
<<<<<<< if (isRecording) { // stop recording and release camera try { mMediaRecorder.stop(); // stop the recording } catch (Exception e) { e.printStackTrace(); Log.e("video OnShutterClick", "mMediaRecorder.stop() exception: " + e.getMessage()); } releaseMediaRecorder(); // release the MediaRecorder object camera.lock(); // take camera access back from MediaRecorder MainScreen.guiManager.lockControls = false; Message msg = new Message(); msg.arg1 = PluginManager.MSG_CONTROL_UNLOCKED; msg.what = PluginManager.MSG_BROADCAST; MainScreen.H.sendMessage(msg); // inform the user that recording has stopped isRecording = false; showRecordingUI(isRecording); prefs.edit().putBoolean("videorecording", false).commit(); Camera.Parameters cp = MainScreen.thiz.getCameraParameters(); if (cp!=null) { SetCameraPreviewSize(cp); MainScreen.guiManager.setupViewfinderPreviewSize(cp); if(Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH && videoStabilization) MainScreen.thiz.setVideoStabilization(false); } //change shutter icon MainScreen.guiManager.setShutterIcon(ShutterButton.RECORDER_START); ContentValues values=null; values = new ContentValues(7); values.put(ImageColumns.TITLE, fileSaved.getName().substring(0, fileSaved.getName().lastIndexOf("."))); values.put(ImageColumns.DISPLAY_NAME, fileSaved.getName()); values.put(ImageColumns.DATE_TAKEN, System.currentTimeMillis()); values.put(ImageColumns.MIME_TYPE, "video/mp4"); values.put(ImageColumns.DATA, fileSaved.getAbsolutePath()); if (filesList.size() > 0) { File firstFile = filesList.get(0); for (int i = 1; i < filesList.size(); i++) { File currentFile = filesList.get(i); try { append(firstFile.getAbsolutePath(), currentFile.getAbsolutePath()); } catch (Exception e) { e.printStackTrace(); } } // if not onPause, then last video isn't added to list. if (!onPause) { append(firstFile.getAbsolutePath(), fileSaved.getAbsolutePath()); } if (!filesList.get(0).getAbsoluteFile().equals(fileSaved.getAbsoluteFile())) { fileSaved.delete(); firstFile.renameTo(fileSaved); } } onPause = false; String[] filesSavedNames= new String[1]; filesSavedNames[0] = fileSaved.toString(); filesList.clear(); mRecordingTimeView.setText("00:00"); mRecorded = 0; MainScreen.thiz.getContentResolver().insert(Images.Media.EXTERNAL_CONTENT_URI, values); MediaScannerConnection.scanFile(MainScreen.thiz, filesSavedNames, null, null); } else releaseMediaRecorder(); ======= if (this.isRecording) { this.stopRecording(); } >>>>>>> if (this.isRecording) { this.stopRecording(); } <<<<<<< if (onPause) { startVideoRecording(); onPause = false; } // Pause video recording, merge files and remove last. else { onPause = true; try { // stop recording and release camera mMediaRecorder.stop(); // stop the recording ContentValues values=null; values = new ContentValues(7); values.put(ImageColumns.TITLE, fileSaved.getName().substring(0, fileSaved.getName().lastIndexOf("."))); values.put(ImageColumns.DISPLAY_NAME, fileSaved.getName()); values.put(ImageColumns.DATE_TAKEN, System.currentTimeMillis()); values.put(ImageColumns.MIME_TYPE, "video/mp4"); values.put(ImageColumns.DATA, fileSaved.getAbsolutePath()); filesList.add(fileSaved); } catch (RuntimeException e) { // Note that a RuntimeException is intentionally thrown to the application, // if no valid audio/video data has been received when stop() is called. // This happens if stop() is called immediately after start(). // The failure lets the application take action accordingly to clean up the output file (delete the output file, // for instance), since the output file is not properly constructed when this happens. fileSaved.delete(); e.printStackTrace(); } } ======= if (this.modeDRO()) { this.onPause = !this.onPause; this.droEngine.setPaused(this.onPause); } else { if (onPause) { startVideoRecording(); onPause = false; } // Pause video recording, merge files and remove last. else { onPause = true; // stop recording and release camera mMediaRecorder.stop(); // stop the recording ContentValues values=null; values = new ContentValues(7); values.put(ImageColumns.TITLE, fileSaved.getName().substring(0, fileSaved.getName().lastIndexOf("."))); values.put(ImageColumns.DISPLAY_NAME, fileSaved.getName()); values.put(ImageColumns.DATE_TAKEN, System.currentTimeMillis()); values.put(ImageColumns.MIME_TYPE, "video/mp4"); values.put(ImageColumns.DATA, fileSaved.getAbsolutePath()); filesList.add(fileSaved); } } >>>>>>> if (this.modeDRO()) { this.onPause = !this.onPause; this.droEngine.setPaused(this.onPause); } else { if (onPause) { startVideoRecording(); onPause = false; } // Pause video recording, merge files and remove last. else { onPause = true; try { // stop recording and release camera mMediaRecorder.stop(); // stop the recording ContentValues values=null; values = new ContentValues(7); values.put(ImageColumns.TITLE, fileSaved.getName().substring(0, fileSaved.getName().lastIndexOf("."))); values.put(ImageColumns.DISPLAY_NAME, fileSaved.getName()); values.put(ImageColumns.DATE_TAKEN, System.currentTimeMillis()); values.put(ImageColumns.MIME_TYPE, "video/mp4"); values.put(ImageColumns.DATA, fileSaved.getAbsolutePath()); filesList.add(fileSaved); } catch (RuntimeException e) { // Note that a RuntimeException is intentionally thrown to the application, // if no valid audio/video data has been received when stop() is called. // This happens if stop() is called immediately after start(). // The failure lets the application take action accordingly to clean up the output file (delete the output file, // for instance), since the output file is not properly constructed when this happens. fileSaved.delete(); e.printStackTrace(); } } }
<<<<<<< ======= import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.nio.ByteBuffer; >>>>>>> import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.nio.ByteBuffer; <<<<<<< import android.hardware.camera2.CaptureResult; ======= import android2.hardware.camera2.CaptureResult; import android.media.Image; >>>>>>> import android2.hardware.camera2.CaptureResult; import android.media.Image; <<<<<<< import com.almalence.SwapHeap; ======= import com.almalence.SwapHeap; import com.almalence.YuvImage; >>>>>>> import com.almalence.SwapHeap; import com.almalence.YuvImage; <<<<<<< requestID = CameraController.captureImage(1, CameraController.YUV); } catch (Exception e) ======= requestID = CameraController.captureImagesWithParams(1, CameraController.JPEG, new int[0], new int[0], false); } catch (Exception e) >>>>>>> requestID = CameraController.captureImagesWithParams(1, CameraController.JPEG, new int[0], new int[0], false); } catch (final Exception e) <<<<<<< if (isYUV) { goodPlace = this.engine.onFrameAdded(true, frame, true); } else { goodPlace = this.engine.onFrameAdded(false, frame, frame_len); } ======= if(frame == 0) frame = SwapHeap.SwapToHeap(frameData); goodPlace = this.engine.onImageTaken(frame, frameData, frame_len, isYUV); // goodPlace = this.engine.onPictureTaken(frameData); >>>>>>> if (frame == 0) { frame = SwapHeap.SwapToHeap(frameData); frame_len = frameData.length; } if (isYUV) { goodPlace = this.engine.onFrameAdded(true, frame, true); } else { goodPlace = this.engine.onFrameAdded(false, frame, frame_len); }
<<<<<<< // if (!isSlowMode) // { // byte[] data = null; // // if (mCameraMirrored) // { // data = PreShot.GetFromBufferNV21(i, 0, 0, 1); // } else // data = PreShot.GetFromBufferNV21(i, 0, 0, 0); // // if (data.length == 0) // { // return null; // } // // int frame = SwapHeap.SwapToHeap(data); // // PluginManager.getInstance().addToSharedMem("resultframe" + (i + // 1) + sessionID, String.valueOf(frame)); // PluginManager.getInstance().addToSharedMem("resultframelen" + (i // + 1) + sessionID, // String.valueOf(data.length)); // // } else if (isSlowMode) // { // byte[] data = PreShot.GetFromBufferSimpleNV21(i, // ApplicationScreen.getImageHeight(), // ApplicationScreen.getImageWidth()); // // if (data.length == 0) // { // return null; // } // // int frame = SwapHeap.SwapToHeap(data); // // PluginManager.getInstance().addToSharedMem("resultframe" + (i + // 1) + sessionID, String.valueOf(frame)); // PluginManager.getInstance().addToSharedMem("resultframelen" + (i // + 1) + sessionID, // String.valueOf(data.length)); // PluginManager.getInstance().addToSharedMem("resultframeformat" + // (i + 1) + sessionID, "jpeg"); // } ======= >>>>>>> <<<<<<< // put save button on screen mSaveButton = new Button(ApplicationScreen.instance); ======= // put save this button on screen mSaveButton = new Button(MainScreen.getInstance()); >>>>>>> // put save button on screen mSaveButton = new Button(ApplicationScreen.instance); <<<<<<< // put save button on screen mSaveAllButton = new Button(ApplicationScreen.instance); ======= // put save all button on screen mSaveAllButton = new Button(MainScreen.getInstance()); >>>>>>> // put save button on screen mSaveAllButton = new Button(ApplicationScreen.instance);
<<<<<<< public BaseResponse handle(JsonPath jsonPath, QueryParams queryParams, RequestBody requestBody) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { ======= public BaseResponse handle(JsonPath jsonPath, RequestParams requestParams, RepositoryMethodParameterProvider parameterProvider, RequestBody requestBody) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, NoSuchFieldException { >>>>>>> public BaseResponse handle(JsonPath jsonPath, QueryParams queryParams, RepositoryMethodParameterProvider parameterProvider, RequestBody requestBody) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, NoSuchFieldException { <<<<<<< .findManyTargets(castedResourceId, elementName, queryParams); MetaInformation metaInformation = getMetaInformation(relationshipRepositoryForClass, targetObjects, queryParams); LinksInformation linksInformation = getLinksInformation(relationshipRepositoryForClass, targetObjects, queryParams); target = new CollectionResponse(targetObjects, jsonPath, queryParams, metaInformation, linksInformation); ======= .findManyTargets(castedResourceId, elementName, requestParams); includeFieldSetter.setIncludedElements(targetObjects, requestParams, parameterProvider); MetaInformation metaInformation = getMetaInformation(relationshipRepositoryForClass, targetObjects, requestParams); LinksInformation linksInformation = getLinksInformation(relationshipRepositoryForClass, targetObjects, requestParams); target = new CollectionResponse(targetObjects, jsonPath, requestParams, metaInformation, linksInformation); >>>>>>> .findManyTargets(castedResourceId, elementName, queryParams); includeFieldSetter.setIncludedElements(targetObjects, queryParams, parameterProvider); MetaInformation metaInformation = getMetaInformation(relationshipRepositoryForClass, targetObjects, queryParams); LinksInformation linksInformation = getLinksInformation(relationshipRepositoryForClass, targetObjects, queryParams); target = new CollectionResponse(targetObjects, jsonPath, queryParams, metaInformation, linksInformation); <<<<<<< Object targetObject = relationshipRepositoryForClass.findOneTarget(castedResourceId, elementName, queryParams); ======= Object targetObject = relationshipRepositoryForClass.findOneTarget(castedResourceId, elementName, requestParams); includeFieldSetter.setIncludedElements(targetObject, requestParams, parameterProvider); >>>>>>> Object targetObject = relationshipRepositoryForClass.findOneTarget(castedResourceId, elementName, queryParams); includeFieldSetter.setIncludedElements(targetObject, queryParams, parameterProvider); <<<<<<< getMetaInformation(relationshipRepositoryForClass, Collections.singletonList(targetObject), queryParams); ======= getMetaInformation(relationshipRepositoryForClass, Collections.singletonList(targetObject), requestParams); >>>>>>> getMetaInformation(relationshipRepositoryForClass, Collections.singletonList(targetObject), queryParams); <<<<<<< getLinksInformation(relationshipRepositoryForClass, Collections.singletonList(targetObject), queryParams); target = new ResourceResponse(targetObject, jsonPath, queryParams, metaInformation, linksInformation); ======= getLinksInformation(relationshipRepositoryForClass, Collections.singletonList(targetObject), requestParams); target = new ResourceResponse(targetObject, jsonPath, requestParams, metaInformation, linksInformation); >>>>>>> getLinksInformation(relationshipRepositoryForClass, Collections.singletonList(targetObject), queryParams); target = new ResourceResponse(targetObject, jsonPath, queryParams, metaInformation, linksInformation);
<<<<<<< BaseResponse taskResponse = resourcePost.handle(taskPath, new QueryParams(), newTaskBody); ======= BaseResponse taskResponse = resourcePost.handle(taskPath, new RequestParams(new ObjectMapper()), null, newTaskBody); >>>>>>> BaseResponse taskResponse = resourcePost.handle(taskPath, new QueryParams(), null, newTaskBody); <<<<<<< ResourceResponse projectResponse = resourcePost.handle(projectPath, new QueryParams(), newProjectBody); ======= ResourceResponse projectResponse = resourcePost.handle(projectPath, new RequestParams(OBJECT_MAPPER), null, newProjectBody); >>>>>>> ResourceResponse projectResponse = resourcePost.handle(projectPath, new QueryParams(), null, newProjectBody); <<<<<<< BaseResponse projectRelationshipResponse = relationshipsResourcePost.handle(savedTaskPath, new QueryParams(), newTaskToProjectBody); ======= BaseResponse projectRelationshipResponse = relationshipsResourcePost.handle(savedTaskPath, new RequestParams(OBJECT_MAPPER), null, newTaskToProjectBody); >>>>>>> BaseResponse projectRelationshipResponse = relationshipsResourcePost.handle(savedTaskPath, new QueryParams(), null, newTaskToProjectBody); <<<<<<< BaseResponse result = sut.handle(savedTaskPath, new QueryParams(), newTaskToProjectBody); ======= BaseResponse result = sut.handle(savedTaskPath, new RequestParams(OBJECT_MAPPER), null, newTaskToProjectBody); >>>>>>> BaseResponse result = sut.handle(savedTaskPath, new QueryParams(), null, newTaskToProjectBody); <<<<<<< BaseResponse taskResponse = resourcePost.handle(taskPath, new QueryParams(), newUserBody); ======= BaseResponse taskResponse = resourcePost.handle(taskPath, new RequestParams(new ObjectMapper()), null, newUserBody); >>>>>>> BaseResponse taskResponse = resourcePost.handle(taskPath, new QueryParams(), null, newUserBody); <<<<<<< ResourceResponse projectResponse = resourcePost.handle(projectPath, new QueryParams(), newProjectBody); ======= ResourceResponse projectResponse = resourcePost.handle(projectPath, new RequestParams(OBJECT_MAPPER), null, newProjectBody); >>>>>>> ResourceResponse projectResponse = resourcePost.handle(projectPath, new QueryParams(), null, newProjectBody); <<<<<<< BaseResponse projectRelationshipResponse = relationshipsResourcePost.handle(savedTaskPath, new QueryParams(), newTaskToProjectBody); ======= BaseResponse projectRelationshipResponse = relationshipsResourcePost.handle(savedTaskPath, new RequestParams(OBJECT_MAPPER), null, newTaskToProjectBody); >>>>>>> BaseResponse projectRelationshipResponse = relationshipsResourcePost.handle(savedTaskPath, new QueryParams(), null, newTaskToProjectBody); <<<<<<< BaseResponse result = sut.handle(savedTaskPath, new QueryParams(), newTaskToProjectBody); ======= BaseResponse result = sut.handle(savedTaskPath, new RequestParams(OBJECT_MAPPER), null, newTaskToProjectBody); >>>>>>> BaseResponse result = sut.handle(savedTaskPath, new QueryParams(), null, newTaskToProjectBody);
<<<<<<< import java.util.HashMap; import java.util.Map; ======= import java.util.List; import java.util.concurrent.ConcurrentHashMap; >>>>>>> import java.util.List; import java.util.concurrent.ConcurrentHashMap; <<<<<<< public User findOne(Long aLong, QueryParams queryParams) { User user = THREAD_LOCAL_REPOSITORY.get().get(aLong); ======= public User findOne(Long aLong, RequestParams requestParams) { User user = THREAD_LOCAL_REPOSITORY.get(aLong); >>>>>>> public User findOne(Long aLong, QueryParams queryParams) { User user = THREAD_LOCAL_REPOSITORY.get(aLong); <<<<<<< public Iterable<User> findAll(QueryParams queryParams) { return THREAD_LOCAL_REPOSITORY.get().values(); ======= public Iterable<User> findAll(RequestParams requestParams) { return THREAD_LOCAL_REPOSITORY.values(); >>>>>>> public Iterable<User> findAll(QueryParams queryParams) { return THREAD_LOCAL_REPOSITORY.values(); <<<<<<< public Iterable<User> findAll(Iterable<Long> ids, QueryParams queryParams) { return THREAD_LOCAL_REPOSITORY.get().values() ======= public Iterable<User> findAll(Iterable<Long> ids, RequestParams requestParams) { return THREAD_LOCAL_REPOSITORY.values() >>>>>>> public Iterable<User> findAll(Iterable<Long> ids, QueryParams queryParams) { return THREAD_LOCAL_REPOSITORY.values()
<<<<<<< ======= import io.katharsis.resource.mock.repository.TaskToProjectRepository; import io.katharsis.response.HttpStatus; >>>>>>> import io.katharsis.resource.mock.repository.TaskToProjectRepository; import io.katharsis.response.HttpStatus; <<<<<<< private static final QueryParams REQUEST_PARAMS = new QueryParams(); ======= >>>>>>> <<<<<<< sut.handle(projectPath, new QueryParams(), newProjectBody); ======= sut.handle(projectPath, new RequestParams(new ObjectMapper()), null, newProjectBody); >>>>>>> sut.handle(projectPath, new QueryParams(), null, newProjectBody); <<<<<<< sut.handle(new ResourcePath("fridges"), new QueryParams(), newProjectBody); ======= sut.handle(new ResourcePath("fridges"), new RequestParams(new ObjectMapper()), null, newProjectBody); >>>>>>> sut.handle(new ResourcePath("fridges"), new QueryParams(), null, newProjectBody); <<<<<<< sut.handle(new ResourcePath("fridges"), new QueryParams(), null); ======= sut.handle(new ResourcePath("fridges"), new RequestParams(new ObjectMapper()), null, null); >>>>>>> sut.handle(new ResourcePath("fridges"), new QueryParams(), null, null); <<<<<<< ResourceResponse projectResponse = sut.handle(projectPath, new QueryParams(), newProjectBody); ======= ResourceResponse projectResponse = sut.handle(projectPath, new RequestParams(new ObjectMapper()), null, newProjectBody); >>>>>>> ResourceResponse projectResponse = sut.handle(projectPath, new QueryParams(), null, newProjectBody); <<<<<<< ResourceResponse taskResponse = sut.handle(taskPath, new QueryParams(), newTaskBody); ======= ResourceResponse taskResponse = sut.handle(taskPath, new RequestParams(new ObjectMapper()), null, newTaskBody); >>>>>>> ResourceResponse taskResponse = sut.handle(taskPath, new QueryParams(), null, newTaskBody); <<<<<<< ResourceResponse projectResponse = sut.handle(projectPath, new QueryParams(), newProjectBody); ======= ResourceResponse projectResponse = sut.handle(projectPath, new RequestParams(new ObjectMapper()), null, newProjectBody); >>>>>>> ResourceResponse projectResponse = sut.handle(projectPath, new QueryParams(), null, newProjectBody); <<<<<<< ResourceResponse taskResponse = sut.handle(taskPath, new QueryParams(), newUserBody); ======= ResourceResponse taskResponse = sut.handle(taskPath, new RequestParams(new ObjectMapper()), null, newUserBody); >>>>>>> ResourceResponse taskResponse = sut.handle(taskPath, new QueryParams(), null, newUserBody); <<<<<<< ResourceResponse memorandumResponse = sut.handle(projectPath, new QueryParams(), newMemorandumBody); ======= ResourceResponse memorandumResponse = sut.handle(projectPath, new RequestParams(new ObjectMapper()), null, newMemorandumBody); >>>>>>> ResourceResponse memorandumResponse = sut.handle(projectPath, new QueryParams(), null, newMemorandumBody);
<<<<<<< public final BaseResponse<?> handle(JsonPath jsonPath, QueryParams queryParams, RequestBody requestBody) throws Exception { ======= public final BaseResponse<?> handle(JsonPath jsonPath, RequestParams requestParams, RepositoryMethodParameterProvider parameterProvider, RequestBody requestBody) throws Exception { >>>>>>> public final BaseResponse<?> handle(JsonPath jsonPath, QueryParams queryParams, RepositoryMethodParameterProvider parameterProvider, RequestBody requestBody) throws Exception { <<<<<<< getMetaInformation(resourceRepository, Collections.singletonList(resource), queryParams); ======= getMetaInformation(resourceRepository, Collections.singletonList(resource), requestParams); LinksInformation linksInformation = getLinksInformation(resourceRepository, Collections.singletonList(resource), requestParams); >>>>>>> getMetaInformation(resourceRepository, Collections.singletonList(resource), queryParams); LinksInformation linksInformation = getLinksInformation(resourceRepository, Collections.singletonList(resource), queryParams);
<<<<<<< private static final QueryParams REQUEST_PARAMS = new QueryParams(); ======= >>>>>>> <<<<<<< public void onNonExistentParentResourceShouldThrowException() throws Exception { // GIVEN RequestBody newProjectBody = new RequestBody(); DataBody data = new DataBody(); newProjectBody.setData(data); data.setType("projects"); data.setAttributes(OBJECT_MAPPER.createObjectNode().put("name", "sample project")); JsonPath projectPath = pathBuilder.buildPath("/tasks/-1/project"); FieldResourcePost sut = new FieldResourcePost(resourceRegistry, typeParser, OBJECT_MAPPER); // THEN expectedException.expect(ResourceNotFoundException.class); // WHEN sut.handle(projectPath, new QueryParams(), newProjectBody); } @Test ======= >>>>>>> <<<<<<< BaseResponse taskResponse = resourcePost.handle(taskPath, new QueryParams(), newTaskBody); ======= BaseResponse taskResponse = resourcePost.handle(taskPath, new RequestParams(objectMapper), null, newTaskBody); >>>>>>> BaseResponse taskResponse = resourcePost.handle(taskPath, new QueryParams(), null, newTaskBody); <<<<<<< ResourceResponse projectResponse = sut.handle(projectPath, new QueryParams(), newProjectBody); ======= ResourceResponse projectResponse = sut.handle(projectPath, new RequestParams(objectMapper), null, newProjectBody); >>>>>>> ResourceResponse projectResponse = sut.handle(projectPath, new QueryParams(), null, newProjectBody);
<<<<<<< import io.katharsis.queryParams.QueryParams; ======= import io.katharsis.queryParams.RequestParams; import io.katharsis.repository.RepositoryMethodParameterProvider; >>>>>>> import io.katharsis.queryParams.QueryParams; import io.katharsis.repository.RepositoryMethodParameterProvider; <<<<<<< public ResourceResponse handle(JsonPath jsonPath, QueryParams queryParams, RequestBody requestBody) ======= public ResourceResponse handle(JsonPath jsonPath, RequestParams requestParams, RepositoryMethodParameterProvider parameterProvider, RequestBody requestBody) >>>>>>> public ResourceResponse handle(JsonPath jsonPath, QueryParams queryParams, RepositoryMethodParameterProvider parameterProvider, RequestBody requestBody) <<<<<<< ResourceRepository resourceRepository = endpointRegistryEntry.getResourceRepository(); setRelations(newResource, bodyRegistryEntry, dataBody, queryParams); ======= ResourceRepository resourceRepository = endpointRegistryEntry.getResourceRepository(parameterProvider); setRelations(newResource, bodyRegistryEntry, dataBody, requestParams, parameterProvider); >>>>>>> ResourceRepository resourceRepository = endpointRegistryEntry.getResourceRepository(parameterProvider); setRelations(newResource, bodyRegistryEntry, dataBody, queryParams, parameterProvider); <<<<<<< return new ResourceResponse(savedResourceWithRelations, jsonPath, queryParams, metaInformation, linksInformation); ======= return new ResourceResponse(savedResourceWithRelations, jsonPath, requestParams, metaInformation, linksInformation, HttpStatus.CREATED_201); >>>>>>> return new ResourceResponse(savedResourceWithRelations, jsonPath, queryParams, metaInformation, linksInformation, HttpStatus.CREATED_201);
<<<<<<< BaseResponse taskResponse = resourcePost.handle(taskPath, new QueryParams(), newTaskBody); ======= BaseResponse taskResponse = resourcePost.handle(taskPath, new RequestParams(new ObjectMapper()), null, newTaskBody); >>>>>>> BaseResponse taskResponse = resourcePost.handle(taskPath, new QueryParams(), null, newTaskBody); <<<<<<< ResourceResponse projectResponse = resourcePost.handle(projectPath, new QueryParams(), newProjectBody); ======= ResourceResponse projectResponse = resourcePost.handle(projectPath, new RequestParams(OBJECT_MAPPER), null, newProjectBody); >>>>>>> ResourceResponse projectResponse = resourcePost.handle(projectPath, new QueryParams(), null, newProjectBody); <<<<<<< BaseResponse projectRelationshipResponse = sut.handle(savedTaskPath, new QueryParams(), newTaskToProjectBody); ======= BaseResponse projectRelationshipResponse = sut.handle(savedTaskPath, new RequestParams(OBJECT_MAPPER), null, newTaskToProjectBody); >>>>>>> BaseResponse projectRelationshipResponse = sut.handle(savedTaskPath, new QueryParams(), null, newTaskToProjectBody); <<<<<<< BaseResponse taskResponse = resourcePost.handle(taskPath, new QueryParams(), newUserBody); ======= BaseResponse taskResponse = resourcePost.handle(taskPath, new RequestParams(new ObjectMapper()), null, newUserBody); >>>>>>> BaseResponse taskResponse = resourcePost.handle(taskPath, new QueryParams(), null, newUserBody); <<<<<<< ResourceResponse projectResponse = resourcePost.handle(projectPath, new QueryParams(), newProjectBody); ======= ResourceResponse projectResponse = resourcePost.handle(projectPath, new RequestParams(OBJECT_MAPPER), null, newProjectBody); >>>>>>> ResourceResponse projectResponse = resourcePost.handle(projectPath, new QueryParams(), null, newProjectBody); <<<<<<< BaseResponse projectRelationshipResponse = sut.handle(savedTaskPath, new QueryParams(), newTaskToProjectBody); ======= BaseResponse projectRelationshipResponse = sut.handle(savedTaskPath, new RequestParams(OBJECT_MAPPER), null, newTaskToProjectBody); >>>>>>> BaseResponse projectRelationshipResponse = sut.handle(savedTaskPath, new QueryParams(), null, newTaskToProjectBody);
<<<<<<< sut.handle(new ResourcePath("fridges"), new QueryParams(), null); ======= sut.handle(new ResourcePath("fridges"), new RequestParams(new ObjectMapper()), null, null); >>>>>>> sut.handle(new ResourcePath("fridges"), new QueryParams(), null, null); <<<<<<< ResourcePost resourcePost = new ResourcePost(resourceRegistry, typeParser, OBJECT_MAPPER); ResourceResponse taskResponse = resourcePost.handle(taskPath, new QueryParams(), newTaskBody); ======= ResourcePost resourcePost = new ResourcePost(resourceRegistry, typeParser, objectMapper); ResourceResponse taskResponse = resourcePost.handle(taskPath, new RequestParams(new ObjectMapper()), null, newTaskBody); >>>>>>> ResourcePost resourcePost = new ResourcePost(resourceRegistry, typeParser, objectMapper); ResourceResponse taskResponse = resourcePost.handle(taskPath, new QueryParams(), null, newTaskBody); <<<<<<< BaseResponse<?> response = sut.handle(jsonPath, new QueryParams(), taskPatch); ======= BaseResponse<?> response = sut.handle(jsonPath, new RequestParams(new ObjectMapper()), null, taskPatch); >>>>>>> BaseResponse<?> response = sut.handle(jsonPath, new QueryParams(), null, taskPatch); <<<<<<< ResourceResponse taskResponse = resourcePost.handle(documentsPath, new QueryParams(), memorandumBody); ======= ResourceResponse taskResponse = resourcePost.handle(documentsPath, new RequestParams(new ObjectMapper()), null, memorandumBody); >>>>>>> ResourceResponse taskResponse = resourcePost.handle(documentsPath, new QueryParams()), null, memorandumBody); <<<<<<< BaseResponse memorandumResponse = sut.handle(documentPath, new QueryParams(), memorandumBody); ======= BaseResponse memorandumResponse = sut.handle(documentPath, new RequestParams(new ObjectMapper()), null, memorandumBody); >>>>>>> BaseResponse memorandumResponse = sut.handle(documentPath, new QueryParams(), null, memorandumBody); <<<<<<< ResourcePost resourcePost = new ResourcePost(resourceRegistry, typeParser, OBJECT_MAPPER); ResourceResponse taskResponse = resourcePost.handle(taskPath, new QueryParams(), newTaskBody); ======= ResourcePost resourcePost = new ResourcePost(resourceRegistry, typeParser, objectMapper); ResourceResponse taskResponse = resourcePost.handle(taskPath, new RequestParams(new ObjectMapper()), null, newTaskBody); >>>>>>> ResourcePost resourcePost = new ResourcePost(resourceRegistry, typeParser, objectMapper); ResourceResponse taskResponse = resourcePost.handle(taskPath, new QueryParams(), null, newTaskBody); <<<<<<< BaseResponse<?> response = sut.handle(jsonPath, new QueryParams(), taskPatch); ======= BaseResponse<?> response = sut.handle(jsonPath, new RequestParams(new ObjectMapper()), null, taskPatch); >>>>>>> BaseResponse<?> response = sut.handle(jsonPath, new QueryParams(), null, taskPatch);
<<<<<<< import io.katharsis.queryParams.QueryParams; ======= import io.katharsis.queryParams.RequestParams; import io.katharsis.repository.RepositoryMethodParameterProvider; >>>>>>> import io.katharsis.repository.RepositoryMethodParameterProvider; import io.katharsis.queryParams.QueryParams; <<<<<<< * @param queryParams built object containing query parameters of the request ======= * @param requestParams built object containing query parameters of the request * @param parameterProvider repository method parameter provider >>>>>>> * @param parameterProvider repository method parameter provider * @param queryParams built object containing query parameters of the request <<<<<<< public BaseResponse<?> dispatchRequest(JsonPath jsonPath, String requestType, QueryParams queryParams, ======= public BaseResponse<?> dispatchRequest(JsonPath jsonPath, String requestType, RequestParams requestParams, RepositoryMethodParameterProvider parameterProvider, >>>>>>> public BaseResponse<?> dispatchRequest(JsonPath jsonPath, String requestType, QueryParams queryParams, RepositoryMethodParameterProvider parameterProvider, <<<<<<< .handle(jsonPath, queryParams, requestBody); ======= .handle(jsonPath, requestParams, parameterProvider, requestBody); >>>>>>> .handle(jsonPath, queryParams, parameterProvider, requestBody);
<<<<<<< import io.katharsis.queryParams.QueryParams; import io.katharsis.repository.RelationshipRepository; ======= import io.katharsis.queryParams.RequestParams; import io.katharsis.repository.annotations.*; >>>>>>> import io.katharsis.queryParams.QueryParams; import io.katharsis.repository.annotations.*; <<<<<<< @Override public Project findOneTarget(Long sourceId, String fieldName, QueryParams queryParams) { Set<Relation<User>> relations = THREAD_LOCAL_REPOSITORY.get(); for (Relation<User> relation : relations) { ======= @JsonApiFindOneTarget public Project findOneTarget(Long sourceId, String fieldName, RequestParams requestParams) { for (Relation<User> relation : THREAD_LOCAL_REPOSITORY.keySet()) { >>>>>>> @JsonApiFindOneTarget public Project findOneTarget(Long sourceId, String fieldName, QueryParams queryParams) { for (Relation<User> relation : THREAD_LOCAL_REPOSITORY.keySet()) { <<<<<<< @Override public Iterable<Project> findManyTargets(Long sourceId, String fieldName, QueryParams queryParams) { ======= @JsonApiFindManyTargets public Iterable<Project> findManyTargets(Long sourceId, String fieldName, RequestParams requestParams) { >>>>>>> @JsonApiFindManyTargets public Iterable<Project> findManyTargets(Long sourceId, String fieldName, QueryParams queryParams) {
<<<<<<< public ResourceResponse handle(JsonPath jsonPath, QueryParams queryParams, RequestBody requestBody) ======= public ResourceResponse handle(JsonPath jsonPath, RequestParams requestParams, RepositoryMethodParameterProvider parameterProvider, RequestBody requestBody) >>>>>>> public ResourceResponse handle(JsonPath jsonPath, QueryParams queryParams, RepositoryMethodParameterProvider parameterProvider, RequestBody requestBody) <<<<<<< Object parent = endpointRegistryEntry.getResourceRepository() .findOne(castedResourceId, queryParams); ======= Object parent = endpointRegistryEntry.getResourceRepository(parameterProvider).findOne(castedResourceId, requestParams); >>>>>>> Object parent = endpointRegistryEntry.getResourceRepository(parameterProvider).findOne(castedResourceId, queryParams); <<<<<<< return new ResourceResponse(savedResourceWithRelations, jsonPath, queryParams, metaInformation, linksInformation); ======= return new ResourceResponse(savedResourceWithRelations, jsonPath, requestParams, metaInformation, linksInformation, HttpStatus.CREATED_201); >>>>>>> return new ResourceResponse(savedResourceWithRelations, jsonPath, queryParams, metaInformation, linksInformation, HttpStatus.CREATED_201);
<<<<<<< ======= import io.katharsis.resource.annotations.JsonApiId; import io.katharsis.resource.annotations.JsonApiResource; import io.katharsis.resource.exception.ResourceException; import io.katharsis.resource.exception.ResourceFieldException; >>>>>>> import io.katharsis.resource.annotations.JsonApiId; import io.katharsis.resource.annotations.JsonApiResource; import io.katharsis.resource.exception.ResourceException; import io.katharsis.resource.exception.ResourceFieldException; <<<<<<< import static org.assertj.core.api.Assertions.assertThat; ======= import java.util.List; import static org.assertj.core.api.Assertions.*; >>>>>>> import static org.assertj.core.api.Assertions.assertThat; import java.util.List; import static org.assertj.core.api.Assertions.*; <<<<<<< public void onValidResourceShouldReturnEntityInformation() { // GIVEN ResourceInformationBuilder sut = new ResourceInformationBuilder(); // WHEN ResourceInformation resourceInformation = sut.build(Task.class); // THEN assertThat(resourceInformation.getResourceClass()).isEqualTo(Task.class); Assert.assertEquals("id", resourceInformation.getIdField().getName()); Assert.assertEquals(1, resourceInformation.getAttributeFields().size()); Assert.assertEquals("name", resourceInformation.getAttributeFields().iterator().next().getName()); Assert.assertEquals(1, resourceInformation.getRelationshipFields().size()); Assert.assertEquals("project", resourceInformation.getRelationshipFields().iterator().next().getName()); ======= public void shouldHaveResourceClassInfoForValidResource() throws Exception { ResourceInformation resourceInformation = resourceInformationBuilder.build(Task.class); assertThat(resourceInformation.getResourceClass()) .isNotNull() .isEqualTo(Task.class); >>>>>>> public void shouldHaveResourceClassInfoForValidResource() throws Exception { ResourceInformation resourceInformation = resourceInformationBuilder.build(Task.class); // WHEN ResourceInformation resourceInformation = sut.build(Task.class); // THEN assertThat(resourceInformation.getResourceClass()).isEqualTo(Task.class); Assert.assertEquals("id", resourceInformation.getIdField().getName()); Assert.assertEquals(1, resourceInformation.getAttributeFields().size()); Assert.assertEquals("name", resourceInformation.getAttributeFields().iterator().next().getName()); Assert.assertEquals(1, resourceInformation.getRelationshipFields().size()); Assert.assertEquals("project", resourceInformation.getRelationshipFields().iterator().next().getName()); assertThat(resourceInformation.getResourceClass()) .isNotNull() .isEqualTo(Task.class); <<<<<<< ======= @Test public void shouldThrowExceptionWhenMoreThan1IdAnnotationFound() throws Exception { expectedException.expect(ResourceException.class); expectedException.expectMessage("Duplicated Id field found in class"); resourceInformationBuilder.build(DuplicatedIdResource.class); } @Test public void shouldHaveProperBasicFieldInfoForValidResource() throws Exception { ResourceInformation resourceInformation = resourceInformationBuilder.build(Task.class); assertThat(resourceInformation.getBasicFields()) .isNotNull() .hasSize(1) .extracting(NAME_PROPERTY) .containsOnly("name"); } @Test public void shouldHaveProperRelationshipFieldInfoForValidResource() throws Exception { ResourceInformation resourceInformation = resourceInformationBuilder.build(Task.class); assertThat(resourceInformation.getRelationshipFields()) .isNotNull() .hasSize(1) .extracting(NAME_PROPERTY) .containsOnly("project"); } @Test public void onResourceWithRestrictedBasicFieldShouldThrowException() { expectedException.expect(ResourceFieldException.class); resourceInformationBuilder.build(RestrictedBasicFieldResource.class); } @Test public void onResourceWithRestrictedRelationshipFieldShouldThrowException() { expectedException.expect(ResourceFieldException.class); resourceInformationBuilder.build(RestrictedRelationshipFieldResource.class); } @JsonApiResource(type = "duplicatedIdAnnotationResources") private static class DuplicatedIdResource { @JsonApiId private Long id; @JsonApiId private Long id2; } @JsonApiResource(type = "restrictedBasicFieldResources") private static class RestrictedBasicFieldResource { @JsonApiId private Long id; private String meta; } @JsonApiResource(type = "restrictedRelationshipFieldResources") private static class RestrictedRelationshipFieldResource { @JsonApiId private Long id; private List<String> links; } >>>>>>> @Test public void shouldThrowExceptionWhenMoreThan1IdAnnotationFound() throws Exception { expectedException.expect(ResourceException.class); expectedException.expectMessage("Duplicated Id field found in class"); resourceInformationBuilder.build(DuplicatedIdResource.class); } @Test public void shouldHaveProperBasicFieldInfoForValidResource() throws Exception { ResourceInformation resourceInformation = resourceInformationBuilder.build(Task.class); assertThat(resourceInformation.getBasicFields()) .isNotNull() .hasSize(1) .extracting(NAME_PROPERTY) .containsOnly("name"); } @Test public void shouldHaveProperRelationshipFieldInfoForValidResource() throws Exception { ResourceInformation resourceInformation = resourceInformationBuilder.build(Task.class); assertThat(resourceInformation.getRelationshipFields()) .isNotNull() .hasSize(1) .extracting(NAME_PROPERTY) .containsOnly("project"); } @JsonApiResource(type = "duplicatedIdAnnotationResources") private static class DuplicatedIdResource { @JsonApiId private Long id; @JsonApiId private Long id2; }
<<<<<<< import com.fasterxml.jackson.annotation.JsonIncludeProperties; ======= >>>>>>> <<<<<<< ======= /** * @since 2.8 */ public static MapSerializer construct(Set<String> ignoredEntries, JavaType mapType, boolean staticValueType, TypeSerializer vts, JsonSerializer<Object> keySerializer, JsonSerializer<Object> valueSerializer, Object filterId) { return construct(ignoredEntries, null, mapType, staticValueType, vts, keySerializer, valueSerializer, filterId); } /** * @since 2.9 */ >>>>>>> <<<<<<< JsonIgnoreProperties.Value ignorals = intr.findPropertyIgnoralByName(config, propertyAcc); if (ignorals != null){ Set<String> newIgnored = ignorals.findIgnoredForSerialization(); if (_nonEmpty(newIgnored)) { ignored = (ignored == null) ? new HashSet<String>() : new HashSet<String>(ignored); for (String str : newIgnored) { ignored.add(str); } ======= final SerializationConfig config = provider.getConfig(); // ignorals Set<String> newIgnored = intr.findPropertyIgnoralByName(config, propertyAcc).findIgnoredForSerialization(); if (_nonEmpty(newIgnored)) { ignored = (ignored == null) ? new HashSet<String>() : new HashSet<String>(ignored); for (String str : newIgnored) { ignored.add(str); >>>>>>> Set<String> newIgnored = intr.findPropertyIgnoralByName(config, propertyAcc).findIgnoredForSerialization(); if (_nonEmpty(newIgnored)) { ignored = (ignored == null) ? new HashSet<String>() : new HashSet<String>(ignored); for (String str : newIgnored) { ignored.add(str); <<<<<<< if (propertyAcc != null) { Object filterId = intr.findFilterId(config, propertyAcc); if (filterId != null) { mser = mser.withFilterId(filterId); ======= if (propertyAcc != null) { Object filterId = intr.findFilterId(propertyAcc); if (filterId != null) { mser = mser.withFilterId(filterId); >>>>>>> if (propertyAcc != null) { Object filterId = intr.findFilterId(config, propertyAcc); if (filterId != null) { mser = mser.withFilterId(filterId);
<<<<<<< protected void validateParams() throws PubNubException { if (channelGroup==null || channelGroup.isEmpty()) { throw PubNubException.builder().pubnubError(PubNubErrorBuilder.PNERROBJ_GROUP_MISSING).build(); ======= protected void validateParams() throws PubNubException { if (channelGroup == null || channelGroup.isEmpty()) { throw PubNubException.builder().pubnubError(PubNubError.PNERROBJ_GROUP_MISSING).build(); >>>>>>> protected void validateParams() throws PubNubException { if (channelGroup == null || channelGroup.isEmpty()) { throw PubNubException.builder().pubnubError(PubNubErrorBuilder.PNERROBJ_GROUP_MISSING).build();
<<<<<<< import com.pubnub.api.builder.PubNubErrorBuilder; import com.pubnub.api.utils.Base64; ======= import com.pubnub.api.vendor.Base64; >>>>>>> import com.pubnub.api.builder.PubNubErrorBuilder; import com.pubnub.api.vendor.Base64; <<<<<<< /** * Returns decoded String * * @param sUrl * , input string * @return , decoded string */ public static String urlDecode(String sUrl) { try { return URLDecoder.decode(sUrl, "UTF-8"); } catch (UnsupportedEncodingException e) { return null; } } public static String preparePamArguments(Map<String, String> pamArgs){ ======= public static String preparePamArguments(Map<String, String> pamArgs) { >>>>>>> /** * Returns decoded String * * @param sUrl * , input string * @return , decoded string */ public static String urlDecode(String sUrl) { try { return URLDecoder.decode(sUrl, "UTF-8"); } catch (UnsupportedEncodingException e) { return null; } } public static String preparePamArguments(Map<String, String> pamArgs) {
<<<<<<< import org.archive.modules.extractor.Link; import org.archive.modules.revisit.RevisitProfile; ======= import org.archive.modules.deciderules.recrawl.IdenticalDigestDecideRule; >>>>>>> import org.archive.modules.revisit.RevisitProfile;
<<<<<<< import java.io.InterruptedIOException; import java.io.Reader; import java.io.UnsupportedEncodingException; import java.net.Inet4Address; import java.net.InetAddress; import java.net.NetworkInterface; import java.net.ServerSocket; import java.net.Socket; import java.net.SocketTimeoutException; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Date; ======= >>>>>>> <<<<<<< import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; ======= >>>>>>> <<<<<<< import org.apache.commons.httpclient.URIException; import org.apache.commons.io.IOUtils; import org.apache.http.NoHttpResponseException; import org.apache.http.client.CookieStore; import org.apache.http.cookie.Cookie; import org.apache.http.impl.client.BasicCookieStore; import org.archive.checkpointing.Checkpoint; import org.archive.httpclient.ConfigurableX509TrustManager.TrustLevel; import org.archive.modules.CrawlMetadata; import org.archive.modules.CrawlURI; import org.archive.modules.CrawlURI.FetchType; ======= import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestSuite; >>>>>>> import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestSuite; <<<<<<< import org.archive.modules.credential.HttpAuthenticationCredential; import org.archive.modules.deciderules.RejectDecideRule; import org.archive.modules.recrawl.FetchHistoryProcessor; import org.archive.net.UURI; import org.archive.net.UURIFactory; import org.archive.util.OneLineSimpleLogger; import org.archive.util.Recorder; ======= >>>>>>> <<<<<<< private static Logger logger = Logger.getLogger(FetchHTTPTest.class.getName()); static { Logger.getLogger("").setLevel(Level.FINE); for (java.util.logging.Handler h: Logger.getLogger("").getHandlers()) { h.setLevel(Level.ALL); h.setFormatter(new OneLineSimpleLogger()); } } ======= // private static Logger logger = Logger.getLogger(FetchHTTPTest.class.getName()); // // /* uncomment this for detailed logging from jetty and heritrix */ // static { // Logger.getLogger("").setLevel(Level.FINE); // for (java.util.logging.Handler h: Logger.getLogger("").getHandlers()) { // h.setLevel(Level.ALL); // h.setFormatter(new OneLineSimpleLogger()); // } // } >>>>>>> // private static Logger logger = Logger.getLogger(FetchHTTPTest.class.getName()); // static { // Logger.getLogger("").setLevel(Level.FINE); // for (java.util.logging.Handler h: Logger.getLogger("").getHandlers()) { // h.setLevel(Level.ALL); // h.setFormatter(new OneLineSimpleLogger()); // } // } <<<<<<< }); httpProxyServer.start(true, false); try { fetcher().setHttpProxyHost("localhost"); fetcher().setHttpProxyPort(7877); fetcher().setHttpProxyUser("http-proxy-user"); fetcher().setHttpProxyPassword("http-proxy-password"); CrawlURI curi = makeCrawlURI("http://localhost:7777/"); fetcher().process(curi); // logger.info('\n' + httpRequestString(curi) + "\n\n" + rawResponseString(curi)); String requestString = httpRequestString(curi); assertTrue(requestString.startsWith("GET http://localhost:7777/ HTTP/1.0\r\n")); assertTrue(requestString.contains("Proxy-Connection: close\r\n")); assertNull(proxiedRequestRememberer.getLastProxiedRequest()); // request didn't make it this far assertEquals(407, curi.getFetchStatus()); // fetch original again now that credentials should be populated proxiedRequestRememberer.clear(); curi = makeCrawlURI("http://localhost:7777/"); fetcher().process(curi); // logger.info('\n' + httpRequestString(curi) + "\n\n" + rawResponseString(curi)); requestString = httpRequestString(curi); assertTrue(requestString.startsWith("GET http://localhost:7777/ HTTP/1.0\r\n")); assertTrue(requestString.contains("Proxy-Connection: close\r\n")); assertNotNull(curi.getHttpResponseHeader("Via")); assertNotNull(proxiedRequestRememberer.getLastProxiedRequest()); runDefaultChecks(curi, "requestLine"); } finally { httpProxyServer.stop(); } } public void testMaxFetchKBSec() throws Exception { ensureHttpServers(); CrawlURI curi = makeCrawlURI("http://localhost:7777/200k"); fetcher().setMaxFetchKBSec(100); fetcher().process(curi); assertEquals(200000, curi.getContentLength()); assertTrue(curi.getFetchDuration() > 1800 && curi.getFetchDuration() < 2200); } public void testMaxLengthBytes() throws Exception { ensureHttpServers(); CrawlURI curi = makeCrawlURI("http://localhost:7777/200k"); fetcher().setMaxLengthBytes(50000); fetcher().process(curi); assertEquals(50001, curi.getRecordedSize()); } public void testSendRange() throws Exception { ensureHttpServers(); CrawlURI curi = makeCrawlURI("http://localhost:7777/200k"); fetcher().setMaxLengthBytes(50000); fetcher().setSendRange(true); fetcher().process(curi); // logger.info("\n" + httpRequestString(curi)); assertTrue(httpRequestString(curi).contains("Range: bytes=0-49999\r\n")); // XXX make server honor range and inspect response? // assertEquals(50000, curi.getRecordedSize()); } public void testSendIfModifiedSince() throws Exception { ensureHttpServers(); fetcher().setSendIfModifiedSince(true); CrawlURI curi = makeCrawlURI("http://localhost:7777/"); fetcher().process(curi); assertFalse(httpRequestString(curi).toLowerCase().contains("if-modified-since")); assertTrue(curi.getHttpResponseHeader("last-modified").equals("Thu, 01 Jan 1970 00:00:00 GMT")); runDefaultChecks(curi); // logger.info("before FetchHistoryProcessor fetchHistory=" + Arrays.toString(curi.getFetchHistory())); FetchHistoryProcessor fetchHistoryProcessor = new FetchHistoryProcessor(); fetchHistoryProcessor.process(curi); // logger.info("after FetchHistoryProcessor fetchHistory=" + Arrays.toString(curi.getFetchHistory())); fetcher().process(curi); // logger.info("\n" + httpRequestString(curi)); assertTrue(httpRequestString(curi).contains("If-Modified-Since: Thu, 01 Jan 1970 00:00:00 GMT\r\n")); runDefaultChecks(curi); // XXX make server send 304 not-modified and check for it here? } public void testSendIfNoneMatch() throws Exception { ensureHttpServers(); fetcher().setSendIfNoneMatch(true); CrawlURI curi = makeCrawlURI("http://localhost:7777/"); fetcher().process(curi); assertFalse(httpRequestString(curi).toLowerCase().contains("if-none-match")); assertTrue(curi.getHttpResponseHeader("etag").equals(ETAG_TEST_VALUE)); runDefaultChecks(curi); logger.info("before FetchHistoryProcessor fetchHistory=" + Arrays.toString(curi.getFetchHistory())); FetchHistoryProcessor fetchHistoryProcessor = new FetchHistoryProcessor(); fetchHistoryProcessor.process(curi); logger.info("after FetchHistoryProcessor fetchHistory=" + Arrays.toString(curi.getFetchHistory())); fetcher().process(curi); logger.info("\n" + httpRequestString(curi)); assertTrue(httpRequestString(curi).contains("If-None-Match: " + ETAG_TEST_VALUE + "\r\n")); runDefaultChecks(curi); // XXX make server send 304 not-modified and check for it here? } public void testShouldFetchBodyRule() throws Exception { ensureHttpServers(); CrawlURI curi = makeCrawlURI("http://localhost:7777/"); fetcher().setShouldFetchBodyRule(new RejectDecideRule()); fetcher().process(curi); logger.info('\n' + httpRequestString(curi) + "\n\n" + rawResponseString(curi)); assertTrue(httpRequestString(curi).startsWith("GET / HTTP/1.0\r\n")); assertEquals("text/plain;charset=US-ASCII", curi.getContentType()); assertTrue(curi.getCredentials().isEmpty()); assertTrue(curi.getFetchDuration() >= 0); assertTrue(curi.getFetchStatus() == 200); assertTrue(curi.getFetchType() == FetchType.HTTP_GET); // check for empty body assertEquals(0, curi.getContentLength()); assertEquals(curi.getContentSize(), curi.getRecordedSize()); assertEquals("", messageBodyString(curi)); assertEquals("", entityString(curi)); } public void testFetchTimeout() throws Exception { ensureHttpServers(); CrawlURI curi = makeCrawlURI("http://localhost:7777/slow.txt"); fetcher().setTimeoutSeconds(2); fetcher().process(curi); // logger.info('\n' + httpRequestString(curi) + "\n\n" + rawResponseString(curi)); assertTrue(curi.getAnnotations().contains("timeTrunc")); assertTrue(curi.getFetchDuration() >= 2000 && curi.getFetchDuration() < 2200); } // see http://stackoverflow.com/questions/100841/artificially-create-a-connection-timeout-error public void testConnectionTimeout() throws Exception { CrawlURI curi = makeCrawlURI("http://10.255.255.1/"); fetcher().setSoTimeoutMs(300); long start = System.currentTimeMillis(); fetcher().process(curi); long elapsed = System.currentTimeMillis() - start; assertTrue(elapsed >= 300 && elapsed < 400); // Httpcomponents throws org.apache.http.conn.ConnectTimeoutException, // commons-httpclient throws java.net.SocketTimeoutException. Both are // instances of InterruptedIOException assertEquals(1, curi.getNonFatalFailures().size()); assertTrue(curi.getNonFatalFailures().toArray()[0] instanceof InterruptedIOException); assertTrue(curi.getNonFatalFailures().toArray()[0].toString().matches("(?i).*connect.*timed out.*")); assertEquals(FetchStatusCodes.S_CONNECT_FAILED, curi.getFetchStatus()); assertEquals(0, curi.getFetchCompletedTime()); } // XXX testSocketTimeout() (the other kind) - how to simulate? public void testSslTrustLevel() throws Exception { // default "open" trust level ensureHttpServers(); CrawlURI curi = makeCrawlURI("https://localhost:7443/"); fetcher().process(curi); runDefaultChecks(curi, "hostHeader"); // "normal" trust level curi = makeCrawlURI("https://localhost:7443/"); fetcher().setSslTrustLevel(TrustLevel.NORMAL); fetcher().process(curi); assertEquals(1, curi.getNonFatalFailures().size()); assertTrue(curi.getNonFatalFailures().toArray()[0] instanceof SSLHandshakeException); assertEquals(FetchStatusCodes.S_CONNECT_FAILED, curi.getFetchStatus()); assertEquals(0, curi.getFetchCompletedTime()); } public void testHttp11() throws Exception { ensureHttpServers(); CrawlURI curi = makeCrawlURI("http://localhost:7777/"); fetcher().setUseHTTP11(true); fetcher().process(curi); assertTrue(httpRequestString(curi).startsWith("GET / HTTP/1.1\r\n")); // what else? runDefaultChecks(curi, "requestLine"); } public void testChunked() throws Exception { ensureHttpServers(); CrawlURI curi = makeCrawlURI("http://localhost:7777/chunked.txt"); fetcher().setUseHTTP11(true); fetcher().setSendConnectionClose(false); /* XXX Server expects us to close the connection apparently. But we * don't detect end of chunked transfer. With these small timeouts we * can finish quickly. A couple of SocketTimeoutExceptions will happen * within RecordingInputStream.readFullyOrUntil(). */ fetcher().setSoTimeoutMs(500); fetcher().setTimeoutSeconds(1); fetcher().process(curi); // logger.info('\n' + httpRequestString(curi) + "\n\n" + rawResponseString(curi)); // logger.info("\n----- rawResponseString -----\n" + rawResponseString(curi)); // logger.info("\n----- contentString -----\n" + contentString(curi)); // logger.info("\n----- entityString -----\n" + entityString(curi)); // logger.info("\n----- messageBodyString -----\n" + messageBodyString(curi)); assertEquals("chunked", curi.getHttpResponseHeader("transfer-encoding")); assertEquals("25\r\n" + DEFAULT_PAYLOAD_STRING + "\r\n0\r\n\r\n", messageBodyString(curi)); assertEquals(DEFAULT_PAYLOAD_STRING, entityString(curi)); assertEquals(DEFAULT_PAYLOAD_STRING, contentString(curi)); } protected static class NoResponseServer extends Thread { protected String listenAddress; protected int listenPort; protected boolean isTimeToBeDone = false; public NoResponseServer(String address, int port) { this.listenAddress = address; this.listenPort = port; } @Override public void run() { try { ServerSocket listeningSocket = new ServerSocket(listenPort, 0, Inet4Address.getByName(listenAddress)); listeningSocket.setSoTimeout(600); while (!isTimeToBeDone) { try { Socket connectionSocket = listeningSocket.accept(); connectionSocket.shutdownOutput(); } catch (SocketTimeoutException e) { ======= @Override protected void tearDown() throws Exception { super.tearDown(); if (httpServers != null) { for (Server server: httpServers.values()) { server.stop(); server.destroy(); >>>>>>> @Override protected void tearDown() throws Exception { super.tearDown(); if (httpServers != null) { for (Server server: httpServers.values()) { server.stop(); server.destroy();
<<<<<<< if (input == presumedUsernameInput()) { nameVals.add(TextUtils.urlEscape(input.name) + "=" + TextUtils.urlEscape(username)); } else if (input == candidatePasswordInputs.get(0)) { nameVals.add(TextUtils.urlEscape(input.name) + "=" + TextUtils.urlEscape(password)); ======= if (input == candidateUsernameInputs.get(0)) { nameVals.add(new NameValue(input.name, username)); } else if(input == candidatePasswordInputs.get(0)) { nameVals.add(new NameValue(input.name, password)); >>>>>>> if (input == presumedUsernameInput()) { nameVals.add(new NameValue(input.name, username)); } else if(input == candidatePasswordInputs.get(0)) { nameVals.add(new NameValue(input.name, password));
<<<<<<< import static org.archive.modules.recrawl.RecrawlAttributeConstants.A_FETCH_HISTORY; ======= import static org.archive.modules.recrawl.RecrawlAttributeConstants.A_CONTENT_DIGEST_HISTORY; >>>>>>> import static org.archive.modules.recrawl.RecrawlAttributeConstants.A_FETCH_HISTORY; import static org.archive.modules.recrawl.RecrawlAttributeConstants.A_CONTENT_DIGEST_HISTORY; <<<<<<< @SuppressWarnings("unchecked") public HashMap<String, Object>[] getFetchHistory() { return (HashMap<String,Object>[]) getData().get(A_FETCH_HISTORY); } ======= public HashMap<String, Object> getContentDigestHistory() { @SuppressWarnings("unchecked") HashMap<String, Object> contentDigestHistory = (HashMap<String, Object>) getData().get(A_CONTENT_DIGEST_HISTORY); if (contentDigestHistory == null) { contentDigestHistory = new HashMap<String, Object>(); getData().put(A_CONTENT_DIGEST_HISTORY, contentDigestHistory); } return contentDigestHistory; } public boolean hasContentDigestHistory() { return getData().get(A_CONTENT_DIGEST_HISTORY) != null; } >>>>>>> @SuppressWarnings("unchecked") public HashMap<String, Object>[] getFetchHistory() { return (HashMap<String,Object>[]) getData().get(A_FETCH_HISTORY); } public HashMap<String, Object> getContentDigestHistory() { @SuppressWarnings("unchecked") HashMap<String, Object> contentDigestHistory = (HashMap<String, Object>) getData().get(A_CONTENT_DIGEST_HISTORY); if (contentDigestHistory == null) { contentDigestHistory = new HashMap<String, Object>(); getData().put(A_CONTENT_DIGEST_HISTORY, contentDigestHistory); } return contentDigestHistory; } public boolean hasContentDigestHistory() { return getData().get(A_CONTENT_DIGEST_HISTORY) != null; }
<<<<<<< ======= private SolrServer solrServer; private TopicDao messageDao; @Autowired private CommentService commentService; @Autowired private MsgbaseDao msgbaseDao; >>>>>>> @Autowired private CommentService commentService; @Autowired private MsgbaseDao msgbaseDao; <<<<<<< @Autowired private CommentDao commentDao; @Autowired private MsgbaseDao msgbaseDao; ======= >>>>>>>
<<<<<<< import ru.org.linux.csrf.CSRFProtectionService; ======= import ru.org.linux.edithistory.EditHistoryDto; import ru.org.linux.edithistory.EditHistoryObjectTypeEnum; import ru.org.linux.edithistory.EditHistoryService; import ru.org.linux.site.MemCachedSettings; >>>>>>> import ru.org.linux.csrf.CSRFProtectionService; import ru.org.linux.edithistory.EditHistoryDto; import ru.org.linux.edithistory.EditHistoryObjectTypeEnum; import ru.org.linux.edithistory.EditHistoryService; import ru.org.linux.site.MemCachedSettings; <<<<<<< ======= import ru.org.linux.spring.commons.CacheProvider; import ru.org.linux.spring.dao.MessageText; >>>>>>> import ru.org.linux.spring.commons.CacheProvider; import ru.org.linux.spring.dao.MessageText; <<<<<<< ======= import java.sql.Timestamp; import java.util.ArrayList; import java.util.HashSet; import java.util.List; >>>>>>> import java.sql.Timestamp; import java.util.ArrayList; import java.util.HashSet; import java.util.List;
<<<<<<< /** * Множество всех имен тэгов */ private final ImmutableSet<String> allTagsNames; /** * Конструктор * @param flags флаги которые влияют на созданный объект */ public Parser(EnumSet<ParserFlags> flags) { ======= public Parser(Set<ParserFlags> flags) { // разрешенные параметры для [list] >>>>>>> /** * Множество всех имен тэгов */ private final ImmutableSet<String> allTagsNames; /** * Конструктор * @param flags флаги которые влияют на созданный объект */ public Parser(Set<ParserFlags> flags) {
<<<<<<< import java.lang.Integer; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; ======= >>>>>>> import java.lang.Integer;
<<<<<<< if (author.getScore()>=200) { return ParserUtil.bb2xhtml(message, includeCut, false, getLink(), db); ======= if (author.getScore()>=100) { return ParserUtil.bb2xhtml(message, includeCut, getLink(), db); >>>>>>> if (author.getScore()>=100) { return ParserUtil.bb2xhtml(message, includeCut, false, getLink(), db);
<<<<<<< if (author.getScore()>=200) { return ParserUtil.bb2xhtml(text, true, true, "", db); ======= if (author.getScore()>=100) { return ParserUtil.bb2xhtml(text, true, "", db); >>>>>>> if (author.getScore()>=100) { return ParserUtil.bb2xhtml(text, true, true, "", db); <<<<<<< if (author.getScore()>=200) { return ParserUtil.bb2xhtml(message, true, true, "", db); ======= if (author.getScore()>=100) { return ParserUtil.bb2xhtml(message, true, "", db); >>>>>>> if (author.getScore()>=100) { return ParserUtil.bb2xhtml(message, true, true, "", db);
<<<<<<< @ApiModelProperty(notes = N_TEAM_ID, example = E_TEAM_ID) private Integer teamId; @ApiModelProperty(notes = N_CREATEDBY, example = E_CREATEDBY) private String createdBy; public String getCreatedBy() { return createdBy; } public void setCreatedBy(String createdBy) { this.createdBy = createdBy; } ======= @ApiModelProperty(notes = "标签") private List<LabelDTO> labels; >>>>>>> @ApiModelProperty(notes = "标签") private List<LabelDTO> labels; @ApiModelProperty(notes = N_TEAM_ID, example = E_TEAM_ID) private Integer teamId; @ApiModelProperty(notes = N_CREATEDBY, example = E_CREATEDBY) private String createdBy; public String getCreatedBy() { return createdBy; } public void setCreatedBy(String createdBy) { this.createdBy = createdBy; } <<<<<<< public Integer getTeamId() { return teamId; } public void setTeamId(Integer teamId) { this.teamId = teamId; } ======= public List<LabelDTO> getLabels() { return labels; } public void setLabels(List<LabelDTO> labels) { this.labels = labels; } >>>>>>> public List<LabelDTO> getLabels() { return labels; } public void setLabels(List<LabelDTO> labels) { this.labels = labels; } public Integer getTeamId() { return teamId; } public void setTeamId(Integer teamId) { this.teamId = teamId; }
<<<<<<< Objects.requireNonNull(patternDefinitions); patternDefinitions.forEach((name, pattern) -> register(name, pattern)); ======= Preconditions.checkNotNull(patternDefinitions); patternDefinitions.forEach(this::register); >>>>>>> Objects.requireNonNull(patternDefinitions); patternDefinitions.forEach(this::register);
<<<<<<< import java.time.ZoneId; import java.time.ZoneOffset; ======= import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.Serializable; >>>>>>> import java.time.ZoneId; <<<<<<< ======= * Create a {@code Grok} instance with the given patterns file and * a {@code Grok} pattern. * * @param grokPatternPath Path to the pattern file * @param grokExpression - <b>OPTIONAL</b> - Grok pattern to compile ex: %{APACHELOG} * @return {@code Grok} instance * @throws GrokException runtime expt */ public static Grok create(String grokPatternPath, String grokExpression) throws GrokException { if (StringUtils.isBlank(grokPatternPath)) { throw new GrokException("{grokPatternPath} should not be empty or null"); } Grok g = new Grok(); g.addPatternFromFile(grokPatternPath); if (StringUtils.isNotBlank(grokExpression)) { g.compile(grokExpression, false); } return g; } /** * Create a {@code Grok} instance with included default patterns. * @return {@code Grok} instance */ public static Grok create() throws GrokException { Grok g = new Grok(); g.addPatternFromClasspath("/patterns/patterns"); return g; } /** * Create a {@code Grok} instance with the given grok patterns file. * * @param grokPatternPath : Path to the pattern file * @return Grok * @throws GrokException runtime expt */ public static Grok create(String grokPatternPath) throws GrokException { return create(grokPatternPath, null); } /** * Add custom pattern to grok in the runtime. * * @param name : Pattern Name * @param pattern : Regular expression Or {@code Grok} pattern * @throws GrokException runtime expt **/ public void addPattern(String name, String pattern) throws GrokException { if (StringUtils.isBlank(name)) { throw new GrokException("Invalid Pattern name"); } if (StringUtils.isBlank(pattern)) { throw new GrokException("Invalid Pattern"); } grokPatternDefinition.put(name, pattern); } /** * Copy the given Map of patterns (pattern name, regular expression) to {@code Grok}, * duplicate element will be override. * * @param cpy : Map to copy * @throws GrokException runtime expt **/ public void copyPatterns(Map<String, String> cpy) throws GrokException { if (cpy == null) { throw new GrokException("Invalid Patterns"); } if (cpy.isEmpty()) { throw new GrokException("Invalid Patterns"); } for (Map.Entry<String, String> entry : cpy.entrySet()) { grokPatternDefinition.put(entry.getKey().toString(), entry.getValue().toString()); } } /** >>>>>>> <<<<<<< public String getOriginalGrokPattern(){ return originalGrokPattern; ======= public void addPatternFromFile(String file) throws GrokException { File f = new File(file); if (!f.exists()) { throw new GrokException("Pattern file "+ f.getAbsolutePath() + " not found"); } if (!f.canRead()) { throw new GrokException("Pattern file "+ f.getAbsolutePath() + " cannot be read"); } try (FileReader r = new FileReader(f)) { addPatternFromReader(r); } catch (IOException e) { throw new GrokException(e.getMessage(), e); } } public void addPatternFromClasspath(String path) throws GrokException { final InputStream inputStream = this.getClass().getResourceAsStream(path); try (Reader r = new InputStreamReader(inputStream)) { addPatternFromReader(r); } catch (IOException e) { throw new GrokException(e.getMessage(), e); } >>>>>>> public String getOriginalGrokPattern(){ return originalGrokPattern; <<<<<<< public String getNamedRegexCollectionById(String id) { return namedRegexCollection.get(id); ======= public void addPatternFromReader(Reader r) throws GrokException { BufferedReader br = new BufferedReader(r); String line; // We dont want \n and commented line Pattern pattern = Pattern.compile("^([A-z0-9_]+)\\s+(.*)$"); try { while ((line = br.readLine()) != null) { Matcher m = pattern.matcher(line); if (m.matches()) { this.addPattern(m.group(1), m.group(2)); } } br.close(); } catch (IOException | GrokException e) { throw new GrokException(e.getMessage(), e); } >>>>>>> public String getNamedRegexCollectionById(String id) { return namedRegexCollection.get(id);
<<<<<<< ======= /** * Method that subclasses may call for standard handling of an exception thrown when * calling constructor or factory method. Will unwrap {@link ExceptionInInitializerError} * and {@link InvocationTargetException}s, then call {@link #wrapAsJsonMappingException}. * * @since 2.7 */ >>>>>>> /** * Method that subclasses may call for standard handling of an exception thrown when * calling constructor or factory method. Will unwrap {@link ExceptionInInitializerError} * and {@link InvocationTargetException}s, then call {@link #wrapAsJsonMappingException}. */
<<<<<<< if (assemblyConfig != null) { String descriptor = assemblyConfig.getDescriptor(); if (descriptor != null) { return new String[]{EnvUtil.prepareAbsolutePath(params.getSourceDirectory(), descriptor).getAbsolutePath()}; } ======= String descriptor = assemblyConfig.getDescriptor(); if (descriptor != null) { return new String[] { EnvUtil.prepareAbsolutePath(params, descriptor).getAbsolutePath() }; } else { return new String[0]; >>>>>>> if (assemblyConfig != null) { String descriptor = assemblyConfig.getDescriptor(); if (descriptor != null) { return new String[] { EnvUtil.prepareAbsolutePath(params, descriptor).getAbsolutePath() }; }
<<<<<<< /** * @component */ private DockerAssemblyManager dockerAssemblyManager; /** @parameter property = "docker.showLogs" default-value="false" */ private boolean showLogs; ======= /** @component */ private DockerArchiveCreator dockerArchiveCreator; >>>>>>> /** @component */ private DockerAssemblyManager dockerAssemblyManager; /** * @parameter default-value="src/main/docker" property="docker.source.dir" */ private String sourceDirectory; <<<<<<< protected boolean showLog(ImageConfiguration imageConfig) { if (showLogs) { return true; } RunImageConfiguration runConfig = imageConfig.getRunConfiguration(); if (runConfig != null) { LogConfiguration logConfig = runConfig.getLog(); if (logConfig != null) { return logConfig.isEnabled(); } } return false; } ======= >>>>>>>
<<<<<<< private WaitUtil.WaitChecker getHealthyWaitChecker(final String imageConfigDesc, final DockerAccess docker, final String containerId, final List<String> logOut) { return new WaitUtil.WaitChecker() { private boolean first = true; @Override public boolean check() { try { final InspectedContainer container = docker.getContainer(containerId); if (container == null) { log.debug("HealthyWaitChecker: Container %s not found"); return false; } final String healthcheck = container.getHealthcheck(); if (first) { if (healthcheck == null) { throw new IllegalArgumentException("Can not wait for healthy state of "+imageConfigDesc+". No HEALTHCHECK configured."); } log.info("%s: Waiting to become healthy", imageConfigDesc); log.debug("HealthyWaitChecker: Waiting for healthcheck: '%s'", healthcheck); logOut.add("on healthcheck '" + healthcheck+"'"); first = false; } else if (log.isDebugEnabled()) { log.debug("HealthyWaitChecker: Waiting on healthcheck '%s'", healthcheck); } return container.isHealthy(); } catch(DockerAccessException e) { return false; } } @Override public void cleanUp() {} }; } private WaitUtil.WaitChecker getLogWaitChecker(final String logPattern, final ServiceHub hub, final String containerId) { return new WaitUtil.WaitChecker() { private boolean first = true; private LogGetHandle logHandle; // Flag updated from a different thread, hence volatile (see also #595) private volatile boolean detected = false; @Override public boolean check() { if (first) { final Pattern pattern = Pattern.compile(logPattern); log.debug("LogWaitChecker: Pattern to match '%s'",logPattern); DockerAccess docker = hub.getDockerAccess(); logHandle = docker.getLogAsync(containerId, new LogCallback() { @Override public void log(int type, Timestamp timestamp, String txt) throws LogCallback.DoneException { log.debug("LogWaitChecker: Tying to match '%s' [Pattern: %s] [thread: %d]", txt, logPattern, Thread.currentThread().getId()); if (pattern.matcher(txt).find()) { detected = true; throw new LogCallback.DoneException(); } } @Override public void error(String error) { log.error("%s", error); } @Override public void close() { // no-op } @Override public void open() { // no-op } }); first = false; } return detected; } @Override public void cleanUp() { if (logHandle != null) { logHandle.finish(); } } }; } ======= >>>>>>>
<<<<<<< import java.util.Arrays; ======= import java.util.Collections; >>>>>>> import java.util.Arrays; import java.util.Collections;
<<<<<<< protected TopicSystem loadAnnotator() throws Exception { return new WikipediaMinerAnnotator(GerbilConfiguration.getInstance().getString( WIKI_MINER_CONFIG_FILE_PROPERTY_NAME)); ======= protected TopicSystem loadAnnotator(ExperimentType type) throws Exception { return new WikipediaMinerAnnotator(GerbilConfiguration.getInstance().getString(WIKI_MINER_CONFIG_FILE_PROPERTY_NAME)); >>>>>>> protected TopicSystem loadAnnotator(ExperimentType type) throws Exception { return new WikipediaMinerAnnotator(GerbilConfiguration.getInstance().getString( WIKI_MINER_CONFIG_FILE_PROPERTY_NAME));
<<<<<<< /** * This class is a very ugly workaround performing the mapping from annotator * names to {@link AnnotatorConfiguration} objects and from an * {@link ExperimentType} to a list of {@link AnnotatorConfiguration}s that are * usable for this {@link ExperimentType}. * * @author Michael R&ouml;der ([email protected]) */ ======= @Deprecated >>>>>>> /** * This class is a very ugly workaround performing the mapping from annotator * names to {@link AnnotatorConfiguration} objects and from an * {@link ExperimentType} to a list of {@link AnnotatorConfiguration}s that are * usable for this {@link ExperimentType}. * * @author Michael R&ouml;der ([email protected]) */ @Deprecated
<<<<<<< public class BabelfyAnnotator implements Sa2WSystem { // private static final Logger LOGGER = LoggerFactory.getLogger(BabelfyAnnotator.class); private static final int BABELFY_MAX_TEXT_LENGTH = 3500; public static final String NAME = "Babelfy"; // private long calib = -1; // private long lastTime = -1; @Autowired private WikipediaApiInterface wikiApi; public BabelfyAnnotator(WikipediaApiInterface wikiApi) { this.wikiApi = wikiApi; } @Override public String getName() { return NAME; } @Override public long getLastAnnotationTime() { // if (calib == -1) // calib = TimingCalibrator.getOffset(this); // return lastTime - calib > 0 ? lastTime - calib : 0; return -1; } @Override public HashSet<Tag> solveC2W(String text) throws AnnotationException { return ProblemReduction.Sc2WToC2W(ProblemReduction.Sa2WToSc2W(solveSa2W(text))); } @Override public HashSet<Annotation> solveA2W(String text) throws AnnotationException { return ProblemReduction.Sa2WToA2W(solveSa2W(text)); } @Override public HashSet<ScoredTag> solveSc2W(String text) throws AnnotationException { return ProblemReduction.Sa2WToSc2W(solveSa2W(text)); } @Override public HashSet<Annotation> solveD2W(String text, HashSet<Mention> mentions) throws AnnotationException { return ProblemReduction.Sa2WToD2W(solveGeneralSa2W(text, mentions), mentions, -1.0f); } @Override public HashSet<ScoredAnnotation> solveSa2W(String text) throws AnnotationException { return solveGeneralSa2W(text, null); } protected HashSet<ScoredAnnotation> solveGeneralSa2W(String text, HashSet<Mention> mentions) throws AnnotationException { HashSet<ScoredAnnotation> annotations = Sets.newHashSet(); List<String> chunks = splitText(text); BabelfyParameters bfyParameters = new BabelfyParameters(); bfyParameters.setAnnotationResource(SemanticAnnotationResource.WIKI); bfyParameters.setMCS(MCS.OFF); bfyParameters.setExtendCandidatesWithAIDAmeans(true); if (mentions != null) { bfyParameters.setThreshold(0.0); bfyParameters.setPoStaggingOptions(PoStaggingOptions.INPUT_FRAGMENTS_AS_NOUNS); bfyParameters.setDisambiguationConstraint( DisambiguationConstraint.DISAMBIGUATE_ALL_RETURN_INPUT_FRAGMENTS); } else { bfyParameters.setThreshold(0.3); bfyParameters.setAnnotationType(SemanticAnnotationType.NAMED_ENTITIES); } IBabelfy bfy = new Babelfy(bfyParameters); int prevChars = 0; for (String chunk : chunks) { BabelfyConstraints constraints = new BabelfyConstraints(); if (mentions != null) { for (Mention m : mentions) { if (m.getPosition() >= prevChars && m.getPosition()+m.getLength() < prevChars+chunk.length()) { constraints.addFragmentToDisambiguate( new CharOffsetFragment(m.getPosition()-prevChars, m.getPosition()+m.getLength()-1-prevChars)); } } } List<SemanticAnnotation> bfyAnnotations = sendRequest(bfy, chunk, constraints); for (SemanticAnnotation bfyAnn : bfyAnnotations) { int wikiID = -1; wikiID = DBpediaToWikiId.getId(wikiApi, bfyAnn.getDBpediaURL()); if (wikiID >= 0) { ScoredAnnotation gerbilAnn = new ScoredAnnotation(prevChars+bfyAnn.getCharOffsetFragment().getStart(), bfyAnn.getCharOffsetFragment().getEnd()- bfyAnn.getCharOffsetFragment().getStart()+1, wikiID, (float)bfyAnn.getScore()); annotations.add(gerbilAnn); } } prevChars += chunk.length(); } return annotations; } protected synchronized List<SemanticAnnotation> sendRequest(IBabelfy bfy, String chunk, BabelfyConstraints constraints) { return bfy.babelfy(chunk, Language.EN, constraints); } protected List<String> splitText(String text) { List<String> chunks = new ArrayList<String>(); int start = 0, end = 0, nextEnd = 0; // As long as we have to create chunks while ((nextEnd >= 0) && ((text.length() - nextEnd) > BABELFY_MAX_TEXT_LENGTH)) { // We have to use the next space, even it would be too far away end = nextEnd = text.indexOf(' ', start + 1); // Search for the next possible end this chunk while ((nextEnd >= 0) && ((nextEnd - start) < BABELFY_MAX_TEXT_LENGTH)) { end = nextEnd; nextEnd = text.indexOf(' ', end + 1); } // Add the chunk chunks.add(text.substring(start, end)); start = end; } // Add the last chunk chunks.add(text.substring(start)); return chunks; } ======= public class BabelfyAnnotator implements A2WSystem { private static final Logger LOGGER = LoggerFactory.getLogger(BabelfyAnnotator.class); private static final int BABELFY_MAX_TEXT_LENGTH = 1500; public static final String NAME = "Babelfy"; private String key; @Autowired private WikipediaApiInterface wikiApi; public BabelfyAnnotator() { this(""); } public BabelfyAnnotator(WikipediaApiInterface wikiApi) { this("", wikiApi); } public BabelfyAnnotator(String key) { this.key = key; } public BabelfyAnnotator(String key, WikipediaApiInterface wikiApi) { this.key = key; this.wikiApi = wikiApi; } public String getName() { return NAME; } public long getLastAnnotationTime() { return -1; } public HashSet<Annotation> solveD2W(String text, HashSet<Mention> mentions) throws AnnotationException { return solveA2W(text, true); } @Override public HashSet<Tag> solveC2W(String text) throws AnnotationException { return ProblemReduction.A2WToC2W(solveA2W(text)); } @Override public HashSet<Annotation> solveA2W(String text) throws AnnotationException { return solveA2W(text, true); } protected HashSet<Annotation> solveA2W(String text, boolean isShortDocument) throws AnnotationException { if (text.length() > BABELFY_MAX_TEXT_LENGTH) { return solveA2WForLongTexts(text); } Babelfy bfy = Babelfy.getInstance(AccessType.ONLINE); HashSet<Annotation> annotations = Sets.newHashSet(); try { it.uniroma1.lcl.babelfy.data.Annotation babelAnnotations = bfy.babelfy(key, text, isShortDocument ? Matching.PARTIAL : Matching.EXACT, Language.EN); int positionInText = 0, posSurfaceFormInText = 0; String surfaceForm; String lowercasedText = text.toLowerCase(); for (BabelSynsetAnchor anchor : babelAnnotations.getAnnotations()) { // The positions of BabelSynsetAnchors are measured in tokens --> we have to find the token inside the // text surfaceForm = anchor.getAnchorText(); posSurfaceFormInText = lowercasedText.indexOf(surfaceForm, positionInText); List<String> uris = anchor.getBabelSynset().getDBPediaURIs(Language.EN); String uri; if ((posSurfaceFormInText >= 0) && (uris != null) && (uris.size() > 0)) { // DIRTY FIX Babelfy seems to return URIs with "DBpedia.org" instead of "dbpedia.org" uri = uris.get(0); uri = uri.replaceAll("DBpedia.org", "dbpedia.org"); int id = DBpediaToWikiId.getId(wikiApi, uri); annotations.add(new Annotation(posSurfaceFormInText, surfaceForm.length(), id)); // annotations.add(new Annotation(anchor.getStart(), anchor.getEnd() - anchor.getStart(), id)); positionInText = posSurfaceFormInText + surfaceForm.length(); } } } catch (BabelfyKeyNotValidOrLimitReached e) { LOGGER.error("The BabelFy Key is invalid or has reached its limit.", e); throw new AnnotationException("The BabelFy Key is invalid or has reached its limit: " + e.getLocalizedMessage()); } catch (IOException | URISyntaxException e) { // LOGGER.error("Exception while requesting annotations from BabelFy. Returning empty Annotation set.", e); throw new AnnotationException("Exception while requesting annotations from BabelFy: " + e.getLocalizedMessage()); } return annotations; } protected HashSet<Annotation> solveA2WForLongTexts(String text) { List<String> chunks = splitText(text); HashSet<Annotation> annotations; annotations = solveA2W(chunks.get(0), false); HashSet<Annotation> tempAnnotations; int startOfChunk = 0; for (int i = 1; i < chunks.size(); ++i) { // get annotations. Note that tempAnnotations = solveA2W(chunks.get(i), false); // We have to correct the positions of the annotations startOfChunk += chunks.get(i - 1).length(); for (Annotation annotation : tempAnnotations) { annotations.add(new Annotation(annotation.getPosition() + startOfChunk, annotation.getLength(), annotation.getConcept())); } } return annotations; } protected List<String> splitText(String text) { List<String> chunks = new ArrayList<String>(); int start = 0, end = 0, nextEnd = 0; // As long as we have to create chunks while ((nextEnd >= 0) && ((text.length() - nextEnd) > BABELFY_MAX_TEXT_LENGTH)) { // We have to use the next space, even it would be too far away end = nextEnd = text.indexOf(' ', start + 1); // Search for the next possible end this chunk while ((nextEnd >= 0) && ((nextEnd - start) < BABELFY_MAX_TEXT_LENGTH)) { end = nextEnd; nextEnd = text.indexOf(' ', end + 1); } // Add the chunk chunks.add(text.substring(start, end)); start = end; } // Add the last chunk chunks.add(text.substring(start)); return chunks; } >>>>>>> public class BabelfyAnnotator implements Sa2WSystem { // private static final Logger LOGGER = LoggerFactory.getLogger(BabelfyAnnotator.class); private static final int BABELFY_MAX_TEXT_LENGTH = 3500; public static final String NAME = "Babelfy"; // private long calib = -1; // private long lastTime = -1; @Autowired private WikipediaApiInterface wikiApi; public BabelfyAnnotator(WikipediaApiInterface wikiApi) { this.wikiApi = wikiApi; } @Override public String getName() { return NAME; } public long getLastAnnotationTime() { return -1; } @Override public HashSet<Tag> solveC2W(String text) throws AnnotationException { return ProblemReduction.Sc2WToC2W(ProblemReduction.Sa2WToSc2W(solveSa2W(text))); } @Override public HashSet<Annotation> solveA2W(String text) throws AnnotationException { return ProblemReduction.Sa2WToA2W(solveSa2W(text)); } @Override public HashSet<ScoredTag> solveSc2W(String text) throws AnnotationException { return ProblemReduction.Sa2WToSc2W(solveSa2W(text)); } @Override public HashSet<Annotation> solveD2W(String text, HashSet<Mention> mentions) throws AnnotationException { return ProblemReduction.Sa2WToD2W(solveGeneralSa2W(text, mentions), mentions, -1.0f); } @Override public HashSet<ScoredAnnotation> solveSa2W(String text) throws AnnotationException { return solveGeneralSa2W(text, null); } protected HashSet<ScoredAnnotation> solveGeneralSa2W(String text, HashSet<Mention> mentions) throws AnnotationException { HashSet<ScoredAnnotation> annotations = Sets.newHashSet(); List<String> chunks = splitText(text); BabelfyParameters bfyParameters = new BabelfyParameters(); bfyParameters.setAnnotationResource(SemanticAnnotationResource.WIKI); bfyParameters.setMCS(MCS.OFF); bfyParameters.setExtendCandidatesWithAIDAmeans(true); if (mentions != null) { bfyParameters.setThreshold(0.0); bfyParameters.setPoStaggingOptions(PoStaggingOptions.INPUT_FRAGMENTS_AS_NOUNS); bfyParameters.setDisambiguationConstraint( DisambiguationConstraint.DISAMBIGUATE_ALL_RETURN_INPUT_FRAGMENTS); } else { bfyParameters.setThreshold(0.3); bfyParameters.setAnnotationType(SemanticAnnotationType.NAMED_ENTITIES); } IBabelfy bfy = new Babelfy(bfyParameters); int prevChars = 0; for (String chunk : chunks) { BabelfyConstraints constraints = new BabelfyConstraints(); if (mentions != null) { for (Mention m : mentions) { if (m.getPosition() >= prevChars && m.getPosition()+m.getLength() < prevChars+chunk.length()) { constraints.addFragmentToDisambiguate( new CharOffsetFragment(m.getPosition()-prevChars, m.getPosition()+m.getLength()-1-prevChars)); } } } List<SemanticAnnotation> bfyAnnotations = sendRequest(bfy, chunk, constraints); for (SemanticAnnotation bfyAnn : bfyAnnotations) { int wikiID = -1; wikiID = DBpediaToWikiId.getId(wikiApi, bfyAnn.getDBpediaURL()); if (wikiID >= 0) { ScoredAnnotation gerbilAnn = new ScoredAnnotation(prevChars+bfyAnn.getCharOffsetFragment().getStart(), bfyAnn.getCharOffsetFragment().getEnd()- bfyAnn.getCharOffsetFragment().getStart()+1, wikiID, (float)bfyAnn.getScore()); annotations.add(gerbilAnn); } } prevChars += chunk.length(); } return annotations; } protected synchronized List<SemanticAnnotation> sendRequest(IBabelfy bfy, String chunk, BabelfyConstraints constraints) { return bfy.babelfy(chunk, Language.EN, constraints); } protected List<String> splitText(String text) { List<String> chunks = new ArrayList<String>(); int start = 0, end = 0, nextEnd = 0; // As long as we have to create chunks while ((nextEnd >= 0) && ((text.length() - nextEnd) > BABELFY_MAX_TEXT_LENGTH)) { // We have to use the next space, even it would be too far away end = nextEnd = text.indexOf(' ', start + 1); // Search for the next possible end this chunk while ((nextEnd >= 0) && ((nextEnd - start) < BABELFY_MAX_TEXT_LENGTH)) { end = nextEnd; nextEnd = text.indexOf(' ', end + 1); } // Add the chunk chunks.add(text.substring(start, end)); start = end; } // Add the last chunk chunks.add(text.substring(start)); return chunks; }
<<<<<<< public class MSNBCDataset extends AbstractDataset implements InitializableDataset { ======= public class MSNBCDataset implements InitializableDataset, Comparator<Span> { >>>>>>> public class MSNBCDataset extends AbstractDataset implements InitializableDataset, Comparator<Span> {
<<<<<<< * Returns either backtick-quoted `named.getName()` (if `named` not null), * or "[null]" if `named` is null. ======= * Returns either single-quoted (apostrophe) {@code 'named.getName()'} (if {@code named} not null), * or "[null]" if {@code named} is null. *<p> * NOTE: before 2.12 returned "backticked" version instead of single-quoted name; changed * to be compatible with most existing quoting usage within databind * * @since 2.9 >>>>>>> * Returns either single-quoted (apostrophe) {@code 'named.getName()'} (if {@code named} not null), * or "[null]" if {@code named} is null. <<<<<<< * Returns either `text` or [null]. ======= * Returns either {@code `text`} (backtick-quoted) or {@code [null]}. * * @since 2.9 >>>>>>> * Returns either {@code `text`} (backtick-quoted) or {@code [null]}.
<<<<<<< import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; ======= import org.aksw.gerbil.exceptions.GerbilException; >>>>>>> import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.aksw.gerbil.exceptions.GerbilException;
<<<<<<< /** * When activated, edited books with more than 50 pages will be shortened to 50. * * @return True if enabled */ boolean truncate1_14Books(); ======= /** * Handles left handed info by using unused bit 7 on Client Settings packet */ boolean isLeftHandedHandling(); >>>>>>> /** * When activated, edited books with more than 50 pages will be shortened to 50. * * @return True if enabled */ boolean truncate1_14Books(); /** * Handles left handed info by using unused bit 7 on Client Settings packet * * @return True if enabled */ boolean isLeftHandedHandling();
<<<<<<< /** * Should 1.15 clients respawn instantly / without showing the death screen * * @return True if enabled */ boolean is1_15InstantRespawn(); ======= /** * Fixes non full blocks having 0 light for 1.14+ clients on sub 1.14 servers. * * @return True if enabled */ boolean isNonFullBlockLightFix(); boolean is1_14HealthNaNFix(); >>>>>>> /** * Fixes non full blocks having 0 light for 1.14+ clients on sub 1.14 servers. * * @return True if enabled */ boolean isNonFullBlockLightFix(); boolean is1_14HealthNaNFix(); /** * Should 1.15 clients respawn instantly / without showing the death screen * * @return True if enabled */ boolean is1_15InstantRespawn();
<<<<<<< register(v1_9_3 = new ProtocolVersion(110, "1.9.3")); register(SNAPSHOT = new ProtocolVersion(201, "16w20a")); ======= register(v1_9_3 = new ProtocolVersion(110, "1.9.3/4")); >>>>>>> register(v1_9_3 = new ProtocolVersion(110, "1.9.3/4")); register(v1_9_3 = new ProtocolVersion(110, "1.9.3")); register(SNAPSHOT = new ProtocolVersion(201, "16w20a"));
<<<<<<< import pneumaticCraft.common.thirdparty.ModInteractionUtils; ======= import pneumaticCraft.common.network.DescSynced; import pneumaticCraft.common.network.GuiSynced; >>>>>>> import pneumaticCraft.common.thirdparty.ModInteractionUtils; <<<<<<< private final TileEntityPneumaticBase vacuumHandler = new TileEntityPneumaticBase(5, 7, PneumaticValues.VOLUME_VACUUM_PUMP){ @Override public List<Pair<ForgeDirection, IPneumaticMachine>> getConnectedPneumatics(){ List<Pair<ForgeDirection, IPneumaticMachine>> teList = new ArrayList<Pair<ForgeDirection, IPneumaticMachine>>(); ForgeDirection direction = getVacuumSide(); TileEntity te = getTileCache()[direction.ordinal()].getTileEntity(); IPneumaticMachine machine = ModInteractionUtils.getInstance().getMachine(te); if(machine != null && isConnectedTo(direction) && machine.isConnectedTo(direction.getOpposite())) { teList.add(new ImmutablePair(direction, machine)); } return teList; } @Override protected boolean saveTeInternals(){ return false; } }; ======= @GuiSynced public int vacuumAir; >>>>>>> @GuiSynced private final TileEntityPneumaticBase vacuumHandler = new TileEntityPneumaticBase(5, 7, PneumaticValues.VOLUME_VACUUM_PUMP){ @Override public List<Pair<ForgeDirection, IPneumaticMachine>> getConnectedPneumatics(){ List<Pair<ForgeDirection, IPneumaticMachine>> teList = new ArrayList<Pair<ForgeDirection, IPneumaticMachine>>(); ForgeDirection direction = getVacuumSide(); TileEntity te = getTileCache()[direction.ordinal()].getTileEntity(); IPneumaticMachine machine = ModInteractionUtils.getInstance().getMachine(te); if(machine != null && isConnectedTo(direction) && machine.isConnectedTo(direction.getOpposite())) { teList.add(new ImmutablePair(direction, machine)); } return teList; } @Override protected boolean saveTeInternals(){ return false; } }; <<<<<<< if(teList.size() == 0) airLeak(getInputSide()); teList = vacuumHandler.getConnectedPneumatics(); if(teList.size() == 0) vacuumHandler.airLeak(getVacuumSide()); if(!worldObj.isRemote && numUsingPlayers > 0) { sendDescriptionPacket(); } ======= boolean inputSideConnected = false; boolean vacuumSideConnected = false; for(Pair<ForgeDirection, IPneumaticMachine> entry : teList) { if(entry.getKey().equals(getInputSide())) inputSideConnected = true; if(entry.getKey().equals(getVacuumSide())) vacuumSideConnected = true; } if(!inputSideConnected) airLeak(getInputSide()); if(!vacuumSideConnected) airLeak(getVacuumSide()); >>>>>>> if(teList.size() == 0) airLeak(getInputSide()); teList = vacuumHandler.getConnectedPneumatics(); if(teList.size() == 0) vacuumHandler.airLeak(getVacuumSide());
<<<<<<< public static final String GUI_AMADRON = GUI_LOCATION + "GuiAmadron.png"; ======= public static final String GUI_NEI_MISC_RECIPES = GUI_LOCATION + "GuiNEIMiscRecipes.png"; >>>>>>> public static final String GUI_AMADRON = GUI_LOCATION + "GuiAmadron.png"; public static final String GUI_NEI_MISC_RECIPES = GUI_LOCATION + "GuiNEIMiscRecipes.png";
<<<<<<< import me.desht.pneumaticcraft.common.progwidgets.*; ======= import me.desht.pneumaticcraft.common.item.ItemRegistry; import me.desht.pneumaticcraft.common.progwidgets.IJumpBackWidget; import me.desht.pneumaticcraft.common.progwidgets.IProgWidget; import me.desht.pneumaticcraft.common.progwidgets.IVariableProvider; import me.desht.pneumaticcraft.common.progwidgets.IVariableWidget; import me.desht.pneumaticcraft.common.progwidgets.ProgWidgetStart; >>>>>>> import me.desht.pneumaticcraft.common.item.ItemRegistry; import me.desht.pneumaticcraft.common.progwidgets.*;
<<<<<<< ======= import me.desht.pneumaticcraft.common.thirdparty.immersiveengineering.ImmersiveEngineering; import me.desht.pneumaticcraft.common.thirdparty.mcmultipart.PneumaticMultiPart; >>>>>>> import me.desht.pneumaticcraft.common.thirdparty.immersiveengineering.ImmersiveEngineering;
<<<<<<< package redis.clients.johm.models; import redis.clients.johm.Attribute; import redis.clients.johm.Model; import redis.clients.johm.Reference; public class User extends Model { @Attribute private String name; private String room; @Reference private Country country; public Country getCountry() { return country; } public void setCountry(Country country) { this.country = country; } public String getRoom() { return room; } public void setRoom(String room) { this.room = room; } public String getName() { return name; } public void setName(String name) { this.name = name; } } ======= package redis.clients.johm.models; import redis.clients.johm.Attribute; import redis.clients.johm.Model; public class User extends Model { @Attribute private String name; private String room; @Attribute private int age; @Attribute private float salary; @Attribute private char initial; public String getRoom() { return room; } public void setRoom(String room) { this.room = room; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public float getSalary() { return salary; } public void setSalary(float salary) { this.salary = salary; } public char getInitial() { return initial; } public void setInitial(char initial) { this.initial = initial; } } >>>>>>> package redis.clients.johm.models; import redis.clients.johm.Attribute; import redis.clients.johm.Model; import redis.clients.johm.Reference; public class User extends Model { @Attribute private String name; private String room; @Attribute private int age; @Attribute private float salary; @Attribute private char initial; @Reference private Country country; public Country getCountry() { return country; } public void setCountry(Country country) { this.country = country; } public String getRoom() { return room; } public void setRoom(String room) { this.room = room; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public float getSalary() { return salary; } public void setSalary(float salary) { this.salary = salary; } public char getInitial() { return initial; } public void setInitial(char initial) { this.initial = initial; } }
<<<<<<< ======= private Spectrum.Block withoutAuthCheck(String path, String expectedJsonSpec) { return () -> { mockMvc.perform(get(path).accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath(expectedJsonSpec).isNotEmpty()); }; } @Configuration @Import(CredentialManagerApp.class) public static class DegenerateSecurityConfiguration { @Bean ResourceServerTokenServices tokenServices() throws Exception { return new SelfValidatingResourceTokenServices(); } static class SelfValidatingResourceTokenServices implements ResourceServerTokenServices { private final JwtTokenStore jwtTokenStore; private final JwtAccessTokenConverter jwtAccessTokenConverter; SelfValidatingResourceTokenServices() throws Exception { jwtAccessTokenConverter = new JwtAccessTokenConverter(); jwtAccessTokenConverter.setSigningKey("tokenkey"); jwtAccessTokenConverter.afterPropertiesSet(); jwtTokenStore = new JwtTokenStore(jwtAccessTokenConverter); } @Override public OAuth2Authentication loadAuthentication(String accessToken) throws AuthenticationException, InvalidTokenException { return jwtTokenStore.readAuthentication(accessToken); } @Override public OAuth2AccessToken readAccessToken(String accessToken) { return jwtTokenStore.readAccessToken(accessToken); } } } >>>>>>> private Spectrum.Block withoutAuthCheck(String path, String expectedJsonSpec) { return () -> { mockMvc.perform(get(path).accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath(expectedJsonSpec).isNotEmpty()); }; }
<<<<<<< ======= import io.pivotal.security.service.regeneratables.CertificateSecret; import io.pivotal.security.service.regeneratables.NotRegeneratable; import io.pivotal.security.service.regeneratables.PasswordSecret; import io.pivotal.security.service.regeneratables.Regeneratable; import io.pivotal.security.service.regeneratables.RsaSecret; import io.pivotal.security.service.regeneratables.SshSecret; import java.util.HashMap; import java.util.Map; import org.springframework.http.HttpStatus; >>>>>>> import io.pivotal.security.service.regeneratables.CertificateSecret; import io.pivotal.security.service.regeneratables.NotRegeneratable; import io.pivotal.security.service.regeneratables.PasswordSecret; import io.pivotal.security.service.regeneratables.Regeneratable; import io.pivotal.security.service.regeneratables.RsaSecret; import io.pivotal.security.service.regeneratables.SshSecret; import java.util.HashMap; import java.util.Map; <<<<<<< this.regeneratableTypes.put("password", new PasswordSecret(generateService)); this.regeneratableTypes.put("ssh", new SshSecret(generateService)); this.regeneratableTypes.put("rsa", new RsaSecret(generateService)); ======= this.regeneratableTypes.put("password", new PasswordSecret(errorResponseService, generateService)); this.regeneratableTypes.put("ssh", new SshSecret(errorResponseService, generateService)); this.regeneratableTypes.put("rsa", new RsaSecret(errorResponseService, generateService)); this.regeneratableTypes.put("certificate", new CertificateSecret(errorResponseService, generateService)); >>>>>>> this.regeneratableTypes.put("password", new PasswordSecret(generateService)); this.regeneratableTypes.put("ssh", new SshSecret(generateService)); this.regeneratableTypes.put("rsa", new RsaSecret(generateService)); this.regeneratableTypes.put("certificate", new CertificateSecret(generateService));
<<<<<<< this.volume.setWorld(this.location.getWorld()); this.volume.setCornerOne(locationBlock.getFace(back).getFace(left, halfHubWidth).getFace(BlockFace.DOWN)); this.volume.setCornerTwo(locationBlock.getFace(right, halfHubWidth).getFace(front, hubDepth).getFace(BlockFace.UP, hubHeigth)); ======= this.volume.setCornerOne(locationBlock.getRelative(back).getRelative(left, halfHubWidth).getRelative(BlockFace.DOWN)); this.volume.setCornerTwo(locationBlock.getRelative(right, halfHubWidth).getRelative(front, hubDepth).getRelative(BlockFace.UP, hubHeigth)); >>>>>>> this.volume.setWorld(this.location.getWorld()); this.volume.setCornerOne(locationBlock.getRelative(back).getRelative(left, halfHubWidth).getRelative(BlockFace.DOWN)); this.volume.setCornerTwo(locationBlock.getRelative(right, halfHubWidth).getRelative(front, hubDepth).getRelative(BlockFace.UP, hubHeigth)); <<<<<<< if (zoneGate != null) { Block block = zoneGate.getFace(left).getFace(back, 1); if (block.getType() != Material.SIGN_POST) { block.setType(Material.SIGN_POST); } block.setData(data); int zoneCap = 0; int zonePlayers = 0; for (Team t : zone.getTeams()) { zonePlayers += t.getPlayers().size(); zoneCap += zone.getTeamCap(); } String[] lines = new String[4]; lines[0] = "Warzone"; lines[1] = zone.getName(); lines[2] = zonePlayers + "/" + zoneCap + " players"; lines[3] = zone.getTeams().size() + " teams"; SignHelper.setToSign(War.war, block, data, lines); } else { War.war.log("Failed to find warhub gate for " + zone.getName() + " warzone.", Level.WARNING); ======= Block block = zoneGate.getRelative(left).getRelative(back, 1); if (block.getType() != Material.SIGN_POST) { block.setType(Material.SIGN_POST); } block.setData(data); int zoneCap = 0; int zonePlayers = 0; for (Team t : zone.getTeams()) { zonePlayers += t.getPlayers().size(); zoneCap += zone.getTeamCap(); >>>>>>> if (zoneGate != null) { Block block = zoneGate.getRelative(left).getRelative(back, 1); if (block.getType() != Material.SIGN_POST) { block.setType(Material.SIGN_POST); } block.setData(data); int zoneCap = 0; int zonePlayers = 0; for (Team t : zone.getTeams()) { zonePlayers += t.getPlayers().size(); zoneCap += zone.getTeamCap(); } String[] lines = new String[4]; lines[0] = "Warzone"; lines[1] = zone.getName(); lines[2] = zonePlayers + "/" + zoneCap + " players"; lines[3] = zone.getTeams().size() + " teams"; SignHelper.setToSign(War.war, block, data, lines); } else { War.war.log("Failed to find warhub gate for " + zone.getName() + " warzone.", Level.WARNING);
<<<<<<< this.lobbyMiddleWallBlock = new BlockInfo(lobbyWorld.getBlockAt(playerLocation.getBlockX(), playerLocation.getBlockY(), playerLocation.getBlockZ()).getFace(facing, 6)); ======= this.lobbyMiddleWallBlock = new BlockInfo(this.warzone.getWorld().getBlockAt(playerLocation.getBlockX(), playerLocation.getBlockY(), playerLocation.getBlockZ()).getRelative(facing, 6)); >>>>>>> this.lobbyMiddleWallBlock = new BlockInfo(lobbyWorld.getBlockAt(playerLocation.getBlockX(), playerLocation.getBlockY(), playerLocation.getBlockZ()).getRelative(facing, 6)); <<<<<<< this.zoneTeleportBlock = new BlockInfo(BlockInfo.getBlock(this.volume.getWorld(), this.lobbyMiddleWallBlock).getFace(this.wall, 6)); ======= this.zoneTeleportBlock = new BlockInfo(BlockInfo.getBlock(this.warzone.getWorld(), this.lobbyMiddleWallBlock).getRelative(this.wall, 6)); >>>>>>> this.zoneTeleportBlock = new BlockInfo(BlockInfo.getBlock(this.volume.getWorld(), this.lobbyMiddleWallBlock).getRelative(this.wall, 6)); <<<<<<< Block zoneSignBlock = BlockInfo.getBlock(this.volume.getWorld(), this.lobbyMiddleWallBlock).getFace(this.wall, 4); ======= Block zoneSignBlock = BlockInfo.getBlock(this.warzone.getWorld(), this.lobbyMiddleWallBlock).getRelative(this.wall, 4); >>>>>>> Block zoneSignBlock = BlockInfo.getBlock(this.volume.getWorld(), this.lobbyMiddleWallBlock).getRelative(this.wall, 4); <<<<<<< Block autoAssignGateBlock = BlockInfo.getBlock(this.volume.getWorld(), this.autoAssignGate); this.setBlock(autoAssignGateBlock.getFace(BlockFace.DOWN), (Material.GLOWSTONE)); ======= Block autoAssignGateBlock = BlockInfo.getBlock(this.warzone.getWorld(), this.autoAssignGate); this.setBlock(autoAssignGateBlock.getRelative(BlockFace.DOWN), (Material.GLOWSTONE)); >>>>>>> Block autoAssignGateBlock = BlockInfo.getBlock(this.volume.getWorld(), this.autoAssignGate); this.setBlock(autoAssignGateBlock.getRelative(BlockFace.DOWN), (Material.GLOWSTONE));
<<<<<<< public WarHub(War war, Location location, String hubOrientation) { this.war = war; int yaw = 0; ======= public WarHub(Location location, String hubOrientation) { this.location = location; this.volume = new Volume("warhub", location.getWorld()); >>>>>>> public WarHub(Location location, String hubOrientation) { int yaw = 0; <<<<<<< yaw = 270; this.setOrientation(BlockFace.SOUTH); ======= this.setOrientation(BlockFace.SOUTH); >>>>>>> yaw = 270; this.setOrientation(BlockFace.SOUTH); <<<<<<< this.location = new Location(location.getWorld(), location.getX(), location.getY(), location.getZ(), yaw, 0); this.volume = new Volume("warhub", war, location.getWorld()); ======= >>>>>>> this.location = new Location(location.getWorld(), location.getX(), location.getY(), location.getZ(), yaw, 0); this.volume = new Volume("warhub", location.getWorld());
<<<<<<< import org.neo4j.storageengine.api.NodeItem; import org.neo4j.storageengine.api.PropertyItem; import org.neo4j.storageengine.api.RelationshipItem; ======= >>>>>>> <<<<<<< final long originalNodeId = toOriginalNodeId(nodeId); forAllRelationships(nodeId, direction, item -> { long relId = RawValues.combineIntInt( (int) item.startNode(), (int) item.endNode()); double weight = propertyDefaultWeight; Object value = item.propertyValue(propertyKey); if (value instanceof Number) { weight = ((Number) value).doubleValue(); } consumer.accept( nodeId, toMappedNodeId(item.otherNode(originalNodeId)), relId, weight ); }); ======= forAllRelationships(nodeId, direction, true, consumer); >>>>>>> forAllRelationships(nodeId, direction, true, consumer); <<<<<<< Consumer<Kernel.RelationshipItem> action) { ======= boolean readWeights, WeightedRelationshipConsumer action) { >>>>>>> boolean readWeights, WeightedRelationshipConsumer action) { <<<<<<< org.neo4j.storageengine.api.Direction d = mediate(direction); withinTransaction(read -> { try (Cursor<Kernel.NodeItem> nodes = read.nodeCursor(originalNodeId)) { while (nodes.next()) { Kernel.NodeItem nodeItem = nodes.get(); try (Cursor<Kernel.RelationshipItem> rels = relationships(d, nodeItem)) { while (rels.next()) { Kernel.RelationshipItem item = rels.get(); if (idMapping.contains(item.otherNode(originalNodeId))) { action.accept(item); } ======= try { withinTransaction(read -> { final double defaultWeight = this.propertyDefaultWeight; RelationshipVisitor<EntityNotFoundException> visitor = (relationshipId, typeId, startNodeId, endNodeId) -> { long otherNodeId = startNodeId == originalNodeId ? endNodeId : startNodeId; if (idMapping.contains(otherNodeId)) { double weight = defaultWeight; if (readWeights && read.relationshipHasProperty(relationshipId, propertyKey)) { Object value = read.relationshipGetProperty( relationshipId, propertyKey); weight = RawValues.extractValue( value, defaultWeight); >>>>>>> try { withinTransaction(read -> { final double defaultWeight = this.propertyDefaultWeight; RelationshipVisitor<EntityNotFoundException> visitor = (relationshipId, typeId, startNodeId, endNodeId) -> { long otherNodeId = startNodeId == originalNodeId ? endNodeId : startNodeId; if (idMapping.contains(otherNodeId)) { double weight = defaultWeight; if (readWeights && read.relationshipHasProperty(relationshipId, propertyKey)) { Object value = read.relationshipGetProperty( relationshipId, propertyKey); weight = RawValues.extractValue( value, defaultWeight); <<<<<<< private Cursor<Kernel.RelationshipItem> relationships( final org.neo4j.storageengine.api.Direction d, final Kernel.NodeItem nodeItem) { if (relationTypeId == StatementConstants.NO_SUCH_RELATIONSHIP_TYPE) { return nodeItem.relationships(d); ======= final RelationshipIterator rels; if (relationTypeId == StatementConstants.NO_SUCH_RELATIONSHIP_TYPE) { rels = read.nodeGetRelationships(originalNodeId, direction); } else { rels = read.nodeGetRelationships(originalNodeId, direction, relationTypeId); } while (rels.hasNext()) { final long relId = rels.next(); rels.relationshipVisit(relId, visitor); } }); } catch (EntityNotFoundException e) { throw Exceptions.launderedException(e); >>>>>>> final RelationshipIterator rels; if (relationTypeId == StatementConstants.NO_SUCH_RELATIONSHIP_TYPE) { rels = read.nodeGetRelationships(originalNodeId, direction); } else { rels = read.nodeGetRelationships(originalNodeId, direction, new int[]{relationTypeId}); } while (rels.hasNext()) { final long relId = rels.next(); rels.relationshipVisit(relId, visitor); } }); } catch (EntityNotFoundException e) { throw Exceptions.launderedException(e); <<<<<<< if (labelId == StatementConstants.NO_SUCH_LABEL) { try (Cursor<Kernel.NodeItem> nodeItemCursor = read.nodeCursorGetAll()) { while (nodeItemCursor.next()) { if (!consumer.test(toMappedNodeId(nodeItemCursor.get().id()))) { break; } } } } else { try (Cursor<Kernel.NodeItem> nodeItemCursor = read.nodeCursorGetForLabel(labelId)) { while (nodeItemCursor.next()) { if (!consumer.test(toMappedNodeId(nodeItemCursor.get().id()))) { break; } } ======= PrimitiveLongIterator nodes = labelId == StatementConstants.NO_SUCH_LABEL ? read.nodesGetAll() : read.nodesGetForLabel(labelId); while (nodes.hasNext()) { final long nodeId = nodes.next(); if (!consumer.test(toMappedNodeId(nodeId))) { break; >>>>>>> PrimitiveLongIterator nodes = labelId == StatementConstants.NO_SUCH_LABEL ? read.nodesGetAll() : read.nodesGetForLabel(labelId); while (nodes.hasNext()) { final long nodeId = nodes.next(); if (!consumer.test(toMappedNodeId(nodeId))) { break;
<<<<<<< importers.add(new ChallengesImporter()); ======= importers.add(new LevelConfigImporter()); importers.add(new ConfigPre13Importer()); >>>>>>> importers.add(new ConfigPre13Importer());
<<<<<<< private static boolean isPrimaryConfig(String configName) { return configName.equalsIgnoreCase("config.yml"); } private static void copy(InputStream stream, File file) throws IOException { if (stream == null || file == null) { return; } ======= public static void copy(InputStream stream, File file) throws IOException { >>>>>>> private static void copy(InputStream stream, File file) throws IOException { if (stream == null || file == null) { return; }
<<<<<<< private static final int VERSION = 10; ======= private static final String VERSION = "11"; >>>>>>> private static final String VERSION = "11"; <<<<<<< public static boolean protectNetherIsland(uSkyBlock plugin, CommandSender sender, IslandInfo islandConfig) { try { WorldGuardPlugin worldGuard = getWorldGuard(); RegionManager regionManager = worldGuard.getRegionManager(plugin.getSkyBlockNetherWorld()); String regionName = islandConfig.getName() + "nether"; if (islandConfig != null && noOrOldRegion(regionManager, regionName, islandConfig)) { ProtectedCuboidRegion region = setRegionFlags(sender, islandConfig, regionName); final Iterable<ProtectedRegion> set = regionManager.getApplicableRegions(islandConfig.getIslandLocation()); for (ProtectedRegion regions : set) { if (!(regions instanceof GlobalProtectedRegion)) { regionManager.removeRegion(regions.getId()); } } regionManager.addRegion(region); plugin.log(Level.INFO, "New protected region created for " + islandConfig.getLeader() + "'s Island by " + sender.getName()); islandConfig.setRegionVersion(getVersion()); return true; } } catch (Exception ex) { String name = islandConfig != null ? islandConfig.getLeader() : "Unknown"; plugin.log(Level.SEVERE, "ERROR: Failed to protect " + name + "'s Island (" + sender.getName() + ")", ex); } return false; } private static String getVersion() { return "" + VERSION + I18nUtil.getLocale(); } ======= private static String getVersion() { return VERSION + " " + I18nUtil.getLocale(); } >>>>>>> private static String getVersion() { return VERSION + " " + I18nUtil.getLocale(); } public static boolean protectNetherIsland(uSkyBlock plugin, CommandSender sender, IslandInfo islandConfig) { try { WorldGuardPlugin worldGuard = getWorldGuard(); RegionManager regionManager = worldGuard.getRegionManager(plugin.getSkyBlockNetherWorld()); String regionName = islandConfig.getName() + "nether"; if (islandConfig != null && noOrOldRegion(regionManager, regionName, islandConfig)) { ProtectedCuboidRegion region = setRegionFlags(sender, islandConfig, regionName); final Iterable<ProtectedRegion> set = regionManager.getApplicableRegions(islandConfig.getIslandLocation()); for (ProtectedRegion regions : set) { if (!(regions instanceof GlobalProtectedRegion)) { regionManager.removeRegion(regions.getId()); } } regionManager.addRegion(region); plugin.log(Level.INFO, "New protected region created for " + islandConfig.getLeader() + "'s Island by " + sender.getName()); islandConfig.setRegionVersion(getVersion()); return true; } } catch (Exception ex) { String name = islandConfig != null ? islandConfig.getLeader() : "Unknown"; plugin.log(Level.SEVERE, "ERROR: Failed to protect " + name + "'s Island (" + sender.getName() + ")", ex); } return false; } private static String getVersion() { return "" + VERSION + I18nUtil.getLocale(); }
<<<<<<< FlowDef definition = new FlowDef() .setName(name) .addTails(tails) .addSources(sources) .addSinks(sinks) .addTraps(traps); if(getProperties().containsKey(CascadingUtil.CASCADING_RUN_ID)){ definition.setRunID((String) getProperties().get(CascadingUtil.CASCADING_RUN_ID)); } return planner.buildFlow(definition); ======= return planner .buildFlow(new FlowDef() .setName(name != null ? name : defaultFlowName) .addTails(tails) .addSources(sources) .addSinks(sinks) .addTraps(traps)); >>>>>>> FlowDef definition = new FlowDef() .setName(name != null ? name : defaultFlowName) .addTails(tails) .addSources(sources) .addSinks(sinks) .addTraps(traps); if(getProperties().containsKey(CascadingUtil.CASCADING_RUN_ID)){ definition.setRunID((String) getProperties().get(CascadingUtil.CASCADING_RUN_ID)); } return planner.buildFlow(definition);
<<<<<<< import org.junit.Test; import java.io.IOException; import java.util.Arrays; import java.util.List; ======= >>>>>>>
<<<<<<< /********************************************************************** /* Deserialization, parser, format features /********************************************************************** ======= /********************************************************** /* Configured helper objects /********************************************************** */ /** * Linked list that contains all registered problem handlers. * Implementation as front-added linked list allows for sharing * of the list (tail) without copying the list. */ protected final LinkedNode<DeserializationProblemHandler> _problemHandlers; /** * Factory used for constructing {@link com.fasterxml.jackson.databind.JsonNode} instances. */ protected final JsonNodeFactory _nodeFactory; /** * @since 2.12 */ protected final CoercionConfigs _coercionConfigs; /* /********************************************************** /* Deserialization features /********************************************************** >>>>>>> /********************************************************************** /* Deserialization, parser, format features /********************************************************************** <<<<<<< _streamReadFeatures = src._streamReadFeatures; ======= _nodeFactory = src._nodeFactory; _coercionConfigs = src._coercionConfigs; _parserFeatures = src._parserFeatures; _parserFeaturesToChange = src._parserFeaturesToChange; >>>>>>> _streamReadFeatures = src._streamReadFeatures; _coercionConfigs = src._coercionConfigs; <<<<<<< _streamReadFeatures = src._streamReadFeatures; ======= _nodeFactory = src._nodeFactory; _coercionConfigs = src._coercionConfigs; _parserFeatures = src._parserFeatures; _parserFeaturesToChange = src._parserFeaturesToChange; >>>>>>> _streamReadFeatures = src._streamReadFeatures; _coercionConfigs = src._coercionConfigs; <<<<<<< _streamReadFeatures = src._streamReadFeatures; ======= _nodeFactory = src._nodeFactory; _coercionConfigs = src._coercionConfigs; _parserFeatures = src._parserFeatures; _parserFeaturesToChange = src._parserFeaturesToChange; _formatReadFeatures = src._formatReadFeatures; _formatReadFeaturesToChange = src._formatReadFeaturesToChange; } protected DeserializationConfig(DeserializationConfig src, SimpleMixInResolver mixins) { super(src, mixins); _deserFeatures = src._deserFeatures; _problemHandlers = src._problemHandlers; _nodeFactory = src._nodeFactory; _coercionConfigs = src._coercionConfigs; _parserFeatures = src._parserFeatures; _parserFeaturesToChange = src._parserFeaturesToChange; >>>>>>> _coercionConfigs = src._coercionConfigs; _streamReadFeatures = src._streamReadFeatures;
<<<<<<< cards.add(new SetCardInfo("Kindred Boon", 5, Rarity.RARE, mage.cards.k.KindredBoon.class)); cards.add(new SetCardInfo("Kindred Charge", 27, Rarity.RARE, mage.cards.k.KindredCharge.class)); cards.add(new SetCardInfo("Kindred Discovery", 11, Rarity.RARE, mage.cards.k.KindredDiscovery.class)); ======= cards.add(new SetCardInfo("Izzet Chemister", 26, Rarity.RARE, mage.cards.i.IzzetChemister.class)); cards.add(new SetCardInfo("Kheru Mind-Eater", 17, Rarity.RARE, mage.cards.k.KheruMindEater.class)); >>>>>>> cards.add(new SetCardInfo("Izzet Chemister", 26, Rarity.RARE, mage.cards.i.IzzetChemister.class)); cards.add(new SetCardInfo("Kheru Mind-Eater", 17, Rarity.RARE, mage.cards.k.KheruMindEater.class)); cards.add(new SetCardInfo("Kindred Boon", 5, Rarity.RARE, mage.cards.k.KindredBoon.class)); cards.add(new SetCardInfo("Kindred Charge", 27, Rarity.RARE, mage.cards.k.KindredCharge.class)); cards.add(new SetCardInfo("Kindred Discovery", 11, Rarity.RARE, mage.cards.k.KindredDiscovery.class)); <<<<<<< cards.add(new SetCardInfo("Kindred Summons", 32, Rarity.RARE, mage.cards.k.KindredSummons.class)); ======= cards.add(new SetCardInfo("Magus of the Mind", 12, Rarity.RARE, mage.cards.m.MagusOfTheMind.class)); cards.add(new SetCardInfo("Mirri, Weatherlight Duelist", 43, Rarity.MYTHIC, mage.cards.m.MirriWeatherlightDuelist.class)); >>>>>>> cards.add(new SetCardInfo("Kindred Summons", 32, Rarity.RARE, mage.cards.k.KindredSummons.class)); cards.add(new SetCardInfo("Magus of the Mind", 12, Rarity.RARE, mage.cards.m.MagusOfTheMind.class)); cards.add(new SetCardInfo("Mirri, Weatherlight Duelist", 43, Rarity.MYTHIC, mage.cards.m.MirriWeatherlightDuelist.class));
<<<<<<< /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets; import mage.cards.ExpansionSet; import mage.cards.repository.CardCriteria; import mage.cards.repository.CardInfo; import mage.cards.repository.CardRepository; import mage.constants.Rarity; import mage.constants.SetType; import java.util.ArrayList; import java.util.List; /** * * @author fireshoes */ public class AetherRevolt extends ExpansionSet { private static final AetherRevolt fINSTANCE = new AetherRevolt(); public static AetherRevolt getInstance() { return fINSTANCE; } protected final List<CardInfo> savedSpecialLand = new ArrayList<>(); private AetherRevolt() { super("Aether Revolt", "AER", ExpansionSet.buildDate(2017, 1, 20), SetType.EXPANSION); this.blockName = "Kaladesh"; this.hasBoosters = true; this.hasBasicLands = false; this.numBoosterLands = 1; this.numBoosterCommon = 10; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 8; this.maxCardNumberInBooster = 184; this.ratioBoosterSpecialLand = 144; this.parentSet = Kaladesh.getInstance(); cards.add(new SetCardInfo("Ajani, Valiant Protector", 185, Rarity.MYTHIC, mage.cards.a.AjaniValiantProtector.class)); cards.add(new SetCardInfo("Disallow", 31, Rarity.RARE, mage.cards.d.Disallow.class)); cards.add(new SetCardInfo("Tezzeret, Master of Metal", 190, Rarity.MYTHIC, mage.cards.t.TezzeretMasterOfMetal.class)); cards.add(new SetCardInfo("Yaheeni's Expertise", 75, Rarity.RARE, mage.cards.y.YaheenisExpertise.class)); } @Override public List<CardInfo> getSpecialLand() { if (savedSpecialLand.isEmpty()) { CardCriteria criteria = new CardCriteria(); criteria.setCodes("MPS"); criteria.minCardNumber(31); criteria.maxCardNumber(54); savedSpecialLand.addAll(CardRepository.instance.findCards(criteria)); } return new ArrayList<>(savedSpecialLand); } } ======= /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets; import mage.cards.ExpansionSet; import mage.cards.repository.CardCriteria; import mage.cards.repository.CardInfo; import mage.cards.repository.CardRepository; import mage.constants.Rarity; import mage.constants.SetType; import java.util.ArrayList; import java.util.List; /** * * @author fireshoes */ public class AetherRevolt extends ExpansionSet { private static final AetherRevolt fINSTANCE = new AetherRevolt(); public static AetherRevolt getInstance() { return fINSTANCE; } protected final List<CardInfo> savedSpecialLand = new ArrayList<>(); private AetherRevolt() { super("Aether Revolt", "AER", ExpansionSet.buildDate(2017, 1, 20), SetType.EXPANSION); this.blockName = "Kaladesh"; this.hasBoosters = true; this.hasBasicLands = false; this.numBoosterLands = 1; this.numBoosterCommon = 10; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 8; this.maxCardNumberInBooster = 184; this.ratioBoosterSpecialLand = 144; this.parentSet = Kaladesh.getInstance(); cards.add(new SetCardInfo("Ajani Unyielding", 127, Rarity.MYTHIC, mage.cards.a.AjaniUnyielding.class)); cards.add(new SetCardInfo("Ajani, Valiant Protector", 185, Rarity.MYTHIC, mage.cards.a.AjaniValiantProtector.class)); cards.add(new SetCardInfo("Disallow", 31, Rarity.RARE, mage.cards.d.Disallow.class)); cards.add(new SetCardInfo("Tezzeret, Master of Metal", 190, Rarity.MYTHIC, mage.cards.t.TezzeretMasterOfMetal.class)); cards.add(new SetCardInfo("Pia's Revolution", 91, Rarity.RARE, mage.cards.p.PiasRevolution.class)); cards.add(new SetCardInfo("Trophy Mage", 48, Rarity.UNCOMMON, mage.cards.t.TrophyMage.class)); } @Override public List<CardInfo> getSpecialLand() { if (savedSpecialLand.isEmpty()) { CardCriteria criteria = new CardCriteria(); criteria.setCodes("MPS"); criteria.minCardNumber(31); criteria.maxCardNumber(54); savedSpecialLand.addAll(CardRepository.instance.findCards(criteria)); } return new ArrayList<>(savedSpecialLand); } } >>>>>>> /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets; import mage.cards.ExpansionSet; import mage.cards.repository.CardCriteria; import mage.cards.repository.CardInfo; import mage.cards.repository.CardRepository; import mage.constants.Rarity; import mage.constants.SetType; import java.util.ArrayList; import java.util.List; /** * * @author fireshoes */ public class AetherRevolt extends ExpansionSet { private static final AetherRevolt fINSTANCE = new AetherRevolt(); public static AetherRevolt getInstance() { return fINSTANCE; } protected final List<CardInfo> savedSpecialLand = new ArrayList<>(); private AetherRevolt() { super("Aether Revolt", "AER", ExpansionSet.buildDate(2017, 1, 20), SetType.EXPANSION); this.blockName = "Kaladesh"; this.hasBoosters = true; this.hasBasicLands = false; this.numBoosterLands = 1; this.numBoosterCommon = 10; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 8; this.maxCardNumberInBooster = 184; this.ratioBoosterSpecialLand = 144; this.parentSet = Kaladesh.getInstance(); cards.add(new SetCardInfo("Ajani Unyielding", 127, Rarity.MYTHIC, mage.cards.a.AjaniUnyielding.class)); cards.add(new SetCardInfo("Ajani, Valiant Protector", 185, Rarity.MYTHIC, mage.cards.a.AjaniValiantProtector.class)); cards.add(new SetCardInfo("Disallow", 31, Rarity.RARE, mage.cards.d.Disallow.class)); cards.add(new SetCardInfo("Tezzeret, Master of Metal", 190, Rarity.MYTHIC, mage.cards.t.TezzeretMasterOfMetal.class)); cards.add(new SetCardInfo("Pia's Revolution", 91, Rarity.RARE, mage.cards.p.PiasRevolution.class)); cards.add(new SetCardInfo("Trophy Mage", 48, Rarity.UNCOMMON, mage.cards.t.TrophyMage.class)); cards.add(new SetCardInfo("Yaheeni's Expertise", 75, Rarity.RARE, mage.cards.y.YaheenisExpertise.class)); } @Override public List<CardInfo> getSpecialLand() { if (savedSpecialLand.isEmpty()) { CardCriteria criteria = new CardCriteria(); criteria.setCodes("MPS"); criteria.minCardNumber(31); criteria.maxCardNumber(54); savedSpecialLand.addAll(CardRepository.instance.findCards(criteria)); } return new ArrayList<>(savedSpecialLand); } }
<<<<<<< filter.add(new SubtypePredicate(SubType.REFLECTION)); ======= filterToken.add(new SubtypePredicate("Reflection")); filterToken.add(new TokenPredicate()); filter.add(new SubtypePredicate("Reflection")); >>>>>>> filterToken.add(new SubtypePredicate(SubType.REFLECTION)); filterToken.add(new TokenPredicate()); filter.add(new SubtypePredicate(SubType.REFLECTION));
<<<<<<< import mage.choices.ChoiceColor; import mage.choices.ManaChoice; ======= >>>>>>> import mage.choices.ChoiceColor; import mage.choices.ManaChoice; <<<<<<< } class PlasmCaptureManaEffect extends ManaEffect { int amountOfMana; public PlasmCaptureManaEffect(int amountOfMana) { super(); this.amountOfMana = amountOfMana; this.staticText = "add X mana in any combination of colors, where X is that spell's converted mana cost"; } public PlasmCaptureManaEffect(final PlasmCaptureManaEffect effect) { super(effect); this.amountOfMana = effect.amountOfMana; } @Override public PlasmCaptureManaEffect copy() { return new PlasmCaptureManaEffect(this); } @Override public Mana produceMana(Game game, Ability source) { Player player = getPlayer(game, source); return ManaChoice.chooseAnyColor(player, game, amountOfMana); } @Override public List<Mana> getNetMana(Game game, Ability source) { List<Mana> netMana = new ArrayList<>(); netMana.add(new Mana(0, 0, 0, 0, 0, 0, amountOfMana, 0)); return netMana; } ======= >>>>>>>
<<<<<<< tokenImageSets.addAll(Arrays.asList("ZEN", "C14", "DDD", "C15", "GVL", "MM3", "CMA", "E01", "C19")); ======= tokenImageSets.addAll(Arrays.asList("ZEN", "C14", "DDD", "C15", "DD3GVL", "MM3", "CMA", "E01", "C19", "C20")); >>>>>>> tokenImageSets.addAll(Arrays.asList("ZEN", "C14", "DDD", "C15", "GVL", "MM3", "CMA", "E01", "C19", "C20"));
<<<<<<< private Map<UUID, FilterCreaturePermanent> usePowerInsteadOfToughnessForDamageLethalityFilters = new HashMap<>(); public GameImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife) { ======= public GameImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife, int startingSize) { >>>>>>> private Map<UUID, FilterCreaturePermanent> usePowerInsteadOfToughnessForDamageLethalityFilters = new HashMap<>(); public GameImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife, int startingSize) {
<<<<<<< cards.add(new SetCardInfo("Balan, Wandering Knight", 2, Rarity.RARE, mage.cards.b.BalanWanderingKnight.class)); cards.add(new SetCardInfo("O-Kagachi, Vengeful Kami", 3, Rarity.MYTHIC, mage.cards.o.OKagachiVengefulKami.class)); ======= cards.add(new SetCardInfo("O-Kagachi, Vengeful Kami", 45, Rarity.MYTHIC, mage.cards.o.OKagachiVengefulKami.class)); >>>>>>> cards.add(new SetCardInfo("Balan, Wandering Knight", 2, Rarity.RARE, mage.cards.b.BalanWanderingKnight.class)); cards.add(new SetCardInfo("O-Kagachi, Vengeful Kami", 45, Rarity.MYTHIC, mage.cards.o.OKagachiVengefulKami.class));
<<<<<<< import com.fasterxml.jackson.databind.type.CollectionType; import com.fasterxml.jackson.databind.type.MapType; import com.fasterxml.jackson.databind.util.SimpleLookupCache; ======= import com.fasterxml.jackson.databind.util.LRUMap; >>>>>>> import com.fasterxml.jackson.databind.util.SimpleLookupCache;
<<<<<<< ======= import java.lang.reflect.Type; import java.math.BigDecimal; >>>>>>> import java.math.BigDecimal;
<<<<<<< cards.add(new SetCardInfo("Nazahn, Revered Bladesmith", 44, Rarity.MYTHIC, mage.cards.n.NazahnReveredBladesmith.class)); ======= cards.add(new SetCardInfo("Balan, Wandering Knight", 2, Rarity.RARE, mage.cards.b.BalanWanderingKnight.class)); >>>>>>> cards.add(new SetCardInfo("Balan, Wandering Knight", 2, Rarity.RARE, mage.cards.b.BalanWanderingKnight.class)); cards.add(new SetCardInfo("Nazahn, Revered Bladesmith", 44, Rarity.MYTHIC, mage.cards.n.NazahnReveredBladesmith.class));
<<<<<<< cards.add(new SetCardInfo("Finale of Devastation", 160, Rarity.MYTHIC, mage.cards.f.FinaleOfDevastation.class)); ======= cards.add(new SetCardInfo("Finale of Eternity", 91, Rarity.MYTHIC, mage.cards.f.FinaleOfEternity.class)); >>>>>>> cards.add(new SetCardInfo("Finale of Devastation", 160, Rarity.MYTHIC, mage.cards.f.FinaleOfDevastation.class)); cards.add(new SetCardInfo("Finale of Eternity", 91, Rarity.MYTHIC, mage.cards.f.FinaleOfEternity.class)); <<<<<<< cards.add(new SetCardInfo("Ugin's Conjurant", 3, Rarity.UNCOMMON, mage.cards.u.UginsConjurant.class)); ======= cards.add(new SetCardInfo("Tyrant's Scorn", 225, Rarity.UNCOMMON, mage.cards.t.TyrantsScorn.class)); cards.add(new SetCardInfo("Ugin, the Ineffable", 2, Rarity.RARE, mage.cards.u.UginTheIneffable.class)); cards.add(new SetCardInfo("Unlikely Aid", 109, Rarity.COMMON, mage.cards.u.UnlikelyAid.class)); cards.add(new SetCardInfo("Vampire Opportunist", 110, Rarity.COMMON, mage.cards.v.VampireOpportunist.class)); >>>>>>> cards.add(new SetCardInfo("Tyrant's Scorn", 225, Rarity.UNCOMMON, mage.cards.t.TyrantsScorn.class)); cards.add(new SetCardInfo("Ugin's Conjurant", 3, Rarity.UNCOMMON, mage.cards.u.UginsConjurant.class)); cards.add(new SetCardInfo("Ugin, the Ineffable", 2, Rarity.RARE, mage.cards.u.UginTheIneffable.class)); cards.add(new SetCardInfo("Unlikely Aid", 109, Rarity.COMMON, mage.cards.u.UnlikelyAid.class)); cards.add(new SetCardInfo("Vampire Opportunist", 110, Rarity.COMMON, mage.cards.v.VampireOpportunist.class));
<<<<<<< /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets; import mage.cards.ExpansionSet; import mage.constants.Rarity; import mage.constants.SetType; /** * * @author fireshoes */ public class RivalsOfIxalan extends ExpansionSet { private static final RivalsOfIxalan instance = new RivalsOfIxalan(); public static RivalsOfIxalan getInstance() { return instance; } private RivalsOfIxalan() { super("Rivals of Ixalan", "RIX", ExpansionSet.buildDate(2018, 1, 19), SetType.EXPANSION); this.blockName = "Ixalan"; this.parentSet = Ixalan.getInstance(); this.hasBoosters = true; this.hasBasicLands = false; this.numBoosterLands = 1; this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 8; cards.add(new SetCardInfo("Angrath's Ambusher", 202, Rarity.UNCOMMON, mage.cards.a.AngrathsAmbusher.class)); cards.add(new SetCardInfo("Angrath's Fury", 204, Rarity.RARE, mage.cards.a.AngrathsFury.class)); cards.add(new SetCardInfo("Angrath, Minotaur Pirate", 201, Rarity.MYTHIC, mage.cards.a.AngrathMinotaurPirate.class)); cards.add(new SetCardInfo("Brass's Bounty", 94, Rarity.RARE, mage.cards.b.BrasssBounty.class)); cards.add(new SetCardInfo("Captain's Hook", 177, Rarity.RARE, mage.cards.c.CaptainsHook.class)); cards.add(new SetCardInfo("Cinder Barrens", 205, Rarity.RARE, mage.cards.c.CinderBarrens.class)); cards.add(new SetCardInfo("Elenda, the Dusk Rose", 157, Rarity.MYTHIC, mage.cards.e.ElendaTheDuskRose.class)); cards.add(new SetCardInfo("Evolving Wilds", 186, Rarity.RARE, mage.cards.e.EvolvingWilds.class)); cards.add(new SetCardInfo("Ghalta, Primal Hunger", 130, Rarity.RARE, mage.cards.g.GhaltaPrimalHunger.class)); cards.add(new SetCardInfo("Silvergill Adept", 53, Rarity.UNCOMMON, mage.cards.s.SilvergillAdept.class)); cards.add(new SetCardInfo("Storm the Vault", 173, Rarity.RARE, mage.cards.s.StormTheVault.class)); cards.add(new SetCardInfo("Swab Goblin", 203, Rarity.COMMON, mage.cards.s.SwabGoblin.class)); cards.add(new SetCardInfo("Tetzimoc, Primal Death", 86, Rarity.RARE, mage.cards.t.TetzimocPrimalDeath.class)); cards.add(new SetCardInfo("The Immortal Sun", 180, Rarity.MYTHIC, mage.cards.t.TheImmortalSun.class)); cards.add(new SetCardInfo("Vampire Champion", 198, Rarity.COMMON, mage.cards.v.VampireChampion.class)); cards.add(new SetCardInfo("Vault of Catlacan", 173, Rarity.RARE, mage.cards.v.VaultOfCatlacan.class)); cards.add(new SetCardInfo("Vona's Hunger", 90, Rarity.RARE, mage.cards.v.VonasHunger.class)); cards.add(new SetCardInfo("Vraska's Conquistador", 199, Rarity.UNCOMMON, mage.cards.v.VraskasConquistador.class)); cards.add(new SetCardInfo("Vraska's Scorn", 200, Rarity.RARE, mage.cards.v.VraskasScorn.class)); cards.add(new SetCardInfo("Vraska, Scheming Gorgon", 197, Rarity.MYTHIC, mage.cards.v.VraskaSchemingGorgon.class)); cards.add(new SetCardInfo("Zetalpa, Primal Dawn", 30, Rarity.RARE, mage.cards.z.ZetalpaPrimalDawn.class)); } } ======= /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets; import mage.cards.ExpansionSet; import mage.constants.Rarity; import mage.constants.SetType; /** * * @author fireshoes */ public class RivalsOfIxalan extends ExpansionSet { private static final RivalsOfIxalan instance = new RivalsOfIxalan(); public static RivalsOfIxalan getInstance() { return instance; } private RivalsOfIxalan() { super("Rivals of Ixalan", "RIX", ExpansionSet.buildDate(2018, 1, 19), SetType.EXPANSION); this.blockName = "Ixalan"; this.parentSet = Ixalan.getInstance(); this.hasBoosters = true; this.hasBasicLands = false; this.numBoosterLands = 1; this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 8; cards.add(new SetCardInfo("Angrath's Ambusher", 202, Rarity.UNCOMMON, mage.cards.a.AngrathsAmbusher.class)); cards.add(new SetCardInfo("Angrath's Fury", 204, Rarity.RARE, mage.cards.a.AngrathsFury.class)); cards.add(new SetCardInfo("Angrath, Minotaur Pirate", 201, Rarity.MYTHIC, mage.cards.a.AngrathMinotaurPirate.class)); cards.add(new SetCardInfo("Brass's Bounty", 94, Rarity.RARE, mage.cards.b.BrasssBounty.class)); cards.add(new SetCardInfo("Captain's Hook", 177, Rarity.RARE, mage.cards.c.CaptainsHook.class)); cards.add(new SetCardInfo("Cinder Barrens", 205, Rarity.RARE, mage.cards.c.CinderBarrens.class)); cards.add(new SetCardInfo("Dusk Charger", 69, Rarity.COMMON, mage.cards.d.DuskCharger.class)); cards.add(new SetCardInfo("Evolving Wilds", 186, Rarity.RARE, mage.cards.e.EvolvingWilds.class)); cards.add(new SetCardInfo("Ghalta, Primal Hunger", 130, Rarity.RARE, mage.cards.g.GhaltaPrimalHunger.class)); cards.add(new SetCardInfo("Glorious Destiny", 18, Rarity.RARE, mage.cards.g.GloriousDestiny.class)); cards.add(new SetCardInfo("Paladin of Atonement", 16, Rarity.RARE, mage.cards.p.PaladinOfAtonement.class)); cards.add(new SetCardInfo("Silvergill Adept", 53, Rarity.UNCOMMON, mage.cards.s.SilvergillAdept.class)); cards.add(new SetCardInfo("Storm the Vault", 173, Rarity.RARE, mage.cards.s.StormTheVault.class)); cards.add(new SetCardInfo("Swab Goblin", 203, Rarity.COMMON, mage.cards.s.SwabGoblin.class)); cards.add(new SetCardInfo("Tetzimoc, Primal Death", 86, Rarity.RARE, mage.cards.t.TetzimocPrimalDeath.class)); cards.add(new SetCardInfo("The Immortal Sun", 180, Rarity.MYTHIC, mage.cards.t.TheImmortalSun.class)); cards.add(new SetCardInfo("Vampire Champion", 198, Rarity.COMMON, mage.cards.v.VampireChampion.class)); cards.add(new SetCardInfo("Vault of Catlacan", 173, Rarity.RARE, mage.cards.v.VaultOfCatlacan.class)); cards.add(new SetCardInfo("Vona's Hunger", 90, Rarity.RARE, mage.cards.v.VonasHunger.class)); cards.add(new SetCardInfo("Vraska's Conquistador", 199, Rarity.UNCOMMON, mage.cards.v.VraskasConquistador.class)); cards.add(new SetCardInfo("Vraska's Scorn", 200, Rarity.RARE, mage.cards.v.VraskasScorn.class)); cards.add(new SetCardInfo("Vraska, Scheming Gorgon", 197, Rarity.MYTHIC, mage.cards.v.VraskaSchemingGorgon.class)); } } >>>>>>> /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets; import mage.cards.ExpansionSet; import mage.constants.Rarity; import mage.constants.SetType; /** * * @author fireshoes */ public class RivalsOfIxalan extends ExpansionSet { private static final RivalsOfIxalan instance = new RivalsOfIxalan(); public static RivalsOfIxalan getInstance() { return instance; } private RivalsOfIxalan() { super("Rivals of Ixalan", "RIX", ExpansionSet.buildDate(2018, 1, 19), SetType.EXPANSION); this.blockName = "Ixalan"; this.parentSet = Ixalan.getInstance(); this.hasBoosters = true; this.hasBasicLands = false; this.numBoosterLands = 1; this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 8; cards.add(new SetCardInfo("Angrath's Ambusher", 202, Rarity.UNCOMMON, mage.cards.a.AngrathsAmbusher.class)); cards.add(new SetCardInfo("Angrath's Fury", 204, Rarity.RARE, mage.cards.a.AngrathsFury.class)); cards.add(new SetCardInfo("Angrath, Minotaur Pirate", 201, Rarity.MYTHIC, mage.cards.a.AngrathMinotaurPirate.class)); cards.add(new SetCardInfo("Brass's Bounty", 94, Rarity.RARE, mage.cards.b.BrasssBounty.class)); cards.add(new SetCardInfo("Captain's Hook", 177, Rarity.RARE, mage.cards.c.CaptainsHook.class)); cards.add(new SetCardInfo("Cinder Barrens", 205, Rarity.RARE, mage.cards.c.CinderBarrens.class)); cards.add(new SetCardInfo("Dusk Charger", 69, Rarity.COMMON, mage.cards.d.DuskCharger.class)); cards.add(new SetCardInfo("Elenda, the Dusk Rose", 157, Rarity.MYTHIC, mage.cards.e.ElendaTheDuskRose.class)); cards.add(new SetCardInfo("Evolving Wilds", 186, Rarity.RARE, mage.cards.e.EvolvingWilds.class)); cards.add(new SetCardInfo("Ghalta, Primal Hunger", 130, Rarity.RARE, mage.cards.g.GhaltaPrimalHunger.class)); cards.add(new SetCardInfo("Glorious Destiny", 18, Rarity.RARE, mage.cards.g.GloriousDestiny.class)); cards.add(new SetCardInfo("Paladin of Atonement", 16, Rarity.RARE, mage.cards.p.PaladinOfAtonement.class)); cards.add(new SetCardInfo("Silvergill Adept", 53, Rarity.UNCOMMON, mage.cards.s.SilvergillAdept.class)); cards.add(new SetCardInfo("Storm the Vault", 173, Rarity.RARE, mage.cards.s.StormTheVault.class)); cards.add(new SetCardInfo("Swab Goblin", 203, Rarity.COMMON, mage.cards.s.SwabGoblin.class)); cards.add(new SetCardInfo("Tetzimoc, Primal Death", 86, Rarity.RARE, mage.cards.t.TetzimocPrimalDeath.class)); cards.add(new SetCardInfo("The Immortal Sun", 180, Rarity.MYTHIC, mage.cards.t.TheImmortalSun.class)); cards.add(new SetCardInfo("Vampire Champion", 198, Rarity.COMMON, mage.cards.v.VampireChampion.class)); cards.add(new SetCardInfo("Vault of Catlacan", 173, Rarity.RARE, mage.cards.v.VaultOfCatlacan.class)); cards.add(new SetCardInfo("Vona's Hunger", 90, Rarity.RARE, mage.cards.v.VonasHunger.class)); cards.add(new SetCardInfo("Vraska's Conquistador", 199, Rarity.UNCOMMON, mage.cards.v.VraskasConquistador.class)); cards.add(new SetCardInfo("Vraska's Scorn", 200, Rarity.RARE, mage.cards.v.VraskasScorn.class)); cards.add(new SetCardInfo("Vraska, Scheming Gorgon", 197, Rarity.MYTHIC, mage.cards.v.VraskaSchemingGorgon.class)); cards.add(new SetCardInfo("Zetalpa, Primal Dawn", 30, Rarity.RARE, mage.cards.z.ZetalpaPrimalDawn.class)); } }
<<<<<<< cards.add(new SetCardInfo("As Luck Would Have It", 102, Rarity.RARE, mage.cards.a.AsLuckWouldHaveIt.class)); cards.add(new SetCardInfo("Crow Storm", 31, Rarity.UNCOMMON, mage.cards.c.CrowStorm.class)); cards.add(new SetCardInfo("Forest", 216, Rarity.LAND, mage.cards.basiclands.Forest.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Ground Pounder", 110, Rarity.COMMON, mage.cards.g.GroundPounder.class)); cards.add(new SetCardInfo("Island", 213, Rarity.LAND, mage.cards.basiclands.Island.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Mountain", 215, Rarity.LAND, mage.cards.basiclands.Mountain.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Plains", 212, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Swamp", 214, Rarity.LAND, mage.cards.basiclands.Swamp.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); ======= cards.add(new SetCardInfo("Amateur Auteur", 3, Rarity.COMMON, mage.cards.a.AmateurAuteur.class)); >>>>>>> cards.add(new SetCardInfo("Amateur Auteur", 3, Rarity.COMMON, mage.cards.a.AmateurAuteur.class)); cards.add(new SetCardInfo("As Luck Would Have It", 102, Rarity.RARE, mage.cards.a.AsLuckWouldHaveIt.class)); cards.add(new SetCardInfo("Crow Storm", 31, Rarity.UNCOMMON, mage.cards.c.CrowStorm.class)); cards.add(new SetCardInfo("Forest", 216, Rarity.LAND, mage.cards.basiclands.Forest.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Ground Pounder", 110, Rarity.COMMON, mage.cards.g.GroundPounder.class)); cards.add(new SetCardInfo("Island", 213, Rarity.LAND, mage.cards.basiclands.Island.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Mountain", 215, Rarity.LAND, mage.cards.basiclands.Mountain.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Plains", 212, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Swamp", 214, Rarity.LAND, mage.cards.basiclands.Swamp.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); <<<<<<< ======= cards.add(new SetCardInfo("Target Minotaur", 98, Rarity.COMMON, mage.cards.t.TargetMinotaur.class)); >>>>>>> cards.add(new SetCardInfo("Target Minotaur", 98, Rarity.COMMON, mage.cards.t.TargetMinotaur.class));
<<<<<<< public interface ServerVariables extends Constructible, Extensible<ServerVariables> { ======= @Deprecated public interface ServerVariables extends Constructible, Extensible<ServerVariables>, Map<String, ServerVariable> { >>>>>>> @Deprecated public interface ServerVariables extends Constructible, Extensible<ServerVariables> {
<<<<<<< private final OutgoingMessageQueue<MessageType> outgoingMessageQueue; ======= /** * Queue of all messages being published by this publisher. */ private final OutgoingMessageQueue<MessageType> outgoingMessages; /** * All {@link PublisherListener} instances added to the publisher. */ private final List<PublisherListener> publisherListeners = new CopyOnWriteArrayList<PublisherListener>(); /** * Th {@link ExecutorService} to be used for all thread creation. */ private final ExecutorService executorService; >>>>>>> /** * Queue of all messages being published by this publisher. */ private final OutgoingMessageQueue<MessageType> outgoingMessageQueue; /** * All {@link PublisherListener} instances added to the publisher. */ private final List<PublisherListener> publisherListeners = new CopyOnWriteArrayList<PublisherListener>(); /** * The {@link ExecutorService} to be used for all thread creation. */ private final ExecutorService executorService; <<<<<<< outgoingMessageQueue = new OutgoingMessageQueue<MessageType>(serializer, executorService); ======= this.executorService = executorService; // TODO(khughes): Use the handed in ExecutorService in the // OutgoingMessageQueue. outgoingMessages = new OutgoingMessageQueue<MessageType>(serializer); outgoingMessages.start(); >>>>>>> this.executorService = executorService; outgoingMessageQueue = new OutgoingMessageQueue<MessageType>(serializer, executorService); <<<<<<< outgoingMessageQueue.setLatchMode(enabled); ======= outgoingMessages.setLatchMode(enabled); >>>>>>> outgoingMessageQueue.setLatchMode(enabled); <<<<<<< outgoingMessageQueue.shutdown(); ======= outgoingMessages.shutdown(); signalShutdown(); >>>>>>> outgoingMessageQueue.shutdown(); signalShutdown(); <<<<<<< return outgoingMessageQueue.getNumberOfChannels() > 0; ======= return outgoingMessages.getNumberChannels() > 0; >>>>>>> return outgoingMessageQueue.getNumberOfChannels() > 0; <<<<<<< return outgoingMessageQueue.getNumberOfChannels(); ======= return outgoingMessages.getNumberChannels(); >>>>>>> return outgoingMessageQueue.getNumberOfChannels(); <<<<<<< outgoingMessageQueue.put(message); ======= outgoingMessages.put(message); >>>>>>> outgoingMessageQueue.put(message); <<<<<<< outgoingMessageQueue.addChannel(channel); ======= outgoingMessages.addChannel(channel); signalRemoteConnection(); } @Override public void addPublisherListener(PublisherListener listener) { publisherListeners.add(listener); } @Override public void removePublisherListener(PublisherListener listener) { publisherListeners.add(listener); } /** * Notify listeners that the node has been registered. * * <p> * Done in another thread. */ public void signalRegistrationDone() { final Publisher<MessageType> publisher = this; executorService.execute(new Runnable() { @Override public void run() { for (PublisherListener listener : publisherListeners) { listener.onPublisherMasterRegistration(publisher); } } }); } /** * Notify listeners that the node has been registered. * * <p> * Done in another thread. */ private void signalRemoteConnection() { final Publisher<MessageType> publisher = this; executorService.execute(new Runnable() { @Override public void run() { for (PublisherListener listener : publisherListeners) { listener.onPublisherRemoteConnection(publisher); } } }); } /** * Notify listeners that the node has shutdown. * * <p> * Done in another thread. */ private void signalShutdown() { final Publisher<MessageType> publisher = this; executorService.execute(new Runnable() { @Override public void run() { for (PublisherListener listener : publisherListeners) { listener.onPublisherShutdown(publisher); } } }); >>>>>>> outgoingMessageQueue.addChannel(channel); signalRemoteConnection(); } @Override public void addPublisherListener(PublisherListener listener) { publisherListeners.add(listener); } @Override public void removePublisherListener(PublisherListener listener) { publisherListeners.add(listener); } /** * Notify listeners that the node has been registered. * * <p> * Done in another thread. */ public void signalRegistrationDone() { final Publisher<MessageType> publisher = this; executorService.execute(new Runnable() { @Override public void run() { for (PublisherListener listener : publisherListeners) { listener.onPublisherMasterRegistration(publisher); } } }); } /** * Notify listeners that the node has been registered. * * <p> * Done in another thread. */ private void signalRemoteConnection() { final Publisher<MessageType> publisher = this; executorService.execute(new Runnable() { @Override public void run() { for (PublisherListener listener : publisherListeners) { listener.onPublisherRemoteConnection(publisher); } } }); } /** * Notify listeners that the node has shutdown. * * <p> * Done in another thread. */ private void signalShutdown() { final Publisher<MessageType> publisher = this; executorService.execute(new Runnable() { @Override public void run() { for (PublisherListener listener : publisherListeners) { listener.onPublisherShutdown(publisher); } } });