auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public CohortDefinition getPatientsWithEnrollment(){ ProgramEnrollmentCohortDefinition cd = new ProgramEnrollmentCohortDefinition(); cd.addParameter(new Parameter("programs", "reporting.parameter.programs", Program.class, List.class, null)); cd.addParameter(new Parameter("enrolledOnOrAfter", "reporting.parameter.enrolledOnOrAfter", Date.class)); cd.addParameter(new Parameter("enrolledOnOrBefore", "reporting.parameter.enrolledOnOrBefore", Date.class)); cd.addParameter(new Parameter("completedOnOrAfter", "reporting.parameter.completedOnOrAfter", Date.class)); cd.addParameter(new Parameter("completedOnOrBefore", "reporting.parameter.completedOnOrBefore", Date.class)); cd.addParameter(new Parameter("locationList", "reporting.parameter.locationList", Location.class, List.class, null)); return cd; }

Target:
public CohortDefinition getPatientsWithEnrollment(){ ProgramEnrollmentCohortDefinition cd = new ProgramEnrollmentCohortDefinition(); cd.addParameter(new Parameter("programs", "reporting.parameter.programs", Program.class, List.class, null)); cd.addParameter(new Parameter("enrolledOnOrAfter", "reporting.parameter.enrolledOnOrAfter", Date.class)); cd.addParameter(new Parameter("enrolledOnOrBefore", "reporting.parameter.enrolledOnOrBefore", Date.class)); cd.addParameter(new Parameter("completedOnOrAfter", "reporting.parameter.completedOnOrAfter", Date.class)); cd.addParameter(new Parameter("completedOnOrBefore", "reporting.parameter.completedOnOrBefore", Date.class)); cd.addParameter(new Parameter("locationList", "reporting.parameter.locationList", Location.class, List.class, null)); return new MappedParametersCohortDefinition(cd, "programs", "programs", "enrolledOnOrAfter", "enrolledOnOrAfter", "enrolledOnOrBefore", "enrolledOnOrBefore", "completedOnOrAfter", "completedOnOrAfter", "completedOnOrBefore", "completedOnOrBefore", "locationList", "locations" ); }
Source:
public void nextRecordByCursor( RECORD record, RecordLoad mode, PageCursor cursor ) throws UnderlyingStorageException { try { int offset = cursor.getOffset() + recordSize; long id = record.getId() + 1; record.setId( id ); long pageId = cursor.getCurrentPageId(); if ( offset >= storeFile.pageSize() || pageId < 0 ) { offset = 0; if ( !cursor.next( pageId + 1 ) ) { verifyAfterNotRead( record, mode ); return; } } readRecordFromPage( id, record, mode, cursor, offset ); } catch ( IOException e ) { throw new UnderlyingStorageException( e ); } }

Target:
public void nextRecordByCursor( RECORD record, RecordLoad mode, PageCursor cursor ) throws UnderlyingStorageException { if ( cursor.getCurrentPageId() < -1 ) { throw new IllegalArgumentException( "Pages are assumed to be positive or -1 if not initialized" ); } try { int offset = cursor.getOffset(); long id = record.getId() + 1; record.setId( id ); long pageId = cursor.getCurrentPageId(); if ( offset >= storeFile.pageSize() || pageId < 0 ) { if ( !cursor.next() ) { verifyAfterNotRead( record, mode ); return; } cursor.setOffset( 0 ); } readRecordFromPage( id, record, mode, cursor ); } catch ( IOException e ) { throw new UnderlyingStorageException( e ); } }
Source:
public OpenShiftDebugMode execute(IProgressMonitor monitor) throws CoreException { Connection connection = OpenShiftServerUtils.getConnection(context.getServer()); IResource resource = OpenShiftServerUtils.getResource(context.getServer(), monitor); IDeploymentConfig dc = getDeploymentConfig(resource, connection, monitor); if (dc == null) { throw new CoreException(OpenShiftCoreActivator.statusFactory().errorStatus( NLS.bind("Could not find deployment config for resource {0}. " + "Your build might be still running and pods not created yet or " + "there might be no labels on your pods pointing to the wanted deployment config.", resource != null? resource.getName() : ""))); } boolean dcUpdated = updateDc(dc, connection, monitor); IPod pod = getPod(dcUpdated, dc, connection, monitor); context.setPod(pod); toggleTimeout(resource, connection, context, monitor); toggleDebugger(context, monitor); return this; }

Target:
public OpenShiftDebugMode execute(IProgressMonitor monitor) throws CoreException { Connection connection = OpenShiftServerUtils.getConnection(context.getServer()); IResource resource = OpenShiftServerUtils.getResource(context.getServer(), monitor); IDeploymentConfig dc = getDeploymentConfig(resource, connection, monitor); if (dc == null) { throw new CoreException(OpenShiftCoreActivator.statusFactory().errorStatus( NLS.bind("Could not find deployment config for resource {0}. " + "Your build might be still running and pods not created yet or " + "there might be no labels on your pods pointing to the wanted deployment config.", resource != null? resource.getName() : ""))); } boolean dcUpdated = updateDc(dc, connection, monitor); IPod pod = getPod(dcUpdated, dc, connection, monitor); context.setPod(pod); toggleRouteTimeout(resource, connection, context, monitor); toggleDebugger(context, monitor); return this; }
Source:
public Index(List<FieldSort> fieldNames, String indexName, IndexType indexType, Tokenizer tokenizer) { Misc.checkNotNull(fieldNames, "fieldNames"); Misc.checkArgument(!fieldNames.isEmpty(), "fieldNames isEmpty()"); Misc.checkArgument((indexName == null || !indexName.isEmpty()), "indexName"); this.fieldNames = new ArrayList<FieldSort>(fieldNames); this.indexName = indexName; this.indexType = indexType; if (indexType == IndexType.TEXT) { if (tokenizer == null) { this.tokenizer = Tokenizer.DEFAULT; } else { this.tokenizer = tokenizer; } } else { Misc.checkArgument(tokenizer == null, "tokenizer must not be null if indexType is JSON"); this.tokenizer = null; } }

Target:
public Index(List<FieldSort> fieldNames, String indexName, IndexType indexType, Tokenizer tokenizer) { Misc.checkNotNull(fieldNames, "fieldNames"); Misc.checkArgument(!fieldNames.isEmpty(), "fieldNames isEmpty()"); Misc.checkArgument((indexName == null || !indexName.isEmpty()), "indexName"); this.fieldNames = new ArrayList<FieldSort>(fieldNames); this.indexName = indexName; this.indexType = indexType; if (indexType == IndexType.TEXT) { if (tokenizer == null) { this.tokenizer = Tokenizer.DEFAULT; } else { this.tokenizer = tokenizer; } } else { Misc.checkArgument(tokenizer == null, "tokenizer must be null if indexType is JSON"); this.tokenizer = null; } }
Source:
public void setProjects(Map<String,Project> projects) { if (projects != null) { populateGroups(getGroups(), new TreeSet<>(projects.values())); } setConfigurationValue("projects", projects); }

Target:
public void setProjects(Map<String,Project> projects) { try { configLock.writeLock().lock(); if (projects != null) { populateGroups(getGroups(), new TreeSet<>(projects.values())); } setConfigurationValue("projects", projects); } finally { configLock.writeLock().unlock(); } }
Source:
private long loadFiles(Table.ID tableId, Path bulkDir, LoadMappingIterator loadMapIter, Master master, long tid) throws Exception { PeekingIterator<Map.Entry<KeyExtent,Bulk.Files>> lmi = new PeekingIterator(loadMapIter); Map.Entry<KeyExtent,Bulk.Files> loadMapEntry = lmi.peek(); Text startRow = loadMapEntry.getKey().getPrevEndRow(); Iterator<TabletMetadata> tabletIter = TabletsMetadata.builder().forTable(tableId) .overlapping(startRow, null).checkConsistency().fetchPrev().fetchLocation().fetchLoaded() .build(master.getContext()).iterator(); List<TabletMetadata> tablets = new ArrayList<>(); TabletMetadata currentTablet = tabletIter.next(); Loader loader; if (bulkInfo.tableState == TableState.ONLINE) { loader = new OnlineLoader(); } else { loader = new OfflineLoader(); } loader.start(bulkDir, master, tid, bulkInfo.setTime); long t1 = System.currentTimeMillis(); while (lmi.hasNext()) { loadMapEntry = lmi.next(); KeyExtent fileTablet = loadMapEntry.getKey(); tablets.clear(); currentTablet = getFirstTablet(tabletIter, currentTablet, fileTablet.getPrevEndRow()); tablets.add(currentTablet); tablets.addAll(getTabletsInRange(tabletIter, currentTablet, fileTablet.getEndRow())); loader.load(tablets, loadMapEntry.getValue()); } return loader.finish(Math.min(System.currentTimeMillis() - t1, 30000)); }

Target:
private long loadFiles(Table.ID tableId, Path bulkDir, LoadMappingIterator loadMapIter, Master master, long tid) throws Exception { PeekingIterator<Map.Entry<KeyExtent,Bulk.Files>> lmi = new PeekingIterator<>(loadMapIter); Map.Entry<KeyExtent,Bulk.Files> loadMapEntry = lmi.peek(); Text startRow = loadMapEntry.getKey().getPrevEndRow(); Iterator<TabletMetadata> tabletIter = TabletsMetadata.builder().forTable(tableId) .overlapping(startRow, null).checkConsistency().fetchPrev().fetchLocation().fetchLoaded() .build(master.getContext()).iterator(); Loader loader; if (bulkInfo.tableState == TableState.ONLINE) { loader = new OnlineLoader(); } else { loader = new OfflineLoader(); } loader.start(bulkDir, master, tid, bulkInfo.setTime); long t1 = System.currentTimeMillis(); while (lmi.hasNext()) { loadMapEntry = lmi.next(); List<TabletMetadata> tablets = findOverlappingTablets(loadMapEntry.getKey(), tabletIter); loader.load(tablets, loadMapEntry.getValue()); } long sleepTime = loader.finish(); if (sleepTime > 0) { long scanTime = Math.min(System.currentTimeMillis() - t1, 30000); sleepTime = Math.max(sleepTime, scanTime * 2); } return sleepTime; }
Source:
private Optional<String> updateGerritAuthWhenRequired(HttpContext httpContext, HttpClientBuilder client) throws IOException, HttpStatusException { if (!loginCache.getHostSupportsGerritAuth()) { cookieStore.clear(); return Optional.absent(); } if (authData.isHttpPassword() || githubOAuthDetected) { return Optional.absent(); } Optional<Cookie> gerritAccountCookie = findGerritAccountCookie(); if (!gerritAccountCookie.isPresent() || gerritAccountCookie.get().isExpired(new Date()) || !isSessionValid(client, httpContext)) { return updateGerritAuth(httpContext, client); } return loginCache.getGerritAuthOptional(); }

Target:
private Optional<String> updateGerritAuthWhenRequired(HttpContext httpContext, HttpClientBuilder client) throws IOException, HttpStatusException { if (!loginCache.getHostSupportsGerritAuth()) { cookieStore.clear(); return Optional.absent(); } if (authData.isHttpPassword()) { return Optional.absent(); } if (loginCache.isGithubOAuthDetected()) { return Optional.absent(); } Optional<Cookie> gerritAccountCookie = findGerritAccountCookie(); if (!gerritAccountCookie.isPresent() || gerritAccountCookie.get().isExpired(new Date()) || !isSessionValid(client, httpContext)) { return updateGerritAuth(httpContext, client); } return loginCache.getGerritAuthOptional(); }
Source:
void parseTemplateNode(Map<String, Template> templates, Node templateNode) { if (templateNode.getNodeType() == Node.ELEMENT_NODE) { Template template = new Template(); Element element = (Element) templateNode; template.setTestPlan("true".equals(element.getAttribute("isTestPlan"))); template.setName(element.getElementsByTagName("name").item(0).getTextContent()); template.setDescription(element.getElementsByTagName("description").item(0).getTextContent()); template.setFileName(element.getElementsByTagName("fileName").item(0).getTextContent()); NodeList nl = element.getElementsByTagName("parameters"); if(nl.getLength()>0) { NodeList parameterNodes = ((Element) nl.item(0)).getElementsByTagName("parameter"); Map<String, String> parameters = parseParameterNodes(parameterNodes); template.setParameters(parameters); } templates.put(template.getName(), template); } }

Target:
void parseTemplateNode(Map<String, Template> templates, Node templateNode) { if (templateNode.getNodeType() == Node.ELEMENT_NODE) { Template template = new Template(); Element element = (Element) templateNode; template.setTestPlan("true".equals(element.getAttribute("isTestPlan"))); template.setName(textOfFirstTag(element, "name")); template.setDescription(textOfFirstTag(element, "description")); template.setFileName(textOfFirstTag(element, "fileName")); NodeList nl = element.getElementsByTagName("parameters"); if(nl.getLength()>0) { NodeList parameterNodes = ((Element) nl.item(0)).getElementsByTagName("parameter"); Map<String, String> parameters = parseParameterNodes(parameterNodes); template.setParameters(parameters); } templates.put(template.getName(), template); } }
Source:
private static ResourceMethod getResourceMethod(Widget toCall, String methodName, Class<?> resourceType) throws NoSuchMethodException { Object oldData = toCall.getData(DISPOSE_LIST); if (oldData instanceof List) { for (Object name : ((List<?>) oldData)) { ResourceMethod method = (ResourceMethod) name; if (method.id == methodName) { return method; } } } if (oldData instanceof ResourceMethod) { if (((ResourceMethod) oldData).id == methodName) { return ((ResourceMethod) oldData); } List<ResourceMethod> newList = new ArrayList<>(); newList.add((ResourceMethod) oldData); oldData = newList; toCall.setData(DISPOSE_LIST, oldData); } Class<?> clazz = toCall.getClass(); Method method; try { method = clazz.getMethod(methodName, resourceType); } catch (SecurityException e) { throw e; } ResourceMethod result = new ResourceMethod(method, methodName); if (oldData == null) { toCall.setData(DISPOSE_LIST, result); toCall.addDisposeListener(disposeListener); } else { ((List<ResourceMethod>) oldData).add(result); } return result; }

Target:
private static ResourceMethod getResourceMethod(Widget toCall, String methodName, Class<?> resourceType) throws NoSuchMethodException { Object oldData = toCall.getData(DISPOSE_LIST); if (oldData instanceof List) { for (Object element : ((List<?>) oldData)) { ResourceMethod method = (ResourceMethod) element; if (method.id == methodName) { return method; } } } if (oldData instanceof ResourceMethod) { if (((ResourceMethod) oldData).id == methodName) { return ((ResourceMethod) oldData); } List<ResourceMethod> newList = new ArrayList<>(); newList.add((ResourceMethod) oldData); oldData = newList; toCall.setData(DISPOSE_LIST, oldData); } Class<?> clazz = toCall.getClass(); Method method; try { method = clazz.getMethod(methodName, resourceType); } catch (SecurityException e) { throw e; } ResourceMethod result = new ResourceMethod(method, methodName); if (oldData == null) { toCall.setData(DISPOSE_LIST, result); toCall.addDisposeListener(disposeListener); } else { ((List<ResourceMethod>) oldData).add(result); } return result; }
Source:
public void testCommit() { System.out.println("testCommit"); jdbc.execute("insert into example values (1, 'test1')"); System.out.println("testCommit OK"); }

Target:
public void testCommit() throws Exception { try { System.out.println("testCommit"); Transaction transaction = tm.getTransaction(); transaction.enlistResource(xaResource); jdbc.execute("insert into example values (1, 'test1')"); System.out.println("testCommit OK"); } catch (Exception e) { System.out.println("testCommit FAIL with " + e); throw e; } }
Source:
public void enrollInCourse() { EnrollForCourseTask enrollForCourseTask = new EnrollForCourseTask(getActivity(), courseDetail.course_id, emailOptIn) { @Override public void onSuccess(Boolean result) { if (result != null && result) { mEnrolled = true; logger.debug("Enrollment successful:" + courseDetail.course_id); mEnrollButton.setText(R.string.view_course_button_text); Toast.makeText(getContext(), R.string.you_are_now_enrolled, Toast.LENGTH_SHORT).show(); signalMyCourseListToRefresh(); GetEnrolledCourseTask getEnrolledCourseTask = new GetEnrolledCourseTask(getActivity(), courseDetail.course_id) { @Override public void onSuccess(EnrolledCoursesResponse course) { if (course != null) { environment.getRouter().showCourseDashboardTabs(getActivity(), environment.getConfig(), course, false); } else { Toast.makeText(getContext(), R.string.cannot_show_dashboard, Toast.LENGTH_SHORT).show(); } } @Override public void onException(Exception ex) { logger.error(ex); Toast.makeText(getContext(), R.string.enrollment_failure, Toast.LENGTH_SHORT).show(); } }; getEnrolledCourseTask.execute(); } else { logger.debug("Enrollment failure:" + courseDetail.course_id); Toast.makeText(getContext(), R.string.enrollment_failure, Toast.LENGTH_SHORT).show(); } } @Override public void onException(Exception ex) { logger.error(ex); Toast.makeText(getContext(), R.string.enrollment_failure, Toast.LENGTH_SHORT).show(); } }; enrollForCourseTask.execute(); }

Target:
public void enrollInCourse() { EnrollForCourseTask enrollForCourseTask = new EnrollForCourseTask(getActivity(), courseDetail.course_id, emailOptIn) { @Override public void onSuccess(Void result) { mEnrolled = true; logger.debug("Enrollment successful:" + courseDetail.course_id); mEnrollButton.setText(R.string.view_course_button_text); Toast.makeText(getContext(), R.string.you_are_now_enrolled, Toast.LENGTH_SHORT).show(); GetEnrolledCourseTask getEnrolledCourseTask = new GetEnrolledCourseTask(getActivity(), courseDetail.course_id) { @Override public void onSuccess(EnrolledCoursesResponse course) { environment.getRouter().showCourseDashboardTabs(getActivity(), environment.getConfig(), course, false); } @Override public void onException(Exception ex) { logger.error(ex); Toast.makeText(getContext(), R.string.cannot_show_dashboard, Toast.LENGTH_SHORT).show(); } }; getEnrolledCourseTask.execute(); } @Override public void onException(Exception ex) { logger.error(ex); Toast.makeText(getContext(), R.string.enrollment_failure, Toast.LENGTH_SHORT).show(); } }; enrollForCourseTask.execute(); }
Source:
public void endWindow() { byte[] currentWindowIDBytes = GPOUtils.serializeLong(currentWindowID); for(Long bucket: buckets) { Long committedWindowID = futureBuckets.get(bucket); if(committedWindowID == null || committedWindowID <= currentWindowID) { futureBuckets.remove(bucket); try { put(bucket, WINDOW_ID_KEY, currentWindowIDBytes); } catch(IOException ex) { throw new RuntimeException(ex); } } } cacheWindowCount++; for(Map.Entry<EventKey, Aggregate> entry: cache.entrySet()) { putGAE(entry.getValue()); } if (updates.isConnected()) { for(Map.Entry<EventKey, Aggregate> entry: cache.entrySet()) { updates.emit(entry.getValue()); } } if(cacheWindowCount == cacheWindowDuration) { cache.clear(); cacheWindowCount = 0; } super.endWindow(); }

Target:
public void endWindow() { byte[] currentWindowIDBytes = GPOUtils.serializeLong(currentWindowID); for(Long bucket: buckets) { Long committedWindowID = futureBuckets.get(bucket); if(committedWindowID == null || committedWindowID <= currentWindowID) { futureBuckets.remove(bucket); try { put(bucket, WINDOW_ID_KEY, currentWindowIDBytes); } catch(IOException ex) { throw new RuntimeException(ex); } } } cacheWindowCount++; for(Map.Entry<EventKey, Aggregate> entry: cache.entrySet()) { putGAE(entry.getValue()); } emitUpdates(); if(cacheWindowCount == cacheWindowDuration) { cache.clear(); cacheWindowCount = 0; } super.endWindow(); }
Source:
public E peek(long timeout, TimeUnit unit) throws InterruptedException { lock.lock(); try { long timeoutNanos = unit.toNanos(timeout); while (queue.isEmpty() && timeoutNanos > 0) { timeoutNanos = nonEmpty.awaitNanos(timeoutNanos); } E peek = queue.peek(); if (peek == null) { throw new NoSuchElementException(); } return peek; } catch (IOException e) { QueueFile.<Error>getSneakyThrowable(e); return null; } finally { lock.unlock(); } }

Target:
public E peek(long timeout, TimeUnit unit) throws InterruptedException { lock.lock(); try { long timeoutNanos = unit.toNanos(timeout); while (queue.isEmpty() && timeoutNanos > 0) { timeoutNanos = nonEmpty.awaitNanos(timeoutNanos); } E peek = queue.peek(); if (peek == null) { throw new NoSuchElementException(); } return peek; } catch (IOException e) { throw QueueFile.<Error>getSneakyThrowable(e); } finally { lock.unlock(); } }
Source:
protected void onCreate(Bundle savedInstanceState) { Timber.d("onCreate()"); mExtensions = new ReviewerExtRegistry(getBaseContext()); super.onCreate(savedInstanceState); setContentView(getContentViewAttr(mPrefFullscreenReview)); getDelegate().setHandleNativeActionModesEnabled(true); View mainView = findViewById(android.R.id.content); initNavigationDrawer(mainView); }

Target:
protected void onCreate(Bundle savedInstanceState) { Timber.d("onCreate()"); mExtensions = new ReviewerExtRegistry(getBaseContext()); restorePreferences(); super.onCreate(savedInstanceState); setContentView(getContentViewAttr(mPrefFullscreenReview)); getDelegate().setHandleNativeActionModesEnabled(true); View mainView = findViewById(android.R.id.content); initNavigationDrawer(mainView); }
Source:
public Config syncConfig(@RequestBody Config config) { return configService.syncConfig(config); }

Target:
public void syncConfig(@RequestBody Config config) { if (configService.verifyConfig(config)) { configService.syncConfig(config.getName()); } else { throw new CommcareAuthenticationException(); } }
Source:
public TierConfig(@JsonProperty(value = "name", required = true) String name, @JsonProperty(value = "segmentSelectorType", required = true) String segmentSelectorType, @JsonProperty("segmentAge") @Nullable String segmentAge, @JsonProperty(value = "storageType", required = true) String storageType, @JsonProperty("serverTag") @Nullable String serverTag) { _name = name; _segmentSelectorType = segmentSelectorType; _segmentAge = segmentAge; _storageType = storageType; _serverTag = serverTag; }

Target:
public TierConfig(@JsonProperty(value = "name", required = true) String name, @JsonProperty(value = "segmentSelectorType", required = true) String segmentSelectorType, @JsonProperty("segmentAge") @Nullable String segmentAge, @JsonProperty(value = "storageType", required = true) String storageType, @JsonProperty("serverTag") @Nullable String serverTag) { Preconditions.checkArgument(name != null, "Must provide non-null 'name' in tierConfig"); Preconditions .checkArgument(segmentSelectorType != null, "Must provide non-null 'segmentSelectorType' in tierConfig"); Preconditions.checkArgument(storageType != null, "Must provide non-null 'storageType' in tierConfig"); _name = name; _segmentSelectorType = segmentSelectorType; _segmentAge = segmentAge; _storageType = storageType; _serverTag = serverTag; }
Source:
private void updateProfileConfigIni() { File profileConfigIni = FileManagementUtil.getProfileConfigIniFile(destination, resourceBundle.getProfile()); FileManagementUtil.changeConfigIniProperty(profileConfigIni, "eclipse.p2.data.area", "@config.dir/../lib/p2/", resourceBundle.getLog()); }

Target:
private void updateProfileConfigIni() { File profileConfigIni = FileManagementUtil.getProfileConfigIniFile(destination, resourceBundle.getProfile()); FileManagementUtil.changeConfigIniProperty(profileConfigIni, "eclipse.p2.data.area", P2Constants.P2_DIRECTORY, resourceBundle.getLog()); }
Source:
public void cache(String key, E entry, int ttl) { cache.get(key, k -> new Entries<>(ttl)).add(entry, shouldReplaceAll(entry)); }

Target:
public void cache(String key, E entry, int ttl) { Entries<E> entries = cache.getIfPresent(key); if (entries == null) { entries = new Entries<>(ttl); } entries.add(entry, ttl, shouldReplaceAll(entry)); cache.put(key, entries); }
Source:
public AuthenticationToken getToken() { if (null != tokenClassName) { final Properties props = new Properties(); if (!loginProps.isEmpty()) { for (Entry<String,String> loginOption : loginProps.entrySet()) props.put(loginOption.getKey(), loginOption.getValue()); } try { AuthenticationToken token = Class.forName(tokenClassName).asSubclass(AuthenticationToken.class).newInstance(); token.init(props); return token; } catch (Exception e) { throw new RuntimeException(e); } } Password pass = null; if (securePassword != null) { pass = securePassword; } else if (password != null) { pass = password; } else { try { pass = Password.promptUser(); } catch (IOException e) { throw new RuntimeException(e); } } if (pass != null) { return new PasswordToken(pass.value); } return null; }

Target:
public AuthenticationToken getToken() { if (null != tokenClassName) { final Properties props = new Properties(); if (!loginProps.isEmpty()) { for (Entry<String,String> loginOption : loginProps.entrySet()) props.put(loginOption.getKey(), loginOption.getValue()); } try { AuthenticationToken token = Class.forName(tokenClassName).asSubclass(AuthenticationToken.class).newInstance(); token.init(props); return token; } catch (Exception e) { throw new RuntimeException(e); } } Password pass = null; if (securePassword != null) { pass = securePassword; } else if (password != null) { pass = password; } else { try { pass = Password.promptUser(); } catch (IOException e) { throw new RuntimeException(e); } } return new PasswordToken(pass.value); }
Source:
public MetadataDiff compareMetadata(DirCacheEntry entry) { if (entry.isAssumeValid()) return MetadataDiff.EQUAL; if (entry.isUpdateNeeded()) return MetadataDiff.DIFFER_BY_METADATA; if (!entry.isSmudged() && entry.getLength() != (int) getEntryLength()) return MetadataDiff.DIFFER_BY_METADATA; if (isModeDifferent(entry.getRawMode())) return MetadataDiff.DIFFER_BY_METADATA; long cacheLastModified = entry.getLastModified(); long fileLastModified = getEntryLastModified(); if (cacheLastModified % 1000 == 0 || getOptions().getCheckStat() == CheckStat.MINIMAL) fileLastModified = fileLastModified - fileLastModified % 1000; else if (fileLastModified % 1000 == 0 || getOptions().getCheckStat() == CheckStat.MINIMAL) cacheLastModified = cacheLastModified - cacheLastModified % 1000; if (fileLastModified != cacheLastModified) return MetadataDiff.DIFFER_BY_TIMESTAMP; else if (!entry.isSmudged()) return MetadataDiff.EQUAL; else return MetadataDiff.SMUDGED; }

Target:
public MetadataDiff compareMetadata(DirCacheEntry entry) { if (entry.isAssumeValid()) return MetadataDiff.EQUAL; if (entry.isUpdateNeeded()) return MetadataDiff.DIFFER_BY_METADATA; if (!entry.isSmudged() && entry.getLength() != (int) getEntryLength()) return MetadataDiff.DIFFER_BY_METADATA; if (isModeDifferent(entry.getRawMode())) return MetadataDiff.DIFFER_BY_METADATA; long cacheLastModified = entry.getLastModified(); long fileLastModified = getEntryLastModified(); long lastModifiedMillis = fileLastModified % 1000; long cacheMillis = cacheLastModified % 1000; if (getOptions().getCheckStat() == CheckStat.MINIMAL) { fileLastModified = fileLastModified - lastModifiedMillis; cacheLastModified = cacheLastModified - cacheMillis; } else if (cacheMillis == 0) fileLastModified = fileLastModified - lastModifiedMillis; else if (lastModifiedMillis == 0) cacheLastModified = cacheLastModified - cacheMillis; if (fileLastModified != cacheLastModified) return MetadataDiff.DIFFER_BY_TIMESTAMP; else if (!entry.isSmudged()) return MetadataDiff.EQUAL; else return MetadataDiff.SMUDGED; }
Source:
public String toString() { return "EmployeeInterface{" + "id=" + id + ", name='" + name + '\'' + '}'; }

Target:
public String toString() { return "Employee{" + "id=" + id + ", name='" + name + '\'' + '}'; }
Source:
public void mergeStreams(DAG dag, Configuration conf) { if (streamsToMerge.size() < 2) { throw new IllegalArgumentException("Not enough streams to merge, at least two streams must be selected for " + "merging with `.merge()`."); } ArrayList<Stream> streamsToAddToDag = new ArrayList<>(); ArrayList<NamedMerger> operatorsToAdd = new ArrayList<>(); constructMergeTree(streamsToAddToDag, operatorsToAdd); for (NamedMerger m : operatorsToAdd) { dag.addOperator(m.name, m.merger); } for (Stream s : streamsToAddToDag) { dag.addStream(s.name, s.sourcePort, s.destPort).setLocality(DAG.Locality.CONTAINER_LOCAL); } }

Target:
public DefaultOutputPort<K> mergeStreams(DAG dag, Configuration conf) { if (streamsToMerge.size() < 2) { throw new IllegalArgumentException("Not enough streams to merge, at least two streams must be selected for " + "merging with `.merge()`."); } ArrayList<Stream> streamsToAddToDag = new ArrayList<>(); ArrayList<NamedMerger> operatorsToAdd = new ArrayList<>(); constructMergeTree(streamsToAddToDag, operatorsToAdd); for (NamedMerger m : operatorsToAdd) { dag.addOperator(m.name, m.merger); } for (Stream s : streamsToAddToDag) { DAG.StreamMeta stream = dag.addStream(s.name, s.sourcePort.port, s.destPort); if (s.sourcePort.internal) { stream.setLocality(DAG.Locality.CONTAINER_LOCAL); } } return streamOutput; }
Source:
private void evictInactiveEntries(long bytesNeeded) { CacheEntry[] entries = getPersistentServerCaches().asMap().values().toArray(new CacheEntry[]{}); Arrays.sort(entries); long available = this.getMemoryManager().getAvailableMemory(); for (int i = 0; i < entries.length && available < bytesNeeded; i++) { CacheEntry entry = entries[i]; if (!entry.isLive()) { getServerCaches().invalidate(entry.getCacheId()); getPersistentServerCaches().invalidate(entry.getCacheId()); available = this.getMemoryManager().getAvailableMemory(); } } }

Target:
synchronized private void evictInactiveEntries(long bytesNeeded) { logger.debug("Trying to evict inactive cache entries to free up " + bytesNeeded + " bytes"); CacheEntry[] entries = getPersistentServerCaches().asMap().values().toArray(new CacheEntry[]{}); Arrays.sort(entries); long available = this.getMemoryManager().getAvailableMemory(); for (int i = 0; i < entries.length && available < bytesNeeded; i++) { CacheEntry entry = entries[i]; ImmutableBytesPtr cacheId = entry.getCacheId(); getPersistentServerCaches().invalidate(cacheId); available = this.getMemoryManager().getAvailableMemory(); logger.debug("Evicted cache ID " + Bytes.toLong(cacheId.get()) + ", we now have " + available + " bytes available"); } }
Source:
public synchronized void onOptimizationFinished(final Set<String> addedWorkers, final Set<String> deletedWorkers) { stateMachine.checkState(State.OPTIMIZE); LOG.log(Level.INFO, "NumAddedWorkers: {0}, NumDeletedWorkers: {1}", new Object[]{addedWorkers.size(), deletedWorkers.size()}); LOG.log(Level.FINE, "AddedWorkers: {0}, DeletedWorkers: {1}", new Object[]{addedWorkers, deletedWorkers}); if (!runningWorkerIds.containsAll(deletedWorkers) || !Collections.disjoint(addedWorkers, deletedWorkers) || !Collections.disjoint(addedWorkers, runningWorkerIds)) { throw new IllegalStateException("The change by optimization is invalid"); } final int numRunningWorkersBefore = runningWorkerIds.size(); runningWorkerIds.addAll(addedWorkers); runningWorkerIds.removeAll(deletedWorkers); blockedWorkerIds.removeAll(deletedWorkers); LOG.log(Level.INFO, "The number of running workers changes by optimization. {0} -> {1}", new Object[]{numRunningWorkersBefore, runningWorkerIds.size()}); stateMachine.setState(State.RUN); if (!blockedWorkerIds.isEmpty()) { stateMachine.setState(State.RUN_FINISHING); } tryReleasingWorkers(); }

Target:
public synchronized void onOptimizationFinished(final Set<String> addedWorkers, final Set<String> deletedWorkers) { stateMachine.checkState(State.OPTIMIZE); LOG.log(Level.INFO, "Added {0} Workers: {1}", new Object[] {addedWorkers.size(), addedWorkers}); LOG.log(Level.INFO, "Deleted {0} Workers: {1}", new Object[] {deletedWorkers.size(), deletedWorkers}); if (!runningWorkerIds.containsAll(deletedWorkers) || !Collections.disjoint(addedWorkers, deletedWorkers) || !Collections.disjoint(addedWorkers, runningWorkerIds)) { throw new IllegalStateException("The change by optimization is invalid"); } final int numRunningWorkersBefore = runningWorkerIds.size(); runningWorkerIds.addAll(addedWorkers); runningWorkerIds.removeAll(deletedWorkers); blockedWorkerIds.removeAll(deletedWorkers); LOG.log(Level.INFO, "The number of running workers changes by optimization. {0} -> {1}", new Object[]{numRunningWorkersBefore, runningWorkerIds.size()}); stateMachine.setState(State.RUN); if (!blockedWorkerIds.isEmpty()) { stateMachine.setState(State.RUN_FINISHING); } tryReleasingWorkers(); }
Source:
private void deleteDependency() { editor.waitActive(); Actions action = actionsFactory.createAction(seleniumWebDriver); editor.setCursorToLine(36); action .keyDown(SHIFT) .sendKeys(DOWN) .sendKeys(DOWN) .sendKeys(DOWN) .sendKeys(DOWN) .sendKeys(DOWN) .keyUp(SHIFT) .sendKeys(DELETE) .perform(); }

Target:
private void deleteDependency() { editor.waitActive(); editor.setCursorToLine(36); seleniumWebDriverHelper .getAction() .keyDown(SHIFT) .sendKeys(DOWN, DOWN, DOWN, DOWN, DOWN) .keyUp(SHIFT) .sendKeys(DELETE) .perform(); }
Source:
public static <T> Response<T> error(int code, ResponseBody body) { if (code < 400) throw new IllegalArgumentException("code < 400: " + code); return error(body, new okhttp3.Response.Builder() .body(body) .code(code) .message("Response.error()") .protocol(Protocol.HTTP_1_1) .request(new Request.Builder().url("http://localhost/").build()) .build()); }

Target:
public static <T> Response<T> error(int code, ResponseBody body) { if (code < 400) throw new IllegalArgumentException("code < 400: " + code); return error(body, new okhttp3.Response.Builder() .body(new OkHttpCall.NoContentResponseBody(body.contentType(), body.contentLength())) .code(code) .message("Response.error()") .protocol(Protocol.HTTP_1_1) .request(new Request.Builder().url("http://localhost/").build()) .build()); }
Source:
public Map<String, Object> toHeaders(StompHeaders source) { Map<String, Object> target = new HashMap<String, Object>(); for (String name : source.keySet()) { if (shouldMapHeader(name, this.inboundHeaderNames)) { if (StompHeaders.CONTENT_TYPE.equals(name)) { target.put(MessageHeaders.CONTENT_TYPE, source.getContentType()); } else { target.put(name, source.getFirst(name)); } } } return target; }

Target:
public Map<String, Object> toHeaders(StompHeaders source) { Map<String, Object> target = new HashMap<String, Object>(); for (String name : source.keySet()) { if (shouldMapHeader(name, this.inboundHeaderNames)) { if (StompHeaders.CONTENT_TYPE.equals(name)) { target.put(MessageHeaders.CONTENT_TYPE, source.getContentType()); } else { String key = name; if (IntegrationStompHeaders.HEADERS.contains(name)) { key = IntegrationStompHeaders.PREFIX + name; } target.put(key, source.getFirst(name)); } } } return target; }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Vcs)) { return false; } Vcs that = (Vcs) o; if (!Objects.equals(revision, that.revision)) { return false; } return Objects.equals(url, that.url); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Vcs)) { return false; } Vcs that = (Vcs) o; return Objects.equals(revision, that.revision) && Objects.equals(url, that.url); }
Source:
public static BlueprintClusterBinding fromHostGroupHostMap(Map<String, Set<String>> hostGroupHosts) { Set<BindingHostGroup> hostGroups = hostGroupHosts.entrySet().stream() .map(entry -> { BindingHostGroup hostGroup = new BindingHostGroup(); hostGroup.setName(entry.getKey()); Set<Map<String, String>> hosts = entry.getValue().stream().map(hostName -> ImmutableMap.of("fqdn", hostName)).collect(toSet()); hostGroup.setHosts(hosts); return hostGroup; }) .collect(toSet()); BlueprintClusterBinding binding = new BlueprintClusterBinding(); binding.setHostGroups(hostGroups); return binding; }

Target:
public static BlueprintClusterBinding fromHostGroupHostMap(Map<String, Set<String>> hostGroupHosts) { Set<BindingHostGroup> hostGroups = hostGroupHosts.entrySet().stream() .map(entry -> BindingHostGroup.create(entry.getKey(), entry.getValue())) .collect(toSet()); BlueprintClusterBinding binding = new BlueprintClusterBinding(); binding.setHostGroups(hostGroups); return binding; }
Source:
public boolean equals(Object obj) { if(!(obj instanceof NfsProfileDetails)) { return false; } NfsProfileDetails nfsDetails = (NfsProfileDetails) obj; if(!ObjectUtils.objectsEqual(getNfsServerIp(), nfsDetails.getNfsServerIp())) { return false; } return true; }

Target:
public boolean equals(Object obj) { if(!(obj instanceof NfsProfileDetails)) { return false; } NfsProfileDetails nfsDetails = (NfsProfileDetails) obj; if(!ObjectUtils.objectsEqual(getNfsServerIp(), nfsDetails.getNfsServerIp())) { return false; } if(!ObjectUtils.objectsEqual(getStatsInfo(), nfsDetails.getStatsInfo())) { return false; } return true; }
Source:
public String getDefaultQuotaName(storage_pool storagePool) { List<Quota> quotaList = getQuotaDAO().getQuotaByStoragePoolGuid(storagePool.getId()); String quotaDefaultName = "Quota_Def_" + storagePool.getname(); String regexToolPattern = quotaDefaultName + "_[0-9]{1,}$"; Integer suffixQuotaName = 0; for (Quota quota : quotaList) { String quotaName = quota.getQuotaName(); if (quotaName.contains(quotaDefaultName) && (quotaName.length() == quotaDefaultName.length() && suffixQuotaName == 0)) { suffixQuotaName = 1; } else if (quotaName.matches(regexToolPattern)) { String defaultQuotaString = quotaName.substring(quotaName.lastIndexOf("_") + 1); Integer defaultQuotaNumber = new Integer(defaultQuotaString); if (suffixQuotaName < defaultQuotaNumber.intValue()) { suffixQuotaName = defaultQuotaNumber.intValue() + 1; } } } return (suffixQuotaName > 0) ? String.format("%1$s_%2$s", quotaDefaultName, suffixQuotaName.toString()) : quotaDefaultName; }

Target:
public String getDefaultQuotaName(storage_pool storagePool) { List<Quota> quotaList = getQuotaDAO().getQuotaByStoragePoolGuid(storagePool.getId()); String quotaDefaultName = "Quota_Def_" + storagePool.getname(); String regexToolPattern = quotaDefaultName + "_[0-9]{1,}$"; int suffixQuotaName = 0; for (Quota quota : quotaList) { String quotaName = quota.getQuotaName(); if (quotaName.contains(quotaDefaultName) && (quotaName.length() == quotaDefaultName.length() && suffixQuotaName == 0)) { suffixQuotaName = 1; } else if (quotaName.matches(regexToolPattern)) { String defaultQuotaString = quotaName.substring(quotaName.lastIndexOf("_") + 1); Integer defaultQuotaNumber = new Integer(defaultQuotaString); if (suffixQuotaName <= defaultQuotaNumber.intValue()) { suffixQuotaName = defaultQuotaNumber.intValue() + 1; } } } return (suffixQuotaName > 0) ? String.format("%1$s_%2$s", quotaDefaultName, suffixQuotaName) : quotaDefaultName; }
Source:
public Void visit(Boolean inTailPosition, New newExpr) { for (Declaration decl : newExpr.getDecls()) { decl.acceptVisitor(this, inTailPosition); } return null; }

Target:
public Void visit(Boolean inTailPosition, New newExpr) { for (Declaration decl : newExpr.getDecls()) { decl.acceptVisitor(this, false); } return null; }
Source:
private String createPluginDirectory(GenEditorGenerator editorGen, String suffix) { StringBuilder pluginDirectory = new StringBuilder(editorGen.getPluginDirectory()); if (pluginDirectory.charAt(0) == '/') { pluginDirectory.delete(0, 1); } String[] pluginDirectoryParts = pluginDirectory.toString().split("/"); StringBuilder result = new StringBuilder("/").append(pluginDirectoryParts[0]); result.append(".").append(suffix).append("/"); for (int i = 1; i < pluginDirectoryParts.length; i++) { result.append(pluginDirectoryParts[i]).append("/"); } return result.toString(); }

Target:
private String createPluginDirectory(GenEditorGenerator editorGen, String suffix) { String pluginDirectory = editorGen.getPluginDirectory(); if (pluginDirectory.startsWith("/")) { pluginDirectory = pluginDirectory.substring(1); } String[] pluginDirectoryParts = pluginDirectory.split("/"); StringBuilder result = new StringBuilder("/").append(pluginDirectoryParts[0]); result.append(".").append(suffix).append("/"); for (int i = 1; i < pluginDirectoryParts.length; i++) { result.append(pluginDirectoryParts[i]).append("/"); } return result.toString(); }
Source:
public Map<String, Ref> getRefs(String prefix) throws IOException { if (!prefix.isEmpty() && prefix.charAt(prefix.length() - 1) != '/') { return new HashMap<>(0); } Ref src = bootstrap.exactRef(txnCommitted); Scanner.Result c = refs; if (c == null || !c.refTreeId.equals(idOf(src))) { c = Scanner.scanRefTree(repo, src, prefix, true); if (prefix.isEmpty()) { refs = c; } } RefList<Ref> empty = RefList.emptyList(); return new RefMap(prefix, empty, c.all, c.sym); }

Target:
public Map<String, Ref> getRefs(String prefix) throws IOException { if (!prefix.isEmpty() && prefix.charAt(prefix.length() - 1) != '/') { return new HashMap<>(0); } Ref src = bootstrap.exactRef(txnCommitted); Scanner.Result c = refs; if (c == null || !c.refTreeId.equals(idOf(src))) { c = Scanner.scanRefTree(repo, src, prefix, true); if (prefix.isEmpty()) { refs = c; } } return new RefMap(prefix, RefList.<Ref> emptyList(), c.all, c.sym); }
Source:
public HttpServletRequest getRequest() { return request; }

Target:
private HttpServletRequest getRequest() { return this.request; }
Source:
private String getWlpOutputDir() throws IOException { Properties envvars = new Properties(); File serverEnvFile = new File(installDirectory, "etc/server.env"); if (serverEnvFile.exists()) { envvars.load(new FileInputStream(serverEnvFile)); } if (serverEnv.exists()) { envvars.load(new FileInputStream(serverEnv)); } serverEnvFile = new File(configDirectory, "server.env"); if (configDirectory != null && serverEnvFile.exists()) { envvars.load(new FileInputStream(serverEnvFile)); } return (String) envvars.get("WLP_OUTPUT_DIR"); }

Target:
private String getWlpOutputDir() throws IOException { Properties envvars = new Properties(); File serverEnvFile = new File(installDirectory, "etc/server.env"); if (serverEnvFile.exists()) { envvars.load(new FileInputStream(serverEnvFile)); } serverEnvFile = new File(configDirectory, "server.env"); if (configDirectory != null && serverEnvFile.exists()) { envvars.load(new FileInputStream(serverEnvFile)); } else if (serverEnv.exists()) { envvars.load(new FileInputStream(serverEnv)); } return (String) envvars.get("WLP_OUTPUT_DIR"); }
Source:
public void showAppCrashDialog(String error) { AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder( this); alertDialogBuilder.setTitle(R.string.crash_dialog_title); alertDialogBuilder .setMessage(R.string.crash_dialog_message) .setCancelable(false) .setPositiveButton(R.string.crash_dialog_positive_button, (dialog, id) -> dialog.cancel()) .setNegativeButton(R.string.crash_dialog_negative_button, (dialog, id) -> finishAffinity()) .setNeutralButton(R.string.crash_dialog_neutral_button, (dialog, id) -> { String filename = OpenMRS.getInstance().getOpenMRSDir() + File.separator + mOpenMRSLogger.getLogFilename(); Intent email = new Intent(Intent.ACTION_SEND); email.putExtra(Intent.EXTRA_SUBJECT, R.string.error_email_subject_app_crashed); email.putExtra(Intent.EXTRA_TEXT, error); email.putExtra(Intent.EXTRA_STREAM, Uri.parse(getString(R.string.file_uri_prefix) + filename)); email.setType(getString(R.string.MIME_type_encapsulated_message)); startActivity(Intent.createChooser(email, getString(R.string.choose_a_email_client))); }); alertDialog = alertDialogBuilder.create(); alertDialog.show(); }

Target:
public void showAppCrashDialog(String error) { AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder( this); alertDialogBuilder.setTitle(R.string.crash_dialog_title); alertDialogBuilder .setMessage(R.string.crash_dialog_message) .setCancelable(false) .setPositiveButton(R.string.crash_dialog_positive_button, (dialog, id) -> dialog.cancel()) .setNegativeButton(R.string.crash_dialog_negative_button, (dialog, id) -> finishAffinity()) .setNeutralButton(R.string.crash_dialog_neutral_button, (dialog, id) -> { String filename = OpenMRS.getInstance().getOpenMRSDir() + File.separator + mOpenMRSLogger.getLogFilename(); Intent email = new Intent(Intent.ACTION_SEND); email.putExtra(Intent.EXTRA_SUBJECT, R.string.error_email_subject_app_crashed); email.putExtra(Intent.EXTRA_TEXT, error); email.putExtra(Intent.EXTRA_STREAM, Uri.parse(ApplicationConstants.URI_FILE + filename)); email.setType(ApplicationConstants.MESSAGE_RFC_822); startActivity(Intent.createChooser(email, getString(R.string.choose_a_email_client))); }); alertDialog = alertDialogBuilder.create(); alertDialog.show(); }
Source:
public void register(TypeCodec<?> newCodec) { for (TypeCodec<?> primitiveCodec : primitiveCodecs) { if (primitiveCodec.accepts(newCodec.getCqlType()) && primitiveCodec.accepts(newCodec.getJavaType())) { LOG.warn( "[{}] Ignoring codec because it collides with built-in primitive codec {}", logPrefix, newCodec, primitiveCodec); return; } } for (TypeCodec<?> userCodec : userCodecs) { if (userCodec.accepts(newCodec.getCqlType()) && userCodec.accepts(newCodec.getJavaType())) { LOG.warn( "[{}] Ignoring codec because it collides with previously registered codec {}", logPrefix, newCodec, userCodec); return; } } try { TypeCodec<?> cachedCodec = getCachedCodec(newCodec.getCqlType(), newCodec.getJavaType(), false); LOG.warn( "[{}] Ignoring codec because it collides with previously generated codec {}", logPrefix, newCodec, cachedCodec); return; } catch (CodecNotFoundException ignored) { } userCodecs.add(newCodec); }

Target:
public void register(TypeCodec<?> newCodec) { registerLock.lock(); try { for (TypeCodec<?> primitiveCodec : primitiveCodecs) { if (collides(newCodec, primitiveCodec)) { LOG.warn( "[{}] Ignoring codec because it collides with built-in primitive codec {}", logPrefix, newCodec, primitiveCodec); return; } } for (TypeCodec<?> userCodec : userCodecs) { if (collides(newCodec, userCodec)) { LOG.warn( "[{}] Ignoring codec because it collides with previously registered codec {}", logPrefix, newCodec, userCodec); return; } } try { TypeCodec<?> cachedCodec = getCachedCodec(newCodec.getCqlType(), newCodec.getJavaType(), false); LOG.warn( "[{}] Ignoring codec because it collides with previously generated codec {}", logPrefix, newCodec, cachedCodec); return; } catch (CodecNotFoundException ignored) { } userCodecs.add(newCodec); } finally { registerLock.unlock(); } }
Source:
public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { boolean classHasLombok = hasLombokAnnotation(node); Map<VariableNameDeclaration, List<NameOccurrence>> vars = node.getScope() .getDeclarations(VariableNameDeclaration.class); for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : vars.entrySet()) { VariableNameDeclaration decl = entry.getKey(); AccessNode accessNodeParent = decl.getAccessNodeParent(); if (!accessNodeParent.isPrivate() || isOK(decl.getImage()) || classHasLombok || ((Annotateable) accessNodeParent).isAnyAnnotationPresent(getProperty(ignoredAnnotationsDescriptor))) { continue; } if (!actuallyUsed(entry.getValue())) { if (!usedInOuterClass(node, decl) && !usedInOuterEnum(node, decl)) { addViolation(data, decl.getNode(), decl.getImage()); } } } return super.visit(node, data); }

Target:
public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { boolean classHasLombok = hasLombokAnnotation(node); Map<VariableNameDeclaration, List<NameOccurrence>> vars = node.getScope() .getDeclarations(VariableNameDeclaration.class); for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : vars.entrySet()) { VariableNameDeclaration decl = entry.getKey(); AccessNode accessNodeParent = decl.getAccessNodeParent(); if (!accessNodeParent.isPrivate() || isOK(decl.getImage()) || classHasLombok || hasIgnoredAnnotation((Annotatable) accessNodeParent)) { continue; } if (!actuallyUsed(entry.getValue())) { if (!usedInOuterClass(node, decl) && !usedInOuterEnum(node, decl)) { addViolation(data, decl.getNode(), decl.getImage()); } } } return super.visit(node, data); }
Source:
public Navigate toPage(String pageName) { String host = UrlBuilder.getHostForWiki(); String cacheBuster = pageName.equals("") || pageName.equals("/") ? "" : "?cb=" + DateTime.now().getMillis(); driver.get("http://" + host + pageName + cacheBuster + "&" + defaultTestingGroup); return this; }

Target:
public Navigate toPage(String pageName) { String host = UrlBuilder.getHostForWiki(); String cacheBuster = pageName.equals("") || pageName.equals("/") ? "" : "?cb=" + DateTime.now().getMillis(); driver.get("http://" + host + pageName + cacheBuster + "?" + defaultTestingGroup); return this; }