auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public FileStatus getFileStatus(Path path) throws IOException { String key = keyFromPath(path); ObjectMetadata metadata = getS3ObjectMetadata(key); if (path.getName().isEmpty()) { if (metadata != null) { return new FileStatus(0, true, 1, 0, 0, qualifiedPath(path)); } throw new FileNotFoundException("File does not exist: " + path); } if (metadata == null) { Iterator<LocatedFileStatus> iterator = listPrefix(path); if (iterator.hasNext() || getS3ObjectMetadata(key + PATH_SEPARATOR) != null) { return new FileStatus(0, true, 1, 0, 0, qualifiedPath(path)); } throw new FileNotFoundException("File does not exist: " + path); } return new FileStatus( getObjectSize(path, metadata), false, 1, BLOCK_SIZE.toBytes(), lastModifiedTime(metadata), qualifiedPath(path)); }

Target:
public FileStatus getFileStatus(Path path) throws IOException { if (path.getName().isEmpty()) { if (getS3ObjectMetadata(path) != null) { return new FileStatus(0, true, 1, 0, 0, qualifiedPath(path)); } throw new FileNotFoundException("File does not exist: " + path); } ObjectMetadata metadata = getS3ObjectMetadata(path); if (metadata == null) { if (exists(path)) { return new FileStatus(0, true, 1, 0, 0, qualifiedPath(path)); } else { throw new FileNotFoundException("File does not exist: " + path); } } return new FileStatus( getObjectSize(path, metadata), false, 1, BLOCK_SIZE.toBytes(), lastModifiedTime(metadata), qualifiedPath(path)); }
Source:
public void run() { Paging paging = new Paging(1, 200); List<Status> statuses = null; boolean KeepGoing = true; boolean hadFailure = false; do { int keepTrying = 0; while (keepTrying < 5) { try { statuses = client.getUserTimeline(id, paging); for (Status tStat : statuses) { String json = TwitterObjectFactory.getRawJSON(tStat); try { provider.lock.readLock().lock(); ComponentUtils.offerUntilSuccess(new StreamsDatum(json), provider.providerQueue); } finally { provider.lock.readLock().unlock(); } } paging.setPage(paging.getPage() + 1); keepTrying = 10; } catch(TwitterException twitterException) { keepTrying += TwitterErrorHandler.handleTwitterError(client, twitterException); } catch(Exception e) { keepTrying += TwitterErrorHandler.handleTwitterError(client, e); } } } while (provider.shouldContinuePulling(statuses)); LOGGER.info(id + " Thread Finished"); }

Target:
public void run() { Paging paging = new Paging(1, 200); List<Status> statuses = null; do { int keepTrying = 0; while (keepTrying < 5) { try { this.client = provider.getTwitterClient(); statuses = client.getUserTimeline(id, paging); for (Status tStat : statuses) { String json = TwitterObjectFactory.getRawJSON(tStat); provider.addDatum(new StreamsDatum(json)); } paging.setPage(paging.getPage() + 1); keepTrying = 10; } catch(TwitterException twitterException) { keepTrying += TwitterErrorHandler.handleTwitterError(client, twitterException); } catch(Exception e) { keepTrying += TwitterErrorHandler.handleTwitterError(client, e); } } } while (provider.shouldContinuePulling(statuses)); LOGGER.info(id + " Thread Finished"); }
Source:
public StringBuffer format(@Nullable Object obj, @Nullable StringBuffer toAppendTo, @Nullable FieldPosition pos) { if (!(obj instanceof Number) || toAppendTo == null) { throw new IllegalArgumentException("Cannot format given Object as a Number: " + obj); } Number number = (Number) obj; if (fRangeMap == null) { StringBuffer buffer = super.format(number, toAppendTo, pos); return (buffer == null ? new StringBuffer() : buffer); } ChartRange internalRange = checkNotNull(fRangeMap).getInternal(); ChartRange externalRange = checkNotNull(fRangeMap).getExternal(); if (internalRange.isDeltaNull() || externalRange.isDeltaNull()) { StringBuffer buffer = super.format(externalRange.getMinimum().doubleValue(), toAppendTo, pos); return (buffer == null ? new StringBuffer() : buffer); } Double externalValue = checkNotNull(fRangeMap).getExternalValue(number).doubleValue(); StringBuffer buffer = super.format(externalValue, toAppendTo, pos); return (buffer == null ? new StringBuffer() : buffer); }

Target:
public StringBuffer format(@Nullable Object obj, @Nullable StringBuffer toAppendTo, @Nullable FieldPosition pos) { if (!(obj instanceof Number) || toAppendTo == null) { throw new IllegalArgumentException("Cannot format given Object as a Number: " + obj); } Number number = (Number) obj; ChartRangeMap rangeMap = fRangeMap; if (rangeMap == null) { StringBuffer buffer = super.format(number, toAppendTo, pos); return (buffer == null ? new StringBuffer() : buffer); } ChartRange internalRange = rangeMap.getInternal(); ChartRange externalRange = rangeMap.getExternal(); if (internalRange.isDeltaNull() || externalRange.isDeltaNull()) { StringBuffer buffer = super.format(externalRange.getMinimum().doubleValue(), toAppendTo, pos); return (buffer == null ? new StringBuffer() : buffer); } Double externalValue = checkNotNull(fRangeMap).getExternalValue(number).doubleValue(); StringBuffer buffer = super.format(externalValue, toAppendTo, pos); return (buffer == null ? new StringBuffer() : buffer); }
Source:
protected void executeCommand() { setPrestartedToZero(); stopVms(); setCommandShouldBeLogged(false); setSucceeded(true); }

Target:
protected void executeCommand() { setPoolBeingDestroyed(); setPrestartedToZero(); setSucceeded(stopVms() && removeVmsInPool() && removeVmPool()); }
Source:
public Factory saveFactory(Factory factory) throws ApiException { final User user = EnvironmentContext.getCurrent().getUser(); if (user == null || user.getName() == null || user.getId() == null) { throw new ServerException("Unable to identify user from context"); } if (factory == null) { throw new BadRequestException("Not null factory required"); } processDefaults(factory); createValidator.validateOnCreate(factory); final String factoryId = factoryStore.saveFactory(factory, null); try { return factory.withLinks(linksHelper.createLinks(factoryStore.getFactory(factoryId), uriInfo)); } catch (UnsupportedEncodingException e) { throw new ServerException(e.getLocalizedMessage(), e); } }

Target:
public Factory saveFactory(Factory factory) throws ApiException { if (factory == null) { throw new BadRequestException("Not null factory required"); } processDefaults(factory); createValidator.validateOnCreate(factory); final String factoryId = factoryStore.saveFactory(factory, null); try { return factory.withLinks(linksHelper.createLinks(factoryStore.getFactory(factoryId), uriInfo)); } catch (UnsupportedEncodingException e) { throw new ServerException(e.getLocalizedMessage(), e); } }
Source:
public void loadKnownHosts(){ Preferences preferences=JSchCorePlugin.getPlugin().getPluginPreferences(); String ssh_home=preferences.getString(IConstants.KEY_SSH2HOME); if(ssh_home.length()==0) ssh_home=PreferenceInitializer.SSH_HOME_DEFAULT; java.io.File file=new java.io.File(ssh_home, "known_hosts"); if (file.exists()) { try{ getJSch().setKnownHosts(file.getPath()); } catch(JSchException e){ JSchCorePlugin.log(IStatus.ERROR, NLS.bind( "An error occurred while loading the know hosts file {0}", file .getAbsolutePath()), e); } } needToLoadKnownHosts=false; }

Target:
public void loadKnownHosts(){ Preferences preferences=JSchCorePlugin.getPlugin().getPluginPreferences(); String ssh_home=preferences.getString(IConstants.KEY_SSH2HOME); if(ssh_home.length()==0) ssh_home=PreferenceInitializer.SSH_HOME_DEFAULT; java.io.File file=new java.io.File(ssh_home, "known_hosts"); try{ getJSch().setKnownHosts(file.getPath()); } catch(JSchException e){ if (!(e.getCause() instanceof FileNotFoundException)) { JSchCorePlugin.log(IStatus.ERROR, NLS.bind( "An error occurred while loading the know hosts file {0}", file .getAbsolutePath()), e); } } needToLoadKnownHosts=false; }
Source:
public void setSelection(int index) { if (index >= mOriginalText.length()) { index = mOriginalText.length() - 1; } int spacesUpToIndex; if (index == 0) { spacesUpToIndex = 0; } else { spacesUpToIndex = index - 1; } try { super.setSelection(index + spacesUpToIndex); } catch (IndexOutOfBoundsException e) { throw new IndexOutOfBoundsException(e.getMessage() + ", requestedIndex=" + index + ", spacesUpToIndex=" + spacesUpToIndex + ", originalText=" + mOriginalText); } }

Target:
public void setSelection(int index) { int newIndex = (index * 2) - 1; newIndex = Math.max(newIndex, 0); newIndex = Math.min(newIndex, (mOriginalText.length() * 2) - 1); try { super.setSelection(newIndex); } catch (IndexOutOfBoundsException e) { throw new IndexOutOfBoundsException(e.getMessage() + ", requestedIndex=" + index + ", newIndex= " + newIndex + ", originalText=" + mOriginalText); } }
Source:
private void newPost() { if (!isAdded()) { return; } ActivityLauncher.addNewPostOrPageForResult(getActivity(), mSite, false, false); }

Target:
private void newPost() { if (!isAdded()) { return; } ActivityLauncher.addNewPostForResult(getActivity(), mSite, false); }
Source:
public RangerCloudIdentitySyncStatus getRangerCloudIdentitySyncStatus(String envCrn, long commandId) { Optional<SdxCluster> sdxCluster = getSdxCluster(envCrn); if (sdxCluster.isEmpty()) { return sucessfulCloudIdSyncStatus("No datlakes associated with the environment."); } try { ApiCommand apiCommand = clouderaManagerRangerUtil.getApiCommand(sdxCluster.get().getStackCrn(), commandId); return toRangerCloudIdentitySyncStatus(apiCommand); } catch (ApiException e) { LOGGER.error("Encountered cloudera manager api exception", e); return failedRangerCloudIdentitySyncStatus("Encountered cloudera manager api exception"); } }

Target:
public RangerCloudIdentitySyncStatus getRangerCloudIdentitySyncStatus(String envCrn, long commandId) { Optional<SdxCluster> sdxCluster = getSdxCluster(envCrn); if (sdxCluster.isEmpty()) { return newSyncStatus(RangerCloudIdentitySyncState.NOT_APPLICABLE, "No datalakes associated with the environment."); } try { ApiCommand apiCommand = clouderaManagerRangerUtil.getApiCommand(sdxCluster.get().getStackCrn(), commandId); return toRangerCloudIdentitySyncStatus(apiCommand); } catch (ApiException e) { LOGGER.error("Encountered cloudera manager api exception", e); return newSyncStatus(RangerCloudIdentitySyncState.FAILED, "Encountered cloudera manager api exception"); } }
Source:
public UsageVO(Long zoneId, Long accountId, Long domainId, String description, String usageDisplay, int usageType, Double rawUsage, Long vmId, String vmName, Long offeringId, Long templateId, Long usageId, Long size, Long virtualSize, Date startDate, Date endDate) { this.zoneId = zoneId; this.accountId = accountId; this.domainId = domainId; this.description = description; this.usageDisplay = usageDisplay; this.usageType = usageType; this.rawUsage = rawUsage; this.vmInstanceId = vmId; this.vmName = vmName; this.offeringId = offeringId; this.templateId = templateId; this.usageId = usageId; this.size = size; this.virtualSize = virtualSize; this.startDate = startDate; this.endDate = endDate; }

Target:
public UsageVO(Long zoneId, Long accountId, Long domainId, String description, String usageDisplay, int usageType, Double rawUsage, Long vmId, String vmName, Long offeringId, Long templateId, Long usageId, Long size, Long virtualSize, Date startDate, Date endDate) { this.zoneId = zoneId; this.accountId = accountId; this.domainId = domainId; this.description = description; this.usageDisplay = usageDisplay; this.usageType = usageType; this.rawUsage = rawUsage; this.vmInstanceId = vmId; this.vmName = vmName; this.offeringId = offeringId; this.templateId = templateId; this.usageId = usageId; this.size = size; this.virtualSize = virtualSize; this.startDate = startDate == null ? null : new Date(startDate.getTime()); this.endDate = endDate == null ? null : new Date(endDate.getTime()); }
Source:
public void testReplace() throws Exception{ boolean removedValue = store.replace(file1, file1Id, "4567"); assertFalse(removedValue); String fileID = store.putIfAbsent(file1, file1Id); assertNull(fileID); removedValue = store.replace(file1, file1Id, "4567"); assertTrue(removedValue); }

Target:
public void testReplace() throws Exception { boolean removedValue = store.replace(file1, file1Id, "4567"); assertFalse(removedValue); String fileID = store.get(file1); assertNull(fileID); fileID = store.putIfAbsent(file1, file1Id); assertNull(fileID); removedValue = store.replace(file1, file1Id, "4567"); assertTrue(removedValue); fileID = store.get(file1); assertNotNull(fileID); assertEquals("4567", fileID); }
Source:
public CPPASTLiteralExpression copy(CopyStyle style) { CPPASTLiteralExpression copy = new CPPASTLiteralExpression(fKind, getValue().clone(), fNumericCompilerSuffixes); copy.fStringLiteralSize = fStringLiteralSize; copy.fEvaluation = fEvaluation; copy.fUserDefinedLiteralOperator = fUserDefinedLiteralOperator; copy.fImplicitNames = fImplicitNames; return copy(copy, style); }

Target:
public CPPASTLiteralExpression copy(CopyStyle style) { CPPASTLiteralExpression copy = new CPPASTLiteralExpression(fKind, getValue(), fNumericCompilerSuffixes); copy.fStringLiteralSize = fStringLiteralSize; copy.fEvaluation = fEvaluation; copy.fUserDefinedLiteralOperator = fUserDefinedLiteralOperator; copy.fImplicitNames = fImplicitNames; return copy(copy, style); }
Source:
public void testSomethingByArrayWithNonEmptyArray() { final SomethingByVarargs s = handle.attach(SomethingByVarargs.class); final List<Something> out = s.get( new SomethingKey(1, "1"), new SomethingKey(2, "2")); assertThat(out).hasSize(2); }

Target:
public void testSomethingByArrayWithNonEmptyArray() { final SomethingByVarargs s = handle.attach(SomethingByVarargs.class); final List<Something> out = s.get( new SomethingKey(1, "1"), new SomethingKey(2, "2")); assertThat(out).hasSameElementsAs(expectedSomethings); }
Source:
private void handleSingleRpcCommand(SingleRpcCommand command, Reply reply, DeliverOrder order) { if (executeOnExecutorService(order, command)) { int commandTopologyId = extractCommandTopologyId(command); BlockingRunnable runnable = createReadyActionRunnable(command, reply, commandTopologyId, order.preserveOrder(), null); remoteCommandsExecutor.execute(runnable); } else { createDefaultRunnable(command, reply, extractCommandTopologyId(command), TopologyMode.WAIT_TX_DATA, order.preserveOrder()).run(); } }

Target:
private void handleSingleRpcCommand(SingleRpcCommand command, Reply reply, DeliverOrder order) { if (executeOnExecutorService(order, command)) { int commandTopologyId = extractCommandTopologyId(command); BlockingRunnable runnable = createDefaultRunnable(command, reply, commandTopologyId, TopologyMode.READY_TX_DATA, order.preserveOrder()); remoteCommandsExecutor.execute(runnable); } else { createDefaultRunnable(command, reply, extractCommandTopologyId(command), TopologyMode.WAIT_TX_DATA, order.preserveOrder()).run(); } }
Source:
public Capabilities getCapabilities(WebDriverConfiguration configuration, boolean performValidations) { DesiredCapabilities capabilities = new DesiredCapabilities(configuration.getCapabilities()); String binary = (String) capabilities.getCapability("chrome.binary"); new ChromeDriverBinaryHandler(capabilities).checkAndSetBinary(performValidations); ChromeOptions chromeOptions = new ChromeOptions(); if (capabilities.getBrowserName().equals("chromeHeadless")) { chromeOptions.addArguments("--headless"); } CapabilitiesOptionsMapper.mapCapabilities(chromeOptions, capabilities, BROWSER_CAPABILITIES); if (Validate.nonEmpty(binary)) { if (performValidations) { Validate.isExecutable(binary, "Chrome binary must point to an executable file, " + binary); } chromeOptions.setBinary(binary); } capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions); String printChromeOptions = (String) capabilities.getCapability(CHROME_PRINT_OPTIONS); if (Validate.nonEmpty(printChromeOptions) && Boolean.valueOf(printChromeOptions.trim())) { try { StringBuffer chromeOptionsLog = new StringBuffer("\n"); chromeOptionsLog.append("======== Chrome options =========").append("\n"); chromeOptionsLog.append(chromeOptions.toJson().toString()).append("\n"); chromeOptionsLog.append("===== End of Chrome options ====="); log.info(chromeOptionsLog.toString()); } catch (IOException e) { log.warning("Something bad happened during printing chrome options: "); log.warning(e.getMessage()); } } return capabilities; }

Target:
public Capabilities getCapabilities(WebDriverConfiguration configuration, boolean performValidations) { DesiredCapabilities capabilities = new DesiredCapabilities(configuration.getCapabilities()); String binary = (String) capabilities.getCapability("chrome.binary"); new ChromeDriverBinaryHandler(capabilities).checkAndSetBinary(performValidations); if (Validate.nonEmpty(binary)) { if (performValidations) { Validate.isExecutable(binary, "Chrome binary must point to an executable file, " + binary); } } setChromeOptions(configuration, capabilities); return capabilities; }
Source:
public synchronized String createNonce(Repository repo, long timestamp) throws IllegalStateException { String path; if (repo instanceof DfsRepository) path = ((DfsRepository) repo).getDescription().getRepositoryName(); else if (repo.getDirectory() != null) path = repo.getDirectory().getPath(); else throw new IllegalStateException(); String input = path + ":" + String.valueOf(timestamp); byte[] rawHmac; try { rawHmac = mac.doFinal(input.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { throw new IllegalStateException(e); } return String.format("%d-%s", Long.valueOf(timestamp), toHex(rawHmac)); }

Target:
public synchronized String createNonce(Repository repo, long timestamp) throws IllegalStateException { String path; if (repo instanceof DfsRepository) path = ((DfsRepository) repo).getDescription().getRepositoryName(); else if (repo.getDirectory() != null) path = repo.getDirectory().getPath(); else throw new IllegalStateException(); String input = path + ":" + String.valueOf(timestamp); byte[] rawHmac; try { rawHmac = mac.doFinal(input.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { throw new IllegalStateException(e); } return Long.toString(timestamp) + "-" + toHex(rawHmac); }
Source:
static public Class<? extends Type> toTypeClass(String dptId) { Class<? extends Type> ohClass = dptTypeMap.get(dptId); if (ohClass == null) { int mainNumber = getMainNumber(dptId); if (mainNumber == -1) { logger.debug("toType: couldn't convert dptID toTypeClass: {}.", dptId); return null; } ohClass = dptMainTypeMap.get(mainNumber); } return ohClass; }

Target:
public Class<? extends Type> toTypeClass(String dptId) { Class<? extends Type> ohClass = dptTypeMap.get(dptId); if (ohClass == null) { int mainNumber = getMainNumber(dptId); if (mainNumber == -1) { logger.debug("Couldn't convert KNX datapoint type id into openHAB type class for dptId: {}.", dptId); return null; } ohClass = dptMainTypeMap.get(mainNumber); } return ohClass; }
Source:
public void onError(Throwable t) { String errorFormat = getString(R.string.error_format); String PREFIX = "OldJobError"; if(t instanceof ParseException) { ParseException e = (ParseException) t; if (e.getCode() == ParseException.OBJECT_NOT_FOUND) { Log.e(PREFIX, "No results found for query...ignoring."); return; } } Log.e(PREFIX, getLocalClassName(), t); showMessage(String.format(errorFormat, t.getLocalizedMessage())); if (t instanceof IllegalStateException) { refreshState(); } }

Target:
public void onError(Throwable t) { String errorFormat = getString(R.string.error_format); String PREFIX = "OddJobError"; if(t instanceof ParseException) { ParseException e = (ParseException) t; if (e.getCode() == ParseException.OBJECT_NOT_FOUND) { Log.e(PREFIX, "No results found for query...ignoring."); return; } } Log.e(PREFIX, getLocalClassName(), t); showMessage(String.format(errorFormat, t.getLocalizedMessage())); if (t instanceof IllegalStateException) { refreshState(); } }
Source:
public HomeModel get(ProfilePreferences profilePreferences) { this.profilePreferences = profilePreferences; final HomeModel model = new HomeModel(translationService.format(Constants.Heading), translationService.format(Constants.SubHeading), "images/product_home_bg.png"); if(profilePreferences.isRulesAndPlanner()) { addProfileRulesPlannerShortcuts(model); } else if(profilePreferences.isFull()) { addProfileFullShortcuts(model); } return model; }

Target:
public HomeModel get(ProfilePreferences profilePreferences) { this.profilePreferences = profilePreferences; HomeModel model = new HomeModel(translationService.format(Constants.Heading), translationService.format(Constants.SubHeading), "images/product_home_bg.png"); switch (profilePreferences.getProfile()) { case FULL: addProfileFullShortcuts(model); break; case PLANNER_AND_RULES: model = new HomeModel(translationService.format(Constants.HeadingDecisionManager), translationService.format(Constants.SubHeadingDecisionManager), "images/product_home_bg.png"); addProfileRulesPlannerShortcuts(model); break; } return model; }
Source:
NatsMessage(String subject, String replyTo, byte[] data, boolean utf8mode) { this.subject = subject; this.replyTo = replyTo; this.data = data; if (utf8mode) { StringBuilder protocolStringBuilder = new StringBuilder((2 * subject.length()) + 20); protocolStringBuilder.append(PUB_SPACE); protocolStringBuilder.append(subject); protocolStringBuilder.append(SPACE); if (replyTo != null) { protocolStringBuilder.append(replyTo); protocolStringBuilder.append(SPACE); } protocolStringBuilder.append(String.valueOf(data.length)); this.protocolBytes = protocolStringBuilder.toString().getBytes(StandardCharsets.UTF_8); } else { byte[] lengthBytes = new byte[12]; int idx = lengthBytes.length; int size = (data != null) ? data.length : 0; if (size > 0) { for (int i = size; i > 0; i /= 10) { idx--; lengthBytes[idx] = digits[i % 10]; } } else { idx--; lengthBytes[idx] = digits[0]; } int len = 4 + subject.length() + 1 + (lengthBytes.length - idx); if (replyTo != null) { len += replyTo.length() + 1; } this.protocolBytes = new byte[len]; int pos = 0; protocolBytes[0] = 'P'; protocolBytes[1] = 'U'; protocolBytes[2] = 'B'; protocolBytes[3] = ' '; pos = 4; pos = copy(protocolBytes, pos, subject); protocolBytes[pos] = ' '; pos++; if (replyTo != null) { pos = copy(protocolBytes, pos, replyTo); protocolBytes[pos] = ' '; pos++; } System.arraycopy(lengthBytes, idx, protocolBytes, pos, lengthBytes.length - idx); } this.sizeInBytes = this.protocolBytes.length + data.length + 4; }

Target:
NatsMessage(String subject, String replyTo, byte[] data, boolean utf8mode) { this.subject = subject; this.replyTo = replyTo; this.data = data; if (utf8mode) { int subjectSize = subject.length() * 2; int replySize = (replyTo != null) ? replyTo.length() * 2 : 0; StringBuilder protocolStringBuilder = new StringBuilder(4 + subjectSize + 1 + replySize + 1); protocolStringBuilder.append(PUB_SPACE); protocolStringBuilder.append(subject); protocolStringBuilder.append(SPACE); if (replyTo != null) { protocolStringBuilder.append(replyTo); protocolStringBuilder.append(SPACE); } protocolStringBuilder.append(String.valueOf(data.length)); this.protocolBytes = protocolStringBuilder.toString().getBytes(StandardCharsets.UTF_8); } else { byte[] lengthBytes = new byte[12]; int idx = lengthBytes.length; int size = (data != null) ? data.length : 0; if (size > 0) { for (int i = size; i > 0; i /= 10) { idx--; lengthBytes[idx] = digits[i % 10]; } } else { idx--; lengthBytes[idx] = digits[0]; } int len = 4 + subject.length() + 1 + (lengthBytes.length - idx); if (replyTo != null) { len += replyTo.length() + 1; } this.protocolBytes = new byte[len]; int pos = 0; protocolBytes[0] = 'P'; protocolBytes[1] = 'U'; protocolBytes[2] = 'B'; protocolBytes[3] = ' '; pos = 4; pos = copy(protocolBytes, pos, subject); protocolBytes[pos] = ' '; pos++; if (replyTo != null) { pos = copy(protocolBytes, pos, replyTo); protocolBytes[pos] = ' '; pos++; } System.arraycopy(lengthBytes, idx, protocolBytes, pos, lengthBytes.length - idx); } this.sizeInBytes = this.protocolBytes.length + data.length + 4; }
Source:
RequestStatus getStatus() { FreenetURI finalURI = getFinalURI(); InsertExceptionMode failureCode = null; String failureReasonShort = null; String failureReasonLong = null; if(putFailedMessage != null) { failureCode = putFailedMessage.code; failureReasonShort = putFailedMessage.getShortFailedMessage(); failureReasonShort = putFailedMessage.getLongFailedMessage(); } int total=0, min=0, fetched=0, fatal=0, failed=0; Date latestSuccess = CurrentTimeUTC.get(), latestFailure = null; boolean totalFinalized = false; if(progressMessage != null) { if(progressMessage instanceof SimpleProgressMessage) { SimpleProgressMessage msg = (SimpleProgressMessage)progressMessage; total = (int) msg.getTotalBlocks(); min = (int) msg.getMinBlocks(); fetched = (int) msg.getFetchedBlocks(); latestSuccess = msg.getLatestSuccess(); fatal = (int) msg.getFatalyFailedBlocks(); failed = (int) msg.getFailedBlocks(); latestFailure = msg.getLatestFailure(); totalFinalized = msg.isTotalFinalized(); } } return new UploadDirRequestStatus( identifier, persistence, started, finished, succeeded, total, min, fetched, latestSuccess, fatal, failed, latestFailure, totalFinalized, priorityClass, finalURI, uri, failureCode, failureReasonShort, failureReasonLong, totalSize, numberOfFiles); }

Target:
RequestStatus getStatus() { FreenetURI finalURI = getFinalURI(); InsertExceptionMode failureCode = null; String failureReasonShort = null; String failureReasonLong = null; if(putFailedMessage != null) { failureCode = putFailedMessage.code; failureReasonShort = putFailedMessage.getShortFailedMessage(); failureReasonShort = putFailedMessage.getLongFailedMessage(); } int total=0, min=0, fetched=0, fatal=0, failed=0; Date latestSuccess = CurrentTimeUTC.get(); Date latestFailure = null; boolean totalFinalized = false; if(progressMessage != null) { if(progressMessage instanceof SimpleProgressMessage) { SimpleProgressMessage msg = (SimpleProgressMessage)progressMessage; total = (int) msg.getTotalBlocks(); min = (int) msg.getMinBlocks(); fetched = (int) msg.getFetchedBlocks(); latestSuccess = msg.getLatestSuccess(); fatal = (int) msg.getFatalyFailedBlocks(); failed = (int) msg.getFailedBlocks(); latestFailure = msg.getLatestFailure(); totalFinalized = msg.isTotalFinalized(); } } return new UploadDirRequestStatus( identifier, persistence, started, finished, succeeded, total, min, fetched, latestSuccess, fatal, failed, latestFailure, totalFinalized, priorityClass, finalURI, uri, failureCode, failureReasonShort, failureReasonLong, totalSize, numberOfFiles); }
Source:
public static ProxySelector createProxySelector(ProxyConfiguration proxyConfig) { switch (proxyConfig.type()) { case DIRECT: return fixedProxySelectorFor(Proxy.NO_PROXY); case FROM_ENVIRONMENT: String defaultEnvProxy = System.getenv(ENV_HTTPS_PROXY); Preconditions.checkNotNull( defaultEnvProxy, "Missing environment variable", SafeArg.of("name", ENV_HTTPS_PROXY)); HostAndPort defaultHostAndPort = HostAndPort.fromString(defaultEnvProxy); InetSocketAddress address = new InetSocketAddress(defaultHostAndPort.getHost(), defaultHostAndPort.getPort()); return fixedProxySelectorFor(new Proxy(Proxy.Type.HTTP, address)); case HTTP: HostAndPort hostAndPort = HostAndPort.fromString(proxyConfig .hostAndPort() .orElseThrow(() -> new SafeIllegalArgumentException( "Expected to find proxy hostAndPort configuration for HTTP proxy"))); InetSocketAddress addr = new InetSocketAddress(hostAndPort.getHost(), hostAndPort.getPort()); return fixedProxySelectorFor(new Proxy(Proxy.Type.HTTP, addr)); case MESH: return ProxySelector.getDefault(); default: } throw new IllegalStateException("Failed to create ProxySelector for proxy configuration: " + proxyConfig); }

Target:
public static ProxySelector createProxySelector(ProxyConfiguration proxyConfig) { switch (proxyConfig.type()) { case DIRECT: return fixedProxySelectorFor(Proxy.NO_PROXY); case FROM_ENVIRONMENT: String defaultEnvProxy = Preconditions.checkNotNull( System.getenv(ENV_HTTPS_PROXY), "Missing environment variable", SafeArg.of("name", ENV_HTTPS_PROXY)); HostAndPort defaultHostAndPort = HostAndPort.fromString(defaultEnvProxy); InetSocketAddress address = new InetSocketAddress(defaultHostAndPort.getHost(), defaultHostAndPort.getPort()); return fixedProxySelectorFor(new Proxy(Proxy.Type.HTTP, address)); case HTTP: HostAndPort hostAndPort = HostAndPort.fromString(proxyConfig .hostAndPort() .orElseThrow(() -> new SafeIllegalArgumentException( "Expected to find proxy hostAndPort configuration for HTTP proxy"))); InetSocketAddress addr = new InetSocketAddress(hostAndPort.getHost(), hostAndPort.getPort()); return fixedProxySelectorFor(new Proxy(Proxy.Type.HTTP, addr)); case MESH: return ProxySelector.getDefault(); default: } throw new IllegalStateException("Failed to create ProxySelector for proxy configuration: " + proxyConfig); }
Source:
public void evaluate() throws Throwable { try ( CompatibilityOverride co = new CompatibilityOverride(config); PlatformCompatOverride pco = new PlatformCompatOverride(hostOnly, config) ) { testStatement.evaluate(); } }

Target:
public void evaluate() throws Throwable { try ( CompatibilityOverride co = new CompatibilityOverride(config); PlatformCompatOverride pco = new PlatformCompatOverride(config); ) { co.init(); pco.init(testType); testStatement.evaluate(); } }
Source:
private View.OnClickListener getClickListener(final ConfigurationItem item) { return new View.OnClickListener() { @Override public void onClick(View view) { FragmentManager fm = getFragmentManager(); if (fm != null && !fm.isStateSaved()) { switch (item) { case ZOOM_LEVELS: InputZoomLevelsBottomSheet.showInstance( fm, EditMapSourceDialogFragment.this, R.string.map_source_zoom_levels, R.string.map_source_zoom_levels_descr, minZoom, maxZoom ); break; case EXPIRE_TIME: ExpireTimeBottomSheet.showInstance(fm, EditMapSourceDialogFragment.this, expireTimeMinutes); break; case MERCATOR_PROJECTION: MercatorProjectionBottomSheet.showInstance(fm, EditMapSourceDialogFragment.this, elliptic); break; case STORAGE_FORMAT: TileStorageFormatBottomSheet.showInstance(fm, EditMapSourceDialogFragment.this, sqliteDB); break; } } } }; }

Target:
private OnClickListener getClickListener(final ConfigurationItem item) { return new View.OnClickListener() { @Override public void onClick(View view) { FragmentManager fm = getFragmentManager(); if (fm != null && !fm.isStateSaved()) { switch (item) { case ZOOM_LEVELS: InputZoomLevelsBottomSheet.showInstance( fm, EditMapSourceDialogFragment.this, R.string.map_source_zoom_levels, R.string.map_source_zoom_levels_descr, minZoom, maxZoom ); break; case EXPIRE_TIME: ExpireTimeBottomSheet.showInstance(fm, EditMapSourceDialogFragment.this, expireTimeMinutes); break; case MERCATOR_PROJECTION: MercatorProjectionBottomSheet.showInstance(fm, EditMapSourceDialogFragment.this, elliptic); break; case STORAGE_FORMAT: TileStorageFormatBottomSheet.showInstance(fm, EditMapSourceDialogFragment.this, sqliteDB); break; } } } }; }
Source:
public boolean nameMatches(String propertyName, String sqlColumnName) { return sqlColumnName.replace("_", "").toLowerCase(locale).equals(propertyName.toLowerCase(locale)); }

Target:
public boolean nameMatches(String propertyName, String sqlColumnName) { return sqlColumnName.replace("_", "").equalsIgnoreCase(propertyName); }
Source:
private void addIfMatches(AppPattern appPattern, String content) { List<String> results = appPattern.findInString(content); if (results != null) { System.out.println(content); this.appMatch = getAppMatch(); results.forEach(appMatch::addVersion); if (LOGGER.isDebugEnabled()) { LOGGER.debug( appPattern.getType() + " matched " + appMatch.getApplication().getName()); } } }

Target:
private void addIfMatches(AppPattern appPattern, String content) { List<String> results = appPattern.findInString(content); if (results != null) { this.appMatch = getAppMatch(); results.forEach(appMatch::addVersion); if (LOGGER.isDebugEnabled()) { LOGGER.debug( appPattern.getType() + " matched " + appMatch.getApplication().getName()); } } }
Source:
public NatMicroserviceClient(String microserviceUri, JcloudsLocation loc) { String tenantAndIdentity = checkNotNull(loc.getIdentity(), "identity"); this.microserviceUri = checkNotNull(microserviceUri, "microserviceUri"); endpoint = NatDirectClient.transformEndpoint(loc.getEndpoint(), Iterables.get(Splitter.on("@").split(tenantAndIdentity), 1)); this.identity = Iterables.get(Splitter.on("@").split(tenantAndIdentity), 0); this.credential = checkNotNull(loc.getCredential(), "credential"); }

Target:
public NatMicroserviceClient(String microserviceUri, JcloudsLocation loc) { String identityAtVOrg = checkNotNull(loc.getIdentity(), "identity"); checkArgument(identityAtVOrg.contains("@")); String vOrg = identityAtVOrg.substring(identityAtVOrg.lastIndexOf("@") + 1); String identity = identityAtVOrg.substring(0, identityAtVOrg.lastIndexOf("@")); this.microserviceUri = checkNotNull(microserviceUri, "microserviceUri"); endpoint = NatDirectClient.transformEndpoint(loc.getEndpoint(), vOrg); this.identity = identity; this.credential = checkNotNull(loc.getCredential(), "credential"); }
Source:
private void run() { try { enforceAttemptTTLs(); } catch (Throwable t) { logger.error("Uncaught exception", t); } try { enforceTaskTTLs(); } catch (Throwable t) { logger.error("Uncaught exception", t); } }

Target:
private void run() { try { enforceAttemptTTLs(); } catch (Throwable t) { logger.error("Uncaught exception when enforcing attempt TTLs. Ignoring. Loop will be retried.", t); } try { enforceTaskTTLs(); } catch (Throwable t) { logger.error("Uncaught exception when enforcing task TTLs. Ignoring. Loop will be retried.", t); } }
Source:
public ByteBuf readLineBuf(AtomicInteger reads) throws IOException { int readBytes = 0; int newlineLength = 0; int readable; this.startIndex = buffer.readerIndex(); loop: while (true) { readable = buffer.readableBytes(); if (readable <= 0) { buffer.readerIndex(this.startIndex); fillBuffer(); if (!buffer.isReadable() && buffer.writerIndex() == 0) { reads.set(0); return null; } else { if (processor.isPrevCharCR() && buffer.getByte(buffer.readerIndex()) == LineSplitProcessor.LF) { buffer.skipBytes(1); if(eof && !buffer.isReadable()) { reads.set(1); return null; } newlineLength++; readBytes++; startIndex = buffer.readerIndex(); } } readable = buffer.readableBytes(); } int endIndex = buffer.forEachByte(buffer.readerIndex(), readable, processor); if (endIndex < 0) { buffer.readerIndex(buffer.writerIndex()); if(eof){ readBytes += (buffer.readerIndex() - startIndex); break loop; } } else { buffer.readerIndex(endIndex + 1); readBytes += (buffer.readerIndex() - startIndex); if (processor.isPrevCharCR() && buffer.isReadable() && buffer.getByte(buffer.readerIndex()) == LineSplitProcessor.LF) { buffer.skipBytes(1); readBytes++; newlineLength += 2; } else { newlineLength += 1; } break loop; } } reads.set(readBytes); return buffer.slice(startIndex, readBytes - newlineLength).retain(); }

Target:
public ByteBuf readLineBuf(AtomicInteger reads) throws IOException { int readBytes = 0; int newlineLength = 0; int readable; this.startIndex = buffer.readerIndex(); loop: while (true) { readable = buffer.readableBytes(); if (readable <= 0) { buffer.readerIndex(this.startIndex); fillBuffer(); if (!buffer.isReadable() && buffer.writerIndex() == 0) { reads.set(0); return null; } else { if (processor.isPrevCharCR() && buffer.getByte(buffer.readerIndex()) == LineSplitProcessor.LF) { buffer.skipBytes(1); if(eof && !buffer.isReadable()) { reads.set(1); return null; } newlineLength++; readBytes++; startIndex = buffer.readerIndex(); } } readable = buffer.readableBytes(); } int endIndex = buffer.forEachByte(buffer.readerIndex(), readable, processor); if (endIndex < 0) { buffer.readerIndex(buffer.writerIndex()); if(eof){ readBytes += (buffer.readerIndex() - startIndex); break loop; } } else { buffer.readerIndex(endIndex + 1); readBytes += (buffer.readerIndex() - startIndex); if (processor.isPrevCharCR() && buffer.isReadable() && buffer.getByte(buffer.readerIndex()) == LineSplitProcessor.LF) { buffer.skipBytes(1); readBytes++; newlineLength += 2; } else { newlineLength += 1; } break loop; } } reads.set(readBytes); return buffer.slice(startIndex, readBytes - newlineLength); }
Source:
public Multimap<String, NotificationChannel> findSubscribedRecipientsForDispatcher(NotificationDispatcher dispatcher, String projectUuid) { checkArgument(projectUuid != null, "ProjectUUID is mandatory"); String dispatcherKey = dispatcher.getKey(); SetMultimap<String, NotificationChannel> recipients = HashMultimap.create(); for (NotificationChannel channel : notificationChannels) { String channelKey = channel.getKey(); List<String> subscribedUsers = dbClient.propertiesDao().findUsersForNotification(dispatcherKey, channelKey, projectUuid); try (DbSession dbSession = dbClient.openSession(false)) { Set<String> filteredSubscribedUsers = dbClient.authorizationDao().keepAuthorizedLoginsOnProject(dbSession, subscribedUsers, projectUuid, UserRole.USER); addUsersToRecipientListForChannel(filteredSubscribedUsers, recipients, channel); } } return recipients; }

Target:
public Multimap<String, NotificationChannel> findSubscribedRecipientsForDispatcher(NotificationDispatcher dispatcher, String projectUuid) { requireNonNull(projectUuid, "ProjectUUID is mandatory"); String dispatcherKey = dispatcher.getKey(); SetMultimap<String, NotificationChannel> recipients = HashMultimap.create(); for (NotificationChannel channel : notificationChannels) { String channelKey = channel.getKey(); Set<String> subscribedUsers = dbClient.propertiesDao().findUsersForNotification(dispatcherKey, channelKey, projectUuid); if (!subscribedUsers.isEmpty()) { try (DbSession dbSession = dbClient.openSession(false)) { Set<String> filteredSubscribedUsers = dbClient.authorizationDao().keepAuthorizedLoginsOnProject(dbSession, subscribedUsers, projectUuid, UserRole.USER); addUsersToRecipientListForChannel(filteredSubscribedUsers, recipients, channel); } } } return recipients; }
Source:
public List<Cookie> getCookieInHeaders(String url) { return stringToCookie(cookieInHeaders,url); }

Target:
public List<Cookie> getCookieInHeaders(String url) { return Collections.unmodifiableList(stringToCookie(cookieInHeaders, url)); }
Source:
public TypeEditorViewModel(Field field, SuggestionProvider<?> suggestionProvider, FieldCheckers fieldCheckers) { super(field, suggestionProvider, fieldCheckers); itemMap.put("mathesis", Localization.lang("Master's thesis")); itemMap.put("phdthesis", Localization.lang("PhD thesis")); itemMap.put("candthesis", Localization.lang("Candidate thesis")); itemMap.put("techreport", Localization.lang("Technical report")); itemMap.put("resreport", Localization.lang("Research report")); itemMap.put("software", Localization.lang("Software")); itemMap.put("datacd", Localization.lang("Data CD")); itemMap.put("audiocd", Localization.lang("Audio CD")); itemMap.put("inproceedings", Localization.lang("InProceedings")); }

Target:
public TypeEditorViewModel(Field field, SuggestionProvider<?> suggestionProvider, FieldCheckers fieldCheckers) { super(field, suggestionProvider, fieldCheckers); itemMap.put("mathesis", Localization.lang("Master's thesis")); itemMap.put("phdthesis", Localization.lang("PhD thesis")); itemMap.put("candthesis", Localization.lang("Candidate thesis")); itemMap.put("techreport", Localization.lang("Technical report")); itemMap.put("resreport", Localization.lang("Research report")); itemMap.put("software", Localization.lang("Software")); itemMap.put("datacd", Localization.lang("Data CD")); itemMap.put("audiocd", Localization.lang("Audio CD")); }
Source:
public static <T> Stream<T> stream(Optional<T> optional) { if (optional.isPresent()) { return Stream.of(optional.get()); } else { return Stream.empty(); } }

Target:
public static <T> Stream<T> stream(Optional<T> optional) { return optional.isPresent() ? Stream.of(optional.get()) : Stream.empty(); }
Source:
public boolean isInterpolated() { return index != null && indexInterpolated != null && !index.equals(indexInterpolated); }

Target:
public boolean isInterpolated() { return index != null && indexInterpolated != null; }
Source:
public void get(@SpringBean PageModel pageModel, @RequestParam(value = "breadcrumbOverride",required = false) String breadcrumbOverride, @RequestParam("patientId") String patientId) { PatientService patientService = Context.getPatientService(); String conceptId = Context.getAdministrationService().getGlobalProperty("concept.causeOfDeath"); Patient patient = patientService.getPatientByUuid(patientId); pageModel.put("person", patient.getPerson()); pageModel.put("birthDate",patient.getBirthdate()); pageModel.put("patient", patient); pageModel.put("patientId", patientId); pageModel.put("breadcrumbOverride", breadcrumbOverride); if (conceptId != null && !conceptId.contains("[a-zA-Z]+")) { pageModel.put("conceptAnswers", getConceptAnswerByConcept(Integer.parseInt(conceptId))); } }

Target:
public void get(@SpringBean PageModel pageModel, @RequestParam(value = "breadcrumbOverride", required = false) String breadcrumbOverride, @RequestParam("patientId") String patientId) { PatientService patientService = Context.getPatientService(); String conceptId = Context.getAdministrationService().getGlobalProperty("concept.causeOfDeath"); Patient patient = patientService.getPatientByUuid(patientId); pageModel.put("birthDate", patient.getBirthdate()); pageModel.put("patient", patient); pageModel.put("patientId", patientId); pageModel.put("breadcrumbOverride", breadcrumbOverride); if (conceptId != null && !conceptId.contains("[a-zA-Z]+")) { pageModel.put("conceptAnswers", getConceptAnswerByConcept(Integer.parseInt(conceptId))); } }
Source:
public void visitAssignmentExpression(AssignmentExpressionTree tree) { if (tree.variable().is(Tree.Kind.IDENTIFIER)) { IdentifierTree variable = (IdentifierTree) tree.variable(); JavaSymbol symbol = (JavaSymbol) variable.symbol(); String nonNullAnnotation = nonNullAnnotation(symbol); if (nonNullAnnotation != null) { List<SymbolicValue> values = programState.peekValues(2); SymbolicValue assignedValue = values.get(1); Constraint constraint = programState.getConstraint(assignedValue); if (constraint != null && constraint.isNull()) { reportIssue(tree, "\"{0}\" is marked \"{1}\" but is set to null.", symbol.name(), nonNullAnnotation); } } } }

Target:
public void visitAssignmentExpression(AssignmentExpressionTree tree) { if (tree.variable().is(Tree.Kind.IDENTIFIER)) { IdentifierTree variable = (IdentifierTree) tree.variable(); Symbol symbol = variable.symbol(); String nonNullAnnotation = nonNullAnnotation(symbol); if (nonNullAnnotation != null) { List<SymbolicValue> values = programState.peekValues(2); SymbolicValue assignedValue = values.get(1); Constraint constraint = programState.getConstraint(assignedValue); if (constraint != null && constraint.isNull()) { reportIssue(tree, "\"{0}\" is marked \"{1}\" but is set to null.", symbol.name(), nonNullAnnotation); } } } }
Source:
protected void testAccessControl_testStudentAccess_shouldPass() { StudentAttributes student1InCourse1 = typicalBundle.students.get("student1InCourse1"); String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, student1InCourse1.getCourse(), Const.ParamsNames.ENTITY_TYPE, Const.EntityType.STUDENT, }; verifyAccessibleForStudentsOfTheSameCourse(submissionParams); verifyInaccessibleWithoutLogin(submissionParams); verifyInaccessibleForUnregisteredUsers(submissionParams); verifyInaccessibleForInstructors(submissionParams); }

Target:
protected void testAccessControl_testStudentAccess_shouldPass() { StudentAttributes student1InCourse1 = typicalBundle.students.get("student1InCourse1"); String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, student1InCourse1.getCourse(), Const.ParamsNames.ENTITY_TYPE, Const.EntityType.STUDENT, }; verifyAccessibleForStudentsOfTheSameCourse(submissionParams); verifyAccessibleForAdmin(submissionParams); verifyInaccessibleWithoutLogin(submissionParams); verifyInaccessibleForUnregisteredUsers(submissionParams); verifyInaccessibleForInstructors(submissionParams); }
Source:
public void areMoreMessagesAvailable_withIndexOf1_shouldReturnFalseWithoutPerformingSearch() throws Exception { ImapFolder folder = createFolder("Folder"); prepareImapFolderForOpen(OPEN_MODE_RW); folder.open(OPEN_MODE_RW); boolean result = folder.areMoreMessagesAvailable(1, null); verify(imapConnection, times(1)).executeSimpleCommand(anyString()); assertFalse(result); }

Target:
public void areMoreMessagesAvailable_withIndexOf1_shouldReturnFalseWithoutPerformingSearch() throws Exception { ImapFolder folder = createFolder("Folder"); prepareImapFolderForOpen(OPEN_MODE_RW); folder.open(OPEN_MODE_RW); assertFalse(folder.areMoreMessagesAvailable(1, null)); verify(imapConnection, times(1)).executeSimpleCommand(anyString()); }
Source:
boolean setErrorFor(final SObjectNode node, final String referenceId, final List<RestError> errors) { final org.apache.camel.component.salesforce.api.dto.Attributes attributes = node.getObject().getAttributes(); final String attributesReferenceId = attributes.getReferenceId(); if (Objects.equals(attributesReferenceId, referenceId)) { node.setErrors(errors); return true; } return StreamSupport.stream(node.getChildNodes().spliterator(), false) .anyMatch(n -> setErrorFor(n, referenceId, errors)); }

Target:
boolean setErrorFor(final SObjectNode node, final String referenceId, final List<RestError> errors) { final Attributes attributes = node.getObject().getAttributes(); final String attributesReferenceId = attributes.getReferenceId(); if (Objects.equals(attributesReferenceId, referenceId)) { node.setErrors(errors); return true; } return StreamSupport.stream(node.getChildNodes().spliterator(), false) .anyMatch(n -> setErrorFor(n, referenceId, errors)); }
Source:
public void run() { if (isDisposing) { return; } if (validationIcon == null || validationIcon.isDisposed()) { return; } if (getVElement().getDiagnostic() == null) { return; } final VTableDomainModelReference tableDMR = (VTableDomainModelReference) getVElement() .getDomainModelReference(); Optional<Setting> setting; if (tableDMR.getDomainModelReference() != null) { setting = getSettingFromObservable(tableDMR.getDomainModelReference(), getViewModelContext().getDomainModel()); } else { setting = getSettingFromObservable(tableDMR, getViewModelContext().getDomainModel()); } if (!setting.isPresent()) { return; } validationIcon.setImage(getValidationIcon(getVElement().getDiagnostic().getHighestSeverity())); showValidationSummaryTooltip(setting.get(), showValidationSummaryTooltip); final Collection<?> collection = (Collection<?>) setting.get().get(true); if (!collection.isEmpty()) { for (final Object object : collection) { getTableViewer().update(object, null); } } }

Target:
public void run() { if (isDisposing) { return; } if (validationIcon == null || validationIcon.isDisposed()) { return; } if (getVElement().getDiagnostic() == null) { return; } final TableConfiguration tableConfiguration = customization.getTableConfiguration(); final Setting setting = tableConfiguration.getContext().getSetting(); validationIcon.setImage(getValidationIcon(getVElement().getDiagnostic().getHighestSeverity())); showValidationSummaryTooltip(setting, showValidationSummaryTooltip); final Collection<?> collection = (Collection<?>) setting.get(true); if (!collection.isEmpty()) { for (final Object object : collection) { getTableViewer().update(object, null); } } }