auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void applyForEachAddress(BiConsumer<Long, ILogData> logDataProcessor) { summonNecromancer(); nextRead = logHead; while (nextRead <= logTail) { try { final long start = nextRead; final long stopIncluded = Math.min(start + batchReadSize - 1, logTail); nextRead = stopIncluded + 1; final Map<Long, ILogData> range = getLogData(runtime, start, stopIncluded); for (Map.Entry<Long, ILogData> entry : range.entrySet()) { long address = entry.getKey(); ILogData logData = entry.getValue(); if (address != addressProcessed + 1) { throw new IllegalStateException("We missed an entry. It can lead to correctness issues."); } addressProcessed++; if (logData.getType() == DataType.TRIMMED) { throw new IllegalStateException("Unexpected TRIMMED data"); } if (address % STATUS_UPDATE_PACE == 0) { log.info("applyForEachAddress: read up to {}", address); } } invokeNecromancer(range, logDataProcessor); } catch (TrimmedException ex) { log.warn("Error loading data", ex); handleRetry(); } } killNecromancer(); }

Target:
private void applyForEachAddress(BiConsumer<Long, ILogData> logDataProcessor) { summonNecromancer(); nextRead = logHead; while (nextRead <= logTail) { try { final long lower = nextRead; final long upper = Math.min(lower + batchReadSize - 1, logTail); nextRead = upper + 1; Map<Long, ILogData> range = runtime.getAddressSpaceView().fetchAll(ContiguousSet.create( Range.closed(lower, upper), DiscreteDomain.longs()), true); for (Map.Entry<Long, ILogData> entry : range.entrySet()) { long address = entry.getKey(); ILogData logData = entry.getValue(); if (address != addressProcessed + 1) { throw new IllegalStateException("We missed an entry. It can lead to correctness issues."); } addressProcessed++; if (logData.getType() == DataType.TRIMMED) { throw new IllegalStateException("Unexpected TRIMMED data"); } if (address % STATUS_UPDATE_PACE == 0) { log.info("applyForEachAddress: read up to {}", address); } } invokeNecromancer(range, logDataProcessor); } catch (TrimmedException ex) { log.warn("Error loading data", ex); handleRetry(); } } killNecromancer(); }
Source:
public static Map<SystemStream, Integer> calculateUpstreamTaskCounts(Multimap<SystemStream, String> inputToTasks, IOGraph ioGraph) { Map<SystemStream, Integer> outputTaskCount = new HashMap<>(); ioGraph.getNodes().forEach(node -> { int count = node.getInputs().stream().flatMap(spec -> inputToTasks.get(spec.toSystemStream()).stream()) .collect(Collectors.toSet()).size(); outputTaskCount.put(node.getOutput().toSystemStream(), count); }); return outputTaskCount; }

Target:
static Map<SystemStream, Integer> calculateUpstreamTaskCounts(Multimap<SystemStream, String> inputToTasks, IOGraph ioGraph) { if (ioGraph == null) { return Collections.EMPTY_MAP; } Map<SystemStream, Integer> outputTaskCount = new HashMap<>(); ioGraph.getNodes().forEach(node -> { int count = node.getInputs().stream().flatMap(spec -> inputToTasks.get(spec.toSystemStream()).stream()) .collect(Collectors.toSet()).size(); outputTaskCount.put(node.getOutput().toSystemStream(), count); }); return outputTaskCount; }
Source:
private List<FreeIpaVersions> filterVersions(ImageCatalog catalog, List<Image> filterImages) { List<String> filteredUuids = filterImages.stream().map(Image::getUuid).collect(Collectors.toList()); return catalog.getVersions().getFreeIpaVersions().stream() .map(versions -> { List<String> defaults = versions.getDefaults().stream().filter(filteredUuids::contains).collect(Collectors.toList()); List<String> imageIds = versions.getImageIds().stream().filter(filteredUuids::contains).collect(Collectors.toList()); LOGGER.debug("Filtered versions: [versions: {}, defaults: {}, images: {}]", versions.getVersions(), defaults, imageIds); return new FreeIpaVersions(versions.getVersions(), defaults, imageIds); }).collect(Collectors.toList()); }

Target:
private List<FreeIpaVersions> filterVersions(ImageCatalog catalog, List<Image> filterImages) { List<String> filteredUuids = filterImages.stream().map(Image::getUuid).collect(Collectors.toList()); LOGGER.debug("The following uuids will be removed from defaults and image ids fields: [{}]", filteredUuids); return catalog.getVersions().getFreeIpaVersions().stream() .map(versions -> filterDefaultsAndImageIds(filteredUuids, versions)).collect(Collectors.toList()); }
Source:
public boolean isCheckResponseSize() { return isEnsureResposneSizeNotTooLarge() || isWarnResponseSizeLarge(); }

Target:
public boolean isCheckResponseSize() { return isErrorOnResponseSizeTooLarge() || isWarnOnResponseSizeLarge(); }
Source:
public final void parseVersion( String version ) { this.value = version; items = new ListItem(); version = version.toLowerCase( Locale.ENGLISH ); ListItem list = items; LinkedList<Item> stack = new LinkedList<>(); stack.push( list ); boolean isDigit = false; int startIndex = 0; for ( int i = 0; i < version.length(); i++ ) { char c = version.charAt( i ); if ( c == '.' ) { if ( i == startIndex ) { list.add( IntItem.ZERO ); } else { list.add( parseItem( isDigit, version.substring( startIndex, i ) ) ); } startIndex = i + 1; } else if ( c == '-' ) { if ( i == startIndex ) { list.add( IntItem.ZERO ); } else { list.add( parseItem( isDigit, version.substring( startIndex, i ) ) ); } startIndex = i + 1; list.add( list = new ListItem() ); stack.push( list ); } else if ( Character.isDigit( c ) ) { if ( !isDigit && i > startIndex ) { list.add( new StringItem( version.substring( startIndex, i ), true ) ); startIndex = i; list.add( list = new ListItem() ); stack.push( list ); } isDigit = true; } else { if ( isDigit && i > startIndex ) { list.add( parseItem( true, version.substring( startIndex, i ) ) ); startIndex = i; list.add( list = new ListItem() ); stack.push( list ); } isDigit = false; } } if ( version.length() > startIndex ) { list.add( parseItem( isDigit, version.substring( startIndex ) ) ); } while ( !stack.isEmpty() ) { list = (ListItem) stack.pop(); list.normalize(); } canonical = items.toString(); }

Target:
public final void parseVersion( String version ) { this.value = version; items = new ListItem(); version = version.toLowerCase( Locale.ENGLISH ); ListItem list = items; Deque<Item> stack = new ArrayDeque<>(); stack.push( list ); boolean isDigit = false; int startIndex = 0; for ( int i = 0; i < version.length(); i++ ) { char c = version.charAt( i ); if ( c == '.' ) { if ( i == startIndex ) { list.add( IntItem.ZERO ); } else { list.add( parseItem( isDigit, version.substring( startIndex, i ) ) ); } startIndex = i + 1; } else if ( c == '-' ) { if ( i == startIndex ) { list.add( IntItem.ZERO ); } else { list.add( parseItem( isDigit, version.substring( startIndex, i ) ) ); } startIndex = i + 1; list.add( list = new ListItem() ); stack.push( list ); } else if ( Character.isDigit( c ) ) { if ( !isDigit && i > startIndex ) { list.add( new StringItem( version.substring( startIndex, i ), true ) ); startIndex = i; list.add( list = new ListItem() ); stack.push( list ); } isDigit = true; } else { if ( isDigit && i > startIndex ) { list.add( parseItem( true, version.substring( startIndex, i ) ) ); startIndex = i; list.add( list = new ListItem() ); stack.push( list ); } isDigit = false; } } if ( version.length() > startIndex ) { list.add( parseItem( isDigit, version.substring( startIndex ) ) ); } while ( !stack.isEmpty() ) { list = (ListItem) stack.pop(); list.normalize(); } canonical = items.toString(); }
Source:
ObjectHolderRef(Field field, ResourceLocation injectedObject, boolean extractFromExistingValues) { Class<?> type = field.getType(); while (IForgeRegistryEntry.class.isAssignableFrom(type) && registry == null) { registry = PersistentRegistryManager.findRegistryByType((Class<IForgeRegistryEntry>)type); type = type.getSuperclass(); } this.field = field; this.isValid = registry != null; if (extractFromExistingValues) { try { Object existing = field.get(null); if (existing == null || existing == GameData.getBlockRegistry().getDefaultValue()) { this.injectedObject = null; this.field = null; this.isValid = false; return; } else { ResourceLocation tmp = null; if (registry != null) { tmp = registry.getKey((IForgeRegistryEntry) existing); } this.injectedObject = tmp; } } catch (Exception e) { throw Throwables.propagate(e); } } else { this.injectedObject = injectedObject; } if (this.injectedObject == null || !isValid()) { throw new IllegalStateException(String.format("The ObjectHolder annotation cannot apply to a field that is not an Item or Block (found : %s at %s.%s)", field.getType().getName(), field.getClass().getName(), field.getName())); } try { FinalFieldHelper.makeWritable(field); } catch (Exception e) { throw Throwables.propagate(e); } }

Target:
ObjectHolderRef(Field field, ResourceLocation injectedObject, boolean extractFromExistingValues) { registry = getRegistryForType(field); this.field = field; this.isValid = registry != null; if (extractFromExistingValues) { try { Object existing = field.get(null); if (existing == null || existing == GameData.getBlockRegistry().getDefaultValue()) { this.injectedObject = null; this.field = null; this.isValid = false; return; } else { ResourceLocation tmp = null; if (registry != null) { tmp = registry.getKey((IForgeRegistryEntry) existing); } this.injectedObject = tmp; } } catch (Exception e) { throw Throwables.propagate(e); } } else { this.injectedObject = injectedObject; } if (this.injectedObject == null || !isValid()) { throw new IllegalStateException(String.format("The ObjectHolder annotation cannot apply to a field that does not map to a registry. Ensure the registry was created during the RegistryEvent.NewRegistry event. (found : %s at %s.%s)", field.getType().getName(), field.getClass().getName(), field.getName())); } try { FinalFieldHelper.makeWritable(field); } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
public RuleMatch[] match(AnalyzedSentence sentence) throws IOException { List<RuleMatch> ruleMatches = new ArrayList<>(); AnalyzedTokenReadings[] tokens = sentence.getTokensWithoutWhitespace(); for(int i = 1; i < tokens.length; i++) { String token = tokens[i].getToken(); if(getSubjects().contains(token)) { final String[] context = getContext(tokens, i); final float[] y = classifier.getScores(context); final Suggestion suggestion = getSuggestion(y); if(!suggestion.matches(token)) { if (!suggestion.isUnsure()) { ruleMatches.add(createRuleMatch(tokens[i], suggestion, y)); } else { System.out.println("unsure: " + getMessage(suggestion, y) + Arrays.toString(context)); } } } } return toRuleMatchArray(ruleMatches); }

Target:
public RuleMatch[] match(AnalyzedSentence sentence) throws IOException { List<RuleMatch> ruleMatches = new ArrayList<>(); AnalyzedTokenReadings[] tokens = sentence.getTokensWithoutWhitespace(); for(int i = 1; i < tokens.length; i++) { String token = tokens[i].getToken(); if(getSubjects().contains(token)) { final String[] context = getContext(tokens, i); final float[] y = classifier.getScores(context); final Suggestion suggestion = getSuggestion(y); if(!suggestion.matches(token)) { if (!suggestion.isUnsure()) { ruleMatches.add(createRuleMatch(tokens[i], suggestion, y)); } else { if(DEBUG) { System.out.println("unsure: " + getMessage(suggestion, y) + Arrays.toString(context)); } } } } } return toRuleMatchArray(ruleMatches); }
Source:
protected void addStorageDomainInDb() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { StorageDomainStatic storageStaticData = getStorageDomain().getStorageStaticData(); DbFacade.getInstance().getStorageDomainStaticDao().save(storageStaticData); if (storageStaticData.getStorageDomainType() == StorageDomainType.Master || storageStaticData.getStorageDomainType() == StorageDomainType.Data) { getDiskProfileDao().save(DiskProfileHelper.createDiskProfile(storageStaticData.getId(), storageStaticData.getStorageName())); } getCompensationContext().snapshotNewEntity(storageStaticData); StorageDomainDynamic newStorageDynamic = new StorageDomainDynamic(null, getStorageDomain().getId(), null); getReturnValue().setActionReturnValue(getStorageDomain().getId()); DbFacade.getInstance().getStorageDomainDynamicDao().save(newStorageDynamic); getCompensationContext().snapshotNewEntity(newStorageDynamic); getCompensationContext().stateChanged(); return null; } }); }

Target:
protected void addStorageDomainInDb() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { StorageDomainStatic storageStaticData = getStorageDomain().getStorageStaticData(); DbFacade.getInstance().getStorageDomainStaticDao().save(storageStaticData); if (storageStaticData.getStorageDomainType().isDataDomain()) { getDiskProfileDao().save(DiskProfileHelper.createDiskProfile(storageStaticData.getId(), storageStaticData.getStorageName())); } getCompensationContext().snapshotNewEntity(storageStaticData); StorageDomainDynamic newStorageDynamic = new StorageDomainDynamic(null, getStorageDomain().getId(), null); getReturnValue().setActionReturnValue(getStorageDomain().getId()); DbFacade.getInstance().getStorageDomainDynamicDao().save(newStorageDynamic); getCompensationContext().snapshotNewEntity(newStorageDynamic); getCompensationContext().stateChanged(); return null; } }); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; RateHistory that = (RateHistory) o; return Objects.equals(rates, that.rates); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } RateHistory that = (RateHistory) o; return Objects.equals(rates, that.rates); }
Source:
public static Binary fromReusedByteArray(final byte[] value, final int offset, final int length) { return fromByteArray(value, offset, length, false); }

Target:
public static Binary fromReusedByteArray(final byte[] value, final int offset, final int length) { return new ByteArraySliceBackedBinary(value, offset, length, true); }
Source:
public View getView(int i, View view, ViewGroup viewGroup) { if (view == null){ view = LayoutInflater.from(Utils.getContext()).inflate(R.layout.item_content, null); } if (view == null){ return null; } IndexedItem item = getItem(i); if (!mAnimCheck.contains(item)) { mAnimCheck.add(item); Utils.fadein(view, i * 20); fadeIn(view); } mViewToPositions.put(view, i); mItemToView.put(item, view); if (item instanceof IndexedFolder) { styleFolderView((IndexedFolder) item, view); } else { styleFileView((IndexedFile) item, view); } handleSelection(view); return view; }

Target:
public View getView(int i, View view, ViewGroup viewGroup) { if (view == null) { view = LayoutInflater.from(Utils.getContext()).inflate(R.layout.item_content, null); if (view == null) { return null; } } IndexedItem item = getItem(i); if (!mAnimCheck.contains(item)) { mAnimCheck.add(item); Utils.fadein(view, i * 20); fadeIn(view); } mViewToPositions.put(view, i); mItemToView.put(item, view); if (item instanceof IndexedFolder) { styleFolderView((IndexedFolder) item, view); } else { styleFileView((IndexedFile) item, view); } handleSelection(view); return view; }
Source:
public SubscribeRule(@JsonProperty("type") final Type type, @JsonProperty("all") final Boolean all, @JsonProperty("publisher") final String publisher, @JsonProperty("track") final String track, @JsonProperty("kind") final Kind kind, @JsonProperty("priority") final Priority priority) { this.type = type; this.all = all; this.kind = kind; this.priority = priority; this.publisher = publisher; this.track = track; }

Target:
public SubscribeRule(@JsonProperty("type") final Type type, @JsonProperty("all") final Boolean all, @JsonProperty("publisher") final String publisher, @JsonProperty("track") final String track, @JsonProperty("kind") final Kind kind, @JsonProperty("priority") final Priority priority) { this.type = type; this.all = all; this.publisher = publisher; this.track = track; this.kind = kind; this.priority = priority; }
Source:
private void installCoreConverter() { if (coreClass.equals(String.class)) { converter = e -> ((JsonString) e).getString(); } else if (coreClass.equals(Set.class)) { converter = e -> convertToSet(e); } else if (coreClass.equals(Long.class)) { converter = e -> ((JsonNumber) e).longValue(); } else if (coreClass.equals(Boolean.class)) { converter = e -> convertToBoolean(e); } else if (coreClass.equals(JsonArray.class)) { converter = e -> e instanceof JsonArray ? e : createArrayBuilder().add(e).build(); } else { converter = e -> e; } }

Target:
private void installCoreConverter() { if (coreClass == String.class) { converter = e -> ((JsonString) e).getString(); } else if (coreClass == Set.class) { converter = e -> convertToSet(e); } else if (coreClass == Long.class) { converter = e -> ((JsonNumber) e).longValue(); } else if (coreClass == Boolean.class) { converter = e -> convertToBoolean(e); } else if (coreClass == JsonArray.class) { converter = e -> e instanceof JsonArray ? e : createArrayBuilder().add(e).build(); } else { converter = e -> e; } }
Source:
public void json_example() { userSessionRule .logIn("obiwan.kenobi") .addPermission(SCAN, db.getDefaultOrganization()) .addPermission(ADMINISTER_QUALITY_PROFILES, db.getDefaultOrganization()); UserDto obiwan = db.users().insertUser(user -> user .setLogin("obiwan.kenobi") .setName("Obiwan Kenobi") .setEmail("obiwan.kenobi@starwars.com") .setLocal(true) .setExternalIdentity("obiwan.kenobi") .setExternalIdentityProvider("sonarqube") .setScmAccounts(newArrayList("obiwan:github", "obiwan:bitbucket")) .setOnboarded(true) .setHomepageType("MY_PROJECTS")); db.users().insertMember(db.users().insertGroup(newGroupDto().setName("Jedi")), obiwan); db.users().insertMember(db.users().insertGroup(newGroupDto().setName("Rebel")), obiwan); String response = ws.newRequest().execute().getInput(); assertJson(response).isSimilarTo(getClass().getResource("current-example.json")); }

Target:
public void json_example() { userSessionRule .logIn("obiwan.kenobi") .addPermission(SCAN, db.getDefaultOrganization()) .addPermission(ADMINISTER_QUALITY_PROFILES, db.getDefaultOrganization()); UserDto obiwan = db.users().insertUser(user -> user .setLogin("obiwan.kenobi") .setName("Obiwan Kenobi") .setEmail("obiwan.kenobi@starwars.com") .setLocal(true) .setExternalIdentity("obiwan.kenobi") .setExternalIdentityProvider("sonarqube") .setScmAccounts(newArrayList("obiwan:github", "obiwan:bitbucket")) .setOnboarded(true) .setHomepageType("PROJECT") .setHomepageValue("UUID-of-the-death-star")); db.users().insertMember(db.users().insertGroup(newGroupDto().setName("Jedi")), obiwan); db.users().insertMember(db.users().insertGroup(newGroupDto().setName("Rebel")), obiwan); db.components().insertPublicProject(u->u.setUuid("UUID-of-the-death-star"), u->u.setDbKey("death-star-key")); String response = ws.newRequest().execute().getInput(); assertJson(response).isSimilarTo(getClass().getResource("current-example.json")); }
Source:
public void onlyTheFirstWSConsumerCreatesANewRequestBodyForTheSameOperation() throws InitialisationException, WSDLException { String echoOperation = "echo"; WSConsumerConfig spyConfig = spy(new WSConsumerConfig()); WSConsumer wsConsumer1 = createConsumer(spyConfig, echoOperation); WSConsumer wsConsumer2 = createConsumer(spyConfig, echoOperation); WSConsumer wsConsumer3 = createConsumer(spyConfig, echoOperation); wsConsumer1.initialise(); wsConsumer2.initialise(); wsConsumer3.initialise(); verify(spyConfig, times(1)).createRequestBody(Mockito.any(Definition.class), Mockito.any(BindingOperation.class)); verify(spyConfig, times(2)).getRequestBodyFromCache(Mockito.any(String.class)); }

Target:
public void onlyTheFirstWSConsumerCreatesANewRequestBodyForTheSameOperation() throws InitialisationException, WSDLException { String echoOperation = "echo"; WSConsumerConfig spyConfig = spy(new WSConsumerConfig()); WSConsumer wsConsumer1 = createConsumer(spyConfig, echoOperation); WSConsumer wsConsumer2 = createConsumer(spyConfig, echoOperation); WSConsumer wsConsumer3 = createConsumer(spyConfig, echoOperation); wsConsumer1.initialise(); wsConsumer2.initialise(); wsConsumer3.initialise(); verify(spyConfig, times(1)).createRequestBody(any(Definition.class), any(BindingOperation.class)); verify(spyConfig, times(2)).getRequestBodyFromCache(any(String.class)); }
Source:
public void example1() throws IOException { considerExample("Example1_original"); cu.getClassByName("A").get().getFieldByName("a").get().addModifier(STATIC); assertTransformed("Example1", cu); }

Target:
public void example1() throws IOException { considerExample("Example1_original"); cu.getClassByName("A").get().getFieldByName("a").get().setModifiers(STATIC); assertTransformed("Example1", cu); }
Source:
public SnapshotInfo listSnapshots() { return null; }

Target:
public SnapshotInfo listSnapshots() { return ConfigurationPersister.NULL_SNAPSHOT_INFO; }
Source:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } if (tree.is(IF_STATEMENT)) { visitIfStatement((IfStatementTree) tree); } if (tree.is(SYNCHRONIZED_STATEMENT)) { synchronizedStmtStack.add(tree); } }

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } if (isIfFieldEqNullTree(tree)) { IfStatementTree ifTree = (IfStatementTree) tree; ifConditionSymbolStack.push(new CheckedLocking(ifTree)); visitIfStatement(ifTree); } if (tree.is(SYNCHRONIZED_STATEMENT)) { synchronizedStmtStack.push(tree); } }
Source:
public static void setUp() throws CommandFailedException, InterruptedException, TimeoutException, IOException { operations.add(C_HANDLER_ADDRESS); administration.reloadIfRequired(); operations.add(C_HANDLER_TB_REMOVED_ADDRESS); administration.reloadIfRequired(); }

Target:
public static void setUp() throws CommandFailedException, InterruptedException, TimeoutException, IOException { List<OnlineCommand> addConsoleHandlers = new LinkedList<>(); addConsoleHandlers.add(Logging.handler().console().add(CONSOLE_HANDLER).build()); addConsoleHandlers.add(Logging.handler().console().add(CONSOLE_HANDLER_TB_REMOVED).build()); client.apply(addConsoleHandlers); administration.reloadIfRequired(); }
Source:
private void showTocOnboarding() { FloatingActionButton tocButton = (FloatingActionButton) parentActivity.findViewById(R.id.floating_toc_button); ToolTipUtil.showToolTip(parentActivity, tocButton, R.layout.inflate_tool_tip_toc_button, Color.BLACK, ToolTip.Position.CENTER); WikipediaApp.getInstance().getOnboardingStateMachine().setTocTutorial(); }

Target:
private void showTocOnboarding() { View tocButton = parentActivity.findViewById(R.id.floating_toc_button); ToolTipUtil.showToolTip(parentActivity, tocButton, R.layout.inflate_tool_tip_toc_button, parentActivity.getResources().getColor(R.color.tool_tip_default), ToolTip.Position.CENTER); WikipediaApp.getInstance().getOnboardingStateMachine().setTocFloatingButtonTutorial(); }
Source:
public static IndicatorQueryMutationEffect findHighestMutationEffectByEvidence(Set<Evidence> evidences) { Integer index = 100; IndicatorQueryMutationEffect indicatorQueryMutationEffect = new IndicatorQueryMutationEffect(); for (Evidence evidence : evidences) { MutationEffect mutationEffect = MutationEffect.getByName(evidence.getKnownEffect()); if (PRIORITIZED_MUTATION_EFFECTS.indexOf(mutationEffect) < index) { indicatorQueryMutationEffect.setMutationEffect(mutationEffect); indicatorQueryMutationEffect.setMutationEffectEvidence(evidence); } } return indicatorQueryMutationEffect; }

Target:
public static IndicatorQueryMutationEffect findHighestMutationEffectByEvidence(Set<Evidence> evidences) { int index = 100; IndicatorQueryMutationEffect indicatorQueryMutationEffect = new IndicatorQueryMutationEffect(); for (Evidence evidence : evidences) { MutationEffect mutationEffect = MutationEffect.getByName(evidence.getKnownEffect()); int _index = PRIORITIZED_MUTATION_EFFECTS.indexOf(mutationEffect); if (_index < index) { indicatorQueryMutationEffect.setMutationEffect(mutationEffect); indicatorQueryMutationEffect.setMutationEffectEvidence(evidence); index = _index; } } return indicatorQueryMutationEffect; }
Source:
public boolean accept(File file) { boolean accept = false; if (!file.isDirectory() && file.canRead()) { String fileName = file.getName(); if (isDescriptorFile(fileName) || isXmlTypeDescriptorFile(fileName)) { accept = true; } } return accept; }

Target:
public boolean accept(File file) { boolean accept = false; if (!file.isDirectory() && file.canRead()) { String extension = FilenameUtils.getExtension(file.getName()); if (SUPPORTED_EXTENSIONS.contains(extension)) { accept = true; } } return accept; }
Source:
protected boolean validateInputs() { if (!super.validateInputs()) { return false; } VdcQueryReturnValue returnValue = getQueryReturnValue(); returnValue.setExceptionString(""); try { String hostName = getParameters().getVdsHostName(); if (StringUtils.isBlank(hostName)) { returnValue.setExceptionString("Cannot register Host - no Hostname address specified."); return false; } List<VDS> vdssByUniqueId = getVdssByUniqueId(); if (vdssByUniqueId.size() > 1) { returnValue.setExceptionString("Cannot register Host - unique id is ambigious."); return false; } if (vdssByUniqueId.size() == 1) { VDS vds = vdssByUniqueId.get(0); if (!VdsHandler.isPendingOvirt(vds)) { returnValue.setExceptionString(VdcBllMessages.VDS_STATUS_NOT_VALID_FOR_UPDATE.name()); return false; } Long otp = getParameters().getOtp(); if (otp != null && !isValidOtp(vds, otp)) { returnValue.setExceptionString(String.format("Invalid OTP for host %s", hostName)); return false; } } } catch (RuntimeException ex) { log.error("RegisterVdsQuery::CanDoAction: An exception has been thrown.", ex); returnValue.setExceptionString(String.format("Cannot register Host - An exception has been thrown: %1$s", ex.getMessage())); return false; } return true; }

Target:
protected boolean validateInputs() { if (!super.validateInputs()) { return false; } VdcQueryReturnValue returnValue = getQueryReturnValue(); returnValue.setExceptionString(""); try { String hostName = getParameters().getVdsHostName(); if (StringUtils.isBlank(hostName)) { returnValue.setExceptionString("Cannot register Host - no Hostname address specified."); return false; } List<VDS> vdssByUniqueId = getVdssByUniqueId(); if (vdssByUniqueId.size() > 1) { returnValue.setExceptionString("Cannot register Host - unique id is ambigious."); return false; } if (vdssByUniqueId.size() == 1) { VDS vds = vdssByUniqueId.get(0); if (!VdsHandler.isPendingOvirt(vds)) { returnValue.setExceptionString(VdcBllMessages.VDS_STATUS_NOT_VALID_FOR_UPDATE.name()); return false; } Long otp = getParameters().getOtp(); if (otp != null && !isValidOtp(vds, otp)) { returnValue.setExceptionString(String.format("Invalid OTP for host %s", hostName)); return false; } } } catch (RuntimeException ex) { log.error(ex); returnValue.setExceptionString(String.format("Cannot register Host - An exception has been thrown: %1$s", ex.getMessage())); return false; } return true; }
Source:
private Set<Guid> getDisksNotInPreviousCheckpoint() { List<DiskImage> checkpointDisks = vmCheckpointDao.getDisksByCheckpointId(getParameters().getVmBackup().getFromCheckpointId()); Set<Guid> vmCheckpointDisksIds = checkpointDisks .stream() .map(DiskImage::getId) .collect(Collectors.toCollection(LinkedHashSet::new)); return getDiskIds().stream() .distinct() .filter(diskId -> !vmCheckpointDisksIds.contains(diskId)) .collect(Collectors.toSet()); }

Target:
public Set<Guid> getDisksNotInPreviousCheckpoint() { List<DiskImage> checkpointDisks = vmCheckpointDao.getDisksByCheckpointId(getParameters().getVmBackup().getFromCheckpointId()); Set<Guid> vmCheckpointDisksIds = checkpointDisks .stream() .map(DiskImage::getId) .collect(Collectors.toCollection(HashSet::new)); return getDiskIds().stream() .distinct() .filter(diskId -> !vmCheckpointDisksIds.contains(diskId)) .collect(Collectors.toSet()); }
Source:
protected List<SegmentTimelineElement> parseSegmentTimeline(XmlPullParser xpp,long timescale, long periodDurationMs) throws XmlPullParserException, IOException { List<SegmentTimelineElement> segmentTimeline = new ArrayList<>(); long elapsedTime = 0; do { xpp.next(); if (XmlPullParserUtil.isStartTag(xpp, "S")) { elapsedTime = parseLong(xpp, "t", elapsedTime); long duration = parseLong(xpp, "d", C.TIME_UNSET); int repeat = parseInt(xpp,"r",0); int count = repeat != -1? 1 + repeat : (int) (((periodDurationMs / 1000) * timescale) / duration); for (int i = 0; i < count; i++) { segmentTimeline.add(buildSegmentTimelineElement(elapsedTime, duration)); elapsedTime += duration; } } else { maybeSkipTag(xpp); } } while (!XmlPullParserUtil.isEndTag(xpp, "SegmentTimeline")); return segmentTimeline; }

Target:
protected List<SegmentTimelineElement> parseSegmentTimeline(XmlPullParser xpp,long timescale, long periodDurationMs) throws XmlPullParserException, IOException { List<SegmentTimelineElement> segmentTimeline = new ArrayList<>(); long elapsedTime = 0; do { xpp.next(); if (XmlPullParserUtil.isStartTag(xpp, "S")) { elapsedTime = parseLong(xpp, "t", elapsedTime); long duration = parseLong(xpp, "d", C.TIME_UNSET); int repeat = parseInt(xpp,"r",0); int count = repeat >= 0? 1 + repeat : (int) (((periodDurationMs / 1000) * timescale) / duration); for (int i = 0; i < count; i++) { segmentTimeline.add(buildSegmentTimelineElement(elapsedTime, duration)); elapsedTime += duration; } } else { maybeSkipTag(xpp); } } while (!XmlPullParserUtil.isEndTag(xpp, "SegmentTimeline")); return segmentTimeline; }
Source:
static void checkModule(ModuleResolver resolver, GenContext ctx, ModuleDeclaration moduleDecl, List<TypedModuleSpec> dependencies) { TypedAST typedAST = moduleDecl.getInner(); if (moduleDecl.isAnnotated()) { List<ImportDeclaration> imports = moduleDecl.getImports(); Set<Module> liftedModules = new HashSet<>(); for (ImportDeclaration decl : imports) { if (decl.isLifted()) { String moduleName = decl.getUri().getSchemeSpecificPart(); Module m = resolver.resolveModule(moduleName, false, true); liftedModules.add(m); } } for (TypedModuleSpec spec : dependencies) { if (spec.getIsAnnotated() != null && !spec.getIsAnnotated()) { if (!liftedModules.contains(spec.getModule())) { ToolError.reportError(ErrorMessage.EFFECT_ANNOTATION_SEPARATION, FileLocation.UNKNOWN); } } } typedAST.acceptVisitor(new AnnotatedEffectVisitor(), ctx); } }

Target:
static void checkModule(ModuleResolver resolver, GenContext ctx, ModuleDeclaration moduleDecl, List<TypedModuleSpec> dependencies) { TypedAST typedAST = moduleDecl.getInner(); if (moduleDecl.isAnnotated()) { List<ImportDeclaration> imports = moduleDecl.getImports(); Set<Module> liftedModules = new HashSet<>(); for (ImportDeclaration decl : imports) { if (decl.isLifted()) { String moduleName = decl.getUri().getSchemeSpecificPart(); Module m = resolver.resolveModule(moduleName, false, true); liftedModules.add(m); } } for (TypedModuleSpec spec : dependencies) { if (!spec.getIsAnnotated()) { if (!liftedModules.contains(spec.getModule())) { ToolError.reportError(ErrorMessage.EFFECT_ANNOTATION_SEPARATION, FileLocation.UNKNOWN); } } } typedAST.acceptVisitor(new AnnotatedEffectVisitor(), ctx); } }
Source:
public void testIterator() { final DependentInstanceTestBean testBean = getBeanManager().lookupBean(DependentInstanceTestBean.class).getInstance(); final Instance<DependentBeanA> injectedBean = testBean.getInjectDependentBeanA(); assertTrue(injectedBean.iterator().hasNext()); }

Target:
public void testIterator() { final DependentInstanceTestBean testBean = getBeanManager().lookupBean(DependentInstanceTestBean.class).getInstance(); final Instance<DependentBeanA> injectedBean = testBean.getInjectDependentBeanA(); assertTrue(injectedBean.iterator().hasNext()); assertEquals(DependentBeanA.class, injectedBean.iterator().next().getClass()); }
Source:
public void mbusDeviceIsNotCoupledWithDevice(String mbusDeviceId, String deviceId) throws Throwable { this.coupleDeviceHooks.deCoupleDevices(deviceId, mbusDeviceId); }

Target:
public void mbusDeviceIsNotCoupledWithDevice(String mbusDeviceId, String deviceId) { this.coupleDeviceHooks.decoupleDevices(deviceId, mbusDeviceId); }
Source:
public final void unsafeSubscribe(CompletableSubscriber s) { requireNonNull(s); try { onSubscribe.call(s); } catch (NullPointerException ex) { throw ex; } catch (Throwable ex) { Exceptions.throwIfFatal(ex); ERROR_HANDLER.handleError(ex); throw toNpe(ex); } }

Target:
public final void unsafeSubscribe(CompletableSubscriber s) { requireNonNull(s); try { CompletableOnSubscribe onSubscribeDecorated = HOOK.onSubscribeStart(this, this.onSubscribe); onSubscribeDecorated.call(s); } catch (NullPointerException ex) { throw ex; } catch (Throwable ex) { Exceptions.throwIfFatal(ex); ex = HOOK.onSubscribeError(ex); ERROR_HANDLER.handleError(ex); throw toNpe(ex); } }
Source:
public PlanWithProperties visitTableWriter(TableWriterNode node, PreferredProperties preferredProperties) { PlanWithProperties source = node.getSource().accept(this, preferredProperties); Optional<PartitioningScheme> partitioningScheme = node.getPartitioningScheme(); if (!partitioningScheme.isPresent()) { if (scaleWriters) { partitioningScheme = Optional.of(new PartitioningScheme(Partitioning.create(SCALED_WRITER_DISTRIBUTION, ImmutableList.of()), source.getNode().getOutputSymbols())); } else if (redistributeWrites) { partitioningScheme = Optional.of(new PartitioningScheme(Partitioning.create(FIXED_ARBITRARY_DISTRIBUTION, ImmutableList.of()), source.getNode().getOutputSymbols())); } } if (partitioningScheme.isPresent() && !source.getProperties().isCompatibleTablePartitioningWith(partitioningScheme.get().getPartitioning(), false, metadata, session) && !(partialMergePushdownStrategy == PUSHDOWN_BUT_NOT_THROUGH_JOIN_AND_AGGREGATION && source.getProperties().isRefinedPartitioningOver(partitioningScheme.get().getPartitioning(), false, metadata, session) && canPushdownPartialMerge(source.getNode()))) { source = withDerivedProperties( partitionedExchange( idAllocator.getNextId(), REMOTE_STREAMING, source.getNode(), partitioningScheme.get()), source.getProperties()); } return rebaseAndDeriveProperties(node, source); }

Target:
public PlanWithProperties visitTableWriter(TableWriterNode node, PreferredProperties preferredProperties) { PlanWithProperties source = node.getSource().accept(this, preferredProperties); Optional<PartitioningScheme> partitioningScheme = node.getPartitioningScheme(); if (!partitioningScheme.isPresent()) { if (scaleWriters) { partitioningScheme = Optional.of(new PartitioningScheme(Partitioning.create(SCALED_WRITER_DISTRIBUTION, ImmutableList.of()), source.getNode().getOutputSymbols())); } else if (redistributeWrites) { partitioningScheme = Optional.of(new PartitioningScheme(Partitioning.create(FIXED_ARBITRARY_DISTRIBUTION, ImmutableList.of()), source.getNode().getOutputSymbols())); } } if (partitioningScheme.isPresent() && !source.getProperties().isCompatibleTablePartitioningWith(partitioningScheme.get().getPartitioning(), false, metadata, session) && !(source.getProperties().isRefinedPartitioningOver(partitioningScheme.get().getPartitioning(), false, metadata, session) && canPushdownPartialMerge(source.getNode(), partialMergePushdownStrategy))) { source = withDerivedProperties( partitionedExchange( idAllocator.getNextId(), REMOTE_STREAMING, source.getNode(), partitioningScheme.get()), source.getProperties()); } return rebaseAndDeriveProperties(node, source); }
Source:
public org.robolectric.res.builder.XmlBlock getXml(ResName resName, String qualifiers) { return pickFor(resName).getXml(resName, qualifiers); }

Target:
public XmlBlock getXml(ResName resName, String qualifiers) { return pickFor(resName).getXml(resName, qualifiers); }
Source:
private void transferAllJobBlobs() throws IOException { final Predicate transferPredicate = () -> ! canceled; final AtomicInteger numBlobsRemaining = new AtomicInteger(jobState.numBlobsInJob()); while ( ! Thread.currentThread().isInterrupted() && transferPredicate.test() && numBlobsRemaining.get() > 0) { try { final Iterable<JobPart> jobParts = jobPartsNotAlreadyTransferred(transferPredicate); final int numJobParts = Iterables.size(jobParts); if (numJobParts <= 0) { break; } final CountDownLatch countDownLatch = new CountDownLatch(1); transferJobParts(jobParts, countDownLatch, numBlobsRemaining, transferPredicate); countDownLatch.await(); } catch (final Ds3NoMoreRetriesException | FailedRequestException e) { emitFailureEvent(makeFailureEvent(failureActivity, e, firstChunk())); throw e; } catch (final InterruptedException | NoSuchElementException e) { Thread.currentThread().interrupt(); } catch (final Throwable t) { emitFailureAndSetCachedException(t); } } }

Target:
private void transferAllJobBlobs() throws IOException { final BooleanSupplier cancellationCheck = () -> !canceled; final AtomicInteger numBlobsRemaining = new AtomicInteger(jobState.numBlobsInJob()); while (!Thread.currentThread().isInterrupted() && cancellationCheck.getAsBoolean() && numBlobsRemaining.get() > 0) { try { final Iterable<JobPart> jobParts = jobPartsNotAlreadyTransferred(cancellationCheck); final int numJobParts = Iterables.size(jobParts); if (numJobParts <= 0) { break; } final CountDownLatch jobPartsCompleteLatch = new CountDownLatch(numJobParts); transferJobParts(jobParts, jobPartsCompleteLatch, numBlobsRemaining, cancellationCheck); jobPartsCompleteLatch.await(); } catch (final Ds3NoMoreRetriesException | FailedRequestException e) { emitFailureEvent(makeFailureEvent(failureActivity, e, firstChunk())); throw e; } catch (final InterruptedException | NoSuchElementException e) { LOG.warn("Thread was interrupted"); Thread.currentThread().interrupt(); } catch (final Throwable t) { emitFailureAndSetCachedException(t); } } }
Source:
private IkeSaPayload makeSaRequestPayload() throws Exception { byte[] inputPacket = TestUtils.hexStringToByteArray(TWO_PROPOSAL_RAW_PACKET); Proposal.sTransformDecoder = new TransformDecoder() { private int mProposalCnt = 0; @Override public Transform[] decodeTransforms(int count, ByteBuffer inputBuffer) throws IkeException { mProposalCnt++; for (int i = 0; i < count; i++) { inputBuffer.getShort(); int length = Short.toUnsignedInt(inputBuffer.getShort()); byte[] temp = new byte[length - 4]; inputBuffer.get(temp); } if (mProposalCnt == 1) { return new Transform[] { mEncrAesCbc128Transform, mIntegHmacSha1Transform, mPrfHmacSha1Transform, mDhGroup1024Transform, mDhGroup2048Transform }; } else { return new Transform[] { mEncrAesGcm8Key128Transform, mEncrAesGcm12Key128Transform, mPrfHmacSha1Transform, mDhGroup1024Transform, mDhGroup2048Transform }; } } }; IkeSaPayload reqPayload = new IkeSaPayload(false, false, inputPacket); return reqPayload; }

Target:
private IkeSaPayload makeSaRequestPayload() throws Exception { return new IkeSaPayload(new SaProposal[] {mSaProposalOne, mSaProposalTwo}); }
Source:
public SystemAdmin getSystemAdmin(String systemName, String adminLabel) { return getSystemAdmins(adminLabel).get(systemName); }

Target:
public SystemAdmin getSystemAdmin(String systemName, String adminLabel) { if (systemAdminMap.isEmpty() || (systemAdminMap.containsKey(systemName) && systemAdminMap.get(systemName).isStopped())) { systemAdminMap.clear(); } return getSystemAdmins(adminLabel).get(systemName); }
Source:
public ItemStack build() throws IllegalStateException { checkState(this.type != null, "Item type has not been set"); int max = this.type.getMaxStackQuantity(); if (type == ItemTypes.AIR || quantity <= 0) { return ((ItemStack) net.minecraft.item.ItemStack.EMPTY); } final ItemStack stack = (ItemStack) new net.minecraft.item.ItemStack((Item) this.type, this.quantity, this.damageValue); if (this.compound != null) { ((net.minecraft.item.ItemStack) stack).setTagCompound(this.compound.copy()); } if (this.itemDataSet != null) { this.itemDataSet.forEach(stack::offer); } if (this.keyValues != null) { this.keyValues.entrySet().forEach(entry -> stack.offer((Key) entry.getKey(), entry.getValue())); } return stack; }

Target:
public ItemStack build() throws IllegalStateException { checkState(this.type != null, "Item type has not been set"); if (type == ItemTypes.NONE || quantity <= 0) { return ((ItemStack) net.minecraft.item.ItemStack.EMPTY); } final ItemStack stack = (ItemStack) new net.minecraft.item.ItemStack((Item) this.type, this.quantity, this.damageValue); if (this.compound != null) { ((net.minecraft.item.ItemStack) stack).setTagCompound(this.compound.copy()); } if (this.itemDataSet != null) { this.itemDataSet.forEach(stack::offer); } if (this.keyValues != null) { this.keyValues.entrySet().forEach(entry -> stack.offer((Key) entry.getKey(), entry.getValue())); } return stack; }
Source:
public VertxOptions setWarningExceptionTime(long warningExceptionTime) { this.warningExceptionTime = warningExceptionTime; return this; }

Target:
public VertxOptions setWarningExceptionTime(long warningExceptionTime) { if (warningExceptionTime < 1) { throw new IllegalArgumentException("warningExceptionTime must be > 0"); } this.warningExceptionTime = warningExceptionTime; return this; }
Source:
private void checkExecStringArrayArgument(NewArrayTree newArrayTree) { List<ExpressionTree> initializers = newArrayTree.initializers(); if (initializers.size() < 3) { return; } if (!chmodCommand(initializers.get(0)).isPresent()) { return; } ExpressionTree modeArg = initializers.get(1); if (initializers.size() > 3 && isRecursiveArgument(modeArg)) { modeArg = initializers.get(2); } if (modeArg.asConstant(String.class).filter(FilePermissionsCheck::isSensisitiveChmodMode).isPresent()) { reportIssue(modeArg, ISSUE_MESSAGE); } }

Target:
private void checkExecStringArrayArgument(NewArrayTree newArrayTree) { List<ExpressionTree> initializers = newArrayTree.initializers(); if (initializers.size() < 3 || !chmodCommand(initializers.get(0)).isPresent()) { return; } for (int i = 1; i < initializers.size(); i++) { ExpressionTree arg = initializers.get(i); if (arg.asConstant(String.class).filter(FilePermissionsCheck::isSensisitiveChmodMode).isPresent()) { reportIssue(arg, ISSUE_MESSAGE); } } }
Source:
private Mono<HttpResponse> attemptAsync(final HttpPipelineCallContext context, final HttpPipelineNextPolicy next, final HttpRequest originalHttpRequest, final int tryCount) { context.setHttpRequest(originalHttpRequest.copy()); return next.clone().process() .flatMap(httpResponse -> { if (shouldRetry(httpResponse, tryCount)) { logger.info("[Retrying] Try count: {}, HTTP response: {}, Original HTTP Request: {}", tryCount, httpResponse, originalHttpRequest); return attemptAsync(context, next, originalHttpRequest, tryCount + 1) .delaySubscription(determineDelayDuration(httpResponse)); } else { return Mono.just(httpResponse); } }) .onErrorResume(err -> { if (tryCount < maxRetries) { logger.info("[Error Resume] Try count: {}, Error: {}, Original HTTP Request: {}", tryCount, err, originalHttpRequest); return attemptAsync(context, next, originalHttpRequest, tryCount + 1) .delaySubscription(this.delayDuration); } else { return Mono.error(err); } }); }

Target:
private Mono<HttpResponse> attemptAsync(final HttpPipelineCallContext context, final HttpPipelineNextPolicy next, final HttpRequest originalHttpRequest, final int tryCount) { context.setHttpRequest(originalHttpRequest.copy()); return next.clone().process() .flatMap(httpResponse -> { if (shouldRetry(httpResponse, tryCount)) { final Duration delayDuration = determineDelayDuration(httpResponse); logger.verbose("[Retrying] Try count: {}, Delay duration in seconds: {}", tryCount, delayDuration.getSeconds()); return attemptAsync(context, next, originalHttpRequest, tryCount + 1) .delaySubscription(delayDuration); } else { return Mono.just(httpResponse); } }) .onErrorResume(err -> { if (tryCount < maxRetries) { logger.verbose("[Error Resume] Try count: {}, Error: {}", tryCount, err); return attemptAsync(context, next, originalHttpRequest, tryCount + 1) .delaySubscription(this.delayDuration); } else { return Mono.error(err); } }); }
Source:
String getEndpointPath() { return callContext.getEndpoint().getEndpointPath(); }

Target:
String getEndpointPath() { return getEndpoint().getEndpointPath(); }
Source:
public void interruptingLocalLeaderElectionTerminates() throws IOException { Path tempDir = Files.createTempDirectory("foo"); Leaders.LocalPaxosServices localPaxosServices = Leaders.createAndRegisterLocalServices( metricsManager, environment, ImmutableLeaderConfig.builder() .localServer("https://example") .quorumSize(1) .addLeaders("https://example") .acceptorLogDir(tempDir.resolve("acceptor").toFile()) .learnerLogDir(tempDir.resolve("learner").toFile()) .build(), () -> ImmutableLeaderRuntimeConfig.builder().build(), USER_AGENT); LeaderElectionService leader = localPaxosServices.leaderElectionService(); LockService lockService = LockServiceImpl.create(); LockService leadershipLock = AwaitingLeadershipProxy.newProxyInstance( LockService.class, () -> lockService, leader); LockService localOrRemoteLock = LocalOrRemoteProxy.newProxyInstance( LockService.class, leadershipLock, null, CompletableFuture.completedFuture(true)); try { Thread.currentThread().interrupt(); localOrRemoteLock.currentTimeMillis(); fail("expected InterruptedException"); } catch (UndeclaredThrowableException e) { assertThat(e.getCause()).isInstanceOf(InterruptedException.class); } }

Target:
public void interruptingLocalLeaderElectionTerminates() throws IOException { Leaders.LocalPaxosServices localPaxosServices = Leaders.createAndRegisterLocalServices( metricsManager, environment, ImmutableLeaderConfig.builder() .localServer("https://example") .quorumSize(1) .addLeaders("https://example") .acceptorLogDir(temporaryFolder.newFolder()) .learnerLogDir(temporaryFolder.newFolder()) .build(), () -> ImmutableLeaderRuntimeConfig.builder().build(), USER_AGENT); LeaderElectionService leader = localPaxosServices.leaderElectionService(); LockService lockService = LockServiceImpl.create(); LockService leadershipLock = AwaitingLeadershipProxy.newProxyInstance( LockService.class, () -> lockService, leader); LockService localOrRemoteLock = LocalOrRemoteProxy.newProxyInstance( LockService.class, leadershipLock, null, CompletableFuture.completedFuture(true)); try { Thread.currentThread().interrupt(); assertThatCode(localOrRemoteLock::currentTimeMillis) .as("proxy correctly handles interrupts") .isInstanceOf(SafeIllegalStateException.class); assertThat(Thread.currentThread().isInterrupted()); } finally { Thread.interrupted(); } }
Source:
private static Set<Class<?>> findExceptionContextClasses() { final String[] classNames = new String[] { "org.apache.commons.lang3.exception.ExceptionContext", "com.joyent.manta.org.apache.commons.lang3.exception.ExceptionContext" }; final Set<Class<?>> classes = new LinkedHashSet<>(classNames.length); for (String className : classNames) { try { classes.add(Class.forName(className)); } catch (ClassNotFoundException ignored) { } } return Collections.unmodifiableSet(classes); }

Target:
private static Set<Class<?>> findExceptionContextClasses() { final String[] classNames = new String[] { "org.apache.commons.lang3.exception.ExceptionContext" }; final Set<Class<?>> classes = new LinkedHashSet<>(classNames.length); for (String className : classNames) { try { classes.add(Class.forName(className)); } catch (ClassNotFoundException ignored) { } } return Collections.unmodifiableSet(classes); }
Source:
public Builder toBuilder() { return new Builder(); }

Target:
public Builder toBuilder() { return new Builder() .setIdTokenProvider(this.idTokenProvider) .setTargetAudience(this.targetAudience) .setOptions(this.options); }