auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void executeCommand(UICommand command) { super.executeCommand(command); if (command.equals(getRemoveSessionCommand())) { } else if(command.equals(getStartSessionCommand())) { startGeoRepSession(); } else if(command.equals(getStopSessionCommand())) { stopGeoRepSession(); } else if(command.equals(getSessionOptionsCommand())) { } else if(command.equals(getViewSessionDetailsCommand())) { } else if (command.equals(getRefreshSessionsCommand())) { refreshSessions(); } else if (command.getName().equalsIgnoreCase("cancelWindow")) { setWindow(null); } else if (command.getName().equalsIgnoreCase("onStartGeoRepSession")) { onGeoRepSessionAction(VdcActionType.StartGlusterVolumeGeoRep, true); } else if (command.getName().equalsIgnoreCase("onStopGeoRepSession")) { onGeoRepSessionAction(VdcActionType.StopGeoRepSession, true); } else if (command.getName().equalsIgnoreCase("onPauseGeoRepSession")) { onGeoRepSessionAction(VdcActionType.PauseGlusterVolumeGeoRepSession, true); } else if (command.getName().equalsIgnoreCase("onResumeGeoRepSession")) { onGeoRepSessionAction(VdcActionType.ResumeGeoRepSession, true); } else if (command.getName().equalsIgnoreCase("closeWindow")) { closeWindow(); } else if(command.equals(getPauseSessionCommand())) { pauseGeoRepSession(); } else if(command.equals(getResumeSessionCommand())) { resumeGeoRepSession(); } }

Target:
public void executeCommand(UICommand command) { super.executeCommand(command); if (command.equals(getRemoveSessionCommand())) { } else if(command.equals(getStartSessionCommand())) { startGeoRepSession(); } else if(command.equals(getStopSessionCommand())) { stopGeoRepSession(); } else if(command.equals(getPauseSessionCommand())) { pauseGeoRepSession(); } else if(command.equals(getResumeSessionCommand())) { resumeGeoRepSession(); } else if(command.equals(getSessionOptionsCommand())) { } else if(command.equals(getViewSessionDetailsCommand())) { } else if (command.equals(getRefreshSessionsCommand())) { refreshSessions(); } else if (command.getName().equalsIgnoreCase("onStartGeoRepSession")) { onGeoRepSessionAction(VdcActionType.StartGlusterVolumeGeoRep, true); } else if (command.getName().equalsIgnoreCase("onStopGeoRepSession")) { onGeoRepSessionAction(VdcActionType.StopGeoRepSession, true); } else if (command.getName().equalsIgnoreCase("onPauseGeoRepSession")) { onGeoRepSessionAction(VdcActionType.PauseGlusterVolumeGeoRepSession, true); } else if (command.getName().equalsIgnoreCase("onResumeGeoRepSession")) { onGeoRepSessionAction(VdcActionType.ResumeGeoRepSession, true); } else if (command.getName().equalsIgnoreCase("closeWindow")) { closeWindow(); } }
Source:
private void slaveShutdown(TaskListener listener) throws DockerException, IOException { if(!getJobProperty().tagOnCompletion) { addJenkinsAction(null); return; } DockerClient client = getClient(); String repositoryName = getJobProperty().imageRepository; if (Strings.isNullOrEmpty(repositoryName)) { repositoryName = theRun.getParent().getDisplayName(); } DockerImageName imageName = new DockerImageName(repositoryName).makeValid(); TagName imageTag = new TagName(theRun.getDisplayName()).makeValid(); String imageId = client.commitCmd(containerId) .withRepository(imageName.toString()) .withTag(imageTag.toString()) .withAuthor("Jenkins") .exec(); addJenkinsAction(imageId); try { String tagToken = getAdditionalTag(listener); if( !Strings.isNullOrEmpty(tagToken) ) { client.tagImageCmd(imageId, imageName.toString(), tagToken) .withForce() .exec(); addJenkinsAction(tagToken); if( getJobProperty().pushOnSuccess ) { client.pushImageCmd(tagToken).exec(); } } } catch(Exception ex) { LOGGER.log(Level.SEVERE, "Could not add additional tags"); } if( getJobProperty().cleanImages ) { client.removeImageCmd(imageId) .withForce() .exec(); } }

Target:
private void slaveShutdown(TaskListener listener) throws DockerException, IOException { if (!getJobProperty().tagOnCompletion) { addJenkinsAction(null); return; } DockerClient client = getClient(); String tag_image = client.commitCmd(containerId) .withRepository(theRun.getParent().getDisplayName()) .withTag(theRun.getDisplayName().replace("#", "b")) .withAuthor("Jenkins") .exec(); addJenkinsAction(tag_image); try { String tagToken = getAdditionalTag(listener); if (!Strings.isNullOrEmpty(tagToken)) { client.tagImageCmd(tag_image, null, tagToken).exec(); addJenkinsAction(tagToken); if (getJobProperty().pushOnSuccess) { client.pushImageCmd(tagToken).exec(); } } } catch (Exception ex) { LOGGER.log(Level.SEVERE, "Could not add additional tags"); } if (getJobProperty().cleanImages) { client.removeImageCmd(tag_image) .withForce() .exec(); } }
Source:
public CompletionStage<Void> commit(Xid externalXid, boolean isOnePhase) { Xid xid = convertXid(externalXid); LocalXaTransaction localTransaction = getLocalTransactionAndValidate(xid); if (localTransaction == null) { return CompletableFutures.completedExceptionFuture(new XAException(XAException.XAER_NOTA)); } CompletionStage<?> prepareStage; if (isOnePhase) { prepareStage = txCoordinator.prepare(localTransaction); } else { prepareStage = CompletableFutures.completedNull(); } CompletionStage<Boolean> commitStage = prepareStage .thenCompose(ignore -> txCoordinator.commit(localTransaction, false)); return commitStage.thenApply(committedInOnePhase -> { forgetSuccessfullyCompletedTransaction(recoveryManager, localTransaction.getXid(), localTransaction, committedInOnePhase); return null; }); }

Target:
public CompletionStage<Void> commit(Xid externalXid, boolean isOnePhase) { Xid xid = convertXid(externalXid); LocalXaTransaction localTransaction = getLocalTransaction(xid); if (localTransaction == null) { return CompletableFutures.completedExceptionFuture(new XAException(XAException.XAER_NOTA)); } CompletionStage<?> prepareStage; if (isOnePhase) { prepareStage = txCoordinator.prepare(localTransaction); } else { prepareStage = CompletableFutures.completedNull(); } return prepareStage.thenCompose(ignore -> txCoordinator.commit(localTransaction, false)) .thenApply(committedInOnePhase -> { forgetSuccessfullyCompletedTransaction(recoveryManager, localTransaction.getXid(), localTransaction, committedInOnePhase); return null; }); }
Source:
public static Slice castToHyperLogLog(@SqlType(SetDigestType.NAME) Slice slice) { checkArgument(slice.getByte(0) == 1, "CAST only works on version 1 of SetDigest format"); int hllLength = slice.getInt(SIZE_OF_BYTE); return Slices.wrappedBuffer(slice.getBytes(SIZE_OF_BYTE + SIZE_OF_INT, hllLength)); }

Target:
public static Slice castToHyperLogLog(@SqlType(SetDigestType.NAME) Slice slice) { checkArgument(slice.getByte(0) == 1, "Legacy version of SetDigest cannot cast to HyperLogLog"); int hllLength = slice.getInt(SIZE_OF_BYTE); return Slices.wrappedBuffer(slice.getBytes(SIZE_OF_BYTE + SIZE_OF_INT, hllLength)); }
Source:
public void exceptionTaskTest() { boolean exceptionFired = false; try { this.applicationContext = SpringApplication.run( TaskExceptionConfiguration.class, new String[] { "spring.cloud.task.closecontext.enable=false", "spring.cloud.task.name=" + TASK_NAME, "spring.main.web-environment=false" }); } catch (IllegalStateException exception) { exceptionFired = true; } assertTrue("An IllegalStateException should have been thrown", exceptionFired); String output = this.outputCapture.toString(); assertTrue("Test results do not show create task message: " + output, output.contains(CREATE_TASK_MESSAGE)); assertTrue("Test results do not show success message: " + output, output.contains(UPDATE_TASK_MESSAGE)); assertTrue("Test results have incorrect exit code: " + output, output.contains(EXCEPTION_EXIT_CODE_MESSAGE)); assertTrue("Test results have incorrect exit message: " + output, output.contains(ERROR_MESSAGE)); assertTrue("Test results have exception message: " + output, output.contains(EXCEPTION_MESSAGE)); }

Target:
public void exceptionTaskTest() { boolean exceptionFired = false; try { this.applicationContext = SpringApplication.run( TaskExceptionConfiguration.class, new String[] { "--spring.cloud.task.closecontext.enable=false", "--spring.cloud.task.name=" + TASK_NAME, "--spring.main.web-environment=false" }); } catch (IllegalStateException exception) { exceptionFired = true; } assertTrue("An IllegalStateException should have been thrown", exceptionFired); String output = this.outputCapture.toString(); assertTrue("Test results do not show create task message: " + output, output.contains(CREATE_TASK_MESSAGE)); assertTrue("Test results do not show success message: " + output, output.contains(UPDATE_TASK_MESSAGE)); assertTrue("Test results have incorrect exit code: " + output, output.contains(EXCEPTION_EXIT_CODE_MESSAGE)); assertTrue("Test results have incorrect exit message: " + output, output.contains(ERROR_MESSAGE)); assertTrue("Test results have exception message: " + output, output.contains(EXCEPTION_MESSAGE)); }
Source:
public Registration requestRegistration(Username username, AgentRuntimeInfo agentRuntimeInfo) { LOGGER.debug("Agent is requesting registration {}", agentRuntimeInfo); AgentInstance agentInstance = agentInstances.register(agentRuntimeInfo); Registration registration = agentInstance.assignCertification(); if (agentInstance.isRegistered()) { agentConfigService.saveOrUpdateAgent(agentInstance, username); LOGGER.debug("New Agent approved " + agentRuntimeInfo); } return registration; }

Target:
public Registration requestRegistration(Username username, AgentRuntimeInfo agentRuntimeInfo) { LOGGER.debug("Agent is requesting registration {}", agentRuntimeInfo); AgentInstance agentInstance = agentInstances.register(agentRuntimeInfo); Registration registration = agentInstance.assignCertification(); if (agentInstance.isRegistered()) { agentConfigService.saveOrUpdateAgent(agentInstance, username); LOGGER.debug("New Agent approved {}", agentRuntimeInfo); } return registration; }
Source:
public void continueOrPropagate(RetryableException exception) { failedAttemptsForCurrentServer.increment(); if (backoffStrategy.backoff(failedAttemptsForCurrentServer.get())) { log.info("{}: {}. Attempt #{} failed for server {}. Retrying the same server.", exception.getCause(), exception.getMessage(), failedAttemptsForCurrentServer, servers.get(currentServer.get())); } else { failedServers.increment(); if (failedServers.get() == servers.size()) { throw exception; } else { log.info("{}: {}. Server #{} ({}) failed times - trying next server", exception.getCause(), exception.getMessage(), failedServers, servers.get(currentServer.get()), failedAttemptsForCurrentServer); currentServer.set((currentServer.get() + 1) % servers.size()); failedAttemptsForCurrentServer.set(0); } } }

Target:
public void continueOrPropagate(RetryableException exception) { failedAttemptsForCurrentServer.increment(); if (backoffStrategy.backoff(failedAttemptsForCurrentServer.get())) { log.info("{}: {}. Attempt #{} failed for server {}. Retrying the same server.", exception.getCause(), exception.getMessage(), failedAttemptsForCurrentServer, servers.get(currentServer.get())); } else { failedServers.increment(); if (failedServers.get() >= servers.size()) { throw exception; } else { log.info("{}: {}. Server #{} ({}) failed times - trying next server", exception.getCause(), exception.getMessage(), failedServers, servers.get(currentServer.get()), failedAttemptsForCurrentServer); currentServer.set((currentServer.get() + 1) % servers.size()); failedAttemptsForCurrentServer.set(0); } } }
Source:
public void shouldSaveNotifySettings() throws Exception { Long accountId = Long.valueOf("12345678"); String fuser = "fuser"; String notifyAPIToken = "a_token"; String notifyTemplateId = "a_template_id"; databaseTestHelper.addGatewayAccount(accountId.toString(), "provider-1", ImmutableMap.of("user", fuser, "password", "word"), "service-name-1", TEST, "description-1", "analytics-id-1"); Optional<GatewayAccountEntity> gatewayAccountOptional = gatewayAccountDao.findById(accountId); assertThat(gatewayAccountOptional.isPresent(), is(true)); GatewayAccountEntity gatewayAccountEntity = gatewayAccountOptional.get(); assertThat(gatewayAccountEntity.getNotifySettings(), is(nullValue())); Map<String, String> notifySettings = ImmutableMap.of("notify_api_token", notifyAPIToken, "notify_template_id", notifyTemplateId); gatewayAccountEntity.setNotifySettings(notifySettings); gatewayAccountDao.merge(gatewayAccountEntity); gatewayAccountOptional = gatewayAccountDao.findById(accountId); assertThat(gatewayAccountOptional.isPresent(), is(true)); gatewayAccountEntity = gatewayAccountOptional.get(); assertThat(gatewayAccountEntity.getNotifySettings().size(), is(2)); assertThat(gatewayAccountEntity.getNotifySettings().get("notify_api_token"), is(notifyAPIToken)); assertThat(gatewayAccountEntity.getNotifySettings().get("notify_template_id"), is(notifyTemplateId)); }

Target:
public void shouldSaveNotifySettings() throws Exception { Long accountId = Long.valueOf("12345678"); String fuser = "fuser"; String notifyAPIToken = "a_token"; String notifyTemplateId = "a_template_id"; databaseTestHelper.addGatewayAccount(accountId.toString(), "provider-1", ImmutableMap.of("user", fuser, "password", "word"), "service-name-1", TEST, "description-1", "analytics-id-1"); Optional<GatewayAccountEntity> gatewayAccountOptional = gatewayAccountDao.findById(accountId); assertThat(gatewayAccountOptional.isPresent(), is(true)); GatewayAccountEntity gatewayAccountEntity = gatewayAccountOptional.get(); assertThat(gatewayAccountEntity.getNotifySettings(), is(nullValue())); Map<String, String> notifySettings = ImmutableMap.of("notify_api_token", notifyAPIToken, "notify_template_id", notifyTemplateId); gatewayAccountEntity.setNotifySettings(notifySettings); gatewayAccountDao.merge(gatewayAccountEntity); notifySettings = databaseTestHelper.getNotifySettings(accountId); assertThat(notifySettings.size(), is(2)); assertThat(notifySettings.get("notify_api_token"), is(notifyAPIToken)); assertThat(notifySettings.get("notify_template_id"), is(notifyTemplateId)); }
Source:
public Object invoke(MethodInvocation invocation) throws Throwable { MessageProperties messageProperties = new MessageProperties(); messageProperties.setHeader(Constants.INVOKED_METHOD_HEADER_NAME, methodHeaderNamingStrategy.generateMethodName(invocation.getMethod())); Message m = getMessageConverter().toMessage(invocation.getArguments(), messageProperties); Message resultMessage; if (getRoutingKey() == null) { resultMessage = amqpTemplate.sendAndReceive(m); } else { resultMessage = amqpTemplate.sendAndReceive(getRoutingKey(), m); } Object result = getMessageConverter().fromMessage(resultMessage); if (invocation.getMethod().getReturnType().getCanonicalName().equals(Void.class.getCanonicalName())) { return null; } else if (result instanceof Throwable && !invocation.getMethod().getReturnType().isAssignableFrom(result.getClass())) { throw (Throwable) result; } else { return result; } }

Target:
public Object invoke(MethodInvocation invocation) throws Throwable { RemoteInvocation remoteInvocation = getRemoteInvocationFactory().createRemoteInvocation(invocation); Object rawResult; if (getRoutingKey() == null) { rawResult = amqpTemplate.convertSendAndReceive(remoteInvocation); } else { rawResult = amqpTemplate.convertSendAndReceive(routingKey, remoteInvocation); } if (rawResult == null) { throw new RemoteProxyFailureException("No reply received - perhaps a timeout in the template?", null); } else if (!(rawResult instanceof RemoteInvocationResult)) { throw new RemoteProxyFailureException("Expected a result of type " + RemoteInvocationResult.class.getCanonicalName() + " but found " + rawResult.getClass().getCanonicalName(), null); } RemoteInvocationResult result = (RemoteInvocationResult) rawResult; return result.recreate(); }
Source:
public void stop(@Nonnull Throwable cause) { boolean cleaned = LockableResourcesManager.get().unqueueContext(getContext()); if (!cleaned) { LOGGER.log(Level.WARNING, "Cannot remove context from lockable resource witing list. The context is not in the waiting list."); } getContext().onFailure(cause); }

Target:
public void stop(@Nonnull Throwable cause) { boolean cleaned = LockableResourcesManager.get().unqueueContext(getContext()); if (!cleaned) { LOGGER.log(Level.WARNING, "Cannot remove context from lockable resource waiting list. The context is not in the waiting list."); } getContext().onFailure(cause); }
Source:
private void watchFiles (IotasConfiguration iotasConfiguration, CatalogService catalogService) { FileEventHandler customProcessorUploadHandler = new CustomProcessorUploadHandler(iotasConfiguration.getCustomProcessorWatchPath(), iotasConfiguration .getCustomProcessorUploadFailPath(), iotasConfiguration.getCustomProcessorUploadSuccessPath(), catalogService); List<FileEventHandler> fileEventHandlers = new ArrayList<>(); fileEventHandlers.add(customProcessorUploadHandler); final FileWatcher fileWatcher = new FileWatcher(fileEventHandlers); fileWatcher.register(); Thread thread = new Thread(new Runnable() { @Override public void run() { while (fileWatcher.processEvents()) { } } }); thread.start(); }

Target:
private void watchFiles (IotasConfiguration iotasConfiguration, CatalogService catalogService) { if (iotasConfiguration.getCustomProcessorWatchPath() == null || iotasConfiguration.getCustomProcessorUploadFailPath() == null || iotasConfiguration .getCustomProcessorUploadSuccessPath() == null) { return; } FileEventHandler customProcessorUploadHandler = new CustomProcessorUploadHandler(iotasConfiguration.getCustomProcessorWatchPath(), iotasConfiguration .getCustomProcessorUploadFailPath(), iotasConfiguration.getCustomProcessorUploadSuccessPath(), catalogService); List<FileEventHandler> fileEventHandlers = new ArrayList<>(); fileEventHandlers.add(customProcessorUploadHandler); final FileWatcher fileWatcher = new FileWatcher(fileEventHandlers); fileWatcher.register(); Thread thread = new Thread(new Runnable() { @Override public void run() { while (fileWatcher.processEvents()) { } } }); thread.start(); }
Source:
public void validateSecretConfigReferences(PluggableSCMMaterial pluggableSCMMaterial) { SCM scmConfig = pluggableSCMMaterial.getScmConfig(); SecretParams secretParams = pluggableSCMMaterial.getSecretParams(); if (secretParams.isEmpty()) { LOGGER.debug("No secret params available in pluggable SCM {}.", pluggableSCMMaterial.getDisplayName()); return; } HashMap<CaseInsensitiveString, StringBuilder> pipelinesWithErrors = new HashMap<>(); String scmConfigName = scmConfig.getName(); secretParams.groupBySecretConfigId() .forEach((secretConfigId, secretParamsToResolve) -> { SecretConfig secretConfig = goConfigService.getSecretConfigById(secretConfigId); if (secretConfig == null) { addError(pipelinesWithErrors, new CaseInsensitiveString(scmConfigName), format("Pluggable SCM '%s' is referring to none-existent secret config '%s'.", scmConfigName, secretConfigId)); } else if (!secretConfig.canRefer(scmConfig.getClass(), scmConfigName)) { addError(pipelinesWithErrors, new CaseInsensitiveString(scmConfigName), format("Pluggable SCM '%s' does not have permission to refer to secrets using secret config '%s'", scmConfigName, secretConfigId)); } }); StringBuilder errorMessage = new StringBuilder(); if (!pipelinesWithErrors.isEmpty()) { errorMessage.append(StringUtils.join(pipelinesWithErrors.values(), '\n').trim()); LOGGER.error("[Material Update] Failure: {}", errorMessage.toString()); throw new RulesViolationException(errorMessage.toString()); } }

Target:
public void validateSecretConfigReferences(PluggableSCMMaterial pluggableSCMMaterial) { Map<CaseInsensitiveString, StringBuilder> errors = validate(pluggableSCMMaterial.getScmConfig()); if (!errors.isEmpty()) { throw new RulesViolationException(errorString(errors)); } }
Source:
public void testNoteEdgeCreation() { diagram.addNode(aClassNode, new Point2D.Double(5, 5)); diagram.addNode(aInterfaceNode, new Point2D.Double(44, 44)); diagram.addNode(aPackageNode, new Point2D.Double(87, 87)); diagram.addNode(aNoteNode, new Point2D.Double(134, 132)); NoteEdge noteEdge1 = new NoteEdge(); NoteEdge noteEdge2 = new NoteEdge(); diagram.addEdge(noteEdge1, new Point2D.Double(9, 9), new Point2D.Double(209,162)); assertEquals(0, diagram.getEdges().size()); diagram.addEdge(noteEdge1, new Point2D.Double(9, 9), new Point2D.Double(139,142)); assertEquals(1, diagram.getEdges().size()); assertEquals(noteEdge1.getStart(), aClassNode); assertEquals(noteEdge1.getEnd(), aNoteNode); diagram.addEdge(noteEdge2, new Point2D.Double(138, 140), new Point2D.Double(9,9)); assertEquals(noteEdge2.getStart(), aNoteNode); assertEquals(noteEdge2.getEnd().getClass(), new PointNode().getClass()); assertEquals(2, diagram.getEdges().size()); }

Target:
public void testNoteEdgeCreation() { aDiagram.addNode(aClassNode, new Point2D.Double(5, 5)); aDiagram.addNode(aInterfaceNode, new Point2D.Double(44, 44)); aDiagram.addNode(aPackageNode, new Point2D.Double(87, 87)); aDiagram.addNode(aNoteNode, new Point2D.Double(134, 132)); NoteEdge noteEdge1 = new NoteEdge(); NoteEdge noteEdge2 = new NoteEdge(); aDiagram.addEdge(noteEdge1, new Point2D.Double(9, 9), new Point2D.Double(209,162)); assertEquals(0, aDiagram.getEdges().size()); aDiagram.addEdge(noteEdge1, new Point2D.Double(9, 9), new Point2D.Double(139,142)); assertEquals(1, aDiagram.getEdges().size()); assertEquals(noteEdge1.getStart(), aClassNode); assertEquals(noteEdge1.getEnd(), aNoteNode); aDiagram.addEdge(noteEdge2, new Point2D.Double(138, 140), new Point2D.Double(9,9)); assertEquals(noteEdge2.getStart(), aNoteNode); assertEquals(noteEdge2.getEnd().getClass(), new PointNode().getClass()); assertEquals(2, aDiagram.getEdges().size()); }
Source:
public void testValidateSnapshotVersionWithInvalidVersions() { assertInvalidSnapshotVersion("1.2.3-SNAPSHOT", "1.2.3", "OSGi version 1.2.3 must have .qualifier qualifier for SNAPSHOT builds"); assertInvalidSnapshotVersion("1.2.3-SNAPSHOT", "1.2.3", "OSGi version 1.2.3 must have .qualifier qualifier for SNAPSHOT builds"); assertInvalidSnapshotVersion("1.2.3-SNAPSHOT", "1.2.0.qualifier", "Unqualified OSGi version 1.2.0.qualifier must match unqualified Maven version 1.2.3-SNAPSHOT for SNAPSHOT builds"); assertInvalidSnapshotVersion("1.2.3.qualifier", "1.2.3.qualifier", "Maven version 1.2.3.qualifier must have -SNAPSHOT qualifier for SNAPSHOT builds"); assertInvalidSnapshotVersion("1.2.3-SNAPSHOT", "1.2.3.SHAPSHOT", "OSGi version 1.2.3.SHAPSHOT must have .qualifier qualifier for SNAPSHOT builds"); }

Target:
public void testValidateSnapshotVersionWithInvalidVersions() { assertInvalidSnapshotVersion("1.2.3-SNAPSHOT", "1.2.3", "OSGi version 1.2.3 must have .qualifier qualifier for SNAPSHOT builds"); assertInvalidSnapshotVersion("1.2.3-SNAPSHOT", "1.2.0.qualifier", "Unqualified OSGi version 1.2.0.qualifier must match unqualified Maven version 1.2.3-SNAPSHOT for SNAPSHOT builds"); assertInvalidSnapshotVersion("1.2.3.qualifier", "1.2.3.qualifier", "Maven version 1.2.3.qualifier must have -SNAPSHOT qualifier for SNAPSHOT builds"); assertInvalidSnapshotVersion("1.2.3-SNAPSHOT", "1.2.3.SHAPSHOT", "OSGi version 1.2.3.SHAPSHOT must have .qualifier qualifier for SNAPSHOT builds"); }
Source:
public void setServers(Set<String> servers) { if (servers.equals(serverPoolReference.get().getServers())) { log.debug("Server pool already contains same list of servers: {}", StringUtils.join(servers, ",")); return; } log.info("Setting server pool to a list of servers: [{}]", servers.size(), StringUtils.join(servers, ",")); serverPoolReference.set(new ServerPool(servers)); if (servers.isEmpty()) { log.warn("No servers are currently available to connect."); } else if (log.isDebugEnabled()) { log.info("Server pool was updated to contain servers: [{}].", servers.size(), StringUtils.join(servers, ",")); } }

Target:
public void setServers(Set<String> servers) { if (servers.equals(serverPoolReference.get().getServers())) { if (log.isDebugEnabled()) { log.debug("Server pool already contains same list of servers: {}", StringUtils.join(servers, ",")); } return; } if (log.isInfoEnabled()) { log.info("Setting server pool to a list of servers: [{}]", servers.size(), StringUtils.join(servers, ",")); } serverPoolReference.set(new ServerPool(servers)); if (servers.isEmpty()) { log.warn("No servers are currently available to connect."); } }
Source:
AbstractValidationContext( ConstraintValidatorManager constraintValidatorManager, ConstraintValidatorFactory constraintValidatorFactory, ValidatorScopedContext validatorScopedContext, TraversableResolver traversableResolver, HibernateConstraintValidatorInitializationContext constraintValidatorInitializationContext, T rootBean, Class<T> rootBeanClass, BeanMetaData<T> rootBeanMetaData, boolean disableAlreadyValidatedBeanTracking ) { this.constraintValidatorManager = constraintValidatorManager; this.validatorScopedContext = validatorScopedContext; this.constraintValidatorFactory = constraintValidatorFactory; this.traversableResolver = traversableResolver; this.constraintValidatorInitializationContext = constraintValidatorInitializationContext; this.rootBean = rootBean; this.rootBeanClass = rootBeanClass; this.rootBeanMetaData = rootBeanMetaData; this.processedGroupUnits = new HashSet<>(); this.processedPathUnits = new HashSet<>(); this.processedPathsPerBean = new IdentityHashMap<>(); this.failingConstraintViolations = newHashSet(); this.disableAlreadyValidatedBeanTracking = disableAlreadyValidatedBeanTracking; }

Target:
protected AbstractValidationContext( ConstraintValidatorManager constraintValidatorManager, ConstraintValidatorFactory constraintValidatorFactory, ValidatorScopedContext validatorScopedContext, TraversableResolver traversableResolver, HibernateConstraintValidatorInitializationContext constraintValidatorInitializationContext, T rootBean, Class<T> rootBeanClass, BeanMetaData<T> rootBeanMetaData, boolean disableAlreadyValidatedBeanTracking ) { this.constraintValidatorManager = constraintValidatorManager; this.validatorScopedContext = validatorScopedContext; this.constraintValidatorFactory = constraintValidatorFactory; this.traversableResolver = traversableResolver; this.constraintValidatorInitializationContext = constraintValidatorInitializationContext; this.rootBean = rootBean; this.rootBeanClass = rootBeanClass; this.rootBeanMetaData = rootBeanMetaData; this.processedGroupUnits = new HashSet<>(); this.processedPathUnits = new HashSet<>(); this.processedPathsPerBean = new IdentityHashMap<>(); this.failingConstraintViolations = newHashSet(); this.disableAlreadyValidatedBeanTracking = disableAlreadyValidatedBeanTracking; }
Source:
private void setupFocusHandling() { focusListener = new IWindowListener() { private void updateUiState() { Display.getCurrent().asyncExec(new Runnable() { @Override public void run() { boolean wasActive = uiIsActive; uiIsActive = Display.getCurrent().getActiveShell() != null; if (uiIsActive != wasActive && GitTraceLocation.REPOSITORYCHANGESCANNER .isActive()) traceUiIsActive(); } private void traceUiIsActive() { StringBuilder message = new StringBuilder( "workbench is "); message.append(uiIsActive ? "active" : "inactive"); GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER .getLocation(), message.toString()); } }); } @Override public void windowOpened(IWorkbenchWindow window) { updateUiState(); } @Override public void windowDeactivated(IWorkbenchWindow window) { updateUiState(); } @Override public void windowClosed(IWorkbenchWindow window) { updateUiState(); } @Override public void windowActivated(IWorkbenchWindow window) { updateUiState(); if (rcs.doReschedule) { rcs.schedule(500); } refreshJob.triggerRefresh(); } }; Job job = new Job(UIText.Activator_setupFocusListener) { @Override protected IStatus run(IProgressMonitor monitor) { if (PlatformUI.isWorkbenchRunning()) PlatformUI.getWorkbench().addWindowListener(focusListener); else schedule(1000L); return Status.OK_STATUS; } }; job.schedule(); }

Target:
private void setupFocusHandling() { focusListener = new IWindowListener() { private void updateUiState() { Display.getCurrent().asyncExec(new Runnable() { @Override public void run() { boolean wasActive = uiIsActive; uiIsActive = Display.getCurrent().getActiveShell() != null; if (uiIsActive != wasActive && GitTraceLocation.REPOSITORYCHANGESCANNER .isActive()) traceUiIsActive(); } private void traceUiIsActive() { StringBuilder message = new StringBuilder( "workbench is "); message.append(uiIsActive ? "active" : "inactive"); GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER .getLocation(), message.toString()); } }); } @Override public void windowOpened(IWorkbenchWindow window) { updateUiState(); } @Override public void windowDeactivated(IWorkbenchWindow window) { updateUiState(); } @Override public void windowClosed(IWorkbenchWindow window) { updateUiState(); } @Override public void windowActivated(IWorkbenchWindow window) { updateUiState(); rcs.schedule(500); refreshJob.triggerRefresh(); } }; Job job = new Job(UIText.Activator_setupFocusListener) { @Override protected IStatus run(IProgressMonitor monitor) { if (PlatformUI.isWorkbenchRunning()) PlatformUI.getWorkbench().addWindowListener(focusListener); else schedule(1000L); return Status.OK_STATUS; } }; job.schedule(); }
Source:
public void run() { while (!Thread.currentThread().isInterrupted()) { try { final OperatorChain query = operatorChainManager.pickOperatorChain(); if (query != null) { query.processNextEvent(); } else { Thread.currentThread().sleep(pollingIntervalMillisecond); } } catch (final Exception t) { try { throw t; } catch (final InterruptedException e) { return; } } } }

Target:
public void run() { try { while (!Thread.currentThread().isInterrupted()) { final OperatorChain query = operatorChainManager.pickOperatorChain(); if (query != null) { query.processNextEvent(); } else { Thread.currentThread().sleep(pollingIntervalMillisecond); } } } catch (final InterruptedException e) { return; } }
Source:
public ASTLambdaParameter(int id) { super(id); }

Target:
ASTLambdaParameter(int id) { super(id); }
Source:
public void logVolumeMessage(final GlusterVolumeEntity volume, final AuditLogType logType) { logAuditMessage(volume.getClusterId(), volume, null, logType, new HashMap<String, String>()); }

Target:
public void logVolumeMessage(final GlusterVolumeEntity volume, final AuditLogType logType) { logAuditMessage(volume.getClusterId(), volume, null, logType, Collections.<String, String> emptyMap()); }
Source:
private void loadAllProjects() { final List<Path> projects = new ArrayList<>(); for (final File project : this.projectCacheDir.listFiles(new FilenameFilter() { String pattern = "[0-9]+\\.[0-9]+"; @Override public boolean accept(final File dir, final String name) { return name.matches(this.pattern); } })) { if (project.exists() && project.isDirectory()) { if (!projectsUnderDeletion.containsKey(project.toPath())) { ProjectDirectoryMetadata projectDirectoryMetadata = fetchProjectMetadata(project.toPath()); if (projectDirectoryMetadata != null) { cachedProjects.put(project.toPath(), projectDirectoryMetadata); } } } } }

Target:
private void loadAllProjects() { final List<Path> projects = new ArrayList<>(); for (final File project : Objects .requireNonNull(this.projectCacheDir.listFiles(new FilenameFilter() { String pattern = "[0-9]+\\.[0-9]+"; @Override public boolean accept(final File dir, final String name) { return name.matches(this.pattern); } }))) { if (project.exists() && project.isDirectory() && !projectsUnderDeletion.containsKey(project.toPath())) { ProjectDirectoryMetadata projectDirectoryMetadata = fetchProjectMetadata(project.toPath()); if (projectDirectoryMetadata != null) { cachedProjects.put(project.toPath(), projectDirectoryMetadata); } } } }
Source:
public void testHealthCheck(String host, String opHost) { LOG.debug("Test Health Check- "+host+opHost + "Response ::"); String resp=Tester.newClient(host).healthCheck(); assertNotNull(resp); assertEquals("{\"status\":\"running\"}",resp); }

Target:
public void testHealthCheck(String host, String opHost) { String resp = Tester.newClient(host).healthCheck(); assertNotNull(resp); assertEquals("{\"status\":\"running\"}", resp); }
Source:
private void mergeSegment(PlatformOutboundInstruction platformOutboundInstruction) { EventProcessorSegmentReference mergeSegment = platformOutboundInstruction.getMergeEventProcessorSegment(); String processorName = mergeSegment.getProcessorName(); int segmentId = mergeSegment.getSegmentIdentifier(); try { eventProcessorController.mergeSegment(processorName, segmentId); resultPublisher.publishSuccessFor(platformOutboundInstruction.getInstructionId()); } catch (Exception e) { logger.error("Failed to merge segment for processor [{}]", segmentId, processorName, e); resultPublisher.publishFailureFor(platformOutboundInstruction.getInstructionId(), e); } }

Target:
private void mergeSegment(PlatformOutboundInstruction platformOutboundInstruction) { EventProcessorSegmentReference mergeSegment = platformOutboundInstruction.getMergeEventProcessorSegment(); String processorName = mergeSegment.getProcessorName(); int segmentId = mergeSegment.getSegmentIdentifier(); String errorMessage = format("Failed to merge segment [%s] for processor [%s]", segmentId, processorName); try { if (!eventProcessorController.mergeSegment(processorName, segmentId)) { throw new RuntimeException(errorMessage); } resultPublisher.publishSuccessFor(platformOutboundInstruction.getInstructionId()); } catch (Exception e) { logger.error(errorMessage, e); resultPublisher.publishFailureFor(platformOutboundInstruction.getInstructionId(), e); } }
Source:
private static String getLastSpottedUsername(final List<LogEntry> logsEntries) { for (LogEntry log: logsEntries) { if (log.getType() == LogType.NOTE) { continue; } if (log.getType() == LogType.GRABBED_IT || log.getType() == LogType.VISIT) { return log.author; } break; } return CgeoApplication.getInstance().getString(R.string.user_unknown); }

Target:
static String getLastSpottedUsername(final List<LogEntry> logsEntries) { for (final LogEntry log: logsEntries) { final LogType logType = log.getType(); if (logType == LogType.GRABBED_IT || logType == LogType.VISIT) { return log.author; } if (logType != LogType.NOTE) { break; } } return CgeoApplication.getInstance().getString(R.string.user_unknown); }
Source:
public void parseExceptionTest() { ListPanel issuePanel = find("#dummy/dummy_col0"); click("#dummy/dummy_col0_filterTextField"); selectAll(); type("milestone:"); push(KeyCode.ENTER); assertEquals(issuePanel.getIssueCount(), 10); click("#dummy/dummy_col0_filterTextField"); selectAll(); type("m:"); push(KeyCode.ENTER); assertEquals(issuePanel.getIssueCount(), 10); }

Target:
public void parseExceptionTest() { ListPanel issuePanel = find("#dummy/dummy_col0"); click("#dummy/dummy_col0_filterTextField"); selectAll(); type("milestone:"); push(KeyCode.ENTER); assertEquals(issuePanel.getIssueCount(), 10); }
Source:
public void stop(long timeout) throws InterruptedException { long startTime = System.currentTimeMillis(); long usedMs = 0; stop = true; for (Thread thread : threads) { if (timeout != 0) { usedMs = System.currentTimeMillis() - startTime; if (usedMs >= timeout) { StringBuilder msg = new StringBuilder("Timeout while waiting for testing threads to stop."); Thread.State threadState = thread.getState(); if (threadState != Thread.State.TERMINATED) { msg.append(" Thread '") .append(thread.getName()) .append("' is still in a state '") .append(threadState) .append("'."); } log.warning(msg.toString()); break; } } thread.join(timeout - usedMs); } threads.clear(); }

Target:
public void stop(long timeout) throws InterruptedException, TimeoutException { long startTime = System.currentTimeMillis(); long usedMs = 0; stop = true; try { for (Thread thread : threads) { if (timeout != 0) { usedMs = System.currentTimeMillis() - startTime; if (usedMs >= timeout) { onTimeout(thread); } } thread.join(timeout - usedMs); } } finally { threads.clear(); } }
Source:
protected void addVmNumaNodes() { List<VdsNumaNode> numaNodes = new ArrayList<VdsNumaNode>(); for (VmNumaNode vnode : DbFacade.getInstance().getVmNumaNodeDAO().getAllVmNumaNodeByVmId(getVmId())) { for (Pair<Guid, Pair<Boolean, Integer>> pair : vnode.getVdsNumaNodeList()) { pair.setFirst(null); pair.getSecond().setFirst(false); } numaNodes.add(vnode); } DbFacade.getInstance().getVmNumaNodeDAO().massSaveNumaNode(numaNodes, null, getVmTemplateId()); }

Target:
protected void addVmNumaNodes() { List<VmNumaNode> vmList = DbFacade.getInstance().getVmNumaNodeDAO().getAllVmNumaNodeByVmId(getVmId()); if (vmList != null && vmList.size() > 0) { List<VmNumaNode> templateList = new ArrayList<>(); for (VmNumaNode vnode : vmList) { List<Pair<Guid, Pair<Boolean, Integer>>> pairs = vnode.getVdsNumaNodeList(); if (pairs != null && pairs.size() > 0) { for (Pair<Guid, Pair<Boolean, Integer>> pair : pairs) { pair.setFirst(null); pair.getSecond().setFirst(false); } } templateList.add(vnode); } VmNumaNodeOperationParameters params = new VmNumaNodeOperationParameters(getVmTemplateId(), templateList); getBackend().runInternalAction(VdcActionType.AddVmNumaNodes, params); } }
Source:
private void handleLedgerEviction(RemovalNotification<Long, TransientLedgerInfo> notification) { TransientLedgerInfo fileInfo = notification.getValue(); if (null == fileInfo || null == notification.getKey()) { return; } fileInfo.close(); }

Target:
private void handleLedgerEviction(RemovalNotification<Long, TransientLedgerInfo> notification) { TransientLedgerInfo ledgerInfo = notification.getValue(); if (null == ledgerInfo || null == notification.getKey()) { return; } ledgerInfo.close(); }
Source:
public List<JobConfig> prepareJobs() throws Exception { ExecutionPlan plan = getExecutionPlan(); String executionPlanJson = plan.getPlanAsJson(); writePlanJsonFile(executionPlanJson); LOG.info("Execution Plan: \n" + executionPlanJson); String planId = String.valueOf(executionPlanJson.hashCode()); List<JobConfig> jobConfigs = plan.getJobConfigs(); if (jobConfigs.isEmpty()) { throw new SamzaException("No jobs in the plan."); } JobConfig jobConfig = jobConfigs.get(0); StreamManager streamManager = null; try { streamManager = buildAndStartStreamManager(jobConfig); createStreams(planId, plan.getIntermediateStreams(), streamManager); } finally { if (streamManager != null) { streamManager.stop(); } } return jobConfigs; }

Target:
public List<JobConfig> prepareJobs() { ExecutionPlan plan = getExecutionPlan(); String executionPlanJson = ""; try { executionPlanJson = plan.getPlanAsJson(); } catch (Exception e) { throw new SamzaException("Failed to create plan JSON.", e); } writePlanJsonFile(executionPlanJson); LOG.info("Execution Plan: \n" + executionPlanJson); String planId = String.valueOf(executionPlanJson.hashCode()); List<JobConfig> jobConfigs = plan.getJobConfigs(); if (jobConfigs.isEmpty()) { throw new SamzaException("No jobs in the plan."); } JobConfig jobConfig = jobConfigs.get(0); StreamManager streamManager = null; try { streamManager = buildAndStartStreamManager(jobConfig); createStreams(planId, plan.getIntermediateStreams(), streamManager); } finally { if (streamManager != null) { streamManager.stop(); } } return jobConfigs; }
Source:
protected Request mutateInstanceForVersion(Request instance, Version version) { if (version.before(Version.V_7_8_0)) { return new Request(); } if (version.before(Version.CURRENT)) { Request request = new Request(); request.setRequestsPerSecond(instance.getRequestsPerSecond()); request.setTimeout(instance.getTimeout()); return request; } return instance; }

Target:
protected Request mutateInstanceForVersion(Request instance, Version version) { if (version.before(Version.V_7_8_0)) { return new Request(); } if (version.before(Version.V_8_0_0)) { Request request = new Request(); request.setRequestsPerSecond(instance.getRequestsPerSecond()); request.setTimeout(instance.getTimeout()); return request; } return instance; }
Source:
private byte[] generate(int size, int nullAt) { byte[] data = new byte[size]; for (int i = 0; i < data.length; i++) { data[i] = (byte) ((i % 72 == 0) ? '\n' : (i%10) + '0'); } if (nullAt >= 0) { data[nullAt] = '\0'; } return data; }

Target:
private static byte[] generate(int size, int nullAt) { byte[] data = new byte[size]; for (int i = 0; i < data.length; i++) { data[i] = (byte) ((i % 72 == 0) ? '\n' : (i%10) + '0'); } if (nullAt >= 0) { data[nullAt] = '\0'; } return data; }
Source:
public Response deleteInsertion(@PathParam("insertionUuid") long insertionUuid) throws Exception { ArtifactReadable insertion = atsServer.getQuery().andUuid(insertionUuid).getResults().getExactlyOne(); return atsServer.getConfigItemFactory().deleteInsertion(insertion) ? Response.ok().build() : Response.notModified().build(); }

Target:
public Response deleteInsertion(@PathParam("insertionUuid") long insertionUuid) throws Exception { ArtifactReadable insertion = atsServer.getArtifactByUuid(insertionUuid); if (insertion == null) { throw new OseeCoreException("Given insertion uuid not found"); } atsServer.getConfigItemFactory().deleteInsertion(insertion); return Response.ok().build(); }
Source:
private void assertThatGcGraceSecondsIs(CassandraKeyValueService kvs, int gcGraceSeconds) throws TException { List<CfDef> knownCfs = kvs.getClientPool().runWithRetry(client -> client.describe_keyspace("atlasdb").getCf_defs()); CfDef clusterSideCf = Iterables.getOnlyElement(knownCfs.stream() .filter(cf -> cf.getName().equals(getInternalTestTableName())) .collect(Collectors.toList())); assertThat(clusterSideCf.gc_grace_seconds == gcGraceSeconds, is(true)); }

Target:
private void assertThatGcGraceSecondsIs(CassandraKeyValueService kvs, int gcGraceSeconds) throws TException { List<CfDef> knownCfs = kvs.getClientPool().runWithRetry(client -> client.describe_keyspace("atlasdb").getCf_defs()); CfDef clusterSideCf = Iterables.getOnlyElement(knownCfs.stream() .filter(cf -> cf.getName().equals(getInternalTestTableName())) .collect(Collectors.toList())); assertThat(clusterSideCf.gc_grace_seconds, equalTo(gcGraceSeconds)); }
Source:
private void updateFilteredItems() { preferencesService.storeInBackground(); boolean showPasswordProtectedGames = showPasswordProtectedGamesCheckBox.isSelected(); boolean showModdedGames = showModdedGamesCheckBox.isSelected(); filteredItems.setPredicate(OPEN_CUSTOM_GAMES_PREDICATE .and(gameInfoBean -> (showPasswordProtectedGames || !gameInfoBean.isPasswordProtected()) && (showModdedGames || gameInfoBean.getSimMods().isEmpty())) .and(rangePredicate)); }

Target:
private void updateFilteredItems() { preferencesService.storeInBackground(); filteredItems.setPredicate(getGamePredicate()); }
Source:
public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.next) { FragmentManager fragmentManager = getFragmentManager(); if (fragmentManager != null) { AddUserBrickFragment addUserBrickFragment = (AddUserBrickFragment) getFragmentManager().findFragmentByTag(AddUserBrickFragment.TAG); getFragmentManager().popBackStackImmediate(); if (addUserBrickFragment != null) { addUserBrickFragment.addUserDataToUserBrick(new StringOption(Objects.requireNonNull(addUserDataUserBrickEditText.getText()).toString()), isAddInputOrLabel); } } } return super.onOptionsItemSelected(item); }

Target:
public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.next) { FragmentManager fragmentManager = getFragmentManager(); if (fragmentManager != null) { AddUserBrickFragment addUserBrickFragment = (AddUserBrickFragment) getFragmentManager().findFragmentByTag(AddUserBrickFragment.TAG); getFragmentManager().popBackStackImmediate(); if (addUserBrickFragment != null && addUserDataUserBrickEditText.getText() != null) { addUserBrickFragment.addUserDataToUserBrick(new StringOption(addUserDataUserBrickEditText.getText().toString()), isAddInputOrLabel); } } } return super.onOptionsItemSelected(item); }
Source:
public void onChunkLoaded(Vector3i chunkCoordinates) { if (renderableRegion.encompasses(chunkCoordinates)) { Chunk chunk = chunkProvider.getChunk(chunkCoordinates); if (chunk == null) { logger.warn("Warning: onChunkLoaded called for a null chunk!"); } else { chunksInProximityOfCamera.add(chunk); Collections.sort(chunksInProximityOfCamera, new ChunkFrontToBackComparator()); } } }

Target:
public void onChunkLoaded(Vector3i chunkCoordinates) { if (renderableRegion.encompasses(chunkCoordinates)) { Chunk chunk = chunkProvider.getChunk(chunkCoordinates); if (chunk != null) { chunksInProximityOfCamera.add(chunk); Collections.sort(chunksInProximityOfCamera, new ChunkFrontToBackComparator()); } else { logger.warn("Warning: onChunkLoaded called for a null chunk!"); } } }
Source:
private Optional<TableToSweep> attemptToChooseTable(SweepPriorityOverrideConfig overrideConfig) { List<TableReference> priorityTableRefs = overrideConfig.priorityTablesAsList().stream() .map(TableReference::createFromFullyQualifiedName) .collect(Collectors.toList()); Collections.shuffle(priorityTableRefs); return attemptToChooseTableFromList(priorityTableRefs, "it is on the sweep priority list"); }

Target:
private Optional<TableToSweep> attemptToChooseTable(SweepPriorityOverrideConfig overrideConfig) { List<TableReference> priorityTableRefs = overrideConfig.priorityTablesAsList().stream() .map(TableReference::createFromFullyQualifiedName) .collect(Collectors.toList()); Collections.shuffle(priorityTableRefs); return attemptToChooseTableFromPrioritisedList(priorityTableRefs, "it is on the sweep priority list"); }
Source:
public void setUp() { when(downloadBatchId.rawId()).thenReturn("my-movie"); liteBatchFileBuilder = new LiteBatchFileBuilder( storageRoot, downloadBatchId, ANY_NETWORK_ADDRESS ); }

Target:
public void setUp() { given(downloadBatchId.rawId()).willReturn("my-movie"); }
Source:
public LegacyTxDataSourceImpl buildCommonPool(Integer minPoolSize, Integer initialPoolSize, Integer maxPoolSize, Boolean prefill, Boolean useStrictMin, FlushStrategy flushStrategy) throws Exception { pool = new DsPoolImpl(minPoolSize, initialPoolSize, maxPoolSize, prefill, useStrictMin, flushStrategy, false, null, Defaults.FAIR, null); return this; }

Target:
public LegacyTxDataSourceImpl buildCommonPool(Integer minPoolSize, Integer initialPoolSize, Integer maxPoolSize, Boolean prefill, Boolean useStrictMin, FlushStrategy flushStrategy) throws Exception { pool = new DsPoolImpl(minPoolSize, initialPoolSize, maxPoolSize, prefill, useStrictMin, flushStrategy, false, null, null, null); return this; }
Source:
void sleep(long msToSleep) throws InterruptedException; } private Sleeper sleeper; PrimaryHandler(TcpHandler fallbackHandler, int locatorWaitTime, Sleeper sleeper) { this.locatorWaitTime = locatorWaitTime; this.fallbackHandler = fallbackHandler; this.sleeper = sleeper; allHandlers.add(fallbackHandler); }

Target:
void sleep(long msToSleep) throws InterruptedException; } @FunctionalInterface interface MillisecondProvider { long millisecondTime(); }
Source:
public CauseOfBlockage getCauseOfBlockage() { long diff = System.currentTimeMillis() - timestamp.getTimeInMillis(); if (diff <= 10000) return CauseOfBlockage.fromMessage(Messages._Queue_InQuietPeriod(Util.getTimeSpanString(diff))); else return CauseOfBlockage.fromMessage(Messages._Queue_Unknown()); }

Target:
public CauseOfBlockage getCauseOfBlockage() { long diff = timestamp.getTimeInMillis() - System.currentTimeMillis(); if (diff >= 0) return CauseOfBlockage.fromMessage(Messages._Queue_InQuietPeriod(Util.getTimeSpanString(diff))); else return CauseOfBlockage.fromMessage(Messages._Queue_FinishedWaiting()); }
Source:
public void removeType(int typeId) { synchronized (this) { schemas.remove(typeId); } }

Target:
public synchronized void removeType(int typeId) { schemas.remove(typeId); }
Source:
private Object[][] testUmiUtilDataProvider() { return new Object[][]{{ Arrays.asList(new String[]{"AAAA", "AA-AA", "-A-T-A", "AAAAA--", "---A", "---", ""}), Arrays.asList(new String[]{"AAAA", "AAAA", "ATA", "AAAAA", "A", "", ""}) }}; }

Target:
private Object[][] testUmiUtilDataProvider() { return new Object[][]{{ Arrays.asList("AAAA", "AA-AA", "-A-T-A", "AAAAA--", "---A", "---", ""), Arrays.asList("AAAA", "AAAA", "ATA", "AAAAA", "A", "", "") }}; }