auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void removeEverythingPastCancelEvent(final List<SubscriptionBaseEvent> inputEvents) { final SubscriptionBaseEvent cancellationEvent = Iterables.tryFind(inputEvents, new Predicate<SubscriptionBaseEvent>() { @Override public boolean apply(final SubscriptionBaseEvent input) { return input.getType() == EventType.API_USER && ((ApiEvent) input).getApiEventType() == ApiEventType.CANCEL; } }).orNull(); if (cancellationEvent == null) { return; } final Iterator<SubscriptionBaseEvent> it = inputEvents.iterator(); while (it.hasNext()) { final SubscriptionBaseEvent input = it.next(); if (!input.isActive()) { continue; } if (input.getId().compareTo(cancellationEvent.getId()) == 0) { } else if (input.getType() == EventType.API_USER && (((ApiEvent) input).getApiEventType() == ApiEventType.TRANSFER || ((ApiEvent) input).getApiEventType() == ApiEventType.CREATE)) { } else if (input.getType() == EventType.API_USER && (((ApiEvent) input).getApiEventType() == ApiEventType.CANCEL) && !((ApiEvent) input).isFromDisk()) { it.remove(); } else if (input.getEffectiveDate().compareTo(cancellationEvent.getEffectiveDate()) >= 0) { it.remove(); } } }

Target:
private void removeEverythingPastCancelEvent(final List<SubscriptionBaseEvent> inputEvents) { final SubscriptionBaseEvent cancellationEvent = Iterables.tryFind(inputEvents, new Predicate<SubscriptionBaseEvent>() { @Override public boolean apply(final SubscriptionBaseEvent input) { return input.getType() == EventType.API_USER && ((ApiEvent) input).getApiEventType() == ApiEventType.CANCEL; } }).orNull(); if (cancellationEvent == null) { return; } final Iterator<SubscriptionBaseEvent> it = inputEvents.iterator(); while (it.hasNext()) { final SubscriptionBaseEvent input = it.next(); if (!input.isActive()) { continue; } if (input.getId().compareTo(cancellationEvent.getId()) == 0) { } else if (input.getType() == EventType.API_USER && (((ApiEvent) input).getApiEventType() == ApiEventType.TRANSFER || ((ApiEvent) input).getApiEventType() == ApiEventType.CREATE)) { } else if (input.getEffectiveDate().compareTo(cancellationEvent.getEffectiveDate()) >= 0) { it.remove(); } } }
Source:
private ActionCol52 getLinkedActionColumn(final String factType, final String fieldName, final GuidedDecisionTable52 model, final BRLRuleModel helper) { if (factType == null || fieldName == null) { return null; } for (ActionCol52 ac : model.getActionCols()) { if (ac instanceof ActionInsertFactCol52) { final ActionInsertFactCol52 aif = (ActionInsertFactCol52) ac; if (factType.equals(aif.getFactType()) && fieldName.equals(aif.getFactField())) { return ac; } } else if (ac instanceof ActionSetFieldCol52) { final ActionSetFieldCol52 asf = (ActionSetFieldCol52) ac; final String binding = asf.getBoundName(); final String asfFactType = helper.getLHSBindingType(binding); if (factType.equals(asfFactType) && fieldName.equals(asf.getFactField())) { return ac; } } else if (ac instanceof BRLActionColumn) { final BRLActionColumn fragment = (BRLActionColumn) ac; if (hasTemplateKeys(fragment)) { for (BRLActionVariableColumn var : fragment.getChildColumns()) { if (factType.equals(var.getFactType()) && fieldName.equals(var.getFactField())) { return var; } } } else { final Map<String, List<String>> rhsTypeFields = rhsTypeFieldsExtractor.extract(model, fragment.getDefinition()); if (rhsTypeFields.containsKey(factType)) { for (String field : rhsTypeFields.get(factType)) { if (field.equals(fieldName)) { return fragment.getChildColumns().get(0); } } } } } } return null; }

Target:
private ActionCol52 getLinkedActionColumn(final String factType, final String fieldName, final GuidedDecisionTable52 model, final BRLRuleModel helper) { if (factType == null || fieldName == null) { return null; } for (ActionCol52 ac : model.getActionCols()) { if (ac instanceof ActionInsertFactCol52) { final ActionInsertFactCol52 aif = (ActionInsertFactCol52) ac; if (factType.equals(aif.getFactType()) && fieldName.equals(aif.getFactField())) { return ac; } } else if (ac instanceof ActionSetFieldCol52) { final ActionSetFieldCol52 asf = (ActionSetFieldCol52) ac; final String binding = asf.getBoundName(); final String asfFactType = helper.getLHSBindingType(binding); if (factType.equals(asfFactType) && fieldName.equals(asf.getFactField())) { return ac; } } else if (ac instanceof BRLActionColumn) { final BRLActionColumn fragment = (BRLActionColumn) ac; if (hasTemplateKeys(fragment)) { return getLinkedTemplateKeyColumn(fragment, factType, fieldName); } else { return getLinkedDefinitionColumn(model, fragment, factType, fieldName); } } } return null; }
Source:
public DownloadDetailsDTO registerDownload(DownloadRequestParams requestParams, String ip, DownloadDetailsDTO.DownloadType type) { afterInitialisation(); DownloadDetailsDTO dd = new DownloadDetailsDTO(requestParams, ip, type); persistentQueueDAO.addDownloadToQueue(dd); currentDownloads.add(dd); return dd; }

Target:
public DownloadDetailsDTO registerDownload(DownloadRequestParams requestParams, String ip, DownloadDetailsDTO.DownloadType type) { afterInitialisation(); DownloadDetailsDTO dd = new DownloadDetailsDTO(requestParams, ip, type); currentDownloads.add(dd); return dd; }
Source:
public void deleteSilentAfterExtract() { if (!saveDownloadedFiles) { try { if (!Files.deleteIfExists(downloadZipFile)) { logger.error("Could not delete downloaded ZIP file '{}'!", downloadZipFile); } } catch (IOException e) { logger.error("Could not delete downloaded ZIP file '{}'!", downloadZipFile, e); } } }

Target:
public void deleteSilentAfterExtract() { if (!saveDownloadedFiles) { FileUtils.deleteFileSilently(downloadZipFile); } }
Source:
public void returnsProperResponseCodeOnNoContentLength() throws Exception { final Socket socket = Mockito.mock(Socket.class); Mockito.when(socket.getInputStream()).thenReturn( new ByteArrayInputStream(Joiner.on("\r\n").join( "POST / HTTP/1.1", "Host: localhost", "", "hi" ).getBytes() ) ); Mockito.when(socket.getLocalAddress()).thenReturn( InetAddress.getLocalHost() ); Mockito.when(socket.getLocalPort()).thenReturn(0); Mockito.when(socket.getInetAddress()).thenReturn( InetAddress.getLocalHost() ); Mockito.when(socket.getPort()).thenReturn(0); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); Mockito.when(socket.getOutputStream()).thenReturn(baos); new BkReuse(new BkBasic(new TkText("411 Test"))).accept(socket); MatcherAssert.assertThat( baos.toString(), Matchers.containsString("HTTP/1.1 411 Length Required") ); }

Target:
public void returnsProperResponseCodeOnNoContentLength() throws Exception { final Socket socket = Mockito.mock(Socket.class); Mockito.when(socket.getInputStream()).thenReturn( new ByteArrayInputStream( Joiner.on("\r\n").join( "POST / HTTP/1.1", "Host: localhost", "", "hi" ).getBytes("UTF-8") ) ); Mockito.when(socket.getLocalAddress()).thenReturn( InetAddress.getLocalHost() ); Mockito.when(socket.getLocalPort()).thenReturn(0); Mockito.when(socket.getInetAddress()).thenReturn( InetAddress.getLocalHost() ); Mockito.when(socket.getPort()).thenReturn(0); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); Mockito.when(socket.getOutputStream()).thenReturn(baos); new BkReuse(new BkBasic(new TkText("411 Test"))).accept(socket); MatcherAssert.assertThat( baos.toString(), Matchers.containsString("HTTP/1.1 411 Length Required") ); }
Source:
private synchronized void initRelationship() { if (relationship != null) { return; } String identifiedRelationship = null; if (containingClassInfo.relationshipFields().contains(this)) { if (annotations != null && annotations.has(Relationship.class)) { identifiedRelationship = annotations.get(Relationship.class).get(Relationship.TYPE, RelationshipUtils.inferRelationshipType(getName())); } else { identifiedRelationship = RelationshipUtils.inferRelationshipType(getName()); } } relationship = Optional.ofNullable(identifiedRelationship); }

Target:
private Optional<String> initRelationship() { if (this.containingClassInfo.relationshipFields().contains(this)) { if (annotations != null) { AnnotationInfo relationshipAnnotation = annotations.get(Relationship.class); if (relationshipAnnotation != null) { return Optional.of(relationshipAnnotation .get(Relationship.TYPE, RelationshipUtils.inferRelationshipType(getName()))); } } return Optional.of(RelationshipUtils.inferRelationshipType(getName())); } return Optional.empty(); }
Source:
private List<Entity> generateEntities(String extensionName, HttpServletRequest request) throws FalconException, IOException { Properties properties = new Properties(); properties.load(request.getInputStream()); LOG.info("properties: " + properties.toString()); List<Entity> entities = extension.getEntities(extensionName, properties); LOG.info("generated " + entities.size() + " entities"); for (Entity entity : entities) { String tags = entity.getTags(); if (StringUtils.isEmpty(tags)) { setEntityTags(entity, TAG_PREFIX_EXTENSION_NAME + extensionName + "," + TAG_PREFIX_EXTENSION_JOB + properties.getProperty(ExtensionProperties.JOB_NAME.getName())); } else { if (tags.indexOf(TAG_PREFIX_EXTENSION_NAME) != -1) { throw new FalconException("Generated extention entity " + entity.getName() + " should not contain tag prefix " + TAG_PREFIX_EXTENSION_NAME); } if (tags.indexOf(TAG_PREFIX_EXTENSION_JOB) != -1) { throw new FalconException("Generated extention entity " + entity.getName() + " should not contain tag prefix " + TAG_PREFIX_EXTENSION_JOB); } setEntityTags(entity, tags + "," + TAG_PREFIX_EXTENSION_NAME + extensionName + "," + TAG_PREFIX_EXTENSION_JOB + properties.getProperty(ExtensionProperties.JOB_NAME.getName())); } } return entities; }

Target:
private List<Entity> generateEntities(String extensionName, HttpServletRequest request) throws FalconException, IOException { Properties properties = new Properties(); properties.load(request.getInputStream()); List<Entity> entities = extension.getEntities(extensionName, properties); for (Entity entity : entities) { String tags = entity.getTags(); if (StringUtils.isEmpty(tags)) { setEntityTags(entity, TAG_PREFIX_EXTENSION_NAME + extensionName + TAG_SEPARATOR + TAG_PREFIX_EXTENSION_JOB + properties.getProperty(ExtensionProperties.JOB_NAME.getName())); } else { if (tags.indexOf(TAG_PREFIX_EXTENSION_NAME) != -1) { throw new FalconException("Generated extention entity " + entity.getName() + " should not contain tag prefix " + TAG_PREFIX_EXTENSION_NAME); } if (tags.indexOf(TAG_PREFIX_EXTENSION_JOB) != -1) { throw new FalconException("Generated extention entity " + entity.getName() + " should not contain tag prefix " + TAG_PREFIX_EXTENSION_JOB); } setEntityTags(entity, tags + TAG_SEPARATOR + TAG_PREFIX_EXTENSION_NAME + extensionName + TAG_SEPARATOR + TAG_PREFIX_EXTENSION_JOB + properties.getProperty(ExtensionProperties.JOB_NAME.getName())); } } return entities; }
Source:
private IResourceVariant fetchVariant(IResource resource, IProgressMonitor monitor) throws TeamException { GitSynchronizeData gsd = gsds.getData(resource.getProject()); if (gsd == null) return null; Repository repo = gsd.getRepository(); String path = getPath(resource, repo); RevCommit revCommit = getRevCommit(gsd); if (revCommit == null) return null; if (path.length() == 0) return handleRepositoryRoot(resource, repo, revCommit); try { if (monitor.isCanceled()) { throw new OperationCanceledException(); } TreeWalk tw = initializeTreeWalk(repo, path); int nth = tw.addTree(revCommit.getTree()); if (resource.getType() == IResource.FILE) { tw.setRecursive(true); if (tw.next() && !tw.getObjectId(nth).equals(zeroId())) return new GitBlobResourceVariant(repo, tw.getObjectId(nth), path); } else { while (tw.next() && !path.equals(tw.getPathString())) { if (monitor.isCanceled()) { throw new OperationCanceledException(); } if (tw.isSubtree()) tw.enterSubtree(); } ObjectId objectId = tw.getObjectId(nth); if (!objectId.equals(zeroId())) return new GitFolderResourceVariant(repo, objectId, path); } } catch (IOException e) { throw new TeamException( NLS.bind( CoreText.GitResourceVariantTree_couldNotFindResourceVariant, resource), e); } return null; }

Target:
private IResourceVariant fetchVariant(IResource resource, IProgressMonitor monitor) throws TeamException { if (resource == null) return null; GitSynchronizeData gsd = gsds.getData(resource.getProject()); if (gsd == null) return null; Repository repo = gsd.getRepository(); String path = getPath(resource, repo); RevCommit revCommit = getRevCommit(gsd); if (revCommit == null) return null; if (path.length() == 0) return handleRepositoryRoot(resource, repo, revCommit); try { if (monitor.isCanceled()) throw new OperationCanceledException(); TreeWalk tw = initializeTreeWalk(repo, path); int nth = tw.addTree(revCommit.getTree()); if (resource.getType() == IResource.FILE) { tw.setRecursive(true); if (tw.next() && !tw.getObjectId(nth).equals(zeroId())) return new GitBlobResourceVariant(repo, tw.getObjectId(nth), path); } else { while (tw.next() && !path.equals(tw.getPathString())) { if (monitor.isCanceled()) throw new OperationCanceledException(); if (tw.isSubtree()) tw.enterSubtree(); } ObjectId objectId = tw.getObjectId(nth); if (!objectId.equals(zeroId())) return new GitFolderResourceVariant(repo, objectId, path); } } catch (IOException e) { throw new TeamException( NLS.bind( CoreText.GitResourceVariantTree_couldNotFindResourceVariant, resource), e); } return null; }
Source:
public int registerCallback(CordovaPlugin receiver, int requestCode) { int mappedId = this.currentCallbackId++; callbacks.put(mappedId, new Pair<CordovaPlugin, Integer>(receiver, requestCode)); return mappedId; }

Target:
public synchronized int registerCallback(CordovaPlugin receiver, int requestCode) { int mappedId = this.currentCallbackId++; callbacks.put(mappedId, new Pair<CordovaPlugin, Integer>(receiver, requestCode)); return mappedId; }
Source:
public void onNewRShinyApp() { dependencyManager_.withShiny("Creating Shiny applications", new Command() { @Override public void execute() { server_.getWorkingDirectory(new ServerRequestCallback<String>() { @Override public void onResponseReceived(String workingDir) { NewShinyWebApplication widget = new NewShinyWebApplication( "New Shiny Web Application", workingDir, new OperationWithInput<NewShinyWebApplication.Result>() { @Override public void execute(Result input) { doNewRShinyApp(input); } }); widget.showModal(); } @Override public void onError(ServerError error) { Debug.logError(error); } }); } }); }

Target:
public void onNewRShinyApp() { dependencyManager_.withShiny("Creating Shiny applications", new Command() { @Override public void execute() { NewShinyWebApplication widget = new NewShinyWebApplication( "New Shiny Web Application", new OperationWithInput<NewShinyWebApplication.Result>() { @Override public void execute(Result input) { doNewRShinyApp(input); } }); widget.showModal(); } }); }
Source:
public void stateTransition(Status from, Status to) { switch (to) { case AVAILABLE: managementRegistry.register(this); messageConsumer.accept(new DefaultMessage( timeSource.getTimeSource().getTimeMillis(), new ContextualNotification( configuration.getContext(), EhcacheNotification.CACHE_MANAGER_AVAILABLE.name()))); break; case MAINTENANCE: messageConsumer.accept(new DefaultMessage( timeSource.getTimeSource().getTimeMillis(), new ContextualNotification( configuration.getContext(), EhcacheNotification.CACHE_MANAGER_MAINTENANCE.name()))); break; case UNINITIALIZED: messageConsumer.accept(new DefaultMessage( timeSource.getTimeSource().getTimeMillis(), new ContextualNotification( configuration.getContext(), EhcacheNotification.CACHE_MANAGER_CLOSED.name()))); cacheManagerProviderService.getCacheManager().deregisterListener(this); break; } }

Target:
public void stateTransition(Status from, Status to) { switch (to) { case AVAILABLE: managementRegistry.register(this); messageConsumer.accept(new DefaultMessage( timeSource.getTimeMillis(), new ContextualNotification( configuration.getContext(), EhcacheNotification.CACHE_MANAGER_AVAILABLE.name()))); break; case MAINTENANCE: messageConsumer.accept(new DefaultMessage( timeSource.getTimeMillis(), new ContextualNotification( configuration.getContext(), EhcacheNotification.CACHE_MANAGER_MAINTENANCE.name()))); break; case UNINITIALIZED: messageConsumer.accept(new DefaultMessage( timeSource.getTimeMillis(), new ContextualNotification( configuration.getContext(), EhcacheNotification.CACHE_MANAGER_CLOSED.name()))); cacheManager.deregisterListener(this); break; default: throw new AssertionError(to); } }
Source:
private void addWorkPackageCriteria() { if (isWorkPackageSpecified()) { ArtifactId workPackArt = atsApi.getQueryService().getArtifactOrSentinel(workPackageId); if (isColorTeamMatch(workPackArt)) { if (workPackArt.isValid()) { queryAnd(AtsAttributeTypes.WorkPackageReference, workPackArt.getIdString()); } } } }

Target:
private void addWorkPackageCriteria() { if (isWorkPackageSpecified()) { ArtifactId workPackArt = atsApi.getQueryService().getArtifactOrSentinel(workPackageId); if (workPackArt.isValid()) { if (isColorTeamMatch(workPackArt)) { queryAnd(AtsAttributeTypes.WorkPackageReference, workPackArt.getIdString()); } } } }
Source:
public boolean isDeprecated() { UpdateSite.Plugin info = getInfo(); return info != null && Arrays.asList(info.categories).contains("deprecated"); }

Target:
public boolean isDeprecated() { return !getDeprecations().isEmpty(); }
Source:
Mono<DecryptResult> decrypt(EncryptionAlgorithm algorithm, byte[] cipherText, Context context) { Objects.requireNonNull(algorithm, "Encryption algorithm cannot be null."); Objects.requireNonNull(cipherText, "Cipher text content to be decrypted cannot be null."); boolean keyAvailableLocally = ensureValidKeyAvailable(); if (!keyAvailableLocally) { return cryptographyServiceClient.decrypt(algorithm, cipherText, context); } if (!checkKeyPermissions(this.key.getKeyOps(), KeyOperation.DECRYPT)) { return Mono.error(new UnsupportedOperationException(String.format("Decrypt Operation is not allowed for " + "key with id %s", key.getKeyId()))); } return localKeyCryptographyClient.decryptAsync(algorithm, cipherText, context, key); }

Target:
Mono<DecryptResult> decrypt(EncryptionAlgorithm algorithm, byte[] cipherText, Context context) { Objects.requireNonNull(algorithm, "Encryption algorithm cannot be null."); Objects.requireNonNull(cipherText, "Cipher text content to be decrypted cannot be null."); boolean keyAvailableLocally = ensureValidKeyAvailable(); if (!keyAvailableLocally) { return cryptographyServiceClient.decrypt(algorithm, cipherText, context); } if (!checkKeyPermissions(this.key.getKeyOps(), KeyOperation.DECRYPT)) { return Mono.error(logger.logExceptionAsError(new UnsupportedOperationException(String.format("Decrypt Operation is not allowed for " + "key with id %s", key.getId())))); } return localKeyCryptographyClient.decryptAsync(algorithm, cipherText, context, key); }
Source:
public BulkReceiveLibraryBackend(LibraryDto dto, Integer quantity, Project project, SampleClass aliquotClass, String defaultSciName) throws IOException { super("libraryReceipt", LibraryDto.class, "Libraries", dto, quantity); if (isDetailedSampleEnabled() && aliquotClass == null) throw new NotFoundException("Aliquot class cannot be null"); this.project = project; this.aliquotClass = aliquotClass; this.defaultSciName = defaultSciName; }

Target:
public BulkReceiveLibraryBackend(LibraryDto dto, Integer quantity, Project project, SampleClass aliquotClass, String defaultSciName) throws IOException { super("libraryReceipt", LibraryDto.class, "Libraries", dto, quantity); if (isDetailedSampleEnabled() && aliquotClass == null) throw new InvalidParameterException("Aliquot class cannot be null"); this.project = project; this.aliquotClass = aliquotClass; this.defaultSciName = defaultSciName; }
Source:
protected void setActiveHandler(WorkbenchDocksHandler handler) { if (activeHandler != null && activeHandler.equals(handler) && !activeHandler.shouldRefreshDocks()) { return; } activeHandler = handler; if (activeHandler.shouldDisableDocks()) { uberfireDocks.hide(UberfireDockPosition.EAST, authoringPerspectiveIdentifier); } else { if (activeDocks != null) { uberfireDocks.remove(activeDocks); } Collection<UberfireDock> docks = activeHandler.provideDocks(authoringPerspectiveIdentifier); activeDocks = docks.toArray(new UberfireDock[docks.size()]); uberfireDocks.add(activeDocks); uberfireDocks.show(UberfireDockPosition.EAST, authoringPerspectiveIdentifier); } }

Target:
protected void setActiveHandler(WorkbenchDocksHandler handler) { if (Objects.equals(activeHandler, handler) && !activeHandler.shouldRefreshDocks()) { return; } activeHandler = handler; if (activeHandler.shouldDisableDocks()) { uberfireDocks.hide(UberfireDockPosition.EAST, authoringPerspectiveIdentifier); } else { if (activeDocks != null) { uberfireDocks.remove(activeDocks); } Collection<UberfireDock> docks = activeHandler.provideDocks(authoringPerspectiveIdentifier); activeDocks = docks.toArray(new UberfireDock[docks.size()]); uberfireDocks.add(activeDocks); uberfireDocks.show(UberfireDockPosition.EAST, authoringPerspectiveIdentifier); } }
Source:
public void handle(Event event, Map postedEvent) { if (!shouldSendEvent(event)) { log.info( "Webhook ping received from github {}", kv( "hook_id", event.content.get("hook_id"), kv( "repository", ((Map<String, Object>) event.content.get("repository")).get("full_name")) .toString())); return; } GithubWebhookEvent githubWebhookEvent = objectMapper.convertValue(postedEvent, GithubWebhookEvent.class); event.content.put("hash", githubWebhookEvent.after); if (githubWebhookEvent.ref == null && githubWebhookEvent.pull_request.head.ref == null) { event.content.put("branch", ""); } else if (githubWebhookEvent.ref == null) { event.content.put("branch", githubWebhookEvent.pull_request.head.ref); } else { event.content.put("branch", githubWebhookEvent.ref.replace("refs/heads/", "")); } event.content.put("repoProject", githubWebhookEvent.repository.owner.login); event.content.put("slug", githubWebhookEvent.repository.name); }

Target:
public void handle(Event event, Map postedEvent) { if (!shouldSendEvent(event)) { log.info( "Webhook ping received from github {}", kv( "hook_id", event.content.get("hook_id"), kv( "repository", ((Map<String, Object>) event.content.get("repository")).get("full_name")) .toString())); return; } GithubWebhookEvent webhookEvent = null; String githubEvent = ""; if (event.content.containsKey("pull_request")) { webhookEvent = objectMapper.convertValue(event.content, GithubPullRequestEvent.class); githubEvent = "pull_request"; } else { webhookEvent = objectMapper.convertValue(event.content, GithubPushEvent.class); githubEvent = "push"; } String fullRepoName = webhookEvent.getFullRepoName(event, postedEvent); Map<String, String> results = new HashMap<>(); results.put("repoProject", webhookEvent.getRepoProject(event, postedEvent)); results.put("slug", webhookEvent.getSlug(event, postedEvent)); results.put("hash", webhookEvent.getHash(event, postedEvent)); results.put("branch", webhookEvent.getBranch(event, postedEvent)); event.content.putAll(results); log.info( "Github Webhook event received: {}", kv("githubEvent", githubEvent), kv("repository", fullRepoName), kv("project", results.get("repoProject")), kv("slug", results.get("slug")), kv("branch", results.get("branch")), kv("hash", results.get("hash"))); }
Source:
private boolean isVmMigrationValid(Cluster cluster, VM candidateVm) { List<Guid> vdsBlackList = candidateVm.getRunOnVds() == null ? Collections.emptyList() : Arrays.asList(candidateVm.getRunOnVds()); boolean canMove = schedulingManager.canSchedule(cluster, candidateVm, vdsBlackList, Collections.emptyList(), new ArrayList<>()); if (canMove) { log.debug("VM is a viable candidate for solving affinity group violation situation.", candidateVm.getId()); return true; } log.debug("VM is NOT a viable candidate for solving affinity group violation situation.", candidateVm.getId()); return false; }

Target:
private boolean isVmMigrationValid(Cluster cluster, VM candidateVm) { List<Guid> vdsBlackList = candidateVm.getRunOnVds() == null ? Collections.emptyList() : Arrays.asList(candidateVm.getRunOnVds()); boolean canMove = schedulingManager.canSchedule(cluster, candidateVm, vdsBlackList, Collections.emptyList(), new ArrayList<>()); if (canMove) { log.debug("VM is a viable candidate for solving the affinity group violation situation.", candidateVm.getId()); return true; } log.debug("VM is NOT a viable candidate for solving the affinity group violation situation.", candidateVm.getId()); return false; }
Source:
public void verifyImage() throws ProtocolAdapterException, ImageTransferException { final MethodResultCode verified = this.imageTransferCosem.callMethod(Method.IMAGE_VERIFY.getValue(), DataObject.newInteger8Data((byte) 0)); if (verified == null) { throw new ProtocolAdapterException(EXCEPTION_MSG_IMAGE_VERIFY_NOT_CALLED); } if (verified == MethodResultCode.OTHER_REASON) { if (this.imageIsVerified()) { return; } final int status = this.getImageTransferStatus(); throw new ImageTransferException(EXCEPTION_MSG_IMAGE_NOT_VERIFIED + status); } if (verified == MethodResultCode.TEMPORARY_FAILURE) { final Future<Integer> newStatus = EXECUTOR_SERVICE.submit(new ImageTransferStatusChangeWatcher( ImageTransferStatus.VERIFICATION_INITIATED, properties.getVerificationStatusCheckInterval(), properties.verificationStatusCheckTimeout)); int status; try { status = newStatus.get(); } catch (InterruptedException | ExecutionException e) { throw new ProtocolAdapterException("", e); } if (status == ImageTransferStatus.VERIFICATION_FAILED.getValue()) { throw new ImageTransferException(EXCEPTION_MSG_IMAGE_NOT_VERIFIED); } return; } }

Target:
public void verifyImage() throws ProtocolAdapterException, ImageTransferException { this.connector.getDlmsMessageListener().setDescription( "ImageTransfer call image_verify " + ", call method: " + JdlmsObjectToStringUtil.describeMethod(this.imageTransferCosem.createMethodParameter( Method.IMAGE_VERIFY, DataObject.newInteger8Data((byte) 0)))); final MethodResultCode verified = this.imageTransferCosem.callMethod(Method.IMAGE_VERIFY, DataObject.newInteger8Data((byte) 0)); if (verified == null) { throw new ProtocolAdapterException(EXCEPTION_MSG_IMAGE_VERIFY_NOT_CALLED); } if (verified == MethodResultCode.SUCCESS) { return; } if (verified == MethodResultCode.TEMPORARY_FAILURE) { this.waitForImageVerification(); } if (this.imageIsVerified()) { return; } final int status = this.getImageTransferStatus(); throw new ImageTransferException(EXCEPTION_MSG_IMAGE_NOT_VERIFIED + status); }
Source:
public <T> Mono<T> traceEnabledPublisher(Mono<T> resultPublisher, Context context, String spanName, String databaseId, String endpoint, Function<T, Integer> statusCodeFunc) { final AtomicReference<Context> parentContext = new AtomicReference<>(Context.NONE); Optional<Object> callDepth = context.getData(COSMOS_CALL_DEPTH); final boolean isNestedCall = callDepth.isPresent(); return resultPublisher .doOnSubscribe(ignoredValue -> { if (!isNestedCall) { parentContext.set(this.startSpan(spanName, databaseId, endpoint, context)); } }).doOnSuccess(response -> { if (!isNestedCall) { this.endSpan(parentContext.get(), Signal.complete(), statusCodeFunc.apply(response)); } }).doOnError(throwable -> { if (!isNestedCall) { this.endSpan(parentContext.get(), Signal.error(throwable), 0); } }); }

Target:
public <T> Mono<T> traceEnabledPublisher(Mono<T> resultPublisher, Context context, String spanName, String databaseId, String endpoint, Function<T, Integer> statusCodeFunc) { final AtomicReference<Context> parentContext = new AtomicReference<>(Context.NONE); Optional<Object> callDepth = context.getData(COSMOS_CALL_DEPTH); final boolean isNestedCall = callDepth.isPresent(); return resultPublisher .doOnSubscribe(ignoredValue -> { if (!isNestedCall) { parentContext.set(this.startSpan(spanName, databaseId, endpoint, context)); } }).doOnSuccess(response -> { if (!isNestedCall) { this.endSpan(parentContext.get(), Signal.complete(), statusCodeFunc.apply(response)); } }).doOnError(throwable -> { if (!isNestedCall) { this.endSpan(parentContext.get(), Signal.error(throwable), ERROR_CODE); } }); }
Source:
private static void constructGroupsMembershipTree(ExtMap entity, ExtKey key, Map<String, ExtMap> groupsCache) { List<ExtMap> groups = new ArrayList<>(); for (ExtMap memberOf : entity.get(key, Collections.<ExtMap> emptyList())) { groups.add(groupsCache.get(memberOf.get(GroupRecord.ID))); } entity.put(key, groups); for (ExtMap group: groups) { constructGroupsMembershipTree(group, GroupRecord.GROUPS, groupsCache); } }

Target:
private static void constructGroupsMembershipTree(ExtMap entity, ExtKey key, Map<String, ExtMap> groupsCache) { List<ExtMap> groups = new ArrayList<>(); for (ExtMap memberOf : entity.get(key, Collections.<ExtMap> emptyList())) { constructGroupsMembershipTree(memberOf, GroupRecord.GROUPS, groupsCache); groups.add(groupsCache.get(memberOf.get(GroupRecord.ID))); } }
Source:
public void testPreferIpV4StackDifferentValues() throws Exception { System.setProperty(PREFER_IPV4, "true"); IgniteEx g = startGrid(0); assertEquals("true", g.cluster().localNode().attribute(PREFER_IPV4)); checkIsClientFlag(g); g = startClientGrid(1); assertEquals("true", g.cluster().localNode().attribute(PREFER_IPV4)); checkIsClientFlag(g); System.setProperty(PREFER_IPV4, "false"); g = startGrid(2); checkIsClientFlag(g); }

Target:
public void testPreferIpV4StackDifferentValues() throws Exception { System.setProperty(PREFER_IPV4, "true"); for (int i = 0; i < 2; i++) { Ignite g = i == 1 ? startClientGrid(i) : startGrid(i); assert "true".equals(g.cluster().localNode().attribute(PREFER_IPV4)); checkIsClientFlag((IgniteEx) g); } System.setProperty(PREFER_IPV4, "false"); IgniteEx g = startGrid(2); checkIsClientFlag(g); }
Source:
public ASTNode visit(Cell cell, Void _) throws ParseFailedException { String sort = context.cellSorts.get(cell.getLabel()); if (cell.getLabel().equals("k") && cell.getEllipses() != Ellipses.NONE) sort = KSorts.K; if (sort == null) { if (cell.getLabel().equals("k")) sort = "K"; else if (cell.getLabel().equals("T")) sort = "Bag"; else if (cell.getLabel().equals("generatedTop")) sort = "Bag"; else if (cell.getLabel().equals("freshCounter")) sort = "K"; else if (cell.getLabel().equals(MetaK.Constants.pathCondition)) sort = "K"; } if (sort != null) { cell.setContents((Term) preferStrict(sort, cell.getContents())); } else { String msg = "Cell '" + cell.getLabel() + "' was not declared in a configuration."; throw new ParseFailedException(new KException(ExceptionType.ERROR, KExceptionGroup.COMPILER, msg, getName(), cell.getFilename(), cell.getLocation())); } return super.visit(cell, _); }

Target:
public ASTNode visit(Cell cell, Void _) throws ParseFailedException { Sort sort = context.getCellSort(cell); if (sort != null) { cell.setContents((Term) preferStrict(sort, cell.getContents())); } else { String msg = "Cell '" + cell.getLabel() + "' was not declared in a configuration."; throw new ParseFailedException(new KException(ExceptionType.ERROR, KExceptionGroup.COMPILER, msg, getName(), cell.getFilename(), cell.getLocation())); } return super.visit(cell, _); }
Source:
public Iterator<DataSegment> getPublishedSegments() { if (isCacheEnabled) { Preconditions.checkState( lifecycleLock.awaitStarted(1, TimeUnit.MILLISECONDS), "hold on, still syncing published segments" ); return publishedSegments.keySet().iterator(); } else { return getMetadataSegments( coordinatorDruidLeaderClient, jsonMapper, responseHandler, segmentWatcherConfig.getWatchedDataSources() ); } }

Target:
public Iterator<DataSegment> getPublishedSegments() { if (isCacheEnabled) { Preconditions.checkState( lifecycleLock.awaitStarted(1, TimeUnit.MILLISECONDS) && cachePopulated.get(), "hold on, still syncing published segments" ); return publishedSegments.keySet().iterator(); } else { return getMetadataSegments( coordinatorDruidLeaderClient, jsonMapper, responseHandler, segmentWatcherConfig.getWatchedDataSources() ); } }
Source:
public void onLineChange( final VirtualFile file, final int firstLine, final int linesAdded, final int linesRemoved) { final List<Breakpoint> fileBreakpoints = breakpointStorage.getByPath(file.getLocation().toString()); final int delta = linesAdded - linesRemoved; if (fileBreakpoints != null) { LOG.fine("Change in file with breakpoints " + file.getLocation().toString()); final List<Breakpoint> toRemove = new ArrayList<>(); final List<Breakpoint> toAdd = new ArrayList<>(); for (final Breakpoint breakpoint : fileBreakpoints) { final int lineNumber = breakpoint.getLocation().getLineNumber() - 1; if (firstLine <= lineNumber && lineNumber < firstLine + linesRemoved) { toRemove.add(breakpoint); continue; } if (firstLine <= lineNumber && lineNumber < firstLine + linesAdded) { toRemove.add(breakpoint); continue; } if (lineNumber >= firstLine + Math.abs(delta)) { Location currentLocation = breakpoint.getLocation(); Location newLocation = new LocationImpl( currentLocation.getTarget(), currentLocation.getLineNumber() + delta, currentLocation.isExternalResource(), currentLocation.getExternalResourceId(), currentLocation.getResourceProjectPath(), currentLocation.getMethod(), currentLocation.getThreadId()); toRemove.add(breakpoint); toAdd.add( new BreakpointImpl( newLocation, new ConditionsImpl(breakpoint.getConditions().getHitCondition(), breakpoint.getConditions().getHitCount()), breakpoint.isEnabled())); } } for (final Breakpoint breakpoint : toRemove) { deleteBreakpoint(file, breakpoint); } for (final Breakpoint breakpoint : toAdd) { addBreakpoint(file, breakpoint); } } }

Target:
public void onLineChange( final VirtualFile file, final int firstLine, final int linesAdded, final int linesRemoved) { final List<Breakpoint> fileBreakpoints = breakpointStorage.getByPath(file.getLocation().toString()); final int delta = linesAdded - linesRemoved; if (fileBreakpoints != null) { LOG.fine("Change in file with breakpoints " + file.getLocation().toString()); final List<Breakpoint> toRemove = new ArrayList<>(); final List<Breakpoint> toAdd = new ArrayList<>(); for (final Breakpoint breakpoint : fileBreakpoints) { final int lineNumber = breakpoint.getLocation().getLineNumber() - 1; if (firstLine <= lineNumber && lineNumber < firstLine + linesRemoved) { toRemove.add(breakpoint); continue; } if (firstLine <= lineNumber && lineNumber < firstLine + linesAdded) { toRemove.add(breakpoint); continue; } if (lineNumber >= firstLine + Math.abs(delta)) { Location currentLocation = breakpoint.getLocation(); Location newLocation = new LocationImpl( currentLocation.getTarget(), currentLocation.getLineNumber() + delta, currentLocation.isExternalResource(), currentLocation.getExternalResourceId(), currentLocation.getResourceProjectPath(), currentLocation.getMethod(), currentLocation.getThreadId()); toRemove.add(breakpoint); toAdd.add( new BreakpointImpl(newLocation, breakpoint.isEnabled(), breakpoint.getCondition())); } } for (final Breakpoint breakpoint : toRemove) { deleteBreakpoint(file, breakpoint); } for (final Breakpoint breakpoint : toAdd) { addBreakpoint(file, breakpoint); } } }
Source:
public void testEmailWith64CharacterLocalPartIsValid() { for (int num = 1; num < 64; num++) { isValidEmail( stringOfLength( num ) + "@foo.com" ); } }

Target:
public void testEmailWith64CharacterLocalPartIsValid() { for (int num = 1; num <= 64; num++) { isValidEmail( stringOfLength( num ) + "@foo.com" ); } }
Source:
private void checkObjectCollision(PackedObjectInfo obj) throws IOException { ObjectTypeAndSize info = openDatabase(obj, new ObjectTypeAndSize()); final byte[] readBuffer = buffer(); final byte[] curBuffer = new byte[readBuffer.length]; long sz = info.size; try (ObjectStream cur = readCurs.open(obj, info.type).openStream()) { if (cur.getSize() != sz) { throw new IOException(MessageFormat.format( JGitText.get().collisionOn, obj.name())); } try (InputStream pck = inflate(Source.DATABASE, sz)) { while (0 < sz) { int n = (int) Math.min(readBuffer.length, sz); IO.readFully(cur, curBuffer, 0, n); IO.readFully(pck, readBuffer, 0, n); for (int i = 0; i < n; i++) { if (curBuffer[i] != readBuffer[i]) { throw new IOException(MessageFormat.format( JGitText.get().collisionOn, obj.name())); } } sz -= n; } } stats.increaseNumBytesDuplicated(sz); stats.incrementObjectsDuplicated(); } catch (MissingObjectException notLocal) { } }

Target:
private void checkObjectCollision(PackedObjectInfo obj) throws IOException { ObjectTypeAndSize info = openDatabase(obj, new ObjectTypeAndSize()); final byte[] readBuffer = buffer(); final byte[] curBuffer = new byte[readBuffer.length]; long sz = info.size; long szForRecord = sz; try (ObjectStream cur = readCurs.open(obj, info.type).openStream()) { if (cur.getSize() != sz) { throw new IOException(MessageFormat.format( JGitText.get().collisionOn, obj.name())); } try (InputStream pck = inflate(Source.DATABASE, sz)) { while (0 < sz) { int n = (int) Math.min(readBuffer.length, sz); IO.readFully(cur, curBuffer, 0, n); IO.readFully(pck, readBuffer, 0, n); for (int i = 0; i < n; i++) { if (curBuffer[i] != readBuffer[i]) { throw new IOException(MessageFormat.format( JGitText.get().collisionOn, obj.name())); } } sz -= n; } } stats.increaseNumBytesDuplicated(szForRecord); stats.incrementObjectsDuplicated(); } catch (MissingObjectException notLocal) { } }
Source:
public @Nullable CtfTmfCallsite getCallsite(String eventName) { if (fTrace != null) { CTFCallsite callsite = fTrace.getCallsite(eventName); if (callsite != null) { return new CtfTmfCallsite(callsite); } } return null; }

Target:
public @Nullable CtfTmfCallsite getCallsite(String eventName) { CTFTrace trace = fTrace; if (trace != null) { CTFCallsite callsite = trace.getCallsite(eventName); if (callsite != null) { return new CtfTmfCallsite(callsite); } } return null; }
Source:
private void validateKdcServers(String ldapSecurityAuthentication, String domainName) throws ManageDomainsResult { KDCLocator locator = new KDCLocator(); DnsSRVResult result = null; boolean foundServers = true; try { result = locator.getKdc(DnsSRVLocator.TCP, domainName); if (result.getNumOfValidAddresses() == 0) { result = locator.getKdc(DnsSRVLocator.UDP,domainName); if (result.getNumOfValidAddresses() == 0) { foundServers =false; } } } catch (Exception ex) { foundServers = false; } if (!foundServers) { throw new ManageDomainsResult("Could not locate KDC servers to be used to validate the input of the utility", ManageDomainsResultEnum.NO_KDC_SERVERS_FOR_DOMAIN, domainName); } }

Target:
private void validateKdcServers(String ldapSecurityAuthentication, String domainName) throws ManageDomainsResult { KDCLocator locator = new KDCLocator(); DnsSRVResult result = null; boolean foundServers = true; try { result = locator.getKdc(DnsSRVLocator.TCP, domainName); if (result == null || result.getNumOfValidAddresses() == 0) { result = locator.getKdc(DnsSRVLocator.UDP,domainName); if (result.getNumOfValidAddresses() == 0) { foundServers =false; } } } catch (Exception ex) { foundServers = false; } if (!foundServers) { throw new ManageDomainsResult("Could not locate KDC servers to be used to validate the input of the utility", ManageDomainsResultEnum.NO_KDC_SERVERS_FOR_DOMAIN, domainName); } }
Source:
private void onAppComesFromBackground(Activity activity) { AppLog.i(T.UTILS, "App comes from background"); ConnectionChangeReceiver.setEnabled(WordPress.this, true); AnalyticsUtils.refreshMetadata(); mApplicationOpenedDate = new Date(); AnalyticsTracker.track(AnalyticsTracker.Stat.APPLICATION_OPENED); if (NetworkUtils.isNetworkAvailable(mContext)) { if (AccountHelper.isSignedInWordPressDotCom()) { if (activity.getIntent().hasExtra(NotificationsListFragment.NOTE_ID_EXTRA)) { NotificationsUpdateService.startService(getContext(), getNoteIdFromNoteDetailActivityIntent(activity.getIntent())); } else { NotificationsUpdateService.startService(getContext()); } NotificationsPendingDraftsService.checkPrefsAndStartService(getContext()); } updatePushNotificationTokenIfNotLimited(); sUpdateWordPressComBlogList.runIfNotLimited(); sUpdateCurrentBlogOption.runIfNotLimited(); } sDeleteExpiredStats.runIfNotLimited(); }

Target:
private void onAppComesFromBackground(Activity activity) { AppLog.i(T.UTILS, "App comes from background"); ConnectionChangeReceiver.setEnabled(WordPress.this, true); AnalyticsUtils.refreshMetadata(); mApplicationOpenedDate = new Date(); AnalyticsTracker.track(AnalyticsTracker.Stat.APPLICATION_OPENED); if (NetworkUtils.isNetworkAvailable(mContext)) { if (AccountHelper.isSignedInWordPressDotCom()) { Intent intent = activity.getIntent(); if (intent != null && intent.hasExtra(NotificationsListFragment.NOTE_ID_EXTRA)) { NotificationsUpdateService.startService(getContext(), getNoteIdFromNoteDetailActivityIntent(activity.getIntent())); } else { NotificationsUpdateService.startService(getContext()); } NotificationsPendingDraftsService.checkPrefsAndStartService(getContext()); } updatePushNotificationTokenIfNotLimited(); sUpdateWordPressComBlogList.runIfNotLimited(); sUpdateCurrentBlogOption.runIfNotLimited(); } sDeleteExpiredStats.runIfNotLimited(); }
Source:
private void updateOverCommitPercent() { if (getAvailableDiskSize() == null || getAvailableDiskSize() == 0) { setStorageDomainOverCommitPercent(0); } else { setStorageDomainOverCommitPercent((int)((getCommittedDiskSize() - getActualImagesSize()) * 100 / getAvailableDiskSize())); } }

Target:
private void updateOverCommitPercent() { if (getAvailableDiskSize() == null || getAvailableDiskSize() == 0) { setStorageDomainOverCommitPercent(0); } else { setStorageDomainOverCommitPercent(((getCommittedDiskSize() - getActualImagesSize()) * 100 / getAvailableDiskSize())); } }
Source:
private List<OwnerProductShare> findProductSharesByOwner(Owner owner, boolean isRecipient, boolean activeOnly, Collection<String> productIds) { String jpql = "FROM OwnerProductShare ps WHERE "; if (CollectionUtils.isNotEmpty(productIds)) { jpql += "ps.productId in (:product_ids) AND "; } if (isRecipient) { jpql += "ps.recipientOwner.id = :owner_id "; } else { jpql += "ps.sharingOwner.id = :owner_id "; } if (activeOnly) { jpql += "AND ps.active = true"; } TypedQuery<OwnerProductShare> query = getEntityManager() .createQuery(jpql, OwnerProductShare.class) .setParameter("owner_id", owner.getId()); if (CollectionUtils.isNotEmpty(productIds)) { query.setParameter("product_ids", productIds); } return query.getResultList(); }

Target:
private List<OwnerProductShare> findProductSharesByOwner(Owner owner, boolean isRecipient, boolean activeOnly, Collection<String> productIds) { String jpql = "FROM OwnerProductShare ps WHERE "; if (CollectionUtils.isNotEmpty(productIds)) { jpql += "ps.productId in (:product_ids) AND "; } if (isRecipient) { jpql += "ps.recipientOwner.id = :owner_id "; } else { jpql += "ps.sharingOwner.id = :owner_id "; } if (activeOnly) { jpql += "AND ps.active = true"; } TypedQuery<OwnerProductShare> query = getEntityManager() .createQuery(jpql, OwnerProductShare.class) .setParameter("owner_id", owner.getId()); List<OwnerProductShare> shares = new LinkedList<OwnerProductShare>(); if (CollectionUtils.isNotEmpty(productIds)) { for (List<String> block : Iterables.partition(productIds, getInBlockSize())) { query.setParameter("product_ids", block); shares.addAll(query.getResultList()); } } else { shares.addAll(query.getResultList()); } return shares; }
Source:
public void indexCreateFailure() throws Exception { ElasticWriter writer = createElasticWriter(); when(mockClient.execute(Matchers.isA(IndicesExists.class))).thenReturn(jestResultFalse); when(jestResultFalse.getErrorMessage()).thenReturn("Unknown error creating index in elastic"); writer.setJestClient(mockClient); writer.start(); writer.stop(); Mockito.verify(mockClient, atLeast(2)).execute(Matchers.<Action<JestResult>>any()); }

Target:
public void indexCreateFailure() throws Exception { when(mockClient.execute(Matchers.isA(IndicesExists.class))).thenReturn(jestResultFalse); when(mockClient.execute(Matchers.isA(PutMapping.class))).thenReturn(jestResultFalse); when(jestResultFalse.getErrorMessage()).thenReturn("Unknown error creating index in elastic"); writer.start(); }
Source:
private void autoRegisterAuthorityFromInputReader() { try { DCInputsReader dcInputsReader = new DCInputsReader(); for (DCInputSet dcinputSet : dcInputsReader.getAllInputs(Integer.MAX_VALUE, 0)) { DCInput[] dcinputs = dcinputSet.getFields(); for (DCInput dcinput : dcinputs) { if (StringUtils.isNotBlank(dcinput.getPairsType()) || StringUtils.isNotBlank(dcinput.getVocabulary())) { String authorityName = dcinput.getPairsType(); if(StringUtils.isBlank(authorityName)) { authorityName = dcinput.getVocabulary(); } if (!StringUtils.equals(dcinput.getInputType(), "qualdrop_value")) { String fieldKey = makeFieldKey(dcinput.getSchema(), dcinput.getElement(), dcinput.getQualifier()); controlled.put(fieldKey, true); isAuthorityRequired.put(fieldKey, true); } } } } } catch (DCInputsReaderException e) { throw new IllegalStateException(e.getMessage(), e); } }

Target:
private void autoRegisterAuthorityFromInputReader() { try { DCInputsReader dcInputsReader = new DCInputsReader(); for (DCInputSet dcinputSet : dcInputsReader.getAllInputs(Integer.MAX_VALUE, 0)) { DCInput[] dcinputs = dcinputSet.getFields(); for (DCInput dcinput : dcinputs) { if (StringUtils.isNotBlank(dcinput.getPairsType()) || StringUtils.isNotBlank(dcinput.getVocabulary())) { String authorityName = dcinput.getPairsType(); if(StringUtils.isBlank(authorityName)) { authorityName = dcinput.getVocabulary(); } if (!StringUtils.equals(dcinput.getInputType(), "qualdrop_value")) { String fieldKey = makeFieldKey(dcinput.getSchema(), dcinput.getElement(), dcinput.getQualifier()); boolean req = ConfigurationManager.getBooleanProperty("authority.required."+fieldKey, false); controlled.put(fieldKey, true); isAuthorityRequired.put(fieldKey, req); } } } } } catch (DCInputsReaderException e) { throw new IllegalStateException(e.getMessage(), e); } }
Source:
public String toString() { Date compliedDate = this.getDate(); String date = compliedDate != null ? String.format("%1$tF %1$tT%1$tz", compliedDate) : null; return String.format("ComplianceStatusDTO [compliant: %b, compiled: %s]", this.isCompliant(), date); }

Target:
public String toString() { Date compliedDate = this.getDate(); String date = compliedDate != null ? String.format("%1$tF %1$tT%1$tz", compliedDate) : null; return String.format("SystemPurposeComplianceStatusDTO [compliant: %b, compiled: %s]", this .isCompliant(), date); }
Source:
public boolean isAvailable(long timeout, TimeUnit unit) throws InterruptedException { Validate.notNull(unit, "invalid null time unit"); if (isAvailable()) { return true; } long now = TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()); final long end = now + unit.toNanos(timeout); synchronized (lock) { while (true) { if (state == State.CLOSED) { return false; } final boolean available = isAvailable(); if (available) { return true; } final long t = end - now; if (t <= 0L) { return available; } if (LOGGER.isDebugEnabled()) { LOGGER.debug( "Solr({}): waiting to become available", core, DurationFormatUtils.formatDurationHMS(TimeUnit.NANOSECONDS.toMillis(t))); } now = waiter.timedWait(lock, now, t, TimeUnit.NANOSECONDS); } } }

Target:
public boolean isAvailable(long timeout, TimeUnit unit) throws InterruptedException { Validate.notNull(unit, "invalid null time unit"); if (isAvailable()) { return true; } long now = TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()); final long end = now + unit.toNanos(timeout); synchronized (lock) { while (true) { if (state == State.CLOSED) { return false; } final boolean available = isAvailable(); if (available) { return true; } final long t = end - now; if (t <= 0L) { return false; } if (LOGGER.isDebugEnabled()) { LOGGER.debug( "Solr({}): waiting to become available", core, DurationFormatUtils.formatDurationHMS(TimeUnit.NANOSECONDS.toMillis(t))); } now = waiter.timedWait(lock, now, t, TimeUnit.NANOSECONDS); } } }
Source:
public ChildData getCurrentData(String fullPath) { TreeNode node = find(fullPath); if ( node == null ) { return null; } ChildData result = node.childData; return result != DEAD ? result : null; }

Target:
public ChildData getCurrentData(String fullPath) { TreeNode node = find(fullPath); if ( node == null ) { return null; } ChildData result = node.childData; return isLive(result) ? result : null; }