auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void rebuildMetadata(final Map<HostInfo, Set<TopicPartition>> activePartitionHostMap, final Map<HostInfo, Set<TopicPartition>> standbyPartitionHostMap) { allMetadata.clear(); if (activePartitionHostMap.isEmpty() && standbyPartitionHostMap.isEmpty()) { return; } final Map<String, List<String>> storeToSourceTopics = builder.stateStoreNameToSourceTopics(); Stream.concat(activePartitionHostMap.keySet().stream(), standbyPartitionHostMap.keySet().stream()) .distinct() .forEach(key -> { final Set<TopicPartition> activePartitionsOnHost = new HashSet<>(); final Set<String> activeStoresOnHost = new HashSet<>(); if (activePartitionHostMap.containsKey(key)) { activePartitionsOnHost.addAll(activePartitionHostMap.get(key)); activeStoresOnHost.addAll(getStoresOnHost(storeToSourceTopics, activePartitionsOnHost)); } activeStoresOnHost.addAll(globalStores); final Set<TopicPartition> standbyPartitionsOnHost = new HashSet<>(); final Set<String> standbyStoresOnHost = new HashSet<>(); if (standbyPartitionHostMap.containsKey(key)) { standbyPartitionsOnHost.addAll(standbyPartitionHostMap.get(key)); standbyStoresOnHost.addAll(getStoresOnHost(storeToSourceTopics, standbyPartitionsOnHost)); } final StreamsMetadata metadata = new StreamsMetadata(key, activeStoresOnHost, activePartitionsOnHost, standbyStoresOnHost, standbyPartitionsOnHost); allMetadata.add(metadata); if (key.equals(thisHost)) { myMetadata = metadata; } }); }

Target:
private void rebuildMetadata(final Map<HostInfo, Set<TopicPartition>> activePartitionHostMap, final Map<HostInfo, Set<TopicPartition>> standbyPartitionHostMap) { allMetadata.clear(); if (activePartitionHostMap.isEmpty() && standbyPartitionHostMap.isEmpty()) { return; } final Map<String, List<String>> storeToSourceTopics = builder.stateStoreNameToSourceTopics(); Stream.concat(activePartitionHostMap.keySet().stream(), standbyPartitionHostMap.keySet().stream()) .distinct() .forEach(hostInfo -> { final Set<TopicPartition> activePartitionsOnHost = new HashSet<>(); final Set<String> activeStoresOnHost = new HashSet<>(); if (activePartitionHostMap.containsKey(hostInfo)) { activePartitionsOnHost.addAll(activePartitionHostMap.get(hostInfo)); activeStoresOnHost.addAll(getStoresOnHost(storeToSourceTopics, activePartitionsOnHost)); } activeStoresOnHost.addAll(globalStores); final Set<TopicPartition> standbyPartitionsOnHost = new HashSet<>(); final Set<String> standbyStoresOnHost = new HashSet<>(); if (standbyPartitionHostMap.containsKey(hostInfo)) { standbyPartitionsOnHost.addAll(standbyPartitionHostMap.get(hostInfo)); standbyStoresOnHost.addAll(getStoresOnHost(storeToSourceTopics, standbyPartitionsOnHost)); } final StreamsMetadata metadata = new StreamsMetadata(hostInfo, activeStoresOnHost, activePartitionsOnHost, standbyStoresOnHost, standbyPartitionsOnHost); allMetadata.add(metadata); if (hostInfo.equals(thisHost)) { localMetadata = metadata; } }); }
Source:
public Map<String, TransportConfiguration> getConnectors() { return Collections.unmodifiableMap(connectors); }

Target:
public Map<String, TransportConfiguration> getConnectors() { return connectors; }
Source:
for (RelDataType operandType: operandTypes) { int operandPrecision = operandType.getPrecision(); amount = (long) operandPrecision + amount; if (!hasPrecisionNotSpecifiedOperand && operandPrecision == RelDataType.PRECISION_NOT_SPECIFIED) { hasPrecisionNotSpecifiedOperand = true; } }

Target:
for (RelDataType operandType: operandTypes) { int operandPrecision = operandType.getPrecision(); amount = (long) operandPrecision + amount; if (operandPrecision == RelDataType.PRECISION_NOT_SPECIFIED) { hasPrecisionNotSpecifiedOperand = true; break; } if (amount > typeSystem.getMaxPrecision(SqlTypeName.VARCHAR)) { precisionOverflow = true; break; } }
Source:
public String getAppiumServerPort(String host) throws Exception { JSONArray hostMachineObject = CapabilityManager.getInstance().getHostMachineObject(); List<Object> objects = hostMachineObject.toList(); Object o = objects.stream().filter(object -> ((HashMap) object).get("machineIP") .toString().equalsIgnoreCase(host) && ((HashMap) object).get("port") != null) .findFirst().orElse(null); if (o != null) { return ((HashMap) o).get("port").toString(); } return null; }

Target:
public String getAppiumServerPort(String host) throws Exception { return appiumServerProp(host,"appiumPort"); }
Source:
protected void processFiltered(File file, FileText fileText) { if (getHeaderLines().size() > fileText.getLines().size()) { log(1, MSG_MISSING); } else { for (int i = 0; i < getHeaderLines().size(); i++) { if (!isMatch(i, fileText.getLines().get(i))) { log(i + 1, MSG_MISMATCH, getHeaderLines().get(i)); break; } } } }

Target:
protected void processFiltered(File file, FileText fileText) { final List<String> lines = fileText.getLines(); if (getHeaderLines().size() > lines.size()) { log(1, MSG_MISSING); } else { for (int i = 0; i < getHeaderLines().size(); i++) { if (!isMatch(i, lines.get(i))) { log(i + 1, MSG_MISMATCH, getHeaderLines().get(i)); break; } } } }
Source:
public IFluidTankProperties[] getTankProperties() { if(parent.get() != null) { IFluidTankProperties[] iFluidTankPropertiesArray = parent.get().getTankProperties(); if(iFluidTankPropertiesArray.length > 0) { IFluidTankProperties fluidTankProperties = parent.get().getTankProperties()[0]; return new IFluidTankProperties[]{new FluidTankProperties(fluidTankProperties.getContents(), fluidTankProperties.getCapacity(), true, false)}; } } return EmptyFluidHandler.EMPTY_TANK_PROPERTIES_ARRAY; }

Target:
public IFluidTankProperties[] getTankProperties() { if(hasParent()) { IFluidTankProperties[] iFluidTankPropertiesArray = parent.get().getTankProperties(); if(iFluidTankPropertiesArray.length > 0) { IFluidTankProperties fluidTankProperties = parent.get().getTankProperties()[0]; return new IFluidTankProperties[]{new FluidTankProperties(fluidTankProperties.getContents(), fluidTankProperties.getCapacity(), true, false)}; } } return EmptyFluidHandler.EMPTY_TANK_PROPERTIES_ARRAY; }
Source:
public ParametersBuilder add(int hour, int minute, int second, int nanosecond, String offset, ZoneId defaultTimeZone) { if ( isNanosecondPrecisionSupported() ) { nanosecond = 0; } return add( defaultTimeZone, hour, minute, second, nanosecond, offset, 1970, 1, 1 ); }

Target:
public ParametersBuilder add(int hour, int minute, int second, int nanosecond, String offset, ZoneId defaultTimeZone) { if ( !isNanosecondPrecisionSupported() ) { nanosecond = 0; } return add( defaultTimeZone, hour, minute, second, nanosecond, offset, 1970, 1, 1 ); }
Source:
public static String getQName(PsiElement[] fileChildren, final String result, boolean searchInSamePackage) { final HaxeClass classForType = (HaxeClass)Arrays.stream(fileChildren) .filter(child -> child instanceof HaxeClass && result.equals(((HaxeClass)child).getName())) .findFirst() .orElse(null); if (classForType != null) { return classForType.getQualifiedName(); } final HaxeImportStatement importStatement = (HaxeImportStatement)(StreamUtil.reverse(Arrays.stream(fileChildren)) .filter(element -> element instanceof HaxeImportStatement && ((HaxeImportStatement)element).getModel().exposeByName(result) != null) .findFirst() .orElse(null)); final HaxeExpression importStatementExpression = importStatement == null ? null : importStatement.getReferenceExpression(); if (importStatement != null && importStatementExpression != null) { return importStatementExpression.getText(); } if (searchInSamePackage && fileChildren.length > 0) { final HaxeFileModel fileModel = HaxeFileModel.fromElement(fileChildren[0]); if (fileModel != null) { final HaxePackageModel packageModel = fileModel.getPackageModel(); if (packageModel != null) { final HaxeClassModel classModel = packageModel.getClassModel(result); if (classModel != null) { return classModel.haxeClass.getQualifiedName(); } } } } return result; }

Target:
public static String getQName(PsiElement[] fileChildren, final String result, boolean searchInSamePackage) { final HaxeClass classForType = (HaxeClass)Arrays.stream(fileChildren) .filter(child -> child instanceof HaxeClass && result.equals(((HaxeClass)child).getName())) .findFirst() .orElse(null); if (classForType != null) { return classForType.getQualifiedName(); } final HaxeImportStatement importStatement = (HaxeImportStatement)(StreamUtil.reverse(Arrays.stream(fileChildren)) .filter(element -> element instanceof HaxeImportStatement && ((HaxeImportStatement)element).getModel().exposeByName(result) != null) .findFirst() .orElse(null)); final HaxeExpression importStatementExpression = importStatement == null ? null : importStatement.getReferenceExpression(); if (importStatementExpression != null) { return importStatementExpression.getText(); } if (searchInSamePackage && fileChildren.length > 0) { final HaxeFileModel fileModel = HaxeFileModel.fromElement(fileChildren[0]); if (fileModel != null) { final HaxePackageModel packageModel = fileModel.getPackageModel(); if (packageModel != null) { final HaxeClassModel classModel = packageModel.getClassModel(result); if (classModel != null) { return classModel.haxeClass.getQualifiedName(); } } } } return result; }
Source:
public List<String> requiredFields() { return makeFieldNamesFromFields(fields); }

Target:
public List<String> requiredFields() { return makeRequiredFieldNamesFromFields(fields); }
Source:
public synchronized static WebDriver getDriver() { if (driver == null) { try { driver = initiateDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); } finally { Runtime.getRuntime().addShutdownHook( new Thread(new BrowserCleanup())); } } return driver; }

Target:
public synchronized static WebDriver getDriver() { if (driver == null) { try { driver = initiateDriver(); } finally { Runtime.getRuntime().addShutdownHook( new Thread(new BrowserCleanup())); } } return driver; }
Source:
public void run() { Object selection = getStructuredSelection().getFirstElement(); if (selection instanceof IBuild) { IBuild build = (IBuild) selection; if (editor != null) { abortBuild(build, editor); } else { abortBuild(build); } } else if (selection instanceof IBuildPlan) { IBuildPlan buildPlan = (IBuildPlan) selection; abortBuild(buildPlan.getLastBuild()); } }

Target:
public void run() { Object selection = getStructuredSelection().getFirstElement(); if (selection instanceof IBuild) { IBuild build = (IBuild) selection; abortBuild(build); } else if (selection instanceof IBuildPlan) { IBuildPlan buildPlan = (IBuildPlan) selection; abortBuild(buildPlan.getLastBuild()); } }
Source:
private SupportedTypeResourceDefinition(SimpleAttributeDefinition... attributes) { super(ModelElement.SUPPORTED_TYPE, new IDMConfigAddStepHandler( getModelValidators(), attributes), null, attributes); }

Target:
private SupportedTypeResourceDefinition(SimpleAttributeDefinition... attributes) { super(ModelElement.SUPPORTED_TYPE, new IDMConfigAddStepHandler( getModelValidators(), attributes), attributes); }
Source:
private static KeyStore getKeyStore(String keyStoreName, String password) throws IOException { KeyStore ks = null; FileInputStream fis = null; try { ks = KeyStore.getInstance("JKS"); char[] passwordArray = password.toCharArray(); fis = new java.io.FileInputStream(keyStoreName); ks.load(fis, passwordArray); fis.close(); } catch (Exception e) { e.printStackTrace(); } finally { if (fis != null) { fis.close(); } } return ks; }

Target:
private KeyStore getKeyStore(String keyStoreName, String password) throws IOException { KeyStore ks = null; FileInputStream fis = null; try { ks = KeyStore.getInstance("JKS"); char[] passwordArray = password.toCharArray(); fis = new java.io.FileInputStream(keyStoreName); ks.load(fis, passwordArray); } catch (Exception e) { this.logger.severe( e.getMessage() ); } finally { if (fis != null) { Utils.closeQuietly( fis ); } } return ks; }
Source:
public static @Nullable TmfEventsTable getEventTable(ITmfTrace trace, Composite parent, int cacheSize) { final String traceType = getTraceType(trace); if (traceType == null) { return null; } TraceElementType elType = (trace instanceof TmfExperiment) ? TraceElementType.EXPERIMENT : TraceElementType.TRACE; for (final IConfigurationElement ce : TmfTraceTypeUIUtils.getTypeUIElements(elType)) { if (ce.getAttribute(TmfTraceTypeUIUtils.TRACETYPE_ATTR).equals(traceType)) { final IConfigurationElement[] eventsTableTypeCE = ce.getChildren(TmfTraceTypeUIUtils.EVENTS_TABLE_TYPE_ELEM); if (eventsTableTypeCE.length != 1) { break; } final String eventsTableType = eventsTableTypeCE[0].getAttribute(TmfTraceTypeUIUtils.CLASS_ATTR); if (eventsTableType.isEmpty()) { break; } try { final Bundle bundle = Platform.getBundle(ce.getContributor().getName()); final Class<?> c = bundle.loadClass(eventsTableType); final Class<?>[] constructorArgs = new Class[] { Composite.class, int.class , Iterable.class}; final Constructor<?> constructor = c.getConstructor(constructorArgs); final Object[] args = new Object[] { parent, cacheSize, trace.getEventAspects() }; return (TmfEventsTable) constructor.newInstance(args); } catch (NoSuchMethodException | ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { return null; } } } return null; }

Target:
public static @Nullable TmfEventsTable getEventTable(ITmfTrace trace, Composite parent, int cacheSize) { final String traceType = getTraceType(trace); if (traceType == null) { return null; } TraceElementType elType = (trace instanceof TmfExperiment) ? TraceElementType.EXPERIMENT : TraceElementType.TRACE; for (final IConfigurationElement ce : TmfTraceTypeUIUtils.getTypeUIElements(elType)) { if (ce.getAttribute(TmfTraceTypeUIUtils.TRACETYPE_ATTR).equals(traceType)) { final IConfigurationElement[] eventsTableTypeCE = ce.getChildren(TmfTraceTypeUIUtils.EVENTS_TABLE_TYPE_ELEM); if (eventsTableTypeCE.length != 1) { break; } final String eventsTableType = eventsTableTypeCE[0].getAttribute(TmfTraceTypeUIUtils.CLASS_ATTR); final boolean useTraceAspects = Boolean.parseBoolean(eventsTableTypeCE[0].getAttribute(TmfTraceTypeUIUtils.USE_TRACE_ASPECTS_ATTR)); if ((eventsTableType == null) || eventsTableType.isEmpty()) { break; } try { final Bundle bundle = Platform.getBundle(ce.getContributor().getName()); final Class<?> c = bundle.loadClass(eventsTableType); Class<?>[] constructorArgs = null; Object[] args = null; if (useTraceAspects) { args = new Object[] { parent, cacheSize, trace.getEventAspects() }; constructorArgs = new Class[] { Composite.class, int.class, Iterable.class }; } else { args = new Object[] { parent, cacheSize }; constructorArgs = new Class[] { Composite.class, int.class }; } final Constructor<?> constructor = c.getConstructor(constructorArgs); return (TmfEventsTable) constructor.newInstance(args); } catch (NoSuchMethodException | ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { return null; } } } return null; }
Source:
public User createUser(String email, String password, Map<String, ? extends Object> parameters) { ImmutableMap<String, ?extends Object> reqParams = ImmutableMap.of("email", email, "password", password); ImmutableMap<String, Object> allParams = new ImmutableMap.Builder<String, Object>() .putAll(reqParams) .putAll(parameters) .build(); User user = createModel(allParams); return user; }

Target:
public User createUser(String email, String password, Map<String, ? extends Object> parameters) { HashMap<String, Object> allParams = new HashMap<String, Object>(); allParams.putAll(parameters); allParams.put("email", email); allParams.put("password", password); User user = createModel(allParams); return user; }
Source:
public void onSuccessPartialConfig(ConfigRepoConfig repoConfig, PartialConfig incoming) { final String fingerprint = repoConfig.getRepo().getFingerprint(); if (this.configWatchList.hasConfigRepoWithFingerprint(fingerprint)) { if (shouldMergePartial(incoming, fingerprint, repoConfig)) { cachedGoPartials.cacheAsLastKnown(fingerprint, incoming); hasRuleViolations(incoming); final boolean isConfigUpdated = updateConfig(incoming, fingerprint, repoConfig); if (isConfigUpdated) { cachedGoPartials.markAsValid(fingerprint, incoming); } else { final PartialConfig previousValidPartial = cachedGoPartials.getValid(repoConfig.getRepo().getFingerprint()); if (previousValidPartial != null) { final boolean isSameRevisionAsOfPreviousValidPartial = ((RepoConfigOrigin) incoming.getOrigin()).getRevision().equals(((RepoConfigOrigin) previousValidPartial.getOrigin()).getRevision()); if (isSameRevisionAsOfPreviousValidPartial) { removeCachedPartialsAndUpdateConfig(fingerprint); } else { ((RepoConfigOrigin) previousValidPartial.getOrigin()).setConfigRepo(((RepoConfigOrigin) incoming.getOrigin()).getConfigRepo()); if (hasRuleViolations(previousValidPartial)) { removeCachedPartialsAndUpdateConfig(fingerprint); } } } } } } }

Target:
public void onSuccessPartialConfig(ConfigRepoConfig repoConfig, PartialConfig incoming) { final String fingerprint = repoConfig.getRepo().getFingerprint(); if (this.configWatchList.hasConfigRepoWithFingerprint(fingerprint)) { if (shouldMergePartial(incoming, fingerprint, repoConfig)) { cachedGoPartials.cacheAsLastKnown(fingerprint, incoming); hasRuleViolations(incoming); if (updateConfig(incoming, fingerprint, repoConfig)) { cachedGoPartials.markAsValid(fingerprint, incoming); } else { if (hasRuleViolationsOnPreviousValidPartial(repoConfig)) { removeCachedLastValidPartial(fingerprint); } } } } }
Source:
public double firstDerivative(Interpolator1DDataBundle data, double value) { int lowerIndex = data.getLowerBoundIndex(value); if (lowerIndex == data.size() - 1) { if (data.size() == 1) { return 0d; } if (value > data.lastKey()) { throw new MathException("Value of " + value + " after last key. Use extrapolator"); } lowerIndex--; } double x1 = data.getKey(lowerIndex); double y1 = data.getValue(lowerIndex); double x2 = data.getKey(lowerIndex + 1); double y2 = data.getValue(lowerIndex + 1); return (y2 - y1) / (x2 - x1); }

Target:
public double firstDerivative(Interpolator1DDataBundle data, double value) { int lowerIndex = data.getLowerBoundIndex(value); if (lowerIndex == data.size() - 1) { if (value > data.lastKey()) { return 0d; } lowerIndex--; } double x1 = data.getKey(lowerIndex); double y1 = data.getValue(lowerIndex); double x2 = data.getKey(lowerIndex + 1); double y2 = data.getValue(lowerIndex + 1); return (y2 - y1) / (x2 - x1); }
Source:
public void call(final Subscriber<? super T> subscriber) { try { final Resource resource = resourceFactory.call(); final DisposeAction<Resource> disposeOnceOnly = new DisposeAction<Resource>(dispose, resource); subscriber.add(disposeOnceOnly); final Observable<? extends T> source; try { source = observableFactory .call(resource); } catch (Throwable e) { Throwable disposeError = dispose(disposeOnceOnly); Exceptions.throwIfFatal(e); Exceptions.throwIfFatal(disposeError); if (disposeError != null) { subscriber.onError(new CompositeException(Arrays.asList(e, disposeError))); } else { subscriber.onError(e); } return; } final Observable<? extends T> observable; if (disposeEagerly) { observable = source .doOnTerminate(disposeOnceOnly); } else { observable = source .doAfterTerminate(disposeOnceOnly) ; } try { observable.unsafeSubscribe(Subscribers.wrap(subscriber)); } catch (Throwable e) { Throwable disposeError = dispose(disposeOnceOnly); Exceptions.throwIfFatal(e); Exceptions.throwIfFatal(disposeError); if (disposeError != null) subscriber.onError(new CompositeException(Arrays.asList(e, disposeError))); else subscriber.onError(e); } } catch (Throwable e) { Exceptions.throwOrReport(e, subscriber); } }

Target:
public void call(final Subscriber<? super T> subscriber) { try { final Resource resource = resourceFactory.call(); final DisposeAction<Resource> disposeOnceOnly = new DisposeAction<Resource>(dispose, resource); subscriber.add(disposeOnceOnly); final Observable<? extends T> source; try { source = observableFactory .call(resource); } catch (Throwable e) { Throwable disposeError = dispose(disposeOnceOnly); Exceptions.throwIfFatal(e); Exceptions.throwIfFatal(disposeError); if (disposeError != null) { subscriber.onError(new CompositeException(e, disposeError)); } else { subscriber.onError(e); } return; } final Observable<? extends T> observable; if (disposeEagerly) { observable = source .doOnTerminate(disposeOnceOnly); } else { observable = source .doAfterTerminate(disposeOnceOnly); } try { observable.unsafeSubscribe(Subscribers.wrap(subscriber)); } catch (Throwable e) { Throwable disposeError = dispose(disposeOnceOnly); Exceptions.throwIfFatal(e); Exceptions.throwIfFatal(disposeError); if (disposeError != null) subscriber.onError(new CompositeException(e, disposeError)); else subscriber.onError(e); } } catch (Throwable e) { Exceptions.throwOrReport(e, subscriber); } }
Source:
private void finishedGeotagging(Intent intent) { boolean success = intent.getBooleanExtra(GeoTagImagesService.EXTRA_SUCCESS, false); if (success) { ArrayList<File> files = (ArrayList<File>) intent.getSerializableExtra(GeoTagImagesService.EXTRA_GEOTAGGED_FILES); activity.finishedGeotagging(files); } else { String failure = intent.getStringExtra(GeoTagImagesService.EXTRA_FAILURE_MESSAGE); failedLoading(failure); } }

Target:
private void finishedGeotagging(Intent intent) { boolean success = intent.getBooleanExtra(GeoTagImagesService.EXTRA_SUCCESS, false); if (success) { if (activity != null) { ArrayList<File> files = (ArrayList<File>) intent.getSerializableExtra(GeoTagImagesService.EXTRA_GEOTAGGED_FILES); activity.finishedGeotagging(files); } } else { String failure = intent.getStringExtra(GeoTagImagesService.EXTRA_FAILURE_MESSAGE); failedLoading(failure); } }
Source:
public static MemoryRealm constructRealm(JaxRsApplication application, ConfManager configManager){ MemoryRealm realm = new MemoryRealm(); MapVerifier mapVerifier = new MapVerifier(); String[] users = configManager.get(ConfigResource.DEFAULT).getTrimmedStrings("restapi.auth.users", "admin|admin|admin"); if (users.length <= 1) { throw new IllegalStateException("Check users definition of restapi.auth.users at nutch-site.xml "); } for (String userconf : users) { String[] userDetail = userconf.split("\\|"); if(userDetail.length != 3) { LOG.error("Check user definition of restapi.auth.users at nutch-site.xml"); throw new IllegalStateException("Check user definition of restapi.auth.users at nutch-site.xml "); } User user = new User(userDetail[0], userDetail[1]); mapVerifier.getLocalSecrets().put(user.getIdentifier(), user.getSecret()); realm.getUsers().add(user); realm.map(user, Role.get(application, userDetail[2])); LOG.info("User added: " + userDetail[0]); } realm.setVerifier(mapVerifier); return realm; }

Target:
public static MemoryRealm constructRealm(JaxRsApplication application, ConfManager configManager){ MemoryRealm realm = new MemoryRealm(); MapVerifier mapVerifier = new MapVerifier(); String[] users = configManager.get(ConfigResource.DEFAULT).getTrimmedStrings("restapi.auth.users", "admin|admin|admin,user|user|user"); if (users.length <= 1) { throw new IllegalStateException("Check users definition of restapi.auth.users at nutch-site.xml "); } for (String userconf : users) { String[] userDetail = userconf.split("\\|"); if(userDetail.length != 3) { LOG.error("Check user definition of restapi.auth.users at nutch-site.xml"); throw new IllegalStateException("Check user definition of restapi.auth.users at nutch-site.xml "); } User user = new User(userDetail[0], userDetail[1]); mapVerifier.getLocalSecrets().put(user.getIdentifier(), user.getSecret()); realm.getUsers().add(user); realm.map(user, Role.get(application, userDetail[2])); LOG.info("User added: {}", userDetail[0]); } realm.setVerifier(mapVerifier); return realm; }
Source:
public int size() { authzManager.checkPermission(CachePermission.ADMIN); return delegate.size(); }

Target:
public int size() { authzManager.checkPermission(AuthorizationPermission.BULK_READ); return delegate.size(); }
Source:
public void canIgnoreInvocationsWithJunit() throws InterruptedException { DelayedExecution delayedExecution = new DelayedExecution(executor, mock, 0); delayedExecution.recordAsyncCall('0'); delayedExecution.recordAsyncCall('1'); delayedExecution.recordAsyncCall('2'); delayedExecution.allAsyncCallsStarted(); verify(mock, timeout(50)).oneArg('0'); verify(mock, timeout(50)).oneArg('1'); verify(mock, timeout(50)).oneArg('2'); }

Target:
public void canIgnoreInvocationsWithJunit() throws InterruptedException { DelayedExecution delayedExecution = createZeroMillisDelayedExecution(); DelayedExecution twentyMillisDelayedExecution = createTwentyMillisDelayedExecution(); delayedExecution.allAsyncCallsStarted(); verify(mock, timeout(50)).oneArg('1'); twentyMillisDelayedExecution.allAsyncCallsStarted(); verify(mock, timeout(50)).oneArg('2'); }
Source:
private void buildReferences(BundleDescription description, List<Object[]> references) { HostSpecification host = description.getHost(); if (host != null) { if (host.getHosts() != null) { BundleDescription[] hosts = host.getHosts(); for (BundleDescription host1 : hosts) { if (host1 != description) { references.add(new Object[]{description, host1}); } } } GenericDescription[] genericDependencies = description.getResolvedGenericRequires(); for (GenericDescription dependency : genericDependencies) { if (ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE.equals(dependency.getType())) { references.add(new Object[] {description, dependency.getSupplier()}); } } } else { buildReferences(description, ((BundleDescriptionImpl) description).getBundleDependencies(), references); } }

Target:
private void buildReferences(BundleDescription description, List<Object[]> references) { HostSpecification hostSpecification = description.getHost(); if (hostSpecification != null) { if (hostSpecification.getHosts() != null) { BundleDescription[] hosts = hostSpecification.getHosts(); for (BundleDescription host : hosts) { if (host != description) { references.add(new Object[]{description, host}); } } } GenericDescription[] genericDependencies = description.getResolvedGenericRequires(); for (GenericDescription dependency : genericDependencies) { if (ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE.equals(dependency.getType())) { references.add(new Object[] {description, dependency.getSupplier()}); } } } else { buildReferences(description, ((BundleDescriptionImpl) description).getBundleDependencies(), references); } }
Source:
private boolean passesFilteringByParameter(final AbstractBuild<?, ?> build, final String parameterName, final String parameterValue){ if (parameterName == null){ return true; } Map<String, String> vars = build.getBuildVariables(); if(vars.containsKey(parameterName)){ if (vars.get(parameterName).equals(parameterValue)) { return true; } } return false; }

Target:
private boolean passesFilteringByParameter(final AbstractBuild<?, ?> build, final String parameterName, final String parameterValue) { if (parameterName == null){ return true; } Map<String, String> vars = build.getBuildVariables(); if (vars == null) { return false; } if(vars.containsKey(parameterName)) { String pv = vars.get(parameterName); if (pv != null && pv.equals(parameterValue)) { return true; } } return false; }
Source:
private boolean verifySharingPermissions(String user, Path path) { FileSystem peergosFileSystem = fileSystems.getTestFileSystem(user); FileSystem nativeFileSystem = fileSystems.getReferenceFileSystem(user); boolean isVerified = true; for (FileSystem.Permission permission : FileSystem.Permission.values()) { Set<String> shareesInPeergos = new HashSet<>(peergosFileSystem.getSharees(path, permission)); Set<String> shareesInLocal = new HashSet<>(nativeFileSystem.getSharees(path, permission)); if (! shareesInPeergos.equals(shareesInLocal)) { LOG.info("User " + peergosFileSystem.user() + " path " + path + " has peergos-fs " + permission.name() + "ers " + shareesInPeergos + " and local-fs " + permission.name() + "ers " + shareesInLocal); isVerified = false; } } return isVerified; }

Target:
private boolean verifySharingPermissions(String user, Path path) { FileSystem peergosFileSystem = fileSystems.getTestFileSystem(user); FileSystem nativeFileSystem = fileSystems.getReferenceFileSystem(user); boolean isVerified = true; for (FileSystem.Permission permission : FileSystem.Permission.values()) { Set<String> shareesInPeergos = new HashSet<>(peergosFileSystem.getSharees(path, permission)); Set<String> shareesInLocal = new HashSet<>(nativeFileSystem.getSharees(path, permission)); if (! shareesInPeergos.equals(shareesInLocal)) { LOG.info("User " + peergosFileSystem.user() + " path " + path + " has peergos-fs " + permission.name() + "ers " + shareesInPeergos + " and local-fs " + permission.name() + "ers " + shareesInLocal); isVerified = false; } for (String sharee : shareesInPeergos) { byte[] read = null; PeergosFileSystemImpl fs = fileSystems.getTestFileSystem(sharee); switch (permission) { case READ: try { read = fs.read(path); } catch (Exception ex) { LOG.log(Level.WARNING, "User "+ sharee +" could not read shared-path "+ path +"!", ex); isVerified = false; } case WRITE: try { fs.write(path, new byte[]{0}); } catch (Exception ex) { LOG.log(Level.WARNING, "User "+ sharee +" could not write shared-path "+ path +"!", ex); } default: throw new IllegalStateException(); } } } return isVerified; }
Source:
private static void checkFStringLiteral(SubscriptionContext ctx) { StringLiteral literal = (StringLiteral) ctx.syntaxNode(); if (TreeUtils.firstAncestorOfKind(literal, Tree.Kind.PLUS) != null) { return; } List<StringElement> fStrings = literal.stringElements().stream() .filter(stringElement -> stringElement.prefix().toLowerCase(Locale.ENGLISH).contains("f")) .collect(Collectors.toList()); if (!fStrings.isEmpty() && fStrings.stream().allMatch(str -> str.formattedExpressions().isEmpty())) { ctx.addIssue(literal, "Add replacement fields or use a normal string instead of an f-string."); } }

Target:
private static void checkFStringLiteral(SubscriptionContext ctx) { StringLiteral literal = (StringLiteral) ctx.syntaxNode(); if (literal.parent().is(Tree.Kind.PLUS)) { return; } List<StringElement> fStrings = literal.stringElements().stream() .filter(stringElement -> stringElement.prefix().toLowerCase(Locale.ENGLISH).contains("f")) .collect(Collectors.toList()); if (!fStrings.isEmpty() && fStrings.stream().allMatch(str -> str.formattedExpressions().isEmpty())) { ctx.addIssue(literal, "Add replacement fields or use a normal string instead of an f-string."); } }
Source:
public CompletableFuture<StaticResource> getResource(String name) { StaticResource template = templates.get(name); if (template != null) { return CompletableFuture.completedFuture(template); } return delegate .getResource(name) .exceptionally((th) -> { templates.putIfAbsent(name, null); return null; } ) .thenApply( (file) -> { templates.putIfAbsent(name, file); return file; }); }

Target:
public CompletableFuture<Optional<StaticResource>> getResource(String name) { Optional<StaticResource> template = templates.get(name); if (template != null) { return CompletableFuture.completedFuture(template); } return delegate .getResource(name) .exceptionally((th) -> { return Optional.empty(); } ) .thenApply( (file) -> { templates.put(name, file); return file; }); }
Source:
public void handleMessage(Message msg) { switch(msg.what) { case EVENT_RADIO_TECHNOLOGY_CHANGED: mOutgoingPhone = ((PhoneBase)mActivePhone).getPhoneName(); Log.d(LOG_TAG, "Switching phone from " + mOutgoingPhone + "Phone to " + (mOutgoingPhone.equals("GSM") ? "CDMAPhone" : "GSMPhone") ); if(mOutgoingPhone.equals("GSM")) { PhoneProxy.setRadioTechnologyChangeGsmToCdma(true); Log.d(LOG_TAG, "Make a new CDMAPhone and destroy the old GSMPhone."); ((GSMPhone)mActivePhone).dispose(); mActivePhone = null; System.gc(); mActivePhone = PhoneFactory.getCdmaPhone(); } else { PhoneProxy.setRadioTechnologyChangeCdmaToGsm(true); Log.d(LOG_TAG, "Make a new GSMPhone and destroy the old CDMAPhone."); ((CDMAPhone)mActivePhone).dispose(); mActivePhone = null; System.gc(); mActivePhone = PhoneFactory.getGsmPhone(); } mIccSmsInterfaceManagerProxy.setmIccSmsInterfaceManager( mActivePhone.getIccSmsInterfaceManager()); mIccPhoneBookInterfaceManagerProxy.setmIccPhoneBookInterfaceManager( mActivePhone.getIccPhoneBookInterfaceManager()); mPhoneSubInfoProxy.setmPhoneSubInfo(this.mActivePhone.getPhoneSubInfo()); mCommandsInterface = ((PhoneBase)mActivePhone).mCM; System.gc(); Intent intent = new Intent(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED); intent.putExtra(Phone.PHONE_NAME_KEY, mActivePhone.getPhoneName()); ActivityManagerNative.broadcastStickyIntent(intent, null); break; default: Log.e(LOG_TAG, "Error! This handler was not registered for this message type. Message: " + msg.what); break; } super.handleMessage(msg); }

Target:
public void handleMessage(Message msg) { switch(msg.what) { case EVENT_RADIO_TECHNOLOGY_CHANGED: mOutgoingPhone = ((PhoneBase)mActivePhone).getPhoneName(); Log.d(LOG_TAG, "Switching phone from " + mOutgoingPhone + "Phone to " + (mOutgoingPhone.equals("GSM") ? "CDMAPhone" : "GSMPhone") ); if(mOutgoingPhone.equals("GSM")) { Log.d(LOG_TAG, "Make a new CDMAPhone and destroy the old GSMPhone."); ((GSMPhone)mActivePhone).dispose(); mActivePhone = null; System.gc(); mActivePhone = PhoneFactory.getCdmaPhone(); } else { Log.d(LOG_TAG, "Make a new GSMPhone and destroy the old CDMAPhone."); ((CDMAPhone)mActivePhone).dispose(); mActivePhone = null; System.gc(); mActivePhone = PhoneFactory.getGsmPhone(); } mIccSmsInterfaceManagerProxy.setmIccSmsInterfaceManager( mActivePhone.getIccSmsInterfaceManager()); mIccPhoneBookInterfaceManagerProxy.setmIccPhoneBookInterfaceManager( mActivePhone.getIccPhoneBookInterfaceManager()); mPhoneSubInfoProxy.setmPhoneSubInfo(this.mActivePhone.getPhoneSubInfo()); mCommandsInterface = ((PhoneBase)mActivePhone).mCM; System.gc(); Intent intent = new Intent(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED); intent.putExtra(Phone.PHONE_NAME_KEY, mActivePhone.getPhoneName()); ActivityManagerNative.broadcastStickyIntent(intent, null); break; default: Log.e(LOG_TAG, "Error! This handler was not registered for this message type. Message: " + msg.what); break; } super.handleMessage(msg); }
Source:
public String getOriginSite() { if(getPageUrl() == null || getPageUrl().getHost() ==null) { return "unknown"; } String host = getPageUrl().getHost(); for (String modHost : Constants.ACCEPTED_MOD_HOSTS) { if (host.endsWith(modHost)) { return modHost; } } return "unknown"; }

Target:
public String getOriginSite() { if(getPageUrl() != null && getPageUrl().getHost() != null) { String host = getPageUrl().getHost(); for (String modHost : Constants.ACCEPTED_MOD_HOSTS) { if (host.endsWith(modHost)) { return modHost; } } } return null; }
Source:
public ApacheClient() { this(new DefaultHttpClient()); DefaultHttpClient client = (DefaultHttpClient) this.client; this.redirectHandler = new RedirectHandler(); client.setRedirectHandler(this.redirectHandler); }

Target:
public ApacheClient() { this(new DefaultHttpClient()); }
Source:
public void customize(ConfigurableEmbeddedServletContainer container) { if (container instanceof TomcatEmbeddedServletContainerFactory) { TomcatEmbeddedServletContainerFactory tomcat = (TomcatEmbeddedServletContainerFactory) container; Connector ajpConnector = new Connector("AJP/1.3"); ajpConnector.setProtocol("AJP/1.3"); ajpConnector.setAttribute("address", bindAddress); ajpConnector.setPort(port); ajpConnector.setSecure(false); ajpConnector.setAllowTrace(false); ajpConnector.setScheme("http"); tomcat.addAdditionalTomcatConnectors(ajpConnector); } }

Target:
public void customize(ConfigurableEmbeddedServletContainer container) { if (container instanceof TomcatEmbeddedServletContainerFactory) { TomcatEmbeddedServletContainerFactory tomcat = (TomcatEmbeddedServletContainerFactory) container; Connector ajpConnector = new Connector("AJP/1.3"); ajpConnector.setAttribute("address", bindAddress); ajpConnector.setPort(port); ajpConnector.setSecure(false); ajpConnector.setAllowTrace(false); ajpConnector.setScheme("http"); tomcat.addAdditionalTomcatConnectors(ajpConnector); } }
Source:
public SignatureBuilder typeVariableConstraints(List<TypeVariableConstraint> typeVariableConstraints) { this.typeVariableConstraints = unmodifiableList(new ArrayList<>(requireNonNull(typeVariableConstraints, "typeVariableConstraints is null"))); return this; }

Target:
public SignatureBuilder typeVariableConstraints(List<TypeVariableConstraint> typeVariableConstraints) { this.typeVariableConstraints = ImmutableList.copyOf(requireNonNull(typeVariableConstraints, "typeVariableConstraints is null")); return this; }
Source:
public void visitSwitchStatement(SwitchStatementTree tree) { List<List<StatementTree>> normalizedBranches = new ArrayList<>(); boolean hasDefault = false; boolean hasFallthrough = false; int lastIndex = tree.cases().size() - 1; for (int i = 0; i < tree.cases().size(); i++) { SwitchCaseClauseTree switchCaseClause = tree.cases().get(i); List<StatementTree> statements = switchCaseClause.statements(); if (switchCaseClause.is(Kind.DEFAULT_CLAUSE)) { hasDefault = true; } if (!statements.isEmpty()) { normalizedBranches.add(normalize(statements)); if (i != lastIndex && !endsWithBreak(statements)) { hasFallthrough = true; } } } if (!normalizedBranches.isEmpty()) { checkBranches("case", normalizedBranches, hasDefault && !hasFallthrough, tree.switchToken()); } super.visitSwitchStatement(tree); }

Target:
public void visitSwitchStatement(SwitchStatementTree tree) { List<List<StatementTree>> normalizedBranches = new ArrayList<>(); boolean hasDefault = false; boolean hasFallthrough = false; int lastIndex = tree.cases().size() - 1; for (int i = 0; i < tree.cases().size(); i++) { SwitchCaseClauseTree switchCaseClause = tree.cases().get(i); List<StatementTree> statements = switchCaseClause.statements(); if (switchCaseClause.is(Kind.DEFAULT_CLAUSE)) { hasDefault = true; } if (!statements.isEmpty()) { normalizedBranches.add(normalize(statements)); if (i != lastIndex && !endsWithBreak(statements)) { hasFallthrough = true; } } } if (!normalizedBranches.isEmpty()) { boolean reportAllDuplicate = hasDefault && !hasFallthrough; checkBranches("case", normalizedBranches, reportAllDuplicate, tree.switchToken()); } super.visitSwitchStatement(tree); }
Source:
protected PlanNodeStatsEstimate visitLogicalBinaryExpression(LogicalBinaryExpression node, Void context) { PlanNodeStatsEstimate leftStats = process(node.getLeft()); PlanNodeStatsEstimate andStats = new FilterExpressionStatsCalculatingVisitor(leftStats, session, types).process(node.getRight()); switch (node.getType()) { case AND: return andStats; case OR: PlanNodeStatsEstimate rightStats = process(node.getRight()); PlanNodeStatsEstimate sumStats = addStatsAndSumDistinctValues(leftStats, rightStats); return differenceInNonRangeStats(sumStats, andStats); default: throw new IllegalStateException(format("Unimplemented logical binary operator expression %s", node.getType())); } }

Target:
protected PlanNodeStatsEstimate visitLogicalBinaryExpression(LogicalBinaryExpression node, Void context) { PlanNodeStatsEstimate leftStats = process(node.getLeft()); PlanNodeStatsEstimate andStats = new FilterExpressionStatsCalculatingVisitor(leftStats, session, types).process(node.getRight()); switch (node.getType()) { case AND: return andStats; case OR: PlanNodeStatsEstimate rightStats = process(node.getRight()); PlanNodeStatsEstimate sumStats = addStatsAndSumDistinctValues(leftStats, rightStats); return differenceInNonRangeStats(sumStats, andStats); default: throw new IllegalStateException("Unimplemented logical binary operator expression " + node.getType()); } }
Source:
public AsyncQuery storeResults(AsyncQuery asyncQuery, Observable<String> result) { log.debug("store AsyncResults for Download"); try (BufferedWriter writer = getWriter(asyncQuery.getId())) { result .map(s -> s.concat(System.getProperty("line.separator"))) .subscribe( s -> { writer.write(s); writer.flush(); }, t -> { throw new IllegalStateException(t); }, () -> { writer.flush(); } ); } catch (IOException e) { throw new IllegalStateException(e); } return asyncQuery; }

Target:
public AsyncQuery storeResults(AsyncQuery asyncQuery, Observable<String> result) { log.debug("store AsyncResults for Download"); try (BufferedWriter writer = getWriter(asyncQuery.getId())) { result .map(record -> record.concat(System.getProperty("line.separator"))) .subscribe( recordCharArray -> { writer.write(recordCharArray); writer.flush(); }, throwable -> { throw new IllegalStateException(throwable); }, () -> { writer.flush(); } ); } catch (IOException e) { throw new IllegalStateException(e); } return asyncQuery; }
Source:
public ICleanUpFix createFix(CleanUpContext context) throws CoreException { ICleanUpFixCore fixCore= coreCleanUp.createFixCore(context); return fixCore == null ? null : new CleanUpFixWrapper(coreCleanUp.createFixCore(context)); }

Target:
public ICleanUpFix createFix(CleanUpContext context) throws CoreException { ICleanUpFixCore fixCore= coreCleanUp.createFixCore(context); return fixCore == null ? null : new CleanUpFixWrapper(fixCore); }
Source:
protected void processWatch(String propertyName, WatchedEvent event) { if (_readWindowMs > 0 && _executorService != null) { int midPoint = _readWindowMs / 2; int delay = midPoint + ThreadLocalRandom.current().nextInt(midPoint); _executorService.schedule(() -> _zk.getChildren(getPath(propertyName), this, this, false), delay, TimeUnit.MILLISECONDS); } else { _zk.getChildren(getPath(propertyName), this, this, false); } }

Target:
protected void processWatch(String propertyName, WatchedEvent event) { if (_zookeeperReadWindowMs > 0 && _executorService != null) { int midPoint = _zookeeperReadWindowMs / 2; int delay = midPoint + ThreadLocalRandom.current().nextInt(midPoint); _executorService.schedule(() -> _zk.getChildren(getPath(propertyName), this, this, false), delay, TimeUnit.MILLISECONDS); } else { _zk.getChildren(getPath(propertyName), this, this, false); } }
Source:
public JPQLQuery<?> from(EntityPath<?>... from) { return query().from(from); }

Target:
public JPAQuery<?> from(EntityPath<?>... from) { return query().from(from); }
Source:
public static SmartThread asyncLoop(final Callable afn, boolean isDaemon, final Thread.UncaughtExceptionHandler eh, int priority, final boolean isFactory, boolean startImmediately, String threadName) { SmartThread thread = new SmartThread(new Runnable() { public void run() { try { final Callable<Long> fn = isFactory ? (Callable<Long>) afn.call() : afn; while (true) { final Long s = fn.call(); if (s==null) break; if (s>0) Thread.sleep(s); } } catch (Throwable t) { if (Utils.exceptionCauseIsInstanceOf( InterruptedException.class, t)) { LOG.info("Async loop interrupted!"); return; } LOG.error("Async loop died!", t); throw new RuntimeException(t); } } }); if (eh != null) { thread.setUncaughtExceptionHandler(eh); } else { thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { public void uncaughtException(Thread t, Throwable e) { LOG.error("Async loop died!", e); Utils.exitProcess(1, "Async loop died!"); } }); } thread.setDaemon(isDaemon); thread.setPriority(priority); if (threadName != null && !threadName.isEmpty()) { thread.setName(thread.getName() +"-"+ threadName); } if (startImmediately) { thread.start(); } return thread; }

Target:
public static SmartThread asyncLoop(final Callable afn, boolean isDaemon, final Thread.UncaughtExceptionHandler eh, int priority, final boolean isFactory, boolean startImmediately, String threadName) { SmartThread thread = new SmartThread(new Runnable() { public void run() { try { final Callable<Long> fn = isFactory ? (Callable<Long>) afn.call() : afn; while (true) { final Long s = fn.call(); if (s==null) break; if (s>0) Time.sleep(s); } } catch (Throwable t) { if (Utils.exceptionCauseIsInstanceOf( InterruptedException.class, t)) { LOG.info("Async loop interrupted!"); return; } LOG.error("Async loop died!", t); throw new RuntimeException(t); } } }); if (eh != null) { thread.setUncaughtExceptionHandler(eh); } else { thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { public void uncaughtException(Thread t, Throwable e) { LOG.error("Async loop died!", e); Utils.exitProcess(1, "Async loop died!"); } }); } thread.setDaemon(isDaemon); thread.setPriority(priority); if (threadName != null && !threadName.isEmpty()) { thread.setName(thread.getName() +"-"+ threadName); } if (startImmediately) { thread.start(); } return thread; }
Source:
public static Path getTribbleFileInJimfs(String vcf, String index, FileSystem fileSystem) throws IOException, URISyntaxException { final FileSystem fs = fileSystem; final Path root = fs.getPath("/"); final Path vcfPath = Paths.get(vcf); if (index != null) { final Path idxPath = Paths.get(index); final Path idxDestination = Paths.get(AbstractFeatureReader.isTabix(vcf, index) ? Tribble.tabixIndexFile(vcf) : Tribble.indexFile(vcf)); Files.copy(idxPath, root.resolve(idxDestination.getFileName().toString())); } return Files.copy(vcfPath, root.resolve(vcfPath.getFileName().toString())); }

Target:
public static Path getTribbleFileInJimfs(String vcf, String index, FileSystem fileSystem) throws IOException, URISyntaxException { final FileSystem fs = fileSystem; final Path root = fs.getPath("/"); final Path vcfPath = Paths.get(vcf); final Path vcfDestination = root.resolve(vcfPath.getFileName().toString()); if (index != null) { final Path idxPath = Paths.get(index); final Path idxDestination = AbstractFeatureReader.isTabix(vcf, index) ? Tribble.tabixIndexPath(vcfDestination) : Tribble.indexPath(vcfDestination); Files.copy(idxPath, idxDestination); } return Files.copy(vcfPath, vcfDestination); }
Source:
public Collection<MessageReceiver> get(ActiveMQSessionFactory sessionFactory) { List<MessageReceiver> messageReceivers = new LinkedList<>(); ActiveMQContextListener.getActiveMQListeners(this.config).forEach(listenerClass -> { try { Class<?> clazz = this.getClass().getClassLoader().loadClass(listenerClass); messageReceivers.add(buildEventMessageReceiver(sessionFactory, (EventListener) injector.getInstance(clazz))); } catch (Exception e) { log.warn("Unable to register listener {}", listenerClass, e); } }); int maxJobs = config.getInt(ConfigProperties.ASYNC_JOBS_THREADS); log.info("Adding job receivers with filter: {}", maxJobs, this.amqpFilter); return messageReceivers; }

Target:
public Collection<MessageReceiver> get(ActiveMQSessionFactory sessionFactory) { List<MessageReceiver> messageReceivers = new LinkedList<>(); ActiveMQContextListener.getActiveMQListeners(this.config).forEach(listenerClass -> { try { Class<?> clazz = this.getClass().getClassLoader().loadClass(listenerClass); messageReceivers.add(buildEventMessageReceiver(sessionFactory, (EventListener) injector.getInstance(clazz))); } catch (Exception e) { log.warn("Unable to register listener {}", listenerClass, e); } }); return messageReceivers; }
Source:
public VmSnapshotCreatePopupWidget(CommonApplicationConstants constants) { memoryEditor = new EntityModelCheckBoxEditor(Align.RIGHT); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); localize(constants); ViewIdHandler.idHandler.generateAndSetIds(this); driver.initialize(this); }

Target:
public VmSnapshotCreatePopupWidget(CommonApplicationConstants constants) { initEditors(); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); localize(constants); ViewIdHandler.idHandler.generateAndSetIds(this); driver.initialize(this); }
Source:
public Object[][] checkDuplicateMarkingDataProvider() { return new Object[][]{ {Paths.get(TEST_FILES_DIR, "pass_queryname.sam"), 0}, {Paths.get(TEST_FILES_DIR, "pass_coordinate.sam"), 0}, {Paths.get(TEST_FILES_DIR, "fail_mate_queryname.sam"), 1}, {Paths.get(TEST_FILES_DIR, "fail_mate_coordinate.sam"), 1}, {Paths.get(TEST_FILES_DIR, "fail_supplementary_queryname_1.sam"), 1}, {Paths.get(TEST_FILES_DIR, "fail_supplementary_coordinate_1.sam"), 1}, {Paths.get(TEST_FILES_DIR, "fail_supplementary_queryname_2.sam"), 1}, {Paths.get(TEST_FILES_DIR, "fail_supplementary_coordinate_2.sam"), 1}, {Paths.get(TEST_FILES_DIR, "fail_secondary_queryname.sam"), 1}, {Paths.get(TEST_FILES_DIR, "fail_secondary_coordinate.sam"), 1}, }; }

Target:
public Object[][] checkDuplicateMarkingDataProvider() { return new Object[][]{ {"pass_queryname.sam", 0}, {"pass_coordinate.sam", 0}, {"fail_mate_queryname.sam", 1}, {"fail_mate_coordinate.sam", 1}, {"fail_supplementary_queryname_1.sam", 1}, {"fail_supplementary_coordinate_1.sam", 1}, {"fail_supplementary_queryname_2.sam", 1}, {"fail_supplementary_coordinate_2.sam", 1}, {"fail_secondary_queryname.sam", 1}, {"fail_secondary_coordinate.sam", 1}, }; }