auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void handleControlCarbonMessage(ControlCarbonMessage controlCarbonMessage, PatternPathRouter. RoutableDestination<Object> routableEndpoint, Session session) { Object webSocketEndpoint = routableEndpoint.getDestination(); Map<String, String> paramValues = routableEndpoint.getGroupNameValues(); Method method = new EndpointDispatcher().getOnPongMessageMethod(webSocketEndpoint); if (method != null) { List<Object> parameterList = new LinkedList<>(); Arrays.stream(method.getParameters()).forEach( parameter -> { if (parameter.getType() == PongMessage.class) { parameterList.add(new WebSocketPongMessage(controlCarbonMessage.readBytes())); } else if (parameter.getType() == Session.class) { parameterList.add(session); } else if (parameter.getType() == String.class) { PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value())); } else { throw new IllegalArgumentException("String parameters " + "without @PathParam annotation"); } } else { parameterList.add(null); } } ); } }

Target:
private void handleControlCarbonMessage(ControlCarbonMessage controlCarbonMessage, PatternPathRouter. RoutableDestination<Object> routableEndpoint, Session session) { Object webSocketEndpoint = routableEndpoint.getDestination(); Map<String, String> paramValues = routableEndpoint.getGroupNameValues(); Optional<Method> methodOptional = new EndpointDispatcher().getOnPongMessageMethod(webSocketEndpoint); try { methodOptional.ifPresent( method -> { List<Object> parameterList = new LinkedList<>(); Arrays.stream(method.getParameters()).forEach( parameter -> { if (parameter.getType() == PongMessage.class) { parameterList.add(new WebSocketPongMessage(controlCarbonMessage.readBytes())); } else if (parameter.getType() == Session.class) { parameterList.add(session); } else if (parameter.getType() == String.class) { PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value())); } else { throw new IllegalArgumentException("String parameters " + "without @PathParam annotation"); } } else { parameterList.add(null); } } ); executeMethod(method, webSocketEndpoint, parameterList, session); } ); } catch (Throwable throwable) { handleError(throwable, routableEndpoint, session); } }
Source:
private void resetIcons() { if (!firstRunThrough) { animationHasStarted = false; style.removeLayer("symbol-layer-id"); initLayerIcon(style); initAnimation(currentSelectedTimeInterpolator); } }

Target:
private void resetIcons() { if (!firstRunThrough) { animationHasStarted = false; style.removeLayer(SYMBOL_LAYER_ID); initAnimation(currentSelectedTimeInterpolator); } }
Source:
private void addHitsFromQuery(List<BibEntry> entryList, String queryURL) throws IOException, FetcherException { LOGGER.debug("Downloading from {}", queryURL); String content = new URLDownload(queryURL).asString(); if (needsCaptcha(content)) { throw new FetcherException("Fetching from Google Scholar failed: Captacha hit at " + queryURL + ".", Localization.lang("This might be caused by reaching the traffic limitation of Google Scholar (see 'Help' for details)."), null); } Matcher matcher = LINK_TO_SUBPAGE_PATTERN.matcher(content); if (!matcher.find()) { LOGGER.debug("No data-clk-atid found in html {}", content); return; } String infoPageUrl = BASIC_SEARCH_URL + "q=info:" + matcher.group(1) + ":scholar.google.com/&output=cite&scirp=0&hl=en"; LOGGER.debug("Using infoPageUrl {}", infoPageUrl); URLDownload infoPageUrlDownload = new URLDownload(infoPageUrl); LOGGER.debug("Downloading from {}", infoPageUrl); String infoPageContent = infoPageUrlDownload.asString(); matcher = LINK_TO_BIB_PATTERN.matcher(infoPageContent); boolean found = false; while (matcher.find()) { found = true; String citationsPageURL = matcher.group().replace("&amp;", "&"); LOGGER.debug("Using citationsPageURL {}", citationsPageURL); BibEntry newEntry = downloadEntry(citationsPageURL); entryList.add(newEntry); } if (!found) { LOGGER.debug("Did not found pattern in html {}", infoPageContent); } }

Target:
private void addHitsFromQuery(List<BibEntry> entryList, String queryURL) throws IOException, FetcherException { LOGGER.debug("Downloading from {}", queryURL); URLDownload urlDownload = new URLDownload(queryURL); obtainAndModifyCookie(urlDownload); String content = urlDownload.asString(); if (needsCaptcha(content)) { throw new FetcherException("Fetching from Google Scholar failed: Captcha hit at " + queryURL + ".", Localization.lang("This might be caused by reaching the traffic limitation of Google Scholar (see 'Help' for details)."), null); } extractEntriesFromContent(content, entryList); }
Source:
public boolean shouldSwitch(ITrackSwitch switchTrack, EntityMinecart cart) { RoutingLogic logic = getLogic(); if(logic != null) return logic.matches(this, cart); else return false; }

Target:
public boolean shouldSwitch(ITrackSwitch switchTrack, EntityMinecart cart) { RoutingLogic logic = getLogic(); if(logic != null && logic.isValid()) return logic.matches(this, cart); else return false; }
Source:
public boolean appliesTo(final Object selection) { boolean appliedConstraint = false; if (selection instanceof EStructuralFeature && UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue().equals(selection)) { appliedConstraint = true; } else if (selection instanceof ValueSpecification) { final ValueSpecification valueSpecification = (ValueSpecification) selection; if (null != valueSpecification.eContainer() && valueSpecification.eContainer() instanceof MultiplicityElement) { final EObject parent = valueSpecification.eContainer(); final Object lowerValue = parent.eGet(UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue()); appliedConstraint = valueSpecification.equals(lowerValue); } } return appliedConstraint; }

Target:
public boolean appliesTo(final Object selection) { boolean appliedConstraint = false; if (selection instanceof EStructuralFeature && UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue().equals(selection)) { appliedConstraint = true; } else if (selection instanceof ValueSpecification) { final ValueSpecification valueSpecification = (ValueSpecification) selection; if (valueSpecification.eContainer() instanceof MultiplicityElement) { final EObject parent = valueSpecification.eContainer(); final Object lowerValue = parent.eGet(UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue()); appliedConstraint = valueSpecification.equals(lowerValue); } } return appliedConstraint; }
Source:
public void stepSetRemoteExecutable(final RequestMonitor rm) { if (fBackend.getSessionType() == SessionType.REMOTE && !fBackend.getIsAttachSession()) { if (!CDebugUtils.getAttribute( fAttributes, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_MULTI, IGDBLaunchConfigurationConstants.DEBUGGER_REMOTE_MULTI_DEFAULT)) { rm.done(); return; } String remoteBinary = CDebugUtils.getAttribute( fAttributes, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_BINARY, ""); if (remoteBinary.length() == 0) { rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "Binary on host is not specified")); rm.done(); return; } fGdbControl.queueCommand( fCommandFactory.createMIGDBSet( getContainerContext(), new String[] { "remote", "exec-file", remoteBinary, }), new ImmediateDataRequestMonitor<MIInfo>(rm)); } else { rm.done(); } }

Target:
public void stepSetRemoteExecutable(final RequestMonitor rm) { if (fBackend.getSessionType() == SessionType.REMOTE && fBackend.getIsAttachSession()) { String remoteBinary = CDebugUtils.getAttribute( fAttributes, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_BINARY, ""); if (remoteBinary.length() == 0) { rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "Binary on host is not specified")); rm.done(); return; } fGdbControl.queueCommand( fCommandFactory.createMIGDBSet( getContainerContext(), new String[] { "remote", "exec-file", remoteBinary, }), new ImmediateDataRequestMonitor<MIInfo>(rm)); } else { rm.done(); } }
Source:
public void onException(SQLException e, OperationType operationType) { if (e instanceof SQLTransientConnectionException || e instanceof BatchUpdateException) { if (operationType == OperationType.Write) { metrics.writeFailureCount.inc(); } else if (operationType == operationType.Read) { metrics.readFailureCount.inc(); } else if (operationType == operationType.Copy) { metrics.copyFailureCount.inc(); } closeActiveConnection(); } }

Target:
public void onException(SQLException e, OperationType operationType) { if (e instanceof SQLTransientConnectionException) { if (operationType == OperationType.Write) { metrics.writeFailureCount.inc(); } else if (operationType == OperationType.Read) { metrics.readFailureCount.inc(); } else if (operationType == OperationType.Copy) { metrics.copyFailureCount.inc(); } closeActiveConnection(); } }
Source:
public HostRestartConfirmationModel() { super(); setForceToMaintenance(new EntityModel<>()); getForceToMaintenance().setEntity(false); getForceToMaintenance().setIsAvailable(true); }

Target:
public HostRestartConfirmationModel() { super(); setForceToMaintenance(new EntityModel<>()); getForceToMaintenance().setEntity(false); }
Source:
public Stream<T> lazyStream() throws IllegalStateException { if (pagerStream == null) { synchronized (this) { if (pagerStream == null) { } currentPage = 0; pagerStream = StreamSupport.stream(new PagerSpliterator<T>(this), false); return (pagerStream); } } throw new IllegalStateException("Stream already issued"); }

Target:
public Stream<T> lazyStream() throws IllegalStateException { if (pagerStream == null) { synchronized (this) { if (pagerStream == null) { currentPage = 0; pagerStream = StreamSupport.stream(new PagerSpliterator<T>(this), false); return (pagerStream); } } } throw new IllegalStateException("Stream already issued"); }
Source:
public int hashCode() { return HashUtil.combineHashCodes(super.hashCode(), isAsync.hashCode()); }

Target:
public int hashCode() { return HashUtil.combineHashCodes(super.hashCode(), Objects.hashCode(isAsync)); }
Source:
public void purgeDeletedSecretWithResponseCodeSnippets() { SecretAsyncClient secretAsyncClient = getAsyncSecretClient(); secretAsyncClient.purgeDeletedSecretWithResponse("deletedSecretName") .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(purgeResponse -> System.out.printf("Purge Status response %d \n", purgeResponse.getStatusCode())); END: com.azure.keyvault.secrets.secretclient.purgeDeletedSecretWithResponse#string }

Target:
public void purgeDeletedSecretWithResponseCodeSnippets() { SecretAsyncClient secretAsyncClient = getAsyncSecretClient(); secretAsyncClient.purgeDeletedSecretWithResponse("deletedSecretName") .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(purgeResponse -> System.out.printf("Purge Status response %d %n", purgeResponse.getStatusCode())); END: com.azure.keyvault.secrets.secretclient.purgeDeletedSecretWithResponse#string }
Source:
public void writeTestResultSummariesToFile(FileWriterWithEncoding fWriter) throws IOException, PMException, OperationCanceledException { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(Include.NON_EMPTY); fWriter.append(StringConstants.LEFT_BRACKET); float size = TestResultSummaryPM.countOfTestResultSummaries( m_project, null); long to = (long) Math.ceil(size / PAGE_SIZE); int pos = 0; for (int i = 1; i <= to; i++) { m_ioHandle.checkCancel(m_monitor); List<ITestResultSummaryPO> summaries = TestResultSummaryPM.getTestResultSummaries( m_project, null, i, PAGE_SIZE); List<TestresultSummaryDTO> summaryDTOs = getTestResultSummaryDTOs(summaries); for (int k = 0; k < summaryDTOs.size(); k++) { pos++; TestresultSummaryDTO dto = summaryDTOs.get(k); StringBuffer buffer = new StringBuffer(); buffer.append(mapper.writeValueAsString(dto)); if (!(i == to && k == summaryDTOs.size() - 1)) { buffer.append(StringConstants.COMMA); } fWriter.append(buffer); m_monitor.worked(1); } m_monitor.subTask(Messages.ImportJsonImportResult + pos + StringConstants.SLASH + (int) size); } fWriter.append(StringConstants.RIGHT_BRACKET); fWriter.close(); }

Target:
public void writeTestResultSummariesToFile(FileWriterWithEncoding fWriter) throws IOException, PMException, OperationCanceledException { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(Include.NON_EMPTY); fWriter.append(StringConstants.LEFT_BRACKET); float size = TestResultSummaryPM.countOfTestResultSummaries( m_project, null); long lastPage = (long) Math.ceil(size / ImportExportUtil.PAGE_SIZE); int pos = 0; for (int countOfPage = 1; countOfPage <= lastPage; countOfPage++) { ImportExportUtil.checkCancel(m_monitor); List<ITestResultSummaryPO> summaries = TestResultSummaryPM.getTestResultSummaries( m_project, null, countOfPage, ImportExportUtil.PAGE_SIZE); List<TestresultSummaryDTO> summaryDTOs = getTestResultSummaryDTOs(summaries); for (int countOfItemInPage = 0; countOfItemInPage < summaryDTOs.size(); countOfItemInPage++) { pos++; TestresultSummaryDTO dto = summaryDTOs.get(countOfItemInPage); StringBuffer buffer = new StringBuffer(); buffer.append(mapper.writeValueAsString(dto)); if (!(countOfPage == lastPage && countOfItemInPage == summaryDTOs.size() - 1)) { buffer.append(StringConstants.COMMA); } fWriter.append(buffer); m_monitor.worked(1); } m_monitor.subTask(Messages.ImportJsonImportResult + pos + StringConstants.SLASH + (int) size); } fWriter.append(StringConstants.RIGHT_BRACKET); fWriter.close(); }
Source:
public void waitUntilMessagesReceived(Long numberOfMessages) { boolean isRetryInProgress = true; while (isRetryInProgress) { Long count = consumerClient.getReceivedMessageCount(); if (count >= numberOfMessages) { isRetryInProgress = false; } AndesClientUtils.sleepForInterval(1000L); } }

Target:
public void waitUntilMessagesReceived(Long numberOfMessages) { while (true) { Long count = consumerClient.getReceivedMessageCount(); if (count >= numberOfMessages) { break; } AndesClientUtils.sleepForInterval(1000L); } }
Source:
public List<String> getAffectedCodeSystemsForTeminology(final String terminologyId) { Preconditions.checkNotNull(terminologyId, "terminologyId"); if (!TERMINOLOGY_ID_TO_SHORTNAMES_CACHE.containsKey(terminologyId)) { final List<String> affectedCodeSystems = Lists.newArrayList(); for (final IConfigurationElement terminology : Platform.getExtensionRegistry().getConfigurationElementsFor(TERMINOLOGY_EXTENSION_POINT_ID)) { final String id = terminology.getAttribute(ID_ATTRIBUTE); if (id.equals(terminologyId)) { affectedCodeSystems.addAll( Arrays.stream(terminology.getChildren(DEPENDENCY_ATTRIBUTE)) .map(configurationElement -> configurationElement.getAttribute(SHORT_NAME_ATTRIBUTE)) .collect(Collectors.toList()) ); } } TERMINOLOGY_ID_TO_SHORTNAMES_CACHE.put(terminologyId, affectedCodeSystems); } return TERMINOLOGY_ID_TO_SHORTNAMES_CACHE.get(terminologyId); }

Target:
public SortedSet<String> getAffectedCodeSystemsForTeminology(final String terminologyId) { Preconditions.checkArgument(TERMINOLOGY_ID_TO_SHORTNAMES_CACHE.containsKey(terminologyId), "No terminology extension has been registered with the id: " + terminologyId); return TERMINOLOGY_ID_TO_SHORTNAMES_CACHE.get(terminologyId); }
Source:
private boolean canRunActions(ArrayList<VdcReturnValueBase> returnValues) { if (getCommands().size() == 1) { CorrelationIdTracker.setCorrelationId(getCommands().get(0).getCorrelationId()); returnValues.add(getCommands().get(0).validateOnly()); } else { checkValidatesAsynchronously(returnValues); } if (isRunOnlyIfAllValidatePass) { for (VdcReturnValueBase value : returnValues) { if (!value.getValidate()) { return false; } } } return true; }

Target:
private boolean canRunActions(ArrayList<VdcReturnValueBase> returnValues) { if (getCommands().size() == 1) { CorrelationIdTracker.setCorrelationId(getCommands().get(0).getCorrelationId()); returnValues.add(getCommands().get(0).validateOnly()); } else { checkValidatesAsynchronously(returnValues); } if (isRunOnlyIfAllValidationPass) { for (VdcReturnValueBase value : returnValues) { if (!value.getValidate()) { return false; } } } return true; }
Source:
public TabletMetadata next() { long sleepTime = 250; TabletMetadata currTablet = null; while (currTablet == null) { TabletMetadata tmp = source.next(); if (prevTablet == null) { if (tmp.sawPrevEndRow()) { Text prevRow = tmp.getExtent().getPrevEndRow(); Text prevMetaRow = null; if (prevRow != null) { prevMetaRow = TabletsSection.getRow(tmp.getExtent().getTableId(), prevRow); } if (prevRow == null || range.beforeStartKey(new Key(prevMetaRow))) { currTablet = tmp; } else { log.info("First tablet prev end row falls within range, retrying ", prevMetaRow, range); } } else { log.warn("Tablet has no prev end row " + tmp.getTableId() + " " + tmp.getEndRow()); } } else if (goodTransition(prevTablet, tmp)) { currTablet = tmp; } if (currTablet == null) { sleepUninterruptibly(sleepTime, TimeUnit.MILLISECONDS); resetSource(); sleepTime = Math.min(2 * sleepTime, 5000); } } prevTablet = currTablet; return currTablet; }

Target:
public TabletMetadata next() { long sleepTime = 250; TabletMetadata currTablet = null; while (currTablet == null) { TabletMetadata tmp = source.next(); if (prevTablet == null) { if (tmp.sawPrevEndRow()) { Text prevMetaRow = null; KeyExtent extent = tmp.getExtent(); if (extent.getPrevEndRow() != null) { prevMetaRow = TabletsSection.getRow(extent.getTableId(), extent.getPrevEndRow()); } if (prevMetaRow == null || range.beforeStartKey(new Key(prevMetaRow))) { currTablet = tmp; } else { log.debug( "First tablet seen provides evidence of earlier tablet in range, retrying ", prevMetaRow, range); } } else { log.warn("Tablet has no prev end row " + tmp.getTableId() + " " + tmp.getEndRow()); } } else if (goodTransition(prevTablet, tmp)) { currTablet = tmp; } if (currTablet == null) { sleepUninterruptibly(sleepTime, TimeUnit.MILLISECONDS); resetSource(); sleepTime = Math.min(2 * sleepTime, 5000); } } prevTablet = currTablet; return currTablet; }
Source:
public void testPreloadingInTransactionalCache() throws Exception { assertTrue(cache.getCacheConfiguration().loaders().preload()); assertNotInCacheAndStore(cache, cache, "k1", "k2", "k3", "k4"); cache.put("k1", "v1"); cache.put("k2", "v2", lifespan, MILLISECONDS); cache.put("k3", "v3"); cache.put("k4", "v4", lifespan, MILLISECONDS); for (int i = 1; i < 5; i++) { if (i % 2 == 1) assertInCacheAndStore(cache, store, "k" + i, "v" + i); else assertInCacheAndStore(cache, store, "k" + i, "v" + i, lifespan); } DataContainer c = cache.getAdvancedCache().getDataContainer(); assertEquals(4, c.size()); cache.stop(); assertEquals(0, c.size()); cache.start(); assertTrue(cache.getCacheConfiguration().loaders().preload()); c = cache.getAdvancedCache().getDataContainer(); assertEquals(4, c.size()); store = TestingUtil.extractComponent(cache, CacheLoaderManager.class).getCacheStore(); for (int i = 1; i < 5; i++) { if (i % 2 == 1) assertInCacheAndStore(cache, store, "k" + i, "v" + i); else assertInCacheAndStore(cache, store, "k" + i, "v" + i, lifespan); } withTx(cache.getAdvancedCache().getTransactionManager(), new Callable<Void>() { @Override public Void call() throws Exception { assertEquals("v1", cache.get("k1")); cache.put("k1", "new-v1"); return null; } }); }

Target:
public void testPreloadingInTransactionalCache() throws Exception { assertTrue(cache.getCacheConfiguration().loaders().preload()); assertNotInCacheAndStore(cache, store, "k1", "k2", "k3", "k4"); cache.put("k1", "v1"); cache.put("k2", "v2", LIFESPAN, MILLISECONDS); cache.put("k3", "v3"); cache.put("k4", "v4", LIFESPAN, MILLISECONDS); for (int i = 1; i < 5; i++) { if (i % 2 == 1) assertInCacheAndStore(cache, store, "k" + i, "v" + i); else assertInCacheAndStore(cache, store, "k" + i, "v" + i, LIFESPAN); } DataContainer c = cache.getAdvancedCache().getDataContainer(); assertEquals(4, c.size()); cache.stop(); assertEquals(0, c.size()); cache.start(); assertTrue(cache.getCacheConfiguration().loaders().preload()); c = cache.getAdvancedCache().getDataContainer(); assertEquals(4, c.size()); store = TestingUtil.extractComponent(cache, CacheLoaderManager.class).getCacheStore(); for (int i = 1; i < 5; i++) { if (i % 2 == 1) assertInCacheAndStore(cache, store, "k" + i, "v" + i); else assertInCacheAndStore(cache, store, "k" + i, "v" + i, LIFESPAN); } withTx(cache.getAdvancedCache().getTransactionManager(), new Callable<Void>() { @Override public Void call() throws Exception { assertEquals("v1", cache.get("k1")); cache.put("k1", "new-v1"); return null; } }); }
Source:
public void flatMapCompletableComplete() { TestSubscriber testSubscriber = new TestSubscriber(); Single.just(1).flatMapCompletable(new Func1<Integer, Completable>() { @Override public Completable call(final Integer integer) { return Completable.complete(); } }).subscribe(testSubscriber); testSubscriber.assertCompleted(); }

Target:
public void flatMapCompletableComplete() { final AtomicInteger atomicInteger = new AtomicInteger(); TestSubscriber testSubscriber = TestSubscriber.create(); Single.just(1).flatMapCompletable(new Func1<Integer, Completable>() { @Override public Completable call(final Integer integer) { return Completable.fromAction(new Action0() { @Override public void call() { atomicInteger.set(5); } }); } }).subscribe(testSubscriber); testSubscriber.assertCompleted(); assertEquals(5, atomicInteger.get()); }
Source:
private IStatus checkExpression(IValidationContext ctx, EObject target, EStructuralFeature feature) { IStatus returnStatus = ctx.createSuccessStatus(); String expression = (String) target.eGet(feature); if (!StringUtil.isEmpty(expression)) { IInterpreterContext context = SiriusInterpreterContextFactory.createInterpreterContext(target, feature); VariableType variableType = context.getTargetType(); if (isTypeIdentified(variableType)) { Optional<EStructuralFeature> optional = variableType.getPossibleTypes().stream().flatMap(type -> type.search(context.getAvailableEPackages()).stream()).filter(EClass.class::isInstance) .map(EClass.class::cast).flatMap(eClass -> eClass.getEAllStructuralFeatures().stream()).filter(f -> f.getName().equals(expression)).findFirst(); if (!optional.isPresent()) { returnStatus = ctx.createFailureStatus(); } } } else { returnStatus = ctx.createFailureStatus(); } return returnStatus; }

Target:
private IStatus checkExpression(IValidationContext ctx, EObject target, EStructuralFeature feature) { IStatus returnStatus = ctx.createSuccessStatus(); String expression = (String) target.eGet(feature); IInterpreterContext context = SiriusInterpreterContextFactory.createInterpreterContext(target, feature); VariableType variableType = context.getTargetType(); if (!StringUtil.isEmpty(expression)) { if (isTypeIdentified(variableType)) { Optional<EStructuralFeature> optional = variableType.getPossibleTypes().stream().flatMap(type -> type.search(context.getAvailableEPackages()).stream()).filter(EClass.class::isInstance) .map(EClass.class::cast).flatMap(eClass -> eClass.getEAllStructuralFeatures().stream()).filter(f -> f.getName().equals(expression)).findFirst(); if (!optional.isPresent()) { returnStatus = ctx.createFailureStatus(expression, variableType); } } } else { returnStatus = ctx.createFailureStatus(expression, variableType); } return returnStatus; }
Source:
public static OcciContext validateCredentials(OcciCredentials occiCredentials) throws InvalidOcciCredentialsException { OcciContext context = new OcciContext(occiCredentials); File f = new File(context.getOcciCredentials().getUserCertificatePath()); if((!f.exists() || f.isDirectory())){ logger.info(String.format("Cert does not exist in provided path" + context.getOcciCredentials().getUserCertificatePath())); throw new InvalidOcciCredentialsException("Cert does not exist in provided path" + context.getOcciCredentials().getUserCertificatePath()); } f = new File(context.getOcciCredentials().getSystemCertDir()); if ((!f.exists() || !f.isDirectory())) { logger.info(String.format("Cert folder does not exist in provided path" + context.getOcciCredentials().getSystemCertDir())); throw new InvalidOcciCredentialsException("Cert folder does not exist in provided path" + context.getOcciCredentials().getSystemCertDir()); } return context; }

Target:
public static OcciContext validateCredentials(OcciCredentials occiCredentials) throws InvalidOcciCredentialsException { OcciContext context = new OcciContext(occiCredentials); File f = new File(context.getOcciCredentials().getUserCertificatePath()); if((!f.exists() || f.isDirectory())) { logger.info(String.format("Certificate does not exist in provided path " + context.getOcciCredentials().getUserCertificatePath())); throw new InvalidOcciCredentialsException("Certificate does not exist in provided path " + context.getOcciCredentials().getUserCertificatePath()); } f = new File(context.getOcciCredentials().getSystemCertDir()); if ((!f.exists() || !f.isDirectory())) { logger.info(String.format("Certificate folder does not exist in provided path " + context.getOcciCredentials().getSystemCertDir())); throw new InvalidOcciCredentialsException("Certificate folder does not exist in provided path " + context.getOcciCredentials().getSystemCertDir()); } return context; }
Source:
public <T> T get(Object key, Callable<T> valueLoader) { long stamp = synchronousGetLock.readLock(); try { T value = (T) nativeCache.get(key); if (value == null) { AtomicBoolean valueObtained = new AtomicBoolean(); while (!valueObtained.get()) { long upgradedLockStamp = synchronousGetLock.tryConvertToWriteLock(stamp); if (upgradedLockStamp != 0) { stamp = upgradedLockStamp; value = (T) nativeCache.computeIfAbsent(key, keyToBeInserted -> { try { return valueLoader.call(); } catch (Exception e) { throw ValueRetrievalExceptionResolver.throwValueRetrievalException(key, valueLoader, e); } }); valueObtained.set(true); } else { synchronousGetLock.unlockRead(stamp); stamp = synchronousGetLock.writeLock(); } } } return value; } finally { synchronousGetLock.unlock(stamp); } }

Target:
public <T> T get(Object key, Callable<T> valueLoader) { ReentrantLock lock = null; T value = (T) nativeCache.get(key); if (value == null) { lock = synchronousGetLocks.computeIfAbsent(key, k -> new ReentrantLock()); lock.lock(); try { if ((value = (T) nativeCache.get(key)) == null) { try { T newValue = valueLoader.call(); value = (T) nativeCache.putIfAbsent(key, newValue); if (value == null) { value = newValue; } } catch (Exception e) { throw ValueRetrievalExceptionResolver.throwValueRetrievalException(key, valueLoader, e); } } } finally { lock.unlock(); synchronousGetLocks.remove(key); } } return value; }
Source:
public void shutdown() { isUp = false; try { if (idConverter != null) { idConverter.close(); idConverter = null; } if (securityService != null) { securityService.close(); securityService = null; } logger.info("AmbryBlobStorageService shutdown complete"); } catch (IOException e) { logger.error("Downstream service close failed", e); } }

Target:
public void shutdown() { isUp = false; try { if (securityService != null) { securityService.close(); securityService = null; } if (idConverter != null) { idConverter.close(); idConverter = null; } logger.info("AmbryBlobStorageService shutdown complete"); } catch (IOException e) { logger.error("Downstream service close failed", e); } }
Source:
private void inbound(final SmppInboundMessageEntity request ) throws IOException { final ActorRef self = self(); String to = request.getSmppTo(); final IncomingPhoneNumbersDao numbersDao = storage.getIncomingPhoneNumbersDao(); List<IncomingPhoneNumber> numbers = numbersDao.getIncomingPhoneNumber(to); IncomingPhoneNumber number = numbers.get(0); if( redirectToHostedSmsApp(self,request, storage.getAccountsDao(), storage.getApplicationsDao(),to )){ if(logger.isInfoEnabled()) { logger.info("SMPP Message Accepted - A Restcomm Hosted App is Found for Number : " + number.getPhoneNumber() ); } return; } else { logger.warning("SMPP Message Rejected : No Restcomm Hosted App Found for inbound number : " + to ); } }

Target:
private void inbound(final SmppInboundMessageEntity request ) throws IOException { final ActorRef self = self(); String to = request.getSmppTo(); if( redirectToHostedSmsApp(self,request, storage.getAccountsDao(), storage.getApplicationsDao(),to )){ if(logger.isInfoEnabled()) { logger.info("SMPP Message Accepted - A Restcomm Hosted App is Found for Number : " + to ); } return; } else { logger.warning("SMPP Message Rejected : No Restcomm Hosted App Found for inbound number : " + to ); } }
Source:
public Secrets(String host, int port, String token) throws VaultException { this.vaultConfig = new VaultConfig(String.format("http://%s:%s", host, port), token); this.vault = new Vault(this.vaultConfig); }

Target:
public Secrets(String host, int port, String token) throws VaultException { this.vaultConfig = new VaultConfig(String.format("http://%s:%d", host, port), token); this.vault = new Vault(this.vaultConfig); }
Source:
public void verifyListenerAnnotationTransformerClass() { MySuiteListener.triggered = false; TestNG tng = new TestNG(); tng.setVerbose(0); tng.setAnnotationTransformer(new MyListenerTransformer()); tng.setTestClasses(new Class[]{AnnotationTransformerClassSampleTest.class}); tng.run(); Assert.assertFalse(MySuiteListener.triggered); }

Target:
public void verifyListenerAnnotationTransformerClass() { MySuiteListener.triggered = false; MySuiteListener2.triggered = false; TestNG tng = new TestNG(); tng.setVerbose(0); tng.setAnnotationTransformer(new MyListenerTransformer()); tng.setTestClasses(new Class[]{AnnotationTransformerClassSampleTest.class}); tng.run(); Assert.assertFalse(MySuiteListener.triggered); Assert.assertTrue(MySuiteListener2.triggered); }
Source:
public static boolean vmDeviceChanged(Guid vmId, VmDeviceGeneralType deviceType, boolean deviceEnabled) { return vmDeviceChanged(vmId, null, deviceEnabled); }

Target:
public static boolean vmDeviceChanged(Guid vmId, VmDeviceGeneralType deviceType, boolean deviceEnabled) { return vmDeviceChanged(vmId, deviceType, null, deviceEnabled); }
Source:
public static void addOrUpdateTaskInDB(final SPMAsyncTask asyncTask) { try { if (asyncTask.getParameters().getDbAsyncTask() != null) { TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Void>() { @Override public Void runInTransaction() { addOrUpdateTaskInDB(asyncTask.getParameters().getDbAsyncTask()); Map<Guid, VdcObjectType> entitiesMap = asyncTask.getEntitiesMap(); for (Entry<Guid, VdcObjectType> entry : entitiesMap.entrySet()) { DbFacade.getInstance() .getAsyncTaskDao() .insertAsyncTaskEntity(asyncTask.getParameters().getDbAsyncTask().getTaskId(), entry.getKey(), entry.getValue()); } return null; } }); } } catch (RuntimeException e) { log.error(String.format( "Adding/Updating task %1$s to DataBase threw an exception.", asyncTask.getVdsmTaskId()), e); } }

Target:
public static void addOrUpdateTaskInDB(final SPMAsyncTask asyncTask) { try { if (asyncTask.getParameters().getDbAsyncTask() != null) { TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Void>() { @Override public Void runInTransaction() { addOrUpdateTaskInDB(asyncTask.getParameters().getDbAsyncTask()); Map<Guid, VdcObjectType> entitiesMap = asyncTask.getEntitiesMap(); for (Entry<Guid, VdcObjectType> entry : entitiesMap.entrySet()) { getAsyncTaskDao().insertAsyncTaskEntity(asyncTask.getParameters() .getDbAsyncTask().getTaskId(), entry.getKey(), entry.getValue()); } return null; } }); } } catch (RuntimeException e) { log.error(String.format( "Adding/Updating task %1$s to DataBase threw an exception.", asyncTask.getVdsmTaskId()), e); } }
Source:
public void untilSubscriptionIsSuspended(Topic topic, String subscription) { untilSubscriptionHasState(topic, subscription, Subscription.State.SUSPENDED); waitAtMost(adjust(Duration.ONE_MINUTE)).until(() -> !endpoints.consumer().listSubscriptions().stream() .filter(sub -> sub.getQualifiedName().equals(topic.getQualifiedName() + "$" + subscription)) .findAny() .isPresent()); }

Target:
public void untilSubscriptionIsSuspended(Topic topic, String subscription) { untilSubscriptionHasState(topic, subscription, Subscription.State.SUSPENDED); waitAtMost(adjust(Duration.TEN_SECONDS)).until(() -> !endpoints.consumer().listSubscriptions().stream() .filter(sub -> sub.getQualifiedName().equals(topic.getQualifiedName() + "$" + subscription)) .findAny() .isPresent()); }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { TransactionalEditingDomain editingDomain = getTableEditingDomain(); Table table = getTable(); if (null != editingDomain && null != table) { BooleanValueStyle autoResizeValue = (BooleanValueStyle) table.getNamedStyle(NattablestylePackage.eINSTANCE.getBooleanValueStyle(), NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT); if (null != autoResizeValue) { Assert.isTrue(autoResizeValue.isBooleanValue()); StyleUtils.deleteBooleanNamedStyle(editingDomain, table, NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT); } else { StyleUtils.initBooleanNamedStyle(editingDomain, table, NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT, true); } } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { TransactionalEditingDomain editingDomain = getTableEditingDomain(); Table table = getTable(); if (null != editingDomain && null != table) { BooleanValueStyle autoResizeValue = (BooleanValueStyle) table.getNamedStyle(NattablestylePackage.eINSTANCE.getBooleanValueStyle(), NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT); if (null != autoResizeValue) { if (autoResizeValue.isBooleanValue()) { StyleUtils.deleteBooleanNamedStyle(editingDomain, table, NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT); } else { StyleUtils.setBooleanNamedStyle(editingDomain, table, NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT, NamedStyleConstants.ENABLE_AUTO_RESIZE_CELL_HEIGHT); } } else { StyleUtils.initBooleanNamedStyle(editingDomain, table, NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT, NamedStyleConstants.ENABLE_AUTO_RESIZE_CELL_HEIGHT); } } return null; }
Source:
protected GlobalLock getGlobalLock(final Connection connection, final String lockName, final ResetReentrantLockCallback resetCb) { try { ZooKeeper zooKeeper = new ZooKeeper("connectString", Long.valueOf(timeout).intValue(), new Watcher() { @Override public void process(final WatchedEvent event) { if (event.getState() == Watcher.Event.KeeperState.SyncConnected) { connectedSignal.countDown(); } } }); return new ZooKeeperGlobalLock("ZooKeeper Lock", zooKeeper, zkPath + "<account_id>"); } catch (IOException e) { return null; } }

Target:
protected GlobalLock getGlobalLock(final Connection connection, final String lockName, final ResetReentrantLockCallback resetCb) { return new ZooKeeperGlobalLock(connection, lockName, globalLockDao, resetCb); }
Source:
public void doFilter( ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { TreeSet<ServiceReference<Filter>> sortedFilterServiceReferences = null; final BundleContext bundleContext = getContext(); if (bundleContext == null) { throw new ServletException( "Unable to get BundleContext. No servlet Filters can be applied. Blocking the request processing."); } try { sortedFilterServiceReferences = new TreeSet<>(bundleContext.getServiceReferences(Filter.class, null)); } catch (InvalidSyntaxException ise) { LOGGER.debug("Should never get this exception as there is no filter being passed."); } if (!CollectionUtils.isEmpty(sortedFilterServiceReferences)) { LOGGER.debug("Found filter(s), now filtering...", sortedFilterServiceReferences.size()); final ProxyFilterChain chain = new ProxyFilterChain(filterChain); for (ServiceReference<Filter> filterServiceReference : sortedFilterServiceReferences) { final Filter filter = bundleContext.getService(filterServiceReference); if (!hasBeenInitialized(filterServiceReference, bundleContext)) { initializeFilter(bundleContext, filterServiceReference, filter); } chain.addFilter(filter); } chain.doFilter(servletRequest, servletResponse); } else { LOGGER.debug("Did not find any Filters. Acting as a pass-through filter..."); filterChain.doFilter(servletRequest, servletResponse); } }

Target:
public void doFilter( ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { if (!filterList.isEmpty()) { ProxyFilterChain chain = new ProxyFilterChain(filterChain); for (Filter filter : filterList) { chain.addFilter(filter); } chain.doFilter(servletRequest, servletResponse); } else { LOGGER.debug("Did not find any Filters. Acting as a pass-through filter..."); filterChain.doFilter(servletRequest, servletResponse); } }
Source:
public void replicasOrderingTestOriginatingIsLocal() { initialize(); originatingDcName = localDcName; RouterConfig routerConfig = getRouterConfig(localDcName, "true", "3", "3", "false", "6"); OperationTracker ot = getOperationTracker(routerConfig.routerGetCrossDcEnabled, routerConfig.routerDeleteSuccessTarget, routerConfig.routerGetRequestParallelism, routerConfig.routerGetIncludeNonOriginatingDcReplicas, routerConfig.routerGetReplicasRequired); sendRequests(ot, 3, false); for (int i = 0; i < 3; i++) { ReplicaId replica = inflightReplicas.poll(); ot.onResponse(replica, true); assertEquals("Should be originating DC", originatingDcName, replica.getDataNodeId().getDatacenterName()); } assertEquals("Should have 0 replica in flight.", 0, inflightReplicas.size()); assertTrue("Operation should have succeeded", ot.hasSucceeded()); assertTrue("Operation should be done", ot.isDone()); }

Target:
public void replicasOrderingTestOriginatingIsLocal() { initialize(); originatingDcName = localDcName; OperationTracker ot = getOperationTracker(true, 3, 3, false, 6); sendRequests(ot, 3, false); for (int i = 0; i < 3; i++) { ReplicaId replica = inflightReplicas.poll(); ot.onResponse(replica, true); assertEquals("Should be originating DC", originatingDcName, replica.getDataNodeId().getDatacenterName()); } assertEquals("Should have 0 replica in flight.", 0, inflightReplicas.size()); assertTrue("Operation should have succeeded", ot.hasSucceeded()); assertTrue("Operation should be done", ot.isDone()); }
Source:
public void execute() { s_logger.info("VOLSS: createSnapshotCmd starts:" + System.currentTimeMillis()); CallContext.current().setEventDetails("Vm Snapshot Id: "+getVMSnapshotId()); Snapshot snapshot; try { snapshot = _snapshotService.backupSnapshotFromVmSnapshot(getEntityId(), getVmId(), getVMSnapshotId()); if (snapshot != null) { SnapshotResponse response = _responseGenerator.createSnapshotResponse(snapshot); response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create snapshot due to an internal error creating snapshot from vm snapshot " + getVMSnapshotId()); } } catch (Exception e) { s_logger.debug("Failed to create snapshot", e); throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create snapshot due to an internal error creating snapshot from vm snapshot " + getVMSnapshotId()); } }

Target:
public void execute() { s_logger.info("CreateSnapshotFromVMSnapshotCmd with vm snapshot id:" + getVMSnapshotId() + " and snapshot id:" + getEntityId() + " starts:" + System.currentTimeMillis()); CallContext.current().setEventDetails("Vm Snapshot Id: "+ getVMSnapshotId()); Snapshot snapshot = null; try { snapshot = _snapshotService.backupSnapshotFromVmSnapshot(getEntityId(), getVmId(), getVolumeId(), getVMSnapshotId()); if (snapshot != null) { SnapshotResponse response = _responseGenerator.createSnapshotResponse(snapshot); response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create snapshot due to an internal error creating snapshot from vm snapshot " + getVMSnapshotId()); } } catch (InvalidParameterValueException ex) { throw ex; } catch (Exception e) { s_logger.debug("Failed to create snapshot", e); throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create snapshot due to an internal error creating snapshot from vm snapshot " + getVMSnapshotId()); } finally { if (snapshot == null) { try { _snapshotService.deleteSnapshot(getEntityId()); } catch (Exception e) { s_logger.debug("Failed to clean failed snapshot" + getEntityId()); } } } }
Source:
public String fromBytes(byte[] bytes) { final Properties props = new Properties(); props.put("serializer.encoding", encoding); final VerifiableProperties verifiableProperties = new VerifiableProperties(props); return new kafka.serializer.StringDecoder(verifiableProperties).fromBytes(bytes); }

Target:
public String fromBytes(byte[] bytes) { return this.stringDecoder.fromBytes(bytes); }
Source:
public List<Context> getSelectedContexts() { TreePath[] paths = treeContext.getSelectionPaths(); if (paths == null || paths.length == 0) return null; SiteNode[] nodes = Arrays.stream(paths) .map(p -> (SiteNode) p.getLastPathComponent()) .toArray(SiteNode[]::new); if (nodes.length == 1 && nodes[0].isRoot()) return null; Stream<Target> targets = Arrays.stream(nodes).map(n -> (Target) n.getUserObject()); return targets == null ? null : Arrays.asList(targets.map(t -> t.getContext()).toArray(Context[]::new)); }

Target:
public List<Context> getSelectedContexts() { TreePath[] paths = treeContext.getSelectionPaths(); if (paths == null || paths.length == 0) return Collections.emptyList(); SiteNode[] nodes = Arrays.stream(paths) .map(p -> (SiteNode) p.getLastPathComponent()) .toArray(SiteNode[]::new); if (nodes.length == 1 && nodes[0].isRoot()) return Collections.emptyList(); Stream<Target> targets = Arrays.stream(nodes).map(n -> (Target) n.getUserObject()); return Arrays.asList(targets.map(Target::getContext).toArray(Context[]::new)); }
Source:
protected static Set<PersistentResource> filter(Class<? extends Annotation> permission, Set<PersistentResource> resources) { Set<PersistentResource> filteredSet = new LinkedHashSet<>(); for (PersistentResource resource : resources) { try { boolean skipNew = resource.getRequestScope().isMutatingMultipleEntities(); if (!skipNew || !resource.getRequestScope().getNewResources().contains(resource)) { resource.checkFieldAwarePermissions(permission); } filteredSet.add(resource); } catch (ForbiddenAccessException e) { } } if (resources instanceof SingleElementSet && resources.equals(filteredSet)) { return resources; } return filteredSet; }

Target:
protected static Set<PersistentResource> filter(Class<? extends Annotation> permission, Set<PersistentResource> resources) { Set<PersistentResource> filteredSet = new LinkedHashSet<>(); for (PersistentResource resource : resources) { try { boolean isMutation = resource.getRequestScope().isMutatingMultipleEntities(); if (!isMutation || !resource.getRequestScope().getNewResources().contains(resource)) { resource.checkFieldAwarePermissions(permission); } filteredSet.add(resource); } catch (ForbiddenAccessException e) { } } if (resources instanceof SingleElementSet && resources.equals(filteredSet)) { return resources; } return filteredSet; }
Source:
public CourseCategoryDAO findCourseCategory(final String id) { List<Object> results = getHibernateTemplate().executeFind(new HibernateCallback() { public Object doInHibernate(Session session) { Query query = session.createSQLQuery( "select * from course_category " + "where categoryId = :id").addEntity(CourseCategoryDAO.class); query.setString("id", id); return query.list(); } }); if (!results.isEmpty()) { return (CourseCategoryDAO)results.get(0); } return null; }

Target:
public CourseCategoryDAO findCourseCategory(final String id) { return (CourseCategoryDAO)getHibernateTemplate().execute(new HibernateCallback() { public CourseCategoryDAO doInHibernate(Session session) { return (CourseCategoryDAO)session.get(CourseCategoryDAO.class, id); } }); }
Source:
public void update(List<ICodeMining> minings, IProgressMonitor monitor) { disposeMinings(); minings.stream().forEach(m -> m.setProgressMonitor(monitor)); fMinings.addAll(minings); }

Target:
public void update(List<ICodeMining> minings, IProgressMonitor monitor) { disposeMinings(); fMonitor= monitor; fMinings.addAll(minings); }
Source:
public static Properties defaultProperties() { Properties properties = BaseHttpApiMetadata.defaultProperties(); properties.put(TEMPLATE, "osFamily=CENTOS,os64Bit=true,osVersionMatches=7.4,hardwareId=ecs.t5-lc2m1.nano,locationId=eu-central-1"); properties.put(TIMEOUT_NODE_RUNNING, 900000); properties.put(TIMEOUT_NODE_SUSPENDED, 900000); return properties; }

Target:
public static Properties defaultProperties() { Properties properties = BaseHttpApiMetadata.defaultProperties(); properties.put(TEMPLATE, "osFamily=CENTOS,os64Bit=true,osVersionMatches=7.4"); properties.put(TIMEOUT_NODE_RUNNING, 900000); properties.put(TIMEOUT_NODE_SUSPENDED, 900000); return properties; }
Source:
public void testDisorder(){ ByteToMessageDecoder decoder = new ByteToMessageDecoder() { int count = 0; @Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) { out.add(in.readBytes(1)); if (++count >= 4) { ctx.pipeline().remove(this); } } }; EmbeddedChannel channel = new EmbeddedChannel(decoder); assertTrue(channel.writeInbound(Unpooled.wrappedBuffer(new byte[]{1, 2, 3, 4, 5}))); assertEquals(1, ((ByteBuf) channel.readInbound()).readByte()); assertEquals(2, ((ByteBuf) channel.readInbound()).readByte()); assertEquals(3, ((ByteBuf) channel.readInbound()).readByte()); assertEquals(4, ((ByteBuf) channel.readInbound()).readByte()); assertEquals(5, ((ByteBuf) channel.readInbound()).readByte()); assertFalse(channel.finish()); }

Target:
public void testDisorder() { ByteToMessageDecoder decoder = new ByteToMessageDecoder() { int count; @Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) { out.add(in.readByte()); if (++count >= 4) { ctx.pipeline().remove(this); } } }; EmbeddedChannel channel = new EmbeddedChannel(decoder); assertTrue(channel.writeInbound(Unpooled.wrappedBuffer(new byte[]{1, 2, 3, 4, 5}))); assertEquals((byte) 1, channel.readInbound()); assertEquals((byte) 2, channel.readInbound()); assertEquals((byte) 3, channel.readInbound()); assertEquals((byte) 4, channel.readInbound()); ByteBuf buffer5 = channel.readInbound(); assertEquals((byte) 5, buffer5.readByte()); assertFalse(buffer5.isReadable()); assertTrue(buffer5.release()); assertFalse(channel.finish()); }
Source:
protected List<Property> getProperties() { Object[] allProperties = antPropertiesBlock.getProperties(); List<Property> properties = new ArrayList<>(allProperties.length); for (Object currproperty : allProperties) { Property property = (Property) currproperty; if (!property.isDefault()) { properties.add(property); } } return properties; }

Target:
protected List<Property> getProperties() { Object[] allProperties = antPropertiesBlock.getProperties(); List<Property> properties = new ArrayList<>(allProperties.length); for (Object prop : allProperties) { Property property = (Property) prop; if (!property.isDefault()) { properties.add(property); } } return properties; }
Source:
public static String setupBucketsPath(final ConfigContext config, final String testName) { String testPathPrefix = String.format("%s/buckets/%s", config.getMantaHomeDirectory(), testName + UUID.randomUUID()); return testPathPrefix + MantaClient.SEPARATOR; }

Target:
private static String setupBucketsPath(final ConfigContext config, final String testName) { String bucketPathPrefix = String.format("%s%sbuckets%s%s", config.getMantaHomeDirectory(), MantaClient.SEPARATOR, MantaClient.SEPARATOR, testName.toLowerCase() + UUID.randomUUID()); return bucketPathPrefix + MantaClient.SEPARATOR + "objects" + MantaClient.SEPARATOR; }