auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected ConfigNodeObject changeValueOnPath(Path desiredPath, AbstractConfigNodeValue value) { ArrayList<AbstractConfigNode> childrenCopy = new ArrayList(super.children); AbstractConfigNodeValue valueCopy = value; for (int i = super.children.size() - 1; i >= 0; i--) { if (!(super.children.get(i) instanceof ConfigNodeField)) { continue; } ConfigNodeField node = (ConfigNodeField)super.children.get(i); Path key = node.path().value(); if (key.equals(desiredPath)) { if (valueCopy == null) childrenCopy.remove(i); else { childrenCopy.set(i, node.replaceValue(value)); valueCopy = null; } } else if (desiredPath.startsWith(key)) { if (node.value() instanceof ConfigNodeObject) { Path remainingPath = desiredPath.subPath(key.length()); childrenCopy.set(i, node.replaceValue(((ConfigNodeObject)node.value()).changeValueOnPath(remainingPath, valueCopy))); if (valueCopy != null && node.render() != super.children.get(i).render()) valueCopy = null; } } } return new ConfigNodeObject(childrenCopy); }

Target:
protected ConfigNodeObject changeValueOnPath(Path desiredPath, AbstractConfigNodeValue value) { ArrayList<AbstractConfigNode> childrenCopy = new ArrayList(super.children); AbstractConfigNodeValue valueCopy = value; for (int i = super.children.size() - 1; i >= 0; i--) { if (!(super.children.get(i) instanceof ConfigNodeField)) { continue; } ConfigNodeField node = (ConfigNodeField)super.children.get(i); Path key = node.path().value(); if (key.equals(desiredPath)) { if (valueCopy == null) childrenCopy.remove(i); else { childrenCopy.set(i, node.replaceValue(value)); valueCopy = null; } } else if (desiredPath.startsWith(key)) { if (node.value() instanceof ConfigNodeObject) { Path remainingPath = desiredPath.subPath(key.length()); childrenCopy.set(i, node.replaceValue(((ConfigNodeObject)node.value()).changeValueOnPath(remainingPath, valueCopy))); if (valueCopy != null && !node.equals(super.children.get(i))) valueCopy = null; } } } return new ConfigNodeObject(childrenCopy); }
Source:
public StateItem(RGB stateColor, String stateString) { Map<String, Object> styleMap = new HashMap<>(); String hexColor = X11ColorUtils.toHexColor(stateColor.red, stateColor.green, stateColor.blue); styleMap.put(StyleProperties.BACKGROUND_COLOR, hexColor); styleMap.put(StyleProperties.COLOR, hexColor); styleMap.put(StyleProperties.STYLE_NAME, stateString); fStyleMap = styleMap; fOriginalStyleMap = ImmutableMap.copyOf(styleMap); }

Target:
public StateItem(RGB stateColor, String stateString) { Map<String, Object> styleMap = new HashMap<>(); String hexColor = ColorUtils.toHexColor(stateColor.red, stateColor.green, stateColor.blue); styleMap.put(StyleProperties.BACKGROUND_COLOR, hexColor); styleMap.put(StyleProperties.COLOR, hexColor); styleMap.put(StyleProperties.STYLE_NAME, stateString); fStyleMap = styleMap; fOriginalStyleMap = ImmutableMap.copyOf(styleMap); }
Source:
RecordFlow evictAckedEventAndScheduleNextEvent(RecordsDeliveryAck recordsDeliveryAck) { final RecordsRetrievedContext recordsRetrievedContext = recordsDeliveryQueue.peek(); RecordFlow flowToBeReturned = null; if (recordsRetrievedContext != null && recordsRetrievedContext.getRecordsRetrieved().batchUniqueIdentifier() .equals(recordsDeliveryAck.batchUniqueIdentifier())) { recordsDeliveryQueue.poll(); takeDelayedDeliveryActionIfRequired(shardId, recordsRetrievedContext.getEnqueueTimestamp(), log); currentSequenceNumber = ((FanoutRecordsRetrieved)recordsRetrievedContext.getRecordsRetrieved()).continuationSequenceNumber(); flowToBeReturned = recordsRetrievedContext.getRecordFlow(); if (recordsDeliveryQueue.peek() != null) { scheduleNextEvent(recordsDeliveryQueue.peek().getRecordsRetrieved()); } } else { if (flow != null && recordsDeliveryAck.batchUniqueIdentifier().getFlowIdentifier() .equals(flow.getSubscribeToShardId())) { log.error( "{}: Received unexpected ack for the active subscription {}. Throwing. ", shardId, recordsDeliveryAck.batchUniqueIdentifier().getFlowIdentifier()); throw new IllegalStateException("Unexpected ack for the active subscription"); } else { log.info("{}: Publisher received an ack for stale subscription {}. Ignoring.", shardId, recordsDeliveryAck.batchUniqueIdentifier().getFlowIdentifier()); } } return flowToBeReturned; }

Target:
RecordFlow evictAckedEventAndScheduleNextEvent(RecordsDeliveryAck recordsDeliveryAck) { final RecordsRetrievedContext recordsRetrievedContext = recordsDeliveryQueue.peek(); RecordFlow flowToBeReturned = null; if (recordsRetrievedContext != null && recordsRetrievedContext.getRecordsRetrieved().batchUniqueIdentifier() .equals(recordsDeliveryAck.batchUniqueIdentifier())) { recordsDeliveryQueue.poll(); takeDelayedDeliveryActionIfRequired(shardId, recordsRetrievedContext.getEnqueueTimestamp(), log); currentSequenceNumber = ((FanoutRecordsRetrieved)recordsRetrievedContext.getRecordsRetrieved()).continuationSequenceNumber(); flowToBeReturned = recordsRetrievedContext.getRecordFlow(); if (!recordsDeliveryQueue.isEmpty()) { scheduleNextEvent(recordsDeliveryQueue.peek().getRecordsRetrieved()); } } else { if (flow != null && recordsDeliveryAck.batchUniqueIdentifier().getFlowIdentifier() .equals(flow.getSubscribeToShardId())) { log.error( "{}: Received unexpected ack for the active subscription {}. Throwing. ", shardId, recordsDeliveryAck.batchUniqueIdentifier().getFlowIdentifier()); throw new IllegalStateException("Unexpected ack for the active subscription"); } else { log.info("{}: Publisher received an ack for stale subscription {}. Ignoring.", shardId, recordsDeliveryAck.batchUniqueIdentifier().getFlowIdentifier()); } } return flowToBeReturned; }
Source:
public void sendTrainingData(int diseaseGroupId, List<DiseaseOccurrence> occurrences) throws JsonProcessingException, WebServiceClientException { String url = rootUrl + diseaseGroupId + "/train"; JsonDiseaseOccurrenceDataSet data = convertToDTO(occurrences); String bodyAsJson = writeRequestBodyAsJson(data); webServiceClient.makePostRequestWithJSON(url, bodyAsJson); }

Target:
public void sendTrainingData(int diseaseGroupId, List<DiseaseOccurrence> occurrences) throws JsonProcessingException, WebServiceClientException { String url = buildUrl(diseaseGroupId, TRAIN_METHOD); JsonDiseaseOccurrenceDataSet data = convertToDTO(occurrences); String bodyAsJson = writeRequestBodyAsJson(data); webServiceClient.makePostRequestWithJSON(url, bodyAsJson); }
Source:
default <T> T decode(Type type, String value) { return decode((Class<T>)type, value); }

Target:
default <T> T decode(Type type, String value) { if (type instanceof Class) { return decode((Class<T>)type, value); } else { throw new UnsupportedOperationException("This decoder " + getClass() + " does not support Type"); } }
Source:
private List<TriggerEventRequest> buildCohortQueryTriggers(String configName) { List<TriggerEventRequest> triggers = new ArrayList<>(); List<EventParameterRequest> parameterRequests = new ArrayList<>(); parameterRequests.add(new EventParameterRequest(DisplayNames.PATIENT_UUID, Keys.PATIENT_UUID)); parameterRequests.add(new EventParameterRequest(DisplayNames.PATIENT_DISPLAY, Keys.PATIENT_DISPLAY)); parameterRequests.add(new EventParameterRequest(DisplayNames.COHORT_QUERY_UUID, Keys.COHORT_QUERY_UUID)); String displayName = DisplayNameHelper.buildDisplayName(DisplayNames.COHORT_QUERY_REPORTMEMBER, configName); triggers.add(new TriggerEventRequest(displayName, EventSubjects.GET_COHORT_QUERY_MEMBER_EVENT.concat(".").concat(configName), null, parameterRequests)); return triggers; }

Target:
private List<TriggerEventRequest> buildCohortQueryTriggers(String configName) { List<TriggerEventRequest> triggers = new ArrayList<>(); List<EventParameterRequest> parameterRequests = new ArrayList<>(); parameterRequests.add(new EventParameterRequest(DisplayNames.PATIENT_UUID, Keys.PATIENT_UUID)); parameterRequests.add(new EventParameterRequest(DisplayNames.PATIENT_DISPLAY, Keys.PATIENT_DISPLAY)); parameterRequests.add(new EventParameterRequest(DisplayNames.COHORT_QUERY_UUID, Keys.COHORT_QUERY_UUID)); String displayName = DisplayNameHelper.buildDisplayName(DisplayNames.COHORT_QUERY_REPORTMEMBER, configName); triggers.add(new TriggerEventRequest(displayName, EventSubjects.GET_COHORT_QUERY_MEMBER_EVENT.concat(configName), null, parameterRequests)); return triggers; }
Source:
public void manageTransitions(RingGroup ringGroup) throws IOException { DomainGroup domainGroup = ringGroup.getDomainGroup(); if (domainGroup == null) { LOG.info("Domain group not found. Nothing to do."); return; } int numRingGroups = ringGroup.getRings().size(); Map<Domain, Map<Integer, Set<Host>>> domainToPartitionToHostsFullyServing = computeDomainToPartitionToHostsFullyServing(ringGroup); for (Ring ring : ringGroup.getRingsSorted()) { partitionAssigner.prepare(ring, domainGroup.getDomainVersions(), ringGroup.getRingGroupConductorMode()); for (Host host : ring.getHostsSorted()) { manageTransitions(host, domainGroup, domainToPartitionToHostsFullyServing); } } }

Target:
public void manageTransitions(RingGroup ringGroup) throws IOException { DomainGroup domainGroup = ringGroup.getDomainGroup(); if (domainGroup == null) { LOG.info("Domain group not found. Nothing to do."); return; } Map<Domain, Map<Integer, Set<Host>>> domainToPartitionToHostsFullyServing = computeDomainToPartitionToHostsFullyServing(ringGroup); for (Ring ring : ringGroup.getRingsSorted()) { partitionAssigner.prepare(ring, domainGroup.getDomainVersions(), ringGroup.getRingGroupConductorMode()); for (Host host : ring.getHostsSorted()) { manageTransitions(host, domainGroup, domainToPartitionToHostsFullyServing); } } }
Source:
private Node maybeReassignAlias(Node assign) { Node lhs = assign.getFirstChild(); if (!lhs.isGetProp()) { return null; } String alias = null; for (Node child = lhs; child != null; child = child.getFirstChild()) { if (child.isName()) { alias = child.getQualifiedName(); } } checkNotNull(alias, "Missing name for alias"); if (aliasToProvidedNamespace.containsKey(alias)) { String providedNamespace = aliasToProvidedNamespace.get(alias); String suffix = lhs.getQualifiedName().substring(alias.length()); Node fullName = NodeUtil.newQName(compiler, providedNamespace + suffix); assign.replaceChild(lhs, fullName); compiler.reportCodeChange(); } return null; }

Target:
private void maybeReassignAlias(Node assign) { Node lhs = assign.getFirstChild(); if (!lhs.isGetProp()) { return; } String alias = null; for (Node child = lhs; child != null; child = child.getFirstChild()) { if (child.isName()) { alias = child.getQualifiedName(); } } checkNotNull(alias, "Missing name for alias"); if (aliasToProvidedNamespace.containsKey(alias)) { String providedNamespace = aliasToProvidedNamespace.get(alias); String suffix = lhs.getQualifiedName().substring(alias.length()); Node fullName = NodeUtil.newQName(compiler, providedNamespace + suffix); assign.replaceChild(lhs, fullName); compiler.reportCodeChange(); } return; }
Source:
ProfileDescriptor getUserProfile() throws ApiException, IOException, JsonParseException { final String profileDescriptor = HttpJsonHelper.requestString(profileApiUrl, "GET", null); return DtoFactory.getInstance().createDtoFromJson(profileDescriptor, ProfileDescriptor.class); }

Target:
ProfileDescriptor getUserProfile() throws ApiException, IOException, JsonParseException { return HttpJsonHelper.request(ProfileDescriptor.class, profileApiUrl, HttpMethod.GET, null); }
Source:
public static <T,V> FactorFilter<T,V> create(String factorName, Filter<T,V> filter){ if (null == factorName || factorName == "" || null == filter){ logger.error("failed to create instance of FactorFilter, at least one of the input paramters are invalid"); return null; } return new FactorFilter<T,V>(factorName,filter); }

Target:
public static <T,V> FactorFilter<T,V> create(String factorName, Filter<T,V> filter){ if (null == factorName || factorName.length() == 0 || null == filter){ logger.error("failed to create instance of FactorFilter, at least one of the input paramters are invalid"); return null; } return new FactorFilter<T,V>(factorName,filter); }
Source:
private <A> Cases<A, SimpleExpression<A>> thenSimple(Expression<A> expr) { return new Cases<A, SimpleExpression<A>>((Class)expr.getType()) { @Override protected SimpleExpression<A> createResult(Class<A> type, Expression<A> last) { return Expressions.operation(type, Ops.CASE, last); } }.addCase(when, expr); }

Target:
private <A> Cases<A, SimpleExpression<A>> thenSimple(Expression<A> expr) { return new Cases<A, SimpleExpression<A>>(expr.getType()) { @Override protected SimpleExpression<A> createResult(Class<? extends A> type, Expression<A> last) { return Expressions.operation(type, Ops.CASE, last); } }.addCase(when, expr); }
Source:
public void updateItem(T item) { mAlgorithm.lock(); try { mAlgorithm.updateItem(item); } finally { mAlgorithm.unlock(); } }

Target:
public boolean updateItem(T item) { mAlgorithm.lock(); try { return mAlgorithm.updateItem(item); } finally { mAlgorithm.unlock(); } }
Source:
long getWord(int index) { if (index == 0) { return elements1; } else { if (index == 1) { return elements2; } else { return 0L; } } }

Target:
long getWord(int index) { if (index == 0) { return elements1; } else if (index == 1) { return elements2; } else { throw new IndexOutOfBoundsException(); } }
Source:
private Map<String, String> generateThirdPartyNameToFullModuleName(ClassLoader loader) { Map<String, String> returnValue; try { final ClassPath classPath = ClassPath.from(loader); returnValue = packages.stream().map(pkg -> pkg.substring(0, pkg.length() - 1)) .flatMap(pkg -> classPath.getTopLevelClasses(pkg).stream()) .map(ClassPath.ClassInfo::load) .filter(PackageObjectFactory::shouldAddToThirdPartyMap) .collect(Collectors.toMap(Class::getSimpleName, Class::getCanonicalName)); } catch (IOException ignore) { returnValue = new HashMap<>(); } return returnValue; }

Target:
private Map<String, String> generateThirdPartyNameToFullModuleName(ClassLoader loader) { Map<String, String> returnValue; try { returnValue = ModuleReflectionUtils.getCheckstyleModules(packages, loader).stream() .collect(Collectors.toMap(Class::getSimpleName, Class::getCanonicalName)); } catch (IOException ignore) { returnValue = new HashMap<>(); } return returnValue; }
Source:
public void buyFromBank(Market m, String symbol, int volume) throws StockMarketExpection { if ((double)volume * m.getStockForSymbol(symbol).getPrice() > cashInHand) { throw new StockMarketExpection("Not enough cash in hand to place buy order."); } int previousVolume = 0; for (Order order: position) { if (order.getStockSymbol() == symbol) { previousVolume += order.getSize(); position.remove(order); break; } } Order newOrder = new BuyOrder(symbol, volume + previousVolume, m.getStockForSymbol(symbol).getPrice(), this); this.position.add(newOrder); this.cashInHand -= (double)volume * m.getStockForSymbol(symbol).getPrice(); }

Target:
public void buyFromBank(Market m, String symbol, int volume) throws StockMarketExpection { if ((double)volume * m.getStockForSymbol(symbol).getPrice() > cashInHand) { throw new StockMarketExpection("Not enough cash in hand to place buy order."); } int previousVolume = 0; for (Order order: possession) { if (order.getStockSymbol() == symbol) { previousVolume += order.getSize(); possession.remove(order); break; } } Order newOrder = new BuyOrder(symbol, volume + previousVolume, m.getStockForSymbol(symbol).getPrice(), this); this.possession.add(newOrder); this.cashInHand -= (double)volume * m.getStockForSymbol(symbol).getPrice(); }
Source:
public void quotaTest() throws Exception { Properties props = new Properties(); props.setProperty(FrontendConfig.REST_REQUEST_QUOTA_STRING, "{\"PUT\": \"20\",\"GET\": \"20\",\"POST\": \"20\",\"HEAD\": \"20\",\"OPTIONS\": \"20\",\"UNKNOWN\": \"20\",\"DELETE\": \"20\"}"); FrontendConfig frontendConfig = new FrontendConfig(new VerifiableProperties(props)); RejectThrottlerTest.MockClock clock = new RejectThrottlerTest.MockClock(); QuotaManager quotaManager = new MockQuotaManager(frontendConfig, clock); for (int i = 0; i < 100; i++) { for (RestMethod resetMethod : RestMethod.values()) { RestRequest restRequest = createRestRequest(resetMethod, "<LINK_0>", null, null); Assert.assertFalse("Should not throttle", quotaManager.shouldThrottle(restRequest)); } } clock.tick(5); for (RestMethod resetMethod : RestMethod.values()) { RestRequest restRequest = createRestRequest(resetMethod, "<LINK_0>", null, null); Assert.assertTrue("Should throttle", quotaManager.shouldThrottle(restRequest)); } clock.tick(5); for (RestMethod resetMethod : RestMethod.values()) { RestRequest restRequest = createRestRequest(resetMethod, "<LINK_0>", null, null); Assert.assertFalse("Should not throttle", quotaManager.shouldThrottle(restRequest)); } }

Target:
public void quotaTest() throws Exception { Properties props = new Properties(); props.setProperty(FrontendConfig.REST_REQUEST_QUOTA_STRING, "{\"PUT\": \"20\",\"GET\": \"20\",\"POST\": \"20\",\"HEAD\": \"20\",\"OPTIONS\": \"20\",\"DELETE\": \"20\"}"); FrontendConfig frontendConfig = new FrontendConfig(new VerifiableProperties(props)); RejectThrottlerTest.MockClock clock = new RejectThrottlerTest.MockClock(); QuotaManager quotaManager = new QuotaManager(createQuotaMock(frontendConfig, clock)); for (int i = 0; i < 100; i++) { for (RestMethod restMethod : RestMethod.values()) { RestRequest restRequest = createRestRequest(restMethod, "<LINK_0>", null, null); Assert.assertFalse("Should not throttle", quotaManager.shouldThrottle(restRequest)); } } clock.tick(5); for (RestMethod restMethod : RestMethod.values()) { RestRequest restRequest = createRestRequest(restMethod, "<LINK_0>", null, null); if (restMethod == RestMethod.UNKNOWN) { Assert.assertFalse("Should not throttle.", quotaManager.shouldThrottle(restRequest)); } else { Assert.assertTrue("Should throttle", quotaManager.shouldThrottle(restRequest)); } } clock.tick(5); for (RestMethod restMethod : RestMethod.values()) { RestRequest restRequest = createRestRequest(restMethod, "<LINK_0>", null, null); Assert.assertFalse("Should not throttle", quotaManager.shouldThrottle(restRequest)); } }
Source:
protected void starting(org.junit.runner.Description description) { TestUtils.deleteTargetTestClassFolder(description); String methodName = description.getMethodName(); String className = description.getClassName(); this.dataDirectory = "target/" + className + "/" + methodName + "/data"; try { filePaths = createData(this.dataDirectory); } catch (IOException e) { throw new RuntimeException(e); } fileSplitterInput = new FileSplitterInput(); scanner = new MockScanner(); fileSplitterInput.setScanner(scanner); fileSplitterInput.getScanner().setScanIntervalMillis(500); fileSplitterInput.getScanner().setFilePatternRegularExp(".*[.]txt"); fileSplitterInput.getScanner().setFiles(new File(dataDirectory).getAbsolutePath()); Attribute.AttributeMap.DefaultAttributeMap attributes = new Attribute.AttributeMap.DefaultAttributeMap(); attributes.put(Context.DAGContext.APPLICATION_PATH, "target/" + className + "/" + methodName + "/" + Long.toHexString(System.currentTimeMillis())); context = new OperatorContextTestHelper.TestIdOperatorContext(0, attributes); fileSplitterInput.setup(context); fileMetadataSink = new CollectorTestSink<>(); TestUtils.setSink(fileSplitterInput.filesMetadataOutput, fileMetadataSink); blockMetadataSink = new CollectorTestSink<>(); TestUtils.setSink(fileSplitterInput.blocksMetadataOutput, blockMetadataSink); }

Target:
protected void starting(org.junit.runner.Description description) { TestUtils.deleteTargetTestClassFolder(description); String methodName = description.getMethodName(); String className = description.getClassName(); this.dataDirectory = "target/" + className + "/" + methodName + "/data"; try { filePaths = createData(this.dataDirectory); } catch (IOException e) { throw new RuntimeException(e); } fileSplitterInput = new FileSplitterInput(); scanner = new MockScanner(); fileSplitterInput.setScanner(scanner); fileSplitterInput.getScanner().setScanIntervalMillis(500); fileSplitterInput.getScanner().setFilePatternRegularExp(".*[.]txt"); fileSplitterInput.getScanner().setFiles(dataDirectory); Attribute.AttributeMap.DefaultAttributeMap attributes = new Attribute.AttributeMap.DefaultAttributeMap(); attributes.put(Context.DAGContext.APPLICATION_PATH, "target/" + className + "/" + methodName + "/" + Long.toHexString(System.currentTimeMillis())); context = new OperatorContextTestHelper.TestIdOperatorContext(0, attributes); fileSplitterInput.setup(context); fileMetadataSink = new CollectorTestSink<>(); TestUtils.setSink(fileSplitterInput.filesMetadataOutput, fileMetadataSink); blockMetadataSink = new CollectorTestSink<>(); TestUtils.setSink(fileSplitterInput.blocksMetadataOutput, blockMetadataSink); }
Source:
public Object bulkheadAroundAdvice(ProceedingJoinPoint proceedingJoinPoint, Bulkhead backendMonitored) throws Throwable { Method method = ((MethodSignature) proceedingJoinPoint.getSignature()).getMethod(); String methodName = method.getDeclaringClass().getName() + "#" + method.getName(); if (backendMonitored == null) { backendMonitored = getBackendMonitoredAnnotation(proceedingJoinPoint); } String backend = backendMonitored.name(); io.github.resilience4j.bulkhead.Bulkhead bulkhead = getOrCreateBulkhead(methodName, backend); Class<?> returnType = method.getReturnType(); if (bulkHeadAspectExts != null && !bulkHeadAspectExts.isEmpty()) { for (BulkHeadAspectExt bulkHeadAspectExt : bulkHeadAspectExts) { if (bulkHeadAspectExt.canHandleReturnType(returnType)) { return bulkHeadAspectExt.handle(proceedingJoinPoint, bulkhead, methodName); } } } else if (CompletionStage.class.isAssignableFrom(returnType)) { return handleJoinPointCompletableFuture(proceedingJoinPoint, bulkhead, methodName); } return handleJoinPoint(proceedingJoinPoint, bulkhead, methodName); }

Target:
public Object bulkheadAroundAdvice(ProceedingJoinPoint proceedingJoinPoint, Bulkhead backendMonitored) throws Throwable { Method method = ((MethodSignature) proceedingJoinPoint.getSignature()).getMethod(); String methodName = method.getDeclaringClass().getName() + "#" + method.getName(); if (backendMonitored == null) { backendMonitored = getBackendMonitoredAnnotation(proceedingJoinPoint); } String backend = backendMonitored.name(); io.github.resilience4j.bulkhead.Bulkhead bulkhead = getOrCreateBulkhead(methodName, backend); Class<?> returnType = method.getReturnType(); if (bulkheadAspectExts != null && !bulkheadAspectExts.isEmpty()) { for (BulkheadAspectExt bulkHeadAspectExt : bulkheadAspectExts) { if (bulkHeadAspectExt.canHandleReturnType(returnType)) { return bulkHeadAspectExt.handle(proceedingJoinPoint, bulkhead, methodName); } } } else if (CompletionStage.class.isAssignableFrom(returnType)) { return handleJoinPointCompletableFuture(proceedingJoinPoint, bulkhead, methodName); } return handleJoinPoint(proceedingJoinPoint, bulkhead, methodName); }
Source:
public int execute(List<String> script, String summaryForLogging) { if (failExecution) { throw new TestException("Simulated driver exception"); } return super.execute(script, summaryForLogging); }

Target:
public int execute(List<String> script, String summaryForLogging) { if (failExecution) { throw new TestException("Simulated driver exception"); } return 0; }
Source:
private void printHelp(Console console) { console.warn("Invalid or Unknown ship ID."); console.warn("Usage: \"changeship module:shipName\""); }

Target:
private void printHelp(Console console) { console.warn("Invalid or Unknown ship ID."); console.warn("Usage: \"changeShip module:shipName\""); }
Source:
private void reportModulesNotFoundErrors(@NotNull DependencySetupErrors setupErrors) { reportModulesNotFoundIssues(MISSING_DEPENDENCIES_BETWEEN_MODULES, setupErrors.getMissingModules()); for (String dependent : setupErrors.getMissingNames()) { String msg = String.format("Module '%1$s' depends on modules that do not have a name.", dependent); add(new Message(FAILED_TO_SET_UP_DEPENDENCIES, Message.Type.ERROR, msg)); } for (String dependent : setupErrors.getDependentsOnLibrariesWithoutBinaryPath()) { String msg = String.format("Module '%1$s' depends on libraries that do not have a 'binary' path.", dependent); add(new Message(FAILED_TO_SET_UP_DEPENDENCIES, Message.Type.ERROR, msg)); } for (DependencySetupErrors.InvalidModuleDependency dependency : setupErrors.getInvalidModuleDependencies()) { String msg = String.format("Dependency '%1$s' on module '%2$s' is ignored because: %3$s.", dependency.targetModuleName, dependency.module.getName(), dependency.detail); VirtualFile buildFile = getBuildFile(dependency.module); assert buildFile != null; add(new Message(FAILED_TO_SET_UP_DEPENDENCIES, Message.Type.WARNING, new OpenFileDescriptor(dependency.module.getProject(), buildFile, 0), msg)); } reportModulesNotFoundIssues(FAILED_TO_SET_UP_DEPENDENCIES, setupErrors.getMissingModulesWithBackupLibraries()); }

Target:
private void reportModulesNotFoundErrors(@NotNull DependencySetupErrors setupErrors) { reportModulesNotFoundIssues(MISSING_DEPENDENCIES_BETWEEN_MODULES, setupErrors.getMissingModules()); for (String dependent : setupErrors.getMissingNames()) { String msg = String.format("Module '%1$s' depends on modules that do not have a name.", dependent); add(new Message(FAILED_TO_SET_UP_DEPENDENCIES, Message.Type.ERROR, msg)); } for (String dependent : setupErrors.getDependentsOnLibrariesWithoutBinaryPath()) { String msg = String.format("Module '%1$s' depends on libraries that do not have a 'binary' path.", dependent); add(new Message(FAILED_TO_SET_UP_DEPENDENCIES, Message.Type.ERROR, msg)); } for (DependencySetupErrors.InvalidModuleDependency dependency : setupErrors.getInvalidModuleDependencies()) { String msg = String.format("Ignoring dependency of module '%1$s' on module '%2$s'. %3$s", dependency.dependent, dependency.dependency.getName(), dependency.detail); VirtualFile buildFile = getBuildFile(dependency.dependency); assert buildFile != null; add(new Message(FAILED_TO_SET_UP_DEPENDENCIES, Message.Type.WARNING, new OpenFileDescriptor(dependency.dependency.getProject(), buildFile, 0), msg)); } reportModulesNotFoundIssues(FAILED_TO_SET_UP_DEPENDENCIES, setupErrors.getMissingModulesWithBackupLibraries()); }
Source:
protected <T> List<T> doMap(final IMappingService mappingService, final org.eclipse.papyrus.model2doc.emf.documentstructuretemplate.TableOfFigures documentStructureElement, final EObject modelElement, Class<T> expectedReturnedClass) { final TableOfFigures toc = DocumentStructureFactory.eINSTANCE.createTableOfFigures(); toc.setTofTitle(documentStructureElement.getTofTitle()); return Collections.singletonList(expectedReturnedClass.cast(toc)); }

Target:
protected <T> List<T> doMap(final IMappingService mappingService, final org.eclipse.papyrus.model2doc.emf.documentstructuretemplate.TableOfFigures documentStructureElement, final EObject modelElement, Class<T> expectedReturnedClass) { final TableOfFigures tof = DocumentStructureFactory.eINSTANCE.createTableOfFigures(); tof.setTofTitle(documentStructureElement.getTofTitle()); return Collections.singletonList(expectedReturnedClass.cast(tof)); }
Source:
public Object getEntity() { abortIfClosed(); Object entity = super.getEntity(); if (entity != null) { return entity; } try { InputStream inputStream = getEntityStream(); if(inputStream.available() == 0){ throw new IllegalStateException(); } return inputStream; } catch (IOException e) { throw new IllegalStateException(e); } }

Target:
public synchronized Object getEntity() { abortIfClosed(); Object entity = super.getEntity(); if (entity != null) { return entity; } try { InputStream inputStream = getEntityStream(); if(inputStream.available() == 0){ throw new IllegalStateException(); } return inputStream; } catch (IOException e) { throw new IllegalStateException(e); } }
Source:
private void addCentralRepositoryEntry(StringBuilder html, CorrelationAttributeInstance attributeInstance) { startTable(html); addRow(html, "Case:", attributeInstance.getCorrelationCase().getDisplayName()); addRow(html, "Type:", attributeInstance.getCorrelationType().getDisplayName()); addRow(html, "Comment:", convertLineBreaksToHtml(attributeInstance.getComment())); addRow(html, "Path:", attributeInstance.getFilePath()); endTable(html); }

Target:
private void addCentralRepositoryEntry(StringBuilder html, CorrelationAttributeInstance attributeInstance) { startTable(html); addRow(html, Bundle.AnnotationsContentViewer_centralRepositoryEntryDataLabel_case(), attributeInstance.getCorrelationCase().getDisplayName()); addRow(html, Bundle.AnnotationsContentViewer_centralRepositoryEntryDataLabel_type(), attributeInstance.getCorrelationType().getDisplayName()); addRow(html, Bundle.AnnotationsContentViewer_centralRepositoryEntryDataLabel_comment(), formatHtmlString(attributeInstance.getComment())); addRow(html, Bundle.AnnotationsContentViewer_centralRepositoryEntryDataLabel_path(), attributeInstance.getFilePath()); endTable(html); }
Source:
public Set<Query> getQueries() throws ConfigException { Set<Query> queries = new HashSet<Query>(); SrampAtomApiClient client = SrampAtomApiClientFactory.createAtomApiClient(); StringBuilder queryBuilder = new StringBuilder(); queryBuilder.append(ARTIFACT_TYPE); SrampClientQuery query = client.buildQuery(queryBuilder.toString()); SrampClientQuery scq = query.startIndex(0); try { QueryResultSet resultSet = scq.query(); for (ArtifactSummary artifactSummary : resultSet) { BaseArtifactType artifact = client.getArtifactMetaData(artifactSummary.getUuid()); String srampQuery = ""; artifactSummary.getCustomPropertyValue(PROPERTY_QUERY); String workflowId = ""; artifactSummary.getCustomPropertyValue(PROPERTY_WORKLOW); Query q = new Query(srampQuery, workflowId); for (Property prop : artifact.getProperty()) { if (prop.getPropertyName().equals(PROPERTY_WORKLOW)) { workflowId = prop.getPropertyValue(); } else if (prop.getPropertyName().equals(PROPERTY_QUERY)) { srampQuery = prop.getPropertyValue(); } else if (prop.getPropertyName().startsWith(PROPERTY_PREFIX)) { String value = prop.getPropertyValue(); q.addParameter(prop.getPropertyName().substring(PROPERTY_PREFIX.length()), value); } } q.setWorkflowId(workflowId); q.setSrampQuery(srampQuery); queries.add(q); } } catch (SrampClientException e) { logger.error( Messages.i18n.format( "QueryExecutor.ExceptionFor", "Reading query from s-ramp", e.getMessage()), e); } catch (SrampAtomException e) { logger.error( Messages.i18n.format( "QueryExecutor.ExceptionFor", " Reading query from s-ramp", e.getMessage()), e); } return queries; }

Target:
public Set<Query> getQueries() throws ConfigException { Set<Query> queries = new HashSet<Query>(); SrampAtomApiClient client = SrampAtomApiClientFactory.createAtomApiClient(); StringBuilder queryBuilder = new StringBuilder(); queryBuilder.append(ARTIFACT_TYPE); SrampClientQuery query = client.buildQuery(queryBuilder.toString()); SrampClientQuery scq = query.startIndex(0); try { QueryResultSet resultSet = scq.query(); for (ArtifactSummary artifactSummary : resultSet) { BaseArtifactType artifact = client.getArtifactMetaData(artifactSummary.getUuid()); Query q = new Query(SrampModelUtils.getCustomProperty(artifact, PROPERTY_QUERY), SrampModelUtils.getCustomProperty(artifact, PROPERTY_WORKLOW)); q.setParameters(SrampModelUtils.getCustomPropertiesByPrefix(artifact, PROPERTY_PREFIX)); queries.add(q); } } catch (SrampClientException e) { logger.error( Messages.i18n.format( "QueryExecutor.ExceptionFor", "Reading query from s-ramp", e.getMessage()), e); } catch (SrampAtomException e) { logger.error( Messages.i18n.format( "QueryExecutor.ExceptionFor", " Reading query from s-ramp", e.getMessage()), e); } return queries; }
Source:
public void testInnerThreadMetaData() { Bugsnag.addThreadMetaData("outerthread", "some key", "value should not be in report"); Thread thread = new Thread(new Runnable() { @Override public void run() { Bugsnag.addThreadMetaData("innerthread", "some key", "value should be in report"); bugsnag.notify(new RuntimeException("test")); } }); thread.start(); try { Thread.sleep(2000); } catch (InterruptedException ex) { } Notification notification = delivery.getNotifications().get(0); Report report = notification.getEvents().get(0); assertTrue(report.getMetaData().containsKey("innerthread")); assertEquals("value should be in report", getMetaDataMap(notification, "innerthread").get("some key")); assertFalse(report.getMetaData().containsKey("outerthread")); }

Target:
public void testInnerThreadMetaData() { Bugsnag.addThreadMetaData("outerthread", "some key", "value should not be in report"); Thread thread = new Thread(new Runnable() { @Override public void run() { Bugsnag.addThreadMetaData("innerthread", "some key", "value should be in report"); bugsnag.notify(new RuntimeException("test")); } }); thread.start(); try { thread.join(); } catch (InterruptedException ex) { } Notification notification = delivery.getNotifications().get(0); Report report = notification.getEvents().get(0); assertTrue(report.getMetaData().containsKey("innerthread")); assertEquals("value should be in report", getMetaDataMap(notification, "innerthread").get("some key")); assertFalse(report.getMetaData().containsKey("outerthread")); }
Source:
public void assumeShallow(Collection<? extends ObjectId> ids) throws IOException { if (!shallowCommitsInitialized) initializeShallowCommits(); for (ObjectId id : ids) lookupCommit(id).parents = RevCommit.NO_PARENTS; }

Target:
public void assumeShallow(Collection<? extends ObjectId> ids) { for (ObjectId id : ids) lookupCommit(id).parents = RevCommit.NO_PARENTS; }
Source:
public void validate(Object obj, Errors errors) { Order order = (Order) obj; if (order == null) { errors.rejectValue("order", "error.general"); } else { if (order.getEncounter() != null && order.getPatient() != null && order.getOrderer() != null) { if (!order.getEncounter().getPatient().equals(order.getPatient())) errors.rejectValue("encounter", "Order.error.encounterPatientMismatch"); } ValidationUtils.rejectIfEmpty(errors, "voided", "error.null"); ValidationUtils.rejectIfEmpty(errors, "concept", "Concept.noConceptSelected"); ValidationUtils.rejectIfEmpty(errors, "patient", "error.null"); ValidationUtils.rejectIfEmpty(errors, "orderer", "error.null"); Date startDate = order.getStartDate(); if (startDate != null) { Date dateStopped = order.getDateStopped(); if (dateStopped != null && startDate.after(dateStopped)) { errors.rejectValue("startDate", "Order.error.startDateAfterDiscontinuedDate"); errors.rejectValue("dateStopped", "Order.error.startDateAfterDiscontinuedDate"); } Date autoExpireDate = order.getAutoExpireDate(); if (autoExpireDate != null && startDate.after(autoExpireDate)) { errors.rejectValue("startDate", "Order.error.startDateAfterAutoExpireDate"); errors.rejectValue("autoExpireDate", "Order.error.startDateAfterAutoExpireDate"); } } } }

Target:
public void validate(Object obj, Errors errors) { Order order = (Order) obj; if (order == null) { errors.rejectValue("order", "error.general"); } else { if (order.getEncounter() != null && order.getPatient() != null) { if (!order.getEncounter().getPatient().equals(order.getPatient())) errors.rejectValue("encounter", "Order.error.encounterPatientMismatch"); } ValidationUtils.rejectIfEmpty(errors, "voided", "error.null"); ValidationUtils.rejectIfEmpty(errors, "concept", "Concept.noConceptSelected"); ValidationUtils.rejectIfEmpty(errors, "patient", "error.null"); ValidationUtils.rejectIfEmpty(errors, "orderer", "error.null"); Date startDate = order.getStartDate(); if (startDate != null) { Date dateStopped = order.getDateStopped(); if (dateStopped != null && startDate.after(dateStopped)) { errors.rejectValue("startDate", "Order.error.startDateAfterDiscontinuedDate"); errors.rejectValue("dateStopped", "Order.error.startDateAfterDiscontinuedDate"); } Date autoExpireDate = order.getAutoExpireDate(); if (autoExpireDate != null && startDate.after(autoExpireDate)) { errors.rejectValue("startDate", "Order.error.startDateAfterAutoExpireDate"); errors.rejectValue("autoExpireDate", "Order.error.startDateAfterAutoExpireDate"); } } } }
Source:
protected void updateSensorProperties() { Map<String, String> properties = editProperties(); Bridge bridge = getBridge(); if (bridge == null) { logger.info("updating thing properties failed, no bridge available"); scheduler.schedule(() -> { updateSensorProperties(); }, 5000, TimeUnit.MILLISECONDS); return; } OwBaseBridgeHandler bridgeHandler = (OwBaseBridgeHandler) bridge.getHandler(); try { if (bridgeHandler == null) { throw new OwException("no bridge handler available"); } OwPageBuffer pages = bridgeHandler.readPages(sensorIds.get(0)); prodDate = String.format("%d/%d", pages.getByte(5, 0), 256 * pages.getByte(5, 1) + pages.getByte(5, 2)); hwRevision = pages.getByte(5, 3); properties.put(PROPERTY_PROD_DATE, prodDate); properties.put(PROPERTY_HW_REVISION, String.valueOf(hwRevision)); logger.trace("set production date {}, revision {}", prodDate, hwRevision); } catch (OwException e) { logger.info("updating thing properties failed: {}", e.getMessage()); scheduler.schedule(() -> { updateSensorProperties(); }, 5000, TimeUnit.MILLISECONDS); return; } updateProperties(properties); }

Target:
protected void updateSensorProperties() { Map<String, String> properties = editProperties(); Bridge bridge = getBridge(); if (bridge == null) { logger.debug("updating thing properties failed, no bridge available"); scheduler.schedule(() -> { updateSensorProperties(); }, 5000, TimeUnit.MILLISECONDS); return; } OwBaseBridgeHandler bridgeHandler = (OwBaseBridgeHandler) bridge.getHandler(); try { if (bridgeHandler == null) { throw new OwException("no bridge handler available"); } OwPageBuffer pages = bridgeHandler.readPages(sensorIds.get(0)); prodDate = String.format("%d/%d", pages.getByte(5, 0), 256 * pages.getByte(5, 1) + pages.getByte(5, 2)); hwRevision = pages.getByte(5, 3); properties.put(PROPERTY_PROD_DATE, prodDate); properties.put(PROPERTY_HW_REVISION, String.valueOf(hwRevision)); logger.trace("set production date {}, revision {}", prodDate, hwRevision); } catch (OwException e) { logger.info("updating thing properties failed: {}", e.getMessage()); scheduler.schedule(() -> { updateSensorProperties(); }, 5000, TimeUnit.MILLISECONDS); return; } updateProperties(properties); }
Source:
private void rewriteConfigMapNames(PodData pod, Map<String, String> configMapNameTranslation) { for (Container container : pod.getSpec().getContainers()) { if (container.getEnv() != null) { container .getEnv() .stream() .filter( env -> env.getValueFrom() != null && env.getValueFrom().getConfigMapKeyRef() != null) .forEach( env -> { ConfigMapKeySelector configMap = env.getValueFrom().getConfigMapKeyRef(); String originalName = configMap.getName(); configMap.setName(configMapNameTranslation.get(originalName)); }); } if (container.getEnvFrom() != null) { container .getEnvFrom() .stream() .filter(envFrom -> envFrom.getConfigMapRef() != null) .forEach( envFrom -> { ConfigMapEnvSource configMapRef = envFrom.getConfigMapRef(); String originalName = configMapRef.getName(); configMapRef.setName(configMapNameTranslation.get(originalName)); }); } } List<Volume> volumes = pod.getSpec().getVolumes(); if (pod.getSpec().getVolumes() != null) { volumes .stream() .filter(vol -> vol.getConfigMap() != null) .forEach( volume -> { ConfigMapVolumeSource configMapVolume = volume.getConfigMap(); String originalName = configMapVolume.getName(); configMapVolume.setName(configMapNameTranslation.get(originalName)); }); } }

Target:
private void rewriteConfigMapNames(PodData pod, Map<String, String> configMapNameTranslation) { for (Container container : pod.getSpec().getContainers()) { if (container.getEnv() != null) { container .getEnv() .stream() .filter( env -> env.getValueFrom() != null && env.getValueFrom().getConfigMapKeyRef() != null) .forEach( env -> { ConfigMapKeySelector configMap = env.getValueFrom().getConfigMapKeyRef(); String originalName = configMap.getName(); if (configMapNameTranslation.containsKey(originalName)) { configMap.setName(configMapNameTranslation.get(originalName)); } }); } if (container.getEnvFrom() != null) { container .getEnvFrom() .stream() .filter(envFrom -> envFrom.getConfigMapRef() != null) .forEach( envFrom -> { ConfigMapEnvSource configMapRef = envFrom.getConfigMapRef(); String originalName = configMapRef.getName(); if (configMapNameTranslation.containsKey(originalName)) { configMapRef.setName(configMapNameTranslation.get(originalName)); } }); } } List<Volume> volumes = pod.getSpec().getVolumes(); if (pod.getSpec().getVolumes() != null) { volumes .stream() .filter(vol -> vol.getConfigMap() != null) .forEach( volume -> { ConfigMapVolumeSource configMapVolume = volume.getConfigMap(); String originalName = configMapVolume.getName(); if (configMapNameTranslation.containsKey(originalName)) { configMapVolume.setName(configMapNameTranslation.get(originalName)); } }); } }
Source:
public void bookmarkFromIterable() { Bookmark bookmark = Bookmark.from( asList( "neo4j:bookmark:v1:tx42", "neo4j:bookmark:v1:tx10", "neo4j:bookmark:v1:tx12" ) ); assertEquals( "neo4j:bookmark:v1:tx42", bookmark.asString() ); verifyParameters( bookmark, "neo4j:bookmark:v1:tx42", "neo4j:bookmark:v1:tx42", "neo4j:bookmark:v1:tx10", "neo4j:bookmark:v1:tx12" ); }

Target:
public void bookmarkFromIterable() { Bookmark bookmark = Bookmark.from( asList( "neo4j:bookmark:v1:tx42", "neo4j:bookmark:v1:tx10", "neo4j:bookmark:v1:tx12" ) ); assertEquals( "neo4j:bookmark:v1:tx42", bookmark.maxBookmarkAsString() ); verifyParameters( bookmark, "neo4j:bookmark:v1:tx42", "neo4j:bookmark:v1:tx42", "neo4j:bookmark:v1:tx10", "neo4j:bookmark:v1:tx12" ); }
Source:
public Collection<Dataset> listDatasets(Project project) { final HashSet<Dataset> datasets = listDatasetLinks(project).stream().map(link -> new Dataset(link.getIdentifier(), link.getUri(), link.getTitle())).collect(Collectors.toCollection(HashSet::new)); return datasets; }

Target:
public Collection<Dataset> listDatasets(Project project) { return listDatasetLinks(project).stream().map(link -> new Dataset(link.getIdentifier(), link.getUri(), link.getTitle())).collect(Collectors.toCollection(HashSet::new)); }
Source:
private boolean canAdd(IFeatureModel candidate) { ISiteFeature[] features = fModel.getSite().getFeatures(); IFeature cfeature = candidate.getFeature(); String id = cfeature.getId(); String version = cfeature.getVersion(); for (ISiteFeature bfeature : features) { boolean idEquals = Objects.equals(bfeature.getId(), id); if (idEquals && (version == null || version.equals(bfeature.getVersion()))) { return false; } } return true; }

Target:
private boolean canAdd(IFeatureModel candidate) { ISiteFeature[] features = fModel.getSite().getFeatures(); IFeature cfeature = candidate.getFeature(); String id = cfeature.getId(); String version = cfeature.getVersion(); for (ISiteFeature bfeature : features) { boolean idEquals = Objects.equals(bfeature.getId(), id); if (idEquals && (bfeature.getVersion() == null || Objects.equals(bfeature.getVersion(), version))) { return false; } } return true; }
Source:
private void appendBuild(StringBuffer buf, final TaskListener listener, final Run<?, ?> currentRun) throws MacroEvaluationException { final ChangesSinceLastBuildContent changes = new ChangesSinceLastBuildContent(changesFormat, pathFormat, showPaths); changes.showDependencies = showDependencies; changes.dateFormat = dateFormat; changes.regex = regex; changes.replace = replace; changes.def = def; Util.printf(buf, format, new Util.PrintfSpec() { public boolean printSpec(StringBuffer buf, char formatChar) { switch (formatChar) { case 'c': try { buf.append(changes.evaluate((AbstractBuild)currentRun, listener, ChangesSinceLastBuildContent.MACRO_NAME)); } catch(Exception e) { } return true; case 'n': buf.append(currentRun.getNumber()); return true; default: return false; } } }); }

Target:
private void appendBuild(StringBuffer buf, final TaskListener listener, final Run<?, ?> currentRun) throws MacroEvaluationException { final ChangesSinceLastBuildContent changes = new ChangesSinceLastBuildContent(changesFormat, pathFormat, showPaths); changes.showDependencies = showDependencies; changes.dateFormat = dateFormat; changes.regex = regex; changes.replace = replace; changes.def = def; Util.printf(buf, format, new Util.PrintfSpec() { public boolean printSpec(StringBuffer buf, char formatChar) { switch (formatChar) { case 'c': try { if(currentRun instanceof AbstractBuild) { buf.append(changes.evaluate((AbstractBuild) currentRun, listener, ChangesSinceLastBuildContent.MACRO_NAME)); } } catch(Exception e) { } return true; case 'n': buf.append(currentRun.getNumber()); return true; default: return false; } } }); }
Source:
public SmudgeFilter(Repository db, InputStream in, OutputStream out) throws IOException { super(in, out); lfsUtil = new LfsUtil(db.getDirectory().toPath().resolve("lfs")); LfsPointer res = LfsPointer.parseLfsPointer(in); if (res != null) { Path mediaFile = lfsUtil.getMediaFile(res.getOid()); if (Files.exists(mediaFile)) { this.in = Files.newInputStream(mediaFile); } } }

Target:
public SmudgeFilter(Repository db, InputStream in, OutputStream out) throws IOException { super(in, out); lfs = new Lfs(db.getDirectory().toPath().resolve(Constants.LFS)); LfsPointer res = LfsPointer.parseLfsPointer(in); if (res != null) { Path mediaFile = lfs.getMediaFile(res.getOid()); if (Files.exists(mediaFile)) { this.in = Files.newInputStream(mediaFile); } } }
Source:
public void preDestroy() { if(formGroup != null) { FormsElementWrapperWidgetUtil.clear(this); } partsWidgets.values().forEach(part -> part.asWidget().removeFromParent()); partsWidgets.clear(); formGroupsInstance.destroyAll(); fieldChangeListeners.clear(); formField = null; formGroup = null; field = null; }

Target:
public void preDestroy() { wrapperWidgetUtil.clear(this); partsWidgets.values().forEach(part -> part.asWidget().removeFromParent()); partsWidgets.clear(); formGroupsInstance.destroyAll(); fieldChangeListeners.clear(); formField = null; formGroup = null; field = null; }
Source:
public void doPolling(Guid cmdId, List<Guid> childCmdIds) { RebootVmCommand<P> command = getCommand(cmdId); boolean anyFailed = false; for (Guid childCmdId : childCmdIds) { CommandEntity entity = CommandCoordinatorUtil.getCommandEntity(childCmdId); switch (entity.getCommandStatus()) { case FAILED: case FAILED_RESTARTED: case UNKNOWN: anyFailed = true; break; default: break; } if (entity.isExecuted() && !entity.getReturnValue().getSucceeded()) { anyFailed = true; } } if (anyFailed) { command.setCommandStatus(CommandStatus.FAILED); } else { VM vm = DbFacade.getInstance().getVmDao().get(command.getParameters().getVmId()); if (vm.getStatus() == VMStatus.Down && !DbFacade.getInstance().getSnapshotDao().exists(vm.getId(), Snapshot.SnapshotStatus.LOCKED)) { command.proceedWithColdRun(); } } }

Target:
public void doPolling(Guid cmdId, List<Guid> childCmdIds) { RebootVmCommand<P> command = getCommand(cmdId); boolean anyFailed = false; for (Guid childCmdId : childCmdIds) { CommandEntity entity = CommandCoordinatorUtil.getCommandEntity(childCmdId); switch (entity.getCommandStatus()) { case FAILED: case FAILED_RESTARTED: case UNKNOWN: anyFailed = true; break; default: break; } } if (anyFailed) { command.setCommandStatus(CommandStatus.FAILED); } else { VM vm = DbFacade.getInstance().getVmDao().get(command.getParameters().getVmId()); if (isVmDownForColdReboot(vm)) { command.proceedWithColdRun(); } } }
Source:
default boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) { return false; }

Target:
default boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) { throw new AssertionError("actPrimary must be overridden"); }