auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ServiceCall<Value> createValue(CreateValueOptions createValueOptions) { Validator.notNull(createValueOptions, "createValueOptions cannot be null"); RequestBuilder builder = RequestBuilder.post(String.format("/v1/workspaces/%s/entities/%s/values", createValueOptions.workspaceId(), createValueOptions.entity())); builder.query(VERSION, versionDate); final JsonObject contentJson = new JsonObject(); if (createValueOptions.metadata() != null) { contentJson.add("metadata", GsonSingleton.getGson().toJsonTree(createValueOptions.metadata())); } if (createValueOptions.synonyms() != null) { contentJson.add("synonyms", GsonSingleton.getGson().toJsonTree(createValueOptions.synonyms())); } if (createValueOptions.patterns() != null) { contentJson.add("patterns", GsonSingleton.getGson().toJsonTree(createValueOptions.patterns())); } contentJson.addProperty("value", createValueOptions.value()); builder.bodyJson(contentJson); return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Value.class)); }

Target:
public ServiceCall<Value> createValue(CreateValueOptions createValueOptions) { Validator.notNull(createValueOptions, "createValueOptions cannot be null"); RequestBuilder builder = RequestBuilder.post(String.format("/v1/workspaces/%s/entities/%s/values", createValueOptions.workspaceId(), createValueOptions.entity())); builder.query(VERSION, versionDate); final JsonObject contentJson = new JsonObject(); if (createValueOptions.metadata() != null) { contentJson.add("metadata", GsonSingleton.getGson().toJsonTree(createValueOptions.metadata())); } if (createValueOptions.synonyms() != null) { contentJson.add("synonyms", GsonSingleton.getGson().toJsonTree(createValueOptions.synonyms())); } contentJson.addProperty("value", createValueOptions.value()); builder.bodyJson(contentJson); return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Value.class)); }
Source:
public Op subtract(Op otherOp) { return new DoubleOp(this.val - ((DoubleOp)otherOp).val); }

Target:
public Op subtract(Op otherOp) { if(!(otherOp instanceof DoubleOp)) { throw new RuntimeException(); } return new DoubleOp(this.val - ((DoubleOp)otherOp).val); }
Source:
public void testOverrideMethodVersion() { Properties props = new Properties(); props.setProperty(API_VERSION_PREFIX + "named:getVault", "namedversion"); props.setProperty(API_VERSION_PREFIX + "VersionedApi.noName", "noNameversion"); ApiVersionFilter filter = new ApiVersionFilter(config, filterStringsBoundToInjectorByName(props)); HttpRequest request = GeneratedHttpRequest.builder().method("GET").endpoint("http://localhost") .invocation(noName).addQueryParam("api-version", "original", "original2").build(); HttpRequest filtered = filter.filter(request); assertEquals(filtered.getEndpoint().getQuery(), "api-version=noNameversion"); request = GeneratedHttpRequest.builder().method("GET").endpoint("http://localhost").invocation(named) .addQueryParam("api-version", "original", "original2").build(); filtered = filter.filter(request); assertEquals(filtered.getEndpoint().getQuery(), "api-version=namedversion"); }

Target:
public void testOverrideMethodVersion() { Properties props = new Properties(); props.setProperty(API_VERSION_PREFIX + "named:get", "namedversion"); props.setProperty(API_VERSION_PREFIX + "VersionedApi.noName", "noNameversion"); ApiVersionFilter filter = new ApiVersionFilter(config, filterStringsBoundToInjectorByName(props)); HttpRequest request = GeneratedHttpRequest.builder().method("GET").endpoint("http://localhost") .invocation(noName).addQueryParam("api-version", "original", "original2").build(); HttpRequest filtered = filter.filter(request); assertEquals(filtered.getEndpoint().getQuery(), "api-version=noNameversion"); request = GeneratedHttpRequest.builder().method("GET").endpoint("http://localhost").invocation(named) .addQueryParam("api-version", "original", "original2").build(); filtered = filter.filter(request); assertEquals(filtered.getEndpoint().getQuery(), "api-version=namedversion"); }
Source:
protected OracleOutputConnector getConnector(PluginTask task, boolean retryableMetadataOperation) { OraclePluginTask oracleTask = (OraclePluginTask) task; if (oracleTask.getDriverPath().isPresent()) { loadDriverJar(oracleTask.getDriverPath().get()); } String url; if (oracleTask.getUrl().isPresent()) { url = oracleTask.getUrl().get(); } else { if (!oracleTask.getHost().isPresent()) { throw new IllegalArgumentException("Field 'host' is not set."); } if (!oracleTask.getDatabase().isPresent()) { throw new IllegalArgumentException("Field 'database' is not set."); } url = String.format("jdbc:oracle:thin:@%s:%d:%s", oracleTask.getHost().get(), oracleTask.getPort(), oracleTask.getDatabase().get()); } Properties props = new Properties(); props.setProperty("user", oracleTask.getUser()); props.setProperty("password", oracleTask.getPassword()); props.putAll(oracleTask.getOptions()); return new OracleOutputConnector(url, props); }

Target:
protected OracleOutputConnector getConnector(PluginTask task, boolean retryableMetadataOperation) { OraclePluginTask oracleTask = (OraclePluginTask) task; if (oracleTask.getDriverPath().isPresent()) { loadDriverJar(oracleTask.getDriverPath().get()); } String url; if (oracleTask.getUrl().isPresent()) { if (oracleTask.getHost().isPresent() || oracleTask.getDatabase().isPresent()) { throw new IllegalArgumentException("'host', 'port' and 'database' parameters are invalid if 'url' parameter is set."); } url = oracleTask.getUrl().get(); } else { if (!oracleTask.getHost().isPresent()) { throw new IllegalArgumentException("Field 'host' is not set."); } if (!oracleTask.getDatabase().isPresent()) { throw new IllegalArgumentException("Field 'database' is not set."); } url = String.format("jdbc:oracle:thin:@%s:%d:%s", oracleTask.getHost().get(), oracleTask.getPort(), oracleTask.getDatabase().get()); } Properties props = new Properties(); props.setProperty("user", oracleTask.getUser()); props.setProperty("password", oracleTask.getPassword()); props.putAll(oracleTask.getOptions()); return new OracleOutputConnector(url, props); }
Source:
public void testBloomFilterVirtualColumnNumber() throws Exception { BloomKFilter filter = new BloomKFilter(1500); filter.addDouble(20.2); byte[] bytes = BloomFilterSerializersModule.bloomKFilterToBytes(filter); String base64 = Base64.encodeBase64String(bytes); testQuery( StringUtils.format("SELECT COUNT(*) FROM druid.foo WHERE bloom_filter_test(2 * CAST(dim1 AS float), '%s')", base64), ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(QSS(Filtration.eternity())) .granularity(Granularities.ALL) .virtualColumns() .filters( new ExpressionDimFilter( StringUtils.format("bloom_filter_test((2 * CAST(\"dim1\", 'DOUBLE')),'%s')", base64), createExprMacroTable() ) ) .aggregators(AGGS(new CountAggregatorFactory("a0"))) .context(TIMESERIES_CONTEXT_DEFAULT) .build() ), ImmutableList.of( new Object[]{1L} ) ); }

Target:
public void testBloomFilterVirtualColumnNumber() throws Exception { BloomKFilter filter = new BloomKFilter(1500); filter.addDouble(20.2); byte[] bytes = BloomFilterSerializersModule.bloomKFilterToBytes(filter); String base64 = StringUtils.encodeBase64String(bytes); testQuery( StringUtils.format("SELECT COUNT(*) FROM druid.foo WHERE bloom_filter_test(2 * CAST(dim1 AS float), '%s')", base64), ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(QSS(Filtration.eternity())) .granularity(Granularities.ALL) .virtualColumns() .filters( new ExpressionDimFilter( StringUtils.format("bloom_filter_test((2 * CAST(\"dim1\", 'DOUBLE')),'%s')", base64), createExprMacroTable() ) ) .aggregators(AGGS(new CountAggregatorFactory("a0"))) .context(TIMESERIES_CONTEXT_DEFAULT) .build() ), ImmutableList.of( new Object[]{1L} ) ); }
Source:
public void symbols_filtering() { assertThat(SYMBOL_MODEL.getSymbols(Symbol.Kind.FUNCTION)).extracting("name").containsOnly("f", "func"); assertThat(SYMBOL_MODEL.getSymbols(Symbol.Kind.PARAMETER)).extracting("name").containsOnly("p1", "p2"); assertThat(SYMBOL_MODEL.getSymbols("a")).hasSize(3); assertThat(SYMBOL_MODEL.getSymbols("arguments")).hasSize(2); assertThat(SYMBOL_MODEL.getSymbols("this")).hasSize(3); assertThat(SYMBOL_MODEL.getSymbols("Object")).hasSize(1); assertThat(SYMBOL_MODEL.getSymbols("window")).hasSize(1); assertThat(SYMBOL_MODEL.getSymbols("document")).hasSize(1); }

Target:
public void symbols_filtering() { assertThat(SYMBOL_MODEL.getSymbols(Symbol.Kind.FUNCTION)).extracting("name").containsOnly("f", "func"); assertThat(SYMBOL_MODEL.getSymbols(Symbol.Kind.PARAMETER)).extracting("name").containsOnly("p1", "p2"); assertThat(SYMBOL_MODEL.getSymbols("a")).hasSize(3); assertThat(SYMBOL_MODEL.getSymbols("arguments")).hasSize(2); assertThat(SYMBOL_MODEL.getSymbols("this")).hasSize(3); assertThat(SYMBOL_MODEL.getSymbols("Object")).hasSize(1); assertThat(SYMBOL_MODEL.getSymbols("window")).hasSize(1); }
Source:
protected void initReferences(APMSpanBuilder builder, TraceReporter reporter) { Reference primaryRef = findPrimaryReference(builder.references); if (primaryRef != null) { if (primaryRef.getReferredTo() instanceof APMSpanBuilder) { initFromExtractedTraceState(builder, reporter, primaryRef); } else if (primaryRef.getReferredTo() instanceof APMSpan) { if (primaryRef.getReferenceType() == References.CHILD_OF) { initChildOf(builder, reporter, primaryRef); } else if (primaryRef.getReferenceType() == References.FOLLOWS_FROM) { initFollowsFrom(builder, reporter, primaryRef); } } } else { processNoPrimaryReference(builder, reporter); } }

Target:
protected void initReferences(APMSpanBuilder builder, TraceReporter reporter) { Reference primaryRef = findPrimaryReference(builder.references); if (primaryRef != null) { if (primaryRef.getReferredTo() instanceof APMSpanBuilder) { initFromExtractedTraceState(builder, reporter, primaryRef); } else if (primaryRef.getReferredTo() instanceof APMSpan) { if (References.CHILD_OF.equals(primaryRef.getReferenceType())) { initChildOf(builder, reporter, primaryRef); } else if (References.FOLLOWS_FROM.equals(primaryRef.getReferenceType())) { initFollowsFrom(builder, reporter, primaryRef); } } } else { processNoPrimaryReference(builder, reporter); } }
Source:
private static String authorityToMobile(@NonNull String authority) { String langCode = authorityToLanguageCode(authority); String subdomain = languageCodeToSubdomain(langCode); return authority.replaceFirst("^" + subdomain + "\\.?", "$0m."); }

Target:
private String authorityToMobile(@NonNull String authority) { String subdomain = languageCodeToSubdomain(languageCode); return authority.replaceFirst("^" + subdomain + "\\.?", "$0m."); }
Source:
public RTTestsParser() { super(Messages._Warnings_RTTests_ParserName(), Messages._Warnings_RTTests_LinkName(), Messages._Warnings_RTTests_TrendName(), CYCLICTEST_WARNING_PATTERN, true); }

Target:
public RTTestsParser() { super(Messages._Warnings_RTTests_ParserName(), Messages._Warnings_RTTests_LinkName(), Messages._Warnings_RTTests_TrendName(), CYCLICTEST_WARNING_PATTERN); }
Source:
public Response authoriseCharge(@PathParam("chargeId") String chargeId, AuthCardDetails authCardDetails) { if (!isWellFormatted(authCardDetails)) { return badRequestResponse("Values do not match expected format/length."); } AuthorisationResponse response = cardAuthoriseService.doAuthorise(chargeId, authCardDetails); return response.getGatewayError().map(this::handleError) .orElseGet(() -> response.getAuthoriseStatus().map(authoriseStatus -> { if (authoriseStatus.equals(AuthoriseStatus.SUBMITTED)) { return badRequestResponse("This transaction was deferred."); } if (isAuthorisationDeclined(authoriseStatus)) { return badRequestResponse("This transaction was declined."); } return ResponseUtil.successResponseWithEntity(ImmutableMap.of("status", authoriseStatus.getMappedChargeStatus().toString())); }).orElseGet(() -> ResponseUtil.serviceErrorResponse("InterpretedStatus not found for Gateway response"))); }

Target:
public Response authoriseCharge(@PathParam("chargeId") String chargeId, AuthCardDetails authCardDetails) { if (!isWellFormatted(authCardDetails)) { return badRequestResponse("Values do not match expected format/length."); } AuthorisationResponse response = cardAuthoriseService.doAuthorise(chargeId, authCardDetails); return response.getGatewayError().map(this::handleError) .orElseGet(() -> response.getAuthoriseStatus().map(this::handleAuthResponse) .orElseGet(() -> ResponseUtil.serviceErrorResponse("InterpretedStatus not found for Gateway response"))); }
Source:
protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException { super.deserializeStateData(serializer); ReopenTableRegionsStateData data = serializer.deserialize(ReopenTableRegionsStateData.class); tableName = ProtobufUtil.toTableName(data.getTableName()); regions = data.getRegionList().stream().map(ProtobufUtil::toRegionLocation) .collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(data.getRegionNamesList())) { regionNames = new ArrayList<>(); data.getRegionNamesList().forEach(regionName -> regionNames.add(regionName.toByteArray())); } else { regionNames = null; } }

Target:
protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException { super.deserializeStateData(serializer); ReopenTableRegionsStateData data = serializer.deserialize(ReopenTableRegionsStateData.class); tableName = ProtobufUtil.toTableName(data.getTableName()); regions = data.getRegionList().stream().map(ProtobufUtil::toRegionLocation) .collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(data.getRegionNamesList())) { regionNames = data.getRegionNamesList().stream().map(ByteString::toByteArray) .collect(Collectors.toList()); } else { regionNames = Collections.emptyList(); } }
Source:
public TextSelectedShareAdapter(PageActivity parentActivity) { super(parentActivity); app = (WikipediaApp) getActivity().getApplicationContext(); clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE); clipChangedListener = new ClipboardManager.OnPrimaryClipChangedListener() { @Override public void onPrimaryClipChanged() { if (expectClipChange && clipboard.hasPrimaryClip() && clipboard.getPrimaryClip().getItemCount() > 0) { expectClipChange = false; CharSequence selectedText = clipboard.getPrimaryClip().getItemAt(0) .coerceToText(getActivity()); Log.d("Share", ">>> Clipboard text: " + selectedText); shareSnippet(selectedText, false); } } }; clipboard.addPrimaryClipChangedListener(clipChangedListener); }

Target:
public TextSelectedShareAdapter(PageActivity parentActivity) { super(parentActivity); app = (WikipediaApp) parentActivity.getApplicationContext(); clipboard = (ClipboardManager) parentActivity.getSystemService(Context.CLIPBOARD_SERVICE); clipChangedListener = new ClipboardManager.OnPrimaryClipChangedListener() { @Override public void onPrimaryClipChanged() { if (expectClipChange && clipboard.hasPrimaryClip() && clipboard.getPrimaryClip().getItemCount() > 0) { expectClipChange = false; CharSequence selectedText = clipboard.getPrimaryClip().getItemAt(0) .coerceToText(getActivity()); Log.d("Share", ">>> Clipboard text: " + selectedText); shareSnippet(selectedText, false); } } }; clipboard.addPrimaryClipChangedListener(clipChangedListener); }
Source:
public void tearDown(ManagementClient managementClient, String serverId) throws Exception { setTimeout(managementClient, 300); executeReload(managementClient); awaitReload(managementClient); }

Target:
public void tearDown(ManagementClient managementClient, String serverId) throws Exception { final int timeout = originalTimeout == -1 ? 300 : originalTimeout; setTimeout(managementClient, timeout); ServerReload.executeReloadAndWaitForCompletion(managementClient.getControllerClient()); }
Source:
private static int getVersion(String keyName) { String[] keyNameArray = keyName.split("\\."); if (keyNameArray[keyNameArray.length - 1].startsWith("v")) { try { return Integer.parseInt(keyNameArray[keyNameArray.length - 1].substring(1)); } catch (NumberFormatException e) { LOGGER.log(Level.WARNING, "Parse version of encryption key error, key: " + keyName); } } return 0; }

Target:
private static int getVersion(String keyName) { int idx = keyName.lastIndexOf('.'); try { return Integer.parseInt(keyName.substring(idx + 2)); } catch (NumberFormatException e) { LOGGER.log(Level.WARNING, "Parse version of encryption key error, key: " + keyName); } return 0; }
Source:
public void testTwoInitThrows() throws Exception { assertThrows(IllegalStateException.class, () -> { StructField mapEntryStructField = new StructField("entry", 5); mapEntryStructField.addField(new StringField("key", 1)); mapEntryStructField.init(); mapEntryStructField.init(); }); }

Target:
public void testTwoInitThrows() throws Exception { StructField mapEntryStructField = new StructField("entry", 5); mapEntryStructField.addField(new StringField("key", 1)); mapEntryStructField.init(); assertThrows(IllegalStateException.class, () -> { mapEntryStructField.init(); }); }
Source:
public int getHeadingRecordIndex(List<CSVRecord> allCsvRecords) { int headingIndex = -1; if (allCsvRecords != null) { Optional<CSVRecord> headingRecord = allCsvRecords.stream().filter(currRecord -> hasHeading(currRecord)) .findFirst(); if (headingRecord.isPresent() && headingRecord.get() != null) { headingIndex = (int) headingRecord.get().getRecordNumber() - 1; } else { LOGGER.warn("No heading row was found."); } } return headingIndex; }

Target:
public int getHeadingRecordIndex(List<CSVRecord> allCsvRecords) { int headingIndex = -1; if (allCsvRecords != null) { Optional<CSVRecord> headingRecord = allCsvRecords.stream().filter(currRecord -> hasHeading(currRecord)) .findAny(); if (headingRecord.isPresent() && headingRecord.get() != null) { headingIndex = (int) headingRecord.get().getRecordNumber() - 1; } else { LOGGER.warn("No heading row was found."); } } return headingIndex; }
Source:
private static KubernetesClientConfig createFromSystemConfig(final Optional<String> name, final io.digdag.client.config.Config systemConfig) { final String clusterName; if (!name.isPresent()) { if (!systemConfig.get("agent.command_executor.type", String.class, "").equals("kubernetes")) { throw new ConfigException("agent.command_executor.type: is not 'kubernetes'"); } clusterName = systemConfig.get(KUBERNETES_CLIENT_PARAMS_PREFIX + "name", String.class); } else { clusterName = name.get(); } final String keyPrefix = KUBERNETES_CLIENT_PARAMS_PREFIX + clusterName + "."; final Config extracted = validateParams(StorageManager.extractKeyPrefix(systemConfig, keyPrefix)); if (extracted.get("use_kube_config", boolean.class, false)){ io.fabric8.kubernetes.client.Config kubeConfig; kubeConfig = getKubeConfigFromPath(extracted.get("kube_config_path", String.class)); return create(clusterName, kubeConfig.getMasterUrl(), kubeConfig.getCaCertData(), kubeConfig.getOauthToken(), kubeConfig.getNamespace() ); }else{ return create(clusterName, extracted.get("master", String.class), extracted.get("certs_ca_data", String.class), extracted.get("oauth_token", String.class), extracted.get("namespace", String.class)); } }

Target:
static KubernetesClientConfig createFromSystemConfig(final Optional<String> name, final io.digdag.client.config.Config systemConfig) { final String clusterName; if (!name.isPresent()) { if (!systemConfig.get("agent.command_executor.type", String.class, "").equals("kubernetes")) { throw new ConfigException("agent.command_executor.type: is not 'kubernetes'"); } clusterName = systemConfig.get(KUBERNETES_CLIENT_PARAMS_PREFIX + "name", String.class); } else { clusterName = name.get(); } final String keyPrefix = KUBERNETES_CLIENT_PARAMS_PREFIX + clusterName + "."; final Config extracted = StorageManager.extractKeyPrefix(systemConfig, keyPrefix); if (extracted.has("kube_config_path")) { String kubeConfigPath = extracted.get("kube_config_path", String.class); io.fabric8.kubernetes.client.Config validatedKubeConfig; validatedKubeConfig = validateKubeConfig(getKubeConfigFromPath(kubeConfigPath)); return create(clusterName, validatedKubeConfig.getMasterUrl(), validatedKubeConfig.getCaCertData(), validatedKubeConfig.getOauthToken(), validatedKubeConfig.getNamespace()); } else { final Config validatedConfig = validateConfig(extracted); return create(clusterName, validatedConfig.get("master", String.class), validatedConfig.get("certs_ca_data", String.class), validatedConfig.get("oauth_token", String.class), validatedConfig.get("namespace", String.class)); } }
Source:
public void setUp() throws Exception { removeDir(new File(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath())); removeDir(new File(REPOSITORY_BASEDIR_SNAPSHOTS.getAbsolutePath())); logger.debug("Generate releases..."); TestCaseWithArtifactGeneration generator = new TestCaseWithArtifactGeneration(); TestCaseWithArtifactGeneration.generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "org.carlspring.strongbox.metadata:strongbox-metadata", new String[]{ "3.0.1", "3.0.2", "3.1", "3.2" }); generator.createTimestampedSnapshotArtifact(REPOSITORY_BASEDIR_SNAPSHOTS.getAbsolutePath(), "org.carlspring.strongbox.metadata", "strongbox-metadata", "3.0.1", "jar", null, 3); generator.createTimestampedSnapshotArtifact(REPOSITORY_BASEDIR_SNAPSHOTS.getAbsolutePath(), "org.carlspring.strongbox.metadata", "strongbox-metadata", "3.0.2", "jar", null, 4); generator.createTimestampedSnapshotArtifact(REPOSITORY_BASEDIR_SNAPSHOTS.getAbsolutePath(), "org.carlspring.strongbox.metadata", "strongbox-metadata", "3.1", "jar", null, 5); }

Target:
public static void setUp() throws Exception { removeDir(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath() + "/org/carlspring/strongbox/metadata/strongbox-metadata"); removeDir(REPOSITORY_BASEDIR_SNAPSHOTS.getAbsolutePath() + "/org/carlspring/strongbox/metadata/strongbox-metadata"); generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "org.carlspring.strongbox.metadata:strongbox-metadata", "3.0.1", "3.0.2", "3.1", "3.2"); TestCaseWithArtifactGeneration generator = new TestCaseWithArtifactGeneration(); String snapshotPath = REPOSITORY_BASEDIR_SNAPSHOTS.getAbsolutePath(); generator.createTimestampedSnapshotArtifact(snapshotPath, "org.carlspring.strongbox.metadata", "strongbox-metadata", "3.0.1", "jar", null, 3); generator.createTimestampedSnapshotArtifact(snapshotPath, "org.carlspring.strongbox.metadata", "strongbox-metadata", "3.0.2", "jar", null, 4); generator.createTimestampedSnapshotArtifact(snapshotPath, "org.carlspring.strongbox.metadata", "strongbox-metadata", "3.1", "jar", null, 5); }
Source:
protected SamHeaderAndIterator openInputs() { final List<SAMFileHeader> headers = new ArrayList<>(INPUT.size()); final List<SamReader> readers = new ArrayList<>(INPUT.size()); for (final String input : INPUT) { SamReader reader = SamReaderFactory.makeDefault() .enable(SamReaderFactory.Option.EAGERLY_DECODE) .open(SamInputResource.of(input)); final SAMFileHeader header = reader.getFileHeader(); headers.add(header); readers.add(reader); } if(ASSUME_ORDER != null) { headers.get(0).setSortOrder(ASSUME_ORDER); } if (headers.size() == 1) { return new SamHeaderAndIterator(headers.get(0), readers.get(0).iterator()); } else { final SamFileHeaderMerger headerMerger = new SamFileHeaderMerger(headers.get(0).getSortOrder(), headers, false); final MergingSamRecordIterator iterator = new MergingSamRecordIterator(headerMerger, readers, ASSUME_ORDER != null); return new SamHeaderAndIterator(headerMerger.getMergedHeader(), iterator); } }

Target:
protected SamHeaderAndIterator openInputs() { final List<SAMFileHeader> headers = new ArrayList<>(INPUT.size()); final List<SamReader> readers = new ArrayList<>(INPUT.size()); for (final String input : INPUT) { SamReader reader = SamReaderFactory.makeDefault() .enable(SamReaderFactory.Option.EAGERLY_DECODE) .open(SamInputResource.of(input)); final SAMFileHeader header = reader.getFileHeader(); headers.add(header); readers.add(reader); } if (ASSUME_SORT_ORDER != null || ASSUME_SORTED) { if (ASSUME_SORT_ORDER == null) { ASSUME_SORT_ORDER = SAMFileHeader.SortOrder.coordinate; ASSUME_SORTED = false; } headers.get(0).setSortOrder(ASSUME_SORT_ORDER); } if (headers.size() == 1) { return new SamHeaderAndIterator(headers.get(0), readers.get(0).iterator()); } else { final SamFileHeaderMerger headerMerger = new SamFileHeaderMerger(headers.get(0).getSortOrder(), headers, false); final MergingSamRecordIterator iterator = new MergingSamRecordIterator(headerMerger, readers, ASSUME_SORT_ORDER != null); return new SamHeaderAndIterator(headerMerger.getMergedHeader(), iterator); } }
Source:
void processPullReply(final K key, final V value) { final PullFuture<V> future = pendingPulls.get(key); if (future != null) { future.setValue(value); } else { LOG.log(Level.WARNING, "Pending pull was not found for key {0}." + " It may be fulfilled by another earlier response from the server", key); } }

Target:
void processPullReply(final K key, final V value) { final PullFuture<V> future = pendingPulls.get(key); if (future != null) { future.setValue(value); } else { LOG.log(Level.WARNING, "Pending pull was not found for key {0}." + " Response for the key may have arrived earlier from another server", key); } }
Source:
public boolean performPaste(Object target, ISelection selection) { if (target instanceof IBreakpointContainer && selection instanceof IStructuredSelection) { IBreakpointContainer container = (IBreakpointContainer) target; for (Object object : ((IStructuredSelection)selection)) { IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(object, IBreakpoint.class); if (breakpoint != null) { container.getOrganizer().addBreakpoint(breakpoint, container.getCategory()); } } return true; } return false; }

Target:
public boolean performPaste(Object target, ISelection selection) { if (target instanceof IBreakpointContainer && selection instanceof IStructuredSelection) { IBreakpointContainer container = (IBreakpointContainer) target; for (Object object : (IStructuredSelection) selection) { IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(object, IBreakpoint.class); if (breakpoint != null) { container.getOrganizer().addBreakpoint(breakpoint, container.getCategory()); } } return true; } return false; }
Source:
public PlaybackControlLayer(String videoTitle, FullscreenCallback fullscreenCallback) { this.videoTitle = videoTitle; this.canSeek = true; this.fullscreenCallback = fullscreenCallback; this.shouldBePlaying = false; this.savedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; actionButtons = new ArrayList<ImageButton>(); }

Target:
public PlaybackControlLayer(String videoTitle, FullscreenCallback fullscreenCallback) { this.videoTitle = videoTitle; this.canSeek = true; this.fullscreenCallback = fullscreenCallback; this.shouldBePlaying = false; actionButtons = new ArrayList<ImageButton>(); }
Source:
private void shareMedia() { MediaModel media = mMediaStore.getMediaWithLocalId(mMediaId); if (media == null) { ToastUtils.showToast(this, R.string.error_media_not_found); return; } Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_TEXT, media.getUrl()); if (!TextUtils.isEmpty(media.getTitle())) { intent.putExtra(Intent.EXTRA_SUBJECT, media.getTitle()); } else if (!TextUtils.isEmpty(media.getDescription())) { intent.putExtra(Intent.EXTRA_SUBJECT, media.getDescription()); } try { startActivity(Intent.createChooser(intent, getString(R.string.reader_share_link))); } catch (android.content.ActivityNotFoundException ex) { ToastUtils.showToast(this, R.string.reader_toast_err_share_intent); } }

Target:
private void shareMedia() { MediaModel media = mMediaStore.getMediaWithLocalId(mMediaId); if (media == null) { ToastUtils.showToast(this, R.string.error_media_not_found); return; } Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_TEXT, media.getUrl()); if (!TextUtils.isEmpty(media.getTitle())) { intent.putExtra(Intent.EXTRA_SUBJECT, media.getTitle()); } else if (!TextUtils.isEmpty(media.getDescription())) { intent.putExtra(Intent.EXTRA_SUBJECT, media.getDescription()); } try { startActivity(Intent.createChooser(intent, getString(R.string.share_link))); } catch (android.content.ActivityNotFoundException ex) { ToastUtils.showToast(this, R.string.reader_toast_err_share_intent); } }
Source:
public KeyValueEncryptedFileStore(File parentDir, String storeName, String encryptionKey) { storeDir = new File(parentDir, storeName); if (!storeDir.exists()) { storeDir.mkdirs(); } this.encryptionKey = encryptionKey; }

Target:
KeyValueEncryptedFileStore(File parentDir, String storeName, String encryptionKey) { if (!isValidStoreName(storeName)) { throw new IllegalArgumentException("Invalid store name: " + storeName); } storeDir = new File(parentDir, storeName); if (!storeDir.exists()) { storeDir.mkdirs(); } if (!storeDir.isDirectory()) { throw new IllegalArgumentException("Failed to create directory for: " + storeName); } this.encryptionKey = encryptionKey; }
Source:
public void unlock(String requestId, String name, long start) { LOG.trace("{} - Unlocking ({})", name, requestId, JavaUtils.duration(start)); ReentrantLock lock = requestLocks.computeIfAbsent(requestId, (r) -> new ReentrantLock()); lock.unlock(); }

Target:
private void unlock(String requestId, String name, long start) { LOG.trace("{} - Unlocking ({})", name, requestId, JavaUtils.duration(start)); ReentrantLock lock = requestLocks.computeIfAbsent(requestId, (r) -> new ReentrantLock()); lock.unlock(); }
Source:
public void testCnxManagerListenerThreadConfigurableRetry() throws Exception { final Map<Long,QuorumServer> unresolvablePeers = new HashMap<>(); final long myid = 1L; unresolvablePeers.put(myid, new QuorumServer(myid, "unresolvable-domain.org:2182:2183;2181")); final QuorumPeer peer = new QuorumPeer(unresolvablePeers, ClientBase.createTmpDir(), ClientBase.createTmpDir(), 2181, 3, myid, 1000, 2, 2); final QuorumCnxManager cnxManager = peer.createCnxnManager(); QuorumCnxManager.Listener listener = cnxManager.listener; listener.start(); listener.join(15000); Assert.assertFalse(listener.isAlive()); Assert.assertFalse(peer.isRunning()); peer.join(15000); Assert.assertFalse(QuorumPeer.class.getSimpleName() + " not stopped after " + "listener thread death", listener.isAlive()); }

Target:
public void testCnxManagerListenerThreadConfigurableRetry() throws Exception { final Map<Long,QuorumServer> unresolvablePeers = new HashMap<>(); final long myid = 1L; unresolvablePeers.put(myid, new QuorumServer(myid, "unresolvable-domain.org:2182:2183;2181")); final QuorumPeer peer = new QuorumPeer(unresolvablePeers, ClientBase.createTmpDir(), ClientBase.createTmpDir(), 2181, 3, myid, 1000, 2, 2, 2); final QuorumCnxManager cnxManager = peer.createCnxnManager(); QuorumCnxManager.Listener listener = cnxManager.listener; listener.start(); listener.join(15000); Assert.assertFalse(listener.isAlive()); Assert.assertFalse(peer.isRunning()); peer.join(15000); Assert.assertFalse(QuorumPeer.class.getSimpleName() + " not stopped after " + "listener thread death", listener.isAlive()); }
Source:
default boolean isDCStable(DeploymentConfig dc) { return "True".equals(dc.getStatus().getConditions().get(0).getStatus()) && dc.getStatus().getUnavailableReplicas() == 0; }

Target:
default boolean isDCStable(DeploymentConfig dc) { return "True".equalsIgnoreCase(dc.getStatus().getConditions().get(0).getStatus()) && dc.getStatus().getUnavailableReplicas() == 0; }
Source:
private boolean isTable(RelNode relNode) { if (relNode instanceof EnumerableTableScan || relNode instanceof LogicalProject) { SqlIOConfig sourceTableConfig = resolveSourceConfigForTable(relNode); return sourceTableConfig != null && sourceTableConfig.getTableDescriptor().isPresent(); } else { return false; } }

Target:
private boolean isTable(RelNode relNode) { if (relNode instanceof EnumerableTableScan) { return resolveSourceConfig(relNode).getTableDescriptor().isPresent(); } else { return false; } }
Source:
public UpdateResponse delete(String key) { try { LOG.info("Delete datastream called for datastream " + key); DELETE_CALL.inc(); Instant startTime = Instant.now(); _store.deleteDatastream(key); synchronized (_deleteCallLatencyMs) { _deleteCallLatencyMs = Duration.between(startTime, Instant.now()).toMillis(); } return new UpdateResponse(HttpStatus.S_200_OK); } catch (Exception e) { CALL_ERROR.inc(); _errorLogger.logAndThrowRestLiServiceException(HttpStatus.S_500_INTERNAL_SERVER_ERROR, "delete datastream failed for datastream: " + key, e); } return null; }

Target:
public UpdateResponse delete(String key) { try { LOG.info("Delete datastream called for datastream " + key); DELETE_CALL.inc(); Instant startTime = Instant.now(); _store.deleteDatastream(key); _deleteCallLatencyMs.set(Duration.between(startTime, Instant.now()).toMillis()); return new UpdateResponse(HttpStatus.S_200_OK); } catch (Exception e) { CALL_ERROR.inc(); _errorLogger.logAndThrowRestLiServiceException(HttpStatus.S_500_INTERNAL_SERVER_ERROR, "delete datastream failed for datastream: " + key, e); } return null; }
Source:
final byte[] getRaw(int columnIndex) { byte[] retval; int pos = m_buffer.position(); int offset = getOffset(columnIndex); VoltType type = getColumnType(columnIndex); int length = type.getLengthInBytesForFixedTypesWithoutCheck(); switch(type) { case TINYINT: case SMALLINT: case INTEGER: case BIGINT: case TIMESTAMP: case FLOAT: case DECIMAL: case GEOGRAPHY_POINT: retval = new byte[length]; m_buffer.position(offset); m_buffer.get(retval); m_buffer.position(pos); return retval; case STRING: case VARBINARY: case GEOGRAPHY: length = m_buffer.getInt(offset); if (length == VoltTable.NULL_STRING_INDICATOR) { length = 0; } length += 4; retval = new byte[length]; m_buffer.position(offset); m_buffer.get(retval); m_buffer.position(pos); return retval; default: throw new RuntimeException("Unknown type"); } }

Target:
final byte[] getRaw(int columnIndex) { byte[] retval; int pos = m_buffer.position(); int offset = getOffset(columnIndex); VoltType type = getColumnType(columnIndex); switch(type) { case TINYINT: case SMALLINT: case INTEGER: case BIGINT: case TIMESTAMP: case FLOAT: case DECIMAL: case GEOGRAPHY_POINT: { int length = type.getLengthInBytesForFixedTypesWithoutCheck(); retval = new byte[length]; m_buffer.position(offset); m_buffer.get(retval); m_buffer.position(pos); return retval; } case STRING: case VARBINARY: case GEOGRAPHY: { int length = m_buffer.getInt(offset); if (length == VoltTable.NULL_STRING_INDICATOR) { length = 0; } length += 4; retval = new byte[length]; m_buffer.position(offset); m_buffer.get(retval); m_buffer.position(pos); return retval; } default: throw new RuntimeException("Unknown type"); } }
Source:
protected static String sanitize(String namespace) { Pattern dotOrWhitespace = Pattern.compile("[\\s]+|[.]+"); return dotOrWhitespace.matcher(namespace).replaceAll("_"); }

Target:
protected static String sanitize(String namespace) { return DOT_OR_WHITESPACE_PATTERN.matcher(namespace).replaceAll("_"); }
Source:
protected void testIntersections(Comparison comparison) { for (Diff diff : comparison.getDifferences()) { int realRefinesSize = Iterables.size(Iterables.filter(diff.getRefines(), not(instanceOf(StereotypedElementChange.class)))); assertFalse("Wrong number of refines (without StereotypedElementChange) on" + diff, realRefinesSize > 1); int stereotypedElementChangeRefines = Iterables.size(Iterables.filter(diff.getRefines(), instanceOf(StereotypedElementChange.class))); assertFalse("Wrong number of refines StereotypedElementChange on " + diff, stereotypedElementChangeRefines > 1); } }

Target:
protected void testIntersections(Comparison comparison) { for (Diff diff : comparison.getDifferences()) { int realRefinesSize = Iterables.size(Iterables.filter(diff.getRefines(), not(instanceOf(StereotypedElementChange.class)))); assertFalse("Wrong number of refines (without StereotypedElementChange) on" + diff, realRefinesSize > 1); int stereotypedElementChangeRefines = Iterables.size(Iterables.filter(diff.getRefines(), instanceOf(StereotypedElementChange.class))); assertFalse("Wrong number of refines (of type StereotypedElementChange) on " + diff, stereotypedElementChangeRefines > 1); } }
Source:
private LeadMessage(final Type type, final String title, String details, final String linkUrl) { this(type, title, details); mLinkUrl = linkUrl; }

Target:
private LeadMessage(final Type type, final String title, String details, final String linkUrl) { mTitle = title; mDetails = details; mType = type; mLinkUrl = linkUrl; }
Source:
private JComponent createBenchmarkTreePanel() { JPanel benchmarkTreePanel = new JPanel(new BorderLayout()); CheckBoxTree checkBoxTree = createCheckBoxTree(); benchmarkTreePanel.add(new JScrollPane(checkBoxTree), BorderLayout.CENTER); JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JButton generateReportButton = new JButton(new GenerateReportAction(this)); buttonPanel.add(generateReportButton); benchmarkTreePanel.add(buttonPanel, BorderLayout.SOUTH); benchmarkTreePanel.setBorder(new EmptyBorder(0, 0, 15, 0)); return benchmarkTreePanel; }

Target:
private JComponent createBenchmarkTreePanel() { JPanel benchmarkTreePanel = new JPanel(new BorderLayout()); CheckBoxTree checkBoxTree = createCheckBoxTree(); benchmarkTreePanel.add(new JScrollPane(checkBoxTree), BorderLayout.CENTER); JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JButton generateReportButton = new JButton(new GenerateReportAction(this)); buttonPanel.add(generateReportButton); benchmarkTreePanel.add(buttonPanel, BorderLayout.SOUTH); benchmarkTreePanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 15, 0)); return benchmarkTreePanel; }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof ReferenceSchema) { ReferenceSchema that = (ReferenceSchema) o; return that.canEqual(this) && Objects.equals(refValue, that.refValue) && Objects.equals(unprocessedProperties, that.unprocessedProperties) && Objects.equals(title, that.title) && Objects.equals(description, that.description) && super.equals(that); } else { return false; } }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof ReferenceSchema) { ReferenceSchema that = (ReferenceSchema) o; return that.canEqual(this) && Objects.equals(refValue, that.refValue) && Objects.equals(unprocessedProperties, that.unprocessedProperties) && Objects.equals(title, that.title) && Objects.equals(description, that.description) && super.equals(that) && EqualsCycleBreaker.equalsWithoutCycle(this, that, true, ReferenceSchema::equalsPossiblyCyclic); } else { return false; } }
Source:
public RemoveNotificationResult removeNotificationForMessage(MessageReference messageReference) { NotificationHolder holder = getNotificationHolderForMessage(messageReference); if (holder == null) { return RemoveNotificationResult.unknownNotification(); } activeNotifications.remove(holder); int notificationId = holder.notificationId; notificationIdsInUse.delete(notificationId); if (!additionalNotifications.isEmpty()) { NotificationContent newContent = additionalNotifications.removeFirst(); NotificationHolder replacement = createNotificationHolder(notificationId, newContent); activeNotifications.addLast(replacement); return RemoveNotificationResult.createNotification(replacement); } return RemoveNotificationResult.cancelNotification(notificationId); }

Target:
public RemoveNotificationResult removeNotificationForMessage(MessageReference messageReference) { NotificationHolder holder = getNotificationHolderForMessage(messageReference); if (holder == null) { return RemoveNotificationResult.unknownNotification(); } activeNotifications.remove(holder); int notificationId = holder.notificationId; markNotificationIdAsFree(notificationId); if (!additionalNotifications.isEmpty()) { NotificationContent newContent = additionalNotifications.removeFirst(); NotificationHolder replacement = createNotificationHolder(notificationId, newContent); activeNotifications.addLast(replacement); return RemoveNotificationResult.createNotification(replacement); } return RemoveNotificationResult.cancelNotification(notificationId); }
Source:
public static ImmutableList<Arguments> getVoidArgsFromParamList(final ImmutableList<Ds3Param> paramList) { if(isEmpty(paramList)) { return ImmutableList.of(); } final ImmutableList.Builder<Arguments> argsBuilder = ImmutableList.builder(); for (final Ds3Param ds3Param : paramList) { if (!ds3Param.getName().equals("Operation") && ds3Param.getType().equals("void")) { argsBuilder.add(toArgument(ds3Param)); } } return argsBuilder.build(); }

Target:
public static ImmutableList<Arguments> getVoidArgsFromParamList(final ImmutableList<Ds3Param> paramList) { if(isEmpty(paramList)) { return ImmutableList.of(); } return paramList.stream() .filter(param -> !param.getName().equals("Operation") && param.getType().equals("void")) .map(RequestConverterUtil::toArgument) .collect(GuavaCollectors.immutableList()); }
Source:
public FacebookBuilder() { super(FacebookAuthProvider.PROVIDER_ID); try { Class c = com.facebook.FacebookSdk.class; } catch (NoClassDefFoundError e) { throw new RuntimeException( "Facebook provider cannot be configured " + "without dependency. Did you forget to add " + "'com.facebook.android:facebook-login:VERSION' dependency?"); } if (getApplicationContext().getString(R.string.facebook_application_id) .equals(UNCONFIGURED_CONFIG_VALUE)) { throw new RuntimeException("Facebook provider unconfigured. Make sure to add" + " a `facebook_application_id` string. See the docs for more info:" + " <LINK_0>"); } if (getApplicationContext().getString(R.string.facebook_login_protocol_scheme) .equals("fbYOUR_APP_ID")) { Log.w("FacebookBuilder", "Facebook provider unconfigured for Chrome" + " Custom Tabs."); } }

Target:
public FacebookBuilder() { super(FacebookAuthProvider.PROVIDER_ID); try { Class c = com.facebook.FacebookSdk.class; } catch (NoClassDefFoundError e) { throw new RuntimeException( "Facebook provider cannot be configured " + "without dependency. Did you forget to add " + "'com.facebook.android:facebook-login:VERSION' dependency?"); } Preconditions.checkConfigured(getApplicationContext(), "Facebook provider unconfigured. Make sure to add a" + " `facebook_application_id` string. See the docs for more info:" + " <LINK_0>", R.string.facebook_application_id); if (getApplicationContext().getString(R.string.facebook_login_protocol_scheme) .equals("fbYOUR_APP_ID")) { Log.w(TAG, "Facebook provider unconfigured for Chrome Custom Tabs."); } }
Source:
public MarketHistory(Market m) { super(); this.market = m; history = new HashMap<String, List<Double>>(); }

Target:
public MarketHistory(Market m) { this.market = m; history = new HashMap<String, List<Double>>(); }
Source:
public void trailingSlashes() { assertEquals("/foo/bar/", ServletUtils.getEncodedPathInfo("/s", "/c/s/foo/bar/", "/c")); assertEquals("/foo/bar/", ServletUtils.getEncodedPathInfo("/s", "/c/s/foo/bar assertEquals("/foo%2Fbar/", ServletUtils.getEncodedPathInfo("/s", "/c/s/foo%2Fbar/", "/c")); assertEquals("/foo%2Fbar/", ServletUtils.getEncodedPathInfo("/s", "/c/s/foo%2Fbar }

Target:
public void trailingSlashes() { assertEquals("/foo/bar/", ServletUtils.getEncodedPathInfo("/c", "/s", "/c/s/foo/bar/")); assertEquals("/foo/bar/", ServletUtils.getEncodedPathInfo("/c", "/s", "/c/s/foo/bar assertEquals("/foo%2Fbar/", ServletUtils.getEncodedPathInfo("/c", "/s", "/c/s/foo%2Fbar/")); assertEquals("/foo%2Fbar/", ServletUtils.getEncodedPathInfo("/c", "/s", "/c/s/foo%2Fbar }
Source:
private void sendMetrics(final String id, final String metrics) { try { final URL obj = new URL(this.dolphinURL); final HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); con.setDoOutput(true); con.setDoInput(true); con.connect(); final OutputStream os = con.getOutputStream(); final String param = "id=" + id + "&metrics=" + metrics; os.write((param).getBytes()); os.flush(); os.close(); final BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()) ); String inputLine; final StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); } catch (Exception e) { throw new RuntimeException("Network Error" + e); } }

Target:
private void sendMetrics(final String id, final String metrics) { try { final String dashboardUrlStr = this.dashboardURL; final URL dashboardUrl = new URL(dashboardUrlStr); final HttpURLConnection con = (HttpURLConnection) dashboardUrl.openConnection(); con.setRequestMethod("POST"); con.setDoOutput(true); con.setDoInput(true); con.connect(); try (final OutputStream os = con.getOutputStream()) { final String param = "id=" + id + "&metrics=" + metrics + "&time=" + System.currentTimeMillis(); os.write((param).getBytes()); os.flush(); } try (final BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()))) { String inputLine; final StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } } } catch (IOException e) { LOG.log(Level.WARNING, "Failed to send metrics to Dashboard server.", e); } }
Source:
public void unregisterPill(final Long accountId, final String pillId) { final Integer numRows = deviceDAO.deletePillPairing(pillId, accountId); if(numRows == 0) { LOGGER.warn("Did not find active pill to unregister"); } final List<DeviceAccountPair> sensePairedWithAccount = this.deviceDAO.getSensesForAccountId(accountId); if(sensePairedWithAccount.isEmpty()){ LOGGER.error("No sense paired with account {}", accountId); } final String senseId = sensePairedWithAccount.get(0).externalDeviceId; try { this.mergedUserInfoDynamoDB.deletePillColor(senseId, accountId, pillId); }catch (Exception ex){ LOGGER.error("Delete pill {}'s color from user info table for sense and account failed: {}", pillId, senseId, accountId, ex.getMessage()); } }

Target:
public void unregisterPill(final Long accountId, final String pillId) { final Integer numRows = deviceDAO.deletePillPairing(pillId, accountId); if(numRows == 0) { LOGGER.warn("Did not find active pill to unregister"); } final List<DeviceAccountPair> sensePairedWithAccount = this.deviceDAO.getSensesForAccountId(accountId); if(sensePairedWithAccount.isEmpty()){ LOGGER.error("No sense paired with account {}", accountId); return; } final String senseId = sensePairedWithAccount.get(0).externalDeviceId; try { this.mergedUserInfoDynamoDB.deletePillColor(senseId, accountId, pillId); }catch (Exception ex){ LOGGER.error("Delete pill {}'s color from user info table for sense and account failed: {}", pillId, senseId, accountId, ex.getMessage()); } }
Source:
public void test_get_URI() throws URISyntaxException { assertEquals("/d1", Paths.get(new URI("file:/ assertEquals("/", Paths.get(new URI("file:/ assertEquals("/d1 try { Paths.get(new URI("d1")); fail(); } catch (IllegalArgumentException expected) }

Target:
public void test_get_URI() throws URISyntaxException { assertEquals("/d1", Paths.get(new URI("file:/ assertEquals("/", Paths.get(new URI("file:/ assertEquals("/d1 try { Paths.get(new URI("d1")); fail(); } catch (IllegalArgumentException expected) try { Paths.get(new URI("scheme://d")); fail(); } catch (FileSystemNotFoundException expected) }
Source:
protected String getResource() { return "simpleusertaskmodel.bpmn"; }

Target:
protected String getResource() { return "simpleUserTaskModel.bpmn"; }
Source:
private void setBackgroundComponentLocation(Graphics g) { if (fitToViewport) { final JViewport vp = (JViewport) getParent(); final Point viewPosition = vp.getViewPosition(); int widthOffset = (int) ((vp.getVisibleRect().getWidth() - backgroundComponent.getWidth()) / 2); int heightOffset = (int) ((vp.getVisibleRect().getHeight() - backgroundComponent.getHeight()) / 2); g.translate(viewPosition.x + widthOffset, viewPosition.y + heightOffset); } else { final Point centerPoint = getRootCenterPoint(); final Point backgroundImageTopLeft = getBackgroundImageTopLeft(centerPoint); g.translate(backgroundImageTopLeft.x, backgroundImageTopLeft.y); } }

Target:
private void setBackgroundComponentLocation(Graphics g) { if (fitToViewport) { final JViewport vp = (JViewport) getParent(); final Point viewPosition = vp.getViewPosition(); g.translate(viewPosition.x, viewPosition.y); } else { final Point centerPoint = getRootCenterPoint(); final Point backgroundImageTopLeft = getBackgroundImageTopLeft(centerPoint); g.translate(backgroundImageTopLeft.x, backgroundImageTopLeft.y); } }