auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void commitNonXAConns() { Map<String, DataServiceConnection> conns = tlCons.get(); for (DataServiceConnection conn : conns.values()) { if (!conn.isXA()) { try { conn.commit(); if (log.isDebugEnabled()) { <START> log.debug("Committing non-XA connection. ThreadID:" + Thread.currentThread().getId()); <END> } } catch (Exception e) { log.warn("Error in committing non-XA connection: " + e.getMessage(), e); } } } }</code><technical_language>print "conn" object well, invoke "toString", do please override toString in "DataServiceConnection" classes, print suitable, for example, in RDBMS ones, Connection objects</technical_language>

Target:
public static void commitNonXAConns() { Map<String, DataServiceConnection> conns = tlCons.get(); for (DataServiceConnection conn : conns.values()) { if (!conn.isXA()) { try { conn.commit(); if (log.isDebugEnabled()) { log.debug("Committing non-XA connection: " + conn.toString() + ", ThreadID - " + Thread.currentThread().getId()); } } catch (Exception e) { log.warn("Error in committing non-XA connection: " + e.getMessage(), e); } } } }
Source:
<code><START> public EventReactorExpected<TuProject> expectThat(TuAggregate entity) { <END> return super.expectThat(entity); }</code><technical_language>this sample usage of test helper class I understand nothing. I know, event import change in aggregate state. However, I understand this is tested, call super</technical_language>

Target:
public EventApplierExpected<TuProject> expectThat(TuAggregate entity) { return super.expectThat(entity); }
Source:
<code>private static boolean isValidGZipStream(File f) throws IOException { FileInputStream fis = null; byte[] byteArray = new byte[2]; try { fis = new FileInputStream(f); <START> fis.read(byteArray, 0, 2); <END> ByteBuffer bb = ByteBuffer.wrap(byteArray); byte[] magicHeader = new byte[2]; bb.get(magicHeader, 0, 2); int magic = magicHeader[0] & 0xff | ((magicHeader[1] << 8) & 0xff00); return magic == GZIPInputStream.GZIP_MAGIC; } catch (FileNotFoundException e) { LOG.error("Unable to open file " + f.getName() + " : ", e); return false; } finally { if (fis != null) { fis.close(); } } }</code><technical_language>Findbugs reports this, ignore result of read(). Please add findbugsExcludeFile.xml ignore (or return check if read successful here, necessary though)</technical_language>

Target:
private static boolean isValidGZipStream(File f) throws IOException { byte[] byteArray = new byte[2]; try (FileInputStream fis = new FileInputStream(f)) { if (2 != fis.read(byteArray, 0, 2)) { LOG.error("Read incorrect number of bytes from " + f.getName()); return false; } ByteBuffer bb = ByteBuffer.wrap(byteArray); byte[] magicHeader = new byte[2]; bb.get(magicHeader, 0, 2); int magic = magicHeader[0] & 0xff | ((magicHeader[1] << 8) & 0xff00); return magic == GZIPInputStream.GZIP_MAGIC; } catch (FileNotFoundException e) { LOG.error("Unable to open file " + f.getName() + " : ", e); return false; } }
Source:
<code>public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { if (!getExpression().evaluate(tuple, ptr)) { return false; } else if (ptr.getLength() == 0) { return true; } PDataType type = getExpression().getDataType(); String stringValue = (String)type.toObject(ptr); if (stringValue == null) { return false; } stringValue = stringValue.trim(); BigDecimal decimalValue; if (format == null) { decimalValue = (BigDecimal) getDataType().toObject(stringValue); } else { ParsePosition parsePosition = new ParsePosition(0); <START> Number number = format.parse(stringValue, parsePosition); <END> if (parsePosition.getErrorIndex() > -1) { ptr.set(EMPTY_BYTE_ARRAY); return true; } if (number instanceof BigDecimal) { decimalValue = (BigDecimal)number; } else { return false; } } byte[] byteValue = getDataType().toBytes(decimalValue); ptr.set(byteValue); return true; }</code><technical_language>I more place a lines do same</technical_language>

Target:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { if (!getExpression().evaluate(tuple, ptr)) { return false; } else if (ptr.getLength() == 0) { return true; } PDataType type = getExpression().getDataType(); String stringValue = (String)type.toObject(ptr); if (stringValue == null) { ptr.set(EMPTY_BYTE_ARRAY); return true; } stringValue = stringValue.trim(); BigDecimal decimalValue; if (format == null) { decimalValue = (BigDecimal) getDataType().toObject(stringValue); } else { ParsePosition parsePosition = new ParsePosition(0); Number number = format.parse(stringValue, parsePosition); if (parsePosition.getErrorIndex() > -1) { ptr.set(EMPTY_BYTE_ARRAY); return true; } if (number instanceof BigDecimal) { decimalValue = (BigDecimal)number; } else { ptr.set(EMPTY_BYTE_ARRAY); return true; } } byte[] byteValue = getDataType().toBytes(decimalValue); ptr.set(byteValue); return true; }
Source:
<code>public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); Message msg = itemFromMenuInfo(menuInfo); if (msg == null) { return; } if (msg.getType().equals(MessageType.STREAM_MESSAGE)) { MenuInflater inflater = getActivity().getMenuInflater(); inflater.inflate(R.menu.context_stream, menu); if ((app.isTopicMute(msg.getStream().getId(), msg.getSubject()))) { <START> menu.findItem(R.id.mute_topic).setTitle("Unmute Topic"); <END> } else { if (filter != null) menu.removeItem(R.id.mute_topic); } } else if (msg.getPersonalReplyTo(app).length > 1) { MenuInflater inflater = getActivity().getMenuInflater(); inflater.inflate(R.menu.context_private, menu); } else { MenuInflater inflater = getActivity().getMenuInflater(); inflater.inflate(R.menu.context_single_private, menu); } }</code><technical_language>User visible strings belong in strings.xml</technical_language>

Target:
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); Message msg = itemFromMenuInfo(menuInfo); if (msg == null) { return; } if (msg.getType().equals(MessageType.STREAM_MESSAGE)) { MenuInflater inflater = getActivity().getMenuInflater(); inflater.inflate(R.menu.context_stream, menu); } else if (msg.getPersonalReplyTo(app).length > 1) { MenuInflater inflater = getActivity().getMenuInflater(); inflater.inflate(R.menu.context_private, menu); } else { MenuInflater inflater = getActivity().getMenuInflater(); inflater.inflate(R.menu.context_single_private, menu); } }
Source:
<code>private void actionDel(AjaxRequestTarget aTarget) { @SuppressWarnings("unchecked") List<LinkWithRoleModel> links = (List<LinkWithRoleModel>) LinkFeatureEditor.this .getModelObject().value; AnnotatorState state = LinkFeatureEditor.this.stateModel.getObject(); FeatureState fs = state.getArmedFeature(); LinkWithRoleModel linkWithRoleModel = links.get(state.getArmedSlot()); links.remove(state.getArmedSlot()); state.clearArmedSlot(); aTarget.add(content); <START> Optional<IPageRequestHandler> handler = RequestCycle.get().find(IPageRequestHandler.class); <END> if (handler.isPresent()) { Page page = (Page) handler.get().getPage(); page.send(page, Broadcast.BREADTH, new LinkFeatureDeletedEvent(fs, aTarget, linkWithRoleModel, RequestCycle.get().find(IPartialPageRequestHandler.class).get())); } }</code><technical_language>get AjaxRequestTarget in method parameter - implements IPartialPageRequestHandler, is need fetch RequestCycle</technical_language>

Target:
private void actionDel(AjaxRequestTarget aTarget) { @SuppressWarnings("unchecked") List<LinkWithRoleModel> links = (List<LinkWithRoleModel>) LinkFeatureEditor.this .getModelObject().value; AnnotatorState state = LinkFeatureEditor.this.stateModel.getObject(); FeatureState fs = state.getArmedFeature(); LinkWithRoleModel linkWithRoleModel = links.get(state.getArmedSlot()); links.remove(state.getArmedSlot()); state.clearArmedSlot(); aTarget.add(content); send(this, Broadcast.BUBBLE, new LinkFeatureDeletedEvent(fs, aTarget, linkWithRoleModel)); }
Source:
<code>default ElideSettings getElideSettings(ServiceLocator injector) { DataStore dataStore = new InjectionAwareHibernateStore( injector, Util.getSessionFactory(getHibernate5ConfigPath(), getModelPackageName())); EntityDictionary dictionary = new EntityDictionary(getCheckMappings()); return new ElideSettingsBuilder(dataStore) .withUseFilterExpressions(true) .withEntityDictionary(dictionary) .withJoinFilterDialect(new RSQLFilterDialect(dictionary)) .withSubqueryFilterDialect(new RSQLFilterDialect(dictionary)) <START> .withISO8601Dates("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC")) <END> .build(); }</code><technical_language>Do want turn this default in elide-standalone, wrap this in if block</technical_language>

Target:
default ElideSettings getElideSettings(ServiceLocator injector) { DataStore dataStore = new InjectionAwareHibernateStore( injector, Util.getSessionFactory(getHibernate5ConfigPath(), getModelPackageName())); EntityDictionary dictionary = new EntityDictionary(getCheckMappings()); ElideSettingsBuilder builder = new ElideSettingsBuilder(dataStore) .withUseFilterExpressions(true) .withEntityDictionary(dictionary) .withJoinFilterDialect(new RSQLFilterDialect(dictionary)) .withSubqueryFilterDialect(new RSQLFilterDialect(dictionary)); if (enableIS06081Dates()) { builder = builder.withISO8601Dates("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC")); } return builder.build(); }
Source:
<code>public void actionPerformed(AnActionEvent e) { final Project project = e.getProject(); if (project == null) { return; } Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor(); if (editor == null) { return; } final Document document = editor.getDocument(); if (document == null) { return; } VirtualFile virtualFile = FileDocumentManager.getInstance().getFile(document); final VirtualFile file = BuckFileUtil.getBuckFile(virtualFile); if (file != null) { BuckQueryCommandHandler handler = new BuckQueryCommandHandler( project, file.getParent(), BuckCommand.QUERY, new Function<List<String>, Void>() { @Nullable @Override public Void apply(@Nullable List<String> strings) { if (strings == null || strings.isEmpty() || strings.get(0) == null || strings.get(0).isEmpty()) { return null; } String target = strings.get(0); BuckBuildCommandHandler handler = new BuckBuildCommandHandler(project, project.getBaseDir(), BuckCommand.PROJECT); handler.command().addParameter(target); handler.command().addParameter("--ide"); handler.command().addParameter("INTELLIJ"); BuckModule buckModule = project.getComponent(BuckModule.class); BuckBuildManager buildManager = BuckBuildManager.getInstance(project); buildManager.setBuilding(project, true); buckModule.attach(target); <START> buildManager.runBuckCommand(handler, "Running buck project for selected file."); <END> buildManager.setBuilding(project, false); return null; } }); BuckBuildManager buildManager = BuckBuildManager.getInstance(project); handler.command().addParameter("owner(" + virtualFile.getPath() + ")"); buildManager.runBuckCommand(handler, "Searching for owning target."); } }</code><technical_language>Instead of "selected file", show file target invoked</technical_language>

Target:
public void actionPerformed(AnActionEvent e) { final Project project = e.getProject(); if (project == null) { return; } Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor(); if (editor == null) { return; } final Document document = editor.getDocument(); if (document == null) { return; } VirtualFile virtualFile = FileDocumentManager.getInstance().getFile(document); final VirtualFile file = BuckFileUtil.getBuckFile(virtualFile); if (file != null) { BuckQueryCommandHandler handler = new BuckQueryCommandHandler( project, file.getParent(), BuckCommand.QUERY, new Function<List<String>, Void>() { @Nullable @Override public Void apply(@Nullable List<String> strings) { if (strings == null || strings.isEmpty() || strings.get(0) == null || strings.get(0).isEmpty()) { return null; } String target = strings.get(0); SelectProjectUtils.generateTargetForProject(target, project); return null; } }); BuckBuildManager buildManager = BuckBuildManager.getInstance(project); handler.command().addParameter("owner(" + virtualFile.getPath() + ")"); buildManager.runBuckCommand(handler, "Searching for owning target."); } }
Source:
<code>protected void initialize() { super.initialize(); for (String[] <START> element : <END> fAppearanceColorListModel) { fConsoleColorList.add(element[0]); } fConsoleColorList.getDisplay().asyncExec(() -> { if (fConsoleColorList != null && !fConsoleColorList.isDisposed()) { fConsoleColorList.select(0); handleAppearanceColorListSelection(); } }); }</code><technical_language>rename colorModel</technical_language>

Target:
protected void initialize() { super.initialize(); for (String[] colorModel : fAppearanceColorListModel) { fConsoleColorList.add(colorModel[0]); } fConsoleColorList.getDisplay().asyncExec(() -> { if (fConsoleColorList != null && !fConsoleColorList.isDisposed()) { fConsoleColorList.select(0); handleAppearanceColorListSelection(); } }); }
Source:
<code>public Properties getSdkProperties() throws IOException { <START> File sdkPropertiesFile = new File(Server.getServersPathFile(), SDKConstants.OPENMRS_SDK_PROPERTIES); <END> if (!sdkPropertiesFile.exists()) { sdkPropertiesFile.createNewFile(); } InputStream in = new FileInputStream(sdkPropertiesFile); Properties sdkProperties = new Properties(); sdkProperties.load(in); return sdkProperties; }</code><technical_language>here. point in throwing IOException. catch rethrow IllegalStateException</technical_language>

Target:
public Properties getSdkProperties() { File sdkPropertiesFile = new File(Server.getServersPathFile(), SDKConstants.OPENMRS_SDK_PROPERTIES); if (!sdkPropertiesFile.exists()) { try { sdkPropertiesFile.createNewFile(); } catch (IOException e) { throw new IllegalStateException("Failed to create SDK properties file in: \"" + Server.getServersPathFile() + SDKConstants.OPENMRS_SDK_PROPERTIES + "\""); } } InputStream in = null; try { in = new FileInputStream(sdkPropertiesFile); } catch (FileNotFoundException e) { throw new IllegalStateException("SDK properties file not found at: \"" + Server.getServersPathFile() + SDKConstants.OPENMRS_SDK_PROPERTIES + "\""); } Properties sdkProperties = new Properties(); try { sdkProperties.load(in); } catch (IOException e) { throw new IllegalStateException("Failed to load properties from file"); } return sdkProperties; }
Source:
<code>public MetricsService(SlimefunPlugin plugin) { this.plugin = plugin; <START> this.metricFile = new File(plugin.getDataFolder(), REPO_NAME + ".jar"); <END> }</code><technical_language>this location, a cache subfolder in data folder for github files, move there? wont bothered this jar sitting inbetween configs</technical_language>

Target:
public MetricsService(SlimefunPlugin plugin) { this.plugin = plugin; this.parentFolder = new File(plugin.getDataFolder(), "cache" + File.separatorChar + "modules"); if (!parentFolder.exists()) parentFolder.mkdirs(); this.metricFile = new File(parentFolder, REPO_NAME + ".jar"); }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final GoodDataSettings that = (GoodDataSettings) o; return maxConnections == that.maxConnections && connectionTimeout == that.connectionTimeout && connectionRequestTimeout == that.connectionRequestTimeout && socketTimeout == that.socketTimeout && pollSleep == that.pollSleep && <START> Objects.equals(userAgent, that.userAgent) && <END> Objects.equals(failOverSettings, that.failOverSettings); }</code><technical_language>consider put && beginning</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final GoodDataSettings that = (GoodDataSettings) o; return maxConnections == that.maxConnections && connectionTimeout == that.connectionTimeout && connectionRequestTimeout == that.connectionRequestTimeout && socketTimeout == that.socketTimeout && pollSleep == that.pollSleep && Objects.equals(userAgent, that.userAgent) && Objects.equals(retrySettings, that.retrySettings); }
Source:
<code>public int compare(final Cell l, final Cell r, boolean ignoreSequenceid) { int diff = 0; <START> if (l instanceof KeyValue && r instanceof KeyValue) { <END> diff = compareKeyValues((KeyValue) l, (KeyValue) r); if (diff != 0) { return diff; } } else if (l instanceof KeyValue && r instanceof ByteBufferKeyValue) { diff = compareKVVsBBKV((KeyValue) l, (ByteBufferKeyValue) r); if (diff != 0) { return diff; } } else if (l instanceof ByteBufferKeyValue && r instanceof KeyValue) { diff = compareKVVsBBKV((KeyValue) r, (ByteBufferKeyValue) l); if (diff != 0) { return -diff; } return ignoreSequenceid ? diff : Long.compare(r.getSequenceId(), l.getSequenceId()); } else if (l instanceof ByteBufferKeyValue && r instanceof ByteBufferKeyValue) { diff = compareBBKV((ByteBufferKeyValue) l, (ByteBufferKeyValue) r); if (diff != 0) { return diff; } } else { int leftRowLength = l.getRowLength(); int rightRowLength = r.getRowLength(); diff = compareRows(l, leftRowLength, r, rightRowLength); if (diff != 0) { return diff; } diff = compareWithoutRow(l, r); if (diff != 0) { return diff; } } return ignoreSequenceid ? diff : Long.compare(r.getSequenceId(), l.getSequenceId()); }</code><technical_language>In read path cells KV BBKV. In write path BBKV now? I some patches for master branch already. create ChunkCell so. Is reverted? Pls check. do KV check BBKV other 2 options? Te perf tests u giving cells KVs right? is test for cells BBKV also? better. a JMH test? split of private methods good now</technical_language>

Target:
public int compare(final Cell l, final Cell r, boolean ignoreSequenceid) { int diff = 0; if (l instanceof KeyValue && r instanceof KeyValue) { diff = compareKeyValues((KeyValue) l, (KeyValue) r); if (diff != 0) { return diff; } } else if (l instanceof KeyValue && r instanceof ByteBufferKeyValue) { diff = compareKVVsBBKV((KeyValue) l, (ByteBufferKeyValue) r); if (diff != 0) { return diff; } } else if (l instanceof ByteBufferKeyValue && r instanceof KeyValue) { diff = compareKVVsBBKV((KeyValue) r, (ByteBufferKeyValue) l); if (diff != 0) { return -diff; } } else if (l instanceof ByteBufferKeyValue && r instanceof ByteBufferKeyValue) { diff = compareBBKV((ByteBufferKeyValue) l, (ByteBufferKeyValue) r); if (diff != 0) { return diff; } } else { int leftRowLength = l.getRowLength(); int rightRowLength = r.getRowLength(); diff = compareRows(l, leftRowLength, r, rightRowLength); if (diff != 0) { return diff; } diff = compareWithoutRow(l, r); if (diff != 0) { return diff; } } return ignoreSequenceid ? diff : Long.compare(r.getSequenceId(), l.getSequenceId()); }
Source:
<code>public void getQosByDiskProfileId() { StorageQos qos = dao.GetQosByDiskProfileId(FixturesTool.DISK_PROFILE_1); assertNotNull(qos); <START> assertEquals(FixturesTool.QOS_ID_1, qos.getId()); <END> }</code><technical_language>consider get qos verify correct profile</technical_language>

Target:
public void getQosByDiskProfileId() { StorageQos qos = dao.getQosByDiskProfileId(FixturesTool.DISK_PROFILE_1); assertNotNull(qos); assertEquals(FixturesTool.QOS_ID_1, qos.getId()); }
Source:
<code>public AllelicCountWithPhasePosteriors(final AllelicCount count, final double refMinorLogProb, final double altMinorLogProb, final double outlierLogProb) { <START> super(Utils.nonNull(count, "AllelicCount cannot be null.")); <END> ParamUtils.isFinite(refMinorLogProb, "Cannot construct AllelicCountWithPhasePosteriors with non-finite ref-minor probability at: " + count.getInterval()); ParamUtils.isFinite(altMinorLogProb, "Cannot construct AllelicCountWithPhasePosteriors with non-finite alt-minor probability at: " + count.getInterval()); ParamUtils.isFinite(outlierLogProb, "Cannot construct AllelicCountWithPhasePosteriors with non-finite outlier probability at: " + count.getInterval()); final double[] normalizedProbs = MathUtils.normalizeFromLog10( new double[]{MathUtils.logToLog10(refMinorLogProb), MathUtils.logToLog10(altMinorLogProb), MathUtils.logToLog10(outlierLogProb)}); refMinorProb = normalizedProbs[0]; altMinorProb = normalizedProbs[1]; outlierProb = normalizedProbs[2]; if (!Double.isFinite(refMinorProb) || !Double.isFinite(altMinorProb) || !Double.isFinite(outlierProb)) { throw new IllegalArgumentException("Cannot construct AllelicCountWithPhasePosteriors with non-finite probabilities at: " + count.getInterval()); } }</code><technical_language>null check belongs in parent constructor</technical_language>

Target:
public AllelicCountWithPhasePosteriors(final AllelicCount count, final double refMinorLogProb, final double altMinorLogProb, final double outlierLogProb) { super(count); ParamUtils.isFinite(refMinorLogProb, "Cannot construct AllelicCountWithPhasePosteriors with non-finite ref-minor probability at: " + count.getInterval()); ParamUtils.isFinite(altMinorLogProb, "Cannot construct AllelicCountWithPhasePosteriors with non-finite alt-minor probability at: " + count.getInterval()); ParamUtils.isFinite(outlierLogProb, "Cannot construct AllelicCountWithPhasePosteriors with non-finite outlier probability at: " + count.getInterval()); final double[] normalizedProbs = MathUtils.normalizeFromLog10( new double[]{MathUtils.logToLog10(refMinorLogProb), MathUtils.logToLog10(altMinorLogProb), MathUtils.logToLog10(outlierLogProb)}); refMinorProb = normalizedProbs[0]; altMinorProb = normalizedProbs[1]; outlierProb = normalizedProbs[2]; Utils.validateArg(Double.isFinite(refMinorProb) && Double.isFinite(altMinorProb) && Double.isFinite(outlierProb), "Cannot construct AllelicCountWithPhasePosteriors with non-finite probabilities at: " + count.getInterval()); }
Source:
<code>protected void formatMaster(final IFormattingContext context, final IDocument document, int offset, int length) { try { final int delta= offset - document.getLineInformationOfOffset(offset).getOffset(); offset -= delta; <START> if (length != 0) END> length += delta; } catch (BadLocationException exception) { } if (fMaster != null) { context.setProperty(FormattingContextProperties.CONTEXT_PARTITION, new TypedPosition(offset, length, fType)); fMaster.formatterStarts(context); fMaster.format(); fMaster.formatterStops(); } }</code><technical_language>I adjust length, move offset beginning of line, adjust if length is 0</technical_language>

Target:
protected void formatMaster(final IFormattingContext context, final IDocument document, int offset, int length) { try { if (length != 0) { final int delta= offset - document.getLineInformationOfOffset(offset).getOffset(); offset -= delta; length += delta; } } catch (BadLocationException exception) { } if (fMaster != null) { context.setProperty(FormattingContextProperties.CONTEXT_PARTITION, new TypedPosition(offset, length, fType)); fMaster.formatterStarts(context); fMaster.format(); fMaster.formatterStops(); } }
Source:
<code>public void run() { TmfCoreTracer.traceRequest(fRequest, "is being serviced by " + fProvider.getName()); fRequest.start(); int nbRequested = fRequest.getNbRequested(); int nbRead = 0; isCompleted = false; ITmfContext context = fProvider.armRequest(fRequest); if (context == null) { fRequest.cancel(); return; } try { ITmfEvent event = fProvider.getNext(context); TmfCoreTracer.traceRequest(fRequest, "read first event"); while (event != null && !fProvider.isCompleted(fRequest, event, nbRead)) { TmfCoreTracer.traceEvent(fProvider, fRequest, event); if (fRequest.getDataType().isInstance(event)) { fRequest.handleData(event); } <START> synchronized (fSynchObject) { <END> while (fIsPaused) { try { fSynchObject.wait(); } catch (InterruptedException e) { } } } if (++nbRead < nbRequested) { event = fProvider.getNext(context); } } isCompleted = true; if (fRequest.isCancelled()) { fRequest.cancel(); } else { fRequest.done(); } } catch (Exception e) { Activator.logError("Error in " + fProvider.getName() + " handling " + fRequest, e); fRequest.fail(); } context.dispose(); }</code><technical_language>synchronized is needed. in fact I lead a deadlock, if thread in stays .wait, lock. another thread calling resume() get stuck synchronized {}</technical_language>

Target:
public void run() { TmfCoreTracer.traceRequest(fRequest, "is being serviced by " + fProvider.getName()); fRequest.start(); int nbRequested = fRequest.getNbRequested(); int nbRead = 0; isCompleted = false; ITmfContext context = fProvider.armRequest(fRequest); if (context == null) { fRequest.cancel(); return; } try { ITmfEvent event = fProvider.getNext(context); TmfCoreTracer.traceRequest(fRequest, "read first event"); while (event != null && !fProvider.isCompleted(fRequest, event, nbRead)) { TmfCoreTracer.traceEvent(fProvider, fRequest, event); if (fRequest.getDataType().isInstance(event)) { fRequest.handleData(event); } while (fIsPaused) { synchronized (fSynchObject) { try { fSynchObject.wait(); } catch (InterruptedException e) { } } } if (++nbRead < nbRequested) { event = fProvider.getNext(context); } } isCompleted = true; if (fRequest.isCancelled()) { fRequest.cancel(); } else { fRequest.done(); } } catch (Exception e) { Activator.logError("Error in " + fProvider.getName() + " handling " + fRequest, e); fRequest.fail(); } context.dispose(); }
Source:
<code>public StatusOnlyReturnForXmlRpc upgradeStoragePool(String storagePoolId, String targetVersion) { Map<String, Object> xmlRpcReturnValue = irsServer.upgradeStoragePool(storagePoolId, targetVersion); <START> StatusOnlyReturnForXmlRpc wrapper = new StatusOnlyReturnForXmlRpc(xmlRpcReturnValue); <END> return wrapper; }</code><technical_language>a matter of test - return inlined</technical_language>

Target:
public StatusOnlyReturnForXmlRpc upgradeStoragePool(String storagePoolId, String targetVersion) { Map<String, Object> xmlRpcReturnValue = irsServer.upgradeStoragePool(storagePoolId, targetVersion); return new StatusOnlyReturnForXmlRpc(xmlRpcReturnValue); }
Source:
<code>private void close(final boolean clean, final Map<TopicPartition, Long> checkpoint) { if (clean && checkpoint != null) { <START> executeAndMaybeSwallow(clean, () -> stateMgr.checkpoint(checkpoint), "state manager checkpoint", log); <END> } switch (state()) { case CREATED: case RUNNING: case RESTORING: case SUSPENDED: final boolean wipeStateStore = !clean && !eosDisabled; executeAndMaybeSwallow( clean, () -> { StateManagerUtil.closeStateManager( log, logPrefix, clean, wipeStateStore, stateMgr, stateDirectory, TaskType.ACTIVE); }, "state manager close", log); executeAndMaybeSwallow(clean, recordCollector::close, "record collector close", log); break; default: throw new IllegalStateException("Illegal state " + state() + " while closing active task " + id); } partitionGroup.close(); closeTaskSensor.record(); transitionTo(State.CLOSED); }</code><technical_language>Remove if</technical_language>

Target:
private void close(final boolean clean, final Map<TopicPartition, Long> checkpoint) { if (clean && checkpoint != null) { executeAndMaybeSwallow(clean, () -> stateMgr.checkpoint(checkpoint), "state manager checkpoint", log); } switch (state()) { case CREATED: case RUNNING: case RESTORING: case SUSPENDED: final boolean wipeStateStore = !clean && !eosDisabled; executeAndMaybeSwallow( clean, () -> StateManagerUtil.closeStateManager( log, logPrefix, clean, wipeStateStore, stateMgr, stateDirectory, TaskType.ACTIVE ), "state manager close", log); executeAndMaybeSwallow(clean, recordCollector::close, "record collector close", log); break; default: throw new IllegalStateException("Illegal state " + state() + " while closing active task " + id); } partitionGroup.close(); closeTaskSensor.record(); transitionTo(State.CLOSED); }
Source:
<code>private Multimap<Publisher, ScoredCandidate<T>> extract(T target, List<ScoredCandidate<T>> filteredCandidates, ResultDescription desc) { desc.startStage("Extracting strong equivalents"); SortedSetMultimap<Publisher, ScoredCandidate<T>> publisherBins = publisherBin(filteredCandidates); ImmutableMultimap.Builder<Publisher, ScoredCandidate<T>> builder = ImmutableMultimap.builder(); for (Publisher publisher : publisherBins.keySet()) { desc.startStage(String.format("Publisher: %s", publisher)); ImmutableSortedSet<ScoredCandidate<T>> copyOfSorted = ImmutableSortedSet.copyOfSorted(publisherBins.get(publisher)); Optional<ScoredCandidate<T>> extracted = extractor.extract(copyOfSorted.asList().reverse(), target, desc); Set<ScoredCandidate<T>> allowedCandidates = candidatesThatCanBeEquivalatedToSamePublisher(copyOfSorted, extracted, target); <START> if(!extracted.isPresent()) { <END> } else if (isSeriesOrBrand(extracted.get().candidate())) { builder.put(publisher, extracted.get()); } else if(allowedCandidates.size() > 0 && !isSeriesOrBrand(target)) { for (ScoredCandidate<T> scoredCandidate : allowedCandidates) { builder.put(publisher, scoredCandidate); } } else { if(extracted.isPresent()) { builder.put(publisher, extracted.get()); } } desc.finishStage(); } desc.finishStage(); return builder.build(); }</code><technical_language>This logic simplified</technical_language>

Target:
private Multimap<Publisher, ScoredCandidate<T>> extract( T target, List<ScoredCandidate<T>> filteredCandidates, ResultDescription desc ) { desc.startStage("Extracting strong equivalents"); SortedSetMultimap<Publisher, ScoredCandidate<T>> publisherBins = publisherBin(filteredCandidates); ImmutableMultimap.Builder<Publisher, ScoredCandidate<T>> builder = ImmutableMultimap.builder(); for (Publisher publisher : publisherBins.keySet()) { desc.startStage(String.format("Publisher: %s", publisher)); ImmutableSortedSet<ScoredCandidate<T>> copyOfSorted = ImmutableSortedSet.copyOfSorted(publisherBins.get(publisher)); Optional<Set<ScoredCandidate<T>>> multipleExtractedCandidates = multipleCandidateExtractor.extract( copyOfSorted.asList().reverse(), target ); if (multipleExtractedCandidates.isPresent()) { builder.putAll( publisher, multipleExtractedCandidates.get() ); } else { Optional<ScoredCandidate<T>> extracted = extractor.extract( copyOfSorted.asList().reverse(), target, desc ); if (extracted.isPresent()) { builder.put(publisher, extracted.get()); } } desc.finishStage(); } desc.finishStage(); return builder.build(); }
Source:
<code>public void testChunkFillingBlobSizeMultipleOfChunkSize() throws Exception { <START> blobSize = chunkSize * random.nextInt(10) + 1; <END> fillChunksAndAssertSuccess(); }</code><technical_language>missing braces ? blobSize end 1 if random.nextInt(10) returns 0</technical_language>

Target:
public void testChunkFillingBlobSizeMultipleOfChunkSize() throws Exception { blobSize = chunkSize * (random.nextInt(10) + 1); fillChunksAndAssertSuccess(); }
Source:
<code>public EList<DCell> getOrderedCells() { final Map<DColumn, Integer> columnIndices = Maps.newHashMap(); int i = 0; DTable table = TableHelper.getTable(this); <START> if (table != null) { for (DColumn col : table.getColumns()) { columnIndices.put(col, i++); } } <END> Ordering<DCell> ordering = Ordering.from(new Comparator<DCell>() { @Override public int compare(DCell a, DCell b) { int result = 0; DColumn columnA = a.getColumn(); DColumn columnB = b.getColumn(); if (columnA == null || columnA.eContainer() == null) { result = -1; } else if (columnB == null || columnB.eContainer() == null) { result = 1; } else { Integer aIndex = columnIndices.get(columnA); Integer bIndex = columnIndices.get(columnB); if (aIndex == null || bIndex == null) { throw new RuntimeException("Should not happen."); } return aIndex - bIndex; } return result; } }); DCell[] data = new DCell[getCells().size()]; getCells().toArray(data); Arrays.sort(data, ordering); return new EcoreEList.UnmodifiableEList<DCell>(eInternalContainer(), TablePackage.eINSTANCE.getDLine_OrderedCells(), data.length, data); }</code><technical_language>this trading NPE for a RuntimeException? If columnIndices is filled, comparator find null values "throw new RuntimeException"</technical_language>

Target:
public EList<DCell> getOrderedCells() { Ordering<DCell> ordering = Ordering.from(new Comparator<DCell>() { Map<DColumn, Integer> columnIndices; @Override public int compare(DCell a, DCell b) { int result = 0; DColumn columnA = a.getColumn(); DColumn columnB = b.getColumn(); if (columnA == null || columnA.eContainer() == null) { result = -1; } else if (columnB == null || columnB.eContainer() == null) { result = 1; } else { if (columnIndices == null) { columnIndices = Maps.newHashMap(); int i = 0; for (DColumn col : columnA.getTable().getColumns()) { columnIndices.put(col, i++); } } Integer aIndex = columnIndices.get(columnA); Integer bIndex = columnIndices.get(columnB); if (aIndex == null || bIndex == null) { throw new RuntimeException("Should not happen."); } return aIndex - bIndex; } return result; } }); DCell[] data = new DCell[getCells().size()]; getCells().toArray(data); Arrays.sort(data, ordering); return new EcoreEList.UnmodifiableEList<DCell>(eInternalContainer(), TablePackage.eINSTANCE.getDLine_OrderedCells(), data.length, data); }
Source:
<code>@Override public void endElement(String ignoredUri, String ignoredName, String qName) { if (qName.equals("OS")) { String osText = currentOrNull(currentText); if (osText != null) { os = OSImage.Type.valueOf(currentOrNull(currentText).toUpperCase()); } } else if (qName.equals("Name")) { name = currentOrNull(currentText); } else if (qName.equals("LogicalSizeInGB")) { String gb = currentOrNull(currentText); if (gb != null) { logicalSizeInGB = Integer.parseInt(gb); } } else if (qName.equals("Description")) { description = currentOrNull(currentText); } else if (qName.equals("Category")) { category = currentOrNull(currentText); } else if (qName.equals("Location")) { String locationField = currentOrNull(currentText); if (locationField != null) { <START> for (String location : Splitter.on(';').split(locationField)) { <END> locations.add(location); } } } else if (qName.equals("AffinityGroup")) { affinityGroup = currentOrNull(currentText); } else if (qName.equals("MediaLink")) { String link = currentOrNull(currentText); if (link != null) { mediaLink = URI.create(link); } } else if (qName.equals("Eula")) { String eulaField = currentOrNull(currentText); if (eulaField != null) { for (String eula : Splitter.on(';').split(eulaField)) { if ((eula = emptyToNull(eula.trim())) != null) { eulas.add(eula); } } } } else if (qName.equals("Label")) { label = currentOrNull(currentText); } currentText.setLength(0); }</code><technical_language>[minor] [splitToList](<LINK_0></technical_language>

Target:
@Override public void endElement(String ignoredUri, String ignoredName, String qName) { if (qName.equals("OS")) { String osText = currentOrNull(currentText); if (osText != null) { os = OSImage.Type.valueOf(currentOrNull(currentText).toUpperCase()); } } else if (qName.equals("Name")) { name = currentOrNull(currentText); } else if (qName.equals("LogicalSizeInGB")) { String gb = currentOrNull(currentText); if (gb != null) { logicalSizeInGB = Integer.parseInt(gb); } } else if (qName.equals("Description")) { description = currentOrNull(currentText); } else if (qName.equals("Category")) { category = currentOrNull(currentText); } else if (qName.equals("Location")) { String locationField = currentOrNull(currentText); if (locationField != null) { locations.addAll(Splitter.on(';').splitToList(locationField)); } } else if (qName.equals("AffinityGroup")) { affinityGroup = currentOrNull(currentText); } else if (qName.equals("MediaLink")) { String link = currentOrNull(currentText); if (link != null) { mediaLink = URI.create(link); } } else if (qName.equals("Eula")) { String eulaField = currentOrNull(currentText); if (eulaField != null) { for (String eula : Splitter.on(';').split(eulaField)) { if ((eula = emptyToNull(eula.trim())) != null) { eulas.add(eula); } } } } else if (qName.equals("Label")) { label = currentOrNull(currentText); } currentText.setLength(0); }
Source:
<code>private String getAction(ServiceTreeNode node, String path) { for (String action : node.getActions()) { if (action.toLowerCase().equals(path)) { return action; } } <START> return null; <END> }</code><technical_language>Consider streams,: return node.getActions().stream() .filter(action -> action.toLowerCase().equals(path)) .findFirst() .orElse(null);</technical_language>

Target:
private String getAction(ServiceTreeNode node, String path) { return node.getActions().stream() .filter(action -> action.toLowerCase().equals(path)) .findFirst() .orElse(null); }
Source:
<code>public void channelRead0(ChannelHandlerContext ctx, Batch batch) throws Exception { if(logger.isDebugEnabled()) { logger.debug(format("Received a new payload")); } ctx.channel().attr(BeatsHandler.PROCESSING_BATCH).set(true); try { for (Message message : batch) { if (logger.isDebugEnabled()) { logger.debug(format("Sending a new message for the listener, sequence: " + message.getSequence())); } messageListener.onNewMessage(ctx, message); if (needAck(message)) { ack(ctx, message); } } }finally{ <START> ctx.channel().attr(ConnectionHandler.CHANNEL_PENDING_COUNTER).get().getAndDecrement(); <END> if (logger.isDebugEnabled()) { logger.debug("{}: batches pending: {}", ctx.channel().id().asShortText(),ctx.channel().attr(ConnectionHandler.CHANNEL_PENDING_COUNTER).get().get()); } batch.release(); ctx.flush(); ctx.channel().attr(PROCESSING_BATCH).set(false); } }</code><technical_language>Unfortunately, I this approach work - number of calls 'channelRead' in 'ConnectionHandler' do necessarily match. In case, for large batches, a single call 'channelRead created multiple channelRead calls pipeline</technical_language>

Target:
public void channelRead0(ChannelHandlerContext ctx, Batch batch) throws Exception { if(logger.isDebugEnabled()) { logger.debug(format("Received a new payload")); } try { for (Message message : batch) { if (logger.isDebugEnabled()) { logger.debug(format("Sending a new message for the listener, sequence: " + message.getSequence())); } messageListener.onNewMessage(ctx, message); if (needAck(message)) { ack(ctx, message); } } }finally{ ctx.channel().attr(ConnectionHandler.CHANNEL_SEND_KEEP_ALIVE).get().set(false); if (logger.isDebugEnabled()) { logger.debug("{}: batches pending: {}", ctx.channel().id().asShortText(),ctx.channel().attr(ConnectionHandler.CHANNEL_SEND_KEEP_ALIVE).get().get()); } batch.release(); ctx.flush(); } }
Source:
<code>public void updateValidationStatuses(final Map<Dependency, FileValidationStatus> depValidationStatuses, final String validationKey) throws SQLException { <START> if (depValidationStatuses.size() == 0) { <END> return; } Object[][] rowsToInsert = depValidationStatuses .keySet() .stream() .map(d -> new Object[]{d.getFileName(), d.getSHA1(), validationKey, depValidationStatuses.get(d).getValue()}) .toArray(Object[][]::new); this.dbOperator.batch("insert ignore into validated_dependencies " + "(file_name, file_sha1, validation_key, validation_status) values (?, ?, ?, ?)", rowsToInsert); }</code><technical_language>depValidationStatuses.isEmpty() a bit easier read</technical_language>

Target:
public void updateValidationStatuses(final Map<Dependency, FileValidationStatus> depValidationStatuses, final String validationKey) throws SQLException { if (depValidationStatuses.isEmpty()) { return; } Object[][] rowsToInsert = depValidationStatuses .keySet() .stream() .map(d -> new Object[]{d.getFileName(), d.getSHA1(), validationKey, depValidationStatuses.get(d).getValue()}) .toArray(Object[][]::new); this.dbOperator.batch("INSERT IGNORE INTO validated_dependencies " + "(file_name, file_sha1, validation_key, validation_status) VALUES (?, ?, ?, ?)", rowsToInsert); }
Source:
<code>public TempDirectory(String name) { try { basePath = Files.createTempDirectory("robolectric-" + name); } catch (IOException e) { throw new RuntimeException(e); } synchronized (TempDirectory.class) { <START> if (tempDirectoriesToDelete == null) { <END> tempDirectoriesToDelete = Collections.synchronizedSet(new HashSet<>()); Runtime.getRuntime().addShutdownHook(new Thread(TempDirectory::clearAllDirectories)); } } tempDirectoriesToDelete.add(this); }</code><technical_language>nit: preferable initialize this upfront this: java private static Set<TempDirectory> tempDirectoriesToDelete = Collections.synchronizedSet(new HashSet<>()); do: java synchronized (tempDirectoriesToDelete) { if (tempDirectoriesToDelete.size() == 0) { ...} }</technical_language>

Target:
public TempDirectory(String name) { try { basePath = Files.createTempDirectory("robolectric-" + name); } catch (IOException e) { throw new RuntimeException(e); } synchronized (tempDirectoriesToDelete) { if (tempDirectoriesToDelete.size() == 0) { Runtime.getRuntime().addShutdownHook(new Thread(TempDirectory::clearAllDirectories)); } tempDirectoriesToDelete.add(this); } }
Source:
<code>private static @NonNull Set<@NonNull Entry<String, Set<String>>> getSsNames(SWTBotView bot) { SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(bot.bot()); SWTBotTimeGraphEntry[] traceEntries = timeGraph.getEntries(); <START> assertEquals("State system explorer should have a single trace entry: " + Arrays.toString(traceEntries), 1, traceEntries.length); <END> SWTBotTimeGraphEntry trace = timeGraph.getEntry("synthetic-trace"); SWTBotTimeGraphEntry[] modules = trace.getEntries(); Map<String, Set<String>> modulesToStateSystems = new HashMap<>(); for (SWTBotTimeGraphEntry module : modules) { Set<String> stateSystems = new HashSet<>(); for (SWTBotTimeGraphEntry stateSystem : module.getEntries()) { stateSystems.add(stateSystem.getText()); } modulesToStateSystems.put(module.getText(), stateSystems); } return modulesToStateSystems.entrySet(); }</code><technical_language>careful, getEntry(String) wait for entry found, code check fail immediately (if quick 0). Is this intention</technical_language>

Target:
private static @NonNull Set<@NonNull Entry<String, Set<String>>> getSsNames(SWTBotView bot) { SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(bot.bot()); SWTBotTimeGraphEntry[] traceEntries = timeGraph.getEntries(); SWTBotTimeGraphEntry trace = timeGraph.getEntry("synthetic-trace"); assertEquals("State system explorer should have a single trace entry: " + Arrays.toString(traceEntries), 1, traceEntries.length); SWTBotTimeGraphEntry[] modules = trace.getEntries(); Map<String, Set<String>> modulesToStateSystems = new HashMap<>(); for (SWTBotTimeGraphEntry module : modules) { Set<String> stateSystems = new HashSet<>(); for (SWTBotTimeGraphEntry stateSystem : module.getEntries()) { stateSystems.add(stateSystem.getText()); } modulesToStateSystems.put(module.getText(), stateSystems); } return modulesToStateSystems.entrySet(); }
Source:
<code><START> public void testMultipleTokens() { <END> ginjector.getPlaceManager().revealDefaultPlace(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { assertTrue(ginjector.getMainPresenter().get().isVisible()); ginjector.getPlaceManager().revealPlace(new PlaceRequest.Builder().nameToken("admin").build()); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { assertFalse(ginjector.getMainPresenter().get().isVisible()); assertTrue(ginjector.getAdminPresenter().get().isVisible()); ginjector.getPlaceManager().revealDefaultPlace(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { assertTrue(ginjector.getMainPresenter().get().isVisible()); assertFalse(ginjector.getAdminPresenter().get().isVisible()); ginjector.getPlaceManager().revealPlace( new PlaceRequest.Builder().nameToken("selfService").build()); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { assertFalse(ginjector.getMainPresenter().get().isVisible()); assertTrue(ginjector.getAdminPresenter().get().isVisible()); finishTest(); } }); } }); } }); } }); delayTestFinish(1000); }</code><technical_language>weird multiple schedule deffered</technical_language>

Target:
public void testMultipleTokens() { ginjector.getPlaceManager().revealDefaultPlace(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { assertTrue(ginjector.getMainPresenter().get().isVisible()); assertFalse(ginjector.getAdminPresenter().get().isVisible()); revealAdmin(); } }); delayTestFinish(1000); }
Source:
<code>public boolean isValid(CruiseConfig preprocessedConfig) { EnvironmentConfig config = preprocessedConfig.getEnvironments().find(this.config.name()); boolean isValid = config.validateTree(ConfigSaveValidationContext.forChain(preprocessedConfig), preprocessedConfig); if (!isValid) { List<ConfigErrors> allErrors = preprocessedConfig.getAllErrors(); <START> result.badRequest(actionFailed.addParam(allErrors.get(0).firstError())); <END> } return isValid; }</code><technical_language>adding errors instead of one</technical_language>

Target:
public boolean isValid(CruiseConfig preprocessedConfig) { EnvironmentConfig config = preprocessedConfig.getEnvironments().find(this.config.name()); boolean isValid = config.validateTree(ConfigSaveValidationContext.forChain(preprocessedConfig), preprocessedConfig); if (!isValid) { String allErrors = new AllConfigErrors(preprocessedConfig.getAllErrors()).asString(); result.badRequest(actionFailed.addParam(allErrors)); } return isValid; }
Source:
<code>private Integer getHash(byte[] hash) { <START> return (hash[3] << 0) + (hash[2] << 8) + (hash[1] << 16) + (hash[0] << 24); <END> }</code><technical_language>hash[3] << 0 is equivalent hash[3]</technical_language>

Target:
private Integer getHash(byte[] hash) { return (hash[3]) + (hash[2] << 8) + (hash[1] << 16) + (hash[0] << 24); }
Source:
<code>protected void migrateData(ReviewDb db, UpdateUI ui) throws OrmException { List<AccountGroup> all = db.accountGroups().all().toList(); <START> if (all.contains(AccountGroup.CHANGE_OWNER)) { <END> return; } AccountGroup changeOwners = newGroup(db, "Change Owner", AccountGroup.CHANGE_OWNER); changeOwners.setDescription("The owner of a change"); changeOwners.setOwnerGroupUUID(adminGroup(all)); changeOwners.setType(AccountGroup.Type.SYSTEM); db.accountGroups().insert( Collections.<AccountGroup> singletonList(changeOwners)); }</code><technical_language>This is false. AccountGroup.UUID equals AccountGroup</technical_language>

Target:
protected void migrateData( ReviewDb db, UpdateUI ui) throws OrmException { Repository git; try { git = mgr.openRepository(allProjects); } catch (IOException e) { throw new OrmException(e); } try { MetaDataUpdate md = new MetaDataUpdate(GitReferenceUpdated.DISABLED, allProjects, git); ProjectConfig config = ProjectConfig.read(md); List<AccountGroup.UUID> adminGroupUUIDs = getAdministrateServerGroups(db, config); if (!adminGroupUUIDs.isEmpty()) { createGroup(db, "Change Owner", adminGroupUUIDs.get(0), "The owner of a change"); } } catch (IOException e) { throw new OrmException(e); } catch (ConfigInvalidException e) { throw new OrmException(e); } finally { git.close(); } }
Source:
<code>private static boolean invalidMethodAndVariable(Symbol currentMember, Symbol knownMember) { Symbol methodSymbol = currentMember.isMethodSymbol() ? currentMember : knownMember; Symbol variableSymbol = methodSymbol == currentMember ? knownMember : currentMember; <START> return sameVisibilityNotPrivate(currentMember, knownMember) <END> && !methodReturningVariableWithSameName(methodSymbol, variableSymbol) && !isBuilderPattern(methodSymbol, variableSymbol); }</code><technical_language>I start method if(!sameVisibilityNotPrivate(currentMember, knownMember)) { return false; } this operation requires knowing is method variable</technical_language>

Target:
private static boolean invalidMethodAndVariable(Symbol currentMember, Symbol knownMember) { if (!sameVisibilityNotPrivate(currentMember, knownMember)) { return false; } Symbol methodSymbol = currentMember.isMethodSymbol() ? currentMember : knownMember; Symbol variableSymbol = methodSymbol == currentMember ? knownMember : currentMember; return !methodReturningVariableWithSameName(methodSymbol, variableSymbol) && !isBuilderPattern(methodSymbol, variableSymbol); }