auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static String distanceToString(float distance, Resources resources) { if (distance < 100) return String.format("%d %s", Math.round(distance), resources.getString(R.string.trackmgr_distance_meters)); else if (distance < 1000) return String.format("%d %s", 10*Math.round(distance/10), resources.getString(R.string.trackmgr_distance_meters)); else if (distance < 10000) return String.format("%.1f %s", distance/1000, resources.getString(R.string.trackmgr_distance_kilometers)); else return String.format("%d %s", Math.round(distance/1000), resources.getString(R.string.trackmgr_distance_kilometers)); }

Target:
public static String distanceToString(float distance, Resources resources) { if (distance < 100) { return resources.getString(R.string.trackmgr_distance_in_meters).replace("{0}", String.valueOf(Math.round(distance))); } else if (distance < 1000) { return resources.getString(R.string.trackmgr_distance_in_meters).replace("{0}", String.valueOf(10 * Math.round(distance / 10))); } else if (distance < STOP_SHOWING_DECIMALS_AFTER*1000) { return resources.getString(R.string.trackmgr_distance_in_kilometers).replace("{0}", String.format("%.1f", distance / 1000)); } else { return resources.getString(R.string.trackmgr_distance_in_kilometers).replace("{0}", String.valueOf(Math.round(distance / 1000))); } }
Source:
private QuotedStringTokenizer(boolean forceLenient) { this.forceLenient = forceLenient; }

Target:
QuotedStringTokenizer(boolean forceLenient) { this.forceLenient = forceLenient; }
Source:
public String transformStatement(String statement) { return filterFullLineComments(statement); }

Target:
public String transformStatement(String statement) { return statement; }
Source:
public String getName() { if (StringUtils.isEmpty(name)) { this.name = getNewRuleAnnotationClauseName(); } return this.name; }

Target:
private String getName() { return this.name; }
Source:
private static void logCorruptPackError(IOException e, PackFile p) { StringBuilder buf = new StringBuilder(MessageFormat.format( JGitText.get().exceptionWhileReadingPack, p.getPackFile().getAbsolutePath())); buf.append('\n'); StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); buf.append(sw.toString()); System.err.println(buf.toString()); }

Target:
private static void logCorruptPackError(IOException e, PackFile p) { StringBuilder buf = new StringBuilder(MessageFormat.format( JGitText.get().exceptionWhileReadingPack, p.getPackFile().getAbsolutePath())); StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); buf.append('\n'); buf.append(sw.toString()); System.err.println(buf.toString()); }
Source:
private void initializeRankOfDictionaryIds() { final int dictionarySize = dictionary.size(); rankOfDictionaryIds = IntStream.range(0, dictionarySize).toArray(); IntArrays.quickSort( rankOfDictionaryIds, new IntComparator() { @Override public int compare(int i1, int i2) { return dictionary.get(i1).compareTo(dictionary.get(i2)); } @Override public int compare(Integer o1, Integer o2) { return compare(o1.intValue(), o2.intValue()); } } ); inverse(rankOfDictionaryIds); }

Target:
private void initializeRankOfDictionaryIds() { final int dictionarySize = dictionary.size(); rankOfDictionaryIds = IntStream.range(0, dictionarySize).toArray(); IntArrays.quickSort( rankOfDictionaryIds, new IntComparator() { @Override public int compare(int i1, int i2) { return dictionary.get(i1).compareTo(dictionary.get(i2)); } @Override public int compare(Integer o1, Integer o2) { return compare(o1.intValue(), o2.intValue()); } } ); IntArrayUtils.inverse(rankOfDictionaryIds); }
Source:
public static <T> Class<T> loadClass(String className, ResourceLoader resourceLoader) { try { return cast(resourceLoader.classForName(className)); } catch (ResourceLoadingException e) { return null; } catch (AccessControlException e) { return null; } catch (SecurityException e) { return null; } }

Target:
public static <T> Class<T> loadClass(String className, ResourceLoader resourceLoader) { try { return cast(resourceLoader.classForName(className)); } catch (ResourceLoadingException e) { return null; } catch (SecurityException e) { return null; } }
Source:
public Mutation(byte[] row, int start, int length, int initialBufferSize) { this.row = new byte[length]; System.arraycopy(row, start, this.row, 0, length); buffer = new UnsynchronizedBuffer.Writer(initialBufferSize); estimatedSize = length + SERIALIZATION_OVERHEAD; }

Target:
public Mutation(byte[] row, int start, int length, int initialBufferSize) { this.row = new byte[length]; System.arraycopy(row, start, this.row, 0, length); buffer = new UnsynchronizedBuffer.Writer(initialBufferSize); estRowAndLargeValSize = length + SERIALIZATION_OVERHEAD; }
Source:
private boolean compactionRunning(List<Integer> jobIds) { if (jobIds.isEmpty()) { return false; } Integer jobId = jobIds.get(0); Option<SparkJobInfo> op = SpliceSpark.getContext().sc().statusTracker().getJobInfo(jobId); if (op.isEmpty()) { return false; } SparkJobInfo jobInfo = op.get(); if (jobInfo.status().equals(JobExecutionStatus.RUNNING)) { return true; } if (jobInfo.status().equals(JobExecutionStatus.SUCCEEDED)) { return true; } return false; }

Target:
private boolean compactionRunning(List<Integer> jobIds) { if (jobIds.isEmpty()) { return false; } Integer jobId = jobIds.get(0); SparkStatusTracker statusTracker = SpliceSpark.getContext().sc().statusTracker(); Option<SparkJobInfo> op = statusTracker.getJobInfo(jobId); if (op.isEmpty()) { return false; } SparkJobInfo jobInfo = op.get(); Integer stageIds = jobInfo.stageIds()[0]; Option<SparkStageInfo> stageInfoOp = statusTracker.getStageInfo(stageIds); if(stageInfoOp.isEmpty()) { return false; } SparkStageInfo stageInfo = stageInfoOp.get(); return stageInfo.numActiveTasks() > 0 || stageInfo.numCompletedTasks() > 0; }
Source:
public final Set<CfgBlock> exits() { return loopBlocks.stream().filter(this::isAnExit).collect(Collectors.toSet()); }

Target:
final Set<CfgBlock> exits() { return loopBlocks.stream().filter(this::isExit).collect(Collectors.toSet()); }
Source:
public void fillTextareaToEditResponseComment(int sessionIdx, int questionIdx, int responseIdx, int commentIdx, String text) { String editorId = "responsecommenttext-" + sessionIdx + "-" + questionIdx + "-" + responseIdx + "-" + commentIdx; WebElement textarea = browser.driver.findElement( By.id(editorId)); waitForRichTextEditorToLoad(editorId); fillTextBox(textarea, text); }

Target:
public void fillTextareaToEditResponseComment(int sessionIdx, int questionIdx, int responseIdx, int commentIdx, String text) { WebElement textarea = browser.driver.findElement( By.id("responsecommenttext-" + sessionIdx + "-" + questionIdx + "-" + responseIdx + "-" + commentIdx)); click(textarea); textarea.clear(); textarea.sendKeys(text); }
Source:
public AppResourceCommon(MavenProperties mavenProperties, ResourceLoader resourceLoader) { this.mavenProperties = mavenProperties; this.resourceLoader = resourceLoader; }

Target:
public AppResourceCommon(MavenProperties mavenProperties, ResourceLoader resourceLoader) { Assert.notNull(mavenProperties, "Non null Maven Properties are required!"); this.mavenProperties = mavenProperties; this.metadataResourceLoader = resourceLoader; }
Source:
public void triggerEditMessageArea() { setStyle(firstMessageMenu, "block"); scrollAndClick(driver.findElement(firstMessageWrapperBy).findElement(moreButtonBy)); scrollAndClick(driver.findElement(firstMessageWrapperBy).findElement(editButtonBy)); setStyle(firstMessageMenu, "none"); }

Target:
public void triggerEditMessageArea() { setDisplayStyle(firstMessageMenu, "block"); scrollAndClick(driver.findElement(firstMessageWrapperBy).findElement(moreButtonBy)); scrollAndClick(driver.findElement(firstMessageWrapperBy).findElement(editButtonBy)); setDisplayStyle(firstMessageMenu, "none"); PageObjectLogging.log("triggerEditMessageArea", "edit message area triggered", true); }
Source:
public Void call() throws Exception { Objects.requireNonNull(acl, "ACL to be removed not specified."); OzoneAddress address = new OzoneAddress(uri); address.ensureBucketAddress(); OzoneClient client = address.createClient(createOzoneConfiguration()); String volumeName = address.getVolumeName(); String bucketName = address.getBucketName(); if (isVerbose()) { System.out.printf("Volume Name : %s%n", volumeName); System.out.printf("Bucket Name : %s%n", bucketName); } OzoneObj obj = OzoneObjInfo.Builder.newBuilder() .setBucketName(bucketName) .setVolumeName(volumeName) .setResType(OzoneObj.ResourceType.BUCKET) .setStoreType(storeType == null ? OZONE : OzoneObj.StoreType.valueOf(storeType)) .build(); boolean result = client.getObjectStore().removeAcl(obj, OzoneAcl.parseAcl(acl)); System.out.printf("%s%n", result ? "ACL removed successfully" : "ACL not removed"); client.close(); return null; }

Target:
public Void call() throws Exception { Objects.requireNonNull(acl, "ACL to be removed not specified."); OzoneAddress address = new OzoneAddress(uri); address.ensureBucketAddress(); OzoneClient client = address.createClient(createOzoneConfiguration()); String volumeName = address.getVolumeName(); String bucketName = address.getBucketName(); if (isVerbose()) { System.out.printf("Volume Name : %s%n", volumeName); System.out.printf("Bucket Name : %s%n", bucketName); } OzoneObj obj = OzoneObjInfo.Builder.newBuilder() .setBucketName(bucketName) .setVolumeName(volumeName) .setResType(OzoneObj.ResourceType.BUCKET) .setStoreType(storeType == null ? OZONE : OzoneObj.StoreType.valueOf(storeType)) .build(); boolean result = client.getObjectStore().removeAcl(obj, OzoneAcl.parseAcl(acl)); System.out.printf("%s%n", "Acl removed successfully: " + result); client.close(); return null; }
Source:
private static String getUnifiedPath(String path) { String newPath = new Path(path).toString(); newPath = newPath.replaceAll("/$", ""); return newPath; }

Target:
private static String getUnifiedPath(String path) { return new Path(path).removeTrailingSeparator().toString(); }
Source:
public String getItemString(ITmfEvent event) { for (ITmfEventAspect<?> aspect : fAspects) { String eventString = NonNullUtils.nullToEmptyString(aspect.resolve(event)); if (eventString != EMPTY_STRING) { return eventString; } } return EMPTY_STRING; }

Target:
public String getItemString(ITmfEvent event) { for (ITmfEventAspect<?> aspect : fAspects) { String eventString = NonNullUtils.nullToEmptyString(aspect.resolve(event)); if (!eventString.isEmpty()) { return eventString; } } return EMPTY_STRING; }
Source:
public void setSiteMode() { Framework.getRuntime().setProperty(SnapshotManager.PROPERTY_SITE_MODE, Boolean.toString(true)); }

Target:
public void setSiteMode() { Framework.getRuntime().setProperty(SnapshotManager.PROPERTY_SITE_MODE, "true"); }
Source:
private void handleTableViewerKeyPressed(KeyEvent event) { if (event.keyCode == SWT.F2 && event.stateMask == 0) { IStructuredSelection selection = (IStructuredSelection) list.getSelection(); if (selection.size() == 1) { Object o = selection.getFirstElement(); if (o instanceof IPerspectiveDescriptor) { String description = ((IPerspectiveDescriptor) o).getDescription(); if (description.length() == 0) description = WorkbenchMessages.SelectPerspective_noDesc; popUp(description); } } } }

Target:
private void handleTableViewerKeyPressed(KeyEvent event) { if (event.keyCode == SWT.F2 && event.stateMask == 0) { IStructuredSelection selection = list.getStructuredSelection(); if (selection.size() == 1) { Object o = selection.getFirstElement(); if (o instanceof IPerspectiveDescriptor) { String description = ((IPerspectiveDescriptor) o).getDescription(); if (description.length() == 0) { description = WorkbenchMessages.SelectPerspective_noDesc; } popUp(description); } } } }
Source:
private List<RuleResult<Patient>> patientsWithMoreThanOneEncounterOnTheSameDate() { log.info("Executing rule to find patients with more than one encounters on a single date"); String queryString = "SELECT visit FROM Encounter e WHERE e.encounterType.uuid='8d5b2be0-c2cc-11de-8d13-0010c6dffd0f' GROUP BY e.encounterType.encounterTypeId, e.visit.visitId HAVING count(e.visit.visitId) > 1"; Query query = getSession().createQuery(queryString); List<Visit> visitList = query.list(); log.info("There are " + visitList.size() + " visits with more than one encounter page"); List<RuleResult<Patient>> ruleResults = new ArrayList<>(); for (Visit visit : visitList) { RuleResult<Patient> ruleResult = new RuleResult<>(); ruleResult.setActionUrl("coreapps/patientdashboard/patientDashboard.page?patientId=" + visit.getPatient().getPatientId() + "&visitId=" + visit.getVisitId()); ruleResult.setNotes("Client #" + getHIVClinicNumber(visit.getPatient()) + " has more than one encounter on " + getDateFormatter().format(visit.getStartDatetime())); ruleResult.setEntity(visit.getPatient()); ruleResults.add(ruleResult); } return ruleResults; }

Target:
private List<RuleResult<Patient>> patientsWithMoreThanOneEncounterOnTheSameDate() { log.info("Executing rule to find patients with more than one encounters on a single date"); String queryString = "SELECT visit FROM Encounter e WHERE e.voided = false AND e.encounterType.uuid='8d5b2be0-c2cc-11de-8d13-0010c6dffd0f' GROUP BY e.encounterType.encounterTypeId, e.visit.visitId HAVING count(e.visit.visitId) > 1"; Query query = getSession().createQuery(queryString); List<Visit> visitList = query.list(); log.info("There are " + visitList.size() + " visits with more than one encounter page"); List<RuleResult<Patient>> ruleResults = new ArrayList<>(); for (Visit visit : visitList) { RuleResult<Patient> ruleResult = new RuleResult<>(); ruleResult.setActionUrl("coreapps/patientdashboard/patientDashboard.page?patientId=" + visit.getPatient().getPatientId() + "&visitId=" + visit.getVisitId()); ruleResult.setNotes("Client #" + getHIVClinicNumber(visit.getPatient()) + " has more than one encounter on " + getDateFormatter().format(visit.getStartDatetime())); ruleResult.setEntity(visit.getPatient()); ruleResults.add(ruleResult); } return ruleResults; }
Source:
public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { if (attacker.getRNG().nextFloat() < .05 && target.getHeldItemMainhand() != null) { ItemEntity item = new ItemEntity(target.world, target.posX, target.posY, target.posZ, target.getHeldItemMainhand().copy()); item.getItem().setCount(1); item.setPickupDelay(40); target.world.addEntity(item); target.getHeldItemMainhand().shrink(1); } return super.hitEntity(stack, target, attacker); }

Target:
public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { ItemStack held = target.getHeldItemMainhand(); if (attacker.getRNG().nextFloat() < .05 && !held.isEmpty()) { ItemEntity item = new ItemEntity(target.world, target.posX, target.posY, target.posZ, held.copy()); item.getItem().setCount(1); item.setPickupDelay(40); target.world.addEntity(item); held.shrink(1); } return super.hitEntity(stack, target, attacker); }
Source:
protected void initWithProperties(String... propertyFiles) { if (propertyFiles != null) { for (String propertyFile : propertyFiles) propertyReports.add(reportFromResourceProperties(propertyFile)); } if (configuration == null) { configuration = new Configuration(reportDirectory, projectName); } configuration.setSortingMethod(SortingMethod.ALPHABETICAL); createEmbeddingsDirectory(); }

Target:
protected void initWithProperties(String... propertyFiles) { for (String propertyFile : propertyFiles) this.classificationFiles.add(reportFromResourceProperties(propertyFile)); if (configuration == null) { configuration = new Configuration(reportDirectory, projectName); } configuration.setSortingMethod(SortingMethod.ALPHABETICAL); createEmbeddingsDirectory(); }
Source:
private void createAndPopulateTable(Connection conn, String tableName, int rowCount) throws Exception { String ddl = "CREATE TABLE " + tableName + " (id integer not null primary key, val1 varchar(10), val2 varchar(10), val3 varchar(10))" + tableDDLOptions; conn.createStatement().execute(ddl); String dml = "UPSERT INTO " + tableName + " (id, val1, val2, val3) VALUES (?, ?, ?, ?)"; PreparedStatement stmt = conn.prepareStatement(dml); for (int id = 1; id <= rowCount; ++id) { stmt.setInt(1, id); stmt.setString(2, "a" + id); stmt.setString(3, "ab" + id); stmt.setString(4, "abc" + id); stmt.executeUpdate(); } conn.commit(); }

Target:
private void createAndPopulateTable(Connection conn, String tableName, int rowCount) throws Exception { String ddl = "CREATE TABLE " + tableName + " (id integer not null primary key, val1 varchar, val2 varchar, val3 varchar)" + tableDDLOptions; conn.createStatement().execute(ddl); String dml = "UPSERT INTO " + tableName + " (id, val1, val2, val3) VALUES (?, ?, ?, ?)"; PreparedStatement stmt = conn.prepareStatement(dml); for (int id = 1; id <= rowCount; ++id) { stmt.setInt(1, id); stmt.setString(2, "a" + id); stmt.setString(3, "ab" + id); stmt.setString(4, "abc" + id); stmt.executeUpdate(); } conn.commit(); }
Source:
public void setSessionMessage(PortletRequest request, RequestStatus requestStatus, String type, String verb, String name) throws PortletException { String statusMessage; if (isNullOrEmpty(name)) { name = ""; } else { name = " " + name; } switch (requestStatus) { case SUCCESS: statusMessage = type + name + " " + verb + "d successfully!"; SessionMessages.add(request, "request_processed", statusMessage); break; case SENT_TO_MODERATOR: statusMessage = "Moderation request was sent to " + verb + " the " + type + name + "!"; SessionMessages.add(request, "request_processed", statusMessage); break; case FAILURE: setSW360SessionError(request, ErrorMessages.DOCUMENT_NOT_PROCESSED_SUCCESSFULLY); break; case IN_USE: if(type.equals("License")) { setSW360SessionError(request, ErrorMessages.LICENSE_USED_BY_RELEASE); } else { setSW360SessionError(request, ErrorMessages.DOCUMENT_USED_BY_PROJECT_OR_RELEASE); } break; case FAILED_SANITY_CHECK: setSW360SessionError(request, ErrorMessages.UPDATE_FAILED_SANITY_CHECK); default: throw new PortletException("Unknown request status"); } }

Target:
public void setSessionMessage(PortletRequest request, RequestStatus requestStatus, String type, String verb, String name) throws PortletException { String statusMessage; if (isNullOrEmpty(name)) { name = ""; } else { name = " " + name; } switch (requestStatus) { case SUCCESS: statusMessage = type + name + " " + verb + "d successfully!"; SessionMessages.add(request, "request_processed", statusMessage); break; case SENT_TO_MODERATOR: statusMessage = "Moderation request was sent to " + verb + " the " + type + name + "!"; SessionMessages.add(request, "request_processed", statusMessage); break; case FAILURE: setSW360SessionError(request, ErrorMessages.DOCUMENT_NOT_PROCESSED_SUCCESSFULLY); break; case IN_USE: if(type.equals("License")) { setSW360SessionError(request, ErrorMessages.LICENSE_USED_BY_RELEASE); } else { setSW360SessionError(request, ErrorMessages.DOCUMENT_USED_BY_PROJECT_OR_RELEASE); } break; case FAILED_SANITY_CHECK: setSW360SessionError(request, ErrorMessages.UPDATE_FAILED_SANITY_CHECK); break; default: throw new PortletException("Unknown request status"); } }
Source:
public void multiIndex_incompatibleAnalyzer_overrideAnalyzer() { StubMappingSearchScope scope = indexManager.createSearchScope( incompatibleAnalyzerIndexManager ); String absoluteFieldPath = indexMapping.analyzedStringField1.relativeFieldName; IndexSearchQuery<DocumentReference> query = scope.query().asReference() .predicate( f -> f.phrase().onField( absoluteFieldPath ).matching( PHRASE_1_UNIQUE_TERM ) .analyzer( OverrideAnalysisDefinitions.ANALYZER_WHITESPACE_LOWERCASE.name ) ) .toQuery(); assertThat( query ).assertThat( query ).hasDocRefHitsAnyOrder( b -> { b.doc( INDEX_NAME, DOCUMENT_1, DOCUMENT_2, DOCUMENT_3, DOCUMENT_4 ); b.doc( INCOMPATIBLE_ANALYZER_INDEX_NAME, INCOMPATIBLE_ANALYZER_INDEX_DOCUMENT_1 ); } ); }

Target:
public void multiIndex_incompatibleAnalyzer_overrideAnalyzer() { StubMappingSearchScope scope = indexManager.createSearchScope( incompatibleAnalyzerIndexManager ); String absoluteFieldPath = indexMapping.analyzedStringField1.relativeFieldName; IndexSearchQuery<DocumentReference> query = scope.query().asReference() .predicate( f -> f.phrase().onField( absoluteFieldPath ).matching( PHRASE_1_UNIQUE_TERM ) .analyzer( OverrideAnalysisDefinitions.ANALYZER_WHITESPACE_LOWERCASE.name ) ) .toQuery(); assertThat( query ).hasDocRefHitsAnyOrder( b -> { b.doc( INDEX_NAME, DOCUMENT_1, DOCUMENT_2, DOCUMENT_3, DOCUMENT_4 ); b.doc( INCOMPATIBLE_ANALYZER_INDEX_NAME, INCOMPATIBLE_ANALYZER_INDEX_DOCUMENT_1 ); } ); }
Source:
public void run() { while ( !halted ) { try { pageCache.flushAndForce(); } catch ( Throwable e ) { error = e; break; } } done = true; Thread localHalter = halter; if ( localHalter != null ) { LockSupport.unpark( localHalter ); } }

Target:
public void run() { try { while ( !halted ) { try { pageCache.flushAndForce(); } catch ( Throwable e ) { error = e; break; } } } finally { halt.release(); } }
Source:
protected ModelAndView addGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { setPropertyAttributes(req, new Property()); Comparator<Service> comparator = new Comparator<Service>() { public int compare(Service a, Service b) { return a.getName().ordinal() < b.getName().ordinal() ? 1 : a.getName().ordinal() == b.getName().ordinal() ? 0 : -1; } }; SortedSet<Service> services = new TreeSet<Service>(comparator); for (Services service : Services.values()) { services.add(new Service(service, false)); } req.setAttribute("services", services); return render(req, resp, "editProperty.jsp", "Add Property"); }

Target:
protected ModelAndView addGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { setPropertyAttributes(req, new Property()); req.setAttribute("services", getServices(new Property(), null)); return render(req, resp, "editProperty.jsp", "Add Property"); }
Source:
private MethodSpec(Builder builder) { CodeBlock code = builder.code.build(); checkArgument(code.isEmpty() || !builder.modifiers.contains(Modifier.ABSTRACT), "abstract method %s cannot have code", builder.name); checkArgument(!builder.varargs || lastParameterIsArray(builder.parameters), "last parameter of varargs method %s must be an array", builder.name); this.name = checkNotNull(builder.name, "name == null"); this.javadoc = builder.javadoc.build(); this.annotations = Util.immutableList(builder.annotations); this.modifiers = Util.immutableSet(builder.modifiers); this.typeVariables = Util.immutableList(builder.typeVariables); this.returnType = builder.returnType; this.parameters = Util.immutableList(builder.parameters); this.varargs = builder.varargs; this.exceptions = Util.immutableList(builder.exceptions); this.initializer = (builder.initializer == null) ? CodeBlock.builder().build() : builder.initializer; this.code = code; }

Target:
private MethodSpec(Builder builder) { CodeBlock code = builder.code.build(); checkArgument(code.isEmpty() || !builder.modifiers.contains(Modifier.ABSTRACT), "abstract method %s cannot have code", builder.name); checkArgument(!builder.varargs || lastParameterIsArray(builder.parameters), "last parameter of varargs method %s must be an array", builder.name); this.name = checkNotNull(builder.name, "name == null"); this.javadoc = builder.javadoc.build(); this.annotations = Util.immutableList(builder.annotations); this.modifiers = Util.immutableSet(builder.modifiers); this.typeVariables = Util.immutableList(builder.typeVariables); this.returnType = builder.returnType; this.parameters = Util.immutableList(builder.parameters); this.varargs = builder.varargs; this.exceptions = Util.immutableList(builder.exceptions); this.defaultValue = builder.defaultValue; this.code = code; }
Source:
public void shouldGenerateUnifiedResourceName() throws Exception { URNPersistentIdentifier urnPersistentIdentifier = new URNPersistentIdentifier(); String urn = urnPersistentIdentifier.generateUnifiedResourceName("bsz", "14", "db", "378704842"); assertEquals("Incorrect check digit in URN ", "urn:nbn:de:bsz:14-db-id3787048428", urn); urn = urnPersistentIdentifier.generateUnifiedResourceName("bsz", "14", "db", "470035625"); assertEquals("Incorrect check digit in URN ", "urn:nbn:de:bsz:14-db-id4700356257", urn); urn = urnPersistentIdentifier.generateUnifiedResourceName("boc", "12", "db", "478704844"); assertEquals("Incorrect check digit in URN ", "urn:nbn:de:boc:12-db-id4787048447", urn); }

Target:
public void shouldGenerateUnifiedResourceName() throws Exception { URNPersistentIdentifier urnPersistentIdentifier = new URNPersistentIdentifier(); String urn = urnPersistentIdentifier.generateUnifiedResourceName("bsz", "14", "db", "id378704842"); assertEquals("Incorrect check digit in URN ", "urn:nbn:de:bsz:14-db-id3787048428", urn); urn = urnPersistentIdentifier.generateUnifiedResourceName("bsz", "14", "db", "id470035625"); assertEquals("Incorrect check digit in URN ", "urn:nbn:de:bsz:14-db-id4700356257", urn); urn = urnPersistentIdentifier.generateUnifiedResourceName("boc", "12", "db", "478704844"); assertEquals("Incorrect check digit in URN ", "urn:nbn:de:boc:12-db-4787048440", urn); urn = urnPersistentIdentifier.generateUnifiedResourceName("bsz", "14", "qucosa", "22579"); assertEquals("Incorrect check digit in URN ", "urn:nbn:de:bsz:14-qucosa-225799", urn); urn = urnPersistentIdentifier.generateUnifiedResourceName("bsz", "d120", "qucosa", "22440"); assertEquals("Incorrect check digit in URN ", "urn:nbn:de:bsz:d120-qucosa-224404", urn); urn = urnPersistentIdentifier.generateUnifiedResourceName("bsz", "ch1", "qucosa", "22583"); assertEquals("Incorrect check digit in URN ", "urn:nbn:de:bsz:ch1-qucosa-225834", urn); }
Source:
@Override public void connect() throws Exception { DatanodeDetails dn = this.pipeline.getFirstNode(); connectToDatanode(dn, null); }

Target:
public void connect() throws Exception { DatanodeDetails dn = this.pipeline.getFirstNode(); connectToDatanode(dn, null); }
Source:
public AvailableTimestamps(LastReturnedTimestamp lastReturnedTimestamp, PersistentUpperLimit upperLimit) { DebugLogger.logger.info("Creating AvailableTimestamps object on thread {}. This should only happen once." + " If you are running embedded AtlasDB, this should only happen once." + " If you are using Timelock, this should happen once per client per leadership election", Thread.currentThread().getName()); this.lastReturnedTimestamp = lastReturnedTimestamp; this.upperLimit = upperLimit; this.issueTimestampLock = new Object(); }

Target:
public AvailableTimestamps(LastReturnedTimestamp lastReturnedTimestamp, PersistentUpperLimit upperLimit) { DebugLogger.logger.info("Creating AvailableTimestamps object on thread {}." + " If you are running embedded AtlasDB, this should only happen once." + " If you are using Timelock, this should happen once per client per leadership election", Thread.currentThread().getName()); this.lastReturnedTimestamp = lastReturnedTimestamp; this.upperLimit = upperLimit; this.issueTimestampLock = new Object(); }
Source:
public FeedbackResponseCommentAttributes() { giverSection = "None"; receiverSection = "None"; showCommentTo = new ArrayList<>(); showGiverNameTo = new ArrayList<>(); isVisibilityFollowingFeedbackQuestion = true; commentText = new Text(""); }

Target:
FeedbackResponseCommentAttributes() { giverSection = Const.DEFAULT_SECTION; receiverSection = Const.DEFAULT_SECTION; showCommentTo = new ArrayList<>(); showGiverNameTo = new ArrayList<>(); isVisibilityFollowingFeedbackQuestion = true; createdAt = new Date(); }
Source:
private void updateTvFolderName() { tvFolderName.setText("Folder:" + currentFile.getParentName() + " (" + (currentIndex + 1) + "/" + baseFiles.size() + ") " + currentFile.getName()); }

Target:
private void updateTvFolderName() { Resources res = getResources(); String text = res.getString(R.string.image_viewer_bottom_bar, getResources().getString(R.string.folder), currentFile.getParentName(), currentIndex + 1, baseFiles.size(), currentFile.getName()); tvFolderName.setText(text); }
Source:
public String getPhoneId() { return "----"; }

Target:
public String getPhoneId() { return DeviceIdentifier.getDeviceIdentifier(this); }
Source:
protected boolean clearTimetable(String feedId) { return timetables.keySet().removeAll(timetables.keySet().stream() .filter(timeTable -> feedId.equals(timeTable.getFeedId())) .collect(Collectors.toSet())); }

Target:
protected boolean clearTimetable(String feedId) { return timetables.keySet().removeIf(tripPattern -> feedId.equals(tripPattern.getFeedId())); }
Source:
public Optional<T> getNextItem(T item) { int index = getItemIndex(item); if (index < 0) return Optional.empty(); return getItems().skip(index + 1).findFirst(); }

Target:
public Optional<T> getNextItem(T item) { int index = getItemIndex(item); if (index < 0) { return Optional.empty(); } return getItems().skip(index + 1).findFirst(); }
Source:
protected void addExtraHeaders(Builder webResource) { if (additionalHeaders != null) { for (String key : additionalHeaders.keySet()) { webResource.header(key, additionalHeaders.get(key)); } } }

Target:
protected void addExtraHeaders(Builder webResource) { if (additionalHeaders != null) { for (Map.Entry<String, List<Object>> entry: additionalHeaders.entrySet()) { webResource.header(entry.getKey(), entry.getValue()); } } }
Source:
public List<SMREntry> getSMRUpdates(UUID id) { MultiSMREntry resMultiSmrEntry = streamUpdates.computeIfAbsent(id, k -> { if (streamBuffers.containsKey(id)) { byte[] streamUpdatesBuf = streamBuffers.get(id); ByteBuf buf = Unpooled.wrappedBuffer(streamUpdatesBuf); int numUpdates = buf.readInt(); List<SMREntry> smrEntries = new ArrayList<>(numUpdates); for (int update = 0; update < numUpdates; update++) { smrEntries.add((SMREntry) Serializers.CORFU.deserialize(buf, null)); } MultiSMREntry multiSMREntry = new MultiSMREntry(smrEntries); multiSMREntry.setGlobalAddress(getGlobalAddress()); streamBuffers.remove(id); return multiSMREntry; } else { return null; } }); return resMultiSmrEntry == null ? Collections.emptyList() : resMultiSmrEntry.getUpdates(); }

Target:
public List<SMREntry> getSMRUpdates(UUID id) { MultiSMREntry resMultiSmrEntry = streamUpdates.computeIfAbsent(id, k -> { if (!streamBuffers.containsKey(id)) { return null; } byte[] streamUpdatesBuf = streamBuffers.get(id); ByteBuf buf = Unpooled.wrappedBuffer(streamUpdatesBuf); int numUpdates = buf.readInt(); List<SMREntry> smrEntries = new ArrayList<>(numUpdates); for (int update = 0; update < numUpdates; update++) { smrEntries.add((SMREntry) Serializers.CORFU.deserialize(buf, null)); } MultiSMREntry multiSMREntry = new MultiSMREntry(smrEntries); multiSMREntry.setGlobalAddress(getGlobalAddress()); streamBuffers.remove(id); return multiSMREntry; }); return resMultiSmrEntry == null ? Collections.emptyList() : resMultiSmrEntry.getUpdates(); }
Source:
private boolean isFeatureInstalled(String featureName) throws Exception { return Arrays.stream(featuresService.listInstalledFeatures()) .map(Feature::getName) .anyMatch(name -> name.equals(featureName)); }

Target:
private boolean isFeatureInstalled(String featureName) throws Exception { return Arrays.stream(featuresService.listInstalledFeatures()) .map(Feature::getName) .anyMatch(featureName::equals); }
Source:
private String encodePostdata(String postdata) { String res = null; if (postdata.contains("@")) { String[] arr = postdata.split("@"); try { res = URLEncoder.encode(readFromFile(arr[1]), StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { LOGGER.error("string '{}' cannot be encoded", readFromFile(arr[1])); } if (!arr[0].isEmpty()) { res = arr[0] + "=" + res; } } else { if (!postdata.contains("=")) { try { res = URLEncoder.encode(postdata, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { LOGGER.error("string '{}' cannot be encoded", postdata); throw new IllegalArgumentException(postdata + " cannot be encoded"); } } else { StringBuilder urlAfterEncoding = new StringBuilder(); int index = postdata.indexOf('='); urlAfterEncoding.append(postdata.substring(0, index)); urlAfterEncoding.append("="); try { urlAfterEncoding.append(URLEncoder.encode(postdata.substring(index + 1, postdata.length()), StandardCharsets.UTF_8.name())); } catch (UnsupportedEncodingException e) { LOGGER.error("string '{}' cannot be encoded", postdata.substring(index + 1, postdata.length())); throw new IllegalArgumentException( postdata.substring(index + 1, postdata.length()) + " cannot be encoded"); } res = urlAfterEncoding.toString(); } } return res; }

Target:
private String encodePostdata(String postdata) { if (postdata.contains("@")) { String contentFile = null; String[] arr = postdata.split("@", 2); String dataToEncode = readFromFile(arr[1]); try { contentFile = URLEncoder.encode(dataToEncode, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { LOGGER.error("string '{}' cannot be encoded", dataToEncode); } if (!arr[0].isEmpty()) { contentFile = arr[0] + "=" + contentFile; } return contentFile; } else { if (!postdata.contains("=")) { try { return URLEncoder.encode(postdata, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { LOGGER.error("string '{}' cannot be encoded", postdata); throw new IllegalArgumentException(postdata + " cannot be encoded"); } } else { int index = postdata.indexOf('='); try { return postdata.substring(0, index + 1) + URLEncoder .encode(postdata.substring(index + 1, postdata.length()), StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { LOGGER.error("string '{}' cannot be encoded", postdata.substring(index + 1, postdata.length())); throw new IllegalArgumentException( postdata.substring(index + 1, postdata.length()) + " cannot be encoded"); } } } }
Source:
public Response doExport(Action action) { validateParameters(action, "storageDomain.id|name"); Disk disk = get(); ExportRepoImageParameters exportParameters = new ExportRepoImageParameters(asGuid(disk.getImageId())); exportParameters.setStorageDomainId(asGuid(disk.getStorageDomains().getStorageDomains().get(0).getId())); exportParameters.setStoragePoolId(getDataCenterId(exportParameters.getStorageDomainId())); exportParameters.setImageGroupID(asGuid(disk.getId())); exportParameters.setDestinationDomainId(getStorageDomainId(action)); return doAction(VdcActionType.ExportRepoImage, exportParameters, action); }

Target:
public Response doExport(Action action) { validateParameters(action, "storageDomain.id|name"); return doAction(VdcActionType.ExportRepoImage, new ExportRepoImageParameters(guid, getStorageDomainId(action)), action); }
Source:
public void initAddButtons() { final ImageButton addBalance = (ImageButton) mView.findViewById(R.id.add_balance_survey); final ImageButton addReceipt = (ImageButton) mView.findViewById(R.id.add_receipt_survey); mView.findViewById(R.id.add_stock_survey).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (isAddShowing) { hideAddMenu(addReceipt, addBalance); } else { showAddMenu(addReceipt, addBalance); } } }); addBalance.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mStockSurveysPresenter.onAddBalanceClick(getActivity()); } }); addReceipt.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mStockSurveysPresenter.onAddReceiptClick(getActivity()); } }); }

Target:
public void initAddButtons() { final ImageButton addBalance = (ImageButton) mView.findViewById(R.id.add_balance_survey); final ImageButton addReceipt = (ImageButton) mView.findViewById(R.id.add_receipt_survey); mView.findViewById(R.id.add_stock_survey).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (isAddShowing) { hideAddMenu(addReceipt, addBalance); } else { showAddMenu(addReceipt, addBalance); } } }); addBalance.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mStockSurveysPresenter.onAddBalanceClick(); } }); addReceipt.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mStockSurveysPresenter.onAddReceiptClick(); } }); }
Source:
public String getKind() { return isHidden() ? (TaskAttribute.TYPE_PERSON.equals(getType()) ? TaskAttribute.KIND_PEOPLE : null) : TaskAttribute.KIND_DEFAULT; }

Target:
public String getKind() { if (flags.contains(Flag.ATTRIBUTE)) { return TaskAttribute.KIND_DEFAULT; } else if (flags.contains(Flag.PEOPLE)) { return TaskAttribute.KIND_PEOPLE; } else if (flags.contains(Flag.OPERATION)) { return TaskAttribute.KIND_OPERATION; } return null; }
Source:
public Environment findOne(String specifiedApplication, String specifiedProfile, String specifiedLabel) { final String application = StringUtils.isEmpty(specifiedApplication) ? serverProperties.getDefaultApplicationName() : specifiedApplication; final String profile = StringUtils.isEmpty(specifiedProfile) ? serverProperties.getDefaultProfile() : specifiedProfile; final String label = StringUtils.isEmpty(specifiedLabel) ? serverProperties.getDefaultLabel() : specifiedLabel; StringBuilder objectKeyPrefix = new StringBuilder(application).append("-") .append(profile); if (!StringUtils.isEmpty(label)) { objectKeyPrefix.append("-").append(label); } final Environment environment = new Environment(application, profile); environment.setLabel(label); final S3ObjectIdBuilder s3ObjectIdBuilder = new S3ObjectIdBuilder() .withBucket(bucketName); S3ConfigFile s3ConfigFile = getS3ConfigFile(s3ObjectIdBuilder, objectKeyPrefix.toString()); if (s3ConfigFile == null) { throw new NoSuchRepositoryException( "No such repository: (" + s3ObjectIdBuilder .withKey(objectKeyPrefix.toString() + "(.properties | .yml)") .build().toString() + ")"); } environment.setVersion(s3ConfigFile.getVersion()); final Map config = s3ConfigFile.read(); config.putAll(serverProperties.getOverrides()); environment.add(new PropertySource(application, config)); return environment; }

Target:
public Environment findOne(String specifiedApplication, String specifiedProfile, String specifiedLabel) { final String application = StringUtils.isEmpty(specifiedApplication) ? serverProperties.getDefaultApplicationName() : specifiedApplication; final String profile = StringUtils.isEmpty(specifiedProfile) ? serverProperties.getDefaultProfile() : specifiedProfile; final String label = StringUtils.isEmpty(specifiedLabel) ? serverProperties.getDefaultLabel() : specifiedLabel; StringBuilder objectKeyPrefix = new StringBuilder(); if (!StringUtils.isEmpty(label)) { objectKeyPrefix.append(label).append("/"); } objectKeyPrefix.append(application).append("-").append(profile); final Environment environment = new Environment(application, profile); environment.setLabel(label); final S3ObjectIdBuilder s3ObjectIdBuilder = new S3ObjectIdBuilder() .withBucket(bucketName); S3ConfigFile s3ConfigFile = getS3ConfigFile(s3ObjectIdBuilder, objectKeyPrefix.toString()); if (s3ConfigFile == null) { throw new NoSuchRepositoryException( "No such repository: (" + s3ObjectIdBuilder .withKey(objectKeyPrefix.toString() + "(.properties | .yml | .json)") .build().toString() + ")"); } environment.setVersion(s3ConfigFile.getVersion()); final Map config = s3ConfigFile.read(); config.putAll(serverProperties.getOverrides()); environment.add(new PropertySource(application, config)); return environment; }
Source:
public List<Class> getSupportedTypes() { return new ArrayList<>(Arrays.asList(ZonedDateTime.class)); }

Target:
public List<Class> getSupportedTypes() { return Collections.singletonList(ZonedDateTime.class); }
Source:
public CloseableIterator<T> iterator() { return createCacheQuery().iterator(); }

Target:
public CloseableIterator<T> iterator() { IndexedQuery<T> cacheQuery = createCacheQuery(); return new MappingIterator(cacheQuery.iterator(), t -> rowProcessor == null ? t : rowProcessor.apply((Object[]) t)); }
Source:
void removeReplica(PartitionId partitionId) throws ReplicationException { PartitionInfo partitionInfo = partitionToPartitionInfo.remove(partitionId); if (partitionInfo == null) { logger.error("Partition not exist when remove from {}. ", partitionId, dataNodeId); throw new ReplicationException("Partition not found"); } removeRemoteReplicaInfoFromReplicaThread(partitionInfo.getRemoteReplicaInfos()); if (replicationConfig.replicationPersistTokenOnShutdownOrReplicaRemove) { try { persistor.write(partitionInfo.getLocalReplicaId().getMountPath(), false); } catch (IOException | ReplicationException e) { logger.error("Exception on token write when remove Partition from {}: ", partitionId, dataNodeId, e); throw new ReplicationException("Exception on token write."); } } Store cloudStore = partitionStoreMap.get(partitionId.toPathString()); if (cloudStore != null) { try { cloudStore.shutdown(); } catch (StoreException ex) { throw new ReplicationException("Cloud not shutdown blobstore while removing replica"); } } else { logger.warn("Store not found for partition {}", partitionId); } logger.info("Partition removed from {}", partitionId, dataNodeId); }

Target:
void removeReplica(PartitionId partitionId) throws ReplicationException { PartitionInfo partitionInfo = partitionToPartitionInfo.remove(partitionId); if (partitionInfo == null) { logger.error("Partition not exist when remove from {}. ", partitionId, dataNodeId); throw new ReplicationException("Partition not found"); } removeRemoteReplicaInfoFromReplicaThread(partitionInfo.getRemoteReplicaInfos()); if (replicationConfig.replicationPersistTokenOnShutdownOrReplicaRemove) { try { persistor.write(partitionInfo.getLocalReplicaId().getMountPath(), false); } catch (IOException | ReplicationException e) { logger.error("Exception on token write when remove Partition from {}: ", partitionId, dataNodeId, e); throw new ReplicationException("Exception on token write."); } } Store cloudStore = partitionStoreMap.get(partitionId.toPathString()); if (cloudStore != null) { storeManager.shutdownBlobStore(partitionId); storeManager.removeBlobStore(partitionId); } else { logger.warn("Store not found for partition {}", partitionId); } logger.info("Partition removed from {}", partitionId, dataNodeId); }
Source:
public boolean isOffsetCommittedByThisTopology(TopicPartition tp, OffsetAndMetadata committedOffset, Map<TopicPartition, OffsetManager> offsetManagers) { try { if (processingGuarantee == ProcessingGuarantee.AT_LEAST_ONCE && offsetManagers.containsKey(tp) && offsetManagers.get(tp).hasCommitted()) { return true; } final CommitMetadata committedMetadata = JSON_MAPPER.readValue(committedOffset.metadata(), CommitMetadata.class); return committedMetadata.getTopologyId().equals(context.getStormId()); } catch (IOException e) { LOG.warn("Failed to deserialize [{}]. Error likely occurred because the last commit " + "for this topic-partition was done using an earlier version of Storm. " + "Defaulting to behavior compatible with earlier version", committedOffset); LOG.trace("", e); return false; } }

Target:
public boolean isOffsetCommittedByThisTopology(TopicPartition tp, OffsetAndMetadata committedOffset, Map<TopicPartition, OffsetManager> offsetManagers) { try { if (processingGuarantee == ProcessingGuarantee.AT_LEAST_ONCE && offsetManagers.containsKey(tp) && offsetManagers.get(tp).hasCommitted()) { return true; } final CommitMetadata committedMetadata = JSON_MAPPER.readValue(committedOffset.metadata(), CommitMetadata.class); return committedMetadata.getTopologyId().equals(context.getStormId()); } catch (IOException e) { LOG.warn("Failed to deserialize expected commit metadata [{}]." + " This error is expected to occur once per partition, if the last commit to each partition" + " was by an earlier version of the KafkaSpout, or by a process other than the KafkaSpout. " + "Defaulting to behavior compatible with earlier version", committedOffset); LOG.trace("", e); return false; } }
Source:
public boolean onLongClick(final View view) { final InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); butt.setVisibility(View.INVISIBLE); edit.setVisibility(View.VISIBLE); if (edit.requestFocus()) { imm.showSoftInput(edit, InputMethodManager.SHOW_IMPLICIT); } edit.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(final CharSequence s, final int start, final int count, final int after) { } @Override public void onTextChanged(final CharSequence s, final int start, final int before, final int count) { } @Override public void afterTextChanged(final Editable s) { final Editable text = edit.getText(); if (text.length() > 0) { final char customChar = text.charAt(0); if ('A' <= customChar && customChar <= 'Z' || 'a' <= customChar && customChar <= 'z' || '0' <= customChar && customChar <= '9' || customChar == ' ') { setCustomChar(Character.toUpperCase(customChar)); } else { final Context context = getContext(); Toast.makeText(context, context.getString(R.string.warn_invalid_character), Toast.LENGTH_SHORT).show(); } edit.setText(""); } else { edit.clearFocus(); } } }); edit.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(final View v, final boolean hasFocus) { if (!hasFocus) { edit.setVisibility(View.INVISIBLE); butt.setVisibility(View.VISIBLE); imm.hideSoftInputFromWindow(edit.getWindowToken(), 0); } } }); return true; }

Target:
public boolean onLongClick(final View view) { return handleLongClick(); }
Source:
public ResponseEntity<?> handleConstraintViolationException(ConstraintViolationException ex) { return createResponseEntity(HttpStatus.BAD_REQUEST, "Username should be a valid Email!"); }

Target:
public ResponseEntity<?> handleConstraintViolationException(ConstraintViolationException ex) { return createResponseEntity(HttpStatus.BAD_REQUEST, ex.getMessage()); }
Source:
public Optional<Resource> getUsedResource(String accountId) throws NotFoundException, ServerException { final Account account = accountManager.getById(accountId); final List<WorkspaceImpl> accountWorkspaces = Lists.newArrayList( iterate( (maxItems, skipCount) -> workspaceManagerProvider .get() .getByNamespace(account.getName(), false, maxItems, skipCount)) .iterator()); if (!accountWorkspaces.isEmpty()) { return Optional.of( new ResourceImpl( WorkspaceResourceType.ID, accountWorkspaces.size(), WorkspaceResourceType.UNIT)); } else { return Optional.empty(); } }

Target:
public Optional<Resource> getUsedResource(String accountId) throws NotFoundException, ServerException { final Account account = accountManager.getById(accountId); final List<WorkspaceImpl> accountWorkspaces = Pages.stream( (maxItems, skipCount) -> workspaceManagerProvider .get() .getByNamespace(account.getName(), false, maxItems, skipCount)) .collect(Collectors.toList()); if (!accountWorkspaces.isEmpty()) { return Optional.of( new ResourceImpl( WorkspaceResourceType.ID, accountWorkspaces.size(), WorkspaceResourceType.UNIT)); } else { return Optional.empty(); } }
Source:
private void validateClaims(Header header, Claims claims) { if (claims != null) { if (!this.ignoreExpiry) { ValidationHelper.validateExpiration(header, claims, this.allowedClockSkewMillis, this.clock); } if (!this.ignoreNotBefore) { ValidationHelper.validateNotBefore(header, claims, this.allowedClockSkewMillis, this.clock); } validateExpectedClaims(header, claims); } }

Target:
private void validateClaims(Header header, Claims claims) { if (claims != null) { if (!this.ignoreExpiry) { validateExpiration(header, claims); } if (!this.ignoreNotBefore) { validateNotBefore(header, claims); } validateExpectedClaims(header, claims); } }
Source:
public void shouldCreateRunnerInstance() throws Throwable { RunnerProvider provider = new RunnerProvider(); InternalRunner runner = provider.newInstance("org.mockito.internal.runners.DefaultInternalRunner", this.getClass(), null); assertNotNull(runner); }

Target:
public void shouldCreateRunnerInstance() throws Throwable { RunnerProvider provider = new RunnerProvider(); InternalRunner runner = provider.newInstance(DefaultInternalRunner.class.getName(), this.getClass(), null); assertNotNull(runner); }
Source:
private static void checkConfigNameForRestart(String yamlFile) { boolean wasPreviouslyLaunched = launchedYamlFile != null; if (wasPreviouslyLaunched && !launchedYamlFile.equals(yamlFile)) { throw new UnsupportedOperationException("We can't launch two Cassandra configurations in the same JVM instance"); } launchedYamlFile = yamlFile; }

Target:
private static void checkConfigNameForRestart(String yamlFile) { boolean wasPreviouslyLaunched = cassandraRef.get() != null; if (wasPreviouslyLaunched && !launchedYamlFile.equals(yamlFile)) { throw new UnsupportedOperationException("We can't launch two Cassandra configurations in the same JVM instance"); } launchedYamlFile = yamlFile; }