auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void replay() { long lastBlock = blockStore.getMaxNumber(); logger.info("Replaying blocks from " + firstBlock + ", current best block: " + lastBlock); int cnt = 0; long num = firstBlock; <START> while(true) { <END> for (; num <= lastBlock; num++) { replayBlock(num); cnt++; if (cnt % 1000 == 0) { logger.info("Replayed " + cnt + " blocks so far. Current block: " + num); } } synchronized (this) { if (onBlockBuffer.size() < onBlockBuffer.maxSize()) { replayComplete = true; break; } else { long newLastBlock = blockStore.getMaxNumber() - 192; if (lastBlock >= newLastBlock) { replayComplete = true; break; } else { lastBlock = newLastBlock; } } } } logger.info("Replay complete."); }</code><technical_language>while (!replayComplete) is if break logic (as I not)</technical_language>

Target:
public void replay() { long lastBlock = blockStore.getMaxNumber(); logger.info("Replaying blocks from " + firstBlock + ", current best block: " + lastBlock); int cnt = 0; long num = firstBlock; while(!replayComplete) { for (; num <= lastBlock; num++) { replayBlock(num); cnt++; if (cnt % 1000 == 0) { logger.info("Replayed " + cnt + " blocks so far. Current block: " + num); } } synchronized (this) { if (onBlockBuffer.size() < onBlockBuffer.maxSize()) { replayComplete = true; } else { long newLastBlock = blockStore.getMaxNumber() - HALF_BUFFER; if (lastBlock >= newLastBlock) { replayComplete = true; } else { lastBlock = newLastBlock; } } } } logger.info("Replay complete."); }
Source:
<code>protected abstract C retrieveCredentials(final WebContext context) throws RequiresHttpAction; public final U getUserProfile(final C credentials, final WebContext context) { init(); logger.debug("credentials : {}", credentials); if (credentials == null) { return null; <START> } <END> final U profile = retrieveUserProfile(credentials, context); for (AuthorizationGenerator<U> authorizationGenerator : this.authorizationGenerators) { authorizationGenerator.generate(profile); } return profile; }</code><technical_language>I condition != null list set null..</technical_language>

Target:
protected abstract C retrieveCredentials(final WebContext context) throws RequiresHttpAction; public final U getUserProfile(final C credentials, final WebContext context) { init(); logger.debug("credentials : {}", credentials); if (credentials == null) { return null; } final U profile = retrieveUserProfile(credentials, context); if (this.authorizationGenerators != null) { for (AuthorizationGenerator<U> authorizationGenerator : this.authorizationGenerators) { authorizationGenerator.generate(profile); } } return profile; }
Source:
<code>boolean verifyEliminateNots() { <START> return !SanityManager.ASSERT || (leftOperand.verifyEliminateNots() && rightOperand.verifyEliminateNots()); <END> }</code><technical_language>I this pattern was, easier part of assertion not. If other cases please revert too</technical_language>

Target:
boolean verifyEliminateNots() { if (SanityManager.ASSERT) { return (leftOperand.verifyEliminateNots() && rightOperand.verifyEliminateNots()); } else {return true;} }
Source:
<code>private static Optional<LiteralTree[]> getLiteralsFromFinalVariables(IdentifierTree identifier) { Symbol symbol = identifier.symbol(); if (!symbol.isVariableSymbol()) { return Optional.empty(); } Symbol.VariableSymbol variableSymbol = (Symbol.VariableSymbol) symbol; <START> if (!variableSymbol.isFinal()) { <END> return Optional.empty(); } VariableTree declaration = variableSymbol.declaration(); if (declaration == null) { return Optional.empty(); } ExpressionTree initializer = declaration.initializer(); if (initializer == null) { return Optional.empty(); } return getLiterals(initializer); }</code><technical_language>Is a check a variable is *effectively* final? this work locals locals rarely explicitly defined final</technical_language>

Target:
private static Optional<LiteralTree[]> getLiteralsFromFinalVariables(IdentifierTree identifier) { Symbol symbol = identifier.symbol(); if (!symbol.isVariableSymbol()) { return Optional.empty(); } Symbol.VariableSymbol variableSymbol = (Symbol.VariableSymbol) symbol; if (!(variableSymbol.isFinal() || JUtils.isEffectivelyFinal(variableSymbol))) { return Optional.empty(); } VariableTree declaration = variableSymbol.declaration(); if (declaration == null) { return Optional.empty(); } ExpressionTree initializer = declaration.initializer(); if (initializer == null) { return Optional.empty(); } return getLiterals(initializer); }
Source:
<code>void setFullscreenDialog(){ try{ WindowManager manager = (WindowManager) getContext().getSystemService(Activity.WINDOW_SERVICE); int width, height; <START> if (Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO) { <END> width = manager.getDefaultDisplay().getWidth(); height = manager.getDefaultDisplay().getHeight(); } else { Point point = new Point(); manager.getDefaultDisplay().getSize(point); width = point.x; height = point.y; } WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); lp.copyFrom(getWindow().getAttributes()); lp.width = width; lp.height = height; getWindow().setAttributes(lp); }catch (NullPointerException ex){ ex.printStackTrace(); } }</code><technical_language>is this check</technical_language>

Target:
void setFullscreenDialog(){ try{ WindowManager manager = (WindowManager) getContext().getSystemService(Activity.WINDOW_SERVICE); Point point = new Point(); manager.getDefaultDisplay().getSize(point); WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); lp.copyFrom(getWindow().getAttributes()); lp.width = point.x; lp.height = point.y; getWindow().setAttributes(lp); }catch (NullPointerException ex){ Log.e(TAG, ex.getMessage()); } }
Source:
<code><START> public void testConstraintSolverForceBacktrackWithSpreadCoLocation() { <END> ConstraintSolverStrategy cs = new ConstraintSolverStrategy() { @Override public <K extends Comparable<K>, V extends Comparable<V>> NavigableMap<K, V> sortByValues(final Map<K, V> map) { return super.sortByValues(map).descendingMap(); } }; basicUnitTestWithKillAndRecover(cs, BACKTRACK_BOLT_PARALLEL, CO_LOCATION_CNT); }</code><technical_language>this testConstraintSolverForceBacktrack</technical_language>

Target:
public void testConstraintSolverForceBacktrackWithSpreadCoLocation() { if (CO_LOCATION_CNT > 1 && !consolidatedConfigFlag) { LOG.info("INFO: Skipping Test with {}={} (required 1), and consolidatedConfigFlag={} (required false)", "testConstraintSolverForceBacktrackWithSpreadCoLocation", ConstraintSolverStrategy.CONSTRAINT_TYPE_MAX_NODE_CO_LOCATION_CNT, CO_LOCATION_CNT, consolidatedConfigFlag); return; } ConstraintSolverStrategy cs = new ConstraintSolverStrategy() { @Override public <K extends Comparable<K>, V extends Comparable<V>> NavigableMap<K, V> sortByValues(final Map<K, V> map) { return super.sortByValues(map).descendingMap(); } }; basicUnitTestWithKillAndRecover(cs, BACKTRACK_BOLT_PARALLEL, CO_LOCATION_CNT); }
Source:
<code>public static String getLanguageNameFromCode(@NonNull String languageCode) throws InvalidLocaleException { final String lowercaseLanguage = languageCode.toLowerCase(Locale.ROOT); switch (lowercaseLanguage) { case "zh_cn": case "zh_hans": <START> return "Simplified Chinese"; <END> case "zh_tw": case "zh_hant": return "Traditional Chinese"; default: if (!isValidBcp47Alpha(lowercaseLanguage, 2, 3)) { throw new InvalidLocaleException("Invalid language: " + languageCode); } return new Locale(languageCode).getDisplayLanguage(); } }</code><technical_language>Locale class "zh_hans", I guess this check is correct</technical_language>

Target:
public static String getLanguageNameFromCode(@NonNull String languageCode) throws InvalidLocaleException { final String lowercaseLanguage = languageCode.toLowerCase(Locale.ROOT); switch (lowercaseLanguage) { case "zh_cn": case "zh_hans": return Locale.SIMPLIFIED_CHINESE.getDisplayLanguage(); case "zh_tw": case "zh_hant": return Locale.TRADITIONAL_CHINESE.getDisplayLanguage(); default: if (!isValidBcp47Alpha(lowercaseLanguage, 2, 3)) { throw new InvalidLocaleException("Invalid language: " + languageCode); } return new Locale(languageCode).getDisplayLanguage(); } }
Source:
<code>public void waitForWritesCompleted(Duration timeout) throws InterruptedException, TimeoutException { <START> lock.writeLock().lockInterruptibly(); <END> lock.writeLock().unlock(); for (StoreObjectAccessorWithLock writer : writers.values()) writer.waitForCurrentWrites(timeout); }</code><technical_language>timeout is</technical_language>

Target:
public void waitForWritesCompleted(Duration timeout) throws InterruptedException, TimeoutException { boolean locked = lock.readLock().tryLock(timeout.toMillisecondsRoundingUp(), TimeUnit.MILLISECONDS); if (locked) { lock.readLock().unlock(); for (StoreObjectAccessorWithLock writer : writers.values()) writer.waitForCurrentWrites(timeout); } else { throw new TimeoutException("Timeout waiting for writes to "+objectStore); } }
Source:
<code>public StarTreeFilterOperator(StarTreeV2 starTreeV2, Map<String, List<PredicateEvaluator>> predicateEvaluatorsMap, Set<String> groupByColumns, @Nullable Map<String, String> debugOptions) { _starTreeV2 = starTreeV2; _predicateEvaluatorsMap = predicateEvaluatorsMap; <START> _groupByColumns = groupByColumns; <END> _debugOptions = debugOptions; _groupByColumns.removeAll(_predicateEvaluatorsMap.keySet()); }</code><technical_language>do need a copy of groupByColumns</technical_language>

Target:
public StarTreeFilterOperator(StarTreeV2 starTreeV2, Map<String, List<PredicateEvaluator>> predicateEvaluatorsMap, Set<String> groupByColumns, @Nullable Map<String, String> debugOptions) { _starTreeV2 = starTreeV2; _predicateEvaluatorsMap = predicateEvaluatorsMap; _debugOptions = debugOptions; if (groupByColumns != null) { _groupByColumns = new HashSet<>(groupByColumns); _groupByColumns.removeAll(_predicateEvaluatorsMap.keySet()); } else { _groupByColumns = Collections.emptySet(); } }
Source:
<code>public void serialize( final Event event, final JsonGenerator jsonGenerator, final SerializerProvider provider) throws IOException { jsonGenerator.writeStartObject(); <START> jsonGenerator.writeStringField("version", "2f"); <END> jsonGenerator.writeObjectField("annotations", event.getAnnotations()); if (!event.getCounterSamples().isEmpty()) { jsonGenerator.writeObjectFieldStart("counters"); serializeSamples(event.getCounterSamples(), jsonGenerator); jsonGenerator.writeEndObject(); } if (!event.getGaugeSamples().isEmpty()) { jsonGenerator.writeObjectFieldStart("gauges"); serializeSamples(event.getGaugeSamples(), jsonGenerator); jsonGenerator.writeEndObject(); } if (!event.getTimerSamples().isEmpty()) { jsonGenerator.writeObjectFieldStart("timers"); serializeSamples(event.getTimerSamples(), jsonGenerator); jsonGenerator.writeEndObject(); } jsonGenerator.writeEndObject(); }</code><technical_language>move "2f" a constant</technical_language>

Target:
public void serialize( final Event event, final JsonGenerator jsonGenerator, final SerializerProvider provider) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeStringField("version", VERSION); jsonGenerator.writeObjectField("annotations", event.getAnnotations()); if (!event.getCounterSamples().isEmpty()) { jsonGenerator.writeObjectFieldStart("counters"); serializeSamples(event.getCounterSamples(), jsonGenerator); jsonGenerator.writeEndObject(); } if (!event.getGaugeSamples().isEmpty()) { jsonGenerator.writeObjectFieldStart("gauges"); serializeSamples(event.getGaugeSamples(), jsonGenerator); jsonGenerator.writeEndObject(); } if (!event.getTimerSamples().isEmpty()) { jsonGenerator.writeObjectFieldStart("timers"); serializeSamples(event.getTimerSamples(), jsonGenerator); jsonGenerator.writeEndObject(); } jsonGenerator.writeEndObject(); }
Source:
<code>private static void xcopy(ArrayList<File> copiedFiles, File source, File target, boolean overwrite, IBackupStore backupStore) throws IOException { if (!source.exists()) throw new IOException("Source: " + source + "does not exists"); if (source.isDirectory()) { if (target.exists() && target.isFile()) { if (!overwrite) throw new IOException("Target: " + target + " already exists"); if (backupStore != null) backupStore.backup(target); else target.delete(); } if (!target.exists()) target.mkdirs(); copiedFiles.add(target); File[] children = source.listFiles(); if (children == null) throw new IOException("Error while retrieving children of directory: " + source); for (File <START> children1 : <END> children) { xcopy(copiedFiles, children1, new File(target, children1.getName()), overwrite, backupStore); } return; } if (target.exists() && !overwrite) throw new IOException("Target: " + target + " already exists"); if (!target.getParentFile().exists() && !target.getParentFile().mkdirs()) throw new IOException("Target: Path " + target.getParent() + " could not be created"); try { Util.copyStream(new FileInputStream(source), true, new FileOutputStream(target), true); } catch (IOException e) { e.printStackTrace(); throw new IOException("Error while copying:" + source.getAbsolutePath()); } copiedFiles.add(target); }</code><technical_language>child</technical_language>

Target:
private static void xcopy(ArrayList<File> copiedFiles, File source, File target, boolean overwrite, IBackupStore backupStore) throws IOException { if (!source.exists()) throw new IOException("Source: " + source + "does not exists"); if (source.isDirectory()) { if (target.exists() && target.isFile()) { if (!overwrite) throw new IOException("Target: " + target + " already exists"); if (backupStore != null) backupStore.backup(target); else target.delete(); } if (!target.exists()) target.mkdirs(); copiedFiles.add(target); File[] children = source.listFiles(); if (children == null) throw new IOException("Error while retrieving children of directory: " + source); for (File child : children) { xcopy(copiedFiles, child, new File(target, child.getName()), overwrite, backupStore); } return; } if (target.exists() && !overwrite) throw new IOException("Target: " + target + " already exists"); if (!target.getParentFile().exists() && !target.getParentFile().mkdirs()) throw new IOException("Target: Path " + target.getParent() + " could not be created"); try { Util.copyStream(new FileInputStream(source), true, new FileOutputStream(target), true); } catch (IOException e) { e.printStackTrace(); throw new IOException("Error while copying:" + source.getAbsolutePath()); } copiedFiles.add(target); }
Source:
<code><START> public void testGetProducerTaskCountForIntermediateStreams() { <END> SystemStream input1 = new SystemStream("system1", "intput1"); SystemStream input2 = new SystemStream("system2", "intput2"); SystemStream input3 = new SystemStream("system2", "intput3"); SystemStream int1 = new SystemStream("system1", "int1"); SystemStream int2 = new SystemStream("system1", "int2"); String task0 = "Task 0"; String task1 = "Task 1"; String task2 = "Task 2"; Multimap<SystemStream, String> streamToConsumerTasks = HashMultimap.create(); streamToConsumerTasks.put(input1, task0); streamToConsumerTasks.put(input1, task1); streamToConsumerTasks.put(input2, task1); streamToConsumerTasks.put(input2, task2); streamToConsumerTasks.put(input3, task1); streamToConsumerTasks.put(int1, task0); streamToConsumerTasks.put(int1, task1); streamToConsumerTasks.put(int2, task0); Multimap<SystemStream, SystemStream> intermediateToInputStreams = HashMultimap.create(); intermediateToInputStreams.put(int1, input1); intermediateToInputStreams.put(int1, input2); intermediateToInputStreams.put(int1, input3); intermediateToInputStreams.put(int2, input2); intermediateToInputStreams.put(int2, input3); Map<SystemStream, Integer> counts = OperatorImplGraph.getProducerTaskCountForIntermediateStreams( streamToConsumerTasks, intermediateToInputStreams); assertTrue(counts.get(int1) == 3); assertTrue(counts.get(int2) == 2); }</code><technical_language>a similar asc ii graph for this test case well? Thanks a lot in advance</technical_language>

Target:
public void testGetProducerTaskCountForIntermediateStreams() { SystemStream input1 = new SystemStream("system1", "intput1"); SystemStream input2 = new SystemStream("system2", "intput2"); SystemStream input3 = new SystemStream("system2", "intput3"); SystemStream int1 = new SystemStream("system1", "int1"); SystemStream int2 = new SystemStream("system1", "int2"); String task0 = "Task 0"; String task1 = "Task 1"; String task2 = "Task 2"; Multimap<SystemStream, String> streamToConsumerTasks = HashMultimap.create(); streamToConsumerTasks.put(input1, task0); streamToConsumerTasks.put(input1, task1); streamToConsumerTasks.put(input2, task1); streamToConsumerTasks.put(input2, task2); streamToConsumerTasks.put(input3, task1); streamToConsumerTasks.put(int1, task0); streamToConsumerTasks.put(int1, task1); streamToConsumerTasks.put(int2, task0); Multimap<SystemStream, SystemStream> intermediateToInputStreams = HashMultimap.create(); intermediateToInputStreams.put(int1, input1); intermediateToInputStreams.put(int1, input2); intermediateToInputStreams.put(int2, input2); intermediateToInputStreams.put(int2, input3); Map<SystemStream, Integer> counts = OperatorImplGraph.getProducerTaskCountForIntermediateStreams( streamToConsumerTasks, intermediateToInputStreams); assertTrue(counts.get(int1) == 3); assertTrue(counts.get(int2) == 2); }
Source:
<code>public Properties getConsumerProperties(String inputChannelName) { if (isPartitionedConsumer(inputChannelName)) { Properties channelConsumerProperties = new Properties(); <START> if (consumerProperties != null) { <END> channelConsumerProperties.putAll(consumerProperties); } channelConsumerProperties.setProperty(BinderProperties.COUNT, Integer.toString(getInstanceCount())); channelConsumerProperties.setProperty(BinderProperties.PARTITION_INDEX, Integer.toString(getInstanceIndex())); return channelConsumerProperties; } else { return getConsumerProperties(); } }</code><technical_language>consumerProperties is non-null in this class, do !consumerProperties.isEmpty() here</technical_language>

Target:
public Properties getConsumerProperties(String inputChannelName) { if (isPartitionedConsumer(inputChannelName)) { Properties channelConsumerProperties = new Properties(); channelConsumerProperties.putAll(consumerProperties); channelConsumerProperties.setProperty(BinderProperties.COUNT, Integer.toString(getInstanceCount())); channelConsumerProperties.setProperty(BinderProperties.PARTITION_INDEX, Integer.toString(getInstanceIndex())); return channelConsumerProperties; } else { return getConsumerProperties(); } }
Source:
<code>protected void assertQueryEquals(String graphQLRequest, String expectedResponse, Map<String, Object> variables) throws Exception { boolean isMutation = graphQLRequest.startsWith("mutation"); ExecutionResult result = api.execute(graphQLRequest, requestScope, variables); if (isMutation) { requestScope.saveOrCreateObjects(); } requestScope.getTransaction().commit(requestScope); <START> assertEquals(result.getErrors().size(), 0, "Errors [" + errorsToString(result.getErrors()) + "]:"); <END> try { LOG.info(mapper.writeValueAsString(result.getData())); assertEquals(mapper.readTree(mapper.writeValueAsString(result.getData())), mapper.readTree(expectedResponse)); } catch (JsonProcessingException e) { fail("JSON parsing exception", e); } }</code><technical_language>switch assert testNG Jupiter, need "expected" "actual" variables swapped. error messages wrong tests fail</technical_language>

Target:
protected void assertQueryEquals(String graphQLRequest, String expectedResponse, Map<String, Object> variables) throws Exception { boolean isMutation = graphQLRequest.startsWith("mutation"); ExecutionResult result = api.execute(graphQLRequest, requestScope, variables); if (isMutation) { requestScope.saveOrCreateObjects(); } requestScope.getTransaction().commit(requestScope); assertEquals(0, result.getErrors().size(), "Errors [" + errorsToString(result.getErrors()) + "]:"); try { LOG.info(mapper.writeValueAsString(result.getData())); assertEquals( mapper.readTree(expectedResponse), mapper.readTree(mapper.writeValueAsString(result.getData())) ); } catch (JsonProcessingException e) { fail("JSON parsing exception", e); } }
Source:
<code>protected void mergePatches(List<SchemaPatch> patches) { <START> final List<DatabaseObject> objects = new ArrayList<>(); <END> patches.stream().forEachOrdered(patch -> { validatePatch(patches, patch); objects.clear(); List<DatabaseObject> tempObjects = new ArrayList<>(); tempObjects.addAll(patch.getObjects()); patch.clearObjects(); patch.addObjects(mergeDatabaseObjects(tempObjects)); targetStore.addPatch(patch); }); }</code><technical_language>I understand this exists. Please check if removed</technical_language>

Target:
protected void mergePatches(List<SchemaPatch> patches) { patches.stream().forEachOrdered(patch -> { validatePatch(patches, patch); List<DatabaseObject> tempObjects = new ArrayList<>(); tempObjects.addAll(patch.getObjects()); patch.clearObjects(); patch.addObjects(mergeDatabaseObjects(tempObjects)); targetStore.addPatch(patch); }); }
Source:
<code>public void init() { try { passThrough = getInitParameter("passThrough", true); headers = getInitParameter("headers", true); body = getInitParameter("body", true); bodyMax = (getInitParameter("maxBody") == null) ? 0 : Integer.parseInt(getInitParameter("maxBody")); if(bodyMax < 0){ logger.error("Parsed a negative maxBody value and caused initialization failure"); throw new IllegalArgumentException("The value of maxBody cannot be negative."); } comment = getInitParameter("comment"); } catch (NumberFormatException e){ <START> logger.error("Caught exception while parsing maxBody value", e); <END> } catch (NullPointerException e) { logger.error("Caught exception because mailet configuration has not been set yet.", e); } }</code><technical_language>I argue want start invalid configuration. catching exceptions is needed</technical_language>

Target:
public void init() { try { logLevel = getInitParameter("level", LogLevel.class, LogLevel.INFO); specificHeaderNames = getInitParameter("specificHeaders", List.class, Collections.emptyList()); specificAttributeNames = getInitParameter("specificAttributes", List.class, Collections.emptyList()); headers = getInitParameter("headers", false); body = getInitParameter("body", false); passThrough = getInitParameter("passThrough", true); bodyMax = Optional.ofNullable(getInitParameter("maxBody", Integer.class)).orElse(0); comment = getInitParameter("comment"); } catch (ClassCastException e) { logger.error("Caught exception while parsing initial parameter values", e); } }
Source:
<code>public void updateSessionData( @PathParam("sessionId") int sessionId) { <START> SessionModel sessionModel = new SessionModel(); <END> long currentTime = System.currentTimeMillis(); Session session = GTFSDB.initSessionBeginTrans(); sessionModel = (SessionModel) session.createQuery(" FROM SessionModel WHERE sessionId = " + sessionId).uniqueResult(); sessionModel.setSessionEndTime(currentTime); List<String> errorAndWarningList = session.createQuery(QueryHelper.sessionErrorsAndWarnings) .setParameter("gtfsRtId", sessionModel.getGtfsRtFeedModel().getGtfsRtId()) .setParameter("startTime", sessionModel.getSessionStartTime()) .setParameter("endTime", currentTime) .list(); int warningCount = 0; int errorCount = 0; for (String errorOrWarning: errorAndWarningList) { if (errorOrWarning.startsWith("W")) { warningCount++; } else { errorCount++; } } sessionModel.setErrorCount(errorCount); sessionModel.setWarningCount(warningCount); session.saveOrUpdate(sessionModel); GTFSDB.commitAndCloseSession(session); }</code><technical_language>I need instantiate a new SessionModel - SessionModel sessionModel;, declare part of line 410 SessionModel sessionModel = (SessionModel) session....</technical_language>

Target:
public void updateSessionData( @PathParam("sessionId") int sessionId) { long currentTime = System.currentTimeMillis(); Session session = GTFSDB.initSessionBeginTrans(); SessionModel sessionModel = (SessionModel) session.createQuery(" FROM SessionModel WHERE sessionId = " + sessionId).uniqueResult(); sessionModel.setSessionEndTime(currentTime); List<String> errorAndWarningList = session.createQuery(QueryHelper.sessionErrorsAndWarnings) .setParameter("gtfsRtId", sessionModel.getGtfsRtFeedModel().getGtfsRtId()) .setParameter("startTime", sessionModel.getSessionStartTime()) .setParameter("endTime", currentTime) .list(); int warningCount = 0; int errorCount = 0; for (String errorOrWarning: errorAndWarningList) { if (errorOrWarning.startsWith("W")) { warningCount++; } else { errorCount++; } } sessionModel.setErrorCount(errorCount); sessionModel.setWarningCount(warningCount); session.saveOrUpdate(sessionModel); GTFSDB.commitAndCloseSession(session); }
Source:
<code>public String getLabel(Category category) { List<LeafNode> leafs = findLeafNodes(category); Collections.sort(leafs, new Comparator<LeafNode>() { public int compare(LeafNode o1, LeafNode o2) { <START> return o1.getName().compareTo(o2.getName()); <END> } }); List<String> labels = new ArrayList<String>(); for (LeafNode leaf : leafs) { labels.add(getLabel(leaf)); } Collections.sort(labels); if(labels.size() < 2) { return StringUtils.join(labels, ") OR ("); } else { return "(" + StringUtils.join(labels, ") OR (") + ")"; } }</code><technical_language>this work? name (i.e. category name)</technical_language>

Target:
public String getLabel(Category category) { List<LeafNode> leafs = findLeafNodes(category); List<String> labels = new ArrayList<String>(); for (LeafNode leaf : leafs) { labels.add(getLabel(leaf)); } Collections.sort(labels); if(labels.size() < 2) { return StringUtils.join(labels, ") OR ("); } else { return "(" + StringUtils.join(labels, ") OR (") + ")"; } }
Source:
<code>private void setItemSelected(int position, boolean isSelected) { PhotoPickerItem item = getItemAtPosition(position); if (item == null) { return; } if (isSelected) { if (!canMultiselect() && !mSelectedItems.isEmpty()) { ThumbnailViewHolder prevHolder = getViewHolderAtPosition(mSelectedItems.get(0)); if (prevHolder != null) { AniUtils.scale(prevHolder.mImgThumbnail, SCALE_SELECTED, SCALE_NORMAL, AniUtils.Duration.SHORT); } mSelectedItems.clear(); } mSelectedItems.add(position); } else { int selectedIndex = mSelectedItems.indexOf(position); if (selectedIndex > -1) { mSelectedItems.remove(selectedIndex); } } ThumbnailViewHolder holder = getViewHolderAtPosition(position); if (holder != null) { if (canMultiselect()) { if (isSelected) { int count = mSelectedItems.indexOf(position) + 1; holder.mTxtSelectionCount.setText(String.format(Locale.getDefault(), "%d", count)); <START> } else if (!isSelected) { <END> holder.mTxtSelectionCount.setText(null); } AniUtils.startAnimation(holder.mTxtSelectionCount, R.anim.pop); } else { if (isSelected) { AniUtils.scaleIn(holder.mTxtSelectionCount, AniUtils.Duration.MEDIUM); } else { AniUtils.scaleOut(holder.mTxtSelectionCount, AniUtils.Duration.MEDIUM); } } holder.mTxtSelectionCount.setSelected(isSelected); if (isSelected) { AniUtils.scale(holder.mImgThumbnail, SCALE_NORMAL, SCALE_SELECTED, AniUtils.Duration.SHORT); } else { AniUtils.scale(holder.mImgThumbnail, SCALE_SELECTED, SCALE_NORMAL, AniUtils.Duration.SHORT); } } if (mListener != null) { mListener.onSelectedCountChanged(getNumSelected()); } long delayMs = AniUtils.Duration.SHORT.toMillis(mContext); new Handler().postDelayed(new Runnable() { @Override public void run() { notifyDataSetChangedInternal(); } }, delayMs); }</code><technical_language>This conditional in else clause is needed in else case, right</technical_language>

Target:
private void setItemSelected(int position, boolean isSelected) { setItemSelected(position, isSelected, true); }
Source:
<code>public Optional<MethodSpec> generate() { ReturnType returnType = parseReturnType(methodElement.getReturnType()); if (!SUPPORTED_RETURN_TYPES.contains(returnType.kind)) { context .getMessager() .error( methodElement, "Invalid return type: %s methods must return void, boolean, Integer, Row, " <START> + "an entity class, a result set, a mapped iterable, or a " <END> + "CompletionStage/CompletableFuture of any of the above", QueryProvider.class.getSimpleName()); return Optional.empty(); } MethodSpec.Builder methodBuilder = GeneratedCodePatterns.override(methodElement); List<ClassName> entityHelperTypes = getEntityHelperTypes(); String providerName = enclosingClass.addQueryProvider(methodElement, getProviderClass(), entityHelperTypes); String providerMethod = methodElement.getAnnotation(QueryProvider.class).providerMethod(); if (providerMethod.isEmpty()) { providerMethod = methodElement.getSimpleName().toString(); } methodBuilder.addCode("$["); if (returnType.kind != VOID) { methodBuilder.addCode("return "); } methodBuilder.addCode("$L.$L(", providerName, providerMethod); boolean first = true; for (VariableElement parameter : methodElement.getParameters()) { if (first) { first = false; } else { methodBuilder.addCode(", "); } methodBuilder.addCode("$L", parameter.getSimpleName().toString()); } methodBuilder.addCode(");$]\n"); return Optional.of(methodBuilder.build()); }</code><technical_language>choosing INT? confuse users</technical_language>

Target:
public Optional<MethodSpec> generate() { MethodSpec.Builder methodBuilder = GeneratedCodePatterns.override(methodElement); List<ClassName> entityHelperTypes = getEntityHelperTypes(); String providerName = enclosingClass.addQueryProvider(methodElement, getProviderClass(), entityHelperTypes); String providerMethod = methodElement.getAnnotation(QueryProvider.class).providerMethod(); if (providerMethod.isEmpty()) { providerMethod = methodElement.getSimpleName().toString(); } methodBuilder.addCode("$["); if (methodElement.getReturnType().getKind() != TypeKind.VOID) { methodBuilder.addCode("return "); } methodBuilder.addCode("$L.$L(", providerName, providerMethod); boolean first = true; for (VariableElement parameter : methodElement.getParameters()) { if (first) { first = false; } else { methodBuilder.addCode(", "); } methodBuilder.addCode("$L", parameter.getSimpleName().toString()); } methodBuilder.addCode(");$]\n"); return Optional.of(methodBuilder.build()); }
Source:
<code>protected static void convertFromProperties(EclipsePreferences node, Properties table, boolean notify) { String version = table.getProperty(VERSION_KEY); if (version == null || !VERSION_VALUE.equals(version)) { } table.remove(VERSION_KEY); for (Object <START> name2 : <END> table.keySet()) { String fullKey = (String) name2; String value = table.getProperty(fullKey); if (value != null) { String[] splitPath = decodePath(fullKey); String path = splitPath[0]; path = makeRelative(path); String key = splitPath[1]; if (DEBUG_PREFERENCE_SET) PrefsMessages.message("Setting preference: " + path + '/' + key + '=' + value); EclipsePreferences childNode = (EclipsePreferences) node.internalNode(path, false, null); String oldValue = childNode.internalPut(key, value); if (notify && !value.equals(oldValue)) childNode.firePreferenceEvent(key, oldValue, value); } } PreferencesService.getDefault().shareStrings(); }</code><technical_language>rename propName switch 'fullKey', i.e. rename fullKey->propName this key</technical_language>

Target:
protected static void convertFromProperties(EclipsePreferences node, Properties table, boolean notify) { String version = table.getProperty(VERSION_KEY); if (version == null || !VERSION_VALUE.equals(version)) { } table.remove(VERSION_KEY); for (Object propName : table.keySet()) { String fullKey = (String) propName; String value = table.getProperty(fullKey); if (value != null) { String[] splitPath = decodePath(fullKey); String path = splitPath[0]; path = makeRelative(path); String key = splitPath[1]; if (DEBUG_PREFERENCE_SET) PrefsMessages.message("Setting preference: " + path + '/' + key + '=' + value); EclipsePreferences childNode = (EclipsePreferences) node.internalNode(path, false, null); String oldValue = childNode.internalPut(key, value); if (notify && !value.equals(oldValue)) childNode.firePreferenceEvent(key, oldValue, value); } } PreferencesService.getDefault().shareStrings(); }
Source:
<code>public void setUp() throws Exception { setBrickPosition = 1; changeBrickPosition = 2; <START> Script project = BrickTestUtils.createProjectAndGetStartScript("variableBricksTest"); <END> project.addBrick(new SetVariableBrick()); project.addBrick(new ChangeVariableBrick()); baseActivityTestRule.launchActivity(null); }</code><technical_language>please rename script</technical_language>

Target:
public void setUp() throws Exception { setBrickPosition = 1; changeBrickPosition = 2; Script script = BrickTestUtils.createProjectAndGetStartScript("variableBricksTest"); script.addBrick(new SetVariableBrick()); script.addBrick(new ChangeVariableBrick()); baseActivityTestRule.launchActivity(null); }
Source:
<code>public static boolean isOptional(@NotNull ErlangCallbackSpec spec) { ErlangCallbackSpecStub stub = spec.getStub(); if (stub != null) return stub.isOptional(); boolean isOptional = false; ErlangFile file = ObjectUtils.tryCast(spec.getContainingFile(), ErlangFile.class); String specName = getCallbackSpecName(spec); int specArity = getCallBackSpecArguments(spec).size(); assert file != null && specName != null; for (ErlangCallbackFunction callback : file.getOptionalCallbacks()) { ErlangAtom functionNameAtom = callback.getQAtom().getAtom(); String functionName = functionNameAtom != null ? getName(functionNameAtom) : null; if (specName.equals(functionName) && specArity == getArity(callback.getInteger())) { isOptional = true; break; } } <START> return isOptional; <END> }</code><technical_language>is reason this isOptional variable - complicates reading</technical_language>

Target:
public static boolean isOptional(@NotNull ErlangCallbackSpec spec) { ErlangCallbackSpecStub stub = spec.getStub(); if (stub != null) return stub.isOptional(); ErlangFile file = ObjectUtils.tryCast(spec.getContainingFile(), ErlangFile.class); String specName = getCallbackSpecName(spec); int specArity = getCallBackSpecArguments(spec).size(); assert file != null && specName != null; for (ErlangCallbackFunction callback : file.getOptionalCallbacks()) { ErlangAtom functionNameAtom = callback.getQAtom().getAtom(); String functionName = functionNameAtom != null ? getName(functionNameAtom) : null; if (specName.equals(functionName) && specArity == getArity(callback.getInteger())) { return true; } } return false; }
Source:
<code>private List<Flight> searchByPrice(SearchParams searchParams){ searchFlights.clear(); try { allFlights = dao.getAllFlights(); } catch (SQLException e) { e.printStackTrace(); } for(int i=0; i < allFlights.size(); i++ ) { if(allFlights.get(i).getPrice() <= searchParams.getPrice()) { searchFlights.add(allFlights.get(i)); } } Collections.sort(searchFlights, new Comparator<Flight>() { public int compare(Flight p1, Flight p2) { return Float.compare(p1.getPrice(), p2.getPrice()); } }); return searchFlights; <START> } <END></code><technical_language>worry it, I this method is indented _tab_</technical_language>

Target:
private List<Flight> searchByPrice(SearchParams searchParams) throws ParseException { searchFlights.clear(); try { allFlights = dao.getAllFlights(); } catch (SQLException e) { e.printStackTrace(); } for(int i=0; i < allFlights.size(); i++ ) { if(allFlights.get(i).getPrice() <= searchParams.getPrice()) { searchFlights.add(allFlights.get(i)); } } Collections.sort(searchFlights, new Comparator<Flight>() { public int compare(Flight p1, Flight p2) { return Float.compare(p1.getPrice(), p2.getPrice()); } }); return searchFlights; }
Source:
<code>public ConfigurationBuilder read(Configuration template) { this.classLoader = new WeakReference<ClassLoader>(template.classLoader()); this.asyncExecutorFactory.read(template.asyncExecutorFactory()); this.balancingStrategyClass = template.balancingStrategyClass(); this.balancingStrategy = template.balancingStrategy(); this.connectionPool.read(template.connectionPool()); this.connectionTimeout = template.connectionTimeout(); for (int i = 0; i < consistentHashImpl.length; i++) { this.consistentHashImpl[i] = template.consistentHashImpl(i + 1); } this.forceReturnValues = template.forceReturnValues(); this.keySizeEstimate = template.keySizeEstimate(); this.marshaller = template.marshaller(); this.marshallerClass = template.marshallerClass(); this.protocolVersion = template.version(); this.servers.clear(); for (ServerConfiguration server : template.servers()) { this.addServer().host(server.host()).port(server.port()); } this.socketTimeout = template.socketTimeout(); this.security.read(template.security()); this.tcpNoDelay = template.tcpNoDelay(); this.tcpKeepAlive = template.tcpKeepAlive(); this.transportFactory = template.transportFactory(); this.valueSizeEstimate = template.valueSizeEstimate(); this.maxRetries = template.maxRetries(); this.nearCache.read(template.nearCache()); <START> for (String className : template.serialWhitelist()) <END> this.whiteListRegExs.add(className); return this; }</code><technical_language>reason this addAll well</technical_language>

Target:
public ConfigurationBuilder read(Configuration template) { this.classLoader = new WeakReference<ClassLoader>(template.classLoader()); this.asyncExecutorFactory.read(template.asyncExecutorFactory()); this.balancingStrategyClass = template.balancingStrategyClass(); this.balancingStrategy = template.balancingStrategy(); this.connectionPool.read(template.connectionPool()); this.connectionTimeout = template.connectionTimeout(); for (int i = 0; i < consistentHashImpl.length; i++) { this.consistentHashImpl[i] = template.consistentHashImpl(i + 1); } this.forceReturnValues = template.forceReturnValues(); this.keySizeEstimate = template.keySizeEstimate(); this.marshaller = template.marshaller(); this.marshallerClass = template.marshallerClass(); this.protocolVersion = template.version(); this.servers.clear(); for (ServerConfiguration server : template.servers()) { this.addServer().host(server.host()).port(server.port()); } this.socketTimeout = template.socketTimeout(); this.security.read(template.security()); this.tcpNoDelay = template.tcpNoDelay(); this.tcpKeepAlive = template.tcpKeepAlive(); this.transportFactory = template.transportFactory(); this.valueSizeEstimate = template.valueSizeEstimate(); this.maxRetries = template.maxRetries(); this.nearCache.read(template.nearCache()); this.whiteListRegExs.addAll(template.serialWhitelist()); return this; }
Source:
<code>private Cursor find(Session session, SearchRow first, SearchRow last, SearchRow intersection) { if (recursive) { return findRecursive(first, last); } setupQueryParameters(session, first, last, intersection); <START> query.setNeverLazy(true); <END> ResultInterface result = query.query(0); return new ViewCursor(this, result, first, last); }</code><technical_language>subqueries never-lazy now. a correct fix</technical_language>

Target:
private Cursor find(Session session, SearchRow first, SearchRow last, SearchRow intersection) { if (recursive) { return findRecursive(first, last); } setupQueryParameters(session, first, last, intersection); ResultInterface result = query.query(0); return new ViewCursor(this, result, first, last); }
Source:
<code>public Configuration getConfiguration(RuleLoaderContext context) { return ConfigurationBuilder.begin() .addRule() .when(FileContent.matches("{taglib1}").inFileNamed("{*}.{extension}")) .perform(new AbstractIterationOperation<FileLocationModel>() { @Override public void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) { GraphService.addTypeToModel(event.getGraphContext(), payload.getFile(), JsfSourceFileModel.class); } }) .where("taglib1") .matches("(java\\.sun\\.com/jsf/core)|(java\\.sun\\.com/jsf/html)|(http://java\\.sun\\.com/jsf/facelets)") .where("extension") <START> .matches("(jsp)|(xhtml)") <END> ; }</code><technical_language>extension else is minor thing, i for some rare cases ;)</technical_language>

Target:
public Configuration getConfiguration(RuleLoaderContext context) { return ConfigurationBuilder.begin() .addRule() .when(FileContent.matches("{taglib1}").inFileNamed("{*}.{extension}")) .perform(new AbstractIterationOperation<FileLocationModel>() { @Override public void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) { GraphService.addTypeToModel(event.getGraphContext(), payload.getFile(), JsfSourceFileModel.class); } }) .where("taglib1") .matches("(java\\.sun\\.com/jsf/)|(java\\.sun\\.com/jsf/)|(xmlns\\.jcp\\.org/jsf)") .where("extension") .matches("(jsp)|(xhtml)|(jspx)") ; }
Source:
<code>public List<ObservationUnitRow> reorder( final CollectionOrder collectionOrder, final int trialDatasetId, final String instanceNumber, final List<ObservationUnitRow> observationUnitRows) { <START> final String blockId = <END> this.fieldbookMiddlewareService.getBlockId(trialDatasetId, instanceNumber); FieldmapBlockInfo fieldmapBlockInfo = null; if (blockId != null) { fieldmapBlockInfo = this.fieldbookMiddlewareService.getBlockInformation(Integer.valueOf(blockId)); } if (collectionOrder == CollectionOrder.PLOT_ORDER || fieldmapBlockInfo == null) { return observationUnitRows; } else if (collectionOrder == CollectionOrder.SERPENTINE_ALONG_ROWS) { return this.dataCollectionSorter.orderByRange(fieldmapBlockInfo, observationUnitRows); } else if (collectionOrder == CollectionOrder.SERPENTINE_ALONG_COLUMNS) { return this.dataCollectionSorter.orderByColumn(fieldmapBlockInfo, observationUnitRows); } else { return observationUnitRows; } }</code><technical_language>thinking a good improvement is StudyInstance in middleware retrieve a boolean indicating if instance a fieldmap created not, avoid querying this info times. tackled in mind</technical_language>

Target:
public List<ObservationUnitRow> reorder( final CollectionOrder collectionOrder, final int trialDatasetId, final String instanceNumber, final List<ObservationUnitRow> observationUnitRows) { final String blockId = this.fieldMapService.getBlockId(trialDatasetId, instanceNumber); FieldmapBlockInfo fieldmapBlockInfo = null; if (blockId != null) { fieldmapBlockInfo = this.fieldMapService.getBlockInformation(Integer.valueOf(blockId)); } if (collectionOrder == CollectionOrder.PLOT_ORDER || fieldmapBlockInfo == null) { return observationUnitRows; } else if (collectionOrder == CollectionOrder.SERPENTINE_ALONG_ROWS) { return this.dataCollectionSorter.orderByRange(fieldmapBlockInfo, observationUnitRows); } else if (collectionOrder == CollectionOrder.SERPENTINE_ALONG_COLUMNS) { return this.dataCollectionSorter.orderByColumn(fieldmapBlockInfo, observationUnitRows); } else { return observationUnitRows; } }
Source:
<code>protected Control createDialogArea(Composite parent) { fDialogComposite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(1, true); fDialogComposite.setLayout(layout); <START> fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); <END> createSelectionGroup(); createOptionComposite(); fLocalComposite = null; fFileWidget = null; createLocalComposite(); setMessage(Messages.TraceControl_SelectProfileText); return fDialogComposite; }</code><technical_language>dialog is a big short in height switch Remote. create Remote composite default, height hint initial layout. set a heightHint dialog composite's grid data compensate</technical_language>

Target:
protected Control createDialogArea(Composite parent) { fDialogComposite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(1, true); fDialogComposite.setLayout(layout); GridData data = new GridData(GridData.FILL_BOTH); data.heightHint = 300; fDialogComposite.setLayoutData(data); createSelectionGroup(); createOptionComposite(); fLocalComposite = null; fFileWidget = null; createLocalComposite(); setMessage(Messages.TraceControl_SelectProfileText); return fDialogComposite; }
Source:
<code>public ReceiveCommand(final ObjectId oldId, final ObjectId newId, final String name, final Type type) { if (oldId == null) { throw new IllegalArgumentException(JGitText.get().oldIdMustNotBeNull); } if (newId == null) { throw new IllegalArgumentException(JGitText.get().newIdMustNotBeNull); } this.oldId = oldId; this.newId = newId; this.name = name; switch (type) { case CREATE: if (!ObjectId.zeroId().equals(oldId)) { throw new IllegalArgumentException( JGitText.get().createRequiresZeroOldId); } break; case DELETE: if (!ObjectId.zeroId().equals(newId)) { throw new IllegalArgumentException( JGitText.get().deleteRequiresZeroNewId); } break; case UPDATE: case UPDATE_NONFASTFORWARD: if (ObjectId.zeroId().equals(newId) || ObjectId.zeroId().equals(oldId)) { throw new IllegalArgumentException( JGitText.get().updateRequiresOldIdAndNewId); } break; default: throw new <START> IllegalStateException(); <END> } this.type = type; }</code><technical_language>Add a message here</technical_language>

Target:
public ReceiveCommand(final ObjectId oldId, final ObjectId newId, final String name, final Type type) { if (oldId == null) { throw new IllegalArgumentException(JGitText.get().oldIdMustNotBeNull); } if (newId == null) { throw new IllegalArgumentException(JGitText.get().newIdMustNotBeNull); } this.oldId = oldId; this.newId = newId; this.name = name; switch (type) { case CREATE: if (!ObjectId.zeroId().equals(oldId)) { throw new IllegalArgumentException( JGitText.get().createRequiresZeroOldId); } break; case DELETE: if (!ObjectId.zeroId().equals(newId)) { throw new IllegalArgumentException( JGitText.get().deleteRequiresZeroNewId); } break; case UPDATE: case UPDATE_NONFASTFORWARD: if (ObjectId.zeroId().equals(newId) || ObjectId.zeroId().equals(oldId)) { throw new IllegalArgumentException( JGitText.get().updateRequiresOldIdAndNewId); } break; default: throw new IllegalStateException(JGitText.get().enumValueNotSupported0); } this.type = type; }
Source:
<code>public void testCreateTwoNodesWithRunScript() throws Exception { try { client.destroyNodesMatching(inGroup(group)); } catch (NoSuchElementException e) { } refreshTemplate(); try { nodes = newTreeSet(client.createNodesInGroup(group, 2, template)); } catch (RunNodesException e) { nodes = newTreeSet(concat(e.getSuccessfulNodes(), e.getNodeErrors().keySet())); throw e; } <START> assertEquals(nodes.size(), 2, "nodes is " + nodes); <END> checkNodes(nodes, group, "bootstrap"); NodeMetadata node1 = nodes.first(); NodeMetadata node2 = nodes.last(); assertLocationSameOrChild(checkNotNull(node1.getLocation(), "location of %s", node1), template.getLocation()); assertLocationSameOrChild(checkNotNull(node2.getLocation(), "location of %s", node2), template.getLocation()); checkImageIdMatchesTemplate(node1); checkImageIdMatchesTemplate(node2); checkOsMatchesTemplate(node1); checkOsMatchesTemplate(node2); }</code><technical_language>"expected 2 nodes was: " + nodes</technical_language>

Target:
public void testCreateTwoNodesWithRunScript() throws Exception { try { client.destroyNodesMatching(inGroup(group)); } catch (NoSuchElementException e) { } refreshTemplate(); try { nodes = newTreeSet(client.createNodesInGroup(group, 2, template)); } catch (RunNodesException e) { nodes = newTreeSet(concat(e.getSuccessfulNodes(), e.getNodeErrors().keySet())); throw e; } assertEquals(nodes.size(), 2, "expected two nodes but was " + nodes); checkNodes(nodes, group, "bootstrap"); NodeMetadata node1 = nodes.first(); NodeMetadata node2 = nodes.last(); assertLocationSameOrChild(checkNotNull(node1.getLocation(), "location of %s", node1), template.getLocation()); assertLocationSameOrChild(checkNotNull(node2.getLocation(), "location of %s", node2), template.getLocation()); checkImageIdMatchesTemplate(node1); checkImageIdMatchesTemplate(node2); checkOsMatchesTemplate(node1); checkOsMatchesTemplate(node2); }
Source:
<code>public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTree methodTree = (MethodTree) tree; if (!methodTree.symbol().isPublic()) { return; } for (VariableTree parameter : methodTree.parameters()) { for (IdentifierTree paramUsage : parameter.symbol().usages()) { Tree paramParent = paramUsage.identifierToken().parent(); <START> while (!paramParent.equals(methodTree) && !assertReported.contains(paramParent)) { <END> if (parentType(paramParent)) { break; } paramParent = paramParent.parent(); } } } }</code><technical_language>extract this a dedicated method</technical_language>

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTree methodTree = (MethodTree) tree; if (!methodTree.symbol().isPublic()) { return; } methodTree.parameters().stream() .map(VariableTree::symbol) .map(Symbol::usages) .flatMap(List::stream) .forEach(parameter -> checkUsage(parameter, methodTree)); }