auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private AbstractGCEvent<?> parseShenandoahEvent(String line) { AbstractGCEvent<?> event = null; Matcher noHeapMatcher = PATTERN_WITHOUT_HEAP.matcher(line); Matcher withHeapMatcher = PATTERN_WITH_HEAP.matcher(line); if (noHeapMatcher.find()) { event = new GCEvent(); AbstractGCEvent.Type type = AbstractGCEvent.Type.lookup(noHeapMatcher.group(NO_HEAP_EVENT_NAME)); event.setType(type); setPauseAndTimestamp(event, noHeapMatcher.group(NO_HEAP_DURATION), noHeapMatcher.group(NO_HEAP_TIMESTAMP)); } else if (withHeapMatcher.find()) { event = line.contains("Concurrent") ? new ConcurrentGCEvent() : new GCEvent(); AbstractGCEvent.Type type = AbstractGCEvent.Type.lookup(withHeapMatcher.group(WITH_HEAP_EVENT_NAME)); event.setType(type); setPauseAndTimestamp(event, withHeapMatcher.group(WITH_HEAP_DURATION), withHeapMatcher.group(WITH_HEAP_TIMESTAMP)); addHeapDetailsToEvent(event, withHeapMatcher.group(WITH_HEAP_MEMORY)); } else { getLogger().warning("Found line that has no match:" + line); } return event; }

Target:
private AbstractGCEvent<?> parseShenandoahEvent(String line) { AbstractGCEvent<?> event = null; Matcher noHeapMatcher = PATTERN_WITHOUT_HEAP.matcher(line); Matcher withHeapMatcher = PATTERN_WITH_HEAP.matcher(line); if (noHeapMatcher.find()) { event = new GCEvent(); AbstractGCEvent.Type type = AbstractGCEvent.Type.lookup(noHeapMatcher.group(NO_HEAP_EVENT_NAME)); event.setType(type); setPauseAndDateOrTimestamp(event, noHeapMatcher.group(NO_HEAP_TIMESTAMP), noHeapMatcher.group(NO_HEAP_DURATION)); } else if (withHeapMatcher.find()) { event = line.contains("Concurrent") ? new ConcurrentGCEvent() : new GCEvent(); AbstractGCEvent.Type type = AbstractGCEvent.Type.lookup(withHeapMatcher.group(WITH_HEAP_EVENT_NAME)); event.setType(type); setPauseAndDateOrTimestamp(event, withHeapMatcher.group(WITH_HEAP_TIMESTAMP), withHeapMatcher.group(WITH_HEAP_DURATION)); addHeapDetailsToEvent(event, withHeapMatcher.group(WITH_HEAP_MEMORY)); } else { getLogger().warning(String.format("Failed to parse line number %d in the log file: %s", in.getLineNumber(), line)); } return event; }
Source:
public void validate() throws ValidationException { if (ec2 != null) { ec2.validate(); } if (baremetal != null) { baremetal.validate(); } if (vagrant != null) { vagrant.validate(); } if(occi != null){ occi.validate(); } }

Target:
public void validate() throws ValidationException { if (ec2 != null) { ec2.validate(); } if (baremetal != null) { baremetal.validate(); } if (vagrant != null) { vagrant.validate(); } if(nova != null) { nova.validate(); } if(occi != null) { occi.validate(); } }
Source:
protected void setNavigationBarColor(@ColorInt int color) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { getWindow().setNavigationBarColor(color); boolean isDarkThemeOrDarkBackground = WikipediaApp.getInstance().getCurrentTheme().isDark() || color == ContextCompat.getColor(this, android.R.color.black); int systemUiVisibilityFlag = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR | getWindow().getDecorView().getSystemUiVisibility(); getWindow().getDecorView().setSystemUiVisibility(isDarkThemeOrDarkBackground ? 0 : systemUiVisibilityFlag); } }

Target:
protected void setNavigationBarColor(@ColorInt int color) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { boolean isDarkThemeOrDarkBackground = WikipediaApp.getInstance().getCurrentTheme().isDark() || color == ContextCompat.getColor(this, android.R.color.black); getWindow().setNavigationBarColor(color); getWindow().getDecorView().setSystemUiVisibility(isDarkThemeOrDarkBackground ? 0 : View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR | getWindow().getDecorView().getSystemUiVisibility()); } }
Source:
private boolean isPrecedentSourceEntry(LookupEntry entry, Application application) { return application.getConfiguration() .getEnabledReadSources() .asList() .get(0) .equals(entry.lookupRef().publisher()); }

Target:
private boolean isPrecedentSourceEntry(LookupEntry entry, Application application) { return application.getConfiguration() .getReadPrecedenceOrdering() .sortedCopy(application.getConfiguration().getEnabledReadSources()) .get(0) .equals(entry.lookupRef().publisher()); }
Source:
private void scheduleCheckStatus() { if (scheduledStatusCheckInProgress || reportsWebappDeployed) { return; } scheduledStatusCheckInProgress = true; Scheduler.get().scheduleFixedDelay( new Scheduler.RepeatingCommand() { @Override public boolean execute() { if (retryCount > MAX_RETRY_COUNTS || reportsWebappDeployed) { scheduledStatusCheckInProgress = false; return false; } retryCount++; checkReportsWebAppStatus(); return true; } }, RETRY_INTERVAL); }

Target:
private void scheduleCheckStatus() { scheduledStatusCheckInProgress = true; Scheduler.get().scheduleFixedDelay( new Scheduler.RepeatingCommand() { @Override public boolean execute() { if (retryCount > MAX_RETRY_COUNTS || reportsWebappDeployed) { scheduledStatusCheckInProgress = false; return false; } retryCount++; checkReportsWebAppStatus(); return true; } }, RETRY_INTERVAL); }
Source:
public List<DeviceOrganizationVisEdge> generateEdges() { List<DeviceOrganizationMetadataHolder> tempDevicesInOrganization = new ArrayList<>(); try { tempDevicesInOrganization = this.getDevicesInOrganization(); } catch (DeviceOrganizationException e) { String msg = "Error while getting devices in organization"; log.error(msg, e); } List<DeviceOrganizationVisEdge> edges = new ArrayList<>(); for (DeviceOrganizationMetadataHolder tempHolder: tempDevicesInOrganization) { String child = tempHolder.getDeviceId(); String parent = tempHolder.getParent(); if (parent.equals("") || parent.equals(" ")) { continue; } else { edges.add(new DeviceOrganizationVisEdge(parent, child)); } } return edges; }

Target:
public List<DeviceOrganizationVisEdge> generateEdges() { List<DeviceOrganizationMetadataHolder> tempDevicesInOrganization = new ArrayList<>(); try { tempDevicesInOrganization = this.getDevicesInOrganization(); } catch (DeviceOrganizationException e) { String msg = "Error while getting devices in organization"; log.error(msg, e); } List<DeviceOrganizationVisEdge> edges = new ArrayList<>(); for (DeviceOrganizationMetadataHolder tempHolder : tempDevicesInOrganization) { String child = tempHolder.getDeviceId(); String parent = tempHolder.getParent(); if (parent.trim().isEmpty()) { continue; } else { edges.add(new DeviceOrganizationVisEdge(parent, child)); } } return edges; }
Source:
public static Function<String, OsFamily> osFamily() { return new Function<String, OsFamily>() { @Override public OsFamily apply(final String label) { if (label != null) { if (label.toUpperCase().contains("CENTOS")) return OsFamily.CENTOS; if (label.toUpperCase().contains("OPENLOGIC")) return OsFamily.CENTOS; else if (label.contains("SUSE")) return OsFamily.SUSE; else if (label.toUpperCase().contains("UBUNTU")) return OsFamily.UBUNTU; else if (label.toUpperCase().contains("WINDOWS")) return OsFamily.WINDOWS; else if (label.toUpperCase().contains("ORACLE LINUX")) return OsFamily.OEL; } return OsFamily.UNRECOGNIZED; } }; }

Target:
public static Function<OSImage, OperatingSystem.Builder> osFamily() { return new Function<OSImage, OperatingSystem.Builder>() { @Override public OperatingSystem.Builder apply(final OSImage image) { final String label = image.label(); checkNotNull(label, "label"); OsFamily family = OsFamily.UNRECOGNIZED; if (label.contains(CENTOS)) family = OsFamily.CENTOS; else if (label.contains(OPENLOGIC)) family = OsFamily.CENTOS; else if (label.contains(SUSE)) family = OsFamily.SUSE; else if (label.contains(UBUNTU)) family = OsFamily.UBUNTU; else if (label.contains(WINDOWS)) family = OsFamily.WINDOWS; else if (label.contains(ORACLE_lINUX)) family = OsFamily.OEL; String version = UNRECOGNIZED; if (label.contains(COREOS)) version = label.replace("CoreOS ", ""); else if (label.contains(OPENSUSE)) version = label.replace("openSUSE ", ""); else if (label.contains(SUSE)) version = label.replace("SUSE ", ""); else if (label.contains(UBUNTU)) version = label.replace("Ubuntu Server ", ""); else if (label.contains(SQL_SERVER)) version = label; else if (label.contains(CENTOS)) version = label; else if (label.contains(WINDOWS)) version = label; else if (label.equals(ORACLE_lINUX)) version = label; if (family != OsFamily.UNRECOGNIZED) { return OperatingSystem.builder().family(family).version(version) .description(image.description() + ""); } else if (family == OsFamily.UNRECOGNIZED && image.os() == OSImage.Type.WINDOWS) { return OperatingSystem.builder().family(OsFamily.WINDOWS).version(version) .description(image.description() + ""); } return OperatingSystem.builder().family(OsFamily.LINUX).version(version).description(image.description()); } }; }
Source:
public void proposeUserIndex(Index idx) throws IgniteCheckedException { assert idx instanceof GridH2IndexBase; lock(true); try { ensureNotDestroyed(); Index idxExist = checkIndexPresence(idx); if (idxExist != null) { String idxCols = Stream.of(idx.getIndexColumns()) .map(k -> k.columnName).collect(Collectors.joining(", ")); U.warn(log, "Index with the given set of columns already exists (consider dropping either new" + " or existing index) [cacheName=" + cacheInfo.name() + ", schemaName=" + getSchema().getName() + ", tableName=" + getName() + ", newIndexName=" + idx.getName() + ", existingIndexName=" + idxExist.getName() + "]"); } Index oldTmpIdx = tmpIdxs.put(idx.getName(), (GridH2IndexBase)idx); assert oldTmpIdx == null; } finally { unlock(true); } }

Target:
public void proposeUserIndex(Index idx) throws IgniteCheckedException { assert idx instanceof GridH2IndexBase; lock(true); try { ensureNotDestroyed(); Index idxExist = checkIndexPresence(idx); if (idxExist != null) { String idxCols = Stream.of(idxExist.getIndexColumns()) .map(k -> k.columnName).collect(Collectors.joining(", ")); U.warn(log, "Index with the given set or subset of columns already exists " + "(consider dropping either new or existing index) [cacheName=" + cacheInfo.name() + ", " + "schemaName=" + getSchema().getName() + ", tableName=" + getName() + ", newIndexName=" + idx.getName() + ", existingIndexName=" + idxExist.getName() + ", existingIndexColumns=[" + idxCols + "]]"); } Index oldTmpIdx = tmpIdxs.put(idx.getName(), (GridH2IndexBase)idx); assert oldTmpIdx == null; } finally { unlock(true); } }
Source:
public void activate(final BundleContext bundleContext, final Map<String, Object> config) { logger.debug("dynamodb persistence service activated"); resetClient(); try { dbConfig = DynamoDBConfig.fromConfig(config); if (dbConfig == null) { throw new IllegalArgumentException("Something was wrong with configuration"); } tableNameResolver = new DynamoDBTableNameResolver(dbConfig.getTablePrefix()); } catch (Exception e) { logger.error("Error with configuration: {}", e); return; } try { db = new DynamoDBClient(dbConfig); if (!checkConnection()) { logger.error("dynamodb: database connection does not work for now, will retry to use the database."); } } catch (Exception e) { logger.error("Error constructing dynamodb client", e); return; } isProperlyConfigured = true; }

Target:
public void activate(final BundleContext bundleContext, final Map<String, Object> config) { resetClient(); dbConfig = DynamoDBConfig.fromConfig(config); if (dbConfig == null) { return; } tableNameResolver = new DynamoDBTableNameResolver(dbConfig.getTablePrefix()); try { boolean connectionOK = maybeConnectAndCheckConnection(); if (db == null) { logger.error("Error creating dynamodb database client. Aborting service activation."); return; } if (!connectionOK) { logger.warn("Failed to establish the dynamodb database connection. " + "Connection will be retried later on persistence service query/store."); } } catch (Exception e) { logger.error("Error constructing dynamodb client", e); return; } isProperlyConfigured = true; logger.debug("dynamodb persistence service activated"); }
Source:
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { try { PMML pmmlModel = JpmmlFactory.newPmml( new ByteArrayInputStream(modelProcessor.getPmml().getBytes())); Evaluator jpmmlEvaluator = JpmmlFactory.newEvaluator(pmmlModel); ModelOutputs modelOutputs = JpmmlModelOutputs.toDefaultStream(pmmlModel); this.modelRunner = new StreamlineJPMMLModelRunner( modelProcessor.getOutputStreams(), modelProcessor.getId(), jpmmlEvaluator, modelOutputs); this.collector = collector; } catch (Exception e) { LOG.error("Unexpected exception while preparing the model evaluation bolt", e); throw new RuntimeException("Unexpected exception while preparing the model evaluation bolt", e); } }

Target:
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { try { PMML pmmlModel = JpmmlFactory.newPmml( new ByteArrayInputStream(modelProcessor.getPmml().getBytes())); this.modelRunner = new StreamlineJPMMLModelRunner( modelProcessor.getOutputStreams(), modelProcessor.getId(), JpmmlFactory.newEvaluator(pmmlModel), JpmmlModelOutputs.toDefaultStream(pmmlModel)); this.collector = collector; } catch (Exception e) { LOG.error("Unexpected exception while preparing the model evaluation bolt", e); throw new RuntimeException("Unexpected exception while preparing the model evaluation bolt", e); } }
Source:
public static List<BatchDTO> getNewspaperBatches() throws DataException, DAOException, IOException { final BatchService batchService = ServiceManager.getBatchService(); final ProcessService processService = ServiceManager.getProcessService(); final FileService fileService = ServiceManager.getFileService(); List<BatchDTO> newspaperBatches = new ArrayList<>(); for (BatchDTO batchTransfer : batchService.findAll()) { if (isNewspaperBatch(batchTransfer, processService, fileService)) { newspaperBatches.add(batchTransfer); } } return newspaperBatches; }

Target:
public static List<BatchDTO> getNewspaperBatches() throws DataException, DAOException, IOException { List<BatchDTO> newspaperBatches = new ArrayList<>(); for (BatchDTO batchTransfer : batchService.findAll()) { if (isNewspaperBatch(batchTransfer)) { newspaperBatches.add(batchTransfer); } } return newspaperBatches; }
Source:
private void map(IndexedRecord input, ProcessContext context) throws IOException { python.set("inputJSON", new PyString(input.toString())); python.exec("input = json.loads(inputJSON)"); python.exec("output = json.loads(\"{}\")"); python.exec(properties.pythonCode.getValue()); python.exec("outputJSON = json.dumps(output)"); PyObject output = python.get("outputJSON"); JsonSchemaInferrer jsonSchemaInferrer = new JsonSchemaInferrer(new ObjectMapper()); Schema jsonSchema = jsonSchemaInferrer.inferSchema(output.toString()); JsonGenericRecordConverter jsonGenericRecordConverter = new JsonGenericRecordConverter(jsonSchema); GenericRecord outputRecord = jsonGenericRecordConverter.convertToAvro(output.toString()); context.output(outputRecord); }

Target:
private void map(IndexedRecord input, ProcessContext context) throws IOException { python.set("inputJSON", new PyString(input.toString())); python.exec("input = json.loads(inputJSON)"); python.exec("output = json.loads(\"{}\")"); python.exec(properties.pythonCode.getValue()); python.exec("outputJSON = json.dumps(output)"); PyObject output = python.get("outputJSON"); if (jsonGenericRecordConverter == null) { JsonSchemaInferrer jsonSchemaInferrer = new JsonSchemaInferrer(new ObjectMapper()); Schema jsonSchema = jsonSchemaInferrer.inferSchema(output.toString()); jsonGenericRecordConverter = new JsonGenericRecordConverter(jsonSchema); } GenericRecord outputRecord = jsonGenericRecordConverter.convertToAvro(output.toString()); context.output(outputRecord); }
Source:
private boolean canSortByIndex() { boolean canSortByIndex = false; if (orderings != null && selectors.size() == 1) { IndexPlan plan = selectors.get(0).getExecutionPlan().getIndexPlan(); if (plan != null) { List<OrderEntry> list = plan.getSortOrder(); if (list != null && list.size() == orderings.length) { canSortByIndex = true; for (int i = 0; i < list.size(); i++) { OrderEntry e = list.get(i); OrderingImpl o = orderings[i]; DynamicOperandImpl op = o.getOperand(); if (!(op instanceof PropertyValueImpl)) { break; } String pn = ((PropertyValueImpl) op).getPropertyName(); if (!pn.equals(e.getPropertyName())) { canSortByIndex = false; break; } if (o.isDescending() != (e.getOrder() == Order.DESCENDING)) { canSortByIndex = false; break; } } } } } return canSortByIndex; }

Target:
private boolean canSortByIndex() { boolean canSortByIndex = false; if (orderings != null && selectors.size() == 1) { IndexPlan plan = selectors.get(0).getExecutionPlan().getIndexPlan(); if (plan != null) { List<OrderEntry> list = plan.getSortOrder(); if (list != null && list.size() == orderings.length) { canSortByIndex = true; for (int i = 0; i < list.size(); i++) { OrderEntry e = list.get(i); OrderingImpl o = orderings[i]; DynamicOperandImpl op = o.getOperand(); String pn = op.getOrderEntryPropertyName(selectors.get(0)); if (pn == null || !pn.equals(e.getPropertyName())) { canSortByIndex = false; break; } if (o.isDescending() != (e.getOrder() == Order.DESCENDING)) { canSortByIndex = false; break; } } } } } return canSortByIndex; }
Source:
private void validateStatic(FrameworkMember<?> member, List<Throwable> errors) { if (fStaticMembers && !member.isStatic()) { addError(errors, member, "must be static."); } if (!fStaticMembers && member.isStatic()) { addError(errors, member, "must not be static, use @ClassRule to make this possible"); } }

Target:
private void validateStatic(FrameworkMember<?> member, List<Throwable> errors) { if (fStaticMembers && !member.isStatic()) { addError(errors, member, "must be static."); } if (!fStaticMembers && member.isStatic()) { addError(errors, member, "must not be static or it has to be annotated with @ClassRule."); } }
Source:
protected boolean canDetect(JsonPointer pointer) { return pointer != null && pointer.toString().matches("/components/links/(\\w+)/operationId"); }

Target:
protected boolean canDetect(JsonPointer pointer) { return pointer != null && pointer.toString().matches(".*/links/(\\w+)/operationId"); }
Source:
public void testNotHyperlinkExternal() { assertMarkup("<p>this [x] is not a link</p>", "this [x] is not a link"); assertMarkup("<p>Use another style [Human]</p>", "Use another style [Human]"); }

Target:
public void testNotHyperlinkExternal() { assertMarkup("<p>this [x] is not a link</p>", "this [x] is not a link"); assertMarkup("<p>Use another style [Human]</p>", "Use another style [Human]"); assertMarkup("<p>[test1://eclipse.org/] is not a link</p>", "[test1://eclipse.org/] is not a link"); assertMarkup("<p>No link [test:me]</p>", "No link [test:me]"); }
Source:
public int hashCode() { return Objects.hash( account, plan, uuid, unitAmountInCents, currency, quantity, activatedAt, canceledAt, expiresAt, currentPeriodStartedAt, currentPeriodEndsAt, trialStartedAt, trialEndsAt, addOns, pendingSubscription, startsAt, collectionMethod, netTerms, poNumber ); }

Target:
public int hashCode() { return Objects.hashCode( account, plan, uuid, state, unitAmountInCents, currency, quantity, activatedAt, canceledAt, expiresAt, currentPeriodStartedAt, currentPeriodEndsAt, trialStartedAt, trialEndsAt, addOns, pendingSubscription, startsAt, collectionMethod, netTerms, poNumber ); }
Source:
public void run() { final URL elasticsearchUrl = corePlugin.getElasticsearchUrl(); if (elasticsearchUrl == null) { return; } httpClient.send(HttpRequestBuilder.<Void>forUrl(elasticsearchUrl + "/_cluster/health") .method("GET") .successHandler(new HttpClient.ResponseHandler<Void>() { @Override public Void handleResponse(HttpRequest<?> httpRequest, InputStream inputStream, Integer statusCode, IOException e) throws IOException { JsonNode clusterHealthResponse = JsonUtils.getMapper().readTree(inputStream); String statusValue = clusterHealthResponse.has("status") ? clusterHealthResponse.get("status").asText() : "red"; boolean isNowAvailable = statusValue.equals("green") || statusValue.equals("yellow"); if (isNowAvailable) { if (!isElasticsearchAvailable()) { logger.info("Elasticsearch is available again."); } elasticsearchAvailable.set(true); for (ElasticsearchAvailableObserver elasticsearchAvailableObserver : elasticsearchAvailableObservers) { elasticsearchAvailableObserver.onElasticsearchAvailable(); } } return null; } }) .errorHandler(new HttpClient.ResponseHandler<Void>() { @Override public Void handleResponse(HttpRequest<?> httpRequest, InputStream is, Integer statusCode, IOException e) throws IOException { if (isElasticsearchAvailable()) { logger.warn("Elasticsearch is not available. " + "Stagemonitor won't try to send documents to Elasticsearch until it is available again."); } elasticsearchAvailable.set(false); return null; } }) .build()); }

Target:
public void run() { final URL elasticsearchUrl = corePlugin.getElasticsearchUrl(); if (elasticsearchUrl == null) { return; } httpClient.send(HttpRequestBuilder.<Void>forUrl(elasticsearchUrl + "/_cluster/health") .method("GET") .successHandler(new HttpClient.ResponseHandler<Void>() { @Override public Void handleResponse(HttpRequest<?> httpRequest, InputStream inputStream, Integer statusCode, IOException e) throws IOException { JsonNode clusterHealthResponse = JsonUtils.getMapper().readTree(inputStream); String statusValue = clusterHealthResponse.has("status") ? clusterHealthResponse.get("status").asText() : "red"; boolean isNowAvailable = statusValue.equals("green") || statusValue.equals("yellow"); if (isNowAvailable) { if (!isElasticsearchAvailable()) { logger.info("Elasticsearch is available again."); } for (ElasticsearchAvailabilityObserver elasticsearchAvailabilityObserver : elasticsearchAvailabilityObservers) { elasticsearchAvailabilityObserver.onElasticsearchAvailable(corePlugin.getElasticsearchClient()); } elasticsearchAvailable.set(true); } return null; } }) .errorHandler(new HttpClient.ResponseHandler<Void>() { @Override public Void handleResponse(HttpRequest<?> httpRequest, InputStream is, Integer statusCode, IOException e) throws IOException { if (isElasticsearchAvailable()) { logger.warn("Elasticsearch is not available. " + "Stagemonitor won't try to send documents to Elasticsearch until it is available again."); } elasticsearchAvailable.set(false); return null; } }) .build()); }
Source:
public void testInsert() throws Exception { execute("CREATE TABLE tpch.test_insert (x bigint, y varchar, t_ts timestamp)"); assertUpdate("INSERT INTO test_insert VALUES (123, 'test', date_parse('1970-12-01 00:00:01','%Y-%m-%d %H:%i:%s'))", 1); assertUpdate("INSERT INTO test_insert VALUES (123, 'test', date_parse('2030-01-01 23:59:59','%Y-%m-%d %H:%i:%s'))", 1); MaterializedResult actual = computeActual("SELECT * FROM test_insert"); MaterializedResult expected = MaterializedResult.resultBuilder(getSession(), BIGINT, VARCHAR, TIMESTAMP) .row((long) 123, "test", Timestamp.valueOf("1970-12-01 00:00:01")) .row((long) 123, "test", Timestamp.valueOf("2030-01-01 23:59:59")) .build(); assertEquals(actual, expected); assertUpdate("DROP TABLE test_insert"); }

Target:
public void testInsert() throws Exception { execute("CREATE TABLE tpch.test_insert (c_bigint bigint, c_varchar varchar, c_timestamp timestamp)"); assertUpdate("INSERT INTO test_insert VALUES (123, 'test', date_parse('1970-12-01 00:00:01','%Y-%m-%d %H:%i:%s'))", 1); assertUpdate("INSERT INTO test_insert VALUES (123, 'test', date_parse('2030-01-01 23:59:59','%Y-%m-%d %H:%i:%s'))", 1); MaterializedResult actual = computeActual("SELECT * FROM test_insert"); MaterializedResult expected = MaterializedResult.resultBuilder(getSession(), BIGINT, VARCHAR, TIMESTAMP) .row((long) 123, "test", Timestamp.valueOf("1970-12-01 00:00:01")) .row((long) 123, "test", Timestamp.valueOf("2030-01-01 23:59:59")) .build(); assertEquals(actual, expected); assertUpdate("DROP TABLE test_insert"); }
Source:
public void handle(Context withinContext) throws Exception { LOG.info("Processing#{} ALTER_TABLE message : {}", fromEventId(), eventMessageAsJSON); Table qlMdTableBefore = new Table(before); if (!Utils .shouldReplicate(withinContext.replicationSpec, qlMdTableBefore, true, withinContext.hiveConf)) { return; } if (withinContext.hiveConf.getBoolVar(HiveConf.ConfVars.REPL_BOOTSTRAP_ACID_TABLES)) { if (!AcidUtils.isTransactionalTable(before) && AcidUtils.isTransactionalTable(after)) { LOG.info("The table " + after.getTableName() + " is converted to ACID table." + " It will be replicated with bootstrap load as REPL_BOOTSTRAP_ACID_TABLES is set to true."); return; } } if (Scenario.ALTER == scenario) { withinContext.replicationSpec.setIsMetadataOnly(true); Table qlMdTableAfter = new Table(after); Path metaDataPath = new Path(withinContext.eventRoot, EximUtil.METADATA_NAME); if (withinContext.hiveConf.getBoolVar(HiveConf.ConfVars.REPL_DUMP_METADATA_ONLY)) { qlMdTableAfter.setStatsStateLikeNewTable(); } EximUtil.createExportDump( metaDataPath.getFileSystem(withinContext.hiveConf), metaDataPath, qlMdTableAfter, null, withinContext.replicationSpec, withinContext.hiveConf); } DumpMetaData dmd = withinContext.createDmd(this); dmd.setPayload(eventMessageAsJSON); dmd.write(); }

Target:
public void handle(Context withinContext) throws Exception { LOG.info("Processing#{} ALTER_TABLE message : {}", fromEventId(), eventMessageAsJSON); Table qlMdTableBefore = new Table(before); if (!Utils .shouldReplicate(withinContext.replicationSpec, qlMdTableBefore, true, withinContext.hiveConf)) { return; } if (withinContext.hiveConf.getBoolVar(HiveConf.ConfVars.REPL_BOOTSTRAP_ACID_TABLES)) { if (!AcidUtils.isTransactionalTable(before) && AcidUtils.isTransactionalTable(after)) { LOG.info("The table " + after.getTableName() + " is converted to ACID table." + " It will be replicated with bootstrap load as hive.repl.bootstrap.acid.tables is set to true."); return; } } if (Scenario.ALTER == scenario) { withinContext.replicationSpec.setIsMetadataOnly(true); Table qlMdTableAfter = new Table(after); Path metaDataPath = new Path(withinContext.eventRoot, EximUtil.METADATA_NAME); if (withinContext.hiveConf.getBoolVar(HiveConf.ConfVars.REPL_DUMP_METADATA_ONLY)) { qlMdTableAfter.setStatsStateLikeNewTable(); } EximUtil.createExportDump( metaDataPath.getFileSystem(withinContext.hiveConf), metaDataPath, qlMdTableAfter, null, withinContext.replicationSpec, withinContext.hiveConf); } DumpMetaData dmd = withinContext.createDmd(this); dmd.setPayload(eventMessageAsJSON); dmd.write(); }
Source:
public void testCreateAndManageUser_StartInBackground_MaxRunningUsers() throws Exception { if (!mHasCreateAndManageUserFeature || !canTestMaxRunningUsers()) { return; } int maxRunningUsers = getDevice().getMaxNumberOfRunningUsersSupported(); for (int i = 0; i < maxRunningUsers - 1; i++) { executeDeviceTestMethod(".CreateAndManageUserTest", "testCreateAndManageUser_StartInBackground"); } executeDeviceTestMethod(".CreateAndManageUserTest", "testCreateAndManageUser_StartInBackground_MaxRunningUsers"); }

Target:
public void testCreateAndManageUser_StartInBackground_MaxRunningUsers() throws Exception { if (!mHasCreateAndManageUserFeature || getMaxNumberOfRunningUsersSupported() >= getMaxNumberOfUsersSupported()) { return; } int maxRunningUsers = getDevice().getMaxNumberOfRunningUsersSupported(); for (int i = 0; i < maxRunningUsers - 1; i++) { executeDeviceTestMethod(".CreateAndManageUserTest", "testCreateAndManageUser_StartInBackground"); } executeDeviceTestMethod(".CreateAndManageUserTest", "testCreateAndManageUser_StartInBackground_MaxRunningUsers"); }
Source:
public TestMediaWikiApiImageFetchingStrategy(Map<String, String> serverContent) { Preconditions.checkNotNull(serverContent, "Please specify some server content for images used during the tests. See: TestMediaWikiApiImageFetchingStrategy#serverContent"); this.serverContent = ImmutableMap.copyOf(serverContent); }

Target:
public TestMediaWikiApiImageFetchingStrategy(Map<String, String> serverContent) { checkNotNull(serverContent, "Please specify some server content for images used during the tests. See: TestMediaWikiApiImageFetchingStrategy#serverContent"); this.serverContent = ImmutableMap.copyOf(serverContent); }
Source:
private boolean isNetmaskInSync() { return ObjectUtils.objectsEqual(iface.getSubnet(), isPrimaryAddressExist() ? networkDataCenterIpConfigurationDefinition.getPrimaryAddress().getNetmask() : null); }

Target:
private boolean isNetmaskInSync() { return ObjectUtils.objectsEqual(iface.getSubnet(), isPrimaryAddressExist() ? getPrimaryAddress().getNetmask() : null); }
Source:
EntityWriter<Object> licenseWriter() throws IOException { return new LicenseWriter( new License(IOUtils.toString(licenseText.getInputStream())) ); }

Target:
EntityWriter<Object> licenseWriter() throws IOException { return new LicenseWriter( new License(IOUtils.toString(licenseText.getInputStream(), "UTF-8")) ); }
Source:
public Object foundLiteral(ImapResponse response, FixedLengthInputStream literal) throws IOException { if (response.getTag() == null && ImapResponseParser.equalsIgnoreCase(response.get(1), "FETCH")) { String contentTransferEncoding = mPart .getHeader(MimeHeader.HEADER_CONTENT_TRANSFER_ENCODING)[0]; String contentType = mPart .getHeader(MimeHeader.HEADER_CONTENT_TYPE)[0]; if(attachmentProgressCallback != null) return MimeUtility.createBody(literal, contentTransferEncoding, contentType, attachmentProgressCallback); return MimeUtility.createBody(literal, contentTransferEncoding, contentType, null); } return null; }

Target:
public Object foundLiteral(ImapResponse response, FixedLengthInputStream literal) throws IOException { if (response.getTag() == null && ImapResponseParser.equalsIgnoreCase(response.get(1), "FETCH")) { String contentTransferEncoding = mPart .getHeader(MimeHeader.HEADER_CONTENT_TRANSFER_ENCODING)[0]; String contentType = mPart .getHeader(MimeHeader.HEADER_CONTENT_TYPE)[0]; if (attachmentProgressCallback != null) { return MimeUtility.createBody(literal, contentTransferEncoding, contentType, attachmentProgressCallback); } return MimeUtility.createBody(literal, contentTransferEncoding, contentType, null); } return null; }
Source:
private List<GoogleCloudStorageItemInfo> getGoogleCloudStorageItemInfos( String bucketName, String objectNamePrefix, ListObjectOptions listOptions, List<String> listedPrefixes, List<StorageObject> listedObjects) { List<GoogleCloudStorageItemInfo> objectInfos = new ArrayList<>( (storageOptions.isInferImplicitDirectoriesEnabled() ? listedPrefixes.size() + 1 : 0) + listedObjects.size()); if (storageOptions.isInferImplicitDirectoriesEnabled() && listOptions.isIncludePrefix() && listOptions.getDelimiter() != null && (!listedPrefixes.isEmpty() || !listedObjects.isEmpty()) && (listedObjects.isEmpty() || !listedObjects.get(0).getName().equals(objectNamePrefix))) { objectInfos.add(createInferredDirectory(new StorageResourceId(bucketName, objectNamePrefix))); } for (StorageObject obj : listedObjects) { objectInfos.add(createItemInfoForStorageObject(obj)); } handlePrefixes(bucketName, listedPrefixes, objectInfos); objectInfos.sort(Comparator.comparing(GoogleCloudStorageItemInfo::getObjectName)); return objectInfos; }

Target:
private List<GoogleCloudStorageItemInfo> getGoogleCloudStorageItemInfos( String bucketName, String objectNamePrefix, ListObjectOptions listOptions, List<String> listedPrefixes, List<StorageObject> listedObjects) { List<GoogleCloudStorageItemInfo> objectInfos = new ArrayList<>( (storageOptions.isInferImplicitDirectoriesEnabled() ? listedPrefixes.size() + 1 : 0) + listedObjects.size()); if (storageOptions.isInferImplicitDirectoriesEnabled() && listOptions.isIncludePrefix() && objectNamePrefix != null && listOptions.getDelimiter() != null && (!listedPrefixes.isEmpty() || !listedObjects.isEmpty()) && (listedObjects.isEmpty() || !listedObjects.get(0).getName().equals(objectNamePrefix))) { objectInfos.add(createInferredDirectory(new StorageResourceId(bucketName, objectNamePrefix))); } for (StorageObject obj : listedObjects) { objectInfos.add(createItemInfoForStorageObject(obj)); } handlePrefixes(bucketName, listedPrefixes, objectInfos); objectInfos.sort(Comparator.comparing(GoogleCloudStorageItemInfo::getObjectName)); return objectInfos; }
Source:
public InvertedDisappearancePriorityConflictResolver(int defaultPriority) { super(defaultPriority); Preconditions.checkArgument(defaultPriority != 0, "Default priority 0 is disallowed"); }

Target:
public InvertedDisappearancePriorityConflictResolver(int defaultPriority) { super(defaultPriority); if (defaultPriority == 0 && logger.getLevel().isGreaterOrEqual(Level.WARN)) { logger.warn(ZERO_PRIORITY_MESSAGE); } }
Source:
public void setUp() { params.put("CallSid", "CA1234567890ABCDE"); params.put("Caller", "+14158675309"); params.put("Digits", "1234"); params.put("From", "+14158675309"); params.put("To", "+18005551212"); signature = "RSOYDt4T1cUTdK1PDd93/VVr8B8="; }

Target:
public void setUp() { params.put("Digits", "1234"); params.put("CallSid", "CA1234567890ABCDE"); params.put("To", "+18005551212"); params.put("Caller", "+14158675309"); params.put("From", "+14158675309"); }
Source:
private void testVariousErrors(String dcWherePutHappened) throws Exception { ArrayList<MockServer> mockServers = new ArrayList<>(mockServerLayout.getMockServers()); ArrayList<ServerErrorCode> serverErrors = new ArrayList<>(Arrays.asList(ServerErrorCode.values())); serverErrors.remove(ServerErrorCode.Blob_Deleted); serverErrors.remove(ServerErrorCode.Blob_Expired); boolean goodServerMarked = false; for (MockServer mockServer : mockServers) { if (!goodServerMarked && mockServer.getDataCenter().equals(dcWherePutHappened)) { mockServer.setServerErrorForAllRequests(ServerErrorCode.No_Error); goodServerMarked = true; } else { mockServer.setServerErrorForAllRequests(serverErrors.get(random.nextInt(serverErrors.size()))); } } getAndAssertSuccess(); }

Target:
private void testVariousErrors(String dcWherePutHappened) throws Exception { ArrayList<MockServer> mockServers = new ArrayList<>(mockServerLayout.getMockServers()); ArrayList<ServerErrorCode> serverErrors = new ArrayList<>(Arrays.asList(ServerErrorCode.values())); serverErrors.remove(ServerErrorCode.Blob_Deleted); serverErrors.remove(ServerErrorCode.Blob_Expired); serverErrors.remove(ServerErrorCode.No_Error); boolean goodServerMarked = false; for (MockServer mockServer : mockServers) { if (!goodServerMarked && mockServer.getDataCenter().equals(dcWherePutHappened)) { mockServer.setServerErrorForAllRequests(ServerErrorCode.No_Error); goodServerMarked = true; } else { mockServer.setServerErrorForAllRequests(serverErrors.get(random.nextInt(serverErrors.size()))); } } getAndAssertSuccess(); }
Source:
public void testTranslateFormtWithNull() { FORMAT format = null; String result = translator.translateFormat(format); assertEquals(FORMAT.DATE_TIME.getJSONValue(), result); }

Target:
public void testTranslateFormtWithNull() { FORMAT format = null; String result = translator.translateFormat(format); assertNull(result); }
Source:
public void probabilityZeroAlwaysGoesToOldService() { IntStream.range(0, 100) .forEach($ -> selectingService.getFreshTimestamp()); verify(oldService, times(100)).getFreshTimestamp(); }

Target:
public void probabilityZeroAlwaysGoesToOldService() { probability.set(0.0); IntStream.range(0, 100) .forEach($ -> selectingService.getFreshTimestamp()); verify(oldService, times(100)).getFreshTimestamp(); }
Source:
protected Object doWork() { if (normalBamFile == null && tumorBamFile == null) { throw new UserException.CommandLineException("At least one of normal and tumor BAM files must be provided. Stopping."); } if (normalBamFile != null && normalHetOutputFile == null) { throw new UserException.CommandLineException("If the normal BAM file is provided, the normal Het output file must also be provided. Stopping."); } if (tumorBamFile != null && tumorHetOutputFile == null) { throw new UserException.CommandLineException("If the tumor BAM file is provided, the tumor Het output file must also be provided. Stopping."); } HetCoverageJobType jobType = HetCoverageJobType.NONE; if (normalBamFile != null && tumorBamFile != null) { jobType = HetCoverageJobType.MATCHED_NORMAL_TUMOR; logger.info("MATCHED_NORMAL_TUMOR mode selected."); } if (normalBamFile != null && tumorBamFile == null) { jobType = HetCoverageJobType.NORMAL_ONLY; logger.info("NORMAL_ONLY mode selected."); } if (normalBamFile == null && tumorBamFile != null) { jobType = HetCoverageJobType.TUMOR_ONLY; logger.info("TUMOR_ONLY mode selected."); } switch (jobType) { case NORMAL_ONLY: runNormalOnly(); break; case TUMOR_ONLY: runTumorOnly(); break; case MATCHED_NORMAL_TUMOR: runMatchedNormalTumor(); break; case NONE: throw new GATKException.ShouldNeverReachHereException("The job type is not properly determined from" + " the arguments. This should not happen."); default: throw new GATKException.ShouldNeverReachHereException("The job type is not properly determined from" + " the arguments. This should not happen."); } return "SUCCESS"; }

Target:
protected Object doWork() { if (normalBamFile == null && tumorBamFile == null) { throw new UserException.BadArgumentValue(String.format("You must provide at least one normal (argument %s)" + " or tumor (argument %s) alignment file.", ExomeStandardArgumentDefinitions.NORMAL_BAM_FILE_LONG_NAME, ExomeStandardArgumentDefinitions.TUMOR_BAM_FILE_LONG_NAME)); } if (normalBamFile != null && normalHetOutputFile == null) { throw new UserException.CommandLineException(String.format("If the normal BAM file is provided, the normal" + " Het pulldown output file (argument %s) must also be provided.", ExomeStandardArgumentDefinitions.NORMAL_ALLELIC_COUNTS_FILE_LONG_NAME)); } if (tumorBamFile != null && tumorHetOutputFile == null) { throw new UserException.CommandLineException(String.format("If the tumor BAM file is provided, the tumor" + " Het pulldown output file (argument %s) must also be provided.", ExomeStandardArgumentDefinitions.TUMOR_ALLELIC_COUNTS_FILE_LONG_NAME)); } if (normalBamFile != null && tumorBamFile != null) { logger.info("MATCHED_NORMAL_TUMOR mode selected."); runMatchedNormalTumor(); } else if (normalBamFile != null) { logger.info("NORMAL_ONLY mode selected."); runNormalOnly(); } else { logger.info("TUMOR_ONLY mode selected."); runTumorOnly(); } return "SUCCESS"; }
Source:
List<AttributeTypeInfo> attributes() throws IOException; FeatureType getFeatureType() throws IOException; String getCqlFilter(); void setCqlFilter(String cqlFilterString); FeatureSource<? extends FeatureType, ? extends Feature> getFeatureSource( ProgressListener listener, Hints hints) throws IOException; boolean isCircularArcPresent(); void setCircularArcPresent(boolean arcsPresent); default boolean getEncodeCoordinatesMeasures() { return true; }

Target:
List<AttributeTypeInfo> attributes() throws IOException; FeatureType getFeatureType() throws IOException; String getCqlFilter(); void setCqlFilter(String cqlFilterString); FeatureSource<? extends FeatureType, ? extends Feature> getFeatureSource( ProgressListener listener, Hints hints) throws IOException; boolean isCircularArcPresent(); void setCircularArcPresent(boolean arcsPresent); default boolean getEncodeMeasures() { return false; }
Source:
public Set<ExplainedQueryString> findQueriesFromExplanation( Map<String, String> originalQueryInMap, Explanation explanation) { Set<ExplainedQueryString> matchedQueryStrings = new LinkedHashSet<>(); Set<String> matchedQueryTerms = explainServiceHelper.findMatchedWords(explanation); for (String matchedQueryTerm : matchedQueryTerms) { Map<String, Double> matchedQueryRule = explainServiceHelper.findMatchQueries(matchedQueryTerm, originalQueryInMap); Optional<Entry<String, Double>> optionalEntry = matchedQueryRule.entrySet().stream().max(Comparator.comparingDouble(Entry::getValue)); if (optionalEntry.isPresent()) { Entry<String, Double> entry = optionalEntry.get(); matchedQueryStrings.add( ExplainedQueryString.create( matchedQueryTerm, entry.getKey(), originalQueryInMap.get(entry.getKey()), entry.getValue())); } } return matchedQueryStrings; }

Target:
public Set<ExplainedQueryString> findQueriesFromExplanation( Map<String, String> originalQueryInMap, Explanation explanation) { Set<ExplainedQueryString> matchedQueryStrings = new LinkedHashSet<>(); Set<String> matchedQueryTerms = explainServiceHelper.findMatchedWords(explanation); for (String matchedQueryTerm : matchedQueryTerms) { Map<String, Double> matchedQueryRule = explainServiceHelper.findMatchQueries(matchedQueryTerm, originalQueryInMap); Entry<String, Double> entry = matchedQueryRule .entrySet() .stream() .max(Comparator.comparingDouble(Entry::getValue)) .orElseThrow( () -> new IllegalStateException( "matchedQueryRule.entrySet() shouldn't return an empty Set")); matchedQueryStrings.add( ExplainedQueryString.create( matchedQueryTerm, entry.getKey(), originalQueryInMap.get(entry.getKey()), entry.getValue())); } return matchedQueryStrings; }
Source:
public void tearDown() throws Exception { mServiceHandler.chan.disconnect(); mServiceHandler.stop(); if (mManager != null) { mManager.disconnect(); } }

Target:
public void tearDown() throws Exception { waitForIdleHandler(mServiceHandler, mTimeoutMs); mServiceHandler.chan.disconnect(); mServiceHandler.stop(); if (mManager != null) { mManager.disconnect(); } }
Source:
private boolean restore( SolrClient client, String collection, String backupLocation, String backupName) throws IOException, SolrServerException { if (canRestore(client, collection)) { CollectionAdminRequest.Restore restore = CollectionAdminRequest.AsyncCollectionAdminRequest.restoreCollection( collection, backupName) .setLocation(backupLocation); String syncReqId = restore.processAsync(client); while (true) { CollectionAdminRequest.RequestStatusResponse requestStatusResponse = CollectionAdminRequest.requestStatus(syncReqId).process(client); RequestStatusState requestStatus = requestStatusResponse.getRequestStatus(); if (requestStatus == RequestStatusState.COMPLETED) { LOGGER.debug("Restore status: {}", requestStatus); return true; } else if (requestStatus == RequestStatusState.FAILED || requestStatus == RequestStatusState.NOT_FOUND) { LOGGER.debug("Restore status: {}", requestStatus); printErrorMessage("Restore failed. "); printResponseErrorMessages(requestStatusResponse); return false; } try { TimeUnit.SECONDS.sleep(1); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } else { LOGGER.warn("Unable to restore collection {}", collection); return false; } }

Target:
private boolean restore( SolrClient client, String collection, String backupLocation, String backupName) throws IOException, InterruptedException, SolrServerException { if (!canRestore(client, collection)) { LOGGER.warn("Unable to restore collection {}", collection); return false; } CollectionAdminRequest.Restore restore = CollectionAdminRequest.AsyncCollectionAdminRequest.restoreCollection(collection, backupName) .setLocation(backupLocation); String syncReqId = restore.processAsync(client); boolean restoreComplete = false; while (true) { CollectionAdminRequest.RequestStatusResponse requestStatusResponse = CollectionAdminRequest.requestStatus(syncReqId).process(client); RequestStatusState requestStatus = requestStatusResponse.getRequestStatus(); if (requestStatus == RequestStatusState.COMPLETED) { LOGGER.debug("Restore status: {}", requestStatus); restoreComplete = true; break; } else if (requestStatus == RequestStatusState.FAILED || requestStatus == RequestStatusState.NOT_FOUND) { LOGGER.debug("Restore status: {}", requestStatus); printErrorMessage("Restore failed. "); printResponseErrorMessages(requestStatusResponse); break; } TimeUnit.SECONDS.sleep(1); } return restoreComplete; }
Source:
private void checkWriteAccess(ISCTFileSystemAccess access, String outputConfiguration, String folderName) { URI uri = access.getURI("", outputConfiguration); if (uri.isFile()) { File file = new File(uri.path()); if (!file.canWrite()) { logger.log(String.format("Can not generated files to read-only folder '%s'. ", folderName)); } } }

Target:
private void checkWriteAccess(ISCTFileSystemAccess access, String outputConfiguration, String folderName) { URI uri = access.getURI("", outputConfiguration); if (uri.isFile()) { File file = new File(uri.path()); if (!file.canWrite()) { logger.log(String.format("Can not generate files to read-only folder '%s'. ", folderName)); } } }
Source:
protected IStatus buildStatistics() { try { fStatistics = (fResource == null ? null : new TmfStateStatistics(this) ); } catch (TmfTraceException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()); } return Status.OK_STATUS; }

Target:
protected IStatus buildStatistics() { try { fStatistics = (fResource == null ? null : new TmfStateStatistics(this) ); } catch (TmfTraceException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } return Status.OK_STATUS; }
Source:
private void assertFilterDocumentProjectFunction(Function<Tuple2<String, AffMatchDocumentProject>, Boolean> function, Float confidenceLevelThreshold) throws Exception { assertTrue(function.call( new Tuple2<String, AffMatchDocumentProject>(projectId, new AffMatchDocumentProject(documentId, projectId, 0.6f)))); float confidenceLevel = 0.4f; boolean result = function.call( new Tuple2<String, AffMatchDocumentProject>(projectId, new AffMatchDocumentProject(documentId, projectId, confidenceLevel))); if (confidenceLevelThreshold == null || confidenceLevelThreshold <= confidenceLevel) { assertTrue(result); } else { assertFalse(result); } }

Target:
private void assertFilterDocumentProjectFunction(Function<Tuple2<String, AffMatchDocumentProject>, Boolean> function, Float confidenceLevelThreshold) throws Exception { if (confidenceLevelThreshold != null) { float greaterConfidenceLevel = confidenceLevelThreshold+0.1f; assertTrue(function.call(new Tuple2<String, AffMatchDocumentProject>(projectId, new AffMatchDocumentProject(documentId, projectId, greaterConfidenceLevel)))); float smallerConfidenceLevel = confidenceLevelThreshold-0.1f; assertFalse(function.call(new Tuple2<String, AffMatchDocumentProject>(projectId, new AffMatchDocumentProject(documentId, projectId, smallerConfidenceLevel)))); } else { assertTrue(function.call(new Tuple2<String, AffMatchDocumentProject>(projectId, new AffMatchDocumentProject(documentId, projectId, 0.0001f)))); } }
Source:
public KeyStore loadKeyStore() throws IOException, GeneralSecurityException { KeyStore ks = KeyStore.getInstance("JKS"); InputStream inputStream = new FileInputStream(new File(keyStorePath)); ks.load(inputStream, passwordStringToCharArray(keyStorePassword)); return ks; }

Target:
public KeyStore loadKeyStore() throws IOException, GeneralSecurityException { KeyStore ks = KeyStore.getInstance(JKS_KEY_STORE_TYPE); InputStream inputStream = null; try { inputStream = new FileInputStream(new File(keyStorePath)); ks.load(inputStream, passwordStringToCharArray(keyStorePassword)); return ks; } finally { forceClose(inputStream); } }
Source:
public Iterator iterator() { return new Iterator() { final Iterator innerIterator = new StepIterator(ObjectRange.this, 1); @Override public boolean hasNext() { return innerIterator.hasNext(); } @Override public Object next() { return innerIterator.next(); } @Override public void remove() { innerIterator.remove(); } }; }

Target:
public Iterator<Comparable> iterator() { return new Iterator<Comparable>() { private final Iterator<Comparable> delegate = new LazySteppingIterator(ObjectRange.this, 1); @Override public synchronized boolean hasNext() { return delegate.hasNext(); } @Override public synchronized Comparable next() { return delegate.next(); } @Override public synchronized void remove() { delegate.remove(); } }; }
Source:
public void testAllChildrenNoMatchExpectTrue() { fFilter.setNot(true); assertTrue(fFilter.matches(fEvent)); }

Target:
public void testAllChildrenNoMatchExpectTrue() { fFilter.setNot(true); ITmfFilterTreeNode child = fFilterNode.clone(); assertEquals("addChild()", 0, fFilterNode.addChild(child)); assertFalse(fFilter.matches(fEvent)); }
Source:
public void testIntersect() { StatisticRange zeroToTen = range(0, 10, 10); StatisticRange zeroToTwenty = range(5, 15, 60); assertEquals(zeroToTen.intersect(zeroToTwenty), range(5, 10, 10)); }

Target:
public void testIntersect() { StatisticRange zeroToTen = range(0, 10, 10); StatisticRange fiveToFifteen = range(5, 15, 60); assertEquals(zeroToTen.intersect(fiveToFifteen), range(5, 10, 10)); }