auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void setSummaries(@NonNull Activity activity, @NonNull SuggestedEditsSummary sourceSummary, SuggestedEditsSummary targetSummary) { this.activity = activity; suggestedEditsSummary = isTranslationEdit ? targetSummary : sourceSummary; pageSummaryContainer.setVisibility(View.VISIBLE); labelText.setText(getLabelText(sourceSummary.getLang())); pageSummaryText.setText(StringUtil.strip(StringUtils.capitalize(StringUtil.removeHTMLTags(isTranslationEdit || invokeSource == SUGGESTED_EDITS_ADD_CAPTION || invokeSource == FEED_CARD_SUGGESTED_EDITS_IMAGE_CAPTION ? sourceSummary.getDescription() : sourceSummary.getExtractHtml())))); <START> if (pageSummaryText.getText().equals(getContext().getString(R.string.suggested_edits_no_description))) { <END> pageSummaryContainer.setVisibility(GONE); } setConditionalLayoutDirection(pageSummaryContainer, (isTranslationEdit) ? sourceSummary.getLang() : pageTitle.getWikiSite().languageCode()); setUpBottomBar(); }</code><technical_language>This feels kind of weird. pass R.string.suggested_edits_no_description this view with, check if empty here</technical_language>

Target:
public void setSummaries(@NonNull Activity activity, @NonNull SuggestedEditsSummary sourceSummary, SuggestedEditsSummary targetSummary) { this.activity = activity; suggestedEditsSummary = isTranslationEdit ? targetSummary : sourceSummary; pageSummaryContainer.setVisibility(View.VISIBLE); labelText.setText(getLabelText(sourceSummary.getLang())); pageSummaryText.setText(StringUtil.strip(StringUtils.capitalize(StringUtil.removeHTMLTags(isTranslationEdit || invokeSource == SUGGESTED_EDITS_ADD_CAPTION || invokeSource == FEED_CARD_SUGGESTED_EDITS_IMAGE_CAPTION ? sourceSummary.getDescription() : sourceSummary.getExtractHtml())))); if (pageSummaryText.getText().toString().isEmpty()) { pageSummaryContainer.setVisibility(GONE); } setConditionalLayoutDirection(pageSummaryContainer, (isTranslationEdit) ? sourceSummary.getLang() : pageTitle.getWikiSite().languageCode()); setUpBottomBar(); }
Source:
<code>public Event(CompletionTime completionTime, String eventSource) { if (null == eventSource || eventSource.isEmpty()) { throw new IllegalStateException("Cannot determine the event source"); } this.context = new HashMap<>(1); this.context.put("id", completionTime.getId()); this.tags = new HashMap<>(); if (null != completionTime.getUri()) { this.tags.put("uri", completionTime.getUri()); } <START> this.tags.put("operation", completionTime.getOperation()); <END> Set<Property> properties = completionTime.getProperties(); if (properties != null && properties.size() > 0) { properties.forEach(p -> { String value = this.tags.get(p.getName()); this.tags.put(p.getName(), value == null ? p.getValue() : String.format("%s,%s", value, p.getValue())); }); } this.dataId = eventSource; this.category = "APM"; this.dataSource = completionTime.getHostName(); this.id = UUID.randomUUID().toString(); this.ctime = completionTime.getTimestamp(); this.text = Long.toString(completionTime.getDuration()); }</code><technical_language>check for null operation aswell - is optional</technical_language>

Target:
public Event(CompletionTime completionTime, String eventSource) { if (null == eventSource || eventSource.isEmpty()) { throw new IllegalStateException("Cannot determine the event source"); } this.context = new HashMap<>(1); this.context.put("id", completionTime.getId()); this.tags = new HashMap<>(); if (null != completionTime.getUri()) { this.tags.put("uri", completionTime.getUri()); } if (null != completionTime.getOperation()) { this.tags.put("operation", completionTime.getOperation()); } Set<Property> properties = completionTime.getProperties(); if (properties != null && properties.size() > 0) { properties.forEach(p -> { String value = this.tags.get(p.getName()); this.tags.put(p.getName(), value == null ? p.getValue() : String.format("%s,%s", value, p.getValue())); }); } this.dataId = eventSource; this.category = "APM"; this.dataSource = completionTime.getHostName(); this.id = UUID.randomUUID().toString(); this.ctime = completionTime.getTimestamp(); this.text = Long.toString(completionTime.getDuration()); }
Source:
<code>private void execute() { if (fFinishedLatch.getCount() == 0) { return; } synchronized (syncObj) { if (fStarted) { return; } fStarted = true; } if (fTrace != null) { fTrace.notifyPendingRequest(true); setNotifyRequestNeeded(true); } fJob = new Job(NLS.bind(Messages.TmfAbstractAnalysisModule_RunningAnalysis, getName())) { @Override protected IStatus run(final IProgressMonitor monitor) { try { monitor.beginTask("", IProgressMonitor.UNKNOWN); broadcast(new TmfStartAnalysisSignal(TmfAbstractAnalysisModule.this, TmfAbstractAnalysisModule.this)); fAnalysisCancelled = !executeAnalysis(monitor); if ((fTrace != null) && isNotifyRequestNeeded()) { fTrace.notifyPendingRequest(false); <START> setNotifyRequestNeeded(false); <END> } } catch (TmfAnalysisException e) { Activator.logError("Error executing analysis with trace " + getTrace().getName(), e); } finally { synchronized (syncObj) { monitor.done(); setAnalysisCompleted(); } } if (!fAnalysisCancelled) { return Status.OK_STATUS; } return Status.CANCEL_STATUS; } @Override protected void canceling() { TmfAbstractAnalysisModule.this.canceling(); } }; fJob.schedule(); }</code><technical_language>This true right now, setNofityRequestNeeded(false) in buildManually of history builder. this adds, more call module developer make, avoid calling this twice</technical_language>

Target:
private void execute() { if (fFinishedLatch.getCount() == 0) { return; } synchronized (syncObj) { if (fStarted) { return; } fStarted = true; } if (fTrace != null) { fTrace.notifyPendingRequest(true); setNotifyPendingReqNeeded(true); } fJob = new Job(NLS.bind(Messages.TmfAbstractAnalysisModule_RunningAnalysis, getName())) { @Override protected IStatus run(final IProgressMonitor monitor) { try { monitor.beginTask("", IProgressMonitor.UNKNOWN); broadcast(new TmfStartAnalysisSignal(TmfAbstractAnalysisModule.this, TmfAbstractAnalysisModule.this)); fAnalysisCancelled = !executeAnalysis(monitor); if ((fTrace != null) && isNotifyPendingReqNeeded()) { fTrace.notifyPendingRequest(false); setNotifyPendingReqNeeded(false); } } catch (TmfAnalysisException e) { Activator.logError("Error executing analysis with trace " + getTrace().getName(), e); } finally { synchronized (syncObj) { monitor.done(); setAnalysisCompleted(); } } if (!fAnalysisCancelled) { return Status.OK_STATUS; } return Status.CANCEL_STATUS; } @Override protected void canceling() { TmfAbstractAnalysisModule.this.canceling(); } }; fJob.schedule(); }
Source:
<code>private FileSystem getInternal(URI uri, Configuration conf, Key key) throws IOException{ FileSystem fs; synchronized (this) { fs = map.get(key); } if (fs != null) { return fs; } try (DurationInfo d = new DurationInfo(LOGGER, false, "Acquiring creator semaphore for %s", uri)) { creatorPermits.acquire(); } catch (InterruptedException e) { throw (IOException)new InterruptedIOException(e.toString()) .initCause(e); } FileSystem fsToClose = null; try { synchronized (this) { fs = map.get(key); } if (fs != null) { LOGGER.debug("Filesystem created while awaiting semaphore", uri); return fs; } fs = createFileSystem(uri, conf); final long timeout = conf.getTimeDuration(SERVICE_SHUTDOWN_TIMEOUT, SERVICE_SHUTDOWN_TIMEOUT_DEFAULT, ShutdownHookManager.TIME_UNIT_DEFAULT); synchronized (this) { FileSystem oldfs = map.get(key); if (oldfs != null) { fsToClose = fs; fs = oldfs; } else { if (map.isEmpty() && !ShutdownHookManager.get().isShutdownInProgress()) { ShutdownHookManager.get().addShutdownHook(clientFinalizer, SHUTDOWN_HOOK_PRIORITY, timeout, ShutdownHookManager.TIME_UNIT_DEFAULT); } fs.key = key; map.put(key, fs); if (conf.getBoolean( FS_AUTOMATIC_CLOSE_KEY, FS_AUTOMATIC_CLOSE_DEFAULT)) { toAutoClose.add(key); } } } } finally { creatorPermits.release(); } if (fsToClose != null) { LOGGER.debug("Duplicate FS created for {}; discarding {}", uri, fs); discardedInstances.incrementAndGet(); <START> fsToClose.close(); <END> } return fs; }</code><technical_language>if close() throw IOException ? cached object, return that</technical_language>

Target:
private FileSystem getInternal(URI uri, Configuration conf, Key key) throws IOException{ FileSystem fs; synchronized (this) { fs = map.get(key); } if (fs != null) { return fs; } try (DurationInfo d = new DurationInfo(LOGGER, false, "Acquiring creator semaphore for %s", uri)) { creatorPermits.acquire(); } catch (InterruptedException e) { throw (IOException)new InterruptedIOException(e.toString()) .initCause(e); } FileSystem fsToClose = null; try { synchronized (this) { fs = map.get(key); } if (fs != null) { LOGGER.debug("Filesystem created while awaiting semaphore", uri); return fs; } fs = createFileSystem(uri, conf); final long timeout = conf.getTimeDuration(SERVICE_SHUTDOWN_TIMEOUT, SERVICE_SHUTDOWN_TIMEOUT_DEFAULT, ShutdownHookManager.TIME_UNIT_DEFAULT); synchronized (this) { FileSystem oldfs = map.get(key); if (oldfs != null) { fsToClose = fs; fs = oldfs; } else { if (map.isEmpty() && !ShutdownHookManager.get().isShutdownInProgress()) { ShutdownHookManager.get().addShutdownHook(clientFinalizer, SHUTDOWN_HOOK_PRIORITY, timeout, ShutdownHookManager.TIME_UNIT_DEFAULT); } fs.key = key; map.put(key, fs); if (conf.getBoolean( FS_AUTOMATIC_CLOSE_KEY, FS_AUTOMATIC_CLOSE_DEFAULT)) { toAutoClose.add(key); } } } } finally { creatorPermits.release(); } if (fsToClose != null) { LOGGER.debug("Duplicate FS created for {}; discarding {}", uri, fs); discardedInstances.incrementAndGet(); IOUtils.cleanupWithLogger(LOGGER, fsToClose); } return fs; }
Source:
<code>protected void map( Object key, Object value, Context context ) throws IOException, InterruptedException { try { final InputRow inputRow = parseInputRow(value, parser); if (!granularitySpec.bucketIntervals().isPresent() || granularitySpec.bucketInterval(new DateTime(inputRow.getTimestampFromEpoch())) .isPresent()) { innerMap(inputRow, value, context); } } catch (ParseException e) { <START> if (config.isIgnoreInvalidRows()) { <END> log.debug(e, "Ignoring invalid row [%s] due to parsing error", value.toString()); context.getCounter(HadoopDruidIndexerConfig.IndexJobCounters.INVALID_ROW_COUNTER).increment(1); return; } else { throw e; } } catch (RuntimeException e) { throw new RE(e, "Failure on row[%s]", value); } }</code><technical_language>flip this for readability's sake put isIgnoreInvalidRows if</technical_language>

Target:
protected void map( Object key, Object value, Context context ) throws IOException, InterruptedException { try { final InputRow inputRow; try { inputRow = parseInputRow(value, parser); } catch (ParseException e) { if (reportParseExceptions) { throw e; } log.debug(e, "Ignoring invalid row [%s] due to parsing error", value.toString()); context.getCounter(HadoopDruidIndexerConfig.IndexJobCounters.INVALID_ROW_COUNTER).increment(1); return; } if (!granularitySpec.bucketIntervals().isPresent() || granularitySpec.bucketInterval(new DateTime(inputRow.getTimestampFromEpoch())) .isPresent()) { innerMap(inputRow, value, context, reportParseExceptions); } } catch (RuntimeException e) { throw new RE(e, "Failure on row[%s]", value); } }
Source:
<code>public DefaultUsage(final Usage in, UsagePriceOverride override, Currency currency) { this.name = in.getName(); this.usageType = in.getUsageType(); this.billingPeriod = in.getBillingPeriod(); this.billingMode = in.getBillingMode(); this.limits = (DefaultLimit[]) in.getLimits(); this.blocks = (DefaultBlock[]) in.getBlocks(); this.tiers = new DefaultTier[in.getTiers().length]; for (int i = 0; i < in.getTiers().length; i++) { <START> if(override != null && override.getTierPriceOverrides().get(i)!=null) <END> tiers[i] = new DefaultTier(in.getTiers()[i], override.getTierPriceOverrides().get(i), currency); else tiers[i] = (DefaultTier) in.getTiers()[i]; } }</code><technical_language>remark (validate ordering)</technical_language>

Target:
public DefaultUsage(final Usage in, UsagePriceOverride override, Currency currency) { this.name = in.getName(); this.usageType = in.getUsageType(); this.billingPeriod = in.getBillingPeriod(); this.billingMode = in.getBillingMode(); this.limits = (DefaultLimit[]) in.getLimits(); this.blocks = (DefaultBlock[]) in.getBlocks(); this.tiers = new DefaultTier[in.getTiers().length]; for (int i = 0; i < in.getTiers().length; i++) { if(override != null && override.getTierPriceOverrides()!=null) { final TieredBlock[] curTieredBlocks = in.getTiers()[i].getTieredBlocks(); final TierPriceOverride overriddenTier = Iterables.tryFind(override.getTierPriceOverrides(), new Predicate<TierPriceOverride>() { @Override public boolean apply(final TierPriceOverride input) { if(input !=null) { final List<TieredBlockPriceOverride> blockPriceOverrides = input.getTieredBlockPriceOverrides(); for (TieredBlockPriceOverride blockDef : blockPriceOverrides) { String unitName = blockDef.getUnitName(); Double max = blockDef.getMax(); Double size = blockDef.getSize(); for (TieredBlock curTieredBlock : curTieredBlocks) if (unitName.equals(curTieredBlock.getUnit().getName()) && Double.compare(size, curTieredBlock.getSize()) == 0 && Double.compare(max, curTieredBlock.getMax()) == 0) { return true; } } } return false; } }).orNull(); tiers[i] = (overriddenTier != null) ? new DefaultTier(in.getTiers()[i], overriddenTier, currency) : (DefaultTier)in.getTiers()[i] ; } else { tiers[i] = (DefaultTier) in.getTiers()[i]; } } }
Source:
<code>protected boolean canDoAction() { if (!super.canDoAction()) { return false; } ArrayList<String> actionMessages = getReturnValue().getCanDoActionMessages(); actionMessages.add(VdcBllMessages.VAR__ACTION__UPDATE.toString()); VdsGroupDAO vdsGroupDAO = DbFacade.getInstance().getVdsGroupDAO(); VDSGroup vdsGroup = getVdsGroup(); <START> VDSGroup oldGroup = vdsGroupDAO.get(vdsGroup.getId()); <END> if (!validateCluster(oldGroup)) { return false; } if (!validateGroupNameChange(oldGroup)) { return false; } if (!validateCpuChange(oldGroup)) { return false; } if (!validateCompatibilityVersionChange(oldGroup)) { return false; } if (!validateCpuFlagsChange(oldGroup)) { return false; } if (!validateSameStoragePool(oldGroup)) { return false; } if (!validateMemberVmsState(oldGroup)) { return false; } if (vdsGroup.getstorage_pool_id() != null && oldGroup.getstorage_pool_id() == null) { storage_pool storagePool = DbFacade.getInstance().getStoragePoolDAO().get( getVdsGroup().getstorage_pool_id().getValue()); if (storagePool.getstorage_pool_type() == StorageType.LOCALFS) { if (!validateLocalfsSpecificRequirements()) { return false; } } } if (!validateMetrics()) { return false; } return true; }</code><technical_language>here, this code line replaced : VDSGroup oldGroup = getVdsGroupDAO().get(vdsGroup.getId());</technical_language>

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } ArrayList<String> actionMessages = getReturnValue().getCanDoActionMessages(); actionMessages.add(VdcBllMessages.VAR__ACTION__UPDATE.toString()); VDSGroup vdsGroup = getVdsGroup(); VDSGroup oldGroup = getVdsGroupDAO().get(vdsGroup.getId()); if (!validateCluster(oldGroup)) { return false; } if (!validateGroupNameChange(oldGroup)) { return false; } if (!validateCpuChange(oldGroup)) { return false; } if (!validateCompatibilityVersionChange(oldGroup)) { return false; } if (!validateCpuFlagsChange(oldGroup)) { return false; } if (!validateSameStoragePool(oldGroup)) { return false; } if (!validateMemberVmsState(oldGroup)) { return false; } if (vdsGroup.getstorage_pool_id() != null && oldGroup.getstorage_pool_id() == null) { storage_pool storagePool = DbFacade.getInstance().getStoragePoolDAO().get( getVdsGroup().getstorage_pool_id().getValue()); if (storagePool.getstorage_pool_type() == StorageType.LOCALFS) { if (!validateLocalfsSpecificRequirements()) { return false; } } } if (!validateMetrics()) { return false; } return true; }
Source:
<code><START> CLIRegistries() { <END> }</code><technical_language>private if for singleton pattern</technical_language>

Target:
private CLIRegistries() { }
Source:
<code><START> public static int getTextColorResId(int buttonType) { <END> switch (buttonType) { case BUTTON_RETRY: return R.color.alert_red; default: return R.color.blue_wordpress; } }</code><technical_language>Minor tip: started @StringRes, @DrawableRes @ColorRes annotations for type of routines. ie: public static @ColorRes int getTextColorResId(int buttonType)</technical_language>

Target:
public static @ColorRes int getTextColorResId(int buttonType) { switch (buttonType) { case BUTTON_RETRY: return R.color.alert_red; default: return R.color.blue_wordpress; } }
Source:
<code>public JPanel getPanel() { <START> JPanel ajaxSpiderPanel = new JPanel(new GridBagLayout()); <END> ajaxSpiderPanel.setBackground(Color.WHITE); ajaxSpiderPanel.add(getSelectCheckBox(), LayoutHelper.getGBC(0, 0, 1, 0.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); ajaxSpiderPanel.add(new JLabel(Constant.messages.getString("quickstart.label.withbrowser")), LayoutHelper.getGBC(1, 0, 1, 0.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); ajaxSpiderPanel.add(getBrowserComboBox(), LayoutHelper.getGBC(2, 0, 1, 0.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); ajaxSpiderPanel.add(new JLabel(""), LayoutHelper.getGBC(3, 0, 1, 1.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); ajaxSpiderPanel.add(Box.createHorizontalGlue()); return ajaxSpiderPanel; }</code><technical_language>This needs return panel always, removal work properly (as remove a panel)</technical_language>

Target:
public JPanel getPanel() { if (panel == null) { panel = new JPanel(new GridBagLayout()); panel.setBackground(Color.WHITE); panel.add(getSelectCheckBox(), LayoutHelper.getGBC(0, 0, 1, 0.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); panel.add(new JLabel(Constant.messages.getString("quickstart.label.withbrowser")), LayoutHelper.getGBC(1, 0, 1, 0.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); panel.add(getBrowserComboBox(), LayoutHelper.getGBC(2, 0, 1, 0.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); panel.add(new JLabel(""), LayoutHelper.getGBC(3, 0, 1, 1.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); panel.add(Box.createHorizontalGlue()); } return panel; }
Source:
<code>private static List<AvailableService> getAvailableServiceBy(EndpointType endpoint) { List<AvailableService> services = new ArrayList<>(); if (null != endpoint) { for (String serviceName : endpoint.getName()) { for (EndpointConfigurationType url : getEndpointConfigurationTypeBy(endpoint)) { <START> if (url != null) { <END> AvailableService aService = new AvailableService(); aService.setServiceName(MessageFormat.format("{0} - {1}", serviceName, url.getVersion())); aService.setAvailable(PING_SERVICE.ping(url.getUrl())); services.add(aService); } } } } return services; }</code><technical_language>url null loop. remove unnecessary check</technical_language>

Target:
private static List<AvailableService> getAvailableServiceBy(EndpointType endpoint) { List<AvailableService> services = new ArrayList<>(); if (null != endpoint) { for (String serviceName : endpoint.getName()) { for (EndpointConfigurationType url : getEndpointConfigurationTypeBy(endpoint)) { AvailableService aService = new AvailableService(); aService.setServiceName(MessageFormat.format("{0} - {1}", serviceName, url.getVersion())); aService.setAvailable(PING_SERVICE.ping(url.getUrl())); services.add(aService); } } } return services; }
Source:
<code>protected void setupQueue() throws IOException { if (queueName != null) { <START> channel.queueDeclare(queueName, true, false, false, null); <END> } }</code><technical_language>This icing cake factor out defaults a package-private Util, a method, declareQueueDefaults(Channel channel, String queueName). Totally you, though. This is improvement. If do it, do refactor in a commit top</technical_language>

Target:
protected void setupQueue() throws IOException { if (queueName != null) { Util.declareQueueDefaults(channel, queueName); } }
Source:
<code>String getBrowserAcceptHeader(EpdqTemplateData templateData) { String acceptHeader = super.getBrowserAcceptHeader(templateData); if (acceptHeader.length() > BROWSER_ACCEPT_MAX_LENGTH) { return DEFAULT_BROWSER_ACCEPT_HEADER; } <START> return super.getBrowserAcceptHeader(templateData); <END> }</code><technical_language>this potentially shortened? return acceptHeader.length() > BROWSER_ACCEPT_MAX_LENGTH ? DEFAULT_BROWSER_ACCEPT_HEADER : acceptHeader;</technical_language>

Target:
String getBrowserAcceptHeader(EpdqTemplateData templateData) { String acceptHeader = super.getBrowserAcceptHeader(templateData); return acceptHeader.length() > BROWSER_ACCEPT_MAX_LENGTH ? DEFAULT_BROWSER_ACCEPT_HEADER : acceptHeader; }
Source:
<code><START> public void testNotEnoughForMultipleDiskAndDomainsSecondDomainFails() { <END> ArrayList<DiskImage> imagesDisks = mockMultipleSourceImagesForDomain(4, STORAGE_DOMAIN_ID, 4); imagesDisks.addAll(mockMultipleSourceImagesForDomain(4, STORAGE_DOMAIN_ID2, 4)); doReturn(imagesDisks).when(cmd).getSourceImages(); mockStorageDomainDAOGetForStoragePool(22, STORAGE_DOMAIN_ID); mockStorageDomainDAOGetForStoragePool(10, STORAGE_DOMAIN_ID2); assertFalse("Validation should fail. Second domain should not have enough free space for request.", cmd.isEnoughSpaceToMergeSnapshots()); }</code><technical_language>difference this test previous one</technical_language>

Target:
public void testNotEnoughForMultipleDiskAndDomainsSecondDomainFails() { List<DiskImage> imagesDisks = mockMultipleSourceImagesForDomain(4, STORAGE_DOMAIN_ID, IMAGE_ACTUAL_SIZE_GB); imagesDisks.addAll(mockMultipleSourceImagesForDomain(4, STORAGE_DOMAIN_ID2, IMAGE_ACTUAL_SIZE_GB)); doReturn(imagesDisks).when(cmd).getSourceImages(); mockStorageDomainDAOGetForStoragePool(22, STORAGE_DOMAIN_ID); mockStorageDomainDAOGetForStoragePool(10, STORAGE_DOMAIN_ID2); assertFalse("Validation should fail. Second domain should not have enough free space for request.", cmd.isEnoughSpaceToMergeSnapshots()); }
Source:
<code>public boolean hideLayerGroup(LayerGroupInfo layerGroup) { for(PublishedInfo subLayer: layerGroup.getLayers()) { if(subLayer instanceof LayerInfo) { if(hideLayer((LayerInfo)subLayer)) return true; } else if (subLayer instanceof LayerGroupInfo) { if(hideLayerGroup((LayerGroupInfo)subLayer)) return true; } } <START> if (layerGroup.getWorkspace() == null) { <END> if (LocalWorkspace.get() != null) { if (catalog.getLayerGroupByName(LocalWorkspace.get(), layerGroup.getName()) != null) { return true; } } return false; } return hideWorkspace(layerGroup.getWorkspace()); }</code><technical_language>I this change is correct, in secure catalog hide a layer group if of sublayers invisible, wrap reduce amount of visible sub-layers</technical_language>

Target:
public boolean hideLayerGroup(LayerGroupInfo layerGroup) { if (layerGroup.getWorkspace() == null) { if (LocalWorkspace.get() != null) { if (catalog.getLayerGroupByName(LocalWorkspace.get(), layerGroup.getName()) != null) { return true; } } return false; } return hideWorkspace(layerGroup.getWorkspace()); }
Source:
<code>public boolean applyDetermination(ScriptPath path, ObjectTag determinationObj) { if (!isDefaultDetermination(determinationObj)) { String determination = determinationObj.toString(); String lower = CoreUtilities.toLowerCase(determination); if (lower.startsWith("reload_speed:")) { ElementTag newBulletSpread = new ElementTag(lower.substring("reload_speed:".length())); if (!newBulletSpread.isDouble()) { Debug.echoError("Determination for 'reload_speed' must be a valid number."); return false; } event.setReloadSpeed(newBulletSpread.asDouble()); return true; } else if (lower.startsWith("reload_time:")) { <START> ElementTag newBulletSpread = new ElementTag(lower.substring("reload_time:".length())); <END> if (!newBulletSpread.isInt()) { Debug.echoError("Determination for 'reload_time' must be a valid number."); return false; } event.setReloadDuration(newBulletSpread.asInt()); return true; } else if (lower.startsWith("reload_sounds:")) { String newReloadSounds = determination.substring("reload_sounds:".length()); if (CoreUtilities.toLowerCase(newReloadSounds).equals("none")) { newReloadSounds = ""; } event.setSounds(newReloadSounds); return true; } } return super.applyDetermination(path, determinationObj); }</code><technical_language>Code meta mismatch. Also, DurationTag</technical_language>

Target:
public boolean applyDetermination(ScriptPath path, ObjectTag determinationObj) { if (!isDefaultDetermination(determinationObj)) { String determination = determinationObj.toString(); String lower = CoreUtilities.toLowerCase(determination); if (lower.startsWith("reload_speed:")) { ElementTag newReloadSpeed = new ElementTag(lower.substring("reload_speed:".length())); if (!newReloadSpeed.isDouble()) { Debug.echoError("Determination for 'reload_speed' must be a valid number."); return false; } event.setReloadSpeed(newReloadSpeed.asDouble()); return true; } else if (lower.startsWith("reload_time:")) { String time = lower.substring("reload_time:".length()); if (!DurationTag.matches(time)) { Debug.echoError("Determination for 'reload_time' must be a valid DurationTag."); return false; } DurationTag newReloadtime = DurationTag.valueOf(lower.substring("reload_time:".length()), getTagContext(path)); event.setReloadDuration(newReloadtime.getTicksAsInt()); return true; } else if (lower.startsWith("reload_sounds:")) { String newReloadSounds = determination.substring("reload_sounds:".length()); if (CoreUtilities.toLowerCase(newReloadSounds).equals("none")) { newReloadSounds = ""; } event.setSounds(newReloadSounds); return true; } } return super.applyDetermination(path, determinationObj); }
Source:
<code>public CorfuReplicationDiscoveryService(@Nonnull ServerContext serverContext, @Nonnull CorfuReplicationClusterManagerAdapter clusterManagerAdapter, @Nonnull CompletableFuture<CorfuInterClusterReplicationServerNode> serverCallback) { this.executorService = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("discovery-service-executor").build()); this.clusterManagerAdapter = clusterManagerAdapter; this.logReplicationNodeId = serverContext.getNodeId(); this.serverContext = serverContext; this.localEndpoint = serverContext.getLocalEndpoint(); this.serverCallback = serverCallback; this.isLeader = false; this.eventQueue = new LinkedBlockingQueue<>(); this.shutdown = false; <START> this.executorService.submit(this::run); <END> }</code><technical_language>Instead of this constructor, cleaner a start(). DiscoveryService.start(), kicks off</technical_language>

Target:
public CorfuReplicationDiscoveryService(@Nonnull ServerContext serverContext, @Nonnull CorfuReplicationClusterManagerAdapter clusterManagerAdapter, @Nonnull CompletableFuture<CorfuInterClusterReplicationServerNode> serverCallback) { this.executorService = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("discovery-service-executor").build()); this.clusterManagerAdapter = clusterManagerAdapter; this.logReplicationNodeId = serverContext.getNodeId(); this.serverContext = serverContext; this.localEndpoint = serverContext.getLocalEndpoint(); this.serverCallback = serverCallback; this.shutdown = false; this.isLeader = new AtomicBoolean(); this.eventQueue = new LinkedBlockingQueue<>(); }
Source:
<code>private String getLastCmd() { CliSessionState cliss = (CliSessionState) SessionState.get(); Scanner scanner = null; try { scanner = new Scanner(new File(cliss.fileName)); } catch (FileNotFoundException e) { LOG.error("Can't find Hive script", e); } if (scanner == null) { return null; } Pattern delim = Pattern.compile(";"); scanner.useDelimiter(delim); String lastLine = null; while (scanner.hasNext()) { String line = StringUtils.trim(scanner.next().replaceAll("\\n", "")); <START> if (!line.startsWith("--") && !StringUtils.isEmpty(line)) { <END> lastLine = line; } } return lastLine; }</code><technical_language>familiar org.apache.commons.lang.StringUtils. StringUtils.isEmpty(line) buy line.isEmpty()? Null safety</technical_language>

Target:
private String getLastCmd() { CliSessionState cliss = (CliSessionState) SessionState.get(); Scanner scanner = null; try { scanner = new Scanner(new File(cliss.fileName)); } catch (FileNotFoundException e) { LOG.error("Can't find Hive script", e); } if (scanner == null) { return null; } Pattern delim = Pattern.compile(";"); scanner.useDelimiter(delim); String lastLine = null; while (scanner.hasNext()) { String line = StringUtils.trim(scanner.next().replaceAll("\\n", "")); if (line.length() != 0 && !line.startsWith("--")) { lastLine = line; } } return lastLine; }
Source:
<code>protected <START> void setSeries(String seriesName, double[] seriesValues) { <END> if (seriesValues == null) { throw new IllegalArgumentException("Series values cannot be null"); } String seriesType = getSeriesType(seriesName); fModelBuilder.addYSeries( new YSeries( seriesType, getSeriesColor(seriesName), getWidth(seriesName), getSeriesStyle(seriesType), seriesName, seriesValues)); }</code><technical_language>please verify need this null check for series name</technical_language>

Target:
protected void setSeries(String seriesName, double[] seriesValues) { if (seriesName == null) { throw new IllegalArgumentException("seriesName cannot be null"); } if (seriesValues == null) { throw new IllegalArgumentException("Series values cannot be null"); } String seriesType = getSeriesType(seriesName); fModelBuilder.addYSeries( new YSeries( seriesType, getSeriesColor(seriesName), getWidth(seriesName), getSeriesStyle(seriesType), seriesName, seriesValues)); }
Source:
<code>protected Object getValueUnchecked(String fieldName) { requestScope.queueTriggers(this, CRUDAction.READ); requestScope.queueTriggers(this, fieldName, CRUDAction.READ, Optional.empty()); <START> runTriggers(OnReadPreSecurity.class, "", Optional.empty()); <END> runTriggers(OnReadPreSecurity.class, fieldName, Optional.empty()); return getValue(getObject(), fieldName, requestScope); }</code><technical_language>extract this empty string a constant CLASS_NO_FIELD = ""</technical_language>

Target:
protected Object getValueUnchecked(String fieldName) { requestScope.queueTriggers(this, CRUDAction.READ); requestScope.queueTriggers(this, fieldName, CRUDAction.READ, Optional.empty()); runTriggers(OnReadPreSecurity.class, CLASS_NO_FIELD); runTriggers(OnReadPreSecurity.class, fieldName); return getValue(getObject(), fieldName, requestScope); }
Source:
<code>public String toString() { return MoreObjects.toStringHelper(this) .omitNullValues() <START> .add("id", id) <END> .add("resourceId", resourceId) .add("tunnelIps", tunnelIps) .add("managementIp", managementIp) .add("managementPort", managementPort) .add("managementProtocol", managementProtocol) .add("remoteMacEntries", remoteMacEntries) .toString(); }</code><technical_language>type</technical_language>

Target:
public String toString() { return MoreObjects.toStringHelper(this) .omitNullValues() .add("id", id) .add("type", type) .add("resourceId", resourceId) .add("tunnelIps", tunnelIps) .add("managementIp", managementIp) .add("managementPort", managementPort) .add("managementProtocol", managementProtocol) .add("remoteMacEntries", remoteMacEntries) .toString(); }
Source:
<code>public Set<String> getChoiceAuthoritiesNames() { if (authorityNames.isEmpty()) { loadChoiceAuthorityConfigurations(); } <START> return authorityNames; <END> }</code><technical_language>authorities.keySet() get ride of authorityNames class field</technical_language>

Target:
public Set<String> getChoiceAuthoritiesNames() { if (authorities.keySet().isEmpty()) { loadChoiceAuthorityConfigurations(); } return authorities.keySet(); }
Source:
<code>public void handlePostEntitlement(PoolManager manager, Consumer consumer, Map<String, Entitlement> entitlements) { Map<String, Integer> stackIdCounts = new HashMap<String, Integer>(); for (Entitlement entitlement : entitlements.values()) { if (entitlement.getPool().isStacked()) { String stackId = entitlement.getPool().getStackId(); Integer count = stackIdCounts.containsKey(stackId) ? stackIdCounts.get(stackId) : 0; stackIdCounts.put(stackId, count + 1); } } Set<String> uniqueStackIds = new HashSet<String>(); Map<String, Entitlement> uniqueEnts = new HashMap<String, Entitlement>(); Map<String, Entitlement> nonUniqueEnts = new HashMap<String, Entitlement>(); for (Entry<String, Entitlement> entry : entitlements.entrySet()) { Pool p = entry.getValue().getPool(); if (p.isStacked() && stackIdCounts.get(p.getStackId()) > 1) { nonUniqueEnts.put(entry.getKey(), entry.getValue()); } else { uniqueEnts.put(entry.getKey(), entry.getValue()); if (p.isStacked()) { uniqueStackIds.add(p.getStackId()); } } } handlePostEntitlement(manager, consumer, uniqueEnts, uniqueStackIds); for (Entry<String, Entitlement> entry: nonUniqueEnts.entrySet()) { Entitlement ent = entry.getValue(); Map<String, Entitlement> entMap = new HashMap<String, Entitlement>(); entMap.put(entry.getKey(), ent); Set<String> stackIdSet = new HashSet<String>(); if (ent.getPool().isStacked()) { stackIdSet.add(ent.getPool().getStackId()); } <START> handlePostEntitlement(manager, consumer, entMap, stackIdSet); <END> } }</code><technical_language>Is a group ents in a stack operate groupings instead of one</technical_language>

Target:
public void handlePostEntitlement(PoolManager manager, Consumer consumer, Map<String, Entitlement> entitlements) { Map<String, Integer> stackIdCounts = new HashMap<String, Integer>(); for (Entitlement entitlement : entitlements.values()) { if (entitlement.getPool().isStacked()) { String stackId = entitlement.getPool().getStackId(); Integer count = stackIdCounts.containsKey(stackId) ? stackIdCounts.get(stackId) : 0; stackIdCounts.put(stackId, count + 1); } } Set<String> uniqueStackIds = new HashSet<String>(); Map<String, Entitlement> uniqueEnts = new HashMap<String, Entitlement>(); Map<String, Entitlement> nonUniqueEnts = new HashMap<String, Entitlement>(); for (Entry<String, Entitlement> entry : entitlements.entrySet()) { Pool p = entry.getValue().getPool(); if (p.isStacked() && stackIdCounts.get(p.getStackId()) > 1) { nonUniqueEnts.put(entry.getKey(), entry.getValue()); } else { uniqueEnts.put(entry.getKey(), entry.getValue()); if (p.isStacked()) { uniqueStackIds.add(p.getStackId()); } } } if (!uniqueEnts.isEmpty()) { handlePostEntitlement(manager, consumer, uniqueEnts, uniqueStackIds); } for (Entry<String, Entitlement> entry: nonUniqueEnts.entrySet()) { Entitlement ent = entry.getValue(); Map<String, Entitlement> entMap = new HashMap<String, Entitlement>(); entMap.put(entry.getKey(), ent); Set<String> stackIdSet = new HashSet<String>(); if (ent.getPool().isStacked()) { stackIdSet.add(ent.getPool().getStackId()); } handlePostEntitlement(manager, consumer, entMap, stackIdSet); } }
Source:
<code>private static void merge(AggregatedCalledFunction destination, AggregatedCalledFunction source) { long sourceDuration = source.getDuration(); long sourceSelfTime = source.getSelfTime(); destination.addToDuration(sourceDuration); destination.addToSelfTime(sourceSelfTime); <START> destination.fStatistics.update(source.fStatistics.getMaxSegment(),source.fStatistics.getMinSegment(), <END> sourceSelfTime); mergeChildren(destination, source); }</code><technical_language>space comma - need pass source duration</technical_language>

Target:
private static void merge(AggregatedCalledFunction destination, AggregatedCalledFunction source) { long sourceDuration = source.getDuration(); long sourceSelfTime = source.getSelfTime(); destination.addToDuration(sourceDuration); destination.addToSelfTime(sourceSelfTime); destination.fStatistics.update(source.fStatistics.getMaxSegment(), source.fStatistics.getMinSegment(), sourceDuration, sourceSelfTime); mergeChildren(destination, source); }
Source:
<code>public boolean hasChange(int changeFlag) { TreeItem[] selection = viewer.getTree().getItems(); TreeItem firstSelectedItem = selection.length > 0 ? selection[0] : null; switch (changeFlag) { case NEXT_CHANGE: return getNextDiff(thisOrFirstItem(firstSelectedItem)) != null; case PREVIOUS_CHANGE: return getPreviousDiff(thisOrFirstItem(firstSelectedItem)) != null; case NEXT_UNRESOLVED_CHANGE: return getNextUnresolvedDiff(thisOrFirstItem(firstSelectedItem)) != null; case FIRST_CHANGE: <START> TreeItem firstItemInTree = getFirstItemInTree(); <END> return firstItemInTree != null && getNextDiff(firstItemInTree) != null; default: throw new IllegalStateException(); } }</code><technical_language>This a bug fix related feature of this review</technical_language>

Target:
public boolean hasChange(int changeFlag) { TreeItem[] selection = viewer.getTree().getItems(); TreeItem firstSelectedItem = selection.length > 0 ? selection[0] : null; switch (changeFlag) { case NEXT_CHANGE: return getNextDiff(thisOrFirstItem(firstSelectedItem)) != null; case PREVIOUS_CHANGE: return getPreviousDiff(thisOrFirstItem(firstSelectedItem)) != null; case NEXT_UNRESOLVED_CHANGE: return getNextUnresolvedDiff(thisOrFirstItem(firstSelectedItem)) != null; case FIRST_CHANGE: return getNextDiff(getFirstItemInTree()) != null; default: throw new IllegalStateException(); } }
Source:
<code>public static final String QueryFullProcessImageName(HANDLE hProcess, int dwFlags) { char[] path = new char[WinDef.MAX_PATH]; IntByReference lpdwSize = new IntByReference(path.length); if (Kernel32.INSTANCE.QueryFullProcessImageName(hProcess, 0, path, lpdwSize)) return new String(path).substring(0, lpdwSize.getValue()); return null; <START> } <END></code><technical_language>This needs a test, please</technical_language>

Target:
public static final String QueryFullProcessImageName(HANDLE hProcess, int dwFlags) { char[] path = new char[WinDef.MAX_PATH]; IntByReference lpdwSize = new IntByReference(path.length); if (Kernel32.INSTANCE.QueryFullProcessImageName(hProcess, 0, path, lpdwSize)) return new String(path).substring(0, lpdwSize.getValue()); throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); }
Source:
<code>public void async(Runnable runnable) { Thread asyncTask = new Thread(() -> { <START> readWriteLock.writeLock().lock(); <END> try { runnable.run(); } finally { readWriteLock.writeLock().unlock(); } }); asyncTask.start(); }</code><technical_language>Empty line</technical_language>

Target:
public void async(Runnable runnable) { String workerName = "async-file-store-cleanup-task-" + workerCounter.getAndIncrement(); GridWorker worker = new GridWorker(igniteInstanceName, workerName, log) { @Override protected void body() { readWriteLock.writeLock().lock(); try { runnable.run(); } finally { readWriteLock.writeLock().unlock(); workers.remove(this); } } }; workers.add(worker); Thread asyncTask = new IgniteThread(worker); asyncTask.start(); }
Source:
<code><START> public List<@NonNull Integer> getSubAttributes(int quark, boolean recursive) <END> throws AttributeNotFoundException { return getAttributeTree().getSubAttributes(quark, recursive); }</code><technical_language>If annotate interface methods need repeat (we setting inherit annotations)</technical_language>

Target:
public List<Integer> getSubAttributes(int quark, boolean recursive) throws AttributeNotFoundException { return getAttributeTree().getSubAttributes(quark, recursive); }
Source:
<code>private List<BootstrapTask> getIncompleteTasks() throws SQLException { ArrayList<BootstrapTask> list = new ArrayList<>(); try ( Connection cx = maxwellConnectionPool.getConnection() ) { <START> PreparedStatement s = cx.prepareStatement("select * from bootstrap where is_complete = 0 and client_id = ? and (started_at is null or started_at <= now()) order by -started_at desc, id"); <END> s.setString(1, this.clientID); ResultSet rs = s.executeQuery(); while (rs.next()) { list.add(BootstrapTask.valueOf(rs)); } } return list; }</code><technical_language>sorry, ordering -started_at desc? NULL values</technical_language>

Target:
private List<BootstrapTask> getIncompleteTasks() throws SQLException { ArrayList<BootstrapTask> list = new ArrayList<>(); try ( Connection cx = maxwellConnectionPool.getConnection() ) { PreparedStatement s = cx.prepareStatement("select * from bootstrap where is_complete = 0 and client_id = ? and (started_at is null or started_at <= now()) order by isnull(started_at), started_at asc, id asc"); s.setString(1, this.clientID); ResultSet rs = s.executeQuery(); while (rs.next()) { list.add(BootstrapTask.valueOf(rs)); } } return list; }
Source:
<code><START> private OpenTok(int apiKey, String apiSecret) { <END> this(apiKey, apiSecret, defaultApiUrl); }</code><technical_language>I public constructor mandatory parameters. This concise initialize object work for 80% of users. Builder for want customize additional option parameters</technical_language>

Target:
public OpenTok(int apiKey, String apiSecret) { this.apiKey = apiKey; this.apiSecret = apiSecret.trim(); this.client = new HttpClient.Builder(apiKey, apiSecret).build(); }
Source:
<code>public String get() { <START> return baseProducer.randomElement("L", "M", "N", "P", "R", "T", "V", "W", "X", "Y") + randomNumeric(8); <END> }</code><technical_language>extract a collection/ array</technical_language>

Target:
public String get() { return baseProducer.randomElement(ID_CARD_TYPE_LETTERS) + randomNumeric(8); }
Source:
<code>public boolean onBackPressed() { if (tocHandler != null && tocHandler.isVisible()) { tocHandler.hide(); return true; } if (closeFindInPage()) { return true; } if (pageLoadStrategy.onBackPressed()) { return true; <START> } else if (tabList.size() > 1) { <END> tabList.remove(tabList.size() - 1); pageLoadStrategy.setBackStack(getCurrentTab().getBackStack()); pageLoadStrategy.loadPageFromBackStack(); tabsProvider.enterTabMode(); return true; } if (tabsProvider.onBackPressed()) { return true; } return false; }</code><technical_language>minor: this else is unnecessary</technical_language>

Target:
public boolean onBackPressed() { if (tocHandler != null && tocHandler.isVisible()) { tocHandler.hide(); return true; } if (closeFindInPage()) { return true; } if (pageLoadStrategy.onBackPressed()) { return true; } if (tabList.size() > 1) { tabList.remove(tabList.size() - 1); pageLoadStrategy.setBackStack(getCurrentTab().getBackStack()); pageLoadStrategy.loadPageFromBackStack(); tabsProvider.enterTabMode(); return true; } return tabsProvider.onBackPressed(); }
Source:
<code>private void runInternal() { try { operationSelector.start(); while (!stage.isTerminated()) { boolean started = stage.isStarted(); if (started) { txRemainingOperations = 0; if (ongoingTx != null) { endTransactionAndRegisterStats(null); } stats.begin(); this.started = started; break; } Operation operation = operationSelector.next(random); try { logic.run(operation); <START> if (delayBetweenRequests > 0) <END> sleep(delayBetweenRequests); } catch (OperationLogic.RequestException e) { } catch (InterruptedException e) { log.trace("Stressor interrupted.", e); interrupt(); } } completion.start(); int i = 0; while (!stage.isTerminated()) { Operation operation = operationSelector.next(random); if (!completion.moreToRun()) break; try { logic.run(operation); if (delayBetweenRequests > 0) sleep(delayBetweenRequests); } catch (OperationLogic.RequestException e) { } catch (InterruptedException e) { log.trace("Stressor interrupted.", e); interrupt(); } i++; completion.logProgress(i); } } finally { if (txRemainingOperations > 0) { endTransactionAndRegisterStats(null); } } }</code><technical_language>async operations, insert delay in ways: a) fixed schedule - execute n-th operation in time n \* period, if manage do in time, try executing operations b) time - put delay requests c) cycle time - record started operation wait start + delay (don't wait if operation duration exceeded delay) added delay this way, kind of results do expect that</technical_language>

Target:
private void runInternal() { boolean counted = false; try { operationSelector.start(); while (!stage.isTerminated()) { boolean started = stage.isStarted(); if (started) { txRemainingOperations = 0; if (ongoingTx != null) { endTransactionAndRegisterStats(null); } break; } else { if (!counted) { threadCountDown.countDown(); counted = true; } Operation operation = operationSelector.next(random); try { logic.run(operation); if (delayBetweenRequests > 0) sleep(delayBetweenRequests); } catch (OperationLogic.RequestException e) { } catch (InterruptedException e) { log.trace("Stressor interrupted.", e); interrupt(); } } } stats.begin(); this.started = true; completion.start(); int i = 0; while (!stage.isTerminated()) { Operation operation = operationSelector.next(random); if (!completion.moreToRun()) break; try { logic.run(operation); if (delayBetweenRequests > 0) sleep(delayBetweenRequests); } catch (OperationLogic.RequestException e) { } catch (InterruptedException e) { log.trace("Stressor interrupted.", e); interrupt(); } i++; completion.logProgress(i); } } finally { if (txRemainingOperations > 0) { endTransactionAndRegisterStats(null); } } }
Source:
<code>public void testNoNPEWhenClientBreaksConnection() throws Exception { final File f = setupFile("file.pdf", TestUtils.randomUnicodeString(1000000)); server.requestHandler(req -> { <START> vertx.executeBlocking(future -> { <END> try { Thread.sleep(100); } catch (InterruptedException e) { } future.complete(); }, false, res -> { req.response().putHeader(HttpHeaders.CONTENT_TYPE, "application/pdf"); try { req.response().sendFile(f.getAbsolutePath(), event -> { if (event.failed()) { testComplete(); } else { fail("It should not reach this point"); } }); } catch (NullPointerException e) { fail("It should not throw NPE"); } }); }); server.listen(onSuccess(server -> { vertx.createNetClient().connect(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, socket -> { socket.result().write("GET / HTTP/1.1\r\n\r\n").close(); }); })); await(); }</code><technical_language>setTimer</technical_language>

Target:
public void testNoNPEWhenClientBreaksConnection() throws Exception { final File f = setupFile("file.pdf", TestUtils.randomUnicodeString(1000000)); server.requestHandler(req -> { req.connection().closeHandler(v -> { req.response().putHeader(HttpHeaders.CONTENT_TYPE, "application/pdf"); try { req.response().sendFile(f.getAbsolutePath(), event -> { if (event.failed()) { testComplete(); } else { fail("It should not reach this point"); } }); } catch (NullPointerException e) { fail("It should not throw NPE"); } }); }); server.listen(onSuccess(server -> { vertx.createNetClient().connect(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, socket -> { socket.result().write("GET / HTTP/1.1\r\n\r\n").close(); }); })); await(); }
Source:
<code>public void appendMessage(String message) { if (message == null) { return; } <START> messagePanel.add(new HTML(StringUtils.addHtmlLineBreaks(message))); <END> }</code><technical_language>adding a new HTML instead of a new Label? ('addHtmlLineBreaks' method usage prevented way)</technical_language>

Target:
public void appendMessage(String message) { if (message == null) { return; } messagePanel.add(new Label(message)); }