auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static Map<Long, Long> fetchExecutionIds(ZephyrConfigModel zephyrData) { final Map<Long, Long> issueKeyExecutionIdMap = new HashMap<Long, Long>(); final String executionsURL = String.format(URL_CREATE_EXECUTIONS_URL, zephyrData.getRestClient().getUrl(), zephyrData.getProjectId(), zephyrData.getVersionId(), zephyrData.getCycleId()); final CloseableHttpResponse response = zephyrData.getRestClient().get(executionsURL); final int statusCode = response.getStatusLine().getStatusCode(); if (statusCode >= 200 && statusCode < 300) { final HttpEntity entity = response.getEntity(); String string = null; try { string = EntityUtils.toString(entity); } catch (IOException e) { ZephyrPlugin.log(e); } final JsonObject executionObject = new JsonParser().parse(string).getAsJsonObject(); final JsonArray executions = executionObject.get("executions").getAsJsonArray(); for (int i = 0; i < executions.size(); i++) { final JsonObject execution = executions.get(i).getAsJsonObject(); final long issueKey = execution.get("issueId").getAsLong(); final long executionId = execution.get("id").getAsLong(); issueKeyExecutionIdMap.put(issueKey, executionId); } } else { ZephyrPlugin.log("Unexpected response status: " + statusCode); } if (response != null) { try { response.close(); } catch (IOException e) { ZephyrPlugin.log(e); } } return issueKeyExecutionIdMap; }

Target:
private static Map<Long, Long> fetchExecutionIds(ZephyrConfigModel zephyrData) { final Map<Long, Long> issueKeyExecutionIdMap = new HashMap<Long, Long>(); final String url = String.format(URL_CREATE_EXECUTIONS_URL, zephyrData.getRestClient().getUrl(), zephyrData.getProjectId(), zephyrData.getVersionId(), zephyrData.getCycleId()); try (final CloseableHttpResponse response = zephyrData.getRestClient().get(url)) { final int statusCode = response.getStatusLine().getStatusCode(); if (statusCode >= 200 && statusCode < 300) { final HttpEntity entity = response.getEntity(); String string = null; try { string = EntityUtils.toString(entity); } catch (IOException e) { throw new IllegalArgumentException( String.format("Bad response entity upon receipt of execution ids <%s>", url), e); } final JsonObject executionObject = new JsonParser().parse(string).getAsJsonObject(); final JsonArray executions = executionObject.get("executions").getAsJsonArray(); for (int i = 0; i < executions.size(); i++) { final JsonObject execution = executions.get(i).getAsJsonObject(); final long issueKey = execution.get("issueId").getAsLong(); final long executionId = execution.get("id").getAsLong(); issueKeyExecutionIdMap.put(issueKey, executionId); } } else { throw new IllegalArgumentException(String .format("Unexpected response status <%s> upon receipt of execution ids <%s>", statusCode, url)); } } catch (IOException e) { throw new IllegalArgumentException(e); } return issueKeyExecutionIdMap; }
Source:
private void processCaches(Document doc, Element parent, Jsr107Configuration configuration) { Map<String, String> cacheMap = configuration.getTemplates(); if (!cacheMap.isEmpty()) { cacheMap.forEach((k, v) -> { Element cacheElement = doc.createElement(JSR_NAMESPACE_PREFIX + COLON + CACHE_ELEMENT_NAME); cacheElement.setAttribute(CACHE_NAME_ATTRIBUTE, k); cacheElement.setAttribute(TEMPLATE_NAME_ATTRIBUTE, v); parent.appendChild(cacheElement); }); } }

Target:
private void processCaches(Document doc, Element parent, Jsr107Configuration configuration) { Map<String, String> cacheMap = configuration.getTemplates(); cacheMap.forEach((k, v) -> { Element cacheElement = doc.createElement(JSR_NAMESPACE_PREFIX + COLON + CACHE_ELEMENT_NAME); cacheElement.setAttribute(CACHE_NAME_ATTRIBUTE, k); cacheElement.setAttribute(TEMPLATE_NAME_ATTRIBUTE, v); parent.appendChild(cacheElement); }); }
Source:
public void testCloneValues() { PhysicsObject originPhysicsObject = world.getPhysicsObject(sprite); Sprite cloneSprite = new Sprite("Clone"); PhysicsLook cloneLook = new PhysicsLook(cloneSprite, world); PhysicsObject clonePhysicsObject = world.getPhysicsObject(cloneSprite); physicsLook.setXInUserInterfaceDimensionUnit(10); physicsLook.setBrightnessInUserInterfaceDimensionUnit(32); originPhysicsObject.setMass(20); physicsLook.copyTo(cloneLook); assertEquals(physicsLook.getXInUserInterfaceDimensionUnit(), cloneLook.getXInUserInterfaceDimensionUnit()); assertEquals(physicsLook.getBrightnessInUserInterfaceDimensionUnit(), cloneLook.getBrightnessInUserInterfaceDimensionUnit()); assertEquals(originPhysicsObject.getMass(), clonePhysicsObject.getMass()); }

Target:
public void testCloneValues() { Sprite cloneSprite = mock(Sprite.class); PhysicsObject clonePhysicsObject = mock(PhysicsObject.class); when(physicsWorldSpy.getPhysicsObject(cloneSprite)).thenReturn(clonePhysicsObject); PhysicsLook cloneLook = new PhysicsLook(cloneSprite, physicsWorldSpy); PhysicsWorld.activeArea = new Vector2(0.0f, 0.0f); when(clonePhysicsObject.getMassCenter()).thenReturn(new Vector2(0.0f, 0.0f)); when(clonePhysicsObject.getCircumference()).thenReturn(0.0f); physicsLook.setBrightnessInUserInterfaceDimensionUnit(32); physicsLook.copyTo(cloneLook); assertEquals(physicsLook.getBrightnessInUserInterfaceDimensionUnit(), cloneLook.getBrightnessInUserInterfaceDimensionUnit()); verify(physicsObject, times(1)).copyTo(clonePhysicsObject); }
Source:
default <R> Option<R> collect(PartialFunction<? super T, ? extends R> partialFunction){ Objects.requireNonNull(partialFunction, "partialFunction is null"); final Option<T> valueInDomain = filter(partialFunction::isDefinedAt); return valueInDomain.isEmpty() ? none(): some(partialFunction.apply(valueInDomain.get())); }

Target:
default <R> Option<R> collect(PartialFunction<? super T, ? extends R> partialFunction) { Objects.requireNonNull(partialFunction, "partialFunction is null"); return filter(partialFunction::isDefinedAt).map(partialFunction::apply); }
Source:
public TestStreamingClient startWithAutocommit(final Consumer<List<StreamBatch>> batchesListener) throws InterruptedException { this.batchesListener = batchesListener; final TestStreamingClient client = startInternal(true); final Thread autocommitThread = new Thread(() -> { int oldIdx = 0; while (client.isRunning()) { while (oldIdx < client.getBatches().size()) { final StreamBatch batch = client.getBatches().get(oldIdx); if (batch.getEvents() != null && !batch.getEvents().isEmpty()) { try { final SubscriptionCursor cursor = batch.getCursor(); final int responseCode = NakadiTestUtils.commitCursors( client.subscriptionId, Collections.singletonList(batch.getCursor()), client.getSessionId()); System.out.println("Committing " + responseCode + ": " + cursor); } catch (JsonProcessingException e) { throw new RuntimeException(e); } } oldIdx += 1; } try { Thread.sleep(100); } catch (InterruptedException e) { throw new RuntimeException(e); } } }); autocommitThread.setDaemon(true); autocommitThread.start(); return client; }

Target:
public TestStreamingClient startWithAutocommit(final Consumer<List<StreamBatch>> batchesListener) throws InterruptedException { this.batchesListener = batchesListener; final TestStreamingClient client = startInternal(true); final Thread autocommitThread = new Thread(() -> { int oldIdx = 0; while (client.isRunning()) { while (oldIdx < client.getBatches().size()) { final StreamBatch batch = client.getBatches().get(oldIdx); if (batch.getEvents() != null && !batch.getEvents().isEmpty()) { try { final SubscriptionCursor cursor = batch.getCursor(); final int responseCode = NakadiTestUtils.commitCursors( client.subscriptionId, Collections.singletonList(batch.getCursor()), client.getSessionId()); LOG.info("Committing " + responseCode + ": " + cursor); } catch (JsonProcessingException e) { throw new RuntimeException(e); } } oldIdx += 1; } try { Thread.sleep(100); } catch (InterruptedException e) { throw new RuntimeException(e); } } }); autocommitThread.setDaemon(true); autocommitThread.start(); return client; }
Source:
public static VirtualColumns create(List<VirtualColumn> virtualColumns) { if (virtualColumns == null || virtualColumns.isEmpty()) { return EMPTY; } Map<String, VirtualColumn> withDotSupport = Maps.newHashMap(); Map<String, VirtualColumn> withoutDotSupport = Maps.newHashMap(); for (VirtualColumn vc : virtualColumns) { if (vc.getOutputName() == null || vc.getOutputName().isEmpty()) { throw new IAE("Empty or null virtualColumn name"); } if (vc.getOutputName().equals(Column.TIME_COLUMN_NAME)) { throw new IAE("virtualColumn name[%s] not allowed", vc.getOutputName()); } if (withDotSupport.containsKey(vc.getOutputName()) || withoutDotSupport.containsKey(vc.getOutputName())) { throw new IAE("Duplicate virtualColumn name[%s]", vc.getOutputName()); } if (vc.usesDotNotation()) { withDotSupport.put(vc.getOutputName(), vc); } else { withoutDotSupport.put(vc.getOutputName(), vc); } } return new VirtualColumns(ImmutableList.copyOf(virtualColumns), withDotSupport, withoutDotSupport); }

Target:
public static VirtualColumns create(List<VirtualColumn> virtualColumns) { if (virtualColumns == null || virtualColumns.isEmpty()) { return EMPTY; } Map<String, VirtualColumn> withDotSupport = Maps.newHashMap(); Map<String, VirtualColumn> withoutDotSupport = Maps.newHashMap(); for (VirtualColumn vc : virtualColumns) { if (Strings.isNullOrEmpty(vc.getOutputName())) { throw new IAE("Empty or null virtualColumn name"); } if (vc.getOutputName().equals(Column.TIME_COLUMN_NAME)) { throw new IAE("virtualColumn name[%s] not allowed", vc.getOutputName()); } if (withDotSupport.containsKey(vc.getOutputName()) || withoutDotSupport.containsKey(vc.getOutputName())) { throw new IAE("Duplicate virtualColumn name[%s]", vc.getOutputName()); } if (vc.usesDotNotation()) { withDotSupport.put(vc.getOutputName(), vc); } else { withoutDotSupport.put(vc.getOutputName(), vc); } } return new VirtualColumns(ImmutableList.copyOf(virtualColumns), withDotSupport, withoutDotSupport); }
Source:
protected void ExecuteIrsBrokerCommand() { uuidReturn = getIrsProxy().deleteImage(getParameters().getStorageDomainId().toString(), getParameters().getStoragePoolId().toString(), getParameters().getImageGroupId().toString(), (Boolean.valueOf(getParameters().getPostZeros())).toString(), (Boolean.valueOf(getParameters().getForceDelete())).toString().toLowerCase()); ProceedProxyReturnValue(); Guid taskID = new Guid(uuidReturn.mUuid); getVDSReturnValue().setCreationInfo( new AsyncTaskCreationInfo(taskID, AsyncTaskType.deleteImage, getParameters().getStoragePoolId())); }

Target:
protected void ExecuteIrsBrokerCommand() { uuidReturn = getIrsProxy().deleteImage(getParameters().getStorageDomainId().toString(), getParameters().getStoragePoolId().toString(), getParameters().getImageGroupId().toString(), String.valueOf(getParameters().getPostZeros()), String.valueOf(getParameters().getForceDelete()).toLowerCase()); ProceedProxyReturnValue(); Guid taskID = new Guid(uuidReturn.mUuid); getVDSReturnValue().setCreationInfo( new AsyncTaskCreationInfo(taskID, AsyncTaskType.deleteImage, getParameters().getStoragePoolId())); }
Source:
private boolean tryLoadProperty(WebContext webContext, BaseEntity<?> entity, Property property) { String propertyName = property.getName(); Value parameterValue = webContext.get(propertyName); if (parameterValue.isNull()) { return false; } try { property.parseValues(entity, Values.of(parameterValue.get(List.class, Collections.singletonList(parameterValue.get())))); ensureTenantMatch(entity, property); } catch (HandledException exception) { UserContext.setFieldError(propertyName, parameterValue); UserContext.setErrorMessage(propertyName, exception.getMessage()); return true; } return false; }

Target:
private boolean tryLoadProperty(WebContext webContext, BaseEntity<?> entity, Property property) { String propertyName = property.getName(); Value parameterValue = webContext.get(propertyName); if (parameterValue.isNull()) { return true; } try { property.parseValues(entity, Values.of(parameterValue.get(List.class, Collections.singletonList(parameterValue.get())))); ensureTenantMatch(entity, property); } catch (HandledException exception) { UserContext.setFieldError(propertyName, parameterValue); UserContext.setErrorMessage(propertyName, exception.getMessage()); return false; } return true; }
Source:
public void canRetrieveAsJson() throws Exception { final Pull pull = repo().pulls().create("Test Pull", "blah", "aaa"); final JsonObject json = pull.json(); MatcherAssert.assertThat( json.getString("number"), Matchers.equalTo("1") ); MatcherAssert.assertThat( json.getString("head"), Matchers.equalTo("blah") ); MatcherAssert.assertThat( json.getString("base"), Matchers.equalTo("aaa") ); }

Target:
public void canRetrieveAsJson() throws Exception { final String head = "blah"; final String base = "aaa"; final Pull pull = repo().pulls().create("Test Pull Json", head, base); final JsonObject json = pull.json(); MatcherAssert.assertThat( json.getString("number"), Matchers.equalTo("1") ); MatcherAssert.assertThat( json.getString("head"), Matchers.equalTo(head) ); MatcherAssert.assertThat( json.getString("base"), Matchers.equalTo(base) ); }
Source:
public List<Map<String, Object>> getPluginsForApplication(String appName) { try { List<Map<String, Object>> returnValues = new ArrayList<>(); for (ApplicationPlugin plugin : applicationPlugins) { if (plugin.matchesAssocationName(appName)) { returnValues.add(plugin.toJSON()); } } return returnValues; } catch (Exception e) { LOGGER.error("Could not get plugins for application", e); throw new ApplicationServiceBeanException("Could not get plugins for application"); } }

Target:
public List<Map<String, Object>> getPluginsForApplication(String appName) { try { List<Map<String, Object>> returnValues = new ArrayList<>(); for (ApplicationPlugin plugin : applicationPlugins) { if (plugin.matchesAssocationName(appName)) { returnValues.add(plugin.toJSON()); } } return returnValues; } catch (VirtualMachineError e) { throw e; } catch (Throwable e) { LOGGER.info("Could not retrieve plugins for application", e); throw new ApplicationServiceBeanException("Could not get plugins for application"); } }
Source:
private void dispatch() { if (isDbInBadState()) { return; } CommCareApp currentApp = CommCareApplication._().getCurrentApp(); if (currentApp == null) { if (CommCareApplication._().usableAppsPresent()) { CommCareApplication._().initFirstUsableAppRecord(); dispatch(); return; } else { Intent i = new Intent(getApplicationContext(), CommCareSetupActivity.class); this.startActivityForResult(i, INIT_APP); } } else { if (CommCareApplication._().isConsumerApp() && !alreadyCheckedForAppFilesChange) { checkForChangedCCZ(); return; } ApplicationRecord currentRecord = currentApp.getAppRecord(); try { if (currentApp.getAppResourceState() == CommCareApplication.STATE_CORRUPTED) { handleDamagedApp(); } else if (!currentRecord.isUsable()) { boolean unseated = handleUnusableApp(currentRecord); if (unseated) { dispatch(); } } else if (!CommCareApplication._().getSession().isActive()) { launchLoginScreen(); } else if (this.getIntent().hasExtra(SESSION_REQUEST)) { handleExternalLaunch(); } else if (this.getIntent().hasExtra(AndroidShortcuts.EXTRA_KEY_SHORTCUT) && !shortcutExtraWasConsumed) { handleShortcutLaunch(); } else { launchHomeScreen(); } } catch (SessionUnavailableException sue) { launchLoginScreen(); } } }

Target:
private void dispatch() { if (isDbInBadState()) { return; } CommCareApp currentApp = CommCareApplication._().getCurrentApp(); if (currentApp == null) { if (CommCareApplication._().usableAppsPresent()) { CommCareApplication._().initFirstUsableAppRecord(); dispatch(); } else { Intent i = new Intent(getApplicationContext(), CommCareSetupActivity.class); this.startActivityForResult(i, INIT_APP); } } else { if (CommCareApplication._().isConsumerApp() && !alreadyCheckedForAppFilesChange) { checkForChangedCCZ(); return; } ApplicationRecord currentRecord = currentApp.getAppRecord(); try { if (currentApp.getAppResourceState() == CommCareApplication.STATE_CORRUPTED) { handleDamagedApp(); } else if (!currentRecord.isUsable()) { boolean unseated = handleUnusableApp(currentRecord); if (unseated) { dispatch(); } } else if (!CommCareApplication._().getSession().isActive()) { launchLoginScreen(); } else if (this.getIntent().hasExtra(SESSION_REQUEST)) { handleExternalLaunch(); } else if (this.getIntent().hasExtra(AndroidShortcuts.EXTRA_KEY_SHORTCUT) && !shortcutExtraWasConsumed) { handleShortcutLaunch(); } else { launchHomeScreen(); } } catch (SessionUnavailableException sue) { launchLoginScreen(); } } }
Source:
public Response toResponse(GitException exception) { if (exception instanceof GitRefNotFoundException) return Response.status(Response.Status.NOT_FOUND) .entity(DtoFactory.getInstance().toJson(exception.getServiceError())) .type(MediaType.APPLICATION_JSON).build(); else if (exception instanceof GitInvalidRefNameException) return Response.status(Response.Status.UNAUTHORIZED) .entity(DtoFactory.getInstance().toJson(exception.getServiceError())) .type(MediaType.APPLICATION_JSON).build(); else if (exception instanceof GitRefAlreadyExistsException) return Response.status(Response.Status.BAD_REQUEST) .entity(DtoFactory.getInstance().toJson(exception.getServiceError())) .type(MediaType.APPLICATION_JSON).build(); else if (exception instanceof GitConflictException) { ConflictExceptionError conflictExceptionError = DtoFactory.getInstance() .createDto(ConflictExceptionError.class) .withMessage(exception.getServiceError().getMessage()) .withConflictingPaths(((GitConflictException) exception).getConflictPaths()); return Response.status(Response.Status.CONFLICT) .entity(DtoFactory.getInstance().toJson(conflictExceptionError)) .type(MediaType.APPLICATION_JSON).build(); } else if (exception instanceof GitException) return Response.serverError().entity(DtoFactory.getInstance().toJson(exception.getServiceError())) .type(MediaType.APPLICATION_JSON).build(); else return Response.serverError().entity(DtoFactory.getInstance().toJson(exception.getServiceError())) .type(MediaType.APPLICATION_JSON).build(); }

Target:
public Response toResponse(GitException exception) { if (exception instanceof GitRefNotFoundException) return Response.status(Response.Status.NOT_FOUND) .entity(DtoFactory.getInstance().toJson(exception.getServiceError())) .type(MediaType.APPLICATION_JSON).build(); else if (exception instanceof GitInvalidRefNameException) return Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(DtoFactory.getInstance().toJson(exception.getServiceError())) .type(MediaType.APPLICATION_JSON).build(); else if (exception instanceof GitRefAlreadyExistsException) return Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(DtoFactory.getInstance().toJson(exception.getServiceError())) .type(MediaType.APPLICATION_JSON).build(); else if (exception instanceof GitConflictException) { ConflictExceptionError conflictExceptionError = newDto(ConflictExceptionError.class).withMessage(exception.getServiceError().getMessage()) .withConflictingPaths(((GitConflictException) exception).getConflictPaths()); return Response.status(Response.Status.CONFLICT) .entity(DtoFactory.getInstance().toJson(conflictExceptionError)) .type(MediaType.APPLICATION_JSON).build(); } return Response.serverError() .entity(DtoFactory.getInstance() .toJson(exception.getServiceError())) .type(MediaType.APPLICATION_JSON).build(); }
Source:
public Iterable<Node> treeIterable(TreeTraversal traversal) { return () -> treeIterator(traversal); }

Target:
private Iterable<Node> treeIterable(TreeTraversal traversal) { return () -> treeIterator(traversal); }
Source:
public void execute() { if (shouldRetry()) { LOG.warn("Retry #" + numFailures + ": Going to sleep for " + retryInterval + " milliseconds."); sleep(retryInterval); retryInterval <<= 1; } }

Target:
public boolean execute() { if (succeeded || numFailures == 0 || numFailures > maxRetries) { return false; } LOG.warn("Retry #" + numFailures + ": Going to sleep for " + retryInterval + " milliseconds."); sleep(retryInterval); retryInterval *= multiplier; return true; }
Source:
void reset() { m_syncedSinceLastEdit = false; if (m_segmentHeaderBuf != null) { m_segmentHeaderBuf.discard(); m_segmentHeaderBuf = null; } if (m_entryHeaderBuf != null) { m_entryHeaderBuf.discard(); m_entryHeaderBuf = null; } m_crc.reset(); m_crc.reset(); }

Target:
void reset() { m_syncedSinceLastEdit = false; if (m_segmentHeaderBuf != null) { m_segmentHeaderBuf.discard(); m_segmentHeaderBuf = null; } if (m_entryHeaderBuf != null) { m_entryHeaderBuf.discard(); m_entryHeaderBuf = null; } }
Source:
public void testDmPingResponse() throws IllegalAccessException, InterruptedException { MsgEcho ping = new MsgEcho( "PING:TEST" ); AgentMessageProcessor processor = (AgentMessageProcessor) this.agent.getMessagingClient().getMessageProcessor(); processor.processMessage( ping ); List<Message> messages = this.client.messagesForTheDm; Assert.assertEquals( 1, messages.size()); Message message = messages.get(0); Assert.assertTrue( message instanceof MsgEcho ); MsgEcho echo = (MsgEcho) message; Assert.assertEquals( "PONG:TEST", echo.getContent()); Assert.assertEquals( ping.getUuid(), echo.getUuid()); }

Target:
public void testDmPingResponse() throws IllegalAccessException { MsgEcho ping = new MsgEcho( "PING:TEST" ); AgentMessageProcessor processor = (AgentMessageProcessor) this.agent.getMessagingClient().getMessageProcessor(); processor.processMessage( ping ); List<Message> messages = this.client.messagesForTheDm; Assert.assertEquals( 1, messages.size()); Message message = messages.get(0); Assert.assertTrue( message instanceof MsgEcho ); MsgEcho echo = (MsgEcho) message; Assert.assertEquals( "PONG:TEST", echo.getContent()); Assert.assertEquals( ping.getUuid(), echo.getUuid()); }
Source:
public PatternBasedHeaderMatcher(Collection<String> patterns) { this(patterns, false); }

Target:
public PatternBasedHeaderMatcher(Collection<String> patterns) { Assert.notNull(patterns, "Patterns must no be null"); Assert.notEmpty(patterns, "At least one pattern must be specified"); for (String pattern : patterns) { this.patterns.add(pattern.toLowerCase()); } }
Source:
public String getDirectoryUrl() { return directoryAsyncClient.getDirectoryUrl(); }

Target:
public URL getDirectoryUrl() { return directoryAsyncClient.getDirectoryUrl(); }
Source:
private void saveAndSetHeaders(final Message message, final PendingReply pendingReply, String messageTag) { String savedReplyTo = message.getMessageProperties().getReplyTo(); pendingReply.setSavedReplyTo(savedReplyTo); if (StringUtils.hasLength(savedReplyTo) && logger.isDebugEnabled()) { logger.debug("Replacing replyTo header:" + savedReplyTo + " in favor of template's configured reply-queue:" + RabbitTemplate.this.replyAddress); } message.getMessageProperties().setReplyTo(RabbitTemplate.this.replyAddress); String savedCorrelation = null; if (this.correlationKey == null) { String correlationId = message.getMessageProperties().getCorrelationId(); if (correlationId != null) { savedCorrelation = correlationId; } } else { savedCorrelation = (String) message.getMessageProperties() .getHeaders().get(RabbitTemplate.this.correlationKey); } pendingReply.setSavedCorrelation(savedCorrelation); if (this.correlationKey == null) { message.getMessageProperties().setCorrelationId(messageTag); } else { message.getMessageProperties().setHeader(this.correlationKey, messageTag); } }

Target:
private void saveAndSetHeaders(final Message message, final PendingReply pendingReply, String messageTag) { String savedReplyTo = message.getMessageProperties().getReplyTo(); pendingReply.setSavedReplyTo(savedReplyTo); if (StringUtils.hasLength(savedReplyTo) && logger.isDebugEnabled()) { logger.debug("Replacing replyTo header: " + savedReplyTo + " in favor of template's configured reply-queue:" + RabbitTemplate.this.replyAddress); } message.getMessageProperties().setReplyTo(this.replyAddress); String savedCorrelation = null; if (this.correlationKey == null) { String correlationId = message.getMessageProperties().getCorrelationId(); if (correlationId != null) { savedCorrelation = correlationId; } } else { savedCorrelation = (String) message.getMessageProperties() .getHeaders().get(this.correlationKey); } pendingReply.setSavedCorrelation(savedCorrelation); if (this.correlationKey == null) { message.getMessageProperties().setCorrelationId(messageTag); } else { message.getMessageProperties().setHeader(this.correlationKey, messageTag); } }
Source:
private boolean isValid(Repository repo, Block block) { boolean isValid = true; if (!block.isGenesis()) { String trieHash = toHexString(block.getTxTrieRoot()); String trieListHash = toHexString(calcTxTrie(block.getTransactionsList())); if (!trieHash.equals(trieListHash)) { logger.warn("Block's given Trie Hash doesn't match: != {}", trieHash, trieListHash); return false; } List<Transaction> txs = block.getTransactionsList(); if (!txs.isEmpty()) { Map<ByteArrayWrapper, BigInteger> curNonce = new HashMap<>(); for (Transaction tx : txs) { byte[] txSender = tx.getSender(); if (txSender == null) { logger.warn("Invalid transaction: sender in tx with rlp={} is null." + "Not valid until EIP-86", ByteUtil.toHexString(tx.getEncoded())); return false; } ByteArrayWrapper key = new ByteArrayWrapper(txSender); BigInteger expectedNonce = curNonce.get(key); if (expectedNonce == null) { expectedNonce = repo.getNonce(txSender); } curNonce.put(key, expectedNonce.add(ONE)); BigInteger txNonce = new BigInteger(1, tx.getNonce()); if (!expectedNonce.equals(txNonce)) { logger.warn("Invalid transaction: Tx nonce != expected nonce (parent nonce: {}): {}", txNonce, expectedNonce, repo.getNonce(txSender), tx); return false; } } } } return isValid; }

Target:
private boolean isValid(Repository repo, Block block) { boolean isValid = true; if (!block.isGenesis()) { isValid = isValid(block.getHeader()); String trieHash = toHexString(block.getTxTrieRoot()); String trieListHash = toHexString(calcTxTrie(block.getTransactionsList())); if (!trieHash.equals(trieListHash)) { logger.warn("Block's given Trie Hash doesn't match: != {}", trieHash, trieListHash); return false; } List<Transaction> txs = block.getTransactionsList(); if (!txs.isEmpty()) { Map<ByteArrayWrapper, BigInteger> curNonce = new HashMap<>(); for (Transaction tx : txs) { byte[] txSender = tx.getSender(); if (txSender == null) { logger.warn("Invalid transaction: sender in tx with rlp={} is null." + "Not valid until EIP-86", ByteUtil.toHexString(tx.getEncoded())); return false; } ByteArrayWrapper key = new ByteArrayWrapper(txSender); BigInteger expectedNonce = curNonce.get(key); if (expectedNonce == null) { expectedNonce = repo.getNonce(txSender); } curNonce.put(key, expectedNonce.add(ONE)); BigInteger txNonce = new BigInteger(1, tx.getNonce()); if (!expectedNonce.equals(txNonce)) { logger.warn("Invalid transaction: Tx nonce != expected nonce (parent nonce: {}): {}", txNonce, expectedNonce, repo.getNonce(txSender), tx); return false; } } } } return isValid; }
Source:
public synchronized AsyncJobStatus cancelJob(String jobId) { if (jobId == null || jobId.isEmpty()) { throw new IllegalArgumentException("jobId is null or empty"); } AsyncJobStatus status = this.jobCurator.lockAndLoad(jobId); if (status != null) { if (status.getState().isTerminal()) { throw new IllegalStateException("job is already in a terminal state: " + status); } if (status.getState() != JobState.RUNNING) { this.setJobState(status, JobState.CANCELED); } else { log.warn("Attempting to cancel job that's already running: {}", status); if (status.getMaxAttempts() > 1) { log.warn("Setting max attempts to: 1"); status.setMaxAttempts(1); } } status = this.jobCurator.merge(status); } return status; }

Target:
public synchronized AsyncJobStatus cancelJob(String jobId) { if (jobId == null || jobId.isEmpty()) { throw new IllegalArgumentException("jobId is null or empty"); } AsyncJobStatus status = this.jobCurator.get(jobId); if (status != null) { if (status.getState().isTerminal()) { throw new IllegalStateException("job is already in a terminal state: " + status); } if (status.getState() != JobState.RUNNING) { this.setJobState(status, JobState.CANCELED); } else { log.warn("Attempting to cancel job that's already running: {}", status); if (status.getMaxAttempts() > 1) { log.warn("Setting max attempts to: 1"); status.setMaxAttempts(1); } } status = this.jobCurator.merge(status); } return status; }
Source:
private Pool createBonusPool(Pool masterPool, List<Pool> existingPools) { Map<String, String> attributes = PoolHelper.getFlattenedAttributes(masterPool.getProduct()); String virtQuantity = getVirtQuantity(attributes.get("virt_limit"), masterPool.getQuantity()); log.info("Checking if bonus pools need to be created for pool: {}", masterPool); if (attributes.containsKey("virt_limit") && virtQuantity != null) { if (!hasBonusPool(existingPools)) { boolean hostLimited = attributes.containsKey("host_limited") && attributes.get("host_limited").equals("true"); HashMap<String, String> virtAttributes = new HashMap<String, String>(); virtAttributes.put("virt_only", "true"); virtAttributes.put("pool_derived", "true"); virtAttributes.put("physical_only", "false"); if (hostLimited || config.getBoolean(ConfigProperties.STANDALONE)) { virtAttributes.put("unmapped_guests_only", "true"); } virtAttributes.put("virt_limit", "0"); Product sku = masterPool.getDerivedProduct() != null ? masterPool.getDerivedProduct() : masterPool.getProduct(); Pool bonusPool = PoolHelper.clonePool(masterPool, sku, virtQuantity, virtAttributes, "derived", prodCurator, null); log.info("Creating new derived pool: {}", bonusPool); return bonusPool; } else { Pool bonus = getBonusPool(existingPools); long virtLong = -1L; try { virtLong = Long.parseLong(virtQuantity); } catch (NumberFormatException pe) { } if (virtLong != bonus.getQuantity()) { bonus.setQuantity(virtLong); poolManager.setPoolQuantity(bonus, virtLong); return bonus; } } } return null; }

Target:
private Pool createBonusPool(Pool masterPool, List<Pool> existingPools) { Map<String, String> attributes = masterPool.getProductAttributes(); String virtQuantity = getVirtQuantity( attributes.get(Product.Attributes.VIRT_LIMIT), masterPool.getQuantity() ); log.info("Checking if bonus pools need to be created for pool: {}", masterPool); if (attributes.containsKey(Product.Attributes.VIRT_LIMIT) && !hasBonusPool(existingPools) && virtQuantity != null) { boolean hostLimited = "true".equals(attributes.get(Product.Attributes.HOST_LIMITED)); HashMap<String, String> virtAttributes = new HashMap<String, String>(); virtAttributes.put(Pool.Attributes.VIRT_ONLY, "true"); virtAttributes.put(Pool.Attributes.DERIVED_POOL, "true"); virtAttributes.put(Pool.Attributes.PHYSICAL_ONLY, "false"); if (hostLimited || config.getBoolean(ConfigProperties.STANDALONE)) { virtAttributes.put(Pool.Attributes.UNMAPPED_GUESTS_ONLY, "true"); } virtAttributes.put(Product.Attributes.VIRT_LIMIT, "0"); Product sku = masterPool.getDerivedProduct() != null ? masterPool.getDerivedProduct() : masterPool.getProduct(); Pool bonusPool = PoolHelper.clonePool(masterPool, sku, virtQuantity, virtAttributes, "derived", ownerProductCurator, null, productCurator); log.info("Creating new derived pool: {}", bonusPool); return bonusPool; } return null; }
Source:
protected void executeVmCommand() { if (shouldAddLease(getVm())) { if (FeatureSupported.isVmLeasesSupported(getVm().getCompatibilityVersion())) { if (!addVmLease(getVm().getLeaseStorageDomainId(), getVm().getId())) { getVm().setLeaseStorageDomainId(null); } } else { getVm().setLeaseStorageDomainId(null); auditLogDirector.log(this, AuditLogType.CANNOT_IMPORT_VM_WITH_LEASE_COMPAT_VERSION); } } super.executeVmCommand(); }

Target:
protected void executeVmCommand() { if (shouldAddLease(getVm())) { if (FeatureSupported.isVmLeasesSupported(getEffectiveCompatibilityVersion())) { if (!addVmLease(getVm().getLeaseStorageDomainId(), getVm().getId())) { getVm().setLeaseStorageDomainId(null); } } else { getVm().setLeaseStorageDomainId(null); auditLogDirector.log(this, AuditLogType.CANNOT_IMPORT_VM_WITH_LEASE_COMPAT_VERSION); } } super.executeVmCommand(); }
Source:
public ProjectStatusWsResponse.ProjectStatus format() { if (!optionalMeasureData.isPresent()) { return newResponseWithoutQualityGateDetails(); } JsonParser parser = new JsonParser(); JsonObject json = parser.parse(optionalMeasureData.get()).getAsJsonObject(); ProjectStatusWsResponse.Status qualityGateStatus = measureLevelToQualityGateStatus(json.get("level").getAsString()); projectStatusBuilder.setStatus(qualityGateStatus); JsonElement ignoredConditions = json.get("ignoredConditions"); if (ignoredConditions != null) { projectStatusBuilder.setIgnoredConditions(ignoredConditions.getAsBoolean()); } else { projectStatusBuilder.setIgnoredConditions(false); } formatConditions(json.getAsJsonArray("conditions")); formatPeriods(); return projectStatusBuilder.build(); }

Target:
public ProjectStatusWsResponse.ProjectStatus format() { if (!optionalMeasureData.isPresent()) { return newResponseWithoutQualityGateDetails(); } JsonParser parser = new JsonParser(); JsonObject json = parser.parse(optionalMeasureData.get()).getAsJsonObject(); ProjectStatusWsResponse.Status qualityGateStatus = measureLevelToQualityGateStatus(json.get("level").getAsString()); projectStatusBuilder.setStatus(qualityGateStatus); formatIgnoredConditions(json); formatConditions(json.getAsJsonArray("conditions")); formatPeriods(); return projectStatusBuilder.build(); }
Source:
protected File findPom(String side, String version, File json) throws IOException { File pom = cache("versions", version, side + ".pom"); HashStore cache = new HashStore(this.cache).load(cache("versions", version, side + ".pom.input")); if ("client".equals(side)) { cache.add(json); } if (!cache.isSame() || !pom.exists()) { POMBuilder builder = new POMBuilder(GROUP, side, version); if ("client".equals(side)) { VersionJson meta = Utils.loadJson(json, VersionJson.class); for (VersionJson.Library lib : meta.libraries) { if (lib.downloads.classifiers != null) { if (lib.downloads.classifiers.containsKey("test")) { builder.dependencies().add(lib.name, "test").withClassifier("test"); } if (lib.natives != null && lib.natives.containsKey(CURRENT_OS) && !lib.getArtifact().getName().contains("java-objc-bridge")) { builder.dependencies().add(lib.name, "runtime").withClassifier(lib.natives.get(CURRENT_OS)); } } else { builder.dependencies().add(lib.name, "compile"); } } } else { builder.dependencies().add(GROUP + ":" + side + ":" + version, "compile").withClassifier("extra"); } builder.dependencies().add(GROUP + ":" + side + ":" + version, "compile").withClassifier("data"); builder.dependencies().add("com.google.code.findbugs:jsr305:3.0.1", "compile"); String ret = builder.tryBuild(); if (ret == null) { return null; } FileUtils.writeByteArrayToFile(pom, ret.getBytes()); cache.save(); Utils.updateHash(pom); } return pom; }

Target:
protected File findPom(String side, String version, File json) throws IOException { File pom = cache("versions", version, side + ".pom"); HashStore cache = new HashStore(this.cache).load(cache("versions", version, side + ".pom.input")); if ("client".equals(side)) { cache.add(json); } if (!cache.isSame() || !pom.exists()) { POMBuilder builder = new POMBuilder(GROUP, side, version); if ("client".equals(side)) { VersionJson meta = Utils.loadJson(json, VersionJson.class); for (VersionJson.Library lib : meta.libraries) { builder.dependencies().add(lib.name, "compile"); if (lib.downloads.classifiers != null) { if (lib.downloads.classifiers.containsKey("test")) { builder.dependencies().add(lib.name, "test").withClassifier("test"); } if (lib.natives != null && lib.natives.containsKey(CURRENT_OS) && !lib.getArtifact().getName().contains("java-objc-bridge")) { builder.dependencies().add(lib.name, "runtime").withClassifier(lib.natives.get(CURRENT_OS)); } } } } else { builder.dependencies().add(GROUP + ":" + side + ":" + version, "compile").withClassifier("extra"); } builder.dependencies().add(GROUP + ":" + side + ":" + version, "compile").withClassifier("data"); builder.dependencies().add("com.google.code.findbugs:jsr305:3.0.1", "compile"); String ret = builder.tryBuild(); if (ret == null) { return null; } FileUtils.writeByteArrayToFile(pom, ret.getBytes()); cache.save(); Utils.updateHash(pom); } return pom; }
Source:
static <T> T build( StructureBuilder<AnyValue,T> builder, MapValue map ) { if ( map.size() == 0 ) { throw new InvalidTemporalArgumentException( "At least one temporal unit must be specified." ); } return build( builder, map.entrySet() ); }

Target:
static <T> T build( StructureBuilder<AnyValue,T> builder, MapValue map ) { if ( map.size() == 0 ) { throw new InvalidValuesArgumentException( "At least one temporal unit must be specified." ); } return build( builder, map.entrySet() ); }
Source:
public String evaluate( String referer ) { ExternalSearch es_inst = ExternalSearch.getInstance(); return es_inst.refererClassify( referer ); }

Target:
public String evaluate( String referer ) { ExternalSearch externalSearch = ExternalSearch.getInstance(); return externalSearch.refererClassify( referer ); }
Source:
public boolean hasMethod(String method) { Object obj = properties.get(method); if(obj != null) { return (obj instanceof MethodHandle); } else { return false; } }

Target:
public boolean hasMethod(String method) { Object obj = properties.get(method); if (obj != null) { return (obj instanceof MethodHandle); } return false; }
Source:
public void logIn(HttpServletRequest request, HttpServletResponse response, Member member) { try { Authentication authentication = authenticationService.authenticate(request, response, member); authenticationSuccessHandler.onAuthenticationSuccess(request, response, authentication, false); } catch (IOException e) { authenticationService.logout(request, response); throw new InternalException(e); } }

Target:
public void logIn(HttpServletRequest request, HttpServletResponse response, Member member) { try { Authentication authentication = authenticationService.authenticate(request, response, member); final boolean redirectOnSuccess = false; authenticationSuccessHandler.onAuthenticationSuccess(request, response, authentication, redirectOnSuccess); } catch (IOException e) { authenticationService.logout(request, response); throw new InternalException(e); } }
Source:
public boolean isEnabled() { return getActiveTextEditor() != null; }

Target:
public boolean isEnabled() { return true; }
Source:
private Optional<Stage> getStageFromRequestParam(Request request, HttpOperationResult operationResult) { String pipelineName = request.params("pipeline_name"); String pipelineCounter = request.params("pipeline_counter"); String stageName = request.params("stage_name"); String stageCounter = request.params("stage_counter"); Stage stage = stageService.findStageWithIdentifier(pipelineName, Integer.parseInt(pipelineCounter), stageName, stageCounter, currentUsername().getUsername().toString(), operationResult); if (!operationResult.isSuccess()) { return Optional.empty(); } if (stage == null || stage instanceof NullStage) { String message = String.format("Stage '%s' not found", stageName); operationResult.notFound("Not Found", message, HealthStateType.general(HealthStateScope.GLOBAL)); return Optional.empty(); } return Optional.ofNullable(stage); }

Target:
private Optional<Stage> getStageFromRequestParam(Request request, HttpOperationResult operationResult) { String pipelineName = request.params("pipeline_name"); String pipelineCounter = request.params("pipeline_counter"); String stageName = request.params("stage_name"); String stageCounter = request.params("stage_counter"); Stage stage = stageService.findStageWithIdentifier(pipelineName, Integer.parseInt(pipelineCounter), stageName, stageCounter, currentUsername().getUsername().toString(), operationResult); if (!operationResult.isSuccess()) { return Optional.empty(); } if (stage == null || stage instanceof NullStage) { String message = String.format("Stage '%s' with counter '%s' not found. Please make sure specified stage or stage run with specified counter exists.", stageName, stageCounter); operationResult.notFound("Not Found", message, HealthStateType.general(HealthStateScope.GLOBAL)); return Optional.empty(); } return Optional.ofNullable(stage); }
Source:
public boolean canReadCommit(RevWalk rw, RevCommit commit) { NameKey projName = state.getProject().getNameKey(); try { Repository repo = repoManager.openRepository(projName); try { for (Entry<String, Ref> entry : repo.getAllRefs().entrySet()) { String refName = entry.getKey(); if (refName.startsWith("refs/changes") || refName.startsWith("refs/cache-automerge")) { continue; } RevCommit tip; try { tip = rw.parseCommit(entry.getValue().getObjectId()); } catch (IncorrectObjectTypeException e) { continue; } if (rw.isMergedInto(commit, tip) && controlForRef(entry.getKey()).canPerform(Permission.READ)) { return true; } } } finally { repo.close(); } } catch (IOException e) { String msg = String.format( "Cannot verify permissions to commit object %s in repository %s", commit.name(), projName.get()); log.error(msg, e); } return controlForRef("refs/*").canPerform(Permission.READ); }

Target:
public boolean canReadCommit(RevWalk rw, RevCommit commit) { NameKey projName = state.getProject().getNameKey(); try { Repository repo = repoManager.openRepository(projName); try { for (Entry<String, Ref> entry : repo.getAllRefs().entrySet()) { String refName = entry.getKey(); if (!refName.startsWith("refs/heads") && !refName.startsWith("refs/tags")) { continue; } RevCommit tip; try { tip = rw.parseCommit(entry.getValue().getObjectId()); } catch (IncorrectObjectTypeException e) { continue; } if (rw.isMergedInto(commit, tip) && controlForRef(entry.getKey()).canPerform(Permission.READ)) { return true; } } } finally { repo.close(); } } catch (IOException e) { String msg = String.format( "Cannot verify permissions to commit object %s in repository %s", commit.name(), projName.get()); log.error(msg, e); } return controlForRef("refs/*").canPerform(Permission.READ); }
Source:
private void createIndexToolTables(Connection connection) throws Exception { ConnectionQueryServices queryServices = connection.unwrap(PhoenixConnection.class).getQueryServices(); Admin admin = queryServices.getAdmin(); if (!admin.tableExists(TableName.valueOf(OUTPUT_TABLE_NAME))) { HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(OUTPUT_TABLE_NAME)); tableDescriptor.setValue("DISABLE_TABLE_SOR", "true"); tableDescriptor.setValue(HColumnDescriptor.TTL, String.valueOf(MetaDataProtocol.DEFAULT_LOG_TTL)); HColumnDescriptor columnDescriptor = new HColumnDescriptor(OUTPUT_TABLE_COLUMN_FAMILY); tableDescriptor.addFamily(columnDescriptor); admin.createTable(tableDescriptor); } if (!admin.tableExists(TableName.valueOf(RESULT_TABLE_NAME))) { HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(RESULT_TABLE_NAME)); tableDescriptor.setValue("DISABLE_TABLE_SOR", "true"); tableDescriptor.setValue(HColumnDescriptor.TTL, String.valueOf(MetaDataProtocol.DEFAULT_LOG_TTL)); HColumnDescriptor columnDescriptor = new HColumnDescriptor(RESULT_TABLE_COLUMN_FAMILY); tableDescriptor.addFamily(columnDescriptor); admin.createTable(tableDescriptor); } }

Target:
private void createIndexToolTables(Connection connection) throws Exception { ConnectionQueryServices queryServices = connection.unwrap(PhoenixConnection.class).getQueryServices(); Admin admin = queryServices.getAdmin(); if (!admin.tableExists(TableName.valueOf(OUTPUT_TABLE_NAME))) { HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(OUTPUT_TABLE_NAME)); tableDescriptor.setValue(HColumnDescriptor.TTL, String.valueOf(MetaDataProtocol.DEFAULT_LOG_TTL)); HColumnDescriptor columnDescriptor = new HColumnDescriptor(OUTPUT_TABLE_COLUMN_FAMILY); tableDescriptor.addFamily(columnDescriptor); admin.createTable(tableDescriptor); } if (!admin.tableExists(TableName.valueOf(RESULT_TABLE_NAME))) { HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(RESULT_TABLE_NAME)); tableDescriptor.setValue(HColumnDescriptor.TTL, String.valueOf(MetaDataProtocol.DEFAULT_LOG_TTL)); HColumnDescriptor columnDescriptor = new HColumnDescriptor(RESULT_TABLE_COLUMN_FAMILY); tableDescriptor.addFamily(columnDescriptor); admin.createTable(tableDescriptor); } }
Source:
private void possiblyResetOffsetsOrWait( Map<TopicPartition, Long> outOfRangePartitions, KafkaConsumer<byte[], byte[]> consumer, TaskToolbox taskToolbox ) throws InterruptedException, IOException { final Map<TopicPartition, Long> resetPartitions = Maps.newHashMap(); boolean doReset = false; if (tuningConfig.isResetOffsetAutomatically()) { for (Map.Entry<TopicPartition, Long> outOfRangePartition : outOfRangePartitions.entrySet()) { final TopicPartition topicPartition = outOfRangePartition.getKey(); final long nextOffset = outOfRangePartition.getValue(); consumer.seekToBeginning(Lists.newArrayList(topicPartition)); final long leastAvailableOffset = consumer.position(topicPartition); consumer.seek(topicPartition, nextOffset); if (leastAvailableOffset > nextOffset) { doReset = true; resetPartitions.put(topicPartition, nextOffset); } } } if (doReset) { sendResetRequestAndWait(resetPartitions, taskToolbox); } else { log.warn("Retrying in %dms", POLL_RETRY_MS); pollRetryLock.lockInterruptibly(); try { long nanos = TimeUnit.MILLISECONDS.toNanos(POLL_RETRY_MS); while (nanos > 0L && !pauseRequested && !stopRequested) { nanos = isAwaitingRetry.awaitNanos(nanos); } } finally { pollRetryLock.unlock(); } } }

Target:
private void possiblyResetOffsetsOrWait( Map<TopicPartition, Long> outOfRangePartitions, KafkaConsumer<byte[], byte[]> consumer, TaskToolbox taskToolbox ) throws InterruptedException, IOException { final Map<TopicPartition, Long> resetPartitions = Maps.newHashMap(); boolean doReset = false; if (tuningConfig.isResetOffsetAutomatically()) { for (Map.Entry<TopicPartition, Long> outOfRangePartition : outOfRangePartitions.entrySet()) { final TopicPartition topicPartition = outOfRangePartition.getKey(); final long nextOffset = outOfRangePartition.getValue(); consumer.seekToBeginning(Collections.singletonList(topicPartition)); final long leastAvailableOffset = consumer.position(topicPartition); consumer.seek(topicPartition, nextOffset); if (leastAvailableOffset > nextOffset) { doReset = true; resetPartitions.put(topicPartition, nextOffset); } } } if (doReset) { sendResetRequestAndWait(resetPartitions, taskToolbox); } else { log.warn("Retrying in %dms", POLL_RETRY_MS); pollRetryLock.lockInterruptibly(); try { long nanos = TimeUnit.MILLISECONDS.toNanos(POLL_RETRY_MS); while (nanos > 0L && !pauseRequested && !stopRequested) { nanos = isAwaitingRetry.awaitNanos(nanos); } } finally { pollRetryLock.unlock(); } } }
Source:
public void visitBinaryExpression(BinaryExpressionTree tree) { if (tree.is(COMPARATIVE_EXPRESSIONS) && isString(tree.leftOperand()) && isString(tree.rightOperand())) { raiseIssue(tree); } super.visitBinaryExpression(tree); }

Target:
public void visitBinaryExpression(BinaryExpressionTree tree) { if (tree.is(RELATIVE_OPERATIONS) && isString(tree.leftOperand()) && isString(tree.rightOperand())) { raiseIssue(tree); } super.visitBinaryExpression(tree); }
Source:
private void registerAsyncCheckpointRunnable(long checkpointId, AsyncCheckpointRunnable asyncCheckpointRunnable) throws IOException { synchronized (lock) { if (closed) { LOG.debug("Cannot register Closeable, this subtaskCheckpointCoordinator is already closed. Closing argument."); closeQuietly(asyncCheckpointRunnable); checkState( !checkpoints.containsKey(checkpointId), "SubtaskCheckpointCoordinator was closed without releasing asyncCheckpointRunnable, %s", checkpointId); } else if (checkpoints.containsKey(checkpointId)) { closeQuietly(asyncCheckpointRunnable); throw new IOException(String.format("Cannot register Closeable, async checkpoint %d runnable has been register. Closing argument.", checkpointId)); } else { checkpoints.put(checkpointId, asyncCheckpointRunnable); } } }

Target:
private void registerAsyncCheckpointRunnable(long checkpointId, AsyncCheckpointRunnable asyncCheckpointRunnable) throws IOException { synchronized (lock) { if (closed) { LOG.debug("Cannot register Closeable, this subtaskCheckpointCoordinator is already closed. Closing argument."); closeQuietly(asyncCheckpointRunnable); checkState( !checkpoints.containsKey(checkpointId), "SubtaskCheckpointCoordinator was closed without releasing asyncCheckpointRunnable for checkpoint %s", checkpointId); } else if (checkpoints.containsKey(checkpointId)) { closeQuietly(asyncCheckpointRunnable); throw new IOException(String.format("Cannot register Closeable, async checkpoint %d runnable has been register. Closing argument.", checkpointId)); } else { checkpoints.put(checkpointId, asyncCheckpointRunnable); } } }