auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void test() throws Exception { ServiceManager serviceManager = new ServiceManager(); long counted = serviceManager.getProcessService().count("from Process"); Assert.assertNotNull("No Process found", counted); Assert.assertEquals(4, counted); String title = serviceManager.getProcessService().find(1).getTitle(); <START> Assert.assertEquals("DBConnectionTest", title); <END> }</code><technical_language>This test work, search for process test data is inserted 4th</technical_language>

Target:
public void test() throws Exception { ServiceManager serviceManager = new ServiceManager(); long counted = serviceManager.getProcessService().count("from Process"); Assert.assertNotNull("No Process found", counted); Assert.assertEquals(4, counted); String title = serviceManager.getProcessService().find(4).getTitle(); Assert.assertEquals("DBConnectionTest", title); }
Source:
<code>public Profile(String managers, String community, String oid) { Matcher m = HOST_PATTERN.matcher(managers); while (m.find()) { hosts.add(new Host( <START> m.group("host") != null ? m.group("host") : m.group("ipv6"), <END> m.group("port"))); } this.community = new OctetString(community); this.oid = new OID(oid); if (!this.oid.isValid()) { throw new IllegalArgumentException( String.format( "Invalid oid '%s'", oid ) ); } }</code><technical_language>I guess above..</technical_language>

Target:
public Profile(String managers, String community, String oid) { Matcher m = HOST_PATTERN.matcher(managers); while (m.find()) { hosts.add(new Host(m.group("host"), m.group("port"))); } this.community = new OctetString(community); this.oid = new OID(oid); if (!this.oid.isValid()) { throw new IllegalArgumentException( String.format( "Invalid oid '%s'", oid ) ); } }
Source:
<code>public void setShouldRenderWhilePanning( boolean shouldRender ) { mShouldRenderWhilePanning = shouldRender; <START> if( shouldRender ) { <END> mTileCanvasViewGroup.setRenderBuffer( TileCanvasViewGroup.FAST_RENDER_BUFFER ); } else { mTileCanvasViewGroup.setRenderBuffer( TileCanvasViewGroup.DEFAULT_RENDER_BUFFER ); } }</code><technical_language>a condition determines a (rather "action" - think: method), i ternary is appropriate: int buffer = shouldRender ? TileCanvasViewGroup.FAST_RENDER_BUFFER : TileCanvasViewGroup.DEFAULT_RENDER_BUFFER; mTileCanvasViewGroup.setRenderBuffer( buffer );</technical_language>

Target:
public void setShouldRenderWhilePanning( boolean shouldRender ) { mShouldRenderWhilePanning = shouldRender; int buffer = shouldRender ? TileCanvasViewGroup.FAST_RENDER_BUFFER : TileCanvasViewGroup.DEFAULT_RENDER_BUFFER; mTileCanvasViewGroup.setRenderBuffer( buffer ); }
Source:
<code>public void declareManagedMemoryUseCaseAtSlotScope(ManagedMemoryUseCase managedMemoryUseCase) { throw new UnsupportedOperationException( <START> "Do not support declare slot scope's managed memory for SinkTransformation."); <END> }</code><technical_language>suggestion "Declaring managed memory cases is supported for SinkTransformation.");</technical_language>

Target:
public void declareManagedMemoryUseCaseAtSlotScope(ManagedMemoryUseCase managedMemoryUseCase) { throw new UnsupportedOperationException( "Declaring managed memory use cases is not supported for SinkTransformation."); }
Source:
<code>public void usageRatio() { <START> tracer.maxPages( 10 ); <END> assertThat( tracer.usageRatio(), closeTo( 0d, 0.0001 ) ); tracer.faults( 5 ); assertThat( tracer.usageRatio(), closeTo( 0.5, 0.0001 ) ); tracer.faults( 5 ); tracer.evictions( 5 ); assertThat( tracer.usageRatio(), closeTo( 0.5, 0.0001 ) ); tracer.faults( 5 ); assertThat( tracer.usageRatio(), closeTo( 1d, 0.0001 ) ); }</code><technical_language>isNaN test for maxPages set</technical_language>

Target:
public void usageRatio() { assertThat( tracer.usageRatio(), is( Double.NaN ) ); tracer.maxPages( 10 ); assertThat( tracer.usageRatio(), closeTo( 0d, 0.0001 ) ); tracer.faults( 5 ); assertThat( tracer.usageRatio(), closeTo( 0.5, 0.0001 ) ); tracer.faults( 5 ); tracer.evictions( 5 ); assertThat( tracer.usageRatio(), closeTo( 0.5, 0.0001 ) ); tracer.faults( 5 ); assertThat( tracer.usageRatio(), closeTo( 1d, 0.0001 ) ); }
Source:
<code>public OidcClient getOidcClient(String callBackUri) { OidcClient oidcClient = createOidcClient(idpType, oidcConfiguration, callBackUri); try { oidcClient.init(); } catch (TechnicalException e) { <START> LOGGER.warn( <END> "OIDC Client could not initialize; this may be due to a configuration issue. See the configuration under \"OIDC Handler Configuration\" in the Admin Console"); return null; } return oidcClient; }</code><technical_language>worthwhile log error a debug level in addition information warn level</technical_language>

Target:
public OidcClient getOidcClient(String callBackUri) { OidcClient oidcClient = createOidcClient(idpType, oidcConfiguration, callBackUri); try { oidcClient.init(); } catch (TechnicalException e) { LOGGER.warn( "OIDC Client could not initialize; this may be due to a configuration issue. See the configuration under \"OIDC Handler Configuration\" in the Admin Console"); LOGGER.debug(e.getMessage()); } return oidcClient; }
Source:
<code>public void marshal(ITypeMarshalBuffer buffer) throws CoreException { final int kind= getKind().ordinal(); final int shiftedKind= kind * ITypeMarshalBuffer.FIRST_FLAG; final int modifiers= getModifiers(); if (modifiers == 0) { buffer.putShort((short) (ITypeMarshalBuffer.BASIC_TYPE | shiftedKind)); } else { <START> buffer.putShort((short) (ITypeMarshalBuffer.BASIC_TYPE | ITypeMarshalBuffer.LAST_FLAG)); <END> buffer.putByte((byte) kind); buffer.putByte((byte) modifiers); } }</code><technical_language>ITypeMarshalBuffer.BASIC_TYPE | shiftedKind | ITypeMarshalBuffer.LAST_FLAG write kind separately</technical_language>

Target:
public void marshal(ITypeMarshalBuffer buffer) throws CoreException { final int kind= getKind().ordinal(); final int shiftedKind= kind * ITypeMarshalBuffer.FIRST_FLAG; final int modifiers= getModifiers(); if (modifiers == 0) { buffer.putShort((short) (ITypeMarshalBuffer.BASIC_TYPE | shiftedKind)); } else { buffer.putShort((short) (ITypeMarshalBuffer.BASIC_TYPE | shiftedKind | ITypeMarshalBuffer.LAST_FLAG)); buffer.putByte((byte) modifiers); } }
Source:
<code>private void processKey(KeyCacheObject key) throws IgniteCheckedException { assert nonNull(key); while (true) { try { checkCancelled(); GridCacheEntryEx entry = cctx.cache().entryEx(key); try { <START> entry.updateIndex(rowFilter, clo, indexCacheStat); <END> } finally { entry.touch(); } break; } catch (GridDhtInvalidPartitionException ignore) { break; } catch (GridCacheEntryRemovedException ignored) { } } }</code><technical_language>of 3 params squashed single closure right here</technical_language>

Target:
private void processKey(KeyCacheObject key) throws IgniteCheckedException { assert nonNull(key); while (true) { try { checkCancelled(); GridCacheEntryEx entry = cctx.cache().entryEx(key); try { entry.updateIndex(wrappedClo); } finally { entry.touch(); } break; } catch (GridDhtInvalidPartitionException ignore) { break; } catch (GridCacheEntryRemovedException ignored) { } } }
Source:
<code>public Disk(DataNode dataNode, JSONObject jsonObject, ClusterMapConfig clusterMapConfig) throws JSONException { if (logger.isTraceEnabled()) { logger.trace("Disk " + jsonObject.toString()); } this.dataNode = dataNode; this.mountPath = jsonObject.getString("mountPath"); try { ResourceStatePolicyFactory resourceStatePolicyFactory = Utils .getObj(clusterMapConfig.clusterMapResourceStatePolicyFactory, this, HardwareState.valueOf(jsonObject.getString("hardwareState")), clusterMapConfig); this.diskStatePolicy = resourceStatePolicyFactory.getResourceStatePolicy(); } catch (Exception e) { <START> logger.error("Error during start {}", e); <END> throw new InstantiationError("Error during start " + e); } this.capacityInBytes = jsonObject.getLong("capacityInBytes"); validate(); }</code><technical_language>error message "Error creating resource state policy instantiating disk" + mountPath. Also, do logger.error("Error start " + e);</technical_language>

Target:
public Disk(DataNode dataNode, JSONObject jsonObject, ClusterMapConfig clusterMapConfig) throws JSONException { if (logger.isTraceEnabled()) { logger.trace("Disk " + jsonObject.toString()); } this.dataNode = dataNode; this.mountPath = jsonObject.getString("mountPath"); try { ResourceStatePolicyFactory resourceStatePolicyFactory = Utils .getObj(clusterMapConfig.clusterMapResourceStatePolicyFactory, this, HardwareState.valueOf(jsonObject.getString("hardwareState")), clusterMapConfig); this.diskStatePolicy = resourceStatePolicyFactory.getResourceStatePolicy(); } catch (Exception e) { logger.error("Error creating resource state policy when instantiating a disk " + e); throw new IllegalStateException("Error creating resource state policy when instantiating a disk: " + mountPath, e); } this.capacityInBytes = jsonObject.getLong("capacityInBytes"); validate(); }
Source:
<code>public ConsumerDTO clone() { ConsumerDTO copy = super.clone(); OwnerDTO owner = this.getOwner(); copy.owner = owner != null ? (OwnerDTO) owner.clone() : null; EnvironmentDTO environment = this.getEnvironment(); copy.environment = environment != null ? (EnvironmentDTO) environment.clone() : null; Map<String, String> facts = this.getFacts(); copy.facts = facts != null ? new HashMap<String, String>(facts) : null; Set<ConsumerInstalledProductDTO> installedProducts = this.getInstalledProducts(); if (installedProducts != null) { copy.installedProducts = new HashSet<ConsumerInstalledProductDTO>(); for (ConsumerInstalledProductDTO installedProduct: installedProducts) { copy.installedProducts.add(installedProduct.clone()); } } Set<CapabilityDTO> capabilities = this.getCapabilities(); if (capabilities != null) { copy.capabilities = new HashSet<CapabilityDTO>(); for (CapabilityDTO capabilityDTO: capabilities) { copy.capabilities.add(capabilityDTO.clone()); } <START> } <END> HypervisorIdDTO hypervisorId = this.getHypervisorId(); copy.hypervisorId = hypervisorId != null ? (HypervisorIdDTO) hypervisorId.clone() : null; Set<String> contentTags = this.getContentTags(); copy.contentTags = contentTags != null ? new HashSet<String>(contentTags) : null; ConsumerTypeDTO type = this.getType(); copy.type = type != null ? (ConsumerTypeDTO) type.clone() : null; CertificateDTO cert = this.getIdCert(); copy.idCert = cert != null ? (CertificateDTO) cert.clone() : null; return copy; }</code><technical_language>of this get updated encapsulation stuff handled. content tags below</technical_language>

Target:
public ConsumerDTO clone() { ConsumerDTO copy = super.clone(); copy.owner = owner != null ? owner.clone() : null; copy.environment = environment != null ? environment.clone() : null; copy.setFacts(this.getFacts()); copy.setInstalledProducts(this.getInstalledProducts()); copy.setCapabilities(this.getCapabilities()); copy.hypervisorId = hypervisorId != null ? hypervisorId.clone() : null; copy.setContentTags(this.getContentTags()); copy.type = type != null ? type.clone() : null; copy.idCert = idCert != null ? idCert.clone() : null; return copy; }
Source:
<code>private void startWebMetrics() throws Exception { <START> final MetricRegistry registry = SERVICE_PROVIDER.getInstance(MetricsManager.class) <END> .getRegistry(); MetricsUtility .addGauge("JETTY-NumIdleThreads", registry, this.queuedThreadPool::getIdleThreads); MetricsUtility.addGauge("JETTY-NumTotalThreads", registry, this.queuedThreadPool::getThreads); MetricsUtility.addGauge("JETTY-NumQueueSize", registry, this.queuedThreadPool::getQueueSize); MetricsUtility .addGauge("WEB-NumQueuedFlows", registry, this.executorManager::getQueuedFlowSize); MetricsUtility .addGauge("WEB-NumRunningFlows", registry, () -> this.executorManager.getRunningFlows().size()); logger.info("starting reporting Web Server Metrics"); SERVICE_PROVIDER.getInstance(MetricsManager.class).startReporting("AZ-WEB", this.props); }</code><technical_language>get MetricsRegistry directly</technical_language>

Target:
private void startWebMetrics() throws Exception { MetricsUtility .addGauge("JETTY-NumIdleThreads", this.registry, this.queuedThreadPool::getIdleThreads); MetricsUtility .addGauge("JETTY-NumTotalThreads", this.registry, this.queuedThreadPool::getThreads); MetricsUtility .addGauge("JETTY-NumQueueSize", this.registry, this.queuedThreadPool::getQueueSize); MetricsUtility .addGauge("WEB-NumQueuedFlows", this.registry, this.executorManager::getQueuedFlowSize); MetricsUtility .addGauge("WEB-NumRunningFlows", this.registry, () -> this.executorManager.getRunningFlows().size()); logger.info("starting reporting Web Server Metrics"); this.metricsManager.startReporting("AZ-WEB", this.props); }
Source:
<code>public static <T> Comparator<Tag<T>> tagIdComparator() { <START> return Comparator.nullsFirst(Comparator.<Tag<T>, ResourceLocation>comparing(Tag::getId, Comparator.nullsFirst(Comparator.naturalOrder()))); <END> }</code><technical_language>do need null first? If null happens, crash</technical_language>

Target:
public static <T> Comparator<Tag<T>> tagIdComparator() { return Comparator.comparing(Tag::getId); }
Source:
<code>public void setFluxUnits(YUnit newUnit) throws UnitsException { if (specValues == null) return; <START> if (fluxValues != null) { <END> setFluxValues(units.convertY(fluxValues, specValues, fluxUnits, specUnits, newUnit)); } if (originalFluxValues != null) { setOriginalFluxValues(units.convertY(originalFluxValues, specValues, fluxUnits, specUnits, newUnit)); } if (fluxErrValues != null) { setFluxErrValues(units.convertY(fluxErrValues, specValues, fluxUnits, specUnits, newUnit)); } if (fluxErrValuesLo != null) { setFluxErrValuesLo(units.convertY(fluxErrValuesLo, specValues, fluxUnits, specUnits, newUnit)); } if (fluxErrValuesHi != null) { setFluxErrValuesHi(units.convertY(fluxErrValuesLo, specValues, fluxUnits, specUnits, newUnit)); } fluxUnits = newUnit; for (int i=0; i<this.getColumnCount(); i++) { if (StringUtils.contains(getColumnInfo(i).getUtype(), "flux")) getColumnInfo(i).setUnitString(newUnit.toString()); } }</code><technical_language>flux-related variables checked for 'not null', spectral-related variables (in lines 168-171)</technical_language>

Target:
public void setFluxUnits(YUnit newUnit) throws UnitsException { if (specValues == null) return; setFluxValues(units.convertY(fluxValues, specValues, fluxUnits, specUnits, newUnit)); setOriginalFluxValues(units.convertY(originalFluxValues, specValues, fluxUnits, specUnits, newUnit)); setFluxErrValues(units.convertY(fluxErrValues, specValues, fluxUnits, specUnits, newUnit)); setFluxErrValuesLo(units.convertY(fluxErrValuesLo, specValues, fluxUnits, specUnits, newUnit)); setFluxErrValuesHi(units.convertY(fluxErrValuesLo, specValues, fluxUnits, specUnits, newUnit)); fluxUnits = newUnit; for (int i=0; i<this.getColumnCount(); i++) { if (StringUtils.contains(getColumnInfo(i).getUtype(), "flux")) getColumnInfo(i).setUnitString(newUnit.toString()); } }
Source:
<code>default boolean isNull() { <START> throw new UnsupportedOperationException("DimensionSelector cannot be operated as numeric ColumnValueSelector" + this.getClass()); <END> }</code><technical_language>DimensionSelector is closer "object" selector, numeric. I this method return false. Indeed, return null getLong/Double/Float, *could* return null getObject()</technical_language>

Target:
default boolean isNull() { return false; }
Source:
<code>public void deleteAll(){ <START> getHibernateTemplate().deleteAll(getHibernateTemplate().find( <END> "from KeyValue")); }</code><technical_language>i understand data fetches database deletes. long KeyValue entity relation other entities I is HQL "delete KeyValue"</technical_language>

Target:
public void deleteAll(){ getHibernateTemplate().bulkUpdate("delete from KeyValue"); }
Source:
<code>public void dragOver(DropTargetDragEvent dragEvent) { NlDropEvent event = new NlDropEvent(dragEvent); Point location = event.getLocation(); myLastMouseX = location.x; myLastMouseY = location.y; ScreenView screenView = mySurface.getScreenView(myLastMouseX, myLastMouseY); if (screenView != null && myCurrentInteraction instanceof DragDropInteraction) { DragDropInteraction interaction = <START> (DragDropInteraction)myCurrentInteraction; <END> assert interaction.getTransferItem() != null; interaction.update(myLastMouseX, myLastMouseY, myLastStateMask); DragType dragType = event.getDropAction() == DnDConstants.ACTION_COPY ? DragType.COPY : DragType.MOVE; interaction.setType(dragType); NlModel model = screenView.getModel(); InsertType insertType = model.determineInsertType(dragType, interaction.getTransferItem(), true ); event.accept(insertType.isCreate() ? DnDConstants.ACTION_COPY : event.getDropAction()); } else { event.reject(); } }</code><technical_language>Space cast</technical_language>

Target:
public void dragOver(DropTargetDragEvent dragEvent) { NlDropEvent event = new NlDropEvent(dragEvent); Point location = event.getLocation(); myLastMouseX = location.x; myLastMouseY = location.y; ScreenView screenView = mySurface.getScreenView(myLastMouseX, myLastMouseY); if (screenView != null && myCurrentInteraction instanceof DragDropInteraction) { DragDropInteraction interaction = (DragDropInteraction)myCurrentInteraction; interaction.update(myLastMouseX, myLastMouseY, myLastStateMask); DragType dragType = event.getDropAction() == DnDConstants.ACTION_COPY ? DragType.COPY : DragType.MOVE; interaction.setType(dragType); NlModel model = screenView.getModel(); InsertType insertType = model.determineInsertType(dragType, interaction.getTransferItem(), true ); event.accept(insertType.isCreate() ? DnDConstants.ACTION_COPY : event.getDropAction()); } else { event.reject(); } }
Source:
<code>private void checkNewRepositoryParameters(IProcess2 process, Set<String> names) { ContextManagerHelper helper = new ContextManagerHelper(process.getContextManager()); Set<ContextItem> contextItemList = helper.getContextItems(); ContextItem item = (ContextItem) result.getParameter(); if (contextItemList.contains(item)) { ContextType contextType = getDefaultContextType(item); for (String paramName : names) { ContextParameterType contextParameterType = ContextUtils.getContextParameterTypeByName(contextType, paramName); helper.addContextParameterType(contextParameterType); } } <START> String remark = result.getRemark(); <END> if (remark != null && remark.endsWith(UpdatesConstants.CONTEXT_MODE)) { ConnectionContextHelper.showContextGroupDialog(process, item, process.getContextManager(), names); } }</code><technical_language>please add junit for this</technical_language>

Target:
private void checkNewRepositoryParameters(IProcess2 process, Set<String> names) { ContextManagerHelper helper = new ContextManagerHelper(process.getContextManager()); Set<ContextItem> contextItemList = helper.getContextItems(); ContextItem item = (ContextItem) result.getParameter(); if (contextItemList.contains(item)) { ContextType contextType = getDefaultContextType(item); for (String paramName : names) { ContextParameterType contextParameterType = ContextUtils.getContextParameterTypeByName(contextType, paramName); helper.addContextParameterType(contextParameterType); } } String remark = result.getRemark(); ConnectionContextHelper.showContextGroupDialog(process, item, process.getContextManager(), names, remark != null && remark.endsWith(UpdatesConstants.CONTEXT_MODE)); }
Source:
<code>public void testBlockLogoffAfterLogon() throws Exception { int freePort = AvailablePortFinder.getNextAvailable(); ServerThread serverThread = new ServerThread(freePort); try { serverThread.setDaemon(true); serverThread.start(); serverThread.waitForInitialization(); SessionID clientSessionID = new SessionID(FixVersions.BEGINSTRING_FIX42, "TW", "ISLD"); SessionSettings settings = getClientSessionSettings(clientSessionID, freePort); ClientApplication clientApplication = new ClientApplication(); final SocketInitiator initiator = new SocketInitiator(clientApplication, new MemoryStoreFactory(), settings, new DefaultMessageFactory()); try { clientApplication.stopAfterLogon(initiator); clientApplication.setUpLogonExpectation(); <START> initiator.start(); <END> assertFalse("wrong logon status", initiator.isLoggedOn()); assertEquals("wrong # of session", 1, initiator.getManagedSessions().size()); } finally { initiator.stop(); } } finally { serverThread.interrupt(); serverThread.join(); } }</code><technical_language>this for a potiential race condition initiator line below</technical_language>

Target:
public void testBlockLogoffAfterLogon() throws Exception { int freePort = AvailablePortFinder.getNextAvailable(); ServerThread serverThread = new ServerThread(freePort); try { serverThread.setDaemon(true); serverThread.start(); serverThread.waitForInitialization(); SessionID clientSessionID = new SessionID(FixVersions.BEGINSTRING_FIX42, "TW", "ISLD"); SessionSettings settings = getClientSessionSettings(clientSessionID, freePort); ClientApplication clientApplication = new ClientApplication(); final SocketInitiator initiator = new SocketInitiator(clientApplication, new MemoryStoreFactory(), settings, new DefaultMessageFactory()); try { clientApplication.stopAfterLogon(initiator); clientApplication.setUpLogonExpectation(); initiator.block(); assertFalse("wrong logon status", initiator.isLoggedOn()); assertEquals("wrong # of session", 1, initiator.getManagedSessions().size()); } finally { initiator.stop(); } } finally { serverThread.interrupt(); serverThread.join(); } }
Source:
<code>public ToneMappingNode(Context context) { screenGrabber = context.get(ScreenGrabber.class); DisplayResolutionDependentFBOs displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); FBO toneMappingFbo = requiresFBO(new FBOConfig(TONE_MAPPING_FBO, FULL_SCALE, FBO.Type.HDR), displayResolutionDependentFBOs); addDesiredStateChange(new BindFbo(toneMappingFbo)); addDesiredStateChange(new SetViewportToSizeOf(toneMappingFbo)); addDesiredStateChange(new EnableMaterial(TONE_MAPPING_MATERIAL)); toneMappingMaterial = getMaterial(TONE_MAPPING_MATERIAL); int textureSlot = 0; <START> addDesiredStateChange(new SetInputTextureFromFbo(textureSlot, displayResolutionDependentFBOs.get(INITIAL_POST_FBO), ColorTexture, displayResolutionDependentFBOs, TONE_MAPPING_MATERIAL, "texScene")); <END> }</code><technical_language>FBO manager is passed in anyway, leave additional constructor takes FBO's URN input, retrieves FBO manager simply passes constructor here? shorten this line others it</technical_language>

Target:
public ToneMappingNode(Context context) { screenGrabber = context.get(ScreenGrabber.class); DisplayResolutionDependentFBOs displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); FBO toneMappingFbo = requiresFBO(new FBOConfig(TONE_MAPPING_FBO_URI, FULL_SCALE, FBO.Type.HDR), displayResolutionDependentFBOs); addDesiredStateChange(new BindFbo(toneMappingFbo)); addDesiredStateChange(new SetViewportToSizeOf(toneMappingFbo)); addDesiredStateChange(new EnableMaterial(TONE_MAPPING_MATERIAL_URN)); toneMappingMaterial = getMaterial(TONE_MAPPING_MATERIAL_URN); int textureSlot = 0; addDesiredStateChange(new SetInputTextureFromFbo(textureSlot, INITIAL_POST_FBO_URI, ColorTexture, displayResolutionDependentFBOs, TONE_MAPPING_MATERIAL_URN, "texScene")); }
Source:
<code>void reportInternal(ReportPoint point) { try { validatePoint(point, validationConfig); } catch (DeltaCounterValueException e) { discardedCounterSupplier.get().inc(); return; } receivedPointLag.update(Clock.now() - point.getTimestamp()); if (point.getValue() instanceof Histogram && recompressor != null) { Histogram histogram = (Histogram) point.getValue(); point.setValue(recompressor.apply(histogram)); } if (point.getValue() instanceof Histogram) { <START> histogramTagCount.update(point.getAnnotations().size()); <END> } else { pointTagCount.update(point.getAnnotations().size()); } final String strPoint = serializer.apply(point); getTask().add(strPoint); getReceivedCounter().inc(); if (validItemsLogger != null) validItemsLogger.info(strPoint); }</code><technical_language>a single histogram tracking tag count, ReportPointHandlerImpl handle atom type anyway. separate histograms for points histograms is useful - impossible combinations ~proxy.histograms.2878.pointTagCount.p99, ~proxy.points.2878.histogramTagCount.p99, 0s waste pps</technical_language>

Target:
void reportInternal(ReportPoint point) { receivedTagCount.update(point.getAnnotations().size()); try { validatePoint(point, validationConfig); } catch (DeltaCounterValueException e) { discardedCounterSupplier.get().inc(); return; } receivedPointLag.update(Clock.now() - point.getTimestamp()); if (point.getValue() instanceof Histogram && recompressor != null) { Histogram histogram = (Histogram) point.getValue(); point.setValue(recompressor.apply(histogram)); } final String strPoint = serializer.apply(point); getTask().add(strPoint); getReceivedCounter().inc(); if (validItemsLogger != null) validItemsLogger.info(strPoint); }
Source:
<code>public long getStartTimeoutMillis() { long currentTimeMillis = System.currentTimeMillis(); long deadLine = startTimeMillis + workspaceStartTimeoutMillis; long timeout = deadLine - currentTimeMillis; <START> return timeout < 0 ? 0 : timeout; <END> }</code><technical_language>Code reduction proposal: return Math.max(0, deadLine - System.currentTimeMillis());</technical_language>

Target:
public long getStartTimeoutMillis() { long deadLine = startTimeMillis + workspaceStartTimeoutMillis; long timeout = deadLine - System.currentTimeMillis(); return Math.max(0, timeout); }
Source:
<code>public void testExecuteBatchPreparedStatement() throws Exception { try (Connection conn = DriverManager.getConnection(connectionStr)) { PreparedStatement stmt = conn.prepareStatement("insert into test (id, string_field) values (?, ?)"); stmt.setInt(1, 2); <START> stmt.setString(2, "foo"); <END> stmt.addBatch(); stmt.setInt(1, 3); stmt.setString(2, "bar"); stmt.addBatch(); stmt.setInt(1, 4); stmt.setString(2, "baz"); stmt.addBatch(); int[] results = stmt.executeBatch(); assertArrayEquals(new int[]{1, 1, 1}, results); conn.createStatement().execute("refresh table test"); ResultSet resultSet = conn.createStatement().executeQuery("select count(*) from test"); assertThat(resultSet.next(), is(true)); assertThat(resultSet.getLong(1), is(4L)); } }</code><technical_language>is needed a string column in this test? if remove pls</technical_language>

Target:
public void testExecuteBatchPreparedStatement() throws Exception { try (Connection conn = DriverManager.getConnection(connectionString)) { PreparedStatement stmt = conn.prepareStatement("insert into test (id) values (?)"); stmt.setInt(1, 2); stmt.addBatch(); stmt.setInt(1, 4); stmt.addBatch(); int[] results = stmt.executeBatch(); assertArrayEquals(new int[]{1, 1}, results); conn.createStatement().execute("refresh table test"); ResultSet resultSet = conn.createStatement().executeQuery("select count(*) from test"); assertThat(resultSet.next(), is(true)); assertThat(resultSet.getLong(1), is(2L)); } }
Source:
<code>public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getName()) <START> .append(" {id=") <END> .append(getId()) .append(", vdsId=") .append(getVdsId()) .append(", name=") .append(getName()) .append(", macAddress=") .append(getMacAddress()) .append(", networkName=") .append(getNetworkName()) .append(", bondName=") .append(getBondName()) .append(", bootProtocol=") .append(getBootProtocol()) .append(", address=") .append(getAddress()) .append(", subnet=") .append(getSubnet()) .append(", gateway=") .append(getGateway()) .append(", mtu=") .append(getMtu()) .append(", bridged=") .append(isBridged()) .append(", speed=") .append(getSpeed()) .append(", type=") .append(getType()) .append(", networkImplementationDetails=") .append(getNetworkImplementationDetails()) .append("]"); return builder.toString(); }</code><technical_language>open closing brackets match</technical_language>

Target:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getName()) .append(" {id=") .append(getId()) .append(", vdsId=") .append(getVdsId()) .append(", name=") .append(getName()) .append(", macAddress=") .append(getMacAddress()) .append(", networkName=") .append(getNetworkName()) .append(", bondName=") .append(getBondName()) .append(", bootProtocol=") .append(getBootProtocol()) .append(", address=") .append(getAddress()) .append(", subnet=") .append(getSubnet()) .append(", gateway=") .append(getGateway()) .append(", mtu=") .append(getMtu()) .append(", bridged=") .append(isBridged()) .append(", speed=") .append(getSpeed()) .append(", type=") .append(getType()) .append(", networkImplementationDetails=") .append(getNetworkImplementationDetails()) .append("}"); return builder.toString(); }
Source:
<code>public WebElement findElement(SearchContext context) { <START> for (By by : bys) { <END> WebElement element = getSearchingFunction(by).apply(context); if (element != null) { return element; } } throw new NoSuchElementException("Cannot locate an element using " + toString()); }</code><technical_language>java return bys.stream() .map(x -> getSearchingFunction(x).apply(context)) .filter(Optional::isPresent) .findFirst() .orElseThrow(() -> new NoSuchElementException("Cannot locate element " + toString()));</technical_language>

Target:
public WebElement findElement(SearchContext context) { return bys.stream() .map(by -> getSearchingFunction(by).apply(context)) .filter(Optional::isPresent) .map(Optional::get) .findFirst() .orElseThrow(() -> new NoSuchElementException("Cannot locate an element using " + toString())); }
Source:
<code>public AuthUser authenticate(final AuthRequest request) throws AuthException { List<AuthUser> authUsers = Lists.newArrayList(); List<AuthException> authExs = Lists.newArrayList(); for (AuthBackend backend : authBackends) { try { authUsers.add(checkNotNull(backend.authenticate(request))); } catch (MissingCredentialsException ex) { } catch (AuthException ex) { authExs.add(ex); } } if (authExs.isEmpty() && authUsers.isEmpty()) { throw new MissingCredentialsException(); <START> } else if (authExs.isEmpty() && authUsers.size() == 1) { <END> return authUsers.get(0); } else if (authExs.size() == 1 && authUsers.isEmpty()) { throw authExs.get(0); } String msg = String.format("Multiple AuthBackends attempted to handle request:" + " authUsers=%s authExs=%s", authUsers, authExs); throw new AuthException(msg); }</code><technical_language>I disagree: if authBackend provided a valid user other ... fine proceed. restriction other authBackend failed produce a valid result multiple auth backends</technical_language>

Target:
public AuthUser authenticate(final AuthRequest request) throws AuthException { List<AuthUser> authUsers = Lists.newArrayList(); List<AuthException> authExs = Lists.newArrayList(); for (AuthBackend backend : authBackends) { try { authUsers.add(checkNotNull(backend.authenticate(request))); } catch (MissingCredentialsException ex) { } catch (AuthException ex) { authExs.add(ex); } } if (authExs.isEmpty()) { return authUsers.get(0); } else if (authExs.size() == 1) { throw authExs.get(0); } else if (authExs.isEmpty() && authUsers.isEmpty()) { throw new MissingCredentialsException(); } String msg = String.format("Multiple AuthBackends attempted to handle request:" + " authUsers=%s authExs=%s", authUsers, authExs); throw new AuthException(msg); }
Source:
<code>public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if (totalItemCount < mPreviousTotalItemCount) { mCurrentPage = mStartingPageIndex; mPreviousTotalItemCount = totalItemCount; if (totalItemCount == 0) { <START> mLoading = true; <END> } } if (mLoading && (totalItemCount > mPreviousTotalItemCount)) { mLoading = false; mPreviousTotalItemCount = totalItemCount; mCurrentPage++; } if (!mLoading && (totalItemCount - visibleItemCount) <= (firstVisibleItem + mVisibleThreshold)) { mLoading = onLoadMore(mCurrentPage + 1, totalItemCount); } }</code><technical_language>this initially try load data this callback? loading manually, right? do prevent loading twice</technical_language>

Target:
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if (totalItemCount < mPreviousTotalItemCount) { mCurrentPage = mStartingPageIndex; mPreviousTotalItemCount = totalItemCount; if (totalItemCount == 0) { mLoading = true; } } if (mLoading && (totalItemCount > mPreviousTotalItemCount)) { mLoading = false; mPreviousTotalItemCount = totalItemCount; mCurrentPage++; } if (!mLoading && (totalItemCount - visibleItemCount) <= (firstVisibleItem + mVisibleThreshold)) { mLoading = onLoadMore(mCurrentPage + 1); } }
Source:
<code>private static void checkSensitiveArgument(RegularArgument regularArgument, SubscriptionContext ctx) { if (regularArgument.expression().is(Tree.Kind.NAME)) { <START> Symbol symbol = ((Name) regularArgument.expression()).symbol(); <END> if (symbol == null) { return; } List<Usage> bindingUsages = symbol.usages().stream().filter(Usage::isBindingUsage).collect(Collectors.toList()); if (bindingUsages.size() == 1) { Usage bindingUsage = bindingUsages.get(0); if (bindingUsage.kind().equals(Usage.Kind.ASSIGNMENT_LHS)) { AssignmentStatement assignmentStatement = (AssignmentStatement) TreeUtils.firstAncestorOfKind(bindingUsage.tree(), Tree.Kind.ASSIGNMENT_STMT); if (assignmentStatement.assignedValue().is(Tree.Kind.STRING_LITERAL, Tree.Kind.NUMERIC_LITERAL)) { ctx.addIssue(regularArgument, PREDICTABLE_SALT_MESSAGE).secondary(assignmentStatement, null); } } } } if (regularArgument.expression().is(Tree.Kind.STRING_LITERAL)) { ctx.addIssue(regularArgument, PREDICTABLE_SALT_MESSAGE); } }</code><technical_language>I utility method Expressions.singleAssignedValue</technical_language>

Target:
private static void checkSensitiveArgument(RegularArgument regularArgument, SubscriptionContext ctx) { if (regularArgument.expression().is(Tree.Kind.NAME)) { Expression expression = Expressions.singleAssignedValue((Name) regularArgument.expression()); if (expression == null) { return; } if (expression.is(Tree.Kind.STRING_LITERAL)) { AssignmentStatement assignmentStatement = (AssignmentStatement) TreeUtils.firstAncestorOfKind(expression, Tree.Kind.ASSIGNMENT_STMT); ctx.addIssue(regularArgument, PREDICTABLE_SALT_MESSAGE).secondary(assignmentStatement, null); } } if (regularArgument.expression().is(Tree.Kind.STRING_LITERAL)) { ctx.addIssue(regularArgument, PREDICTABLE_SALT_MESSAGE); } }
Source:
<code>private static Metadata deserialize(byte[] blob) { try { <START> return new ObjectMapper().readValue(blob, Metadata.class); <END> } catch (IOException e) { throw new RuntimeException(e); } }</code><technical_language>OBJECT_MAPPER</technical_language>

Target:
private static Metadata deserialize(byte[] blob) { try { return MAPPER.readValue(blob, Metadata.class); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
<code>public User updateUser(User user, Map<String, Boolean> requiredAttributes, List<String> allSimpleMultiValuedAttributes) throws CharonException, BadRequestException, NotFoundException { if (user.getId() == null) { <START> throw new NotFoundException("No user found with the id : " + user.getId()); <END> } inMemoryUserList.replace(user.getId(), user); return (User) CopyUtil.deepCopy(user); }</code><technical_language>is null right? If try print value? I Empty userID. Also, StringUtils</technical_language>

Target:
public User updateUser(User user, Map<String, Boolean> requiredAttributes, List<String> allSimpleMultiValuedAttributes) throws CharonException, BadRequestException, NotFoundException { if (StringUtils.isEmpty(user.getId())) { throw new NotFoundException("No user found. User id is empty."); } inMemoryUserList.replace(user.getId(), user); return (User) CopyUtil.deepCopy(user); }
Source:
<code>public void setZabState(ZabState zabState) { this.zabState.set(zabState); <START> LOG.info("Peer state changed: " + getDetailedPeerState()); <END> }</code><technical_language>nit: parameterized logging (and for subsequent log statements)</technical_language>

Target:
public void setZabState(ZabState zabState) { this.zabState.set(zabState); LOG.info("Peer state changed: {}", getDetailedPeerState()); }
Source:
<code>public void returnsGreatestPunchedTimeBeforeTimestampEvenIfNotAssociatedWithGreatestEligibleTimestamp() { <START> puncherStore.put(TIMESTAMP_BETWEEN_1_AND_2, WALL_CLOCK_BETWEEN_2_AND_3); <END> assertThat(puncherStore.getMillisForTimestamp(TIMESTAMP_2)) .isEqualTo(WALL_CLOCK_BETWEEN_2_AND_3) .isNotEqualTo(WALL_CLOCK_2); }</code><technical_language>cases more obvious a puncher store a map of like: 10 -> 200 20 -> 100. Agreed edge-casey. completely obvious _should_ do in this circumstance. is correct</technical_language>

Target:
public void returnsGreatestPunchedTimeBeforeTimestampEvenIfNotAssociatedWithGreatestEligibleTimestamp() { puncherStore = initializePuncherStore(PUNCHER_HISTORY_WITH_CLOCK_DRIFT); assertThat(puncherStore.getMillisForTimestamp(TIMESTAMP_2)) .isEqualTo(WALL_CLOCK_2) .isNotEqualTo(WALL_CLOCK_1); }
Source:
<code>public int run() throws IOException { Preconditions.checkArgument(samplePaths != null && !samplePaths.isEmpty(), "Sample CSV path is required"); Preconditions.checkArgument(samplePaths.size() == 1, "Only one CSV sample can be given"); Preconditions.checkArgument(linesToSample > 0, "At least one row must be sampled"); if (header != null) { noHeader = true; } CSVProperties props = new CSVProperties.Builder() .delimiter(delimiter) .escape(escape) .quote(quote) .header(header) .hasHeader(!noHeader) .linesToSkip(linesToSkip) <START> .linesToSample(linesToSample) <END> .charset(charsetName) .build(); Set<String> required = ImmutableSet.of(); if (requiredFields != null) { required = ImmutableSet.copyOf(requiredFields); } String sampleSchema = CSVUtil .inferNullableSchema( recordName, open(samplePaths.get(0)), props, required) .toString(!minimize); output(sampleSchema, console, outputPath); return 0; }</code><technical_language>This passed inferNullableSchema call below</technical_language>

Target:
public int run() throws IOException { Preconditions.checkArgument(samplePaths != null && !samplePaths.isEmpty(), "Sample CSV path is required"); Preconditions.checkArgument(samplePaths.size() == 1, "Only one CSV sample can be given"); Preconditions.checkArgument(numRecords > 0, "At least one row must be sampled"); if (header != null) { noHeader = true; } CSVProperties props = new CSVProperties.Builder() .delimiter(delimiter) .escape(escape) .quote(quote) .header(header) .hasHeader(!noHeader) .linesToSkip(linesToSkip) .charset(charsetName) .build(); Set<String> required = ImmutableSet.of(); if (requiredFields != null) { required = ImmutableSet.copyOf(requiredFields); } String sampleSchema = CSVUtil .inferNullableSchema( recordName, open(samplePaths.get(0)), props, required, numRecords) .toString(!minimize); output(sampleSchema, console, outputPath); return 0; }
Source:
<code>public List<Facility> getFacilitiesByHostName(PerunSession sess, String hostname) throws InternalErrorException { Utils.checkPerunSession(sess); List<Facility> facilities = getFacilitiesManagerBl().getFacilitiesByHostName(sess, hostname); if (!facilities.isEmpty()) { Iterator<Facility> facilityByHostname = facilities.iterator(); while(facilityByHostname.hasNext()) { <START> if(!AuthzResolver.isAuthorized(sess, Role.FACILITYADMIN, facilityByHostname.next()) && <END> !AuthzResolver.isAuthorized(sess, Role.PERUNOBSERVER)) { facilityByHostname.remove(); } } } return facilities; }</code><technical_language>This check is fundamentally wrong. return facilities for PERUNADMIN/PERUNOBSERVER filter response for FACILITYADMIN</technical_language>

Target:
public List<Facility> getFacilitiesByHostName(PerunSession sess, String hostname) throws InternalErrorException { Utils.checkPerunSession(sess); List<Facility> facilities = getFacilitiesManagerBl().getFacilitiesByHostName(sess, hostname); if (AuthzResolver.isAuthorized(sess, Role.PERUNOBSERVER)) { return facilities; } if (!facilities.isEmpty()) { Iterator<Facility> facilityByHostname = facilities.iterator(); while(facilityByHostname.hasNext()) { if(!AuthzResolver.isAuthorized(sess, Role.FACILITYADMIN, facilityByHostname.next())) { facilityByHostname.remove(); } } } return facilities; }
Source:
<code>public static void stopSyncServer() throws Exception { Request request = new Request.Builder() .url(STOP_SERVER) .build(); Response response; <START> int attempts = 3; <END> while (attempts > 0) { attempts--; try { response = client.newCall(request).execute(); if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); return; } catch (SocketTimeoutException e) { RealmLog.error("HTTP test server did not respond to /stop in time. Retrying."); } } throw new IllegalStateException("Failed to stop ROS."); }</code><technical_language>do need retries stop start</technical_language>

Target:
public static void stopSyncServer() throws Exception { Request request = new Request.Builder() .url(STOP_SERVER) .build(); Response response = client.newCall(request).execute(); if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); }
Source:
<code>public UserDTO updateUserCreatedOnBuddyRequest(UUID id, String tempPassword, UserDTO userResource) { User originalUserEntity = getEntityByID(id); <START> if (!originalUserEntity.isCreatedOnBuddyRequest()) <END> { throw new YonaException("User is not created on buddy request"); } UserEncryptedEntitySet retrievedEntitySet = retrieveUserEncryptedData(originalUserEntity, tempPassword); return saveUserEncryptedDataWithNewPassword(retrievedEntitySet, userResource); }</code><technical_language>Replace 4 lines assert ~originalUserEntity.isCreatedOnBuddyRequest()</technical_language>

Target:
public UserDTO updateUserCreatedOnBuddyRequest(UUID id, String tempPassword, UserDTO userResource) { User originalUserEntity = getEntityByID(id); if (!originalUserEntity.isCreatedOnBuddyRequest()) { throw new IllegalArgumentException("User is not created on buddy request"); } EncryptedUserData retrievedEntitySet = retrieveUserEncryptedData(originalUserEntity, tempPassword); return saveUserEncryptedDataWithNewPassword(retrievedEntitySet, userResource); }
Source:
<code>public BoltMessageLog( FileSystemAbstraction fileSystem, File logFile, Executor executor ) throws IOException { RotatingFileOutputStreamSupplier outputStreamSupplier = new RotatingFileOutputStreamSupplier( fileSystem, logFile, ROTATION_THRESHOLD_BYTES, ROTATION_DELAY_MS, MAX_ARCHIVES, executor ); <START> <END> FormattedLog formattedLog = FormattedLog.withUTCTimeZone().toOutputStream( outputStreamSupplier ); formattedLog.setLevel( Level.DEBUG ); this.inner = formattedLog; }</code><technical_language>file do logs goto</technical_language>

Target:
public BoltMessageLog( FileSystemAbstraction fileSystem, File logFile, Executor executor ) throws IOException { RotatingFileOutputStreamSupplier outputStreamSupplier = new RotatingFileOutputStreamSupplier( fileSystem, logFile, ROTATION_THRESHOLD_BYTES, ROTATION_DELAY_MS, MAX_ARCHIVES, executor ); DateFormat iso8601DateFormat = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSSZ" ); FormattedLog formattedLog = FormattedLog.withUTCTimeZone().withDateFormat( iso8601DateFormat ) .toOutputStream( outputStreamSupplier ); formattedLog.setLevel( Level.DEBUG ); this.inner = formattedLog; }
Source:
<code>public String getDimmer(String number) { <START> String content = HttpUtil.executeUrl(GET, createURL() <END> + "/" + XML_PATH + "?" + SUFFIX_PASSWORD + getPassword(), this.timeOut); content = XmlUtils.getContentOfElement(content, SUFFIX_DIMMER + number); double calc = Math.round(Double.parseDouble(XmlUtils.getContentOfElement(content, "Value"))/2.54); String string_value = String.valueOf((int)calc); return string_value; }</code><technical_language>Please extrace generated url a variable calling HttpUtil.executeUrl(), this debugging easier</technical_language>

Target:
public String getDimmer(String number) { String URL = createURL() + "/" + XML_PATH + "?" + SUFFIX_PASSWORD + getPassword(); String content = HttpUtil.executeUrl(GET, URL, this.timeOut); content = XmlUtils.getContentOfElement(content, SUFFIX_DIMMER + number); double dimmer_value = Double.parseDouble(XmlUtils.getContentOfElement(content, "Value")); double calc = Math.round(dimmer_value/2.54); String string_value = String.valueOf((int)calc); return string_value; }
Source:
<code>private Sorting.Direction convertDirection(Sort.Direction direction) { if (direction.toString().equalsIgnoreCase("desc")) { return Sorting.Direction.DESC; } else { return Sorting.Direction.ASC; } <START> } <END></code><technical_language>direction == Direction.DESC instead of converting string</technical_language>

Target:
private Sorting.Direction convertDirection(Sort.Direction direction) { if (direction != null) { if (direction == Sort.Direction.DESC) { return Sorting.Direction.DESC; } else { return Sorting.Direction.ASC; } } else { return defaultDirection; } }
Source:
<code>public InputStream readTemplatePath() { determineMessageFormat(); try { if (messageFormat == MessageFormat.CUSTOM) { return new FileInputStream(new File(templatePath)); } else { return getClass().getResourceAsStream(messageFormat.jarPath); } } catch (IOException e) { <START> throw new RuntimeException("Failed to read template in subscription " + name + ": " + e.getMessage(), e); <END> } }</code><technical_language>necessary e.getMessage() , e ... get message duplicated in logs</technical_language>

Target:
public InputStream readTemplatePath() { messageFormat = determineMessageFormat(); log.info("Using message format: to process artifacts for subscription: {}", messageFormat, name); try { if (messageFormat == MessageFormat.CUSTOM) { return new FileInputStream(new File(templatePath)); } else if (messageFormat.jarPath != null){ return getClass().getResourceAsStream(messageFormat.jarPath); } } catch (IOException e) { throw new RuntimeException("Failed to read template in subscription " + name, e); } return null; }
Source:
<code>Mono<PhoneNumberSearch>> createSearchActivationOperation(CreateSearchOptions options) { return (pollingContext) -> { Mono<PhoneNumberSearch> response = createSearch(options).flatMap(createSearchResponse -> { String searchId = createSearchResponse.getSearchId(); <START> PhoneNumberSearch phoneNumberSearch = new PhoneNumberSearch().setSearchId(searchId); <END> return Mono.just(phoneNumberSearch); }); return response; }; }</code><technical_language>is this work.. if assign searchId a new PhoneNumberSearch object? do - getSearchById(createSearchResponse.getSearchId())</technical_language>

Target:
createSearchActivationOperation(CreateSearchOptions options) { return (pollingContext) -> { Mono<PhoneNumberSearch> response = createSearch(options).flatMap(createSearchResponse -> { String searchId = createSearchResponse.getSearchId(); Mono<PhoneNumberSearch> phoneNumberSearch = getSearchById(searchId); return phoneNumberSearch; }); return response; }; }
Source:
<code>public boolean canFlipToNextPage() { boolean canFlip = true; if (!validatePage() || fileName.getText().equals("")) { canFlip = false; this.setErrorMessage(Messages.PapyrusProjectCreationPage_page_incorrect_desc + this.getProjectName().toLowerCase()); } IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); <START> for (IProject iproject : projects) { <END> if (this.getProjectName().equalsIgnoreCase(iproject.getName())) { canFlip = false; this.setErrorMessage(Messages.PapyrusProjectCreationPage_page_same_case_desc + this.getProjectName().toLowerCase()); } } return canFlip; }</code><technical_language>execute this loop is canFlip == true (If error found, is pointless search for another issue)</technical_language>

Target:
public boolean canFlipToNextPage() { boolean canFlip = true; if (!validatePage() || fileName.getText().equals("")) { canFlip = false; this.setErrorMessage(Messages.PapyrusProjectCreationPage_page_incorrect_desc + this.getProjectName().toLowerCase()); } IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); if (canFlip != false) { for (IProject iproject : projects) { if (this.getProjectName().equalsIgnoreCase(iproject.getName())) { canFlip = false; this.setErrorMessage(Messages.PapyrusProjectCreationPage_page_same_case_desc + iproject.getName()); break; } } } return canFlip; }