auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean executeWithoutTransaction() { boolean functionReturnValue = false; boolean exceptionOccurred = true; try { logRunningCommand(); if (hasTaskHandlers()) { getCurrentTaskHandler().execute(); } else { executeCommand(); } functionReturnValue = getSucceeded(); exceptionOccurred = false; } catch (VdcBLLException e) { log.error("Command '{}' throw Vdc Bll exception. With error message: {}", getClass().getName(), e.getMessage()); log.debug("Exception", e); processExceptionToClient(new VdcFault(e, e.getVdsError().getCode())); } catch (RuntimeException e) { processExceptionToClient(new VdcFault(e, VdcBllErrors.ENGINE)); log.error("Command '{}' throw exception: {}", getClass().getName(), e.getMessage()); log.error("Exception", e); } finally { if (!exceptionOccurred) { setCommandExecuted(); } if (exceptionOccurred || !getSucceeded()) { clearChildAsyncTasksWithOutVdsmId(); setCommandStatus(CommandStatus.FAILED); setSucceeded(false); compensate(); } else { if (getTaskType() == AsyncTaskType.notSupported && getReturnValue().getVdsmTaskIdList().isEmpty() && getCallBack() == null && commandStatus == CommandStatus.ACTIVE) { setCommandStatus(CommandStatus.SUCCEEDED); } cleanUpCompensationData(); } } return functionReturnValue; }

Target:
private boolean executeWithoutTransaction() { boolean functionReturnValue = false; boolean exceptionOccurred = true; try { logRunningCommand(); if (hasTaskHandlers()) { getCurrentTaskHandler().execute(); } else { executeCommand(); } functionReturnValue = getSucceeded(); exceptionOccurred = false; } catch (VdcBLLException e) { log.error("Command '{}' failed: {}", getClass().getName(), e.getMessage()); log.debug("Exception", e); processExceptionToClient(new VdcFault(e, e.getVdsError().getCode())); } catch (RuntimeException e) { processExceptionToClient(new VdcFault(e, VdcBllErrors.ENGINE)); log.error("Command '{}' failed: {}", getClass().getName(), e.getMessage()); log.error("Exception", e); } finally { if (!exceptionOccurred) { setCommandExecuted(); } if (exceptionOccurred || !getSucceeded()) { clearChildAsyncTasksWithOutVdsmId(); setCommandStatus(CommandStatus.FAILED); setSucceeded(false); compensate(); } else { if (getTaskType() == AsyncTaskType.notSupported && getReturnValue().getVdsmTaskIdList().isEmpty() && getCallBack() == null && commandStatus == CommandStatus.ACTIVE) { setCommandStatus(CommandStatus.SUCCEEDED); } cleanUpCompensationData(); } } return functionReturnValue; }
Source:
private static boolean isOptionalProperty(Class beanClass, PropertyDescriptor beanProp) { Field field = getField(beanClass, beanProp.getName()); return field != null ? field.getAnnotationsByType(Optional.class).length > 0 || beanProp.getReadMethod().getAnnotationsByType(Optional.class).length > 0 : beanProp.getReadMethod().getAnnotationsByType(Optional.class).length > 0; }

Target:
private static boolean isOptionalProperty(Class beanClass, PropertyDescriptor beanProp) { if (beanProp.getReadMethod().getAnnotationsByType(Optional.class).length > 0) { return true; } Field field = getField(beanClass, beanProp.getName()); return field != null && field.getAnnotationsByType(Optional.class).length > 0; }
Source:
private void runAutodefineForOneProvider(Guid providerId, int index) { Network externalNetwork = createExternalNetwork(getNetworkName(index), providerId); AddNetworkStoragePoolParameters storagePoolParameters = new AddNetworkStoragePoolParameters(getNetwork().getStoragePoolId(), externalNetwork); storagePoolParameters.setVnicProfileRequired(false); ActionReturnValue returnValue = runInternalAction(ActionType.AddNetworkOnProvider, storagePoolParameters); if (returnValue.getSucceeded()) { Guid networkId = returnValue.getActionReturnValue(); networkHelper.attachNetworkToClusters(networkId, clustersByProvider.get(providerId)); externalNetwork.setId(networkId); networkHelper.addVnicProfileWithoutFilter(externalNetwork, true); } }

Target:
private void runAutodefineForOneProvider(Guid providerId, int index) { try (EngineLock lock = acquireLockForProvider(providerId)) { Network externalNetwork = createExternalNetwork(calcExternalNetworkName(index), providerId); AddNetworkStoragePoolParameters storagePoolParameters = new AddNetworkStoragePoolParameters(getNetwork().getStoragePoolId(), externalNetwork); storagePoolParameters.setVnicProfileRequired(false); ActionReturnValue returnValue = runInternalAction(ActionType.AddNetworkOnProvider, storagePoolParameters); if (returnValue.getSucceeded()) { Guid externalNetworkId = returnValue.getActionReturnValue(); networkHelper.attachNetworkToClusters(externalNetworkId, clustersByProvider.get(providerId)); externalNetwork.setId(externalNetworkId); networkHelper.addVnicProfileWithoutFilter(externalNetwork, true); } } catch (Exception e) { log.error("Exception occurred while acquiring lock for provider: {}", providerId.toString()); log.debug("Exception", e); } }
Source:
Set<T> doGetNextGroup(Set<T> idle, Set<T> active) { if (active.isEmpty()) { return idle; } else { return ImmutableSet.of(); } }

Target:
Set<T> doGetNextGroup(Set<T> idle, Set<T> active) { return active.isEmpty() ? idle : ImmutableSet.of(); }
Source:
private double calcTimeoutToFence(int vmCount, VdsSpmStatus spmStatus) { int spmIndicator = 0; if (spmStatus == VdsSpmStatus.SPM) { spmIndicator = 1; } return TimeUnit.SECONDS.toMillis( Config.<Integer> GetValue(ConfigValues.TimeoutToResetVdsInSeconds) + (Config.<Integer> GetValue(ConfigValues.DelayResetForSpmInSeconds) * spmIndicator) + (Config.<Integer> GetValue(ConfigValues.DelayResetPerVmInSeconds) * vmCount)); }

Target:
private double calcTimeoutToFence(int vmCount, VdsSpmStatus spmStatus) { int spmIndicator = 0; if (spmStatus == VdsSpmStatus.SPM) { spmIndicator = 1; } return TimeUnit.SECONDS.toMillis((int)( Config.<Integer> GetValue(ConfigValues.TimeoutToResetVdsInSeconds) + (Config.<Double> GetValue(ConfigValues.DelayResetForSpmInSeconds) * spmIndicator) + (Config.<Double> GetValue(ConfigValues.DelayResetPerVmInSeconds) * vmCount))); }
Source:
private Object convertAssociation(Object source, MongoPersistentProperty property) { if (property == null || !property.isAssociation() || source == null || source instanceof DBRef) { return source; } if (source instanceof Iterable) { BasicDBList result = new BasicDBList(); for (Object element : (Iterable<?>) source) { result.add(element instanceof DBRef ? element : converter.toDBRef(element, property)); } return result; } if (property.isMap()) { BasicDBObject result = new BasicDBObject(); DBObject dbObject = (DBObject) source; for (String key : dbObject.keySet()) { Object o = dbObject.get(key); result.put(key, o instanceof DBRef ? o : converter.toDBRef(o, property)); } return result; } return property.isEntity() ? converter.toDBRef(source, property) : source; }

Target:
private Object convertAssociation(Object source, MongoPersistentProperty property) { if (property == null || !property.isAssociation() || source == null || source instanceof DBRef || !property.isEntity()) { return source; } if (source instanceof Iterable) { BasicDBList result = new BasicDBList(); for (Object element : (Iterable<?>) source) { result.add(element instanceof DBRef ? element : converter.toDBRef(element, property)); } return result; } if (property.isMap()) { BasicDBObject result = new BasicDBObject(); DBObject dbObject = (DBObject) source; for (String key : dbObject.keySet()) { Object o = dbObject.get(key); result.put(key, o instanceof DBRef ? o : converter.toDBRef(o, property)); } return result; } return converter.toDBRef(source, property); }
Source:
private void updatePosts(boolean forced) { if (!isAdded()) { return; } if (!NetworkUtils.checkConnection(getActivity())) { mRecyclerView.setRefreshing(false); return; } if (mFirstLoad) { mRecyclerView.setRefreshing(false); mFirstLoad = false; } else { UpdateAction updateAction = forced ? UpdateAction.REQUEST_REFRESH : UpdateAction.REQUEST_NEWER; switch (getPostListType()) { case TAG_FOLLOWED: case TAG_PREVIEW: updatePostsWithTag(getCurrentTag(), updateAction); break; case BLOG_PREVIEW: updatePostsInCurrentBlogOrFeed(updateAction); break; case SEARCH_RESULTS: break; } mRecyclerView.setRefreshing(true); AnalyticsTracker.track(Stat.READER_PULL_TO_REFRESH); } if (getCurrentTag() != null && getCurrentTag().isBookmarked()) { ReaderPostTable.purgeUnbookmarkedPostsWithBookmarkTag(); refreshPosts(); } }

Target:
private void updatePosts(boolean forced) { if (!isAdded()) { return; } if (!NetworkUtils.checkConnection(getActivity())) { mRecyclerView.setRefreshing(false); return; } if (mFirstLoad) { mRecyclerView.setRefreshing(false); mFirstLoad = false; } else { UpdateAction updateAction = forced ? UpdateAction.REQUEST_REFRESH : UpdateAction.REQUEST_NEWER; switch (getPostListType()) { case TAG_FOLLOWED: case TAG_PREVIEW: updatePostsWithTag(getCurrentTag(), updateAction); break; case BLOG_PREVIEW: updatePostsInCurrentBlogOrFeed(updateAction); break; case SEARCH_RESULTS: break; } mRecyclerView.setRefreshing(true); } if (getCurrentTag() != null && getCurrentTag().isBookmarked()) { ReaderPostTable.purgeUnbookmarkedPostsWithBookmarkTag(); refreshPosts(); } }
Source:
public void testPostRequestNestedJSON() { Map<String, Object> jsonData = new HashMap<>(); Map<String, Object> nestedJSONData1 = new HashMap<>(); Map<String, Object> nestedJSONData2= new HashMap<>(); jsonData.put("key1", "value1"); nestedJSONData1.put("key4", "value4"); nestedJSONData1.put("key5", "value5"); nestedJSONData2.put("key6", "value6"); jsonData.put("key2", nestedJSONData1); jsonData.put("key3", nestedJSONData2); try { headers.put("Content-Type", "application/json"); response = WS.request(WS.OP.POST, uri + "/post", headers, jsonData, ContentType.APPLICATION_JSON); } catch (Exception e) { Assert.fail(e.toString()); } System.out.println(response.get("json")); Assert.assertTrue(response != null); Assert.assertEquals("value1", ((JSONObject) response.get("json")).get("key1")); Assert.assertEquals("value4", ((Map) ((Map) response.get("json")).get("key2")).get("key4")); Assert.assertEquals("value5", ((JSONObject) ((JSONObject) response.get("json")).get("key2")).get("key5")); Assert.assertEquals("value6", ((Map) ((JSONObject) response.get("json")).get("key3")).get("key6")); }

Target:
public void testPostRequestNestedJSON() { Map<String, Object> jsonData = new HashMap<>(); Map<String, Object> nestedJSONData1 = new HashMap<>(); Map<String, Object> nestedJSONData2= new HashMap<>(); jsonData.put("key1", "value1"); nestedJSONData1.put("key4", "value4"); nestedJSONData1.put("key5", "value5"); nestedJSONData2.put("key6", "value6"); jsonData.put("key2", nestedJSONData1); jsonData.put("key3", nestedJSONData2); try { headers.put("Content-Type", "application/json"); response = WS.request(WS.OP.POST, uri + "/post", headers, jsonData, ContentType.APPLICATION_JSON); } catch (Exception e) { Assert.fail(e.toString()); } Assert.assertTrue(response != null); Assert.assertEquals("value1", ((JSONObject) response.get("json")).get("key1")); Assert.assertEquals("value4", ((Map) ((Map) response.get("json")).get("key2")).get("key4")); Assert.assertEquals("value5", ((JSONObject) ((JSONObject) response.get("json")).get("key2")).get("key5")); Assert.assertEquals("value6", ((Map) ((JSONObject) response.get("json")).get("key3")).get("key6")); }
Source:
private static void setupLoggerStorage(boolean userStorageAvailable) { boolean loggingEnabled = true; if (instance().currentApp != null) { loggingEnabled = HiddenPreferences.isLoggingEnabled(); } if (userStorageAvailable) { if (loggingEnabled) { Logger.registerLogger(new AndroidLogger(app.getUserStorage(AndroidLogEntry.STORAGE_KEY, AndroidLogEntry.class))); } ForceCloseLogger.registerStorage(app.getUserStorage(ForceCloseLogEntry.STORAGE_KEY, ForceCloseLogEntry.class)); XPathErrorLogger.registerStorage(app.getUserStorage(XPathErrorEntry.STORAGE_KEY, XPathErrorEntry.class)); } else { if (loggingEnabled) { Logger.registerLogger(new AndroidLogger( app.getGlobalStorage(AndroidLogEntry.STORAGE_KEY, AndroidLogEntry.class))); } ForceCloseLogger.registerStorage( app.getGlobalStorage(ForceCloseLogEntry.STORAGE_KEY, ForceCloseLogEntry.class)); } }

Target:
private static void setupLoggerStorage(boolean userStorageAvailable) { boolean loggingEnabled = HiddenPreferences.isLoggingEnabled(); if (userStorageAvailable) { if (loggingEnabled) { Logger.registerLogger(new AndroidLogger(app.getUserStorage(AndroidLogEntry.STORAGE_KEY, AndroidLogEntry.class))); } ForceCloseLogger.registerStorage(app.getUserStorage(ForceCloseLogEntry.STORAGE_KEY, ForceCloseLogEntry.class)); XPathErrorLogger.registerStorage(app.getUserStorage(XPathErrorEntry.STORAGE_KEY, XPathErrorEntry.class)); } else { if (loggingEnabled) { Logger.registerLogger(new AndroidLogger( app.getGlobalStorage(AndroidLogEntry.STORAGE_KEY, AndroidLogEntry.class))); } ForceCloseLogger.registerStorage( app.getGlobalStorage(ForceCloseLogEntry.STORAGE_KEY, ForceCloseLogEntry.class)); } }
Source:
void shutdown() { long startTime = SystemTime.getInstance().milliseconds(); try { logger.info("shutdown started"); clusterParticipant.terminate(); if (scheduler != null) { scheduler.shutdown(); if (!scheduler.awaitTermination(5, TimeUnit.MINUTES)) { logger.error("Could not terminate all tasks after scheduler shutdown"); } } if (statsManager != null) { statsManager.shutdown(); } if (networkServer != null) { networkServer.shutdown(); } if (requestHandlerPool != null) { requestHandlerPool.shutdown(); } if (replicationManager != null) { replicationManager.shutdown(); } if (storageManager != null) { storageManager.shutdown(); } if (connectionPool != null) { connectionPool.shutdown(); } if (reporter != null) { reporter.stop(); } if (notificationSystem != null) { try { notificationSystem.close(); } catch (IOException e) { logger.error("Error while closing notification system.", e); } } clusterMap.close(); logger.info("shutdown completed"); } catch (Exception e) { logger.error("Error while shutting down server", e); } finally { shutdownLatch.countDown(); long processingTime = SystemTime.getInstance().milliseconds() - startTime; metrics.serverShutdownTimeInMs.update(processingTime); logger.info("Server shutdown time in Ms " + processingTime); } }

Target:
public void shutdown() { long startTime = SystemTime.getInstance().milliseconds(); try { logger.info("shutdown started"); if (clusterParticipant != null) { clusterParticipant.close(); } if (scheduler != null) { scheduler.shutdown(); if (!scheduler.awaitTermination(5, TimeUnit.MINUTES)) { logger.error("Could not terminate all tasks after scheduler shutdown"); } } if (statsManager != null) { statsManager.shutdown(); } if (networkServer != null) { networkServer.shutdown(); } if (requestHandlerPool != null) { requestHandlerPool.shutdown(); } if (replicationManager != null) { replicationManager.shutdown(); } if (storageManager != null) { storageManager.shutdown(); } if (connectionPool != null) { connectionPool.shutdown(); } if (reporter != null) { reporter.stop(); } if (notificationSystem != null) { try { notificationSystem.close(); } catch (IOException e) { logger.error("Error while closing notification system.", e); } } if (clusterMap != null) { clusterMap.close(); } logger.info("shutdown completed"); } catch (Exception e) { logger.error("Error while shutting down server", e); } finally { shutdownLatch.countDown(); long processingTime = SystemTime.getInstance().milliseconds() - startTime; metrics.serverShutdownTimeInMs.update(processingTime); logger.info("Server shutdown time in Ms " + processingTime); } }
Source:
public void send(String fromAddress, String toAddress, String subject, String message) throws EmailSendException { Mail mail = new Mail(fromAddress, toAddress, subject, message); LOGGER.info(String.format("Sending message [%s] from [%s] to [%s] with subject [%s].", mail.getMessage(), mail.getFromAddress(), mail.getToAddress(), mail.getSubject())); try { mailSender.send(getMimeMessagePreparator(mail)); log(new EmailRecord(mail.getFromAddress(), mail.getToAddress(), mail.getSubject(), mail.getMessage(), now(), DeliveryStatus.SENT)); } catch (MailException e) { log(new EmailRecord(mail.getFromAddress(), mail.getToAddress(), mail.getSubject(), mail.getMessage(), now(), DeliveryStatus.ERROR)); throw new EmailSendException("{\"Error\":\"Unable to send an email to " + mail.getToAddress() + "\"}", e); } }

Target:
public void send(String fromAddress, String toAddress, String subject, String message) throws EmailSendException { Mail mail = new Mail(fromAddress, toAddress, subject, message); LOGGER.info(String.format("Sending message [%s] from [%s] to [%s] with subject [%s].", mail.getMessage(), mail.getFromAddress(), mail.getToAddress(), mail.getSubject())); try { mailSender.send(getMimeMessagePreparator(mail)); log(new EmailRecord(mail.getFromAddress(), mail.getToAddress(), mail.getSubject(), mail.getMessage(), now(), DeliveryStatus.SENT)); } catch (MailException e) { log(new EmailRecord(mail.getFromAddress(), mail.getToAddress(), mail.getSubject(), mail.getMessage(), now(), DeliveryStatus.ERROR)); throw new EmailSendException("Unable to send an email to " + mail.getToAddress(), e); } }
Source:
public @Nullable String getUnit() { return null; }

Target:
public @Nullable String getUnit() { return fUnit; }
Source:
private void copy(String storeId, File src, File tgt, long capacityInBytes) throws Exception { try (StoreCopier copier = new StoreCopier(storeId, src, tgt, capacityInBytes, fetchSizeInBytes, storeConfig, new MetricRegistry(), storeKeyFactory, diskIOScheduler, Collections.EMPTY_LIST, time)) { copier.copy(new StoreFindTokenFactory(storeKeyFactory).getNewFindToken()); } File[] replicas = {src, tgt}; if (!consistencyChecker.checkConsistency(replicas)) { throw new IllegalStateException("Data in " + src + " and " + tgt + " is not equivalent"); } }

Target:
private void copy(String storeId, File src, File tgt, long capacityInBytes) throws Exception { try (StoreCopier copier = new StoreCopier(storeId, src, tgt, capacityInBytes, fetchSizeInBytes, storeConfig, new MetricRegistry(), storeKeyFactory, diskIOScheduler, transformers, time)) { copier.copy(new StoreFindTokenFactory(storeKeyFactory).getNewFindToken()); } File[] replicas = {src, tgt}; if (!consistencyChecker.checkConsistency(replicas)) { throw new IllegalStateException("Data in " + src + " and " + tgt + " is not equivalent"); } }
Source:
public MicrometerMetricsFactory(MeterRegistry meterRegistry) { this.meterRegistry = meterRegistry; }

Target:
public MicrometerMetricsFactory(MeterRegistry meterRegistry) { Assert.notNull(meterRegistry, "'meterRegistry' cannot be null"); this.meterRegistry = meterRegistry; }
Source:
public InflightMessage completeMessage(Position p) { synchronized (this.linkedMap) { InflightMessage m = this.linkedMap.get(p); assert(m != null); m.isComplete = true; InflightMessage completeUntil = null; if (p.equals(head.position)) { Iterator<InflightMessage> iterator = this.linkedMap.values().iterator(); while ( iterator.hasNext() ) { InflightMessage msg = iterator.next(); if ( !msg.isComplete ) { head = msg; break; } completeUntil = msg; iterator.remove(); } if (isFull && linkedMap.size() < capacity) { isFull = false; this.linkedMap.notify(); } } if (producerAckTimeoutMS > 0 && isFull && head.staleness() > producerAckTimeoutMS && completePercentage() >= completePercentageThreshold) { context.terminate(new IllegalStateException( "Did not receive acknowledgement for the head of the inflight message list for " + producerAckTimeoutMS + " ms")); } return completeUntil; } }

Target:
public InflightMessage completeMessage(Position p) { synchronized (this.linkedMap) { InflightMessage m = this.linkedMap.get(p); assert(m != null); m.isComplete = true; InflightMessage completeUntil = null; Iterator<InflightMessage> iterator = iterator(); while ( iterator.hasNext() ) { InflightMessage msg = iterator.next(); if ( !msg.isComplete ) { break; } completeUntil = msg; iterator.remove(); } if (isFull && linkedMap.size() < capacity) { isFull = false; this.linkedMap.notify(); } if (producerAckTimeoutMS > 0 && isFull) { Iterator<InflightMessage> it = iterator(); if (it.hasNext() && it.next().timeSinceSendMS() > producerAckTimeoutMS && completePercentage() >= completePercentageThreshold) { context.terminate(new IllegalStateException( "Did not receive acknowledgement for the head of the inflight message list for " + producerAckTimeoutMS + " ms")); } } return completeUntil; } }
Source:
protected CommonReporter() { for (final Entry<ProblemLevel, OutputStreamFile> entry : ThreadConfig.get( Reporter.REPORTER_OUTPUT_STREAM_BY_LEVEL).entrySet()) { streamByLevel.put(entry.getKey(), entry.getValue().getPrintStream()); } final Thread reporterThread = new Thread(new RunReporter()); reporterThread.start(); Jack.getSession().getHooks().addHook(new Runnable() { @Override public void run() { toProcess.add(REPORTING_DONE); try { reporterThread.join(); } catch (InterruptedException e) { logger.log(Level.FINE, "Reporter hook was interrupted in " + Thread.currentThread().getName()); Thread.currentThread().interrupt(); } } }); }

Target:
protected CommonReporter() { for (final Entry<ProblemLevel, OutputStreamFile> entry : ThreadConfig.get( Reporter.REPORTER_OUTPUT_STREAM_BY_LEVEL).entrySet()) { streamByLevel.put(entry.getKey(), entry.getValue().getPrintStream()); } final Thread reporterThread = new Thread(new RunReporter(), "Jack reporter"); reporterThread.start(); Jack.getSession().getHooks().addHook(new Runnable() { @Override public void run() { toProcess.add(REPORTING_DONE); try { reporterThread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }); }
Source:
public void push() { if (Session.getCredentials() == null || Session.getCredentials().isDemoCredentials()) { Log.d(TAG, "execute mocked push"); executeMockedPush(); } else if (isLogged()) { Log.d(TAG, "execute push"); executePush(); } }

Target:
public void push() { if (Session.getCredentials() != null && Session.getCredentials().isDemoCredentials()) { Log.d(TAG, "execute mocked push"); executeMockedPush(); } else if (isLogged()) { Log.d(TAG, "execute push"); executePush(); } }
Source:
public boolean validate(IDocument document, int offset, DocumentEvent event) { if (!isOffsetValid(offset)) return fIsValidated= false; if (isSupportingRequiredProposals() && !(((MemberProposalInfo) getProposalInfo()).fProposal).isSuffixProposal()) { fIsValidated= CharOperation.camelCaseMatch(getPrefix(document, offset).toCharArray(), TextProcessor.deprocess(getDisplayString()).toCharArray()) || CharOperation.substringMatch(getPrefix(document, offset), TextProcessor.deprocess(getDisplayString())); } else fIsValidated= isValidPrefix(getPrefix(document, offset)); if (fIsValidated && event != null) { int delta= (event.fText == null ? 0 : event.fText.length()) - event.fLength; final int newLength= Math.max(getReplacementLength() + delta, 0); setReplacementLength(newLength); } return fIsValidated; }

Target:
public boolean validate(IDocument document, int offset, DocumentEvent event) { if (!isOffsetValid(offset)) return fIsValidated= false; fIsValidated= isValidPrefix(getPrefix(document, offset)); if (fIsValidated && event != null) { int delta= (event.fText == null ? 0 : event.fText.length()) - event.fLength; final int newLength= Math.max(getReplacementLength() + delta, 0); setReplacementLength(newLength); } return fIsValidated; }
Source:
public MapOperation() { final ILogger logger = this.logger(); final int forcedEvictionRetryCount = getRetryCount(); evictions = new Eviction[]{ new RecordStoreForcedEviction(forcedEvictionRetryCount, logger, this), new PartitionRecordStoreForcedEviction(forcedEvictionRetryCount, logger, this), new AllEntriesEviction(logger, this), new PartitionAllEntriesEviction(logger, this) }; }

Target:
public MapOperation() { }
Source:
public UnicastMacAddressValidation() { setExpression("^[a-fA-F0-9][02468aAcCeE](:[a-fA-F0-9]{2}){5}$"); setMessage(ConstantsManager.getInstance().getConstants().invalidMacAddressMsg()); }

Target:
public UnicastMacAddressValidation() { setExpression("^[a-fA-F0-9][02468aAcCeE](:[a-fA-F0-9]{2}){5}$"); setMessage(ConstantsManager.getInstance().getConstants().invalidUnicastMacAddressMsg()); }
Source:
private static String getMessageOrNull(AuditLogType logType) { final String key = logType.name(); try { return resourceBundle.getString(key); } catch (Exception e) { log.error("Key '{}' is not translated in '{}'", key, getResourceBundleName()); return null; } }

Target:
protected static String getMessageOrNull(AuditLogType logType) { final String key = logType.name(); try { return resourceBundle.getString(key); } catch (Exception e) { log.error("Key '{}' is not translated in '{}'", key, getResourceBundleName()); return null; } }
Source:
private void closeCart() { $(sidePanelContainer).removeClass(res.style().rightPanel__open()); $(cartIcon).attr("class", font.icons().iconCart()); $(cartButton).removeClass(res.style().active()); $(cartIcon).text(""); shoppingCartOpen = false; }

Target:
private void closeCart() { $(sidePanelContainer).removeClass(res.style().rightPanel__open()); $(cartIcon).text(""); $(cartIcon).addClass(font.icons().iconCart()); $(cartButton).removeClass(res.style().active()); shoppingCartOpen = false; }
Source:
private static void doubleCheck(CheckArguments param) throws CommandFormatException, IOException { if (param.getCtx() == null) { log.warn("Skip double checking by management trusted commands - CommandContext connection not set!"); return; } if (param.isSearchTypeStatus() && UNKNOWN.equals(param.getExpectedState())) { throw new IllegalStateException("Could not verify deployment state " + UNKNOWN + "!"); } log.info("Double checking " + param.getName() + " with management command trusted for " + param.getGoalStr()); if (param.getCtx().isTerminated()) { throw new IllegalStateException("FAILED: Could not double checking " + param.getName() + " with management operations for " + param.getGoalStr() + "!" + "Because connection to cli is closed!"); } if (param.isSearchTypeStatus()) { doubleCheckStatus(param); } else if (param.isSearchTypeExist()) { doubleCheckExist(param); } else if (param.isSearchTypeMissing()) { doubleCheckMissing(param); } else { throw new IllegalStateException("Unknown operation selected! Could not verify check!"); } log.info("Double checking " + param.getName() + " with management operations for " + param.getGoalStr() + " - Success"); }

Target:
private static void doubleCheck(CheckArguments param) throws CommandFormatException, IOException { if (param.getCtx() == null) { log.warn("Skip double checking by management trusted commands - CommandContext connection not set!"); return; } if (param.isSearchTypeStatus() && UNKNOWN.equals(param.getExpectedState())) { throw new IllegalStateException("Could not verify deployment state " + UNKNOWN + "!"); } log.trace("Double checking " + param.getName() + " with management command trusted for " + param.getGoalStr()); if (param.getCtx().isTerminated()) { throw new IllegalStateException("FAILED: Could not double checking " + param.getName() + " with management operations for " + param.getGoalStr() + "!" + "Because connection to cli is closed!"); } if (param.isSearchTypeStatus()) { doubleCheckStatus(param); } else if (param.isSearchTypeExist()) { doubleCheckExist(param); } else if (param.isSearchTypeMissing()) { doubleCheckMissing(param); } else { throw new IllegalStateException("Unknown operation selected! Could not verify check!"); } log.trace("Double checking " + param.getName() + " with management operations for " + param.getGoalStr() + " - Success"); }
Source:
private void validateThenCreateAccount() { clearErrors(); if (!USERNAME_PATTERN.matcher(getText(usernameInput)).matches()) { usernameInput.requestFocus(); usernameInput.setError(getString(R.string.create_account_username_error)); return; } else if (getText(passwordInput).length() < PASSWORD_MIN_LENGTH) { passwordInput.requestFocus(); passwordInput.setError(getString(R.string.create_account_password_error)); return; } else if (!passwordInput.isPasswordVisible() && !getText(passwordInput).equals(getText(passwordRepeatInput))) { passwordRepeatInput.requestFocus(); passwordRepeatInput.setError(getString(R.string.create_account_passwords_mismatch_error)); return; } else if (!TextUtils.isEmpty(getText(emailInput)) && !Patterns.EMAIL_ADDRESS.matcher(getText(emailInput)).matches()) { emailInput.requestFocus(); emailInput.setError(getString(R.string.create_account_email_error)); return; } if (captchaHandler.isActive() && captchaHandler.token() != null) { doCreateAccount(captchaHandler.token()); } else { getCreateAccountInfo(); } }

Target:
private void validateThenCreateAccount() { clearErrors(); ValidateResult result = validateInput(getText(usernameInput), getText(passwordInput), getText(passwordRepeatInput), !passwordInput.isPasswordVisible(), getText(emailInput)); switch (result) { case INVALID_USERNAME: usernameInput.requestFocus(); usernameInput.setError(getString(R.string.create_account_username_error)); return; case INVALID_PASSWORD: passwordInput.requestFocus(); passwordInput.setError(getString(R.string.create_account_password_error)); return; case PASSWORD_MISMATCH: passwordRepeatInput.requestFocus(); passwordRepeatInput.setError(getString(R.string.create_account_passwords_mismatch_error)); return; case INVALID_EMAIL: emailInput.requestFocus(); emailInput.setError(getString(R.string.create_account_email_error)); return; case SUCCESS: default: break; } if (captchaHandler.isActive() && captchaHandler.token() != null) { doCreateAccount(captchaHandler.token()); } else { getCreateAccountInfo(); } }
Source:
public static MoveEntityEvent.Teleport handleDisplaceEntityTeleportEvent(final Entity entityIn, final double posX, final double posY, final double posZ, final float yaw, final float pitch) { World world = ((org.spongepowered.api.entity.Entity) entityIn).getWorld(); final Transform fromTransform = ((org.spongepowered.api.entity.Entity) entityIn).getTransform(); final Transform toTransform = fromTransform.withPosition(new Vector3d(posX, posY, posZ)).withRotation(new Vector3d(pitch, yaw, 0)); return handleDisplaceEntityTeleportEvent(entityIn, fromTransform, toTransform, world, world); }

Target:
public static MoveEntityEvent.Teleport handleDisplaceEntityTeleportEvent(final Entity entityIn, final double posX, final double posY, final double posZ, final float yaw, final float pitch) { final World world = ((org.spongepowered.api.entity.Entity) entityIn).getWorld(); final Transform fromTransform = ((org.spongepowered.api.entity.Entity) entityIn).getTransform(); final Transform toTransform = fromTransform.withPosition(new Vector3d(posX, posY, posZ)).withRotation(new Vector3d(pitch, yaw, 0)); return handleDisplaceEntityTeleportEvent(entityIn, fromTransform, toTransform, world, world); }
Source:
@Override public boolean canHandleRequest(@NonNull Request data) { Uri uri = data.uri; if (uri == null) return false; return SCHEME_CONTENT.equals(uri.getScheme()); }

Target:
@Override public boolean canHandleRequest(@NonNull Request data) { Uri uri = data.uri; return uri != null && SCHEME_CONTENT.equals(uri.getScheme()); }
Source:
public void setSecondaryColor(int color) { if (date != null) { date.setTextColor(color); } if (weatherLayout != null) { weatherLayout.setColor(color); } if (weatherLayout2 != null) { weatherLayout2.setColor(color); } if (divider != null) { divider.setBackgroundColor(color); } if (analog_clock != null) { analog_clock.setSecondaryColor(color); } if (layoutId == LAYOUT_ID_DIGITAL_FLIP) { CustomDigitalFlipClock layout = findViewById(R.id.time_layout); layout.setSecondaryColor(color); } Utility.colorizeView(calendarView, color, PorterDuff.Mode.MULTIPLY); Utility.colorizeView(notificationLayout, color); }

Target:
public void setSecondaryColor(int color) { if (date != null) { date.setTextColor(color); } if (weatherLayout != null) { weatherLayout.setColor(color); } if (weatherLayout2 != null) { weatherLayout2.setColor(color); } if (divider != null) { divider.setBackgroundColor(color); } if (analog_clock != null) { analog_clock.setSecondaryColor(color); } if (layoutId == LAYOUT_ID_DIGITAL_FLIP) { CustomDigitalFlipClock layout = findViewById(R.id.time_layout); layout.setSecondaryColor(color); } if (mediaStyleLayout != null) { View boundView = mediaStyleLayout.getChildAt(0); NotificationMediacontrolBinding mediaControlLayoutBinding = DataBindingUtil.getBinding(boundView); if (mediaControlLayoutBinding != null) { mediaControlLayoutBinding.getModel().setColor(color); mediaControlLayoutBinding.invalidateAll(); } } Utility.colorizeView(calendarView, color, PorterDuff.Mode.MULTIPLY); Utility.colorizeView(notificationLayout, color); }
Source:
public CheckBoxFieldDefinition getDefaultField() { CheckBoxFieldDefinition result = new CheckBoxFieldDefinition(); result.setStandaloneClassName(Boolean.class.getName()); return new CheckBoxFieldDefinition(); }

Target:
public CheckBoxFieldDefinition getDefaultField() { return new CheckBoxFieldDefinition(); }
Source:
public <T> List<ScriptResult<T>> executeScript(Script<T> script, String targetType, Set<String> targets) { final TargetType tType = TargetType.valueOf(targetType); final HashSet<RMNode> selectedRMNodes = new HashSet<>(); switch (tType) { case NODESOURCE_NAME: for (String target : targets) { NodeSource nodeSource = deployedNodeSources.get(target); if (nodeSource != null) { for (RMNode candidateNode : this.allNodes.values()) { if (candidateNode.getNodeSource().equals(nodeSource)) { this.selectCandidateNode(selectedRMNodes, candidateNode); } } } } break; case NODE_URL: for (String target : targets) { RMNode candidateNode = this.allNodes.get(target); if (candidateNode != null) { this.selectCandidateNode(selectedRMNodes, candidateNode); } } break; case HOSTNAME: for (String target : targets) { for (RMNode node : this.allNodes.values()) { if (node.getHostName().equals(target)) { this.selectCandidateNode(selectedRMNodes, node); break; } } } break; default: throw new IllegalArgumentException("Unable to execute script, unknown target type: " + targetType); } return this.selectionManager.executeScript(script, selectedRMNodes, null); }

Target:
public <T> List<ScriptResult<T>> executeScript(Script<T> script, String targetType, Set<String> targets) { final TargetType tType = TargetType.valueOf(targetType); final HashSet<RMNode> selectedRMNodes = new HashSet<>(); switch (tType) { case NODESOURCE_NAME: for (String target : targets) { NodeSource nodeSource = this.deployedNodeSources.get(target); if (nodeSource != null) { for (RMNode candidateNode : this.allNodes.values()) { if (candidateNode.getNodeSource().equals(nodeSource)) { this.selectCandidateNode(selectedRMNodes, candidateNode); } } } } break; case NODE_URL: for (String target : targets) { RMNode candidateNode = this.allNodes.get(target); if (candidateNode != null) { this.selectCandidateNode(selectedRMNodes, candidateNode); } } break; case HOSTNAME: for (String target : targets) { for (RMNode node : this.allNodes.values()) { if (node.getHostName().equals(target)) { this.selectCandidateNode(selectedRMNodes, node); break; } } } break; default: throw new IllegalArgumentException("Unable to execute script, unknown target type: " + targetType); } return this.selectionManager.executeScript(script, selectedRMNodes, null); }
Source:
private String getValueFromPart(Element part) { String value = part.getText(); String type = part.attributeValue("localType"); if (type != null) { value += " (" + type + ")"; } return value; }

Target:
private String getValueFromPart(Element part) { String value = part.getText(); String type = part.attributeValue("localType"); if (Objects.nonNull(type)) { value += " (" + type + ")"; } return value; }
Source:
private Set<String> extractTags(Set<String> input) throws BadRequestException { if (input == null) { return Collections.emptySet(); } else { HashSet<String> result = new HashSet<>(); for (String hashtag : input) { if (hashtag.contains(",")) { throw new BadRequestException("Hashtags may not contain commas"); } if (!hashtag.trim().isEmpty()) { result.add(hashtag.trim()); } } return result; } }

Target:
private Set<String> extractTags(Set<String> input) throws IllegalArgumentException { if (input == null) { return Collections.emptySet(); } else { HashSet<String> result = new HashSet<>(); for (String hashtag : input) { if (hashtag.contains(",")) { throw new IllegalArgumentException("Hashtags may not contain commas"); } if (!hashtag.trim().isEmpty()) { result.add(hashtag.trim()); } } return result; } }
Source:
public void setDependentModule(TmfStateSystemAnalysisModule dependentModule) { fDependentAnalysis = dependentModule; }

Target:
private void setDependentModule(TmfStateSystemAnalysisModule dependentModule) { fDependentModule = dependentModule; }
Source:
private Value getPort( PortInfo portInfo, List< InterfaceDefinition > interfaces ) { Value response = Value.create(); response.getFirstChild( "name" ).setValue( portInfo.id() ); if( portInfo instanceof InputPortInfo ) { InputPortInfo port = (InputPortInfo) portInfo; if( port.location() != null ) { response.getFirstChild( "location" ).setValue( port.location().toString() ); } else { response.getFirstChild( "location" ).setValue( "local" ); } if( port.protocol() != null ) { response.getFirstChild( "protocol" ).setValue( port.protocol() ); } else { response.getFirstChild( "protocol" ).setValue( "" ); } } else if( portInfo instanceof OutputPortInfo ) { OutputPortInfo port = (OutputPortInfo) portInfo; if( port.location() != null ) { response.getFirstChild( "location" ).setValue( port.location().toString() ); } else { response.getFirstChild( "location" ).setValue( "local" ); } if( port.protocol() != null ) { response.getFirstChild( "protocol" ).setValue( port.protocol() ); } else { response.getFirstChild( "protocol" ).setValue( "" ); } } List< InterfaceDefinition > interfaceList = portInfo.getInterfaceList(); for( int intf = 0; intf < interfaceList.size(); intf++ ) { InterfaceDefinition interfaceDefinition = portInfo.getInterfaceList().get( intf ); response.getChildren( "interfaces" ).get( intf ).getFirstChild( "name" ) .setValue( interfaceDefinition.name() ); interfaces = addInterfaceToList( interfaces, interfaceDefinition ); } return response; }

Target:
private Value getPort( PortInfo portInfo, List< InterfaceDefinition > interfaces ) { Value response = Value.create(); response.getFirstChild( "name" ).setValue( portInfo.id() ); if( portInfo instanceof InputPortInfo ) { InputPortInfo port = (InputPortInfo) portInfo; if( port.location() != null ) { response.getFirstChild( "location" ).setValue( port.location().toString() ); } else { response.getFirstChild( "location" ).setValue( "local" ); } if( port.protocolId() != null ) { response.getFirstChild( "protocol" ).setValue( port.protocolId() ); } else { response.getFirstChild( "protocol" ).setValue( "" ); } } else if( portInfo instanceof OutputPortInfo ) { OutputPortInfo port = (OutputPortInfo) portInfo; if( port.location() != null ) { response.getFirstChild( "location" ).setValue( port.location().toString() ); } else { response.getFirstChild( "location" ).setValue( "local" ); } if( port.protocolId() != null ) { response.getFirstChild( "protocol" ).setValue( port.protocolId() ); } else { response.getFirstChild( "protocol" ).setValue( "" ); } } List< InterfaceDefinition > interfaceList = portInfo.getInterfaceList(); for( int intf = 0; intf < interfaceList.size(); intf++ ) { InterfaceDefinition interfaceDefinition = portInfo.getInterfaceList().get( intf ); response.getChildren( "interfaces" ).get( intf ).getFirstChild( "name" ) .setValue( interfaceDefinition.name() ); interfaces = addInterfaceToList( interfaces, interfaceDefinition ); } return response; }
Source:
private void setupStalenessChecker() { if (currentRequestManager == null){ setRetryComplete(); return; } Runnable runnable = new Runnable() { @Override public void run() { synchronized (Batch.this) { if (currentRequestManager == null || currentRequestManager.isEmpty()) { setRetryComplete(); } else if (currentRequestManager.isStale()) { setFailure( io.grpc.Status.UNKNOWN.withDescription("Stale requests.").asRuntimeException()); } else { setupStalenessChecker(); } } } }; if (currentRequestManager.lastRpcSentTimeNanos != null) { long delay = currentRequestManager.calculateTimeUntilStaleNanos(); stalenessFuture = retryExecutorService.schedule(runnable, delay, TimeUnit.NANOSECONDS); } }

Target:
private void setupStalenessChecker() { if (operationsAreComplete()){ setRetryComplete(); return; } Runnable runnable = new Runnable() { @Override public void run() { synchronized (Batch.this) { if (operationsAreComplete() || currentRequestManager.isEmpty()) { setRetryComplete(); } else if (currentRequestManager.isStale()) { setFailure( io.grpc.Status.UNKNOWN.withDescription("Stale requests.").asRuntimeException()); } else { setupStalenessChecker(); } } } }; if (currentRequestManager.lastRpcSentTimeNanos != null) { long delay = currentRequestManager.calculateTimeUntilStaleNanos(); stalenessFuture = retryExecutorService.schedule(runnable, delay, TimeUnit.NANOSECONDS); } }
Source:
Point getScreenDPI () { int dpi = 96; if (GTK.GTK3) { if (GTK.GTK_VERSION > OS.VERSION(3, 22, 0)) { long display = GDK.gdk_display_get_default(); long pMonitor = GDK.gdk_display_get_primary_monitor(display); if (pMonitor == 0) { pMonitor = GDK.gdk_display_get_monitor(display, 0); } int widthMM = GDK.gdk_monitor_get_width_mm(pMonitor); int scaleFactor = GDK.gdk_monitor_get_scale_factor(pMonitor); GdkRectangle monitorGeometry = new GdkRectangle (); GDK.gdk_monitor_get_geometry(pMonitor, monitorGeometry); dpi = Compatibility.round (254 * monitorGeometry.width * scaleFactor, widthMM * 10); } } else { int widthMM = GDK.gdk_screen_width_mm (); int width = GDK.gdk_screen_width (); dpi = Compatibility.round (254 * width, widthMM * 10); } return new Point (dpi, dpi); }

Target:
Point getScreenDPI () { int dpi = 96; if (GTK.GTK3) { if (GTK.GTK_VERSION >= OS.VERSION(3, 22, 0)) { long display = GDK.gdk_display_get_default(); long pMonitor = GDK.gdk_display_get_primary_monitor(display); if (pMonitor == 0) { pMonitor = GDK.gdk_display_get_monitor(display, 0); } int widthMM = GDK.gdk_monitor_get_width_mm(pMonitor); int scaleFactor = GDK.gdk_monitor_get_scale_factor(pMonitor); GdkRectangle monitorGeometry = new GdkRectangle (); GDK.gdk_monitor_get_geometry(pMonitor, monitorGeometry); dpi = Compatibility.round (254 * monitorGeometry.width * scaleFactor, widthMM * 10); } } else { int widthMM = GDK.gdk_screen_width_mm (); int width = GDK.gdk_screen_width (); dpi = Compatibility.round (254 * width, widthMM * 10); } return new Point (dpi, dpi); }
Source:
public ScrollTransform<Integer> createScrollTransform( Integer limit, Supplier<AsyncFuture<SearchResponse>> scroller ){ final OptionalLimit optionalLimit = OptionalLimit.of(limit); return new ScrollTransform<>(async, optionalLimit, scroller, Object::hashCode); }

Target:
public ScrollTransform<SearchHit> createScrollTransform( Integer limit, Supplier<AsyncFuture<SearchResponse>> scroller ){ final OptionalLimit optionalLimit = OptionalLimit.of(limit); return new ScrollTransform<>(async, optionalLimit, scroller, Function.identity()); }
Source:
boolean accept(String name, Set<String> names) { return !names.contains(HaxePresentableUtil.getterName(name)) || !names.contains(HaxePresentableUtil.setterName(name)); }

Target:
boolean accept(String name, Set<String> names) { return !names.contains(HaxePresentableUtil.getterName(name)); }
Source:
private void setLocationByZip(final String zip) { Runnable r = new Runnable() { @Override public void run() { Location l = LocationUtils.getLocationFromZip(getContext(), zip); if (l != null) { mLocationHelper.onLocationChanged(l); setMyLocation(l, true, true); } else { Toast.makeText(getContext(), getString(R.string.main_ziplocation_error), Toast.LENGTH_SHORT).show(); } } }; r.run(); }

Target:
private void setLocationByZip(final String zip) { final Handler h = new Handler(); h.post(new Runnable() { @Override public void run() { Location l = LocationUtils.getLocationFromZip( Application.get().getApplicationContext(), zip); if (l != null && mLocationHelper != null) { mLocationHelper.onLocationChanged(l); setMyLocation(l, true, true); } else { Toast.makeText(Application.get().getApplicationContext(), getString(R.string.main_ziplocation_error), Toast.LENGTH_SHORT).show(); } } }); }
Source:
public boolean isVideoAdBiggerThanImageAd(double videoHeight, double imageHeight) { int percentResult = (int)Math.round(100-(100/(videoHeight/imageHeight))); if (percentResult == PERCENTAGE_DIFFERENCE_BETWEEN_VIDEO_AND_IMAGE_AD) { return true; } PageObjectLogging.log("isVideoAdBiggerThanImageAdOasis", "Expected percentage difference between video height and image height is not equal with " + PERCENTAGE_DIFFERENCE_BETWEEN_VIDEO_AND_IMAGE_AD + " percent", false, driver); return false; }

Target:
public boolean isVideoAdBiggerThanImageAd(double videoHeight, double imageHeight) { int percentResult = (int)Math.round(100-(100/(videoHeight/imageHeight))); return percentResult == PERCENTAGE_DIFFERENCE_BETWEEN_VIDEO_AND_IMAGE_AD; }
Source:
public LabelTypes getLabelTypes() { Set<LabelType> r = Sets.newTreeSet(new Comparator<LabelType>() { @Override public int compare(LabelType o1, LabelType o2) { return o1.getName().compareTo(o2.getName()); } }); String destBranch = getChange().getDest().get(); for (LabelType l : getProjectControl().getLabelTypes().getLabelTypes()) { List<String> refs = l.getBranches(); if (refs == null) { r.add(l); } else { for (String b : refs) { if (RefConfigSection.isValid(b) && match(destBranch, b)) { r.add(l); break; } } } } return new LabelTypes(Lists.newArrayList(r)); }

Target:
public LabelTypes getLabelTypes() { Set<LabelType> r = Sets.newTreeSet(Ordering.natural().onResultOf( new Function<LabelType, String>() { @Override public String apply(LabelType in) { return in.getName(); } })); String destBranch = getChange().getDest().get(); for (LabelType l : getProjectControl().getLabelTypes().getLabelTypes()) { List<String> refs = l.getRefPatterns(); if (refs == null) { r.add(l); } else { for (String b : refs) { if (RefConfigSection.isValid(b) && match(destBranch, b)) { r.add(l); break; } } } } return new LabelTypes(Lists.newArrayList(r)); }
Source:
List<String> getFilteredKeys(BibEntry entry, StandardField operator) { Optional<String> citingS = entry.getField(operator); if (citingS.isEmpty()) { LOGGER.info(entry.getField(StandardField.TITLE).orElse("no title") + ": " + operator.getName() + " is empty!"); return new ArrayList<>(); } ArrayList<String> keys = new ArrayList<>(Arrays.asList(citingS.get().split(","))); filterNonExisting(keys); entry.setField(operator, String.join(",", keys)); LOGGER.info(entry.getField(StandardField.TITLE).orElse("no title") + ": " + operator.getName() + ": " + String.join(",", keys)); return keys; }

Target:
List<String> getFilteredKeys(BibEntry entry, StandardField operator) { Optional<String> citingS = entry.getField(operator); if (citingS.isEmpty()) { LOGGER.debug("{}: is empty!", entry.getField(StandardField.TITLE).orElse("no title"), operator.getName()); return new ArrayList<>(); } ArrayList<String> keys = new ArrayList<>(Arrays.asList(citingS.get().split(","))); filterNonExisting(keys); entry.setField(operator, String.join(",", keys)); LOGGER.debug("{}: {}: {}", entry.getField(StandardField.TITLE).orElse("no title"), operator.getName(), String.join(",", keys)); return keys; }
Source:
public void testSwaggerDocs() throws Exception { Response response = invokeGet(getContextRoot(3)+"docs/"); if (response.getStatus()!=200) { response = invokeGet(getContextRoot(1)+"api-docs?url="+getContextRoot(1)+"swagger.json"); } assertResponse(response); assertThat(Jsoup.parse(responseStr).title()).isIn("Execution Server Documentation", "Swagger UI"); }

Target:
public void testSwaggerDocs() throws Exception { Response response = invokeGet(getContextRoot(3)+"docs/"); if (response.getStatus()!=200) { response = invokeGet(getContextRoot(1)+"api-docs?url="+getContextRoot(1)+"swagger.json"); } assertResponse(response); responseStr = response.readEntity(String.class); response.close(); assertThat(Jsoup.parse(responseStr).title()).isIn("Execution Server Documentation", "Swagger UI"); }