auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void main(String args[]) { try { VerifiableProperties verifiableProperties = StoreToolsUtil.getVerifiableProperties(args); ConsistencyCheckerTool consistencyCheckerTool = new ConsistencyCheckerTool(verifiableProperties); consistencyCheckerTool.checkConsistency(); } catch (Exception e) { <START> System.err.println("Consistency checker exited with Exception: " + e); <END> } }</code><technical_language>exception need caught. Also, logger</technical_language>

Target:
public static void main(String args[]) throws Exception { VerifiableProperties verifiableProperties = StoreToolsUtil.getVerifiableProperties(args); ConsistencyCheckerTool consistencyCheckerTool = new ConsistencyCheckerTool(verifiableProperties); consistencyCheckerTool.checkConsistency(); }
Source:
<code>public void tag(CoreSession session, String docId, String label) throws DocumentSecurityException { if (session.hasPermission(new IdRef(docId), SecurityConstants.WRITE)) { CoreInstance.doPrivileged(session, s -> { <START> doTag(s, docId, cleanLabel(label, true, false)); <END> }); fireUpdateEvent(session, docId); } else { String principalName = session.getPrincipal().getName(); throw new DocumentSecurityException("User '" + principalName + "' is not allowed to add tag '" + label + "' on document '" + docId + "'"); } }</code><technical_language>privileged sections small compute cleanLabel(label, true, false) of it</technical_language>

Target:
public void tag(CoreSession session, String docId, String label) throws DocumentSecurityException { if (session.hasPermission(new IdRef(docId), SecurityConstants.WRITE)) { String cleanLabel = cleanLabel(label, true, false); CoreInstance.doPrivileged(session, s -> { doTag(s, docId, cleanLabel); }); fireUpdateEvent(session, docId); } else { String principalName = session.getPrincipal().getName(); throw new DocumentSecurityException("User '" + principalName + "' is not allowed to add tag '" + label + "' on document '" + docId + "'"); } }
Source:
<code>public boolean setInput(Object object) { try { Object useAsInput = object; <START> ISelection selection = getSite().getPage().getSelection(); <END> if (selection instanceof IStructuredSelection) { IStructuredSelection structuredSelection = (IStructuredSelection) selection; HistoryPageInput mostFittingInput = SelectionUtils .getMostFittingInput(structuredSelection, object); if (mostFittingInput != null) { useAsInput = mostFittingInput; } } setWarningText(null); trace = GitTraceLocation.HISTORYVIEW.isActive(); if (trace) GitTraceLocation.getTrace().traceEntry( GitTraceLocation.HISTORYVIEW.getLocation(), useAsInput); if (useAsInput == getInput()) return true; this.input = null; return super.setInput(useAsInput); } finally { if (trace) GitTraceLocation.getTrace().traceExit( GitTraceLocation.HISTORYVIEW.getLocation()); } }</code><technical_language>If history view active, part activated selection get is selected SWTCommit history page's CommitGraphTable</technical_language>

Target:
public boolean setInput(Object object) { try { Object useAsInput = getMostFittingInput(object); setWarningText(null); trace = GitTraceLocation.HISTORYVIEW.isActive(); if (trace) GitTraceLocation.getTrace().traceEntry( GitTraceLocation.HISTORYVIEW.getLocation(), useAsInput); if (useAsInput == getInput()) return true; this.input = null; return super.setInput(useAsInput); } finally { if (trace) GitTraceLocation.getTrace().traceExit( GitTraceLocation.HISTORYVIEW.getLocation()); } }
Source:
<code>protected boolean <START> isSpanMarkup(char <END> character) { return SPAN_MARKUP_CHARACTERS.matches(character); }</code><technical_language>consider making this method private package scope</technical_language>

Target:
private boolean isSpanMarkup(char character) { return SPAN_MARKUP_CHARACTERS.matches(character); }
Source:
<code>public void shouldDecorateFutureAndCallerRequestCancelled() { CircuitBreaker circuitBreaker = CircuitBreaker.ofDefaults("testName"); final Future<String> future = executor.submit(() -> "Hello World"); future.cancel(true); CircuitBreakerFuture<String> decoratedFuture = new CircuitBreakerFuture<>(circuitBreaker, future); Throwable thrown = catchThrowable(() -> decoratedFuture.get()); <START> assertThat(thrown).isInstanceOf(CancellationException.class); <END> assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(0); assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(0); assertThat(circuitBreaker.getMetrics().getNumberOfSuccessfulCalls()).isEqualTo(0); assertThat(circuitBreaker.getMetrics().getNumberOfNotPermittedCalls()).isEqualTo(0); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.CLOSED); }</code><technical_language>This test fail sometimes. a Future mock instead</technical_language>

Target:
public void shouldDecorateFutureAndCallerRequestCancelled() throws Exception { CircuitBreaker circuitBreaker = CircuitBreaker.ofDefaults("testName"); final Future<String> future = mock(Future.class); when(future.get()).thenThrow(new CancellationException()); CircuitBreakerFuture<String> decoratedFuture = new CircuitBreakerFuture<>(circuitBreaker, future); Throwable thrown = catchThrowable(() -> decoratedFuture.get()); assertThat(thrown).isInstanceOf(CancellationException.class); assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(0); assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(0); assertThat(circuitBreaker.getMetrics().getNumberOfSuccessfulCalls()).isEqualTo(0); assertThat(circuitBreaker.getMetrics().getNumberOfNotPermittedCalls()).isEqualTo(0); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.CLOSED); then(future).should().get(); }
Source:
<code>public URLStreamHandler createURLStreamHandler(final String protocol) { if(KUBERNETES_PROTOCOL.equals(protocol)) { new URLStreamHandler(){ @Override <START> protected URLConnection openConnection(final URL u) throws IOException { <END> Assert.requireNonNull(u, "u"); final String serviceName = u.getHost(); if(serviceName.contains(":")) { final String namespace = serviceName.split(":")[0]; final String name = serviceName.split(":")[1]; try { return discoveryService.getAddress(namespace, name).get().openConnection(); } catch (Exception e) { throw new IOException("Can not convert service URL", e); } } else { final String name = serviceName; try { return discoveryService.getAddress(name).get().openConnection(); } catch (Exception e) { throw new IOException("Can not convert service URL", e); } } } }; } return null; }</code><technical_language>url u :)</technical_language>

Target:
public URLStreamHandler createURLStreamHandler(final String protocol) { if(KUBERNETES_PROTOCOL.equals(protocol)) { new URLStreamHandler(){ @Override protected URLConnection openConnection(final URL url) throws IOException { Assert.requireNonNull(url, "url"); final String serviceName = url.getHost(); if(serviceName.contains(":")) { final String namespace = serviceName.split(":")[0]; final String name = serviceName.split(":")[1]; try { return discoveryService.getAddress(namespace, name).get().openConnection(); } catch (final Exception e) { throw new IOException("Can not convert service URL", e); } } else { final String name = serviceName; try { return discoveryService.getAddress(name).get().openConnection(); } catch (final Exception e) { throw new IOException("Can not convert service URL", e); } } } }; } return null; }
Source:
<code>public void testLayoutVisitor () throws JSONException { JSONObject params = new JSONObject(); params.put("verb", 0); <START> params.put("anchor", RelativeLayout.TRUE); <END> final ViewVisitor layoutVisitor = new ViewVisitor.LayoutSetVisitor(mRelativeLayoutButtonPath, params); layoutVisitor.visit(mRootView); RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) mRootView.mRelativeLayoutButton.getLayoutParams(); int[] rules = layoutParams.getRules(); assertEquals(rules[0], -1); }</code><technical_language>discussed making this a class final members, verb anchor</technical_language>

Target:
public void testLayoutVisitor () { ViewVisitor.LayoutRule params = new ViewVisitor.LayoutRule(0, RelativeLayout.TRUE); final ViewVisitor layoutVisitor = new ViewVisitor.LayoutUpdateVisitor(mRelativeLayoutButtonPath, params); layoutVisitor.visit(mRootView); RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) mRootView.mRelativeLayoutButton.getLayoutParams(); int[] rules = layoutParams.getRules(); assertEquals(rules[0], -1); }
Source:
<code>public void testListenSocketAddress() { server = vertx.createHttpServer().requestHandler(noOpHandler()); server.listen(testAddress, onSuccess(server -> { testComplete(); })); <START> <END> await(); }</code><technical_language>a client complete test server request</technical_language>

Target:
public void testListenSocketAddress() { NetClient netClient = vertx.createNetClient(); server = vertx.createHttpServer().requestHandler(req -> req.response().end()); SocketAddress sockAddress = SocketAddress.inetSocketAddress(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST); server.listen(sockAddress, onSuccess(server -> { netClient.connect(sockAddress, onSuccess(sock -> { sock.handler(buf -> { assertTrue("Response is not an http 200", buf.toString("UTF-8").startsWith("HTTP/1.1 200 OK")); testComplete(); }); sock.write("GET / HTTP/1.1\r\n\r\n"); })); })); try { await(); } finally { netClient.close(); } }
Source:
<code><START> static <E,T> Validation<E,T> invalid(E error) { <END> return new Invalid<>(error); }</code><technical_language>Please add a check Objects.requireNonNull(error, "error is null");</technical_language>

Target:
static <E,T> Validation<E,T> invalid(E error) { Objects.requireNonNull(error, "error is null"); return new Invalid<>(error); }
Source:
<code>public RealmConfiguration getSystemDefaultSyncConfiguration() { SyncUser currentUser; try { currentUser = SyncUser.currentUser(); } catch (IllegalStateException e ) { throw new IllegalStateException("Could not create a default sync configuration as " + <START> "multiple users are logged in. Use Realm.getInstance() instead of se", e); <END> } if (currentUser == null) { throw new IllegalStateException("No user is logged in. Login a user using SyncUser.login() first."); } if (cachedDefaultConfiguration != null && !currentUser.equals(cachedDefaultConfiguration.getUser())) { cachedDefaultConfiguration = null; } if (cachedDefaultConfiguration == null) { cachedDefaultConfiguration = new SyncConfiguration.Builder(currentUser, createUrl(currentUser)) .partialRealm() .build(); } return cachedDefaultConfiguration; }</code><technical_language>instead of se</technical_language>

Target:
public RealmConfiguration getSystemDefaultSyncConfiguration() { SyncUser currentUser; try { currentUser = SyncUser.currentUser(); } catch (IllegalStateException e ) { throw new IllegalStateException("Could not create a default sync configuration as " + "multiple users are logged in. Use 'Realm.getInstance()' instead of 'Realm.getDefaultInstance()' " + "in order to specify the specific users configuration." , e); } if (currentUser == null) { throw new IllegalStateException("No user is logged in. Login a user using SyncUser.login() first."); } if (cachedDefaultConfiguration != null && !currentUser.equals(cachedDefaultConfiguration.getUser())) { cachedDefaultConfiguration = null; } if (cachedDefaultConfiguration == null) { cachedDefaultConfiguration = new SyncConfiguration.Builder(currentUser, createUrl(currentUser)) .partialRealm() .build(); } return cachedDefaultConfiguration; }
Source:
<code>TagMatcher matcher(TagCache cache, Repository db, Collection<Ref> include) { include = <START> Lists.newArrayList(Iterators.filter(include.iterator(), <END> new Predicate<Ref>() { @Override public boolean apply(Ref ref) { return !TagSet.skip(ref); } })); TagSet tags = this.tags; if (tags == null) { tags = build(cache, db); } TagMatcher m = new TagMatcher(this, cache, db, include, tags, false); tags.prepare(m); if (!m.newRefs.isEmpty() || !m.lostRefs.isEmpty()) { tags = rebuild(cache, db, tags, m); m = new TagMatcher(this, cache, db, include, tags, true); tags.prepare(m); } return m; }</code><technical_language>I this more readable FluentIterable: include = FluentIterable.of(include).filter(new Predicate<Ref>() { @Override public boolean apply(Ref ref) { return !TagSet.skip(ref); } }).toList();</technical_language>

Target:
TagMatcher matcher(TagCache cache, Repository db, Collection<Ref> include) { include = FluentIterable.from(include).filter(new Predicate<Ref>() { @Override public boolean apply(Ref ref) { return !TagSet.skip(ref); } }).toList(); TagSet tags = this.tags; if (tags == null) { tags = build(cache, db); } TagMatcher m = new TagMatcher(this, cache, db, include, tags, false); tags.prepare(m); if (!m.newRefs.isEmpty() || !m.lostRefs.isEmpty()) { tags = rebuild(cache, db, tags, m); m = new TagMatcher(this, cache, db, include, tags, true); tags.prepare(m); } return m; }
Source:
<code>static AllelicCount createAllelicCountWithVerbosity(final DataLine dataLine, final AllelicCountTableColumn.AllelicCountTableVerbosity verbosity) { final int position = dataLine.getInt(AllelicCountTableColumn.POSITION); final SimpleInterval interval = new SimpleInterval(dataLine.get(AllelicCountTableColumn.CONTIG), position, position); final int refReadCount = dataLine.getInt(AllelicCountTableColumn.REF_COUNT); final int altReadCount = dataLine.getInt(AllelicCountTableColumn.ALT_COUNT); if (verbosity == AllelicCountTableColumn.AllelicCountTableVerbosity.BASIC) { return new AllelicCount(interval, refReadCount, altReadCount); } else { <START> final Nucleotide refNucleotide = Nucleotide.valueOf(dataLine.get(AllelicCountTableColumn.REF_NUCLEOTIDE).getBytes()[0]); <END> final Nucleotide altNucleotide = Nucleotide.valueOf(dataLine.get(AllelicCountTableColumn.ALT_NUCLEOTIDE).getBytes()[0]); final int readDepth = dataLine.getInt(AllelicCountTableColumn.READ_DEPTH); if (verbosity == AllelicCountTableColumn.AllelicCountTableVerbosity.INTERMEDIATE) { return new AllelicCount(interval, refReadCount, altReadCount, refNucleotide, altNucleotide, readDepth); } else { final double hetLogOdds = dataLine.getDouble(AllelicCountTableColumn.HET_LOG_ODDS); return new AllelicCount(interval, refReadCount, altReadCount, refNucleotide, altNucleotide, readDepth, hetLogOdds); } } }</code><technical_language>I name() safe (i.e., in case adds names AllelicCountTableColumn in future, evaluation scripts break unexpectedly)</technical_language>

Target:
static AllelicCount createAllelicCountWithVerbosity(final DataLine dataLine, final AllelicCountTableColumn.AllelicCountTableVerbosity verbosity) { final int position = dataLine.getInt(AllelicCountTableColumn.POSITION); final SimpleInterval interval = new SimpleInterval(dataLine.get(AllelicCountTableColumn.CONTIG), position, position); final int refReadCount = dataLine.getInt(AllelicCountTableColumn.REF_COUNT); final int altReadCount = dataLine.getInt(AllelicCountTableColumn.ALT_COUNT); if (verbosity == AllelicCountTableColumn.AllelicCountTableVerbosity.BASIC) { return new AllelicCount(interval, refReadCount, altReadCount); } else { final Nucleotide refNucleotide = Nucleotide.valueOf(dataLine.get(AllelicCountTableColumn.REF_NUCLEOTIDE.name()).getBytes()[0]); final Nucleotide altNucleotide = Nucleotide.valueOf(dataLine.get(AllelicCountTableColumn.ALT_NUCLEOTIDE.name()).getBytes()[0]); final int readDepth = dataLine.getInt(AllelicCountTableColumn.READ_DEPTH.name()); if (verbosity == AllelicCountTableColumn.AllelicCountTableVerbosity.INTERMEDIATE) { return new AllelicCount(interval, refReadCount, altReadCount, refNucleotide, altNucleotide, readDepth); } else { final double hetLogOdds = dataLine.getDouble(AllelicCountTableColumn.HET_LOG_ODDS.name()); return new AllelicCount(interval, refReadCount, altReadCount, refNucleotide, altNucleotide, readDepth, hetLogOdds); } } }
Source:
<code>public void onResume() { super.onResume(); mPresenter.updateConceptsInDBTextView(); LocalBroadcastManager.getInstance(this.getActivity()).registerReceiver(bReceiver, new IntentFilter(ApplicationConstants.BroadcastActions.CONCEPT_DOWNLOAD_BROADCAST_INTENT_ID)); <START> contactUs(); <END> }</code><technical_language>write this in setUpConceptsView() functions instead</technical_language>

Target:
public void onResume() { super.onResume(); mPresenter.updateConceptsInDBTextView(); LocalBroadcastManager.getInstance(this.getActivity()).registerReceiver(bReceiver, new IntentFilter(ApplicationConstants.BroadcastActions.CONCEPT_DOWNLOAD_BROADCAST_INTENT_ID)); }
Source:
<code>protected void internalReceiveCommand(String itemName, Command command) { logger.debug("internalReceiveCommand() is called!"); for (FreeswitchBindingProvider provider : providers) { FreeswitchBindingConfig config = provider.getFreeswitchBindingConfig(itemName); switch(config.getType()){ case CMD_API:{ if (!(command instanceof StringType)){ <START> logger.error("API commands must be a StringType"); <END> return; } String str = ((StringType) command).toString().toLowerCase(); String response = executeApiCommand(str); eventPublisher.postUpdate(itemName, new StringType(response)); } break; default: break; } } }</code><technical_language>Please enhance log statement provide a comprehensive set of information reduce log level warn. Please slf4j String.format() notation e.g. logger.warn("Could process command '{}' for item '{}'. Freeswitch API commands of type StringType.", command, itemName)</technical_language>

Target:
protected void internalReceiveCommand(String itemName, Command command) { logger.trace("Received command for item '{}' with command '{}'",itemName, command); for (FreeswitchBindingProvider provider : providers) { FreeswitchBindingConfig config = provider.getFreeswitchBindingConfig(itemName); switch(config.getType()){ case CMD_API:{ if (!(command instanceof StringType)){ logger.warn("could not process command '{}' for item '{}': command is not a StringType", command, itemName); return; } String str = ((StringType) command).toString().toLowerCase(); String response = executeApiCommand(str); eventPublisher.postUpdate(itemName, new StringType(response)); } break; default: break; } } }
Source:
<code>public Variable getVariable(final String identifier) { <START> if (identifier == null || identifier.isEmpty()) <END> return null; for (Variable variable : fVariables) { if (identifier.equals(variable.getName())) { return variable; } } return null; }</code><technical_language>remove check, unnecessary</technical_language>

Target:
public Variable getVariable(final String identifier) { for (Variable variable : fVariables) { if (variable.getName().equals(identifier)) return variable; } return null; }
Source:
<code>public ExecutionResult run(String command, File workingDir, Map<String, String> env) throws ToolException, IOException, InterruptedException { String[] commandArray = createCommandArray(command); try { ProcessBuilder pb = fs.runInShell(commandArray[0], Arrays.copyOfRange(commandArray, 1, commandArray.length)); pb.directory(workingDir); Map<String, String> envp = pb.environment(); if (env != null) { envp.putAll(env); } ExecutionResult result = fs.execute(pb, null); int rc = result.getRc(); if (rc != 0) { boolean execError = isCommandExecutionError(rc); if (checkExitCode || execError) { <START> throw new ToolException( new String(result.getStderr().toByteArray()), result, execError); <END> } } return result; } finally { deleteCommandArray(); } }</code><technical_language>IMO dangerous leave caller ask exception for relevant information, standard handle exceptions is log message stack trace (and else). caller log relevant information. I knowledge JGit though, e.g. if expected caller asks exception for properties</technical_language>

Target:
public ExecutionResult run(String command, File workingDir, Map<String, String> env) throws ToolException, IOException, InterruptedException { String[] commandArray = createCommandArray(command); try { ProcessBuilder pb = fs.runInShell(commandArray[0], Arrays.copyOfRange(commandArray, 1, commandArray.length)); pb.directory(workingDir); Map<String, String> envp = pb.environment(); if (env != null) { envp.putAll(env); } ExecutionResult result = fs.execute(pb, null); int rc = result.getRc(); if (rc != 0) { boolean execError = isCommandExecutionError(rc); if (checkExitCode || execError) { throw new ToolException( "JGit: tool execution return code: " + rc + "\n" + "checkExitCode: " + checkExitCode + "\n" + "execError: " + execError + "\n" + "stderr: \n" + new String( result.getStderr().toByteArray()), result, execError); } } return result; } finally { deleteCommandArray(); } }
Source:
<code>public void testSearchFirewallPolicies() { firewallPolicyList.add(createFirewallPolicy()); firewallPolicyList.add(createFirewallPolicy()); List<FirewallPolicyMetadata> firewallPolicyMetadataList = firewallPolicyService.find( new FirewallPolicyFilter().dataCenters(DataCenter.DE_FRANKFURT) ); assertNotNull(firewallPolicyMetadataList); assertEquals(firewallPolicyMetadataList.size(), 2); <START> FirewallPolicyMetadata firewallPolicy1Metadata = firewallPolicyService.findByRef(firewallPolicyList.get(0)); <END> assertNotNull(firewallPolicy1Metadata); }</code><technical_language>please add checking for search criteria (assert data center is Frankfurt) great search policies others criteria (source, destination, ports etc)</technical_language>

Target:
public void testSearchFirewallPolicies() { firewallPolicyList.add(createFirewallPolicy()); firewallPolicyList.add(createFirewallPolicy()); List<FirewallPolicyMetadata> firewallPolicyMetadataList = firewallPolicyService.find( new FirewallPolicyFilter().dataCenters(DataCenter.DE_FRANKFURT) ); assertNotNull(firewallPolicyMetadataList); assertEquals(firewallPolicyMetadataList.size(), 2); assertEquals(firewallPolicyMetadataList.get(0).getDataCenterId(), DataCenter.DE_FRANKFURT.getId()); assertEquals(firewallPolicyMetadataList.get(1).getDataCenterId(), DataCenter.DE_FRANKFURT.getId()); FirewallPolicyMetadata firewallPolicy1Metadata = firewallPolicyService.findByRef(firewallPolicyList.get(0)); assertNotNull(firewallPolicy1Metadata); assertEquals(firewallPolicy1Metadata.getDataCenterId(), DataCenter.DE_FRANKFURT.getId()); }
Source:
<code>public static void endRequest(HttpRequest request) { if (IS_DEBUGGING_ENABLED) { <START> logEvent(EventType.END_PAGE, request); <END> lastRequestLogEvents = LOG_EVENTS.get(); REQUEST_ID.remove(); SEQUENCE_ID.remove(); LOG_EVENTS.remove(); } }</code><technical_language>This "END_REQUEST" I</technical_language>

Target:
public static void endRequest(HttpRequest request) { if (IS_DEBUGGING_ENABLED) { logEvent(EventType.END_REQUEST, request); lastRequestLogEvents = LOG_EVENTS.get(); REQUEST_ID.remove(); SEQUENCE_ID.remove(); LOG_EVENTS.remove(); } }
Source:
<code>boolean getBackgroundImageZoomIn() { <START> boolean on = settings.getBoolean("zoominBackgroundImage", false); <END> if (slideshowStyle == SLIDESHOW_STYLE_ANIMATED) { on = true; setBackgroundZoomIn(true); setSlideShowStyle(SLIDESHOW_STYLE_CENTER); } return on; }</code><technical_language>In order group settings I rename preferences backgroundImageFadeIn backgroundImageMoveIn backgroundImageZoomIn In export together</technical_language>

Target:
boolean getBackgroundImageZoomIn() { boolean on = settings.getBoolean("backgroundImageZoomIn", false); if (slideshowStyle == SLIDESHOW_STYLE_ANIMATED) { on = true; setBackgroundZoomIn(true); setSlideShowStyle(SLIDESHOW_STYLE_CENTER); } return on; }
Source:
<code><START> protected OAuthRequest createAccessTokenRequest(AccessTokenRequestParams params) { <END> final OAuthRequest request = new OAuthRequest(getApi().getAccessTokenVerb(), getApi().getAccessTokenEndpoint()); getApi().getClientAuthentication().addClientAuthentication(request, getApiKey(), getApiSecret()); request.addBodyParameter(OAuthConstants.CODE, params.getCode()); final String callback = getCallback(); if (callback != null) { request.addBodyParameter(OAuthConstants.REDIRECT_URI, callback); } request.addBodyParameter(OAuthConstants.GRANT_TYPE, OAuthConstants.AUTHORIZATION_CODE); final String pkceCodeVerifier = params.getPkceCodeVerifier(); if (pkceCodeVerifier != null) { request.addBodyParameter(PKCE.PKCE_CODE_VERIFIER_PARAM, pkceCodeVerifier); } if (isDebug()) { log("created access token request with body params [%s], query string params [%s]", request.getBodyParams().asFormUrlEncodedString(), request.getQueryStringParams().asFormUrlEncodedString()); } return request; }</code><technical_language>This override is unneeded. diff is "request.addBodyParameter" instead of "request.addParameter". override getAccessTokenVerb in API. POST default. "request.addParameter" invoke "request.addBodyParameter" inside. ps.The diff is questionable. skipped setting OAuthConstants.SCOPE parameter. why</technical_language>

Target:
protected OAuthRequest createAccessTokenRequest(AccessTokenRequestParams params) { final OAuthRequest request = new OAuthRequest(getApi().getAccessTokenVerb(), getApi().getAccessTokenEndpoint()); getApi().getClientAuthentication().addClientAuthentication(request, getApiKey(), getApiSecret()); request.addParameter(OAuthConstants.CODE, params.getCode()); final String callback = getCallback(); if (callback != null) { request.addParameter(OAuthConstants.REDIRECT_URI, callback); } request.addParameter(OAuthConstants.GRANT_TYPE, OAuthConstants.AUTHORIZATION_CODE); final String pkceCodeVerifier = params.getPkceCodeVerifier(); if (pkceCodeVerifier != null) { request.addParameter(PKCE.PKCE_CODE_VERIFIER_PARAM, pkceCodeVerifier); } if (isDebug()) { log("created access token request with body params [%s], query string params [%s]", request.getBodyParams().asFormUrlEncodedString(), request.getQueryStringParams().asFormUrlEncodedString()); } return request; }
Source:
<code>public Observable<Void> shutdown() { <START> return delegateRegistry.shutdown(); <END> }</code><technical_language>shutdown for batchingRegistryAlso</technical_language>

Target:
public Observable<Void> shutdown() { remoteBatchingRegistry.shutdown(); return delegateRegistry.shutdown(); }
Source:
<code>public void initialize(String file) throws ServiceException, IOException { <START> RandomAccessInputStream jpegFile = new RandomAccessInputStream(file); <END> try { Metadata metadata = ImageMetadataReader.readMetadata(jpegFile); directory = metadata.getFirstDirectoryOfType(ExifSubIFDDirectory.class); } catch (Throwable e) { jpegFile.close(); throw new ServiceException("Could not read EXIF data", e); } }</code><technical_language>This simplified a [try-with-resources](<LINK_0> statement, removing final .close() call</technical_language>

Target:
public void initialize(String file) throws ServiceException, IOException { try (RandomAccessInputStream jpegFile = new RandomAccessInputStream(file)) { try { Metadata metadata = ImageMetadataReader.readMetadata(jpegFile); directory = metadata.getFirstDirectoryOfType(ExifSubIFDDirectory.class); } catch (Throwable e) { throw new ServiceException("Could not read EXIF data", e); } } }
Source:
<code>protected void initSelectedType() { Integer selectedNicType = getNic().getType(); ArrayList<VmInterfaceType> nicTypes = (ArrayList<VmInterfaceType>) getNicType().getItems(); nicTypes = nicTypes == null ? new ArrayList<VmInterfaceType>() : nicTypes; if (selectedNicType == null || !nicTypes.contains(VmInterfaceType.forValue(selectedNicType))) { <START> selectedNicType = AsyncDataProvider.getDefaultNicType(nicTypes).getValue(); <END> } getNicType().setSelectedItem(VmInterfaceType.forValue(selectedNicType)); }</code><technical_language>well, getDefaultNicType returns null fail NPE here</technical_language>

Target:
protected void initSelectedType() { VmInterfaceType selectedNicType = VmInterfaceType.forValue(getNic().getType()); ArrayList<VmInterfaceType> nicTypes = (ArrayList<VmInterfaceType>) getNicType().getItems(); nicTypes = nicTypes == null ? new ArrayList<VmInterfaceType>() : nicTypes; if (selectedNicType == null || !nicTypes.contains(selectedNicType)) { selectedNicType = AsyncDataProvider.getDefaultNicType(nicTypes); } getNicType().setSelectedItem(selectedNicType); }
Source:
<code>@Override public SqlNode getCastSpec(final RelDataType type) { if (type instanceof BasicSqlType) { <START> SqlUserDefinedTypeNameSpec typeNameSpec; <END> switch (type.getSqlTypeName()) { case BIGINT: return createSqlDataTypeSpecByName("INT64"); case DOUBLE: return createSqlDataTypeSpecByName("FLOAT64"); case DECIMAL: return createSqlDataTypeSpecByName("NUMERIC"); case BOOLEAN: return createSqlDataTypeSpecByName("BOOL"); case VARCHAR: return createSqlDataTypeSpecByName("STRING"); case VARBINARY: return createSqlDataTypeSpecByName("BYTES"); case DATE: return createSqlDataTypeSpecByName("DATE"); case TIME: return createSqlDataTypeSpecByName("TIME"); case TIMESTAMP: return createSqlDataTypeSpecByName("TIMESTAMP"); } } return super.getCastSpec(type); }</code><technical_language>This removed</technical_language>

Target:
@Override public SqlNode getCastSpec(final RelDataType type) { if (type instanceof BasicSqlType) { switch (type.getSqlTypeName()) { case BIGINT: return createSqlDataTypeSpecByName("INT64"); case DOUBLE: return createSqlDataTypeSpecByName("FLOAT64"); case DECIMAL: return createSqlDataTypeSpecByName("NUMERIC"); case BOOLEAN: return createSqlDataTypeSpecByName("BOOL"); case VARCHAR: return createSqlDataTypeSpecByName("STRING"); case VARBINARY: return createSqlDataTypeSpecByName("BYTES"); case DATE: return createSqlDataTypeSpecByName("DATE"); case TIME: return createSqlDataTypeSpecByName("TIME"); case TIMESTAMP: return createSqlDataTypeSpecByName("TIMESTAMP"); } } return super.getCastSpec(type); }
Source:
<code>protected void listDeployments(CommandContext ctx, boolean l) throws CommandFormatException { if(!l) { printList(ctx, Util.getDeployments(ctx.getModelControllerClient()), l); return; } final ModelControllerClient client = ctx.getModelControllerClient(); final List<String> names = Util.getDeployments(client); if(names.isEmpty()) { return; } final StrictSizeTable table = new StrictSizeTable(names.size()); try { final List<Property> descriptions = getDeploymentDescriptions(ctx, names).asPropertyList(); for(Property prop : descriptions) { final ModelNode step = prop.getValue(); if(step.hasDefined(Util.RESULT)) { final ModelNode result = step.get(Util.RESULT); table.addCell(Util.NAME, result.get(Util.NAME).asString()); table.addCell(Util.RUNTIME_NAME, result.get(Util.RUNTIME_NAME).asString()); if(result.has(Util.ENABLED)) { table.addCell(Util.ENABLED, result.get(Util.ENABLED).asString()); } if(result.has(Util.STATUS)) { table.addCell(Util.STATUS, result.get(Util.STATUS).asString()); } } if(!table.isAtLastRow()) { table.nextRow(); } } ctx.printLine(table.toString()); <START> } catch (Exception e) { <END> throw new CommandFormatException(table.toString()); } }</code><technical_language>Do need catch exception there</technical_language>

Target:
protected void listDeployments(CommandContext ctx, boolean l) throws CommandFormatException { if(!l) { printList(ctx, Util.getDeployments(ctx.getModelControllerClient()), l); return; } final ModelControllerClient client = ctx.getModelControllerClient(); final List<String> names = Util.getDeployments(client); if(names.isEmpty()) { return; } final StrictSizeTable table = new StrictSizeTable(names.size()); final List<Property> descriptions = getDeploymentDescriptions(ctx, names).asPropertyList(); for(Property prop : descriptions) { final ModelNode step = prop.getValue(); if(step.hasDefined(Util.RESULT)) { final ModelNode result = step.get(Util.RESULT); table.addCell(Util.NAME, result.get(Util.NAME).asString()); table.addCell(Util.RUNTIME_NAME, result.get(Util.RUNTIME_NAME).asString()); if(result.has(Util.ENABLED)) { table.addCell(Util.ENABLED, result.get(Util.ENABLED).asString()); } if(result.has(Util.STATUS)) { table.addCell(Util.STATUS, result.get(Util.STATUS).asString()); } } if(!table.isAtLastRow()) { table.nextRow(); } } ctx.printLine(table.toString()); }
Source:
<code>public void createPartControl(Composite parent) { fTree = new Tree(parent, SWT.NONE); TreeColumn nameCol = new TreeColumn(fTree, SWT.NONE, 0); TreeColumn valueCol = new TreeColumn(fTree, SWT.NONE, 1); <START> nameCol.setText("Synchronization Information"); END> valueCol.setText("Value"); fTree.setItemCount(0); fTree.setHeaderVisible(true); nameCol.pack(); valueCol.pack(); }</code><technical_language>externalize</technical_language>

Target:
public void createPartControl(Composite parent) { fTree = new Tree(parent, SWT.NONE); TreeColumn nameCol = new TreeColumn(fTree, SWT.NONE, 0); TreeColumn valueCol = new TreeColumn(fTree, SWT.NONE, 1); nameCol.setText(Messages.TmfSynchronizationView_NameColumn); valueCol.setText(Messages.TmfSynchronizationView_ValueColumn); fTree.setItemCount(0); fTree.setHeaderVisible(true); nameCol.pack(); valueCol.pack(); }
Source:
<code>public String getToken() { <START> Random randomSize = new Random(); <END> int randomByteSize = randomSize.nextInt(251) + 5; ByteBuffer byteBuffer = ByteBuffer.allocate(randomByteSize); SecureRandom secureRandom = new SecureRandom(); secureRandom.ints(Byte.MIN_VALUE, Byte.MAX_VALUE).limit(randomByteSize).forEach((randInt) -> byteBuffer.put((byte) randInt)); byte[] randomBytes = byteBuffer.array(); byte[] xoredCsrf = xorCsrf(randomBytes, Utf8.encode(this.token)); ByteBuffer combinedBuffer = ByteBuffer.allocate(randomByteSize + xoredCsrf.length); combinedBuffer.put(randomBytes); combinedBuffer.put(xoredCsrf); return Base64.getEncoder().encodeToString(combinedBuffer.array()); }</code><technical_language>I is reason a random size. explain a random size helps</technical_language>

Target:
public String getToken() { return this.token; }
Source:
<code>public void testSubSelectWhere() throws Exception { setup.setUpCharacters(); execute("select id, name " + "from (select * from characters where female = true) as ch " + "where name like 'Arthur'"); assertThat(printedTable(response.rows()), is("4| Arthur\n")); <START> assertThat(printedTable(response.rows()), <END> is("4| Arthur\n")); }</code><technical_language>This is redundant</technical_language>

Target:
public void testSubSelectWhere() throws Exception { setup.setUpCharacters(); execute("select id, name " + "from (select * from characters where female = true) as ch " + "where name like 'Arthur'"); assertThat(printedTable(response.rows()), is("4| Arthur\n")); }
Source:
<code>static int calculateBlockResetBytes(int currentBytes) { long newBytes = (long) ceil(currentBytes * BLOCK_RESET_SKEW); if (newBytes > Integer.MAX_VALUE) { <START> return Integer.MAX_VALUE; <END> } return (int) newBytes; }</code><technical_language>MAX_ARRAY_SIZE instead. This concept is new Presto. MAX_ARRAY_SIZE in BlockUtil. -8, copied ArrayList.MAX_ARRAY_SIZE</technical_language>

Target:
static int calculateBlockResetBytes(int currentBytes) { long newBytes = (long) ceil(currentBytes * BLOCK_RESET_SKEW); if (newBytes > MAX_ARRAY_SIZE) { return MAX_ARRAY_SIZE; } return (int) newBytes; }
Source:
<code>protected void onResume() { super.onResume(); Fragment currentFragment = getSupportFragmentManager().findFragmentById(R.id.container); <START> if (currentFragment instanceof SearchFragment) { <END> mNavigationView.setCheckedItem(R.id.item_dashboard); } else if (currentFragment instanceof ClientListFragment) { mNavigationView.setCheckedItem(R.id.item_clients); } else if (currentFragment instanceof GroupsListFragment) { mNavigationView.setCheckedItem(R.id.item_groups); } else if (currentFragment instanceof CenterListFragment) { mNavigationView.setCheckedItem(R.id.item_centers); } else if (currentFragment instanceof OfflineDashboardFragment) { mNavigationView.setCheckedItem(R.id.item_offline); } }</code><technical_language>switch instead</technical_language>

Target:
protected void onResume() { super.onResume(); String currentFragment = getSupportFragmentManager().findFragmentById(R.id.container) .getClass().getSimpleName(); switch (currentFragment) { case "SearchFragment": mNavigationView.setCheckedItem(R.id.item_dashboard); break; case "ClientListFragment": mNavigationView.setCheckedItem(R.id.item_clients); break; case "GroupsListFragment": mNavigationView.setCheckedItem(R.id.item_groups); break; case "CenterListFragment": mNavigationView.setCheckedItem(R.id.item_centers); break; case "OfflineDashboardFragment": mNavigationView.setCheckedItem(R.id.item_offline); } }
Source:
<code>public static <T> void decodeNullable(ClientMessage.ForwardFrameIterator iterator, Function<ClientMessage.ForwardFrameIterator, T> decodeFunction, Consumer<T> consumer) { <START> if (nextFrameIsNullEndFrame(iterator)) { <END> decode(iterator, decodeFunction, consumer); } }</code><technical_language>if(! nextFrameIsNullEndFrame)</technical_language>

Target:
public static <T> void decodeNullable(ClientMessage.ForwardFrameIterator iterator, Function<ClientMessage.ForwardFrameIterator, T> decodeFunction, Consumer<T> consumer) { if (!nextFrameIsNullEndFrame(iterator)) { decode(iterator, decodeFunction, consumer); } }
Source:
<code>int calculateReplicationFactorForDC(List<HostToken> allHostTokens, String dataCenter) { Map<Long, Integer> groups = new HashMap<>(); Set<HostToken> uniqueHostTokens = new HashSet<>(allHostTokens); if (dataCenter == null) { if(localRack != null) { dataCenter = localRack.substring(0, localRack.length() - 1); } } for (HostToken hostToken: uniqueHostTokens) { <START> if(dataCenter == null || hostToken.getHost().getRack().contains(dataCenter)) { <END> Long token = hostToken.getToken(); if (groups.containsKey(token)) { int current = groups.get(token); groups.put(token, current + 1); } else { groups.put(token, 1); } } } Set<Integer> uniqueCounts = new HashSet<>(groups.values()); if (uniqueCounts.size() > 1) { throw new RuntimeException("Invalid configuration - replication factor cannot be asymmetric"); } int rf = uniqueCounts.toArray(new Integer[uniqueCounts.size()])[0]; if (rf > 3) { logger.warn("Replication Factor is high: " + uniqueHostTokens); } return rf; }</code><technical_language>This block of code wants obtain hosts belong in a specific datacenter. adding 'dataCenter == null' check, datacenters added 'groups' map? If correct, more sense set a default DC 'else' condition 'if' statement in L398</technical_language>

Target:
int calculateReplicationFactorForDC(List<HostToken> allHostTokens, String dataCenter) { Map<Long, Integer> groups = new HashMap<>(); Set<HostToken> uniqueHostTokens = new HashSet<>(allHostTokens); if (dataCenter == null) { if(localRack != null) { dataCenter = localRack.substring(0, localRack.length() - 1); } else { dataCenter = allHostTokens.get(0).getHost().getRack().substring(0, localRack.length() - 1); } } for (HostToken hostToken: uniqueHostTokens) { if(hostToken.getHost().getRack().contains(dataCenter)) { Long token = hostToken.getToken(); if (groups.containsKey(token)) { int current = groups.get(token); groups.put(token, current + 1); } else { groups.put(token, 1); } } } Set<Integer> uniqueCounts = new HashSet<>(groups.values()); if (uniqueCounts.size() > 1) { throw new RuntimeException("Invalid configuration - replication factor cannot be asymmetric"); } int rf = uniqueCounts.toArray(new Integer[uniqueCounts.size()])[0]; if (rf > 3) { logger.warn("Replication Factor is high: " + uniqueHostTokens); } return rf; }
Source:
<code>public boolean blockInteract(GlowPlayer player, GlowBlock block, BlockFace face, Vector clickedLoc) { GlowBlockState state = block.getState(); MaterialData data = state.getData(); if (!(data instanceof FlowerPot)) { warnMaterialData(FlowerPot.class, data); return false; } if (state instanceof GlowFlowerPot) { GlowFlowerPot pot = (GlowFlowerPot) state; if (pot.getContents() == null) { pot.setContents(player.getItemInHand().getData().clone()); <START> pot.update(); <END> return true; } } return false; }</code><technical_language>update method overriden inTEFlowerPot, this currently nothing</technical_language>

Target:
public boolean blockInteract(GlowPlayer player, GlowBlock block, BlockFace face, Vector clickedLoc) { GlowBlockState state = block.getState(); MaterialData data = state.getData(); if (!(data instanceof FlowerPot)) { warnMaterialData(FlowerPot.class, data); return false; } if (state instanceof GlowFlowerPot) { GlowFlowerPot pot = (GlowFlowerPot) state; ItemStack heldItem = player.getItemInHand(); if (pot.getContents() == null && heldItem != null && isValidContents(heldItem.getData())) { pot.setContents(heldItem.getData().clone()); return pot.update(); } } return false; }
Source:
<code>private static void findFiles(IResource resource, List<IResource> files) throws CoreException { if (resource instanceof IFile) { files.add(resource); return; } if (resource instanceof IContainer) { for (IResource <START> resource1 : <END> ((IContainer) resource).members()) { findFiles(resource1, files); } } }</code><technical_language>rename res</technical_language>

Target:
private static void findFiles(IResource resource, List<IResource> files) throws CoreException { if (resource instanceof IFile) { files.add(resource); return; } if (resource instanceof IContainer) { for (IResource res : ((IContainer) resource).members()) { findFiles(res, files); } } }
Source:
<code>public IStatus validate(IProject project, String path) { File file = new File(path); if (!file.exists()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "File not found: " + path); } if (!file.isFile()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Not a file. It's a directory: " + path); } int confidence = 0; try { if (!TmfTraceUtils.isText(file)) { return new TraceValidationStatus(confidence, Activator.PLUGIN_ID); } } catch (IOException e) { Activator.getInstance().logError("Error validating file: " + path, e); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "IOException validating file: " + path, e); } try (BufferedRandomAccessFile rafile = new BufferedRandomAccessFile(path, "r")) { int lineCount = 0; int matches = 0; String line = readNextEventString(() -> (char) rafile.read()); while ((line != null) && (lineCount++ < MAX_LINES)) { try { TraceEventField field = TraceEventEvent.parseJson(line); if (field != null) { matches++; } } catch (RuntimeException e) { confidence = Integer.MIN_VALUE; } confidence = MAX_CONFIDENCE * matches / lineCount; line = readNextEventString(() -> (char) rafile.read()); } <START> if(matches == 0) { <END> return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Most assuredly NOT a traceevevnt trace"); } } catch (IOException e) { Activator.getInstance().logError("Error validating file: " + path, e); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "IOException validating file: " + path, e); } return new TraceValidationStatus(confidence, Activator.PLUGIN_ID); }</code><technical_language>whitespace :(</technical_language>

Target:
public IStatus validate(IProject project, String path) { File file = new File(path); if (!file.exists()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "File not found: " + path); } if (!file.isFile()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Not a file. It's a directory: " + path); } int confidence = 0; try { if (!TmfTraceUtils.isText(file)) { return new TraceValidationStatus(confidence, Activator.PLUGIN_ID); } } catch (IOException e) { Activator.getInstance().logError("Error validating file: " + path, e); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "IOException validating file: " + path, e); } try (BufferedRandomAccessFile rafile = new BufferedRandomAccessFile(path, "r")) { int lineCount = 0; int matches = 0; String line = readNextEventString(() -> (char) rafile.read()); while ((line != null) && (lineCount++ < MAX_LINES)) { try { TraceEventField field = TraceEventEvent.parseJson(line); if (field != null) { matches++; } } catch (RuntimeException e) { confidence = Integer.MIN_VALUE; } confidence = MAX_CONFIDENCE * matches / lineCount; line = readNextEventString(() -> (char) rafile.read()); } if (matches == 0) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Most assuredly NOT a traceevent trace"); } } catch (IOException e) { Activator.getInstance().logError("Error validating file: " + path, e); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "IOException validating file: " + path, e); } return new TraceValidationStatus(confidence, Activator.PLUGIN_ID); }
Source:
<code>private Map<String, String> getStatementSessionProperties() { if (queryTimeoutSeconds.get() > 0) { String queryTimeoutDuration = queryTimeoutSeconds.longValue() + "s"; <START> PrestoConnection.checkSessionProperty(QUERY_MAX_RUN_TIME, queryTimeoutDuration); <END> return ImmutableMap.of(QUERY_MAX_RUN_TIME, queryTimeoutDuration); } return ImmutableMap.of(); }</code><technical_language>This check needed for a property setting</technical_language>

Target:
private Map<String, String> getStatementSessionProperties() { ImmutableMap.Builder<String, String> sessionProperties = ImmutableMap.builder(); if (queryTimeoutSeconds.get() > 0) { sessionProperties.put("query_max_run_time", queryTimeoutSeconds.longValue() + "s"); } return sessionProperties.build(); }
Source:
<code><START> protected OpenstackImageProviderProxy getProviderProxy() { <END> if (providerProxy == null) { StorageDomain storageDomain = DbFacade.getInstance().getStorageDomainDao().get( getEnclosingCommand().getParameters().getSourceStorageDomainId()); Provider provider = DbFacade.getInstance().getProviderDao().get(new Guid(storageDomain.getStorage())); providerProxy = ProviderProxyFactory.getInstance().create(provider); } return providerProxy; }</code><technical_language>1. consider exported a helper class, this code in places ImportRepoImageCommand 2. get StorageDomainStatic, lighter query involves joins - unlink getStorageDomain 3. consider pass provider in parameters</technical_language>

Target:
protected OpenstackImageProviderProxy getProviderProxy() { if (providerProxy == null) { providerProxy = OpenstackImageProviderProxy .getFromStorageDomainId(getEnclosingCommand().getParameters().getSourceStorageDomainId()); } return providerProxy; }
Source:
<code>private void checkIndexRebuild(String cacheName, boolean rebuild) { String idxSql = "SELECT IS_INDEX_REBUILD_IN_PROGRESS FROM " + systemSchemaName() + ".TABLES " + "WHERE TABLE_NAME='" + cacheName + "'"; <START> List<List<?>> res = execSql(grid(), idxSql); <END> assertFalse(res.isEmpty()); assertTrue(res.stream().allMatch(row -> { assertEquals(1, row.size()); Boolean isIndexRebuildInProgress = (Boolean)row.get(0); return isIndexRebuildInProgress == rebuild; })); }</code><technical_language>query arguments instead of dynamic query build "SELECT IS_INDEX_REBUILD_IN_PROGRESS " + systemSchemaName() + ".TABLES TABLE_NAME =</technical_language>

Target:
private void checkIndexRebuild(String cacheName, boolean rebuild) { String idxSql = "SELECT IS_INDEX_REBUILD_IN_PROGRESS FROM " + systemSchemaName() + ".TABLES " + "WHERE TABLE_NAME = ?"; List<List<?>> res = execSql(grid(), idxSql, cacheName); assertFalse(res.isEmpty()); assertTrue(res.stream().allMatch(row -> { assertEquals(1, row.size()); Boolean isIndexRebuildInProgress = (Boolean)row.get(0); return isIndexRebuildInProgress == rebuild; })); }
Source:
<code>public void setControllerRoute( IPathItem fast, boolean zeroOut ) { if( zeroOut ) { <START> this.usedChannels &= ~0xffffffff; <END> } int idx = this.connections.indexOf( fast ); if( idx > 0 ) { this.connections.remove( fast ); this.connections.add( 0, (IGridConnection) fast ); } }</code><technical_language>yes, I ~</technical_language>

Target:
public void setControllerRoute( IPathItem fast, boolean zeroOut ) { if( zeroOut ) { this.usedChannels = 0; } int idx = this.connections.indexOf( fast ); if( idx > 0 ) { this.connections.remove( fast ); this.connections.add( 0, (IGridConnection) fast ); } }
Source:
<code>public static synchronized boolean isWordPressCom(URL url) { if (url == null) { return false; } <START> return url.getHost().endsWith(".wordpress.com") || url.getHost().equals("wordpress.com"); <END> }</code><technical_language>routines check getHost() is null string comparison</technical_language>

Target:
public static boolean isWordPressCom(URL url) { if (url == null) { return false; } return url.getHost().endsWith(".wordpress.com") || url.getHost().equals("wordpress.com"); }