auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void createControl(final Composite parent) { final Composite panel = new Composite(parent, SWT.NULL); final GridLayout layout = new GridLayout(); layout.numColumns = 1; panel.setLayout(layout); createDestinationGroup(panel); createConfigGroup(panel); importProjectsButton = new Button(panel, SWT.CHECK); importProjectsButton .setText("Import all projects after clone finishes"); Dialog.applyDialogFont(panel); setControl(panel); checkPage(); }

Target:
public void createControl(final Composite parent) { final Composite panel = new Composite(parent, SWT.NULL); final GridLayout layout = new GridLayout(); layout.numColumns = 1; panel.setLayout(layout); createDestinationGroup(panel); createConfigGroup(panel); importProjectsButton = new Button(panel, SWT.CHECK); importProjectsButton.setText(UIText.CloneDestinationPage_importButton); Dialog.applyDialogFont(panel); setControl(panel); checkPage(); }
Source:
public boolean lock(long timeout, TimeUnit unit) { long startTime = System.currentTimeMillis(); long lockTimeout = TimeUnit.MILLISECONDS.convert(timeout, unit); Random random = new Random(); while ((System.currentTimeMillis() - startTime) < lockTimeout) { try { leaseId.getAndSet(leaseBlobManager.acquireLease(LEASE_TIME_IN_SEC, leaseId.get())); } catch (AzureException e) { return false; } if (leaseId.get() != null) { LOG.info("Acquired lock!"); hasLock.set(true); return true; } else { try { Thread.sleep(random.nextInt(1000)); } catch (InterruptedException e) { Thread.interrupted(); } LOG.info("Trying to acquire lock again..."); } } return false; }

Target:
public boolean lock(long timeout, TimeUnit unit) { long startTime = System.currentTimeMillis(); long lockTimeout = TimeUnit.MILLISECONDS.convert(timeout, unit); Random random = new Random(); while ((System.currentTimeMillis() - startTime) < lockTimeout) { try { leaseId.getAndSet(leaseBlobManager.acquireLease(LEASE_TIME_IN_SEC, leaseId.get())); } catch (AzureException e) { return false; } if (leaseId.get() != null) { LOG.info("Acquired lock!"); hasLock.getAndSet(true); return true; } else { try { Thread.sleep(random.nextInt(1000)); } catch (InterruptedException e) { Thread.interrupted(); } LOG.info("Trying to acquire lock again..."); } } return false; }
Source:
private void logChange(ArtifactReadable artifact, IAttributeType attrType, String currValue, String newValue) { System.err.println( String.format("Attr Values not same; Current [%s], new [%s] for attr type [%s] and artifact %s", currValue, newValue, attrType, artifact.toStringWithId())); }

Target:
private void logChange(ArtifactReadable artifact, IAttributeType attrType, String currValue, String newValue) { results.logWithFormat("Attr Values not same; Current [%s], new [%s] for attr type [%s] and artifact %s", currValue, newValue, attrType, artifact.toStringWithId()); }
Source:
public void testCreateWithSsh() throws InterruptedException { server.enqueue( new MockResponse().setBody(stringFromResource("/volume/get.json")) ); List<String> sshKeys = new ArrayList<String>(); sshKeys.add("hQGOEJeFL91EG3+l9TtRbWNjzhDVHeLuL3NWee6bekA="); Volume volume = volumeApi().createVolume( Volume.Request.creatingBuilder() .dataCenterId("datacenter-id") .name("jclouds-volume") .size(3) .type("HDD") .licenceType(LicenceType.LINUX) .sshKeys(sshKeys) .build()); assertNotNull(volume); assertNotNull(volume.id()); assertEquals(server.getRequestCount(), 1); assertSent(server, "POST", "/rest/datacenters/datacenter-id/volumes", "{\"properties\": {\"name\": \"jclouds-volume\", \"size\": 3, \"licenceType\": \"LINUX\", \"sshKeys\":[\"hQGOEJeFL91EG3+l9TtRbWNjzhDVHeLuL3NWee6bekA=\"], \"type\":\"HDD\"}}" ); }

Target:
public void testCreateWithSsh() throws InterruptedException { server.enqueue( new MockResponse().setBody(stringFromResource("/volume/get.json")) ); HashSet<String> sshKeys = new HashSet<String>(); sshKeys.add("hQGOEJeFL91EG3+l9TtRbWNjzhDVHeLuL3NWee6bekA="); Volume volume = volumeApi().createVolume( Volume.Request.creatingBuilder() .dataCenterId("datacenter-id") .name("jclouds-volume") .size(3) .type(VolumeType.HDD) .licenceType(LicenceType.LINUX) .sshKeys(sshKeys) .build()); assertNotNull(volume); assertNotNull(volume.id()); assertEquals(server.getRequestCount(), 1); assertSent(server, "POST", "/datacenters/datacenter-id/volumes", "{\"properties\": {\"name\": \"jclouds-volume\", \"size\": 3, \"licenceType\": \"LINUX\", \"sshKeys\":[\"hQGOEJeFL91EG3+l9TtRbWNjzhDVHeLuL3NWee6bekA=\"], \"type\":\"HDD\"}}" ); }
Source:
private void interpolateElevationsOfPillarNodes() { final EdgeIterator edge = storage.getAllEdges(); while (edge.next()) { if (isStructureEdge(edge)) { int firstNodeId = edge.getBaseNode(); int secondNodeId = edge.getAdjNode(); double lat0 = storage.getNodeAccess().getLat(firstNodeId); double lon0 = storage.getNodeAccess().getLon(firstNodeId); double ele0 = storage.getNodeAccess().getEle(firstNodeId); double lat1 = storage.getNodeAccess().getLat(secondNodeId); double lon1 = storage.getNodeAccess().getLon(secondNodeId); double ele1 = storage.getNodeAccess().getEle(secondNodeId); final PointList pointList = edge.fetchWayGeometry(0); final int count = pointList.size(); for (int index = 0; index < count; index++) { double lat = pointList.getLat(index); double lon = pointList.getLon(index); double ele = elevationInterpolator.calculateElevation(lat, lon, lat0, lon0, ele0, lat1, lon1, ele1); pointList.set(index, lat, lon, ele); } edge.setWayGeometry(pointList); } } }

Target:
private void interpolateElevationsOfPillarNodes() { final EdgeIterator edge = storage.getAllEdges(); final NodeAccess nodeAccess = storage.getNodeAccess(); while (edge.next()) { if (isInterpolatableEdge(edge)) { int firstNodeId = edge.getBaseNode(); int secondNodeId = edge.getAdjNode(); double lat0 = nodeAccess.getLat(firstNodeId); double lon0 = nodeAccess.getLon(firstNodeId); double ele0 = nodeAccess.getEle(firstNodeId); double lat1 = nodeAccess.getLat(secondNodeId); double lon1 = nodeAccess.getLon(secondNodeId); double ele1 = nodeAccess.getEle(secondNodeId); final PointList pointList = edge.fetchWayGeometry(0); final int count = pointList.size(); for (int index = 0; index < count; index++) { double lat = pointList.getLat(index); double lon = pointList.getLon(index); double ele = elevationInterpolator.calculateElevationBasedOnTwoPoints(lat, lon, lat0, lon0, ele0, lat1, lon1, ele1); pointList.set(index, lat, lon, ele); } edge.setWayGeometry(pointList); } } }
Source:
public static void loadBasicInformation(GerritClient gerrit, ChangeInfo toRefresh) { ChangeInfo newChangeInfo = QueryHelpers.queryBasicInformation(gerrit, toRefresh.getId()); mergeNewInformation(toRefresh, newChangeInfo); QueryHelpers.loadRevisionDetails(gerrit, toRefresh.getUserSelectedRevision()); }

Target:
public static void loadBasicInformation(GerritClient gerrit, ChangeInfo toRefresh) { ChangeInfo newChangeInfo = QueryHelpers.queryBasicInformation(gerrit, toRefresh.getId()); mergeNewInformation(toRefresh, newChangeInfo); }
Source:
public GenericColumn get() { if (nullValueBitmap.isEmpty()) { return new DoublesColumn(column.get()); } else { return new DoublesColumnWithNulls(column.get(), nullValueBitmap); } }

Target:
public GenericColumn get() { return DoublesColumn.create(column.get(), nullValueBitmap); }
Source:
public PollResult poll(boolean initial, Object checkPoint) throws Exception { Map<String, Object> map = new HashMap<String, Object>(); for(PropertyWithDeploymentContext prop: tableCache.getProperties()){ if(prop.getContextKey() == contextKey && prop.getContextValue().equalsIgnoreCase(cfg.getString(prop.getContextKey().getKey()))){ map.put(prop.getPropertyName(), prop.getPropertyValue()); } } return PollResult.createFull(map); }

Target:
public PollResult poll(boolean initial, Object checkPoint) throws Exception { Map<String, Object> map = new HashMap<String, Object>(); for(PropertyWithDeploymentContext prop: tableCache.getProperties()){ if(prop.getContextKey() == contextKey && prop.getContextValue() == null){ map.put(prop.getPropertyName(), prop.getPropertyValue()); } else if(prop.getContextKey() == contextKey && prop.getContextValue().equalsIgnoreCase(deploymentContext.getValue(contextKey))){ map.put(prop.getPropertyName(), prop.getPropertyValue()); } } return PollResult.createFull(map); }
Source:
public AdminMetrics(MetricRegistry metricRegistry) { unknownActionErrorCount = metricRegistry.counter(MetricRegistry.name(AdminBlobStorageService.class, "unknownActionErrorCount")); }

Target:
public AdminMetrics(MetricRegistry metricRegistry) { }
Source:
public static String getQName(PsiElement[] fileChildren, final String result, boolean searchInSamePackage) { final HaxeImportStatement importStatement = (HaxeImportStatement)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(); final String packageName = getPackageName( (HaxePackageStatement)Arrays.stream(fileChildren) .filter(element -> element instanceof HaxePackageStatement) .findFirst() .orElse(null) ); final HaxeClass classForType = (HaxeClass)ContainerUtil.find(fileChildren, new Condition<PsiElement>() { @Override public boolean value(PsiElement element) { return element instanceof HaxeClass && result.equals(((HaxeClass)element).getName()); } }); if (classForType != null) { return classForType.getQualifiedName(); } else if (importStatement != null && importStatementExpression != null) { return importStatementExpression.getText(); } else if (searchInSamePackage && !packageName.isEmpty()) { return packageName + "." + result; } return result; }

Target:
public static String getQName(PsiElement[] fileChildren, final String result, boolean searchInSamePackage) { 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(); final String packageName = getPackageName( (HaxePackageStatement)Arrays.stream(fileChildren) .filter(element -> element instanceof HaxePackageStatement) .findFirst() .orElse(null) ); final HaxeClass classForType = (HaxeClass)ContainerUtil.find(fileChildren, new Condition<PsiElement>() { @Override public boolean value(PsiElement element) { return element instanceof HaxeClass && result.equals(((HaxeClass)element).getName()); } }); if (classForType != null) { return classForType.getQualifiedName(); } else if (importStatement != null && importStatementExpression != null) { return importStatementExpression.getText(); } else if (searchInSamePackage && !packageName.isEmpty()) { return packageName + "." + result; } return result; }
Source:
private boolean addOncogenicMutations(Alteration exactAlt, Set<Alteration> relevantAlts) { boolean add = false; if (!isKitSpecialVariants(exactAlt)) { if (!exactAlt.getAlteration().trim().equalsIgnoreCase("amplification")) { Set<Oncogenicity> oncogenicities = AlterationUtils.getCuratedOncogenicity(exactAlt); boolean has = AlterationUtils.hasImportantCuratedOncogenicity(oncogenicities); if (has) { Boolean isOncogenic = AlterationUtils.hasOncogenic(oncogenicities); if (isOncogenic != null && isOncogenic) { add = true; } } else { for (Alteration alt : relevantAlts) { Boolean isOncogenic = AlterationUtils.isOncogenicAlteration(alt); if (isOncogenic != null && isOncogenic) { add = true; break; } } } } } return add; }

Target:
private boolean addOncogenicMutations(Alteration exactAlt, Set<Alteration> relevantAlts) { boolean add = false; if (!isKitSpecialVariants(exactAlt)) { if (!exactAlt.getAlteration().trim().equalsIgnoreCase("amplification")) { Set<Oncogenicity> oncogenicities = AlterationUtils.getCuratedOncogenicity(exactAlt); boolean has = AlterationUtils.hasImportantCuratedOncogenicity(oncogenicities); if (has) { Boolean isOncogenic = AlterationUtils.hasOncogenic(oncogenicities); if (isOncogenic != null && isOncogenic) { add = true; } } else { for (Alteration alt : relevantAlts) { Boolean isOncogenic = AlterationUtils.isOncogenicAlteration(alt); if (isOncogenic != null && isOncogenic && !isKitSpecialVariants(alt)) { add = true; break; } } } } } return add; }
Source:
public void testCollectionFirstInvalid() throws Throwable { form.setListProperty(Arrays.asList("ああa", "ああ")); Validator validator = Validation.buildDefaultValidatorFactory() .getValidator(); Set<ConstraintViolation<ByteMaxTestForm>> violations = validator .validate(form); assertThat(violations, is(notNullValue())); assertThat(violations.size(), is(1)); assertThat(violations.iterator().next().getPropertyPath().toString(), is("listProperty[0].<list element>")); assertThat(violations.iterator().next().getMessage(), is(String.format( MESSAGE_VALIDATION_ERROR, 6))); }

Target:
public void testCollectionFirstInvalid() { form.setListProperty(Arrays.asList("ああa", "ああ")); Validator validator = Validation.buildDefaultValidatorFactory() .getValidator(); Set<ConstraintViolation<ByteMaxTestForm>> violations = validator .validate(form); assertThat(violations, is(notNullValue())); assertThat(violations.size(), is(1)); ConstraintViolation<ByteMaxTestForm> v = violations.iterator().next(); assertThat(v.getPropertyPath().toString(), is( "listProperty[0].<list element>")); assertThat(v.getMessage(), is(String.format(MESSAGE_VALIDATION_ERROR, 6))); }
Source:
public void addProcessDefinition(String deploymentId, String processId, Object processDescriptor, KieContainer kieContainer) { Map<String, ProcessDescriptor> definitions = null; synchronized (definitionCache) { definitions = definitionCache.get(deploymentId); if (definitions == null) { definitions = new ConcurrentHashMap<String, ProcessDescriptor>(); definitionCache.put(deploymentId, definitions); } ProcessDescriptor descriptor = (ProcessDescriptor) processDescriptor; ProcessAssetDesc definition = descriptor.getProcess(); if( kieContainer != null && descriptor.hasUnresolvedReusableSubProcessNames() ) { descriptor.resolveReusableSubProcessNames(kieContainer.getKieBase().getProcesses()); } definition.setReusableSubProcesses(descriptor.getReusableSubProcesses()); definitions.put(processId, descriptor); } }

Target:
public void addProcessDefinition(String deploymentId, String processId, Object processDescriptor, KieContainer kieContainer) { Map<String, ProcessDescriptor> definitions = null; synchronized (definitionCache) { Map<String, ProcessDescriptor> newDef = new ConcurrentHashMap<String, ProcessDescriptor>(); definitions = definitionCache.putIfAbsent(deploymentId, newDef); if( definitions == null ) { definitions = newDef; } ProcessDescriptor descriptor = (ProcessDescriptor) processDescriptor; ProcessAssetDesc definition = descriptor.getProcess(); if( kieContainer != null && descriptor.hasUnresolvedReusableSubProcessNames() ) { descriptor.resolveReusableSubProcessNames(kieContainer.getKieBase().getProcesses()); } definition.setReusableSubProcesses(descriptor.getReusableSubProcesses()); definitions.put(processId, descriptor); } }
Source:
void loadClasspathResource(String location) throws IOException { Objects.requireNonNull(location, "location"); InputStream is = getClass().getResourceAsStream(location); if (is == null) { throw new IllegalArgumentException("Resource " + location + " not found in the classpath"); } load(new InputStreamReader(is, Charset.defaultCharset())); }

Target:
void loadClasspathResource(String location) throws IOException { Objects.requireNonNull(location, "location"); InputStream is = getClass().getResourceAsStream(location); if (is == null) { throw new IllegalArgumentException("Resource " + location + " not found in the classpath"); } load(new InputStreamReader(is, StandardCharsets.UTF_8)); }
Source:
public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if(responses.isEmpty()){ return ""; } StringBuilder csv = new StringBuilder(); boolean hasAssignedWeights = hasAssignedWeights(); for (int i = 0; i < rubricChoices.size(); i++) { String header = rubricChoices.get(i); if (hasAssignedWeights) { header += ("(" + rubricWeights.get(i) + ")"); } csv.append("," + Sanitizer.sanitizeForCsv(header)); } if (hasAssignedWeights) { csv.append("," + "Average"); } csv.append(Const.EOL); DecimalFormat df = new DecimalFormat("#"); DecimalFormat dfAverage = new DecimalFormat("0.00"); int[][] responseFrequency = calculateResponseFrequency(responses, this); double[][] rubricStats = calculateRubricStats(responses, question); for (int i = 0; i < rubricSubQuestions.size(); i++) { String alphabeticalIndex = StringHelper.integerToLowerCaseAlphabeticalIndex(i + 1); csv.append(Sanitizer.sanitizeForCsv(alphabeticalIndex + ") " + rubricSubQuestions.get(i))); for (int j = 0; j < rubricChoices.size(); j++) { String percentageFrequency = df.format(rubricStats[i][j] * 100) + "%"; csv.append("," + percentageFrequency + " (" + responseFrequency[i][j] + ")"); } if (hasAssignedWeights) { csv.append("," + dfAverage.format(rubricStats[i][numOfRubricChoices])); } csv.append(Const.EOL); } return csv.toString(); }

Target:
public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if (responses.isEmpty()) { return ""; } StringBuilder csv = new StringBuilder(); DecimalFormat dfWeight = new DecimalFormat("#.##"); for (int i = 0; i < rubricChoices.size(); i++) { String header = rubricChoices.get(i); if (hasAssignedWeights) { header += " (Weight: " + dfWeight.format(rubricWeights.get(i)) + ")"; } csv.append(',').append(Sanitizer.sanitizeForCsv(header)); } if (hasAssignedWeights) { csv.append(",Average"); } csv.append(Const.EOL); DecimalFormat df = new DecimalFormat("#"); DecimalFormat dfAverage = new DecimalFormat("0.00"); int[][] responseFrequency = calculateResponseFrequency(responses, this); float[][] rubricStats = calculateRubricStats(responses, question); for (int i = 0; i < rubricSubQuestions.size(); i++) { String alphabeticalIndex = StringHelper.integerToLowerCaseAlphabeticalIndex(i + 1); csv.append(Sanitizer.sanitizeForCsv(alphabeticalIndex + ") " + rubricSubQuestions.get(i))); for (int j = 0; j < rubricChoices.size(); j++) { String percentageFrequency = df.format(rubricStats[i][j] * 100) + "%"; csv.append("," + percentageFrequency + " (" + responseFrequency[i][j] + ")"); } if (hasAssignedWeights) { csv.append(',').append(dfAverage.format(rubricStats[i][rubricWeights.size()])); } csv.append(Const.EOL); } return csv.toString(); }
Source:
public static Image map(RepoImage entity, Image template) { Image model = template != null ? template : new Image(); model.setId(entity.getRepoImageId()); model.setName(entity.getRepoImageName()); if (entity.getSize() != null) { model.setSize(entity.getSize()); } model.setFileType(map(entity.getFileType(), null)); return model; }

Target:
public static Image map(RepoImage entity, Image template) { Image model = template != null ? template : new Image(); model.setId(entity.getRepoImageId()); model.setName(entity.getRepoImageName()); model.setSize(entity.getSize()); model.setFileType(map(entity.getFileType(), null)); return model; }
Source:
public Map<Variable, Term> patternMatch(Term subject, Term pattern) { substitution = Maps.newHashMapWithExpectedSize(32); tasks.clear(); taskBuffer.clear(); tasks.addFirst(Pair.of(subject, pattern)); failed = false; if (match()) { if (termContext.definition().context().krunOptions != null && termContext.definition().context().krunOptions.experimental.prove() != null) { PatternMatcher.evaluateSubstitution(substitution, termContext); } return substitution; } else { return null; } }

Target:
public Map<Variable, Term> patternMatch(Term subject, Term pattern) { substitution = Maps.newHashMapWithExpectedSize(32); tasks.clear(); taskBuffer.clear(); tasks.addFirst(Pair.of(subject, pattern)); failed = false; if (match()) { if (termContext.definition().context().krunOptions != null && termContext.definition().context().krunOptions.experimental.prove != null) { PatternMatcher.evaluateSubstitution(substitution, termContext); } return substitution; } else { return null; } }
Source:
void updateTimeRangeSelectionPieChart() { if (getTimeRangePC() == null) { fTimeRangePC = new PieChart(this, SWT.NONE); getTimeRangePC().getTitle().setText(fTimeRangePCname); getTimeRangePC().getAxisSet().getXAxis(0).getTitle().setText(""); getTimeRangePC().getLegend().setPosition(SWT.BOTTOM); getTimeRangePC().getLegend().setVisible(true); getTimeRangePC().addListener(SWT.MouseMove, fMouseListener); } else if (getTimeRangePC().isDisposed()) { return; } Map<String, Long> totalEventCountForChart = getTotalEventCountForChart(false); if(totalEventCountForChart == null){ return; } updatePieChartWithData(fTimeRangePC, totalEventCountForChart, MIN_PRECENTAGE_TO_SHOW_SLICE, fOthersSliceName); }

Target:
synchronized void updateTimeRangeSelectionPieChart() { if (getTimeRangePC() == null) { fTimeRangePC = new PieChart(this, SWT.NONE); getTimeRangePC().getTitle().setText(fTimeRangePCname); getTimeRangePC().getAxisSet().getXAxis(0).getTitle().setText(""); getTimeRangePC().getLegend().setPosition(SWT.BOTTOM); getTimeRangePC().getLegend().setVisible(true); getTimeRangePC().addListener(SWT.MouseMove, fMouseListener); } else if (getTimeRangePC().isDisposed()) { return; } Map<String, Long> totalEventCountForChart = getTotalEventCountForChart(false); if(totalEventCountForChart == null){ return; } updatePieChartWithData(fTimeRangePC, totalEventCountForChart, MIN_PRECENTAGE_TO_SHOW_SLICE, fOthersSliceName); }
Source:
protected void configure() { bind(GsonModule.DateAdapter.class).to(GsonModule.Iso8601DateAdapter.class); }

Target:
protected void configure() { bind(DateAdapter.class).to(Iso8601DateAdapter.class); }
Source:
public ATCommandResponse(ATCommand command, byte[] response, ATCommandStatus status) { this.command = command; this.response = response; this.status = status; }

Target:
public ATCommandResponse(ATCommand command, byte[] response, ATCommandStatus status) { if (command == null) throw new NullPointerException("Command cannot be null."); if (response == null) throw new NullPointerException("Response cannot be null."); if (status == null) throw new NullPointerException("Status cannot be null."); this.command = command; this.response = response; this.status = status; }
Source:
public static boolean isTrivialRebase(Project.NameKey project, Repository git, RevCommit prior, RevCommit next) { if (!next.getFullMessage().equals(prior.getFullMessage())) { return false; } if (next.getTree() == prior.getTree()) { return true; } if (next.getParentCount() != 1) { return false; } try { ThreeWayMerger merger = MergeStrategy.RESOLVE.newMerger(git, true); merger.setBase(prior.getParent(0)); return merger.merge(next.getParent(0), prior) && merger.getResultTreeId().equals(next.getTree()); } catch (IOException err) { log.warn("Cannot check trivial rebase of new patch set " + next.name() + " in " + project.get(), err); return false; } }

Target:
public static boolean isTrivialRebase(Project.NameKey project, Repository git, RevCommit prior, RevCommit next) { if (!next.getFullMessage().equals(prior.getFullMessage())) { return false; } if (prior.getParentCount() != 1 || next.getParentCount() != 1) { return false; } if (next.getTree() == prior.getTree() && prior.getParent(0).equals(next.getParent(0))) { return true; } try { ThreeWayMerger merger = MergeStrategy.RESOLVE.newMerger(git, true); merger.setBase(prior.getParent(0)); return merger.merge(next.getParent(0), prior) && merger.getResultTreeId().equals(next.getTree()); } catch (IOException err) { log.warn("Cannot check trivial rebase of new patch set " + next.name() + " in " + project.get(), err); return false; } }
Source:
public void setValues() { fontOverrideProperty.setValue(preferences.getBoolean(JabRefPreferences.OVERRIDE_DEFAULT_FONT_SIZE)); fontSizeProperty.setValue(String.valueOf(preferences.getInt(JabRefPreferences.MAIN_FONT_SIZE))); fontTweaksLinuxProperty.setValue(preferences.getBoolean(JabRefPreferences.FX_FONT_RENDERING_TWEAK)); switch (preferences.get(JabRefPreferences.FX_THEME)) { case ThemeLoader.MAIN_CSS: themeLightProperty.setValue(true); themeDarkProperty.setValue(false); break; case ThemeLoader.DARK_CSS: themeLightProperty.setValue(false); themeDarkProperty.setValue(true); break; default: themeLightProperty.setValue(false); themeDarkProperty.setValue(false); } }

Target:
public void setValues() { fontOverrideProperty.setValue(preferences.getBoolean(JabRefPreferences.OVERRIDE_DEFAULT_FONT_SIZE)); fontSizeProperty.setValue(String.valueOf(preferences.getInt(JabRefPreferences.MAIN_FONT_SIZE))); switch (preferences.get(JabRefPreferences.FX_THEME)) { case ThemeLoader.DARK_CSS: themeLightProperty.setValue(false); themeDarkProperty.setValue(true); break; case ThemeLoader.MAIN_CSS: default: themeLightProperty.setValue(true); themeDarkProperty.setValue(false); } }
Source:
public Receive createReceive() { return receiveBuilder() .match(AntiEntropyTick.class, message -> { LOGGER.info() .setMessage("ticking") .addData("organization", _organization) .addData("repositoryType", _repositoryType) .log(); if (_currentlyExecuting) { return; } LOGGER.info() .setMessage("starting anti-entropy") .addData("organization", _organization) .addData("repositoryType", _repositoryType) .log(); getContext().getSystem().scheduler().scheduleOnce( scala.concurrent.duration.Duration.Zero(), () -> { try { runAntiEntropy(); } finally { getSelf().tell(AntiEntropyFinished.INSTANCE, getSelf()); } }, getContext().getSystem().dispatcher()); }) .match(AntiEntropyFinished.class, message -> { _currentlyExecuting = false; }) .build(); }

Target:
public Receive createReceive() { return receiveBuilder() .match(AntiEntropyTick.class, message -> { LOGGER.debug() .setMessage("ticking") .addData("repositoryType", _repositoryType) .log(); if (_currentlyExecuting) { return; } getContext().getSystem().scheduler().scheduleOnce( scala.concurrent.duration.Duration.Zero(), createAntiEntropyRunnable(), getContext().dispatcher()); }) .match(AntiEntropyFinished.class, message -> { _currentlyExecuting = false; }) .build(); }
Source:
public boolean equals(Object o) { if (o == null || o.getClass() != getClass()) { return false; } if (o == this) { return true; } AbstractOpenshiftUIElement<?, ?> other= (AbstractOpenshiftUIElement<?, ?>) o; return wrapped.equals(other.getWrapped()) && (getParent() == null && other.getParent() == null || getParent().equals(other.getParent())); }

Target:
public boolean equals(Object o) { if (o == null || o.getClass() != getClass()) { return false; } if (o == this) { return true; } AbstractOpenshiftUIElement<?, ?> other= (AbstractOpenshiftUIElement<?, ?>) o; return wrapped.equals(other.getWrapped()) && ( getParent() != null && getParent().equals(other.getParent()) || getParent() == null && other.getParent() == null ); }
Source:
public Set<Route> getRoutes (String stop_id) { return feed.patterns.values().stream() .filter(p -> p.orderedStops.contains(stop_id)) .map(p -> feed.routes.get(p.route_id)) .collect(Collectors.toSet()); }

Target:
public List<Route> getRoutes (String stop_id) { return feed.patterns.values().stream() .filter(p -> p.orderedStops.contains(stop_id)) .distinct() .map(p -> feed.routes.get(p.route_id)) .collect(Collectors.toList()); }
Source:
public LexicalScope getChild(String name) { if (name.equals(EVENT_HEADER_ID.getName())) { return EVENT_HEADER_ID; } if (name.equals(EVENT_HEADER_V.getName())) { return EVENT_HEADER_V; } return super.getChild(name); }

Target:
public ILexicalScope getChild(String name) { if (name.equals(EVENT_HEADER_ID.getName())) { return EVENT_HEADER_ID; } if (name.equals(EVENT_HEADER_V.getName())) { return EVENT_HEADER_V; } return super.getChild(name); }
Source:
public DetectorTask restoreRedundancy(Layout layout){ return restoreRedundancyAndMergeSegments(layout); }

Target:
public void restoreRedundancy(Layout layout) { restoreRedundancyAndMergeSegments(layout); }
Source:
public Collection<IInstallableUnit> getMandatoryUnits() { return additionalUnits.values(); }

Target:
public Collection<IInstallableUnit> getMandatoryUnits() { return Collections.emptyList(); }
Source:
<T> List<Invoker<T>> route(List<Invoker<T>> invokers, URL url, Invocation invocation) throws RpcException; Integer getPriority(); @Override default int compareTo(Router o) { if (o == null) { throw new IllegalArgumentException(); } if (this.getPriority().equals(o.getPriority())) { if (o.getUrl() == null) { return -1; } return getUrl().toFullString().compareTo(o.getUrl().toFullString()); } else { return getPriority() > o.getPriority() ? 1 : -1; } }

Target:
<T> List<Invoker<T>> route(List<Invoker<T>> invokers, URL url, Invocation invocation) throws RpcException; int getPriority(); @Override default int compareTo(Router o) { if (o == null) { throw new IllegalArgumentException(); } if (this.getPriority() == o.getPriority()) { if (o.getUrl() == null) { return -1; } return getUrl().toFullString().compareTo(o.getUrl().toFullString()); } else { return getPriority() > o.getPriority() ? 1 : -1; } }
Source:
public List<CycleCourseGroup> getSecondCycleDegreesWithAffinity(final CycleCourseGroup firstCycle) { return firstCycle.getDestinationAffinitiesSet().stream(). sorted(CycleCourseGroup.COMPARATOR_BY_PARENT_DEGREE_PRESENTATION_NAME).collect(Collectors.toList()); }

Target:
public List<CycleCourseGroup> getSecondCycleDegreesWithAffinity(final CycleCourseGroup firstCycle) { return firstCycle.getDestinationAffinitiesSet().stream(). sorted(Comparator.comparing(CycleCourseGroup::getParentDegreeCurricularPlan, DegreeCurricularPlan.COMPARATOR_BY_PRESENTATION_NAME)).collect(Collectors.toList()); }
Source:
void setServerErrorCode(final String errorCode) { if (null != errorCode && !errorCode.equals("0")) { setProperty(EventStrings.SERVER_ERROR_CODE, errorCode.trim()); } }

Target:
void setServerErrorCode(final String errorCode) { if (!StringExtensions.isNullOrBlank(errorCode) && !errorCode.equals("0")) { setProperty(EventStrings.SERVER_ERROR_CODE, errorCode.trim()); } }
Source:
public void addNotification() throws Exception { for (int i = 0; i < NO_OF_DEVICES; i++) { DeviceIdentifier testDeviceIdentifier = new DeviceIdentifier(DEVICE_ID_PREFIX + i, DEVICE_TYPE); Notification notification = mockNotification.getNotification(i, "CHECKED", testDeviceIdentifier.toString(), DEVICE_ID_PREFIX + i, 1, DEVICE_TYPE); NotificationManagementServiceImpl notificationManagementService = new NotificationManagementServiceImpl(); Assert.assertTrue(notificationManagementService.addNotification(testDeviceIdentifier, notification)); } }

Target:
public void addNotification() throws Exception { for (int i = 0; i < NO_OF_DEVICES; i++) { DeviceIdentifier testDeviceIdentifier = new DeviceIdentifier(DEVICE_ID_PREFIX + i, DEVICE_TYPE); Notification notification = TestDataHolder.getNotification(i, "CHECKED", testDeviceIdentifier.toString(), DEVICE_ID_PREFIX + i, 1, DEVICE_TYPE); NotificationManagementServiceImpl notificationManagementService = new NotificationManagementServiceImpl(); Assert.assertTrue(notificationManagementService.addNotification(testDeviceIdentifier, notification)); } }
Source:
public void run() { try { Long rescheduleAt = handler.tick(false); if (rescheduleAt == null) { scheduledPool.schedule(scheduleRunnable, 10, TimeUnit.MILLISECONDS); } else if (rescheduleAt != 0) { scheduledPool.schedule(scheduleRunnable, rescheduleAt - TimeUnit.NANOSECONDS.toMillis(System.nanoTime()), TimeUnit.MILLISECONDS); } } catch (Exception e) { log.warn(e.getMessage(), e); } }

Target:
public void run() { Long rescheduleAt = handler.tick(false); if (rescheduleAt == null) { scheduledPool.schedule(scheduleRunnable, 10, TimeUnit.MILLISECONDS); } else if (rescheduleAt != 0) { scheduledPool.schedule(scheduleRunnable, rescheduleAt - TimeUnit.NANOSECONDS.toMillis(System.nanoTime()), TimeUnit.MILLISECONDS); } }
Source:
public CroppingToolPageObject selectCrop() { cropImageButton.click(); return new CroppingToolPageObject(driver); }

Target:
public CroppingToolPageObject selectCrop() { waitAndClick(cropImageButton); return new CroppingToolPageObject(driver); }
Source:
public void run() { NsdClient nsdClientInstance = NsdClient.getInstance(getApplicationContext()); Log.d(TAG, "FriendCreationServiceThread Started"); while (!Thread.currentThread().isInterrupted()) { while (!nsdClientInstance.isEmptyFriendCreationQueue()){ try { TimeUnit.MILLISECONDS.sleep(delayInterval); Friend creatingFriend = nsdClientInstance.dequeueFriendCreationQueue(); Log.d(TAG, "Creating friend " + creatingFriend.getMac().toString()); FriendCreationRequest CreationRequest = new FriendCreationRequest(creatingFriend); ChatManager chatManager = ChatManager.getInstance(getApplicationContext()); chatManager.enqueueOutGoingMessageQueue(CreationRequest.convertMessageToJson()); } catch (InterruptedException e) { e.printStackTrace(); } } } }

Target:
public void run() { FriendCreationQueue friendCreationQueue = FriendCreationQueue.getInstance(); Log.d(TAG, "FriendCreationServiceThread Started"); while (!Thread.currentThread().isInterrupted()) { while (MessageServer.serviceStarted && !friendCreationQueue.isEmptyFriendCreationQueue()){ try { Friend creatingFriend = friendCreationQueue.topFriendCreationQueue(); Log.d(TAG, "Creating friend " + creatingFriend.getIp().toString()); FriendCreationRequest creationRequest = new FriendCreationRequest(creatingFriend,getApplicationContext()); ChatManager chatManager = ChatManager.getInstance(); chatManager.enqueueOutGoingMessageQueue(creationRequest.convertMessageToJson()); TimeUnit.MILLISECONDS.sleep(delayInterval); friendCreationQueue.dequeueFriendCreationQueue(); } catch (InterruptedException e) { e.printStackTrace(); } } } }
Source:
private void prefixTrim(CorfuPayloadMsg<TrimRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { try { TrimRequest req = msg.getPayload(); batchWriter.prefixTrim(req.getAddress(), msg.getEpoch()); r.sendResponse(ctx, msg, CorfuMsgType.ACK.msg()); } catch (TrimmedException ex) { r.sendResponse(ctx, msg, CorfuMsgType.ERROR_TRIMMED.msg()); } }

Target:
private void prefixTrim(CorfuPayloadMsg<TrimRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { try { TrimRequest req = msg.getPayload(); batchWriter.prefixTrim(req.getAddress().getSequence(), msg.getEpoch()); r.sendResponse(ctx, msg, CorfuMsgType.ACK.msg()); } catch (TrimmedException ex) { r.sendResponse(ctx, msg, CorfuMsgType.ERROR_TRIMMED.msg()); } }
Source:
void addThreadMetrics(List<MetricFamilySamples> sampleFamilies) { sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_current", "Current thread count of a JVM", threadBean.getThreadCount())); sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_daemon", "Daemon thread count of a JVM", threadBean.getDaemonThreadCount())); sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_peak", "Peak thread count of a JVM", threadBean.getPeakThreadCount())); sampleFamilies.add( new CounterMetricFamily( "jvm_threads_started_total", "Started thread count of a JVM", threadBean.getTotalStartedThreadCount())); sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_deadlocked", "Deadlocked thread count of a JVM", nullSafeArrayLength(threadBean.findDeadlockedThreads()))); sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_monitor_deadlocked", "Deadlocked monitor thread count of a JVM", nullSafeArrayLength(threadBean.findMonitorDeadlockedThreads()))); }

Target:
void addThreadMetrics(List<MetricFamilySamples> sampleFamilies) { sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_current", "Current thread count of a JVM", threadBean.getThreadCount())); sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_daemon", "Daemon thread count of a JVM", threadBean.getDaemonThreadCount())); sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_peak", "Peak thread count of a JVM", threadBean.getPeakThreadCount())); sampleFamilies.add( new CounterMetricFamily( "jvm_threads_started_total", "Started thread count of a JVM", threadBean.getTotalStartedThreadCount())); sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_deadlocked", "Cycles of JVM-threads that are in deadlock waiting to acquire object monitors or ownable synchronizers", nullSafeArrayLength(threadBean.findDeadlockedThreads()))); sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_deadlocked_monitor", "Cycles of JVM-threads that are in deadlock waiting to acquire object monitors", nullSafeArrayLength(threadBean.findMonitorDeadlockedThreads()))); }
Source:
protected void checkTryResources(final DetailAST resourcesSpecAst) { final DetailAST resourcesAst = resourcesSpecAst.findFirstToken(TokenTypes.RESOURCES); final IndentLevel expectedResourceIndent = new IndentLevel(getIndent().getFirstIndentLevel() + getIndentCheck().getLineWrappingIndentation()); final String subType = "resource"; DetailAST resourceAst = resourcesAst.getFirstChild(); while (resourceAst != null) { if (resourceAst.getType() == TokenTypes.RESOURCE) { final DetailAST nextSibling; if (resourceAst.getNextSibling() == null) { nextSibling = getTryResRparen(); } else { nextSibling = resourceAst.getNextSibling(); } if (isOnStartOfLine(resourceAst)) { checkChildIndentation(resourceAst, subType, expectedResourceIndent); checkWrappingIndentation( resourceAst, nextSibling, getIndentCheck().getLineWrappingIndentation(), expectedResourceIndent.getFirstIndentLevel(), true); } else { checkWrappingIndentation(resourceAst, nextSibling); } } resourceAst = resourceAst.getNextSibling(); } }

Target:
protected void checkTryResources(final DetailAST resourcesSpecAst) { final DetailAST resourcesAst = resourcesSpecAst.findFirstToken(TokenTypes.RESOURCES); final int indetation = getIndent().getFirstIndentLevel() + getIndentCheck().getLineWrappingIndentation(); final IndentLevel expectedResourceIndent = new IndentLevel(indetation); final String subType = "resource"; DetailAST resourceAst = resourcesAst.getFirstChild(); while (resourceAst != null) { if (resourceAst.getType() == TokenTypes.RESOURCE) { final DetailAST nextSibling; if (resourceAst.getNextSibling() == null) { nextSibling = getTryResRparen(); } else { nextSibling = resourceAst.getNextSibling(); } if (isOnStartOfLine(resourceAst)) { checkChildIndentation(resourceAst, subType, expectedResourceIndent); checkWrappingIndentation( resourceAst, nextSibling, getIndentCheck().getLineWrappingIndentation(), expectedResourceIndent.getFirstIndentLevel(), true); } else { checkWrappingIndentation(resourceAst, nextSibling); } } resourceAst = resourceAst.getNextSibling(); } }
Source:
public boolean isIpv4InSubnet(String networkAddress, String mask, String candidateAddress) { String netmask = IPv4MaskValidator.getInstance().getOctetNetmask(mask); Ipv4NetworkRange ipv4NetworkRange = ipAddressConverter.createIpv4NetworkRange(networkAddress, netmask); BigInteger ipToTestInt = ipAddressConverter.convertIpAddressToBigInt(candidateAddress); return ipv4NetworkRange.isInRange(ipToTestInt); }

Target:
public boolean isIpv4InSubnet(String networkAddress, String mask, String candidateAddress) { if (candidateAddress == null) { return true; } String netmask = IPv4MaskValidator.getInstance().getOctetNetmask(mask); Ipv4NetworkRange ipv4NetworkRange = ipAddressConverter.createIpv4NetworkRange(networkAddress, netmask); BigInteger ipToTestInt = ipAddressConverter.convertIpAddressToBigInt(candidateAddress); return ipv4NetworkRange.isInRange(ipToTestInt); }
Source:
protected void gameLoop() throws SlickException { int delta = getDelta(); if (!Display.isVisible() && updateOnlyOnVisible) { try { Thread.sleep(100); } catch (Exception e) } else { try { updateAndRender(delta); } catch (SlickException e) { this.e = e; running = false; return; } } updateFPS(); Display.update(); GL11.glFlush(); if (Display.isCloseRequested()) { if (game.closeRequested()) running = false; } }

Target:
protected void gameLoop() throws SlickException { int delta = getDelta(); if (!Display.isVisible() && updateOnlyOnVisible) { try { Thread.sleep(100); } catch (Exception e) } else { try { updateAndRender(delta); } catch (SlickException e) { this.e = e; running = false; return; } } updateFPS(); Display.update(); if (Display.isCloseRequested()) { if (game.closeRequested()) running = false; } }
Source:
private static ImportDeclaration getProblematicImport(IProblem problem, CompilationUnit cu) { ASTNode coveringNode= new NodeFinder(cu, problem.getSourceStart(), problem.getSourceEnd() - problem.getSourceStart()).getCoveringNode(); if (coveringNode != null) { ASTNode importNode= ASTNodes.getParent(coveringNode, ASTNode.IMPORT_DECLARATION); if (importNode instanceof ImportDeclaration) { return (ImportDeclaration) importNode; } } return null; }

Target:
private static ImportDeclaration getProblematicImport(IProblem problem, CompilationUnit cu) { ASTNode coveringNode= new NodeFinder(cu, problem.getSourceStart(), problem.getSourceEnd() - problem.getSourceStart() + 1).getCoveringNode(); if (coveringNode != null) { ASTNode importNode= ASTNodes.getParent(coveringNode, ASTNode.IMPORT_DECLARATION); if (importNode instanceof ImportDeclaration) { return (ImportDeclaration) importNode; } } return null; }
Source:
public AutoCloseable scheduleWithFixedDelay(Supplier<CompletionStage<?>> supplier, long initialDelay, long delay, TimeUnit unit) { ReschedulingTask task = new ReschedulingTask(supplier, delay, unit); task.future = scheduler.schedule(task, initialDelay, unit); return task; }

Target:
public AutoCloseable scheduleWithFixedDelay(Supplier<CompletionStage<?>> supplier, long initialDelay, long delay, TimeUnit unit) { ReschedulingTask task = new ReschedulingTask(supplier, delay, unit); synchronized (task) { task.future = scheduler.schedule(task, initialDelay, unit); } return task; }
Source:
private List<Values> parseSiteMap(String url, byte[] content, String contentType) { crawlercommons.sitemaps.SiteMapParser parser = new crawlercommons.sitemaps.SiteMapParser( strictMode); AbstractSiteMap siteMap = null; try { siteMap = parser.parseSiteMap(contentType, content, new URL(url)); } catch (Exception e) { LOG.error("Exception while parsing sitemap", e); return null; } List<Values> links = new ArrayList<Values>(); if (siteMap.isIndex()) { SiteMapIndex smi = ((SiteMapIndex) siteMap); Collection<AbstractSiteMap> subsitemaps = smi.getSitemaps(); Iterator<AbstractSiteMap> iter = subsitemaps.iterator(); while (iter.hasNext()) { String s = iter.next().getUrl().toExternalForm(); HashMap<String, String[]> metadata = KeyValues.newInstance(); KeyValues.setValue(isSitemapKey, metadata, "true"); Values ol = new Values(s, metadata, Status.DISCOVERED); links.add(ol); LOG.debug(url + " : [sitemap] " + s); } } else { SiteMap sm = ((SiteMap) siteMap); Collection<SiteMapURL> sitemapURLs = sm.getSiteMapUrls(); Iterator<SiteMapURL> iter = sitemapURLs.iterator(); while (iter.hasNext()) { SiteMapURL smurl = iter.next(); double priority = smurl.getPriority(); ChangeFrequency freq = smurl.getChangeFrequency(); String s = smurl.getUrl().toExternalForm(); HashMap<String, String[]> metadata = KeyValues.newInstance(); KeyValues.setValue(isSitemapKey, metadata, "false"); Values ol = new Values(s, metadata, Status.DISCOVERED); links.add(ol); LOG.debug(url + " : [sitemap] " + s); } } return links; }

Target:
private List<Values> parseSiteMap(String url, byte[] content, String contentType) { crawlercommons.sitemaps.SiteMapParser parser = new crawlercommons.sitemaps.SiteMapParser( strictMode); AbstractSiteMap siteMap = null; try { siteMap = parser.parseSiteMap(contentType, content, new URL(url)); } catch (Exception e) { LOG.error("Exception while parsing sitemap", e); return Collections.emptyList(); } List<Values> links = new ArrayList<Values>(); if (siteMap.isIndex()) { SiteMapIndex smi = ((SiteMapIndex) siteMap); Collection<AbstractSiteMap> subsitemaps = smi.getSitemaps(); Iterator<AbstractSiteMap> iter = subsitemaps.iterator(); while (iter.hasNext()) { String s = iter.next().getUrl().toExternalForm(); HashMap<String, String[]> metadata = KeyValues.newInstance(); KeyValues.setValue(isSitemapKey, metadata, "true"); Values ol = new Values(s, metadata, Status.DISCOVERED); links.add(ol); LOG.debug("{} : [sitemap] {}", url, s); } } else { SiteMap sm = ((SiteMap) siteMap); Collection<SiteMapURL> sitemapURLs = sm.getSiteMapUrls(); Iterator<SiteMapURL> iter = sitemapURLs.iterator(); while (iter.hasNext()) { SiteMapURL smurl = iter.next(); double priority = smurl.getPriority(); ChangeFrequency freq = smurl.getChangeFrequency(); String s = smurl.getUrl().toExternalForm(); HashMap<String, String[]> metadata = KeyValues.newInstance(); KeyValues.setValue(isSitemapKey, metadata, "false"); Values ol = new Values(s, metadata, Status.DISCOVERED); links.add(ol); LOG.debug("{} : [sitemap] {}", url, s); } } return links; }
Source:
private CqlNameGenerator(NamingConvention namingConvention, TypeMirror converterClassMirror) { Preconditions.checkArgument(namingConvention == null ^ converterClassMirror == null); this.namingConvention = namingConvention; this.converterClassMirror = converterClassMirror; }

Target:
private CqlNameGenerator(NamingConvention namingConvention, TypeMirror converterClassMirror) { assert namingConvention == null ^ converterClassMirror == null; this.namingConvention = namingConvention; this.converterClassMirror = converterClassMirror; }
Source:
private static InferredType unionDeclaredType(List<Expression> subscripts, Map<String, Symbol> builtinSymbols) { InferredType first = declaredType(subscripts.get(0), builtinSymbols); for (int i = 1; i < subscripts.size(); i++) { first = InferredTypes.or(first, declaredType(subscripts.get(i), builtinSymbols)); } return first; }

Target:
private static InferredType unionDeclaredType(List<Expression> subscripts, Map<String, Symbol> builtinSymbols) { InferredType union = declaredType(subscripts.get(0), builtinSymbols); for (int i = 1; i < subscripts.size(); i++) { union = InferredTypes.or(union, declaredType(subscripts.get(i), builtinSymbols)); } return union; }
Source:
public static Block createRandomStringBlock(int positionCount, float nullRate, int maxStringLength) { verifyNullRate(nullRate); return createStringsBlock( IntStream.range(0, positionCount) .mapToObj(i -> nullRate > 0 && ThreadLocalRandom.current().nextDouble(1) < nullRate ? null : generateRandomStringWithLength(maxStringLength)) .collect(Collectors.toList())); }

Target:
public static Block createRandomStringBlock(int positionCount, float nullRate, int maxStringLength) { ValuesWithNullsGenerator<String> generator = new ValuesWithNullsGenerator(nullRate, () -> generateRandomStringWithLength(maxStringLength)); return createStringsBlock( IntStream.range(0, positionCount) .mapToObj(i -> generator.next()) .collect(Collectors.toList())); }
Source:
public static void forceCleanupBucketsOnBP(final Ds3Client client) throws IOException { final GetBucketsSpectraS3Request request = new GetBucketsSpectraS3Request(); final GetBucketsSpectraS3Response response = client.getBucketsSpectraS3(request); for (Bucket bucket : response.getBucketListResult().getBuckets()) { cancelAllJobsForBucket(client, bucket.getName()); client.deleteBucketSpectraS3(new DeleteBucketSpectraS3Request(bucket.getName()).withForce(true)); } }

Target:
public static void forceCleanupBucketsOnBP(final Ds3Client client) throws IOException { final GetBucketsSpectraS3Request request = new GetBucketsSpectraS3Request(); final GetBucketsSpectraS3Response response = client.getBucketsSpectraS3(request); for (final Bucket bucket : response.getBucketListResult().getBuckets()) { cancelAllJobsForBucket(client, bucket.getName()); client.deleteBucketSpectraS3(new DeleteBucketSpectraS3Request(bucket.getName()).withForce(true)); } }