auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void writeSubscribeCommands( String repoName, List<SubscribeCommand> commands) throws IOException { write("repository " + repoName); for (SubscribeCommand cmd : commands) { switch (cmd.getCommand()) { case SUBSCRIBE: write("want " + cmd.getSpec()); break; case UNSUBSCRIBE: write("stop " + cmd.getSpec()); break; default: throw new IllegalArgumentException(); } } }

Target:
private void writeSubscribeCommands( String repoName, List<SubscribeCommand> commands) throws IOException { write("repository " + repoName); for (SubscribeCommand cmd : commands) { switch (cmd.getCommand()) { case SUBSCRIBE: write("want " + cmd.getSpec()); break; case UNSUBSCRIBE: write("stop " + cmd.getSpec()); break; default: throw new IllegalArgumentException(cmd.toString()); } } }
Source:
public Optional<Control> getControlForAction(String actionId) { return actionBar.getControlById(actionId); }

Target:
public Optional<Control> getControlForAction(String actionId) { if (tableViewerComposite.getActionBar().isPresent()) { return tableViewerComposite.getActionBar().get().getControlById(actionId); } return Optional.empty(); }
Source:
public void save(PageRequestContext requestContext) throws SetupWizardException { StudyProgrammeDAO studyProgrammeDAO = DAOFactory.getInstance().getStudyProgrammeDAO(); StudyProgrammeCategoryDAO studyProgrammeCategoryDAO = DAOFactory.getInstance().getStudyProgrammeCategoryDAO(); OrganizationDAO organizationDAO = DAOFactory.getInstance().getOrganizationDAO(); int rowCount = NumberUtils.createInteger(requestContext.getRequest().getParameter("studyProgrammesTable.rowCount")).intValue(); for (int i = 0; i < rowCount; i++) { String colPrefix = "studyProgrammesTable." + i; Long studyProgrammeId = requestContext.getLong(colPrefix + ".studyProgrammeId"); String name = requestContext.getString(colPrefix + ".name"); String code = requestContext.getString(colPrefix + ".code"); Long categoryId = requestContext.getLong(colPrefix + ".category"); Long organizationId = requestContext.getLong(colPrefix + ".organization"); StudyProgrammeCategory category = null; Organization organization = null; if (categoryId != null) { category = studyProgrammeCategoryDAO.findById(categoryId); } if (organizationId != null) { organization = organizationDAO.findById(organizationId); } if (studyProgrammeId == -1) { studyProgrammeDAO.create(organization, name, category, code); } } }

Target:
public void save(PageRequestContext requestContext) throws SetupWizardException { StudyProgrammeDAO studyProgrammeDAO = DAOFactory.getInstance().getStudyProgrammeDAO(); StudyProgrammeCategoryDAO studyProgrammeCategoryDAO = DAOFactory.getInstance().getStudyProgrammeCategoryDAO(); DefaultsDAO defaultsDAO = DAOFactory.getInstance().getDefaultsDAO(); Defaults defaults = defaultsDAO.getDefaults(); int rowCount = NumberUtils.createInteger(requestContext.getRequest().getParameter("studyProgrammesTable.rowCount")).intValue(); for (int i = 0; i < rowCount; i++) { String colPrefix = "studyProgrammesTable." + i; Long studyProgrammeId = requestContext.getLong(colPrefix + ".studyProgrammeId"); String name = requestContext.getString(colPrefix + ".name"); String code = requestContext.getString(colPrefix + ".code"); Long categoryId = requestContext.getLong(colPrefix + ".category"); StudyProgrammeCategory category = null; if (categoryId != null) { category = studyProgrammeCategoryDAO.findById(categoryId); } if (studyProgrammeId == -1) { studyProgrammeDAO.create(defaults.getOrganization(), name, category, code); } } }
Source:
public static SchemaPlus from(Database db) { final SchemaPlus schema = CalciteSchema.createRootSchema( false , false , VoltFrameworkConfig.DEFAULT_SCHEMA_NAME).plus(); db.getTables().forEach(table -> { schema.add(table.getTypeName(), new VoltTable(table)); }); for (Map.Entry<String, Triple<Class, Boolean, Class[]>> function : VoltSqlFunctions.VOLT_SQL_FUNCTIONS.entries()) { schema.add(function.getKey().toUpperCase(), ScalarFunctionImpl.create(function.getValue().getLeft(), function.getKey(), function.getValue().getMiddle(), function.getValue().getRight())); } return schema; }

Target:
public static SchemaPlus from(Database db) { final SchemaPlus schema = CalciteSchema.createRootSchema( false , false , VoltFrameworkConfig.DEFAULT_SCHEMA_NAME).plus(); db.getTables().forEach(table -> { schema.add(table.getTypeName(), new VoltTable(table)); }); for (Map.Entry<Class, VoltSqlFunctions.FunctionDescriptor> function : VoltSqlFunctions.VOLT_SQL_FUNCTIONS.entries()) { switch(function.getValue().getType()){ case SCALAR: ScalarFunctionDescriptor scalarFunction = (ScalarFunctionDescriptor) function.getValue(); schema.add(scalarFunction.getFunctionName().toUpperCase(), ScalarFunctionImpl.create( function.getKey(), scalarFunction.getFunctionName(), scalarFunction.isExactArgumentTypes(), scalarFunction.getFunctionId(), scalarFunction.getArgumentTypes())); break; case AGGREGATE: AggregateFunctionDescriptor aggregateFunction = (AggregateFunctionDescriptor) function.getValue(); schema.add(aggregateFunction.getFunctionName().toUpperCase(), AggregateFunctionImpl.create( function.getKey(), aggregateFunction.getFunctionName(), aggregateFunction.isExactArgumentTypes(), aggregateFunction.getAggType(), aggregateFunction.getArgumentTypes())); break; default: break; } } return schema; }
Source:
public byte[] getSignature() { try (final DefaultAgentProxy agentProxy = new DefaultAgentProxy()) { final byte[] bytes = stream.toByteArray(); stream.reset(); return agentProxy.sign(identity, bytes); } catch (IOException e) { throw Throwables.propagate(e); } }

Target:
public byte[] getSignature() { try { return agentProxy.sign(identity, stream.toByteArray()); } catch (IOException e) { throw Throwables.propagate(e); } }
Source:
boolean isAssignmentValid(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext) { return node.getCurrentAssignmentCount() < node.getMaxPartition() && node.getCurrentAssignmentsByResource(replica.getResourceName()).size() < replica .getResourceMaxPartitionsPerInstance(); }

Target:
boolean isAssignmentValid(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext) { return node.getAssignedReplicaCount() < node.getMaxPartition() && node.getAssignedPartitionsByResource(replica.getResourceName()).size() < replica .getResourceMaxPartitionsPerInstance(); }
Source:
public void globalVerify() throws Exception { if (isMemberNode(targetInstance)) { MapConfig mapConfig = targetInstance.getConfig().getMapConfig(basename); MapStoreConfig mapStoreConfig = mapConfig.getMapStoreConfig(); final MapStoreWithCounterPerKey mapStore = (MapStoreWithCounterPerKey) mapStoreConfig.getImplementation(); final IMap map = targetInstance.getMap(basename); assertTrueEventually(new AssertTask() { @Override public void run() throws Exception { assertEquals("The number of items in the store is incorrect. ", keyCounter.intValue(), mapStore.storeCount.size()); } },300); log.info(basename + ": Checking if some keys where stored more than once"); for (Object k : mapStore.storeCount.keySet()) { assertEquals("There were multiple calls to MapStore.store", 1, mapStore.storeCount.get(k).intValue()); } } }

Target:
public void globalVerify() throws Exception { if (isMemberNode(targetInstance)) { MapConfig mapConfig = targetInstance.getConfig().getMapConfig(basename); MapStoreConfig mapStoreConfig = mapConfig.getMapStoreConfig(); Map<Object, AtomicInteger> mapStore = ((MapStoreWithCounterPerKey)mapStoreConfig.getImplementation()).storeCount; log.info(basename + ": Checking if some keys where stored more than once"); for (Object k : mapStore.keySet()) { assertEquals("There were multiple calls to MapStore.store", 1, mapStore.get(k).intValue()); } } }
Source:
public void testFirst() { for (Storage storage : TestConfig.STORAGES_TO_TEST_AGAINST) { Literal javac = storage.createLiteral("javac.exe", RDF.PLAIN_LITERAL); Node mods = storage.createNode(Mods.MODS); NodeReference kitodo = storage.createNodeReference("<LINK_0>"); Node node = storage.createNode().add(javac).add(kitodo).put(Mets.TYPE, mods); node.removeAll(RDF.toURL(Node.FIRST_INDEX)); assertThat(node.first().orElse(null), is(equalTo((long) 2))); } }

Target:
public void testFirst() { for (Storage storage : TestConfig.STORAGES_TO_TEST_AGAINST) { Literal javac = storage.createLiteral("javac.exe", RDF.PLAIN_LITERAL); Node mods = storage.createNode(MODS_MODS); NodeReference kitodo = storage.createNodeReference("<LINK_0>"); Node node = storage.createNode().add(javac).add(kitodo).put(METS_TYPE, mods); node.removeAll(RDF.toURL(Node.FIRST_INDEX)); assertThat(node.first().orElse(null), is(equalTo((long) 2))); } }
Source:
private static FormatParserPlugin getFormatParserPluginInstance() { FormatParserPlugin parsie = null; String parsePlugin = sage.Sage.get("mediafile_mediaformat_parser_plugin", ""); try { parsie = (FormatParserPlugin) Class.forName(parsePlugin, true, sage.Sage.extClassLoader).newInstance(); } catch (Throwable e1) { if (sage.Sage.DBG) { System.out.println("Error instantiating metadata parser plugin of:" + e1); } } return parsie; }

Target:
private static FormatParserPlugin getFormatParserPluginInstance() { if (formatParserPluginInstance == null) { String parsePlugin = sage.Sage.get("mediafile_mediaformat_parser_plugin", ""); if (!parsePlugin.isEmpty()) { synchronized (formatParserPluginLock) { if (formatParserPluginInstance != null) { return formatParserPluginInstance; } try { formatParserPluginInstance = (FormatParserPlugin) Class.forName(parsePlugin, true, sage.Sage.extClassLoader).newInstance(); } catch (Throwable e1) { if (sage.Sage.DBG) { System.out.println("Error instantiating metadata parser plugin of: " + e1); } } } } } return formatParserPluginInstance; }
Source:
public Iterable<RawQuery.Result<String>> query(RawQuery query, KeyInformation.IndexRetriever informations, TransactionHandle tx) throws StorageException { List<RawQuery.Result<String>> result = new ArrayList<RawQuery.Result<String>>(); String core = query.getStore(); String keyIdField = keyFieldIds.get(core); SolrServer solr = this.solrServers.get(core); SolrQuery solrQuery = new SolrQuery(); solrQuery.setQuery("*:*"); solrQuery.addFilterQuery(query.getQuery()); solrQuery.addField("*"); solrQuery.addField("score"); if (query.hasLimit()) { solrQuery.setRows(query.getLimit()); } else { solrQuery.setRows(MAX_RESULT_SET_SIZE); } try { QueryResponse response = null; response = solr.query(solrQuery); log.debug("Executed query in ms", query.getQuery(), response.getElapsedTime()); int totalHits = response.getResults().size(); if (false == query.hasLimit() && totalHits >= MAX_RESULT_SET_SIZE) { log.warn("Query result set truncated to first elements for query: {}", MAX_RESULT_SET_SIZE, query); } result = new ArrayList<RawQuery.Result<String>>(totalHits); for (SolrDocument hit : response.getResults()) { result.add(new RawQuery.Result<String>(hit.getFieldValue(keyIdField).toString(), Double.parseDouble(hit.getFieldValue("score").toString()))); } } catch (HttpSolrServer.RemoteSolrException e) { log.error("Query did not complete because parameters were not recognized : ", e); } catch (SolrServerException e) { log.error("Unable to query Solr index.", e); } return result; }

Target:
public Iterable<RawQuery.Result<String>> query(RawQuery query, KeyInformation.IndexRetriever informations, TransactionHandle tx) throws StorageException { List<RawQuery.Result<String>> result = new ArrayList<RawQuery.Result<String>>(); String core = query.getStore(); String keyIdField = keyFieldIds.get(core); SolrServer solr = this.solrServers.get(core); SolrQuery solrQuery = new SolrQuery(); solrQuery.setQuery("*:*"); solrQuery.addFilterQuery(query.getQuery()); solrQuery.addField(keyIdField); solrQuery.addField("score"); if (query.hasLimit()) { solrQuery.setRows(query.getLimit()); } else { solrQuery.setRows(MAX_RESULT_SET_SIZE); } try { QueryResponse response = null; response = solr.query(solrQuery); log.debug("Executed query in ms", query.getQuery(), response.getElapsedTime()); int totalHits = response.getResults().size(); if (false == query.hasLimit() && totalHits >= MAX_RESULT_SET_SIZE) { log.warn("Query result set truncated to first elements for query: {}", MAX_RESULT_SET_SIZE, query); } result = new ArrayList<RawQuery.Result<String>>(totalHits); for (SolrDocument hit : response.getResults()) { double score = Double.parseDouble(hit.getFieldValue("score").toString()); result.add( new RawQuery.Result<String>(hit.getFieldValue(keyIdField).toString(), score)); } } catch (HttpSolrServer.RemoteSolrException e) { log.error("Query did not complete because parameters were not recognized : ", e); } catch (SolrServerException e) { log.error("Unable to query Solr index.", e); } return result; }
Source:
private Object visitDataReadCommand(InvocationContext ctx, AbstractDataCommand command) { final Object key = command.getKey(); CompletionStage<Void> stage = entryFactory.wrapEntryForReading(ctx, key, command.getSegment(), ignoreOwnership(command) || canRead(command)); if ((CompletionStages.isCompletedSuccessfully(stage))) { return invokeNextThenApply(ctx, command, dataReadReturnHandler); } return asyncValue(stage).thenApply(ctx, command, ((rCtx, rCommand, rv) -> invokeNextThenApply(rCtx, command, dataReadReturnHandler))); }

Target:
private Object visitDataReadCommand(InvocationContext ctx, AbstractDataCommand command) { final Object key = command.getKey(); CompletionStage<Void> stage = entryFactory.wrapEntryForReading(ctx, key, command.getSegment(), ignoreOwnership(command) || canRead(command)); return makeStage(asyncInvokeNext(ctx, command, stage)).thenApply(ctx, command, dataReadReturnHandler); }
Source:
void onComplete(DeleteOperation op) { Exception e = op.getOperationException(); if (e == null) { notificationSystem.onBlobDeleted(op.getBlobId().getID()); } else { routerMetrics.deleteBlobErrorCount.inc(); routerMetrics.countError(e); } routerMetrics.operationDequeuingRate.mark(); routerMetrics.deleteBlobOperationLatencyMs.update(time.milliseconds() - op.getSubmissionTimeMs()); if (op.setCallbackInvoked()) { operationCompleteCallback.completeOperation(op.getFutureResult(), op.getCallback(), op.getOperationResult(), op.getOperationException()); } }

Target:
void onComplete(DeleteOperation op) { Exception e = op.getOperationException(); if (e == null) { notificationSystem.onBlobDeleted(op.getBlobId().getID()); } else { routerMetrics.deleteBlobErrorCount.inc(); routerMetrics.countError(e); } routerMetrics.operationDequeuingRate.mark(); routerMetrics.deleteBlobOperationLatencyMs.update(time.milliseconds() - op.getSubmissionTimeMs()); operationCompleteCallback.completeOperation(op.getFutureResult(), op.getCallback(), op.getOperationResult(), op.getOperationException()); }
Source:
public synchronized void setDistinctId(String distinctId) { if (mDistinctId == distinctId) { return; } else { mUnseenSurveys.clear(); mUnseenNotifications.clear(); mVariants = new JSONArray(); mDistinctId = distinctId; } }

Target:
public synchronized void setDistinctId(String distinctId) { if (mDistinctId == null || !mDistictId.equals(distinctId)){ mUnseenSurveys.clear(); mUnseenNotifications.clear(); } mDistinctId = distinctId; }
Source:
public void issue_1678() { ProjectFactory.newProject("test-empty").version(SupportedVersions.CAMEL_LATEST).type(ProjectType.SPRING) .create(); CamelEditor editor = new CamelEditor("camel-context.xml"); editor.addCamelComponent(new Route(), 100, 100); editor.selectEditPart("Route _route1"); FusePropertiesView propertiesView = new FusePropertiesView(); propertiesView.activate(); propertiesView.selectTab("Details"); propertiesView.setProperty(PropertyType.TEXT, "Auto Startup", "true"); editor.save(); editor.doOperation("Route _route1", "Go Into"); assertFalse("Invoke of 'Go Into' failed", editor.isComponentAvailable("Route _route2")); assertFalse("Project 'test-empty' contains 'Graphic is disposed' error", graphicError()); editor.doOperation("Route _route1", "Show Camel Context"); assertTrue("Invoke of 'Show Camel Context' failed", editor.isComponentAvailable("Route _route2")); assertFalse("Project 'test-empty' contains 'Graphic is disposed' error", graphicError()); }

Target:
public void issue_1678() { ProjectFactory.newProject("test-empty").version(SupportedVersions.CAMEL_LATEST).type(ProjectType.SPRING) .create(); CamelEditor editor = new CamelEditor("camel-context.xml"); editor.addCamelComponent(new Route(), 100, 100); editor.selectEditPart("Route _route1"); FusePropertiesView propertiesView = new FusePropertiesView(); propertiesView.activate(); propertiesView.selectTab("Details"); propertiesView.setProperty(PropertyType.TEXT, "Auto Startup", "true"); editor.save(); editor.doOperation("Route _route1", "Go Into"); assertFalse("Invoke of 'Go Into' failed", editor.isComponentAvailable("Route _route2")); assertTrue(LogGrapper.getPluginErrors("fuse").size() == 0); editor.doOperation("Route _route1", "Show Camel Context"); assertTrue("Invoke of 'Show Camel Context' failed", editor.isComponentAvailable("Route _route2")); assertTrue(LogGrapper.getPluginErrors("fuse").size() == 0); }
Source:
private void runTester(long numberOfItems, ComparisonConstant op, int ts) throws NoConnectionsException, IOException { Pair<Long, Long> pair = new Pair<>(0l, Long.MAX_VALUE); int loop = 0; long existingRows = numberOfItems; while (pair.getSecond() > 0) { pair = nibbleDeletePartitioned(op, ts, existingRows); existingRows -= pair.getFirst(); if (++loop > 100) { fail("Make no progress on delete, something wrong happens in @NibbleDeleteSP"); } } pair = new Pair<>(0l, Long.MAX_VALUE); loop = 0; existingRows = numberOfItems; while (pair.getSecond() > 0) { pair = nibbleDeleteReplicated(op, ts, existingRows); existingRows -= pair.getFirst(); if (++loop > 100) { fail("Make no progress on delete, something wrong happens in @NibbleDeleteSP"); } } }

Target:
private void runTester(long numberOfItems, ComparisonConstant op, int ts) throws NoConnectionsException, IOException { Pair<Long, Long> pair = new Pair<>(0l, Long.MAX_VALUE); int loop = 0; long existingRows = numberOfItems; while (pair.getSecond() > 0) { pair = nibbleDeletePartitioned(op, ts, existingRows); existingRows -= pair.getFirst(); if (++loop > 100) { fail("Make no progress on delete, something wrong happens in @NibbleDeleteSP or @NibbleDeleteMP"); } } pair = new Pair<>(0l, Long.MAX_VALUE); loop = 0; existingRows = numberOfItems; while (pair.getSecond() > 0) { pair = nibbleDeleteReplicated(op, ts, existingRows); existingRows -= pair.getFirst(); if (++loop > 100) { fail("Make no progress on delete, something wrong happens in @NibbleDeleteSP or @NibbleDeleteMP"); } } }
Source:
public void write(JsonWriter out, PublicKey value) throws IOException { checkArgument(value instanceof RSAPublicKey || value instanceof DSAPublicKey, "Only RSA and DSA keys are supported"); if (value instanceof RSAPublicKey) { out.value(SshKeys.encodeAsOpenSSH((RSAPublicKey) value)); } else { out.value(DSAKeys.encodeAsOpenSSH((DSAPublicKey) value)); } }

Target:
public void write(JsonWriter out, PublicKey value) throws IOException { if (value instanceof RSAPublicKey) { out.value(SshKeys.encodeAsOpenSSH((RSAPublicKey) value)); } else if (value instanceof DSAPublicKey) { out.value(DSAKeys.encodeAsOpenSSH((DSAPublicKey) value)); } else { throw new IllegalArgumentException("Only RSA and DSA keys are supported"); } }
Source:
public void shutdown() throws InterruptedException { bossGroup.shutdownGracefully().sync(); workerGroup.shutdownGracefully().sync(); logger.info("HttpServer shutdown "); }

Target:
public void shutdown() throws InterruptedException { bossGroup.shutdownGracefully().sync(); workerGroup.shutdownGracefully().sync(); logger.info("HttpsServer shutdown "); }
Source:
public void testNotFound() throws Exception { given() .when() .get("/skeleton/0000.SKL") .then() .statusCode(HttpStatus.NOT_FOUND.value()); }

Target:
public void testNotFound() throws Exception { given() .when() .get("/skeletonFiles/0000.SKL") .then() .statusCode(HttpStatus.NOT_FOUND.value()); }
Source:
public void testSnapshotRemoteWithNodeFiler() throws Exception { int grids = 3; CacheConfiguration<Integer, Integer> ccfg = txCacheConfig(new CacheConfiguration<Integer, Integer>(DEFAULT_CACHE_NAME)) .setNodeFilter(node -> node.consistentId().toString().endsWith("1")); for (int i = 0; i < grids; i++) startGrid(optimize(getConfiguration(getTestIgniteInstanceName(i)).setCacheConfiguration())); IgniteEx ig0 = grid(0); ig0.cluster().baselineAutoAdjustEnabled(false); ig0.cluster().state(ACTIVE); for (int i = 0; i < CACHE_KEYS_RANGE; i++) ig0.getOrCreateCache(ccfg).put(i, i); forceCheckpoint(); Map<Integer, Set<Integer>> parts = new HashMap<>(); parts.put(CU.cacheId(DEFAULT_CACHE_NAME), null); IgniteInternalFuture<?> fut = snp(grid(0)).requestRemoteSnapshot(grid(2).localNode().id(), parts, new BiConsumer<File, GroupPartitionId>() { @Override public void accept(File file, GroupPartitionId gprPartId) { fail("We should not receive anything."); } }); assertThrowsAnyCause(log, fut::get, IgniteCheckedException.class, "The snapshot operation stopped"); }

Target:
public void testSnapshotRemoteWithNodeFiler() throws Exception { int grids = 3; CacheConfiguration<Integer, Integer> ccfg = txCacheConfig(new CacheConfiguration<Integer, Integer>(DEFAULT_CACHE_NAME)) .setNodeFilter(node -> node.consistentId().toString().endsWith("1")); for (int i = 0; i < grids; i++) startGrid(optimize(getConfiguration(getTestIgniteInstanceName(i)).setCacheConfiguration())); IgniteEx ig0 = grid(0); ig0.cluster().baselineAutoAdjustEnabled(false); ig0.cluster().state(ACTIVE); for (int i = 0; i < CACHE_KEYS_RANGE; i++) ig0.getOrCreateCache(ccfg).put(i, i); Map<Integer, Set<Integer>> parts = new HashMap<>(); parts.put(CU.cacheId(DEFAULT_CACHE_NAME), null); IgniteInternalFuture<?> fut = snp(grid(0)).requestRemoteSnapshot(grid(2).localNode().id(), parts, new BiConsumer<File, GroupPartitionId>() { @Override public void accept(File file, GroupPartitionId gprPartId) { fail("We should not receive anything."); } }); assertThrowsAnyCause(log, fut::get, IgniteCheckedException.class, "The snapshot operation stopped"); }
Source:
public ClientBuilder newBuilder(String clientName, JaxRsClientConfig config, Collection<JaxRsFeatureGroup> featureGroups) { final List<Consumer<SslContextFactory>> sSlFactoryContextCustomizers = getSSlFactoryContextCustomizers(config, featureGroups); final List<Consumer<HttpClient>> httpClientCustomizers = getHttpClientCustomizers(clientName, config); return new JettyResteasyClientBuilder(true, httpClientCustomizers, sSlFactoryContextCustomizers) .connectTimeout(config.getConnectTimeout().toMillis(), TimeUnit.MILLISECONDS) .executorService(configureThreadPool(clientName, config)); }

Target:
public ClientBuilder newBuilder(String clientName, JaxRsClientConfig config, Collection<JaxRsFeatureGroup> featureGroups) { final List<Consumer<SslContextFactory>> sslFactoryContextCustomizers = getSSlFactoryContextCustomizers(config, featureGroups); final List<Consumer<HttpClient>> httpClientCustomizers = getHttpClientCustomizers(clientName, config); return new JettyResteasyClientBuilder(true, httpClientCustomizers, sslFactoryContextCustomizers) .connectTimeout(config.getConnectTimeout().toMillis(), TimeUnit.MILLISECONDS) .executorService(configureThreadPool(clientName, config)); }
Source:
public void startNewSegment() { lastTimeUpdated = 0; lastPoint = null; execWithClose(updateScript, new Object[] { 0, 0, 0, 0, 0, System.currentTimeMillis(), -1.0f}); addTrackPoint(null, true, System.currentTimeMillis()); }

Target:
public void startNewSegment() { lastTimeUpdated = 0; lastPoint = null; execWithClose(updateScript, new Object[] { 0, 0, 0, 0, 0, System.currentTimeMillis(), NO_HEADING}); addTrackPoint(null, true, System.currentTimeMillis()); }
Source:
Set<Pool> revokeEntitlementsFromOverflowingPools(List<Pool> pools) { Collection<Pool> overflowing = new ArrayList<>(); for (Pool pool : pools) { if (pool.isOverflowing()) { overflowing.add(pool); } } if (overflowing.isEmpty()) { return null; } List<Entitlement> entitlementsToRevoke = new ArrayList<>(); overflowing = poolCurator.lockAndLoad(overflowing); List<Entitlement> overFlowingEnts = this.poolCurator.retrieveOrderedEntitlementsOf(overflowing); Map<String, List<Entitlement>> entMap = new HashMap<>(); for (Entitlement entitlement : overFlowingEnts) { List<Entitlement> poolEnts = entMap.get(entitlement.getPool().getId()); if (poolEnts == null) { poolEnts = new ArrayList<Entitlement>(); entMap.put(entitlement.getPool().getId(), poolEnts); } poolEnts.add(entitlement); } for (Pool pool : overflowing) { List<Entitlement> entitlements = entMap.get(pool.getId()); long newConsumed = pool.getConsumed(); for (Entitlement ent : entitlements) { if (newConsumed > pool.getQuantity()) { entitlementsToRevoke.add(ent); newConsumed -= ent.getQuantity(); } else { break; } } } return revokeEntitlements(new ArrayList<>(entitlementsToRevoke)); }

Target:
Set<Pool> revokeEntitlementsFromOverflowingPools(List<Pool> pools) { Collection<Pool> overflowing = pools.stream().filter(Pool::isOverflowing).collect(Collectors.toList()); if (overflowing.isEmpty()) { return null; } List<Entitlement> entitlementsToRevoke = new ArrayList<>(); overflowing = poolCurator.lockAndLoad(overflowing); List<Entitlement> overFlowingEnts = this.poolCurator.retrieveOrderedEntitlementsOf(overflowing); Map<String, List<Entitlement>> entMap = new HashMap<>(); for (Entitlement entitlement : overFlowingEnts) { entMap.computeIfAbsent(entitlement.getPool().getId(), k -> new ArrayList<>()).add(entitlement); } for (Pool pool : overflowing) { List<Entitlement> entitlements = entMap.get(pool.getId()); long newConsumed = pool.getConsumed(); for (Entitlement ent : entitlements) { if (newConsumed > pool.getQuantity()) { entitlementsToRevoke.add(ent); newConsumed -= ent.getQuantity(); } else { break; } } } return revokeEntitlements(new ArrayList<>(entitlementsToRevoke)); }
Source:
default boolean connectAll(@Nonnull S subject, @Nullable Collection<O> objects) { if (subject == null) { throw new IllegalArgumentException(); } return objects == null || objects.stream().filter(Objects::nonNull).map(object -> connect(subject, object)).allMatch(b -> b); }

Target:
default boolean connectAll(@Nonnull S subject, @Nullable Collection<O> objects) { if (subject == null) { throw new IllegalArgumentException(); } return objects == null || objects.stream().filter(Objects::nonNull).map(object -> connect(subject, object)) .reduce(Boolean.TRUE, (b1, b2) -> b1 && b2); }
Source:
private IAuthenticationResult getAccessTokenByClientCredentialGrant(AzureCloudConfig azureCloudConfig) throws MalformedURLException, InterruptedException, ExecutionException { ConfidentialClientApplication app = ConfidentialClientApplication.builder(azureCloudConfig.azureStorageClientId, ClientCredentialFactory.createFromSecret(azureCloudConfig.azureStorageSecret)) .authority(azureCloudConfig.azureStorageAuthority) .build(); ClientCredentialParameters clientCredentialParam = ClientCredentialParameters.builder(Collections.singleton(AZURE_STORAGE_ACCESS_SCOPE)).build(); CompletableFuture<IAuthenticationResult> future = app.acquireToken(clientCredentialParam); return future.get(); }

Target:
private IAuthenticationResult getAccessTokenByClientCredentialGrant(AzureCloudConfig azureCloudConfig) throws MalformedURLException, InterruptedException, ExecutionException { ConfidentialClientApplication app = ConfidentialClientApplication.builder(azureCloudConfig.azureStorageClientId, ClientCredentialFactory.createFromSecret(azureCloudConfig.azureStorageSecret)) .authority(azureCloudConfig.azureStorageAuthority) .build(); ClientCredentialParameters clientCredentialParam = ClientCredentialParameters.builder(Collections.singleton(azureCloudConfig.azureStorageScope)).build(); return app.acquireToken(clientCredentialParam).get(); }
Source:
private static IProject createExistingProject(final ProjectRecord record, IProgressMonitor monitor) throws CoreException { String projectName = record.getProjectName(); final IWorkspace workspace = ResourcesPlugin.getWorkspace(); final IProject project = workspace.getRoot().getProject(projectName); if (record.getProjectDescription() == null) { record.setProjectDescription(workspace .newProjectDescription(projectName)); IPath locationPath = new Path(record.getProjectSystemFile() .getAbsolutePath()); if (Platform.getLocation().isPrefixOf(locationPath)) { record.getProjectDescription().setLocation(null); } else { record.getProjectDescription().setLocation(locationPath); } } else { record.getProjectDescription().setName(projectName); } try { monitor.beginTask( UIText.WizardProjectsImportPage_CreateProjectsTask, 100); project.create(record.getProjectDescription(), new SubProgressMonitor(monitor, 30)); project.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor( monitor, 50)); return project; } finally { monitor.done(); } }

Target:
private static IProject createExistingProject(final ProjectRecord record, IProgressMonitor monitor) throws CoreException { String projectName = record.getProjectName(); final IWorkspace workspace = ResourcesPlugin.getWorkspace(); final IProject project = workspace.getRoot().getProject(projectName); if (record.getProjectDescription() == null) { record.setProjectDescription(workspace .newProjectDescription(projectName)); IPath locationPath = new Path(record.getProjectSystemFile() .getAbsolutePath()); if (Platform.getLocation().isPrefixOf(locationPath)) record.getProjectDescription().setLocation(null); else record.getProjectDescription().setLocation(locationPath); } else record.getProjectDescription().setName(projectName); try { monitor.beginTask( UIText.WizardProjectsImportPage_CreateProjectsTask, 100); project.create(record.getProjectDescription(), new SubProgressMonitor(monitor, 30)); project.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor( monitor, 50)); return project; } finally { monitor.done(); } }
Source:
void func(long seed, Random param) { Random localVar1 = new Random(); Random localVar2 = new Random(seed); Object localVar3 = new Object(); staticField = new Random(); field = new Random(); thid.field = new Random(); field = localVar1 = new Random(); field = (localVar1 = new Random()); localVar1 = localVar2 = new Random(); localVar1 = (localVar2 = new Random()); Random localVar4 = field = new Random(); Random localVar5 = localVar4 = new Random(); new Random(); param = new Random(); func(12, new Random()); func(12, localVar1 = new Random()); }

Target:
void func(long seed, Random param) { Random localVar1 = new Random(); Random localVar2 = new Random(seed); Object localVar3 = new Object(); staticField = new Random(); field = new Random(); this.field = new Random(); field = localVar1 = new Random(); field = (localVar1 = new Random()); localVar1 = localVar2 = new Random(); localVar1 = (localVar2 = new Random()); Random localVar4 = field = new Random(); Random localVar5 = localVar4 = new Random(); new Random(); param = new Random(); func(12, new Random()); func(12, localVar1 = new Random()); }
Source:
private CardDetailsEntity buildCardDetailsEntity(AuthCardDetails authCardDetails) { CardDetailsEntity detailsEntity = new CardDetailsEntity(); detailsEntity.setCardBrand(sanitize(authCardDetails.getCardBrand())); detailsEntity.setCardHolderName(sanitize(authCardDetails.getCardHolder())); detailsEntity.setExpiryDate(authCardDetails.getEndDate()); if (hasFullCardNumber(authCardDetails)) { detailsEntity.setFirstDigitsCardNumber(FirstDigitsCardNumber.of(StringUtils.left(authCardDetails.getCardNo(), 6))); } if (hasLastFourCharactersCardNumber(authCardDetails)) { detailsEntity.setLastDigitsCardNumber(LastDigitsCardNumber.of(StringUtils.right(authCardDetails.getCardNo(), 4))); } if (authCardDetails.getAddress().isPresent()) { AddressEntity addressEntity = new AddressEntity(authCardDetails.getAddress().get()); processRegionForCanadaOrUs(addressEntity); detailsEntity.setBillingAddress(addressEntity); } detailsEntity.setCardType(PayersCardType.toCardType(authCardDetails.getPayersCardType())); return detailsEntity; }

Target:
private CardDetailsEntity buildCardDetailsEntity(AuthCardDetails authCardDetails) { CardDetailsEntity detailsEntity = new CardDetailsEntity(); detailsEntity.setCardBrand(sanitize(authCardDetails.getCardBrand())); detailsEntity.setCardHolderName(sanitize(authCardDetails.getCardHolder())); detailsEntity.setExpiryDate(authCardDetails.getEndDate()); if (hasFullCardNumber(authCardDetails)) { detailsEntity.setFirstDigitsCardNumber(FirstDigitsCardNumber.of(StringUtils.left(authCardDetails.getCardNo(), 6))); } if (hasLastFourCharactersCardNumber(authCardDetails)) { detailsEntity.setLastDigitsCardNumber(LastDigitsCardNumber.of(StringUtils.right(authCardDetails.getCardNo(), 4))); } authCardDetails.getAddress().ifPresent(address -> { AddressEntity addressEntity = new AddressEntity(authCardDetails.getAddress().get()); processRegionForCanadaOrUs(addressEntity); detailsEntity.setBillingAddress(addressEntity); }); detailsEntity.setCardType(PayersCardType.toCardType(authCardDetails.getPayersCardType())); return detailsEntity; }
Source:
public static String stripSlash(String url) { String ret = url; while (ret.endsWith("/")) { ret = ret.substring(0, ret.length() - 1); } return ret; }

Target:
private String stripSlash(String url) { String ret = url; while (ret.endsWith("/")) { ret = ret.substring(0, ret.length() - 1); } return ret; }
Source:
private List<Exception> violationsToException(Set<ConstraintViolation<Adapter>> violations) { List<Exception> result = new ArrayList<>(); for (ConstraintViolation v : violations) { result.add(new CoreException(String.format("Interlok Validation Error: [%1$s]=[%2$s]", v.getPropertyPath(), v.getMessage()))); } return result; }

Target:
private List<Exception> violationsToException(Set<ConstraintViolation<Adapter>> violations) { return violations.stream().map((v) -> new CoreException(String .format("Interlok Validation Error: [%1$s]=[%2$s]", v.getPropertyPath(), v.getMessage()))) .collect(Collectors.toList()); }
Source:
public static BootProtocol map(Ipv6BootProtocol entity) { if (entity == null) { return null; } switch (entity) { case POLY_DHCP_AUTOCONF: case AUTOCONF: return BootProtocol.AUTOCONF; case DHCP: return BootProtocol.DHCP; case NONE: return BootProtocol.NONE; case STATIC_IP: return BootProtocol.STATIC; default: return null; } }

Target:
public static BootProtocol map(Ipv6BootProtocol entity) { if (entity == null) { return null; } switch (entity) { case AUTOCONF: return BootProtocol.AUTOCONF; case DHCP: return BootProtocol.DHCP; case NONE: return BootProtocol.NONE; case STATIC_IP: return BootProtocol.STATIC; default: return null; } }
Source:
void aggregates() { BbCreateProject createProject1 = createProject(); BbCreateProject createProject2 = createProject(); BbProject expectedProject1 = createdProjectState(createProject1); BbProject expectedProject2 = createdProjectState(createProject2); context.receivesCommands(createProject1, createProject2) .assertThat(exactly(BbProject.class, ImmutableSet.of(expectedProject1, expectedProject2))); }

Target:
void aggregates() { BbCreateProject createProject1 = createProject(); BbCreateProject createProject2 = createProject(); BbProject expectedProject1 = createdProjectState(createProject1); BbProject expectedProject2 = createdProjectState(createProject2); context.receivesCommands(createProject1, createProject2) .assertThat(exactly(BbProject.class, of(expectedProject1, expectedProject2))); }
Source:
public List<Relationship> getRightRelations(Context context, Entity entity) { List<Relationship> fullList = this.getAllRelations(context, entity); List<Relationship> listToReturn = new LinkedList<>(); for (Relationship relationship : fullList) { if (relationship.getRightItem() == entity.getItem()) { listToReturn.add(relationship); } } return listToReturn; }

Target:
public List<Relationship> getRightRelations(Context context, Entity entity) { List<Relationship> fullList = entity.getRelationships(); List<Relationship> listToReturn = new LinkedList<>(); for (Relationship relationship : fullList) { if (relationship.getRightItem().getID() == entity.getItem().getID()) { listToReturn.add(relationship); } } return listToReturn; }
Source:
private TimeLockServices createInvalidatingTimeLockServices(String client) { List<String> uris = install.cluster().cluster().uris(); ImmutableLeaderConfig leaderConfig = ImmutableLeaderConfig.builder() .addLeaders(uris.toArray(new String[uris.size()])) .localServer(install.cluster().localServer()) .sslConfiguration(PaxosRemotingUtils.getSslConfigurationOptional(install)) .quorumSize(uris.size() / 2 + 1) .build(); Supplier<ManagedTimestampService> rawTimestampServiceSupplier = timestampCreator.createTimestampService(client, leaderConfig); Supplier<LockService> rawLockServiceSupplier = lockCreator::createThreadPoolingLockService; return timelockCreator.createTimeLockServices(client, rawTimestampServiceSupplier, rawLockServiceSupplier); }

Target:
private TimeLockServices createInvalidatingTimeLockServices(String client) { List<String> uris = install.cluster().cluster().uris(); ImmutableLeaderConfig leaderConfig = ImmutableLeaderConfig.builder() .addLeaders(uris.toArray(new String[uris.size()])) .localServer(install.cluster().localServer()) .sslConfiguration(PaxosRemotingUtils.getSslConfigurationOptional(install)) .quorumSize(PaxosRemotingUtils.getQuorumSize(uris)) .build(); Supplier<ManagedTimestampService> rawTimestampServiceSupplier = timestampCreator .createTimestampService(client, leaderConfig); Supplier<LockService> rawLockServiceSupplier = lockCreator::createThreadPoolingLockService; return timelockCreator.createTimeLockServices(client, rawTimestampServiceSupplier, rawLockServiceSupplier); }
Source:
public void stop(ProfilePoint operationName) { long stop = System.nanoTime(); if (operationName == NULL_OP) { return; } if (!operations.containsKey(operationName)) { return; } long total = stop - operations.get(operationName); double time = (total / 1000) / 1000.0; if(time >= logThreshold){ String stringTime = Double.toString(time); if(stringTime.length() < 6 && stringTime.contains(".")){ while(stringTime.length() < 6){ stringTime += "0"; } } stringTime += "ms"; if(time > 1000){ stringTime = Double.toString(((long)time) / 1000.0) + "sec"; } doLog("[" + stringTime + "][Lvl:" + (operationName.getGranularity().getLevel()) + "]:" + getIndent(queuedProfilePoints) + operationName.toString() + operationName.getMessage() + (operationName.wasGCd()?gcString:"")); } queuedProfilePoints--; }

Target:
public void stop(ProfilePoint operationName) { long stop = System.nanoTime(); if (operationName == NULL_OP) { return; } if (!operations.containsKey(operationName)) { return; } long total = stop - operations.get(operationName); double time = (total / 1000) / 1000.0; if(time >= logThreshold){ String stringTime = Double.toString(time); if(stringTime.length() < 6 && stringTime.contains(".")){ while(stringTime.length() < 6){ stringTime += "0"; } } stringTime += "ms"; if(time > 1000){ stringTime = Double.toString(((long)time) / 1000.0) + "sec"; } String operationMessage = operationName.getMessage()!=null?" Message: "+operationName.getMessage():""; doLog("[" + stringTime + "][Lvl:" + (operationName.getGranularity().getLevel()) + "]:" + getIndent(queuedProfilePoints) + operationName.toString() + operationMessage + (operationName.wasGCd()?gcString:"")); } queuedProfilePoints--; }
Source:
public Cluster apply(Cluster original) { requireNonNull(original); Node nodeInStripe = getStripe().getNodes().stream().findAny().get(); Optional<Stripe> stripeOptional = original.getStripe(nodeInStripe.getNodeAddress()); if (!stripeOptional.isPresent()) { throw new IllegalArgumentException("Node name: " + nodeInStripe.getNodeName() + " is not in cluster: " + original); } for (Node node : getStripe().getNodes()) { if (stripeOptional.get().containsNode(node.getNodeAddress())) { throw new IllegalArgumentException("Node with address: " + node.getNodeAddress() + " is not in stripe: " + stripeOptional.get() + " in cluster: " + original); } } Cluster updated = original.clone(); updated.detachStripe(getStripe()); return updated; }

Target:
public Cluster apply(Cluster original) { requireNonNull(original); if (!original.getStripes().contains(getStripe())) { throw new IllegalArgumentException("Stripe : " + getStripe() + " is not in cluster: " + original); } Cluster updated = original.clone(); updated.removeStripe(getStripe()); return updated; }
Source:
private static boolean extendsZopeInterface(@Nullable Symbol symbol) { return SymbolUtils.findAllSuperClasses(symbol).stream().anyMatch( s -> "zope.interface.Interface".equals(s.fullyQualifiedName())); }

Target:
private static boolean extendsZopeInterface(@Nullable Symbol symbol) { if (symbol != null && symbol.kind() == Symbol.Kind.CLASS) { return ((ClassSymbol) symbol).isOrExtends("zope.interface.Interface"); } return false; }
Source:
private boolean isConsoleEnabled() { boolean isConsoleEnabled; if (getParameters().isConsoleEnabled() != null) { isConsoleEnabled = getParameters().isConsoleEnabled(); } else { isConsoleEnabled = getVmDeviceUtils().hasConsoleDevice(getVmId()); } return isConsoleEnabled; }

Target:
private boolean isConsoleEnabled() { if (getParameters().isConsoleEnabled() != null) { return getParameters().isConsoleEnabled(); } else { return getVmDeviceUtils().hasConsoleDevice(getVmId()); } }
Source:
public String getPath() { if (path == null) { return null; } boolean trailingSeparator = path.endsWith(File.separator); Path absolutePath = Paths.get(path); if (!absolutePath.isAbsolute()) { if (System.getProperty("ddf.home") != null) { absolutePath = Paths.get(System.getProperty("ddf.home"), path); } else { LOGGER.warn( "Path is relative. System property ddf.home is not set, resolving path to: ", path, absolutePath.toAbsolutePath()); } } String absolutePathStr = absolutePath.toAbsolutePath().toString(); return trailingSeparator ? absolutePathStr + File.separator : absolutePathStr; }

Target:
public String getPath() { if (System.getProperty("ddf.home") == null) { LOGGER.warn("System property ddf.home is not set"); } return getPath(System.getProperty("ddf.home")); }
Source:
public Rectangle getPreferredLocation(Rectangle proposedLocation) { Rectangle newLocation = null; if (port instanceof Port) { RTPortKindEnum kind = RTPortUtils.getKind((Port) port); if (null != kind) { switch (kind) { case EXTERNAL: case RELAY: newLocation = getPreferredBorderedLocation(proposedLocation); break; case SPP: case SAP: if (RTPortUtils.isService((Port) port)) { newLocation = getPreferredBorderedLocation(proposedLocation); } else { newLocation = getPreferredInternalLocation(proposedLocation); } break; case INTERNAL: newLocation = getPreferredInternalLocation(proposedLocation); break; default: newLocation = getPreferredBorderedLocation(proposedLocation); break; } } else { newLocation = getPreferredBorderedLocation(proposedLocation); } } else { newLocation = getPreferredBorderedLocation(proposedLocation); } return newLocation; }

Target:
public Rectangle getPreferredLocation(Rectangle proposedLocation) { Rectangle newLocation = null; if (port instanceof Port) { if (RTPortUtils.isService((Port) port)) { newLocation = getPreferredBorderedLocation(proposedLocation); } else { newLocation = getPreferredInternalLocation(proposedLocation); } } else { newLocation = getPreferredBorderedLocation(proposedLocation); } return newLocation; }
Source:
public static Set<String> getSwiftSourceFiles() throws IOException { Set<String> filenames = new TreeSet<String>(); for (String pathname: pathnames) { if (pathname.endsWith(".swift")) { filenames.add(pathname); } if (new File(pathname).isDirectory()) { Files.walk(Paths.get(pathname)) .filter((Path path) -> path.toString().endsWith(".swift")) .forEach((Path path) -> filenames.add(path.toString())); } } return filenames; }

Target:
public static Set<String> getSwiftSourceFiles() throws IOException { Set<String> filenames = new TreeSet<>(); for (String pathName : pathNames) { File file = new File(pathName); if (file.isDirectory()) { Files.walk(Paths.get(pathName)) .filter(path -> path.toFile().isFile()) .filter(path -> path.toString().endsWith(".swift")) .forEach(path -> filenames.add(path.toString())); } else if (file.isFile() && pathName.endsWith(".swift") && file.canRead()) { filenames.add(pathName); } else { throw new IOException("Cannot read " + pathName); } } return filenames; }
Source:
public void before() throws Exception { downloadCache.before(); Path tmpPath = tmp.getRoot().toPath(); LOG.info("The current temporary path: {}", tmpPath); this.sqlClientSessionConf = tmpPath.resolve("sql-client-session.conf"); this.result = tmpPath.resolve("result"); apacheAvroJars.add(downloadCache.getOrDownload("<LINK_2>", tmpPath)); apacheAvroJars.add(downloadCache.getOrDownload("<LINK_0>", tmpPath)); apacheAvroJars.add(downloadCache.getOrDownload("<LINK_1>", tmpPath)); }

Target:
public void before() throws Exception { DOWNLOAD_CACHE.before(); Path tmpPath = tmp.getRoot().toPath(); LOG.info("The current temporary path: {}", tmpPath); this.sqlClientSessionConf = tmpPath.resolve("sql-client-session.conf"); this.result = tmpPath.resolve("result"); apacheAvroJars.add(DOWNLOAD_CACHE.getOrDownload("<LINK_2>", tmpPath)); apacheAvroJars.add(DOWNLOAD_CACHE.getOrDownload("<LINK_0>", tmpPath)); apacheAvroJars.add(DOWNLOAD_CACHE.getOrDownload("<LINK_1>", tmpPath)); }
Source:
public SubstitutionMatrix(final List<CramCompressionRecord> records) { initializeBaseByCode(); final long[][] frequencies = buildFrequencies(records); for (final SubstitutionBase b : SubstitutionBase.values()) { encodedMatrixBytes[b.ordinal()] = substitutionCodeVector(b.getBase(), frequencies[b.getBase()]); } for (final SubstitutionBase r : SubstitutionBase.values()) { for (final SubstitutionBase b : SubstitutionBase.values()) { if (r != b) { baseByCode[r.getBase()][codeByBase[r.getBase()][b.getBase()]] = b.getBase(); baseByCode[Character.toLowerCase(r.getBase())][codeByBase[r.getBase()][b.getBase()]] = b.getBase(); } } } }

Target:
public SubstitutionMatrix(final List<CramCompressionRecord> records) { final long[][] frequencies = buildFrequencies(records); for (final SubstitutionBase b : BASES) { encodedMatrixBytes[b.ordinal()] = substitutionCodeVector(b.getBase(), frequencies[b.getBase()]); } for (final SubstitutionBase r : BASES) { for (final SubstitutionBase b : BASES) { if (r != b) { baseByCode[r.getBase()][codeByBase[r.getBase()][b.getBase()]] = b.getBase(); baseByCode[Character.toLowerCase(r.getBase())][codeByBase[r.getBase()][b.getBase()]] = b.getBase(); } } } }
Source:
public int getOpacity() { return PixelFormat.UNKNOWN; }

Target:
public int getOpacity() { return 0; }
Source:
public static boolean isOffsetFileValid(File storeDir, Set<SystemStreamPartition> storeSSPs, boolean isSideInput) { boolean hasValidOffsetFile = false; if (storeDir.exists()) { Map<SystemStreamPartition, String> offsetContents = readOffsetFile(storeDir, storeSSPs, isSideInput); if (offsetContents == null) { LOG.info("Offset file is not valid for store: {}.", storeDir.toPath() + "; the file does not exist."); } else if (offsetContents.isEmpty()) { LOG.info("Offset file is not valid for store: {}.", storeDir.toPath() + "; the file is empty."); } else if (!offsetContents.keySet().equals(storeSSPs)) { LOG.info("Offset file is not valid for store: {}.", storeDir.toPath() + "; the file does not match store SSPs: " + storeSSPs.toString() + "."); } else { hasValidOffsetFile = true; } } return hasValidOffsetFile; }

Target:
public static boolean isOffsetFileValid(File storeDir, Set<SystemStreamPartition> storeSSPs, boolean isSideInput) { boolean hasValidOffsetFile = false; if (storeDir.exists()) { Map<SystemStreamPartition, String> offsetContents = readOffsetFile(storeDir, storeSSPs, isSideInput); if (offsetContents == null) { LOG.info("Offset file does not exist. Store directory: {}", storeDir.toPath()); } else if (offsetContents.isEmpty()) { LOG.info("Offset file is empty. Store directory: {}", storeDir.toPath()); } else if (!offsetContents.keySet().equals(storeSSPs)) { LOG.info("Offset file is invalid since change-log SSPs don't match. " + "Store directory: {}. SSPs from offset-file: SSPs expected: ", storeDir.toPath(), offsetContents.keySet(), storeSSPs); } else { hasValidOffsetFile = true; } } return hasValidOffsetFile; }