auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { <END> super.drawGuiContainerForegroundLayer(mouseX, mouseY); mouseX -= cornerX; mouseY -= cornerY; if(71 <= mouseX && mouseX < 83 && 16 <= mouseY && mouseY < 68) { List<String> text = Lists.newArrayList(); FluidStack fuel = fuelInfo.fluid; text.add(TextFormatting.WHITE + Util.translate("gui.smeltery.fuel")); if(fuel != null) { text.add(fuel.getLocalizedName()); liquidToString(fuel, text); } else { text.add(Util.translate("gui.smeltery.fuel.empty")); } text.add(Util.translateFormatted("gui.smeltery.fuel.heat", fuelInfo.heat)); this.drawHoveringText(text, mouseX, mouseY); } }</code><technical_language>Lots of duplicate code in again, if pull stuff in a common class for smeltery furnace</technical_language>

Target:
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { super.drawGuiContainerForegroundLayer(mouseX, mouseY); mouseX -= cornerX; mouseY -= cornerY; if(71 <= mouseX && mouseX < 83 && 16 <= mouseY && mouseY < 68) { drawFuelTooltip(mouseX, mouseY); } }
Source:
<code>private Boolean validateForBoolean(String value) { if (!value.equals("true") && !value.equals("false")) { <START> return false; <END> } return true; }</code><technical_language>Instead of returning false throw errror</technical_language>

Target:
private void validateForBoolean(String value) { if (!value.equals("true") && !value.equals("false")) { throw new OpenClinicaSystemException(FAILED, ErrorConstants.ERR_VALUE_TYPE_MISMATCH); } }
Source:
<code>public FilterType propertyIsEqualTo(String propertyName, int literal) { return buildPropertyIsFilterType( <START> propertyName, literal, PROPERTY_IS_OPS.PropertyIsEqualTo, DEFAULT_MATCH_CASE); <END> }</code><technical_language>overloading for buildPropertyIsFilterType method DEFAULT_MATCH_CASE if specified</technical_language>

Target:
public FilterType propertyIsEqualTo(String propertyName, int literal) { return buildPropertyIsFilterType(propertyName, literal, PROPERTY_IS_OPS.PropertyIsEqualTo); }
Source:
<code>public String getTenantAsString() { <START> return Value.of(getTenant().getId()).getString(); <END> }</code><technical_language>String.valueOf(getTenant().getId())</technical_language>

Target:
public String getTenantAsString() { return getTenant().isFilled() ? String.valueOf(getTenant().getId()) : null; }
Source:
<code>public synchronized void append(Frame frame) { if (FrameHeaderFlyweight.FLAGS_M == (FrameHeaderFlyweight.FLAGS_M & frame.flags())) { <START> final ByteBuf buffer = FrameHeaderFlyweight.sliceFrameMetadataRetained(frame.content()); <END> metadataBuffer.addComponent(true, buffer); } else { final ByteBuf buffer = FrameHeaderFlyweight.sliceFrameDataRetained(frame.content()); dataBuffer.addComponent(true, buffer); } }</code><technical_language>read data in this case</technical_language>

Target:
public synchronized void append(Frame frame) { final ByteBuf byteBuf = frame.content(); final FrameType frameType = FrameHeaderFlyweight.frameType(byteBuf); final int frameLength = FrameHeaderFlyweight.frameLength(byteBuf); final int metadataLength = FrameHeaderFlyweight.metadataLength(byteBuf, frameType, frameLength); final int dataLength = FrameHeaderFlyweight.dataLength(byteBuf, frameType); if (0 < metadataLength) { int metadataOffset = FrameHeaderFlyweight.metadataOffset(byteBuf); if (FrameHeaderFlyweight.hasMetadataLengthField(frameType)) { metadataOffset += FrameHeaderFlyweight.FRAME_LENGTH_SIZE; } metadataBuffer.addComponent(true, byteBuf.retainedSlice(metadataOffset, metadataLength)); } if (0 < dataLength) { final int dataOffset = FrameHeaderFlyweight.dataOffset(byteBuf, frameType, frameLength); dataBuffer.addComponent(true, byteBuf.retainedSlice(dataOffset, dataLength)); } }
Source:
<code>protected void createControls(final Composite parent, int horizontalSpan) { setNotificationsAllowed(false); try { Composite composite = new Composite(parent, SWT.BORDER); if (fillVertically) { GridLayout layout = ALayout.getZeroMarginLayout(1, false); layout.verticalSpacing = 4; composite.setLayout(layout); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); } else { GridLayout layout = ALayout.getZeroMarginLayout(horizontalSpan, false); layout.verticalSpacing = 4; composite.setLayout(layout); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false); gd.horizontalSpan = horizontalSpan; composite.setLayoutData(gd); } <START> if (isDisplayLabel() && !getLabel().equals("")) { <END> labelWidget = new Label(composite, SWT.NONE); labelWidget.setText(getLabel() + ":"); if (getToolTip() != null) { labelWidget.setToolTipText(getToolTip()); } } createEditor(composite); addToolTip(composite, getToolTip()); } finally { setNotificationsAllowed(true); } refresh(); }</code><technical_language>Is impossible for getLabel return null? Please Strings.isValid(getLabel) instead</technical_language>

Target:
protected void createControls(final Composite parent, int horizontalSpan) { setNotificationsAllowed(false); try { Composite composite = new Composite(parent, SWT.BORDER); if (fillVertically) { GridLayout layout = ALayout.getZeroMarginLayout(1, false); layout.verticalSpacing = 4; composite.setLayout(layout); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); } else { GridLayout layout = ALayout.getZeroMarginLayout(horizontalSpan, false); layout.verticalSpacing = 4; composite.setLayout(layout); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false); gd.horizontalSpan = horizontalSpan; composite.setLayoutData(gd); } if (isDisplayLabel() && Strings.isValid(getLabel())) { labelWidget = new Label(composite, SWT.NONE); labelWidget.setText(getLabel() + ":"); if (getToolTip() != null) { labelWidget.setToolTipText(getToolTip()); } } createEditor(composite); addToolTip(composite, getToolTip()); } finally { setNotificationsAllowed(true); } refresh(); }
Source:
<code>public <V> V get(final String key) throws IllegalArgumentException { if (!sideEffects.containsKey(key)) { if (!closed) { final RequestMessage msg = RequestMessage.build(Tokens.OPS_GATHER) .addArg(Tokens.ARGS_SIDE_EFFECT, serverSideEffect) .addArg(Tokens.ARGS_SIDE_EFFECT_KEY, key) .addArg(Tokens.ARGS_HOST, host) .processor("traversal").create(); try { <START> final Result result = client.submitAsync(msg).get().one(); <END> sideEffects.put(key, null == result ? null : result.getObject()); if (keys.isEmpty()) keys = new HashSet<>(); keys.add(key); } catch (Exception ex) { final Throwable root = ExceptionUtils.getRootCause(ex); final String exMsg = null == root ? "" : root.getMessage(); if (exMsg.equals("Could not find side-effects for " + serverSideEffect + ".")) sideEffects.put(key, null); else throw new RuntimeException("Could not get keys", root); } } else { sideEffects.put(key, null); } } return (V) sideEffects.get(key); }</code><technical_language>one() suffice. Side-effects aggregated internally returned ResultSet return Result object</technical_language>

Target:
public <V> V get(final String key) throws IllegalArgumentException { if (!sideEffects.containsKey(key)) { if (!closed) { final RequestMessage msg = RequestMessage.build(Tokens.OPS_GATHER) .addArg(Tokens.ARGS_SIDE_EFFECT, serverSideEffect) .addArg(Tokens.ARGS_SIDE_EFFECT_KEY, key) .addArg(Tokens.ARGS_HOST, host) .processor("traversal").create(); try { final Result result = client.submitAsync(msg).get().one(); sideEffects.put(key, null == result ? null : result.getObject()); if (keys.equals(Collections.emptySet())) keys = new HashSet<>(); keys.add(key); } catch (Exception ex) { final Throwable root = ExceptionUtils.getRootCause(ex); final String exMsg = null == root ? "" : root.getMessage(); if (exMsg.equals("Could not find side-effects for " + serverSideEffect + ".")) sideEffects.put(key, null); else throw new RuntimeException("Could not get keys", root); } } else { sideEffects.put(key, null); } } return (V) sideEffects.get(key); }
Source:
<code>private JobInput getJobInput(JobStatus status, String user, List<Constraint> constraints) { JobInput.Builder input = new JobInput.Builder(); input.status(status.name().toUpperCase()); if (user != null) input.owner(user); String id = null; String priority = null; String name = null; for (Constraint constraint : constraints) { String value = constraint.getValue(); switch (constraint.getTargetField()) { case ID: { switch (constraint.getAction()) { case EQUALS: id = getValue(id, value); break; case GREATER_THAN_OR_EQUAL_TO: input.greaterThanId(value); break; case LESS_THAN_OR_EQUAL_TO: input.lowerThanId(value); break; default: <START> ; <END> } } break; case PRIORITY: { priority = getValue(priority, value.toUpperCase()); } break; case NAME: { switch (constraint.getAction()) { case EQUALS: name = getValue(name, value); break; case CONTAINS: name = getValue(name, "*" + value + "*"); break; case STARTS_WITH: name = getValue(name, value + "*"); break; default: ; } } break; } } if (id != null) input.id(id); if (priority != null) input.priority(priority); if (name != null) input.jobName(name); return input.build(); }</code><technical_language>add a break for default case in order consistency in code</technical_language>

Target:
private JobInput getJobInput(JobStatus status, String user, List<Constraint> constraints) { JobInput.Builder input = new JobInput.Builder(); input.status(status.name().toUpperCase()); if (user != null) input.owner(user); String id = null; String priority = null; String name = null; for (Constraint constraint : constraints) { String value = constraint.getValue(); switch (constraint.getTargetField()) { case ID: { switch (constraint.getAction()) { case EQUALS: id = getValue(id, value); break; case GREATER_THAN_OR_EQUAL_TO: input.afterId(value); break; case LESS_THAN_OR_EQUAL_TO: input.beforeId(value); break; default: break; } } break; case PRIORITY: { priority = getValue(priority, value.toUpperCase()); } break; case NAME: { switch (constraint.getAction()) { case EQUALS: name = getValue(name, value); break; case CONTAINS: name = getValue(name, "*" + value + "*"); break; case STARTS_WITH: name = getValue(name, value + "*"); break; default: break; } } break; } } if (id != null) input.id(id); if (priority != null) input.priority(priority); if (name != null) input.jobName(name); return input.build(); }
Source:
<code>public IpPrefix requestDownstreamPrefix(final int interfaceType) { final int index = mDownstreamPrefixMap.indexOfKey(interfaceType); if (index >= 0) { return mDownstreamPrefixMap.valueAt(index); } if (interfaceType == TETHERING_BLUETOOTH) { final IpPrefix prefix = new IpPrefix(BLUETOOTH_PREFIX); updateDownstreamRecord(interfaceType, prefix); return prefix; } final byte[] bytes = {(byte) 0xc0, (byte) 0xa8, 0, 0}; int random = getRandomSubNetId(); for (int i = 0; i < MAX_SUBNET_NUM; i++) { final int subNet = (random + i) & SUBNET_MASK; if <START> (subNet == BLUETOOTH_RESVERED) <END> continue; bytes[2] = (byte) subNet; InetAddress addr; try { addr = InetAddress.getByAddress(bytes); } catch (UnknownHostException e) { throw new IllegalStateException("Invalid address, shouldn't happen.", e); } final IpPrefix prefix = new IpPrefix(addr, DEFAULT_PREFIX_LENGTH); if (prefix.equals(mLastConflictPrefix)) continue; if (getDownstreamType(prefix) != TETHERING_INVALID) continue; if (!isConflictWithUpstream(prefix)) { updateDownstreamRecord(interfaceType, prefix); return prefix; } } return null; }</code><technical_language>some OSes support 0 255 well, excluded</technical_language>

Target:
public IpPrefix requestDownstreamPrefix(final int interfaceType) { final int index = mDownstreamPrefixMap.indexOfKey(interfaceType); if (index >= 0) { return mDownstreamPrefixMap.valueAt(index); } if (interfaceType == TETHERING_BLUETOOTH) { final IpPrefix prefix = new IpPrefix(BLUETOOTH_PREFIX); updateDownstreamPrefix(interfaceType, prefix); return prefix; } final byte[] bytes = mTetheringPrefix.getRawAddress(); int random = getRandomSubNetId(); for (int i = 0; i < MAX_SUBNET_NUM; i++) { final int subNet = (random + i) & BYTE_MASK; if (subNet == BLUETOOTH_RESERVED) continue; bytes[2] = (byte) subNet; final InetAddress addr; try { addr = InetAddress.getByAddress(bytes); } catch (UnknownHostException e) { throw new IllegalStateException("Invalid address, shouldn't happen.", e); } final IpPrefix prefix = new IpPrefix(addr, DEFAULT_PREFIX_LENGTH); if (mLastConflictPrefix != null && isConflictPrefix(prefix, mLastConflictPrefix)) continue; if (isDownstreamPrefixInUse(prefix)) continue; if (!isConflictWithUpstream(prefix)) { updateDownstreamPrefix(interfaceType, prefix); return prefix; } } return null; }
Source:
<code>public void addAll(HyperLogLogPlus other) throws HyperLogLogPlusMergeException { if (other.sizeof() != sizeof()) { throw new HyperLogLogPlusMergeException("Cannot merge estimators of different sizes"); } if ((format == Format.NORMAL) && (other.format == Format.NORMAL)) { registerSet.merge(other.registerSet); return; } if ((format == Format.SPARSE) && (other.format == Format.SPARSE)) { sparseSet = mergeEstimators(other); <START> if (sparseSet.length > (sparseSetThreshold * (SPARSE_SET_TEMP_SET_RATIO + 1)) / SPARSE_SET_TEMP_SET_RATIO) { <END> convertToNormal(); } return; } if ((format == Format.SPARSE) && (other.format == Format.NORMAL)) { convertToNormal(); registerSet.merge(other.registerSet); return; } if ((format == Format.NORMAL) && (other.format == Format.SPARSE)) { other.mergeTempList(); for (int i = 0; i < other.sparseSet.length; i++) { int k = other.sparseSet[i]; int idx = other.getIndex(k, p); int r = other.decodeRunLength(k); registerSet.updateIfGreater(idx, r); } return; } throw new IllegalStateException("Unhandled HLL++ merge combination"); }</code><technical_language>elaborate this change</technical_language>

Target:
public void addAll(HyperLogLogPlus other) throws HyperLogLogPlusMergeException { if (other.sizeof() != sizeof()) { throw new HyperLogLogPlusMergeException("Cannot merge estimators of different sizes"); } if (format == Format.SPARSE) { mergeTempList(); } if (other.format == Format.SPARSE) { other.mergeTempList(); } if ((format == Format.NORMAL) && (other.format == Format.NORMAL)) { registerSet.merge(other.registerSet); return; } if ((format == Format.SPARSE) && (other.format == Format.SPARSE)) { sparseSet = mergeEstimators(other); if (sparseSet.length > sparseSetThreshold) { convertToNormal(); } return; } if ((format == Format.SPARSE) && (other.format == Format.NORMAL)) { convertToNormal(); registerSet.merge(other.registerSet); return; } if ((format == Format.NORMAL) && (other.format == Format.SPARSE)) { for (int i = 0; i < other.sparseSet.length; i++) { int k = other.sparseSet[i]; int idx = other.getIndex(k, p); int r = other.decodeRunLength(k); registerSet.updateIfGreater(idx, r); } return; } throw new IllegalStateException("Unhandled HLL++ merge combination"); }
Source:
<code>public OpenAPI getDocument() throws OpenAPIBuildException { if (mappings.isEmpty() || !isEnabled()) { return null; } else if (mappings.size() == 1) { OpenAPI document = mappings.peekLast().getDocument(); if(document == null) { document = mappings.peekLast().buildDocument(); } return document; <START> } else { <END> List<OpenAPI> docs = new ArrayList<>(); for (OpenApiMapping mapping : mappings) { if(mapping.getDocument() == null) { allDocuments = null; mapping.buildDocument(); } docs.add(mapping.getDocument()); } if(allDocuments == null) { allDocuments = new OpenAPIImpl(); OpenAPIImpl.merge(allDocuments, docs, true); } return allDocuments; } }</code><technical_language>suggestion: else-if else needed return in if-blocks</technical_language>

Target:
public OpenAPI getDocument() throws OpenAPIBuildException { if (mappings.isEmpty() || !isEnabled()) { return null; } if (mappings.size() == 1) { OpenAPI document = mappings.peekLast().getDocument(); if (document == null) { document = mappings.peekLast().buildDocument(); } return document; } List<OpenAPI> docs = new ArrayList<>(); for (OpenApiMapping mapping : mappings) { if (mapping.getDocument() == null) { allDocuments = null; mapping.buildDocument(); } docs.add(mapping.getDocument()); } if (allDocuments == null) { allDocuments = new OpenAPIImpl(); OpenAPIImpl.merge(allDocuments, docs, true); } return allDocuments; }
Source:
<code>public static <T, U extends T> U put(Class<T> type, U object) { <START> if (context == null) <END> return null; context.put(type, object); return object; }</code><technical_language>Brackets please - part of code convention :-)</technical_language>

Target:
public static <T, U extends T> U put(Class<T> type, U object) { if (context == null) { return null; } context.put(type, object); return object; }
Source:
<code>private void showQuickStartTaskPromptIfNecessary() { if (AppPrefs.isQuickStartActive()) { QuickStartTask promptedTask = getPromptedQuickStartTask(); if (promptedTask != null && mQuickStartStore.hasDoneTask(AppPrefs.getSelectedSite(), promptedTask)) { resetQuickStartPromptCounter(); QuickStartMySitePrompts nextPrompt = getNextQuickStartPrompt(); if (nextPrompt != null) { setPromptedQuickStartTask(nextPrompt.getTask()); } else { setPromptedQuickStartTask(null); } } <START> if (shouldShowQuickStartTaskPrompt() && getView() != null) { <END> mQuickStartSnackBarHandler.removeCallbacksAndMessages(null); mQuickStartSnackBarHandler.postDelayed(new Runnable() { @Override public void run() { showQuickStartDialogTaskPrompt(AppPrefs.getNumberOfTimesQuickStartDialogShown() == MAX_NUMBER_OF_TIMES_TO_SHOW_QUICK_START_DIALOG); } }, AUTO_QUICK_START_SNACKBAR_DELAY_MS); } } }</code><technical_language>Is getView() != null required showQuickStartDialogTaskPrompt(boolean) if (!isAdded() || getView() == null) early return</technical_language>

Target:
private void showQuickStartTaskPromptIfNecessary() { if (AppPrefs.isQuickStartActive()) { QuickStartTask promptedTask = getPromptedQuickStartTask(); if (promptedTask != null && mQuickStartStore.hasDoneTask(AppPrefs.getSelectedSite(), promptedTask)) { resetQuickStartPromptCounter(); QuickStartMySitePrompts nextPrompt = getNextQuickStartPrompt(); if (nextPrompt != null) { setPromptedQuickStartTask(nextPrompt.getTask()); } else { setPromptedQuickStartTask(null); } } if (shouldShowQuickStartTaskPrompt()) { mQuickStartSnackBarHandler.removeCallbacksAndMessages(null); mQuickStartSnackBarHandler.postDelayed(new Runnable() { @Override public void run() { showQuickStartDialogTaskPrompt(); } }, AUTO_QUICK_START_SNACKBAR_DELAY_MS); } } }
Source:
<code>public PlanWithProperties visitTableWriter(TableWriterNode node, Context context) { PlanWithProperties source = node.getSource().accept(this, context); Optional<PartitioningScheme> partitioningScheme = node.getPartitioningScheme(); if (partitioningScheme.isPresent() && source.getProperties().getNodePartitioning().isPresent() && partitioningScheme.get().getPartitioning().equals(source.getProperties().getNodePartitioning().get())) { return rebaseAndDeriveProperties(node, source); <START> } <END> if (!partitioningScheme.isPresent() && redistributeWrites) { partitioningScheme = Optional.of(new PartitioningScheme(Partitioning.create(FIXED_ARBITRARY_DISTRIBUTION, ImmutableList.of()), source.getNode().getOutputSymbols())); } if (partitioningScheme.isPresent()) { source = withDerivedProperties( partitionedExchange( idAllocator.getNextId(), REMOTE, source.getNode(), partitioningScheme.get()), source.getProperties()); } return rebaseAndDeriveProperties(node, source); }</code><technical_language>This appears complicated. This if code (with this if next if swapped) essentially boils to: if (!partitioningScheme.isPresent && redistributedWrites) { partitioningScheme = Optional.of(...); } if (partitioningScheme.isPresent()) { source = add exchange source matches partitioningScheme (if already) } return rebaseAndDeriveProperties(node, source); a result, I find this code extremely complicated. Is a write this, @martint</technical_language>

Target:
public PlanWithProperties visitTableWriter(TableWriterNode node, Context context) { PlanWithProperties source = node.getSource().accept(this, context); Optional<PartitioningScheme> partitioningScheme = node.getPartitioningScheme(); if (!partitioningScheme.isPresent() && redistributeWrites) { partitioningScheme = Optional.of(new PartitioningScheme(Partitioning.create(FIXED_ARBITRARY_DISTRIBUTION, ImmutableList.of()), source.getNode().getOutputSymbols())); } if (partitioningScheme.isPresent() && !source.getProperties().isNodePartitionedOn(partitioningScheme.get().getPartitioning(), false)) { source = withDerivedProperties( partitionedExchange( idAllocator.getNextId(), REMOTE, source.getNode(), partitioningScheme.get()), source.getProperties()); } return rebaseAndDeriveProperties(node, source); }
Source:
<code>public BigDecimal convertPressure(BigDecimal value) { if (this == DEFAULT_PRESSURE_UNIT) { return value.setScale(0, RoundingMode.HALF_UP); } else if (this == INHG) { return value.multiply(MBAR_TO_INHG).setScale(2, RoundingMode.HALF_UP); } else { <START> return value.multiply(MBAR_TO_MMHG).setScale(1, RoundingMode.HALF_UP); <END> } }</code><technical_language>precision lost formatting time instead of conversion</technical_language>

Target:
public BigDecimal convertPressure(BigDecimal value) { if (this == DEFAULT_PRESSURE_UNIT) { return value; } else if (this == INHG) { return value.multiply(MBAR_TO_INHG); } else { return value.multiply(MBAR_TO_MMHG); } }
Source:
<code>private void validate() { <START> assertThat(restTemplate, <END> Objects::nonNull, () -> new AxonConfigurationException( "The RestTemplate is a hard requirement and should be provided")); assertThat(messageRoutingInformationEndpoint, name -> Objects.nonNull(name) && !name.equals(""), () -> new AxonConfigurationException( "The messageRoutingInformationEndpoint is a hard requirement and should be provided")); }</code><technical_language>Extraction a separate method</technical_language>

Target:
protected void validate() { super.validate(); assertNonNull(restTemplate, "The RestTemplate is a hard requirement and should be provided"); assertMessageRoutingInfoEndpoint( messageRoutingInformationEndpoint, "The messageRoutingInformationEndpoint is a hard requirement and should be provided" ); }
Source:
<code>public <X> X get(String key) { if (unescape) { Object value = super.get(key); <START> if (value != null && value instanceof String) { <END> return (X) GwtSafeHtmlUtils.htmlUnescape((String) value); } return (X) value; } else { return (X) super.get(key); } }</code><technical_language>null check needed instanceof</technical_language>

Target:
public <X> X get(String key) { if (unescaped) { Object value = super.get(key); if (value instanceof String) { return (X) GwtSafeHtmlUtils.htmlUnescape((String) value); } return (X) value; } else { return (X) super.get(key); } }
Source:
<code><START> public List<EditInfo> parseEditInfos(JsonElement result) throws RestApiException { <END> if (!result.isJsonArray()) { return Collections.singletonList(gson.fromJson(result, EditInfo.class)); } return gson.fromJson(result, TYPE); }</code><technical_language>throws RestApiException necessary</technical_language>

Target:
public List<EditInfo> parseEditInfos(JsonElement result) { if (!result.isJsonArray()) { return Collections.singletonList(gson.fromJson(result, EditInfo.class)); } return gson.fromJson(result, TYPE); }
Source:
<code>public String evaluate( String referer ) { <START> ExternalSearch es_inst = ExternalSearch.getInstance(); <END> return es_inst.identifySearchEngine( referer ); }</code><technical_language>Please change es_inst externalSerach. I some "_" in code camelCase is a more common java convention</technical_language>

Target:
public String evaluate( String referer ) { ExternalSearch externalSearch = ExternalSearch.getInstance(); return externalSearch.identifySearchEngine( referer ); }
Source:
<code>public void onResourceChanged(ResourceChangedEvent event) { ResourceDelta delta = event.getDelta(); Path resourceLocation = delta.getResource().getLocation(); <START> if (project.equals(resourceLocation) && REMOVED == delta.getKind()) { <END> EditorPartPresenter editorPart = editorAgent.getOpenedEditor(getLocation()); editorAgent.closeEditor(editorPart); removeHandlers(); } }</code><technical_language>Check for delta kind first, for equality of resources. faster this condition</technical_language>

Target:
public void onResourceChanged(ResourceChangedEvent event) { ResourceDelta delta = event.getDelta(); Path resourceLocation = delta.getResource().getLocation(); if (REMOVED == delta.getKind() && project.equals(resourceLocation)) { EditorPartPresenter editorPart = editorAgent.getOpenedEditor(getLocation()); editorAgent.closeEditor(editorPart); removeHandlers(); } }
Source:
<code>AsyncNonMetaRegionLocator(AsyncConnectionImpl conn) { this.conn = conn; this.maxConcurrentLocateRequestPerTable = conn.getConfiguration().getInt( MAX_CONCURRENT_LOCATE_REQUEST_PER_TABLE, DEFAULT_MAX_CONCURRENT_LOCATE_REQUEST_PER_TABLE); this.locatePrefetchLimit = conn.getConfiguration().getInt(LOCATE_PREFETCH_LIMIT, DEFAULT_LOCATE_PREFETCH_LIMIT); this.metaReplicaMode = CatalogReplicaMode.valueOf(conn.getConfiguration() .get(LOCATOR_META_REPLICAS_MODE, CatalogReplicaMode.None.toString())); switch (this.metaReplicaMode) { case LoadBalance: String replicaSelectorClass = conn.getConfiguration(). get(RegionLocator.LOCATOR_META_REPLICAS_MODE_LOADBALANCE_SELECTOR, CatalogReplicaLoadBalanceReplicaSimpleSelector.class.getName()); this.metaReplicaSelector = CatalogReplicaLoadBalanceReplicaSelectorFactory.createSelector( replicaSelectorClass, META_TABLE_NAME, conn); break; case None: if (this.metaReplicaMode == CatalogReplicaMode.None) { <START> boolean userMetaReplicas = conn.getConfiguration().getBoolean(USE_META_REPLICAS, <END> DEFAULT_USE_META_REPLICAS); if (userMetaReplicas) { this.metaReplicaMode = CatalogReplicaMode.HedgedRead; } } break; default: } }</code><technical_language>name? s/userMetaReplicas/useMetaReplicas/</technical_language>

Target:
AsyncNonMetaRegionLocator(AsyncConnectionImpl conn) { this.conn = conn; this.maxConcurrentLocateRequestPerTable = conn.getConfiguration().getInt( MAX_CONCURRENT_LOCATE_REQUEST_PER_TABLE, DEFAULT_MAX_CONCURRENT_LOCATE_REQUEST_PER_TABLE); this.locatePrefetchLimit = conn.getConfiguration().getInt(LOCATE_PREFETCH_LIMIT, DEFAULT_LOCATE_PREFETCH_LIMIT); this.metaReplicaMode = CatalogReplicaMode.fromString(conn.getConfiguration() .get(LOCATOR_META_REPLICAS_MODE, CatalogReplicaMode.NONE.toString())); switch (this.metaReplicaMode) { case LOAD_BALANCE: String replicaSelectorClass = conn.getConfiguration(). get(RegionLocator.LOCATOR_META_REPLICAS_MODE_LOADBALANCE_SELECTOR, CatalogReplicaLoadBalanceSimpleSelector.class.getName()); this.metaReplicaSelector = CatalogReplicaLoadBalanceSelectorFactory.createSelector( replicaSelectorClass, META_TABLE_NAME, conn, () -> { int numOfReplicas = 1; try { RegionLocations metaLocations = conn.registry.getMetaRegionLocations().get( conn.connConf.getReadRpcTimeoutNs(), TimeUnit.NANOSECONDS); numOfReplicas = metaLocations.size(); } catch (Exception e) { LOG.error("Failed to get table {}'s region replication, ", META_TABLE_NAME, e); } return numOfReplicas; }); break; case NONE: boolean useMetaReplicas = conn.getConfiguration().getBoolean(USE_META_REPLICAS, DEFAULT_USE_META_REPLICAS); if (useMetaReplicas) { this.metaReplicaMode = CatalogReplicaMode.HEDGED_READ; } break; default: } }
Source:
<code>public String toString() { StringBuilder buf = new StringBuilder(); buf.append("HunkHeader["); buf.append(getOldImage().getStartLine() + "," <START> + getOldImage().getLineCount()); <END> buf.append("->"); buf.append(getNewStartLine() + "," + getNewLineCount()); buf.append("]"); return buf.toString(); }</code><technical_language>break this 3 append calls, instead of creating intermediate String</technical_language>

Target:
public String toString() { StringBuilder buf = new StringBuilder(); buf.append("HunkHeader["); buf.append(getOldImage().getStartLine()); buf.append(','); buf.append(getOldImage().getLineCount()); buf.append("->"); buf.append(getNewStartLine()).append(',').append(getNewLineCount()); buf.append(']'); return buf.toString(); }
Source:
<code>public TInterface findByNumber(UID uidBusiness, String number) { JPAGenericInvoiceEntity invoice = this.queryInvoice(uidBusiness.toString(), number).findOne(); if (!(invoice instanceof PTGenericInvoiceEntity)) { <START> return null; <END> } return (TInterface) invoice; }</code><technical_language>I previous code returned [NoResultException](<LINK_0> returns null Is this want</technical_language>

Target:
public TInterface findByNumber(UID uidBusiness, String number) { JPAGenericInvoiceEntity invoice = this.queryInvoice(uidBusiness.toString(), number).findOne(); if (!(invoice instanceof PTGenericInvoiceEntity)) { throw new RuntimeException("Invoice number " + number + " of business " + uidBusiness + " is not of class " + PTGenericInvoiceEntity.class.getSimpleName()); } return (TInterface) invoice; }
Source:
<code>public void executeSQL_shouldReturnNullGivenNull() { adminService.executeSQL(null, true); <START> verify(adminDAO, never()).executeSQL("was never called", true); <END> }</code><technical_language>want verify executeSQL is called all. parameter I told wrong Please replace verify(adminDAO, never()).executeSQL(anyString(), anyBoolean()); this ensure method is called matter parameters</technical_language>

Target:
public void executeSQL_shouldReturnNullGivenNull() { adminService.executeSQL(null, true); verify(adminDAO, never()).executeSQL(anyString(), anyBoolean()); }
Source:
<code>private <T extends Timestamped> T deserialize(StorageObject object, Class<T> clas, boolean current_version) throws java.io.UnsupportedEncodingException { try { ByteArrayOutputStream output = new java.io.ByteArrayOutputStream(); Storage.Objects.Get getter = obj_api.get(object.getBucket(), object.getName()); if (!current_version) { getter.setGeneration(object.getGeneration()); } Closure timeExecuteClosure = new Closure<String>(this, this) { public Object doCall() throws Exception { mediaDownloadTimer.record(new Callable() { public Void call() throws Exception { getter.executeMediaAndDownloadTo(output); return null; } }); return Closure.DONE; } }; doRetry(timeExecuteClosure, "deserialize", object.getName()); String json = output.toString("UTF8"); return objectMapper.readValue(json, clas); } catch (Exception ex) { if (current_version) { log.error("Error reading {}: {}", value("object", object.getName()), ex.getMessage()); } else { log.error("Error reading generation={}: {}", value("object", object.getName()), value("generation", object.getGeneration()), <START> ex.getMessage()); <END> } return null; } }</code><technical_language>rethrow here, is valuable print more message include stack trace</technical_language>

Target:
private <T extends Timestamped> T deserialize(StorageObject object, Class<T> clas, boolean current_version) throws java.io.UnsupportedEncodingException { try { ByteArrayOutputStream output = new java.io.ByteArrayOutputStream(); Storage.Objects.Get getter = obj_api.get(object.getBucket(), object.getName()); if (!current_version) { getter.setGeneration(object.getGeneration()); } Closure timeExecuteClosure = new Closure<String>(this, this) { public Object doCall() throws Exception { mediaDownloadTimer.record(new Callable() { public Void call() throws Exception { getter.executeMediaAndDownloadTo(output); return null; } }); return Closure.DONE; } }; doRetry(timeExecuteClosure, "deserialize", object.getName()); String json = output.toString("UTF8"); return objectMapper.readValue(json, clas); } catch (Exception ex) { if (current_version) { log.error("Error reading {}: ", value("object", object.getName()), ex); } else { log.error("Error reading generation={}: ", value("object", object.getName()), value("generation", object.getGeneration()), ex); } return null; } }
Source:
<code>private void verifyDeleteFailure(MockId idToDelete, StoreErrorCodes expectedErrorCode) { <START> short accoundId = accountIdMap.containsKey(idToDelete) == true ? accountIdMap.get(idToDelete) <END> : Utils.getRandomShort(TestUtils.RANDOM); short containerId = containerIdMap.containsKey(idToDelete) == true ? containerIdMap.get(idToDelete) : Utils.getRandomShort(TestUtils.RANDOM); MessageInfo info = new MessageInfo(idToDelete, DELETE_RECORD_SIZE, accoundId, containerId, System.currentTimeMillis()); MessageWriteSet writeSet = new MockMessageWriteSet(Collections.singletonList(info), Collections.singletonList(ByteBuffer.allocate(1))); try { store.delete(writeSet); fail("Store DELETE should have failed"); } catch (StoreException e) { assertEquals("Unexpected StoreErrorCode", expectedErrorCode, e.getErrorCode()); } }</code><technical_language>understand this - do this</technical_language>

Target:
private void verifyDeleteFailure(MockId idToDelete, StoreErrorCodes expectedErrorCode) throws StoreException { short accoundId = accountIdMap.containsKey(idToDelete) == true ? accountIdMap.get(idToDelete) : Utils.getRandomShort(TestUtils.RANDOM); short containerId = containerIdMap.containsKey(idToDelete) == true ? containerIdMap.get(idToDelete) : Utils.getRandomShort(TestUtils.RANDOM); MessageInfo info = new MessageInfo(idToDelete, DELETE_RECORD_SIZE, accoundId, containerId, System.currentTimeMillis()); MessageWriteSet writeSet = new MockMessageWriteSet(Collections.singletonList(info), Collections.singletonList(ByteBuffer.allocate(1))); if (store.getStoreConfig().storeDeleteAuthorizationCheck == true) { try { store.delete(writeSet); fail("Store DELETE should have failed"); } catch (StoreException e) { assertEquals("Unexpected StoreErrorCode", expectedErrorCode, e.getErrorCode()); } } }
Source:
<code>public void testValidateQuestionDetails_duplicateMcqOptions_errorReturned() { <START> FeedbackMcqQuestionDetails mcqDetails = new FeedbackMcqQuestionDetails(); <END> Map<String, String[]> requestParams = new HashMap<>(); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_TYPE, new String[] { "MCQ" }); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_TEXT, new String[] { "mcq question text" }); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_MCQ_GENERATED_OPTIONS, new String[] { "NONE" }); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFCHOICECREATED, new String[] { "2" }); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_MCQCHOICE + "-0", new String[] { "Choice 1" }); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_MCQCHOICE + "-1", new String[] { "Choice 1" }); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_MCQ_HAS_WEIGHTS_ASSIGNED, new String[] { "off" }); assertTrue(mcqDetails.extractQuestionDetails(requestParams, FeedbackQuestionType.MCQ)); List<String> errors = mcqDetails.validateQuestionDetails(dummySessionToken); assertEquals(1, errors.size()); assertEquals(Const.FeedbackQuestion.MCQ_ERROR_DUPLICATE_MCQ_OPTION, errors.get(0)); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_MCQCHOICE + "-1", new String[] { " Choice 1 " }); assertTrue(mcqDetails.extractQuestionDetails(requestParams, FeedbackQuestionType.MCQ)); errors = mcqDetails.validateQuestionDetails(dummySessionToken); assertEquals(1, errors.size()); assertEquals(Const.FeedbackQuestion.MCQ_ERROR_DUPLICATE_MCQ_OPTION, errors.get(0)); }</code><technical_language>BTW, test method validateQuestionDetails. extractQuestionDetails is deprecated in V7 now</technical_language>

Target:
public void testValidateQuestionDetails_duplicateMcqOptions_errorReturned() { FeedbackMcqQuestionDetails mcqDetails = new FeedbackMcqQuestionDetails(); mcqDetails.setNumOfMcqChoices(2); mcqDetails.setMcqChoices(Arrays.asList("choice 1", "choice 1")); List<String> errors = mcqDetails.validateQuestionDetails(dummySessionToken); assertEquals(1, errors.size()); assertEquals(Const.FeedbackQuestion.MCQ_ERROR_DUPLICATE_MCQ_OPTION, errors.get(0)); mcqDetails.setMcqChoices(Arrays.asList("choice 1", " choice 1 ")); errors = mcqDetails.validateQuestionDetails(dummySessionToken); assertEquals(1, errors.size()); assertEquals(Const.FeedbackQuestion.MCQ_ERROR_DUPLICATE_MCQ_OPTION, errors.get(0)); }
Source:
<code>private JoinBridgeAndLifecycle<T> data(Lifespan lifespan) { checkArgument(!Lifespan.taskWide().equals(lifespan)); return map.computeIfAbsent(lifespan, span -> { T joinBridge = joinBridgeProvider.apply(span); return new JoinBridgeAndLifecycle<>(joinBridge, new JoinLifecycle(joinBridge, probeFactoryCount, outerFactoryCount)); }); <START> } <END></code><technical_language>nit: call method name data , instead of, say, joinBridgeAndLifecycle getJoinBridgeAndLifecycle ? :)</technical_language>

Target:
private JoinBridgeAndLifecycle<T> data(Lifespan lifespan) { checkArgument(!Lifespan.taskWide().equals(lifespan)); return joinBridgeMap.computeIfAbsent(lifespan, span -> { T joinBridge = joinBridgeProvider.apply(span); return new JoinBridgeAndLifecycle<>(joinBridge, new JoinLifecycle(joinBridge, probeFactoryCount, outerFactoryCount)); }); }
Source:
<code>private VDS getAlternateUpServerInCluster(Guid clusterId, Guid vdsId) { List<VDS> vdsList = getVdsDao().getAllForVdsGroupWithStatus(clusterId, VDSStatus.Up); <START> if (vdsList != null && vdsList.size() > 0) { <END> for (VDS vds : vdsList) { if (!vdsId.equals(vds.getId())) { return vds; } } } return null; }</code><technical_language>vdsList null contract of dao for fetching collections. Please replace if (!vdsList.isEmpty())</technical_language>

Target:
private VDS getAlternateUpServerInCluster(Guid clusterId, Guid vdsId) { List<VDS> vdsList = getVdsDao().getAllForVdsGroupWithStatus(clusterId, VDSStatus.Up); if (vdsList.isEmpty()) { return null; } for (VDS vds : vdsList) { if (!vdsId.equals(vds.getId())) { return vds; } } return null; }
Source:
<code>public String associateAddress(NodeMetadata node) { IaasProvider iaasInfo = getIaasProvider(); ComputeServiceContext context = iaasInfo.getComputeService().getContext(); CloudStackApi cloudStackApi = context.unwrapApi(CloudStackApi.class); String ip = null; ListPublicIPAddressesOptions listPublicIPAddressesOptions = new ListPublicIPAddressesOptions(); listPublicIPAddressesOptions.zoneId(iaasInfo.getProperty(CloudControllerConstants.AVAILABILITY_ZONE)); Set<PublicIPAddress> publicIPAddresses = cloudStackApi.getAddressApi() .listPublicIPAddresses(listPublicIPAddressesOptions); String id = node.getProviderId(); for (PublicIPAddress publicIPAddress : publicIPAddresses) { if (publicIPAddress.getVirtualMachineId().equals(id)) { ip = publicIPAddress.getIPAddress(); <START> log.debug("Successfully associated an IP address " + ip <END> + " for node with id: " + node.getId()); break; } } if (ip == null || ip.isEmpty()) { String msg = "No address associated for node with id: " + node.getId(); log.debug(msg); throw new CloudControllerException(msg); } return ip; }</code><technical_language>this needs info log? WDYT</technical_language>

Target:
public String associateAddress(NodeMetadata node) { IaasProvider iaasInfo = getIaasProvider(); ComputeServiceContext context = iaasInfo.getComputeService().getContext(); CloudStackApi cloudStackApi = context.unwrapApi(CloudStackApi.class); String ip = null; ListPublicIPAddressesOptions listPublicIPAddressesOptions = new ListPublicIPAddressesOptions(); listPublicIPAddressesOptions.zoneId(iaasInfo.getProperty(CloudControllerConstants.AVAILABILITY_ZONE)); Set<PublicIPAddress> publicIPAddresses = cloudStackApi.getAddressApi() .listPublicIPAddresses(listPublicIPAddressesOptions); String id = node.getProviderId(); for (PublicIPAddress publicIPAddress : publicIPAddresses) { if (publicIPAddress.getVirtualMachineId().equals(id)) { ip = publicIPAddress.getIPAddress(); log.info("Successfully associated an IP address " + ip + " for node with id: " + node.getId()); break; } } if (ip == null || ip.isEmpty()) { String msg = "No address associated for node with id: " + node.getId(); log.warn(msg); throw new CloudControllerException(msg); } return ip; }
Source:
<code>public ListenableFuture<LabelMeta> getLabelMeta(final LabelType type, final LabelId id) { return transform(labelClient.getLabelName(type, id), new AsyncFunction<Optional<String>, LabelMeta>() { @Override public ListenableFuture<LabelMeta> apply(final Optional<String> name) throws Exception { if (name.isPresent()) { <START> return store.getMeta(id, type); <END> } throw new LabelException(id, type, "Could not find label."); } }); }</code><technical_language>This method removed. annotation methods</technical_language>

Target:
public ListenableFuture<LabelMeta> getLabelMeta(final LabelType type, final LabelId id) { return transform(labelClient.getLabelName(type, id), new AsyncFunction<Optional<String>, LabelMeta>() { @Override public ListenableFuture<LabelMeta> apply(final Optional<String> name) throws Exception { if (name.isPresent()) { return store.getMeta(id, type); } return immediateFailedFuture(new LabelException(id, type, "Could not find label meta information for id " + id + " and " + type)); } }); }
Source:
<code>public Tag create(final JsonObject params) throws IOException { final Directives dirs = new Directives().xpath(this.xpath()).add("tag"); final Set<String> keys = params.keySet(); final Iterator<String> iterator = keys.iterator(); <START> while (iterator.hasNext()) { <END> final String key = iterator.next(); if (params.get(key).toString().contains("}")) { dirs.add(key).set(params.get(key).toString()).up(); } else { dirs.add(key).set(params.getString(key)).up(); } } this.storage.apply(dirs); final References refs = new MkReferences( this.storage, this.self, this.coords ); final StringBuilder builder = new StringBuilder(); builder.append("refs/tags/").append(params.getString("name")); refs.create(builder.toString(), params.getString("sha")); return this.get(params.getString("sha")); }</code><technical_language>brrr, complicated? for (String key : params.keySet())</technical_language>

Target:
public Tag create(final JsonObject params) throws IOException { final Directives dirs = new Directives().xpath(this.xpath()).add("tag"); for (final Entry<String, JsonValue> entry : params.entrySet()) { dirs.add(entry.getKey()).set(entry.getValue().toString()).up(); } this.storage.apply(dirs); new MkReferences(this.storage, this.self, this.coords).create( new StringBuilder().append("refs/tags/").append( params.getString("name") ).toString(), params.getString("sha") ); return this.get(params.getString("sha")); }
Source:
<code>public void test_reuse_cluster_sender() throws InterruptedException { Microservices micro = Microservices.builder() .services(new GreetingServiceImpl()) .reuseClusterTransport(true) .build(); GreetingService service = micro.proxy().api(GreetingService.class).create(); CountDownLatch latch = new CountDownLatch(1); service.greeting("joe").whenComplete((result, error) -> { if (error == null) { latch.countDown(); } }); assertTrue(!micro.services().isEmpty()); ServiceInstance instance = micro.services().stream().findFirst().get(); assertEquals(instance.address(), micro.cluster().address()); assertEquals(instance.serviceName(), "io.scalecube.services.GreetingService"); <START> latch.await(1, TimeUnit.SECONDS); <END> micro.shutdown(); }</code><technical_language>need check latch</technical_language>

Target:
public void test_reuse_cluster_sender() throws InterruptedException { Microservices micro = Microservices.builder() .services(new GreetingServiceImpl()) .reuseClusterTransport(true) .build(); GreetingService service = micro.proxy().api(GreetingService.class).create(); CountDownLatch latch = new CountDownLatch(1); service.greeting("joe").whenComplete((result, error) -> { if (error == null) { latch.countDown(); } }); assertTrue(!micro.services().isEmpty()); ServiceInstance instance = micro.services().stream().findFirst().get(); assertEquals(instance.address(), micro.cluster().address()); assertEquals(instance.serviceName(), "io.scalecube.services.GreetingService"); latch.await(1, TimeUnit.SECONDS); assertTrue(latch.getCount() == 0); micro.shutdown(); }
Source:
<code>private void setupAppList() { Context activity = getActivity(); PackageManager pm = activity.getPackageManager(); List<ApplicationInfo> list = pm.getInstalledApplications(0); boolean showSystemApp = Settings.uiPref.getBoolean("show_system_apps", false); boolean showAppWithAds = Settings.uiPref.getBoolean("show_apps_with_ads", false); itemList = new ArrayList<Map<String, Object>>(); for(ApplicationInfo info : list) { if(showSystemApp || ((info.flags & ApplicationInfo.FLAG_SYSTEM) == 0)) { Map<String, Object> map = new HashMap<String, Object>(); map.put("title", pm.getApplicationLabel(info)); map.put("key", info.packageName); map.put("icon", pm.getApplicationIcon(info)); String ads = adPref.getString(info.packageName, ""); map.put("summary", ads); <START> if (ads.length > 0) { <END> itemList.add(map); } else { if (!showAppWithAds) { itemList.add(map); } } } } Collections.sort(itemList, new Comparator<Map<String, Object>>() { @Override public int compare(Map<String, Object> lhs, Map<String, Object> rhs) { String s1 = (String) lhs.get("title"); String s2 = (String) rhs.get("title"); return s1.compareToIgnoreCase(s2); } }); }</code><technical_language>I this section of code more neat java if(!showAppWithAds || (showAppWithAds && map.get("summary").length > 0)) { itemList.add(map); }</technical_language>

Target:
private void setupAppList() { Context activity = getActivity(); PackageManager pm = activity.getPackageManager(); List<ApplicationInfo> list = pm.getInstalledApplications(0); boolean showSystemApp = Settings.uiPref.getBoolean("show_system_apps", false); boolean showAppWithAds = Settings.uiPref.getBoolean("show_apps_with_ads", false); itemList = new ArrayList<Map<String, Object>>(); for(ApplicationInfo info : list) { if(showSystemApp || ((info.flags & ApplicationInfo.FLAG_SYSTEM) == 0)) { Map<String, Object> map = new HashMap<String, Object>(); map.put("title", pm.getApplicationLabel(info)); map.put("key", info.packageName); map.put("icon", pm.getApplicationIcon(info)); String ads = adPref.getString(info.packageName, ""); map.put("summary", ads); if (!showAppWithAds || (showAppWithAds && ads.length() > 0)) { itemList.add(map); } } } Collections.sort(itemList, new Comparator<Map<String, Object>>() { @Override public int compare(Map<String, Object> lhs, Map<String, Object> rhs) { String s1 = (String) lhs.get("title"); String s2 = (String) rhs.get("title"); return s1.compareToIgnoreCase(s2); } }); }
Source:
<code>private Expression replaceAliases(Expression condition, List<? extends NamedExpression> named) { List<Alias> aliases = new ArrayList<>(); named.forEach(n -> { if (n instanceof Alias) { aliases.add((Alias) n); } }); return condition.transformDown(u -> { boolean qualified = u.qualifier() != null; for (Alias alias : aliases) { if (qualified ? Objects.equals(alias.qualifiedName(), u.qualifiedName()) : Objects.equals(alias.name(), u.name()) <START> && !(alias.child() instanceof UnresolvedAttribute && Objects.equals(((UnresolvedAttribute) alias.child()).name(), alias.name()))) { <END> return alias; } } return u; }, UnresolvedAttribute.class); }</code><technical_language>suggestion && (alias.child().resolved() == true)) {</technical_language>

Target:
private Expression replaceAliases(Expression condition, List<? extends NamedExpression> named) { List<Alias> aliases = new ArrayList<>(); named.forEach(n -> { if (n instanceof Alias) { Alias a = (Alias) n; if ((a.child() instanceof UnresolvedAttribute && Objects.equals(((UnresolvedAttribute) a.child()).name(),a.name())) == false) { aliases.add(a); } } }); return condition.transformDown(u -> { boolean qualified = u.qualifier() != null; for (Alias alias : aliases) { if (qualified ? Objects.equals(alias.qualifiedName(), u.qualifiedName()) : Objects.equals(alias.name(), u.name())) { return alias; } } return u; }, UnresolvedAttribute.class); }
Source:
<code>public void enterParameterClause(SwiftParser.ParameterClauseContext ctx) { <START> verifier.verifyParenthesisContentWhitespace(ctx); <END> }</code><technical_language>this work if ... is parameterList</technical_language>

Target:
public void enterParameterClause(SwiftParser.ParameterClauseContext ctx) { verifier.verifyBracketContentWhitespace(ctx, Messages.PARENTHESES); }