auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static DateTime possiblySanitizeSampleTime(final DateTime referenceTime, final DateTime sampleTime, final Integer clockSkewInHours) { final DateTime copySampleTime = new DateTime(sampleTime); final Integer diffInMinutes = Minutes.minutesBetween(referenceTime, copySampleTime.minusMonths(5)).getMinutes(); if(Math.abs(diffInMinutes) < clockSkewInHours * 60) { return sampleTime.minusMonths(5).withMinuteOfHour(sampleTime.getMinuteOfHour()).withHourOfDay(sampleTime.getHourOfDay()); } return sampleTime; }

Target:
public static DateTime possiblySanitizeSampleTime(final DateTime referenceTime, final DateTime sampleTime, final Integer clockSkewInHours) { final Integer diffInMinutes = Minutes.minutesBetween(referenceTime, sampleTime.minusMonths(5)).getMinutes(); if(Math.abs(diffInMinutes) < clockSkewInHours * 60) { return sampleTime.minusMonths(5).withMinuteOfHour(sampleTime.getMinuteOfHour()).withHourOfDay(sampleTime.getHourOfDay()); } return sampleTime; }
Source:
private void verifyLineByLine(final InputStream stream, final InputStream rStream, final String fileName) throws IOException, CoreException { final LineComparator comparator = new LineComparator(stream, ignoreWhiteSpace); final LineComparator rComparator = new LineComparator(rStream, ignoreWhiteSpace); final RangeDifference[] diffs = RangeDifferencer.findRanges((IRangeComparator) null, comparator, rComparator); boolean haschange = false; boolean skippedLines = true; for (final RangeDifference diff : diffs) { if(diff.kind() != RangeDifference.CHANGE) { continue; } for (int i = 0; i < Math.max(diff.leftLength(), diff.rightLength()); i++) { int left = diff.leftStart() + i; int right = diff.rightStart() + i; if (right < diff.rightEnd()) { final String line = rComparator.getLine(right); if (!isSkippedLine(line)) { skippedLines = false; break; } } if (left < diff.leftEnd()) { final String line = comparator.getLine(left); if (!isSkippedLine(line)) { skippedLines = false; break; } } } if(!skippedLines) { haschange = true; break; } } if (!haschange) { return; } final ArrayList<String> l1 = comparator.listOflines; final ArrayList<String> l2 = rComparator.listOflines; final String patch = String.join("\n", DiffUtils.generateUnifiedDiff(fileName, fileName, l1, DiffUtils.diff(l1, l2), 3)); reportError(patch); }

Target:
private void verifyLineByLine(final InputStream stream, final InputStream rStream, final String fileName) throws IOException, CoreException { final LineComparator comparator = new LineComparator(stream, ignoreWhiteSpace); final LineComparator rComparator = new LineComparator(rStream, ignoreWhiteSpace); final RangeDifference[] diffs = RangeDifferencer.findRanges((IRangeComparator) null, comparator, rComparator); boolean hasDifferences = false; for (final RangeDifference diff : diffs) { if(diff.kind() != RangeDifference.CHANGE) { continue; } for (int i = 0; i < Math.max(diff.leftLength(), diff.rightLength()); i++) { int left = diff.leftStart() + i; int right = diff.rightStart() + i; if (right < diff.rightEnd()) { final String line = rComparator.getLine(right); if (!isSkippedLine(line)) { hasDifferences = true; break; } } if (left < diff.leftEnd()) { final String line = comparator.getLine(left); if (!isSkippedLine(line)) { hasDifferences = true; break; } } } if(hasDifferences) { break; } } if (!hasDifferences) { return; } final List<String> l1 = comparator.getLines(); final List<String> l2 = rComparator.getLines(); final String patch = String.join("\n", DiffUtils.generateUnifiedDiff(fileName, fileName, l1, DiffUtils.diff(l1, l2), 3)); reportError(patch); }
Source:
private ExpressionResult evaluateUserChecks(Path path) { PermissionExecutor executor = resource.getRequestScope().getPermissionExecutor(); ExpressionResult result = ExpressionResult.PASS; for (Path.PathElement element : path.getPathElements()) { try { result = executor.checkUserPermissions( element.getType(), ReadPermission.class, element.getFieldName()); } catch (ForbiddenAccessException e) { return ExpressionResult.FAIL; } if (result == ExpressionResult.DEFERRED) { return result; } } return result; }

Target:
private ExpressionResult evaluateUserChecks(Path path) { PermissionExecutor executor = resource.getRequestScope().getPermissionExecutor(); ExpressionResult result = ExpressionResult.PASS; for (Path.PathElement element : path.getPathElements()) { try { result = executor.checkUserPermissions( element.getType(), ReadPermission.class, element.getFieldName()); } catch (ForbiddenAccessException e) { return ExpressionResult.FAIL; } if (result != ExpressionResult.PASS) { return result; } } return result; }
Source:
public void dispose() { getSite().getPage().removePartListener(partListener); IWorkingSetManager workingSetManager = getPlugin().getWorkbench() .getWorkingSetManager(); workingSetManager.removePropertyChangeListener(propertyChangeListener); if (collapseAllHandler != null) { collapseAllHandler.dispose(); } if (getActionGroup() != null) { getActionGroup().dispose(); } Control control = viewer.getControl(); if (dragDetectListener != null && control != null && control.isDisposed() == false) { control.removeListener(SWT.DragDetect, dragDetectListener); } emptyWorkspaceHelper.dispose(); super.dispose(); }

Target:
public void dispose() { getSite().getPage().removePartListener(partListener); IWorkingSetManager workingSetManager = getPlugin().getWorkbench() .getWorkingSetManager(); workingSetManager.removePropertyChangeListener(propertyChangeListener); if (collapseAllHandler != null) { collapseAllHandler.dispose(); } if (getActionGroup() != null) { getActionGroup().dispose(); } Control control = viewer.getControl(); if (dragDetectListener != null && control != null && control.isDisposed() == false) { control.removeListener(SWT.DragDetect, dragDetectListener); } super.dispose(); }
Source:
private String checksum(Object o1, Object o2) { String algorithmKey = FunctionUtils.toString(o1); String input = FunctionUtils.toString(o2); switch (algorithmKey) { case ALGORITHM_KEY_VERHOEFF: return verhoeffChecksum(input); default: throw new XPathUnsupportedException("Algorithm key " + algorithmKey + " is not supported for checksum"); } }

Target:
private static String checksum(Object o1, Object o2) { String algorithmKey = FunctionUtils.toString(o1); String input = FunctionUtils.toString(o2); switch (algorithmKey) { case ALGORITHM_KEY_VERHOEFF: return verhoeffChecksum(input); default: throw new XPathUnsupportedException("Bad algorithm key " + algorithmKey + ". We only support 'verhoeff' as algorithm key right now."); } }
Source:
private PlanRoot doAnalyzeQuery() { stateMachine.beginAnalysis(); PlanNodeIdAllocator idAllocator = new PlanNodeIdAllocator(); LogicalPlanner logicalPlanner = new LogicalPlanner(stateMachine.getSession(), planOptimizers, idAllocator, metadata, sqlParser, statsCalculator, costCalculator, stateMachine.getWarningCollector()); Plan plan = logicalPlanner.plan(analysis); queryPlan.set(plan); List<Input> inputs = new InputExtractor(metadata, stateMachine.getSession()).extractInputs(plan.getRoot()); stateMachine.setInputs(inputs); Optional<Output> output = new OutputExtractor().extractOutput(plan.getRoot()); stateMachine.setOutput(output); SubPlan fragmentedPlan = planFragmenter.createSubPlans(stateMachine.getSession(), plan, false, WarningCollector.NOOP); stateMachine.endAnalysis(); boolean explainAnalyze = analysis.getStatement() instanceof Explain && ((Explain) analysis.getStatement()).isAnalyze(); return new PlanRoot(fragmentedPlan, !explainAnalyze, extractConnectors(analysis)); }

Target:
private PlanRoot doAnalyzeQuery() { stateMachine.beginAnalysis(); PlanNodeIdAllocator idAllocator = new PlanNodeIdAllocator(); LogicalPlanner logicalPlanner = new LogicalPlanner(stateMachine.getSession(), planOptimizers, idAllocator, metadata, sqlParser, statsCalculator, costCalculator, stateMachine.getWarningCollector()); Plan plan = logicalPlanner.plan(analysis); queryPlan.set(plan); List<Input> inputs = new InputExtractor(metadata, stateMachine.getSession()).extractInputs(plan.getRoot()); stateMachine.setInputs(inputs); Optional<Output> output = new OutputExtractor().extractOutput(plan.getRoot()); stateMachine.setOutput(output); SubPlan fragmentedPlan = planFragmenter.createSubPlans(stateMachine.getSession(), plan, false, stateMachine.getWarningCollector()); stateMachine.endAnalysis(); boolean explainAnalyze = analysis.getStatement() instanceof Explain && ((Explain) analysis.getStatement()).isAnalyze(); return new PlanRoot(fragmentedPlan, !explainAnalyze, extractConnectors(analysis)); }
Source:
public Object evaluate(String expression, Map<String, Object> inputVariables) { CompilerContext ctx = newCompilerContext(); if ( inputVariables != null ) { inputVariables.entrySet().stream().forEach( e -> ctx.addInputVariable( e.getKey(), e.getValue() ) ); } CompiledExpression expr = compile( expression, ctx ); if ( inputVariables == null ) { return evaluate( expr, Collections.emptyMap() ); } else { return evaluate( expr, inputVariables ); } }

Target:
public Object evaluate(String expression, Map<String, Object> inputVariables) { CompilerContext ctx = newCompilerContext(); if ( inputVariables != null ) { inputVariables.entrySet().stream().forEach( e -> ctx.addInputVariable( e.getKey(), e.getValue() ) ); } CompiledExpression expr = compile( expression, ctx ); if ( inputVariables == null ) { return evaluate( expr, EMPTY_INPUT ); } else { return evaluate( expr, inputVariables ); } }
Source:
public List<Map<String, Object>> anyMultiQuery(QueryBuilder query, Field<?>... fields) { try (Connection c = ds.getConnection()) { LOGGER.log(Level.FINEST, query.toString()); PreparedStatement stmt = query.toStatement(c); try { ResultSet rs = stmt.executeQuery(); try { ArrayList<Map<String, Object>> results = new ArrayList<Map<String, Object>>(); while(rs.next()) { Map<String, Object> result = new HashMap<String, Object>(); for(int i = 0; i< fields.length; i++) { result.put(fields[i].getFieldName(), fields[i].getValue(rs)); } results.add(result); } return results; } finally { rs.close(); } } finally { stmt.close(); } } catch (SQLException ex) { throw new IllegalStateException("MultiSelectQuery Failed",ex); } }

Target:
public List<Map<String, Object>> anyMultiQuery(QueryBuilder query, Field<?>... fields) { LOGGER.log(Level.FINEST, query.toString()); try (Connection c = ds.getConnection()) { try (PreparedStatement stmt = query.toStatement(c)) { try (ResultSet rs = stmt.executeQuery()) { ArrayList<Map<String, Object>> results = new ArrayList<Map<String, Object>>(); while (rs.next()) { Map<String, Object> result = new HashMap<String, Object>(); for (int i = 0; i < fields.length; i++) { result.put(fields[i].getFieldName(), fields[i].getValue(rs)); } results.add(result); } return results; } } } catch (SQLException ex) { throw new IllegalStateException("MultiSelectQuery Failed",ex); } }
Source:
protected GoogleCredentials(AccessToken accessToken) { super(accessToken); }

Target:
public GoogleCredentials(AccessToken accessToken) { super(accessToken); }
Source:
public DefaultStatisticsServiceConfiguration withLatencyHistoryWindow(long duration, TimeUnit unit) { if (duration <= 0) { throw new IllegalArgumentException("Window must be a positive integer."); } this.latencyHistoryWindow = duration; this.latencyHistoryWindowUnit = unit; return this; }

Target:
public DefaultStatisticsServiceConfiguration withLatencyHistoryWindow(long duration, TimeUnit unit) { if (duration <= 0) { throw new IllegalArgumentException("Window must be a positive integer"); } this.latencyHistoryWindow = duration; this.latencyHistoryWindowUnit = unit; return this; }
Source:
public AccessControlPolicyExtension( AccessControlSecurityConfiguration config, SubjectIdentity subjectIdentity) { this.config = config; isOwner = predicate(subjectIdentity.getIdentityAttribute(), Core.METACARD_OWNER); isSystem = (s) -> { Set<String> subject = s.getOrDefault(config.getSystemUserAttribute(), Collections.emptySet()); return subject.contains(config.getSystemUserAttributeValue()); }; hasAccessAdministrators = predicate(subjectIdentity.getIdentityAttribute(), Security.ACCESS_ADMINISTRATORS); hasAccessGroups = predicate(Constants.ROLES_CLAIM_URI, SecurityAttributes.ACCESS_GROUPS); hasAccessIndividuals = predicate(subjectIdentity.getIdentityAttribute(), SecurityAttributes.ACCESS_INDIVIDUALS); }

Target:
public AccessControlPolicyExtension( AccessControlSecurityConfiguration config, SubjectIdentity subjectIdentity) { isOwner = predicate(subjectIdentity.getIdentityAttribute(), Core.METACARD_OWNER); isSystem = (s) -> { Set<String> subject = s.getOrDefault(config.getSystemUserAttribute(), Collections.emptySet()); return subject.contains(config.getSystemUserAttributeValue()); }; hasAccessAdministrators = predicate(subjectIdentity.getIdentityAttribute(), Security.ACCESS_ADMINISTRATORS); hasAccessGroups = predicate(Constants.ROLES_CLAIM_URI, SecurityAttributes.ACCESS_GROUPS); hasAccessIndividuals = predicate(subjectIdentity.getIdentityAttribute(), SecurityAttributes.ACCESS_INDIVIDUALS); }
Source:
private void processNodeImpl(EntityNode node) { if (node != null) { for (EntityNode childNode : (Collection<EntityNode>) node.getChildrenNodes()) { this.processNodeImpl(childNode); } NodeVisitor visitor = this.visitors.get(node.getEntityClass()); if (visitor == null) { throw new IllegalStateException("No visitor configured for nodes of type: " + node.getEntityClass()); } visitor.processNode(this, this.mapper, node); } }

Target:
private void processNodeImpl(EntityNode node) { if (node != null && !node.visited()) { for (EntityNode childNode : (Collection<EntityNode>) node.getChildrenNodes()) { this.processNodeImpl(childNode); } NodeVisitor visitor = this.visitors.get(node.getEntityClass()); if (visitor == null) { throw new IllegalStateException("No visitor configured for nodes of type: " + node.getEntityClass()); } visitor.processNode(this, this.mapper, node); node.markVisited(); } }
Source:
public void run() { Iterable<HTInterval> currentIntervals; try { while (true) { currentIntervals = intervalQueue.take(); for (HTInterval currentInterval : currentIntervals) { if (currentInterval.getAttribute() == -1) { getSHT().closeTree(currentInterval.getEndTime()); return; } getSHT().insertInterval(currentInterval); } } } catch (InterruptedException e) { Activator.getDefault().logError("State History Tree interrupted!", e); } catch (TimeRangeException e) { Activator.getDefault().logError("Error starting the state system", e); } }

Target:
public void run() { try { loop: while (true) { Iterable<HTInterval> currentIntervals = intervalQueue.take(); for (HTInterval currentInterval : currentIntervals) { if (currentInterval.getAttribute() == -1) { getSHT().closeTree(currentInterval.getEndTime()); break loop; } getSHT().insertInterval(currentInterval); } } } catch (InterruptedException e) { Activator.getDefault().logError("State History Tree interrupted!", e); } catch (TimeRangeException e) { Activator.getDefault().logError("Error starting the state system", e); } }
Source:
protected ToolSection findParentSection(Collection<EObject> selection) { for (EObject tool : selection) { if (tool.eContainer() instanceof ToolSection) { return (ToolSection) tool.eContainer(); } } return null; }

Target:
protected ToolSection findParentSection(Collection<EObject> selection) { Option<EObject> toolsection; for (EObject tool : selection) { toolsection = new EObjectQuery(tool).getFirstAncestorOfType(ToolPackage.eINSTANCE.getToolSection()); if (toolsection.get() instanceof ToolSection) { return (ToolSection) toolsection.get(); } } return null; }
Source:
public static String toJsonObject(String contactId, String linkedWithId) { JSONObject jsonObject = new JSONObject(); if (contactId != null && !contactId.isEmpty()) { addJsonStringValue(contactId, jsonObject, CONTACT_ID_TAG); } if (linkedWithId != null && !linkedWithId.isEmpty()) { addJsonStringValue(linkedWithId, jsonObject, LINKED_WITH_TAG); } return jsonObject.toString(); }

Target:
public static String toJsonObject(String contactId, String linkedWithId) { JSONObject jsonObject = new JSONObject(); addJsonStringValue(contactId, jsonObject, CONTACT_ID_TAG); addJsonStringValue(linkedWithId, jsonObject, LINKED_WITH_TAG); return jsonObject.toString(); }
Source:
public boolean replaceAtHead(K key, Chain expected, Chain replacement) { final Lock lock = heads.writeLock(); lock.lock(); try { InternalChain chain = heads.get(key); if (chain == null) { if (expected.iterator().hasNext()) { return false; } else { for (Element element : replacement) { append(key, element.getPayload()); } return true; } } else { try { return chain.replace(expected, replacement); } finally { chain.close(); } } } finally { lock.unlock(); } }

Target:
public boolean replaceAtHead(K key, Chain expected, Chain replacement) { final Lock lock = heads.writeLock(); lock.lock(); try { InternalChain chain = heads.get(key); if (chain == null) { if (expected.iterator().hasNext()) { return false; } else { throw new IllegalArgumentException("Empty expected sequence"); } } else { try { return chain.replace(expected, replacement); } finally { chain.close(); } } } finally { lock.unlock(); } }
Source:
private void addShutdownListeners() { workbench.addWorkbenchListener(new IWorkbenchListener() { @Override public boolean preShutdown(final IWorkbench workbench, final boolean forced) { shutDown(); return true; } @Override public void postShutdown(final IWorkbench workbench) { InitializationManager.getInstance().shutdown(); } }); }

Target:
private void addShutdownListeners() { workbench.addWorkbenchListener(new IWorkbenchListener() { @Override public boolean preShutdown(final IWorkbench workbench, final boolean forced) { IWorkspace workspace = ResourcesPlugin.getWorkspace(); workspace.removeResourceChangeListener(getMarkupModelListener()); WatchDogEventType.END_IDE.process(workbench); InitializationManager.getInstance().getIntervalManager().closeAllIntervals(); transferManager.sendItemsImmediately(); return true; } @Override public void postShutdown(final IWorkbench workbench) { InitializationManager.getInstance().shutdown(); } }); }
Source:
public void clusterInstallationFinished(StackView stackView) { try { transactionService.required(() -> { clusterService.updateClusterStatusByStackId(stackView.getId(), AVAILABLE); stackUpdater.updateStackStatus(stackView.getId(), DetailedStackStatus.AVAILABLE, "Cluster creation finished."); flowMessageService.fireEventAndLog(stackView.getId(), AVAILABLE.name(), CLUSTER_BUILT); }); } catch (TransactionExecutionException e) { throw new TransactionRuntimeExecutionException(e); } }

Target:
public void clusterInstallationFinished(StackView stackView) { try { transactionService.required(() -> { clusterService.updateClusterStatusByStackId(stackView.getId(), AVAILABLE); stackUpdater.updateStackStatus(stackView.getId(), DetailedStackStatus.AVAILABLE, "Salt update finished."); flowMessageService.fireEventAndLog(stackView.getId(), AVAILABLE.name(), CLUSTER_SALT_UPDATE_FINISHED); }); } catch (TransactionExecutionException e) { throw new TransactionRuntimeExecutionException(e); } }
Source:
public static Timer getTimer(FluoConfiguration config, MetricRegistry registry, String name) { Timer timer = registry.getTimers().get(name); if (timer == null) { timer = new Timer(getConfiguredReservoir(config)); registry.register(name, timer); } return timer; }

Target:
public static Timer getTimer(FluoConfiguration config, MetricRegistry registry, String name) { Timer timer = registry.getTimers().get(name); if (timer == null) { return addTimer(config, registry, name); } return timer; }
Source:
public DesiredCapabilities getDefaultCapabilities() { logger.entering(); DesiredCapabilities capability = new DesiredCapabilities(); capability.setCapability("name", Grid.getTestSession().getTestName()); capability.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); if (!Grid.getWebTestSession().getBrowser().contains("firefox") && getLocalConfigProperty(ConfigProperty.SELENIUM_USE_GECKODRIVER).equals("true")) { capability.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, "ignore"); } capability.setCapability(CapabilityType.SUPPORTS_JAVASCRIPT, true); if (!Boolean.parseBoolean(getLocalConfigProperty(ConfigProperty.BROWSER_CAPABILITY_SUPPORT_JAVASCRIPT))) { capability.setCapability(CapabilityType.SUPPORTS_JAVASCRIPT, false); } String browserVersion = getLocalConfigProperty(ConfigProperty.BROWSER_CAPABILITY_VERSION); if (getLocalConfigProperty(ConfigProperty.BROWSER_CAPABILITY_VERSION) != null) { capability.setVersion(browserVersion); } String platform = getLocalConfigProperty(ConfigProperty.BROWSER_CAPABILITY_PLATFORM); if (!platform.equalsIgnoreCase("ANY")) { capability.setCapability(CapabilityType.PLATFORM, platform); } logger.exiting(capability); return capability; }

Target:
public DesiredCapabilities getDefaultCapabilities() { logger.entering(); DesiredCapabilities capability = new DesiredCapabilities(); capability.setCapability("name", Grid.getTestSession().getTestName()); capability.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); if (!Config.getBoolConfigProperty(ConfigProperty.SELENIUM_USE_GECKODRIVER) && Grid.getWebTestSession() != null && !Grid.getWebTestSession().getBrowser().contains("firefox")) { capability.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE); } capability.setCapability(CapabilityType.SUPPORTS_JAVASCRIPT, true); if (!Boolean.parseBoolean(getLocalConfigProperty(ConfigProperty.BROWSER_CAPABILITY_SUPPORT_JAVASCRIPT))) { capability.setCapability(CapabilityType.SUPPORTS_JAVASCRIPT, false); } String browserVersion = getLocalConfigProperty(ConfigProperty.BROWSER_CAPABILITY_VERSION); if (getLocalConfigProperty(ConfigProperty.BROWSER_CAPABILITY_VERSION) != null) { capability.setVersion(browserVersion); } String platform = getLocalConfigProperty(ConfigProperty.BROWSER_CAPABILITY_PLATFORM); if (!platform.equalsIgnoreCase("ANY")) { capability.setCapability(CapabilityType.PLATFORM, platform); } logger.exiting(capability); return capability; }
Source:
public StopGlusterVolumeCommand(GlusterVolumeActionParameters params) { super(params); setGlusterVolumeId(getParameters().getVolumeId()); }

Target:
public StopGlusterVolumeCommand(GlusterVolumeActionParameters params) { super(params); }
Source:
public Image getImage(VirtualGuest guest) { ProductOrder order; if (guest.getStartCpus() < 1) return null; try { order = client.getVirtualGuestClient().getOrderTemplate(guest.getId()); } catch (RuntimeException e) { logger.warn("Cannot getOrderTemplate " + guest.getId(), e); return null; } if (order == null) return null; Iterable<ProductItem> items = Iterables.transform(order.getPrices(), ProductItems.item()); ProductItem os = Iterables.find(items, ProductItemPredicates.categoryCode("os")); if (os.getPrices().isEmpty()) return null; return new ProductItemToImage().apply(os); }

Target:
public Image getImage(VirtualGuest guest) { ProductOrder order = null; if (guest.getStartCpus() < 1) return null; try { order = client.getVirtualGuestClient().getOrderTemplate(guest.getId()); } catch (SoftLayerOrderItemDuplicateException e) { logger.warn(e, "Cannot get order template for virtualGuestId(%s)", guest.getId()); } if (order == null) return null; Iterable<ProductItem> items = Iterables.transform(order.getPrices(), ProductItems.item()); ProductItem os = Iterables.find(items, ProductItemPredicates.categoryCode("os")); if (os.getPrices().isEmpty()) return null; return new ProductItemToImage().apply(os); }
Source:
public AbstractConnectionBuilder<CredentialsConnectionBuilder> credentials(String username, String password) { return new CredentialsConnectionBuilder(username, password, this.serverUrl); }

Target:
public CredentialsConnectionBuilder credentials(String username, String password) { return new CredentialsConnectionBuilder(username, password, serverUrl, configuration); }
Source:
public List<QueueMessage> receiveMessages(String queueUrl, String messageAttributeName) throws QueueException { try { Integer MAX_MESSAGES = 10; ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl); receiveMessageRequest.setMaxNumberOfMessages(MAX_MESSAGES); ReceiveMessageResult receiveMessageResult = sqsClient.receiveMessage(receiveMessageRequest.withMessageAttributeNames(messageAttributeName)); return QueueMessage.of(receiveMessageResult); } catch (AmazonSQSException | UnsupportedOperationException e) { logger.error("Failed to receive messages from SQS queue - {}", e.getMessage()); throw new QueueException(e.getMessage()); } }

Target:
public List<QueueMessage> receiveMessages(String queueUrl, String messageAttributeName) throws QueueException { try { ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl); receiveMessageRequest .withMessageAttributeNames(messageAttributeName) .withMaxNumberOfMessages(10); ReceiveMessageResult receiveMessageResult = sqsClient.receiveMessage(receiveMessageRequest); return QueueMessage.of(receiveMessageResult); } catch (AmazonSQSException | UnsupportedOperationException e) { logger.error("Failed to receive messages from SQS queue - {}", e.getMessage()); throw new QueueException(e.getMessage()); } }
Source:
private String writeArrayFieldComparisonJS(String field,String array,String op) { return String.format("for(var i=0;i<this.%s.length;i++) { if(this.%s %s this.%s[i]) return true;}",array,field,op,array); }

Target:
private String writeArrayFieldComparisonJS(String field,String array,String op) { return String.format("for(var i=0;i<this.%s.length;i++) { if(!(this.%s %s this.%s[i])) return false; } return true;",array,field,op,array); }
Source:
private boolean createProcessHierarchy() { processProcessHierarchy(); Process mainProcess = getMainProcess(); if (!ProcessValidator.isContentValid(mainProcess.getTitle(), processMetadataTab.getProcessDetailsElements(), true)) { return false; } addProperties(mainProcess, processMetadataTab.getProcessDetailsElements(), processDataTab.getDocType(), processDataTab.getTiffHeaderImageDescription()); updateTasks(mainProcess); try { mainProcess.setSortHelperImages(processDataTab.getGuessedImages()); ServiceManager.getProcessService().save(mainProcess); } catch (DataException e) { Helper.setErrorMessage("errorCreating", new Object[] {ObjectType.PROCESS.getTranslationSingular() }, logger, e); return false; } if (!createProcessesLocation()) { return false; } if (ensureNonEmptyTitles()) { try { ServiceManager.getProcessService().save(getMainProcess()); } catch (DataException e) { Helper.setErrorMessage("errorSaving", new Object[] {ObjectType.PROCESS.getTranslationSingular()}, logger, e); return false; } } preserveProcessHierarchyMetadata(); if (Objects.nonNull(titleRecordLinkTab.getTitleRecordProcess())) { getMainProcess().setParent(titleRecordLinkTab.getTitleRecordProcess()); titleRecordLinkTab.getTitleRecordProcess().getChildren().add(getMainProcess()); } try { ServiceManager.getProcessService().save(mainProcess); } catch (DataException e) { Helper.setErrorMessage("errorCreating", new Object[] {ObjectType.PROCESS.getTranslationSingular() }, logger, e); return false; } return true; }

Target:
private void createProcessHierarchy() throws DataException, ProcessGenerationException, IOException { processProcessHierarchy(); ServiceManager.getProcessService().save(getMainProcess()); if (!createProcessesLocation()) { throw new IOException("Unable to create directories for process hierarchy!"); } if (ensureNonEmptyTitles()) { ServiceManager.getProcessService().save(getMainProcess()); } saveProcessHierarchyMetadata(); if (Objects.nonNull(titleRecordLinkTab.getTitleRecordProcess())) { getMainProcess().setParent(titleRecordLinkTab.getTitleRecordProcess()); titleRecordLinkTab.getTitleRecordProcess().getChildren().add(getMainProcess()); } for (int i = 0; i < this.processes.size() - 1; i++) { TempProcess tempProcess = this.processes.get(i); MetadataEditor.addLink(this.processes.get(i + 1).getProcess(), "0", tempProcess.getProcess().getId()); } ServiceManager.getProcessService().save(getMainProcess()); }
Source:
protected Object executeWithSubject() throws Exception { if (!force) { String answer = session.readLine("Are you sure you want to continue?(y/n)", ' ').toLowerCase(); if (!("y".equals(answer) || "yes".equals(answer))) { console.println("Aborting."); return null; } } try (SolrClient solrClient = clientFactory.newClient(COLLECTION_NAME)) { Callable<Boolean> booleanCallable = solrClient::isAvailable; boolean response = Failsafe.with( new RetryPolicy() .retryWhen(false) .withMaxDuration(5, TimeUnit.SECONDS) .withBackoff(25, 1_000, TimeUnit.MILLISECONDS)) .get(booleanCallable); if (!response) { LOGGER.error("Could not contact solr"); printErrorMessage("Could not contact solr, exiting."); return null; } executeWithSolrClient(solrClient); } catch (SolrServerException | IOException e) { LOGGER.info("Error while executing", e); printErrorMessage("Error while executing."); throw e; } printSuccessMessage("Success"); return null; }

Target:
protected Object executeWithSubject() throws Exception { if (!force) { String answer = session.readLine("Are you sure you want to continue? (y/n): ", null).toLowerCase(); if (!("y".equalsIgnoreCase(answer) || "yes".equalsIgnoreCase(answer))) { console.println("Aborting."); return null; } } try (SolrClient solrClient = clientFactory.newClient(COLLECTION_NAME)) { Callable<Boolean> booleanCallable = solrClient::isAvailable; boolean response = Failsafe.with( new RetryPolicy() .retryWhen(false) .withMaxDuration(5, TimeUnit.SECONDS) .withBackoff(25, 1_000, TimeUnit.MILLISECONDS)) .get(booleanCallable); if (!response) { LOGGER.error("Could not contact solr"); printErrorMessage("Could not contact solr, exiting."); return null; } executeWithSolrClient(solrClient); } catch (SolrServerException | IOException e) { LOGGER.info("Error while executing", e); printErrorMessage("Error while executing."); throw e; } printSuccessMessage("Success"); return null; }
Source:
String encode(String segment) { return URL.encodeQueryString(type.replacePathSeparator(segment)); }

Target:
private String encode(String segment) { return URL.encodeQueryString(type.replacePathSeparator(segment)); }
Source:
public FetchCommand setTimeout(int timeout) { this.timeout = timeout; return this; }

Target:
public FetchCommand setTimeout(int timeout) { checkCallable(); this.timeout = timeout; return this; }
Source:
private AuditLogType(int value, AuditLogSeverity severity, int eventFloodRate) { intValue = value; this.eventFloodRate = eventFloodRate; this.severity = severity; }

Target:
private AuditLogType(int value, AuditLogSeverity severity, int eventFloodRate) { intValue = value; this.eventFloodRate = eventFloodRate; this.severity = getDefaultSeverity(severity); }
Source:
PicassoDrawable(Context context, Bitmap bitmap, Drawable placeholder, Picasso.LoadedFrom loadedFrom, boolean noFade, boolean debugging) { super(context.getResources(), bitmap); this.debugging = debugging; this.density = context.getResources().getDisplayMetrics().density; this.loadedFrom = loadedFrom; this.colorMatrix = new ColorMatrix(); boolean fade = loadedFrom != MEMORY && !noFade; if (fade) { this.placeholder = placeholder; animating = true; startTimeMillis = SystemClock.uptimeMillis(); } }

Target:
PicassoDrawable(Context context, Bitmap bitmap, Drawable placeholder, Picasso.LoadedFrom loadedFrom, boolean noFade, boolean debugging) { super(context.getResources(), bitmap); this.debugging = debugging; this.density = context.getResources().getDisplayMetrics().density; this.loadedFrom = loadedFrom; boolean fade = loadedFrom != MEMORY && !noFade; if (fade) { this.placeholder = placeholder; animating = true; startTimeMillis = SystemClock.uptimeMillis(); } }
Source:
private Optional<String> remoteBranch() { try { String remoteRef = runQuietGitCommand(canonical, nativeGitTimeoutInMs, "symbolic-ref -q HEAD"); String remoteBranch = runQuietGitCommand(canonical, nativeGitTimeoutInMs, "for-each-ref --format=%(upstream:short) " + remoteRef); return Optional.ofNullable(remoteBranch.isEmpty() ? null : remoteBranch); } catch (Exception e) { return Optional.empty(); } }

Target:
private Optional<String> remoteBranch() { try { String remoteRef = runQuietGitCommand(canonical, nativeGitTimeoutInMs, "symbolic-ref -q " + evaluateOnCommit); if(remoteRef == null || remoteRef.isEmpty()) { log.debug("Could not find ref for: " + evaluateOnCommit);; return Optional.empty(); } String remoteBranch = runQuietGitCommand(canonical, nativeGitTimeoutInMs, "for-each-ref --format=%(upstream:short) " + remoteRef); return Optional.ofNullable(remoteBranch.isEmpty() ? null : remoteBranch); } catch (Exception e) { return Optional.empty(); } }
Source:
public CompletableFuture<Void> restoreSnapshot( String snapshotName, boolean takeFailSafeSnapshot) { throw new UnsupportedOperationException("restoreSnapshot"); }

Target:
public CompletableFuture<Void> restoreSnapshot( String snapshotName, boolean takeFailSafeSnapshot) { throw new UnsupportedOperationException( "In place table restorations are not supported. Please use cloneSnapshot"); }
Source:
private void createDisabledImage() { if (this.disabledImage != null && !this.disabledImage.isDisposed()) disabledImage = new Image(this.image.getDevice(), this.image, SWT.IMAGE_DISABLE); }

Target:
private void createDisabledImage() { if (this.disabledImage == null || this.disabledImage.isDisposed()) if (this.image != null && !this.image.isDisposed()) disabledImage = new Image(this.image.getDevice(), this.image, SWT.IMAGE_DISABLE); }
Source:
int wtf(String tag, String msg) { if (enableLogging) return Log.wtf(tag, msg); return 0; }

Target:
int wtf(String tag, String msg) { if (enableLogging && logLevel >= Log.ASSERT) return Log.wtf(tag, msg); return 0; }
Source:
protected int run(List<String> nonFlagArgs) throws Exception { if (0 == nonFlagArgs.size()) { getPrintStream().printf("URI must be specified as an argument%n"); return FAILURE; } else if (nonFlagArgs.size() > 1) { getPrintStream().printf("Too many arguments: %s%n", nonFlagArgs.toString()); return FAILURE; } final KijiURI thisURI = KijiURI.newBuilder(nonFlagArgs.get(0)).build(); if (thisURI.getZookeeperQuorum() == null) { getPrintStream().printf("Specify a cluster with argument: kiji://zookeeper-quorum%n"); return FAILURE; } if (thisURI.getInstance() == null) { return listInstances(thisURI); } final Kiji kiji = Kiji.Factory.open(thisURI); try { if (thisURI.getTable() == null) { getPrintStream().println("Listing tables in kiji instance: " + thisURI); return listTables(kiji); } final KijiTable table = kiji.openTable(thisURI.getTable()); try { final KijiTableLayout tableLayout = table.getLayout(); getPrintStream().println("Listing columns in kiji table: " + thisURI); for (FamilyLayout family : tableLayout.getFamilies()) { for (ColumnLayout column : family.getColumns()) { getPrintStream().println(family.getName() + ":" + column.getName()); } } return SUCCESS; } finally { ResourceUtils.releaseOrLog(table); } } finally { ResourceUtils.releaseOrLog(kiji); } }

Target:
protected int run(List<String> nonFlagArgs) throws Exception { int status = SUCCESS; if (nonFlagArgs.isEmpty()) { getPrintStream().printf("URI was unspecified, reverting to default: %s%n", KConstants.DEFAULT_URI); return run(KijiURI.newBuilder(KConstants.DEFAULT_URI).build()); } else { for (String arg : nonFlagArgs) { status = Math.max(status, run(KijiURI.newBuilder(arg).build())); } return status; } }
Source:
public void createBucketErrorInObjStore() throws Exception { ObjectStore spyObjectStore = Mockito.spy(objectStore); BDDMockito.willReturn(Optional.of(false)).given(spyObjectStore).createBucket(Mockito.any(Bucket.class)); Field objStoreField = RepoService.class.getDeclaredField("objectStore"); objStoreField.setAccessible(true); objStoreField.set(repoService, spyObjectStore); try { List<Audit> audit = null; audit = sqlService.listAudit(bucket1.getBucketName(), null, null, null, null); repoService.createBucket(bucket1.getBucketName(), CREATION_DATE_TIME_STRING); Assert.assertTrue(sqlService.listAudit(bucket1.getBucketName(), null, null, null, null).size() == audit.size()); Assert.fail(); } catch (RepoException e) { Assert.assertTrue(e.getType() == RepoException.Type.ServerError); Assert.assertTrue(e.getMessage().startsWith("Unable to create bucket in object store")); } sqlService.getReadOnlyConnection(); Assert.assertTrue(sqlService.getBucket(bucket1.getBucketName()) == null); sqlService.releaseConnection(); Assert.assertFalse(objectStore.bucketExists(bucket1).get()); }

Target:
public void createBucketErrorInObjStore() throws Exception { ObjectStore spyObjectStore = Mockito.spy(objectStore); BDDMockito.willReturn(Optional.of(false)).given(spyObjectStore).createBucket(Mockito.any(Bucket.class)); Field objStoreField = RepoService.class.getDeclaredField("objectStore"); objStoreField.setAccessible(true); objStoreField.set(repoService, spyObjectStore); try { List<Audit> audit = sqlService.listAudit(bucket1.getBucketName(), null, null, null, null); repoService.createBucket(bucket1.getBucketName(), CREATION_DATE_TIME_STRING); Assert.assertTrue(sqlService.listAudit(bucket1.getBucketName(), null, null, null, null).size() == audit.size()); Assert.fail(); } catch (RepoException e) { Assert.assertTrue(e.getType() == RepoException.Type.ServerError); Assert.assertTrue(e.getMessage().startsWith("Unable to create bucket in object store")); } sqlService.getReadOnlyConnection(); Assert.assertTrue(sqlService.getBucket(bucket1.getBucketName()) == null); sqlService.releaseConnection(); Assert.assertFalse(objectStore.bucketExists(bucket1).get()); }
Source:
public Base(final Request req) throws IOException { super(req); final InputStream stream = new RqLengthAware(req).body(); try { this.body = Channels.newChannel(stream); this.buffer = ByteBuffer.allocate( Math.min(8192, stream.available()) ); this.map = this.buildRequests(req); } finally { if (this.body == null) { stream.close(); } else { this.body.close(); } } }

Target:
public Base(final Request req) throws IOException { super(req); final InputStream stream = new RqLengthAware(req).body(); try { this.body = Channels.newChannel(stream); try { this.buffer = ByteBuffer.allocate( Math.min(8192, stream.available()) ); this.map = this.buildRequests(req); } finally { this.body.close(); } } finally { stream.close(); } }
Source:
public void suspendProcessInstanceCmdExecutorTest() { SuspendProcessInstanceCmd suspendProcessInstanceCmd = new SuspendProcessInstanceCmd("x"); assertThat(suspendProcessInstanceCmdExecutor).isNotNull(); assertThat(suspendProcessInstanceCmdExecutor.getHandledType()).isEqualTo(SuspendProcessInstanceCmd.class); suspendProcessInstanceCmdExecutor.execute(suspendProcessInstanceCmd); verify(processEngine).suspend(suspendProcessInstanceCmd); verify(commandResults).send(ArgumentMatchers.<Message<SuspendProcessInstanceResults>>any()); }

Target:
public void suspendProcessInstanceCmdExecutorTest() { SuspendProcessInstanceCmd suspendProcessInstanceCmd = new SuspendProcessInstanceCmd("x"); assertThat(suspendProcessInstanceCmdExecutor.getHandledType()).isEqualTo(SuspendProcessInstanceCmd.class); suspendProcessInstanceCmdExecutor.execute(suspendProcessInstanceCmd); verify(processEngine).suspend(suspendProcessInstanceCmd); verify(commandResults).send(ArgumentMatchers.<Message<SuspendProcessInstanceResults>>any()); }
Source:
public void multiRestriction1() throws Exception { List<Command<?>> commands = new ArrayList<Command<?>>(); commands.add(KieServices.Factory.get().getCommands().newInsert(new Person("multi"))); commands.add(KieServices.Factory.get().getCommands().newFireAllRules()); session.execute(KieServices.Factory.get().getCommands().newBatchExecution(commands, null)); Assertions.assertThat(firedRules.isRuleFired("or1")).isTrue(); }

Target:
public void multiRestriction1() throws Exception { List<Command<?>> commands = new ArrayList<Command<?>>(); commands.add(getCommands().newInsert(new Person("multi"))); commands.add(getCommands().newFireAllRules()); session.execute(getCommands().newBatchExecution(commands, null)); Assertions.assertThat(firedRules.isRuleFired("or1")).isTrue(); }
Source:
Mono<Response<RecognizePiiEntitiesResult>> recognizePiiEntitiesWithResponse(String text, String language, Context context) { Objects.requireNonNull(text, "'text' cannot be null."); return recognizeBatchPiiEntitiesWithResponse( Collections.singletonList(new TextDocumentInput("0", text, language)), null, context) .map(response -> { Iterator<RecognizePiiEntitiesResult> piiEntitiesResultIterator = response.getValue().iterator(); RecognizePiiEntitiesResult piiEntitiesResult = null; if (response.getStatusCode() == 200 && piiEntitiesResultIterator.hasNext()) { piiEntitiesResult = piiEntitiesResultIterator.next(); if (piiEntitiesResult.isError()) { toTextAnalyticsException(piiEntitiesResult.getError(), logger); } } return new SimpleResponse<>(response, piiEntitiesResult); }); }

Target:
Mono<Response<RecognizePiiEntitiesResult>> recognizePiiEntitiesWithResponse(String text, String language, Context context) { Objects.requireNonNull(text, "'text' cannot be null."); return recognizeBatchPiiEntitiesWithResponse( Collections.singletonList(new TextDocumentInput("0", text, language)), null, context) .map(Transforms::processSingleResponseErrorResult); }
Source:
public void updateSubscriptionsForRepartitioning(final EventType eventType, final int partitions) throws NakadiBaseException { final List<Subscription> subscriptions = subscriptionRepository.listSubscriptions( ImmutableSet.of(eventType.getName()), Optional.empty(), 0, 1000); for (final Subscription subscription : subscriptions) { final ZkSubscriptionClient zkClient = subscriptionClientFactory.createClient(subscription, LogPathBuilder.build(subscription.getId(), "repartition")); zkClient.repartitionTopology(eventType.getName(), partitions); zkClient.closeSubscriptionStreams( () -> LOG.info("subscription streams were closed, after repartitioning"), 60000); } }

Target:
public void updateSubscriptionsForRepartitioning(final EventType eventType, final int partitions) throws NakadiBaseException { final List<Subscription> subscriptions = subscriptionRepository.listSubscriptions( ImmutableSet.of(eventType.getName()), Optional.empty(), 0, repartitioningSubscriptionsLimit); for (final Subscription subscription : subscriptions) { final ZkSubscriptionClient zkClient = subscriptionClientFactory.createClient(subscription, LogPathBuilder.build(subscription.getId(), "repartition")); zkClient.repartitionTopology(eventType.getName(), partitions); zkClient.closeSubscriptionStreams( () -> LOG.info("subscription streams were closed, after repartitioning"), TimeUnit.SECONDS.toMillis(nakadiSettings.getMaxCommitTimeout())); } }
Source:
DefaultUriSource(URI uri) { this.uri = Preconditions.notNull(uri, "uri must not be null"); }

Target:
DefaultUriSource(URI uri) { this.uri = Preconditions.notNull(uri, "URI must not be null"); }
Source:
private void contextualizeCompressionSettings() { final RequestConfig.Builder builder = RequestConfig.copy(context.getRequestConfig()); builder.setContentCompressionEnabled(allowGZip || allowDeflate); context.setRequestConfig(builder.build()); }

Target:
private void contextualizeCompressionSettings() { final RequestConfig.Builder builder = RequestConfig.copy(getContext().getRequestConfig()); builder.setContentCompressionEnabled(allowCompression); context.setRequestConfig(builder.build()); }
Source:
private void loadFile(File file) throws ConfigurationException { Configuration config = null; try { config = Configuration.loadFile(file); String name = config.getString(NAME); ExtensionEntry alreadyLoded = loadedEntries.get(name); if (alreadyLoded != null) { throw new ConfigurationException("Could not load the configuration file \"" + file.getAbsolutePath() + "\". The configuration file + \"" + alreadyLoded.file.getAbsolutePath() + "\" already has the name " + name); } ExtensionEntry entry = new ExtensionEntry(file, config.getBoolean(ENABLED, true), name, config.getString(SERVICE), config); loadedEntries.put(entry.name, entry); } catch (IOException exception) { throw new ConfigurationException( "Can't load object configuration file \"" + file.getAbsolutePath() + "\".", exception); } }

Target:
private void loadFile(File file) throws ConfigurationException { Configuration config = null; try { config = Configuration.loadFile(file); ExtensionEntry entry = new ExtensionEntry(file, config); ExtensionEntry alreadyLoded = loadedEntries.get(entry.getName()); if (alreadyLoded != null) { throw new ConfigurationException("Could not load the configuration file \"" + file.getAbsolutePath() + "\". The configuration file + \"" + alreadyLoded.file.getAbsolutePath() + "\" already has the name " + entry.getName()); } loadedEntries.put(entry.name, entry); } catch (IOException exception) { throw new ConfigurationException( "Can't load object configuration file \"" + file.getAbsolutePath() + "\".", exception); } }
Source:
@Test public void checkVersion() throws Exception { HgExe hgexe = new HgExe( this.mercurialInstallation, null, this.launcher, j.jenkins, this.listener, this.vars); String version = hgexe.version(); assertNotNull(version); assertTrue(version.length() >= 3); assertTrue(version.length() <= 8); }

Target:
@Test public void checkVersion() throws Exception { HgExe hgexe = new HgExe( this.mercurialInstallation, null, this.launcher, j.jenkins, this.listener, this.vars); String version = hgexe.version(); assertNotNull(version); assertTrue(new VersionNumber(version).compareTo(new VersionNumber("1.0")) >= 0); }
Source:
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { this.player = args.length < 2 ? getCommandSenderAsPlayer(sender) : getPlayer(server, sender, args[0]); this.uuid = PlayerHelper.getUUIDFromPlayer(player).toString(); this.network = NetworkHelper.getSoulNetwork(uuid); }

Target:
public final void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { if (!getName().equals("get")) { if (args.length == 1 && (args[0].equals("?") || args[0].equals("help"))) { sender.sendMessage(new TextComponentTranslation(getHelp())); return; } this.player = args.length < 2 ? getCommandSenderAsPlayer(sender) : getPlayer(server, sender, args[0]); this.uuid = PlayerHelper.getUUIDFromPlayer(player).toString(); this.network = NetworkHelper.getSoulNetwork(uuid); } subExecute(server, sender, args); }
Source:
private void evaluateMaintenanceHostCommandProgress(List<Guid> childCmdIds, CommandBase<?> rootCommand) { UpgradeHostParameters parameters = (UpgradeHostParameters) rootCommand.getParameters(); VdsDynamic host = DbFacade.getInstance().getVdsDynamicDao().get(parameters.getVdsId()); switch (host.getStatus()) { case PreparingForMaintenance: break; case Maintenance: log.info("Host '{}' is on maintenance mode. Proceeding with Upgrade process.", getHostName(parameters.getVdsId())); invokeHostUpgrade(rootCommand, parameters); break; default: if (isMaintenanceCommandExecuted(childCmdIds)) { log.info("Host '{}' failed to move to maintenance mode. Upgrade process is terminated.", getHostName(parameters.getVdsId())); rootCommand.setCommandStatus(CommandStatus.FAILED); } break; } }

Target:
private void evaluateMaintenanceHostCommandProgress(List<Guid> childCmdIds, CommandBase<?> rootCommand) { UpgradeHostParameters parameters = (UpgradeHostParameters) rootCommand.getParameters(); VdsDynamic host = DbFacade.getInstance().getVdsDynamicDao().get(parameters.getVdsId()); switch (host.getStatus()) { case PreparingForMaintenance: break; case Maintenance: log.error("Host '{}' is on maintenance mode. Proceeding with Upgrade process.", getHostName(parameters.getVdsId())); invokeHostUpgrade(rootCommand, parameters); break; default: if (isMaintenanceCommandExecuted(childCmdIds)) { log.error("Host '{}' failed to move to maintenance mode. Upgrade process is terminated.", getHostName(parameters.getVdsId())); rootCommand.setCommandStatus(CommandStatus.FAILED); } break; } }
Source:
public double getSolarRechargeTime() { if( null == spectralClass || null == subtype ) { return 183; } return StarUtil.getSolarRechargeTime(spectralClass, subtype); }

Target:
public double getSolarRechargeTime() { if( null == spectralClass || null == subtype ) { return 176; } return StarUtil.getSolarRechargeTime(spectralClass, subtype); }