auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.debug("Entered SsoLoginServlet"); String scope = String.format("ovirt-app-admin ovirt-app-portal ovirt-ext=auth:sequence-priority=%s", EngineLocalConfig.getInstance().getProperty(authSequencePriorityPropertyName)); String redirectUri = String.format("%s://%s:%s%s", request.getScheme(), FiltersHelper.getRedirectUriServerName(request.getServerName()), request.getServerPort(), postActionUrl); String url = new URLBuilder(FiltersHelper.getEngineSsoUrl(request), "/oauth/authorize") .addParameter("client_id", EngineLocalConfig.getInstance().getProperty("ENGINE_SSO_CLIENT_ID")) .addParameter("response_type", "code") .addParameter("app_url", request.getParameter("app_url")) .addParameter("engine_url", FiltersHelper.getEngineUrl(request)) .addParameter("redirect_uri", redirectUri) .addParameter("scope", scope).build(); <START> log.debug("Redirecting to url: {}", url); <END> response.sendRedirect(url); }</code><technical_language>enclose url ': log.debug("Redirecting '{}'", url);</technical_language>

Target:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.debug("Entered SsoLoginServlet"); String scope = String.format("ovirt-app-admin ovirt-app-portal ovirt-ext=auth:sequence-priority=%s", EngineLocalConfig.getInstance().getProperty(authSequencePriorityPropertyName)); String redirectUri = String.format("%s://%s:%s%s", request.getScheme(), FiltersHelper.getRedirectUriServerName(request.getServerName()), request.getServerPort(), postActionUrl); String url = new URLBuilder(FiltersHelper.getEngineSsoUrl(request), "/oauth/authorize") .addParameter("client_id", EngineLocalConfig.getInstance().getProperty("ENGINE_SSO_CLIENT_ID")) .addParameter("response_type", "code") .addParameter("app_url", request.getParameter("app_url")) .addParameter("engine_url", FiltersHelper.getEngineUrl(request)) .addParameter("redirect_uri", redirectUri) .addParameter("scope", scope).build(); log.debug("Redirecting to '{}'", url); response.sendRedirect(url); }
Source:
<code>public void updateMeta(Session session, DbObject obj) { if (isMVStore()) { synchronizes (this) { int id = obj.getId(); <START> if (id > 0) { <END> if (!starting && !obj.isTemporary()) { Row newRow = meta.getTemplateRow(); MetaRecord.populateRowFromDBObject(obj, newRow); Row oldRow = metaIdIndex.getRow(session, id); if (oldRow != null) { meta.updateRow(session, oldRow, newRow); } } objectIds.set(id); } } } else { lockMeta(session); synchronized (this) { int id = obj.getId(); removeMeta(session, id); addMeta(session, obj); if(id > 0) { objectIds.set(id); } } } }</code><technical_language>this if block dodgy... checking id > 0 temporary, means update meta for non-temporary objects</technical_language>

Target:
public void updateMeta(Session session, DbObject obj) { if (isMVStore()) { synchronized (this) { int id = obj.getId(); if (id > 0) { if (!starting && !obj.isTemporary()) { Row newRow = meta.getTemplateRow(); MetaRecord.populateRowFromDBObject(obj, newRow); Row oldRow = metaIdIndex.getRow(session, id); if (oldRow != null) { meta.updateRow(session, oldRow, newRow); } } objectIds.set(id); } } } else { lockMeta(session); synchronized (this) { int id = obj.getId(); removeMeta(session, id); addMeta(session, obj); if(id > 0) { objectIds.set(id); } } } }
Source:
<code><START> public SubscriptionScheduleCollection list(Map<String, Object> params) throws StripeException { <END> return list(params, (RequestOptions) null); }</code><technical_language>@ob-stripe totally random do need duplicate collection classes? (nothing do autogen, realizing I asked in a while)</technical_language>

Target:
public static SubscriptionScheduleCollection list(Map<String, Object> params) throws StripeException { return list(params, (RequestOptions) null); }
Source:
<code>public String rewriteColumnType(ColumnType columnType, Integer columnSize) { if (columnType == ColumnType.INTEGER) { return "INT"; } <START> if (columnType == ColumnType.STRING && columnSize == null) { <END> return super.rewriteColumnType(columnType, 65535); } return super.rewriteColumnType(columnType, columnSize); }</code><technical_language>checking STRING enough here. I imagine a lot of Hive users more specific VARCHAR column type</technical_language>

Target:
public String rewriteColumnType(ColumnType columnType, Integer columnSize) { if (columnType == ColumnType.INTEGER) { return "INT"; } if(columnType == ColumnType.STRING) { return "STRING"; } if (columnType == ColumnType.VARCHAR && columnSize == null) { return super.rewriteColumnType(columnType, 65535); } return super.rewriteColumnType(columnType, columnSize); }
Source:
<code>public static Organization createDtoFromDbo(DBOOrganization dbo) { Organization dto = new Organization(); <START> dto.setCreatedBy("" + dbo.getCreatedBy()); <END> dto.setCreatedOn(dbo.getCreatedOn()); dto.setId(""+dbo.getId()); dto.setName(dbo.getName()); return dto; }</code><technical_language>String.valueOf</technical_language>

Target:
public static Organization createDtoFromDbo(DBOOrganization dbo) { Organization dto = new Organization(); dto.setCreatedBy(dbo.getCreatedBy().toString()); dto.setCreatedOn(dbo.getCreatedOn()); dto.setId(dbo.getId().toString()); dto.setName(dbo.getName()); return dto; }
Source:
<code>private AggregatedColumn(Column column, Function function) { <START> super(column.table, column.field, column.type); <END> this.function = function; this.sqlKeyword = function.toString() + "(" + column.getSqlKeyword() + ")"; this.alias = column.getSqlKeyword().replaceAll("\\.", "_") + "_" + function.name().toLowerCase(); }</code><technical_language>Sorry, I [this constructor](<LINK_0> as: this( column, function, function.toString() + "(" + column.getSqlKeyword() + ")", this.alias = column.getSqlKeyword().replaceAll("\\.", "_") + "_" + function.name().toLowerCase() ) Right</technical_language>

Target:
private AggregatedColumn(Column column, Function function) { this(column, function, createSqlKeyword(column, function), createAlias(column, function)); }
Source:
<code>public void shutdown() { log.info("Shutdown LogUnit server. Current epoch: {}, ", serverContext.getServerEpoch()); super.shutdown(); <START> executor.shutdown(); <END> logCleaner.shutdown(); batchWriter.close(); streamLog.close(); }</code><technical_language>This wait for tasks finish executing introduce a race a file descriptor leak. clearDataFiles interleaves call getSegmentHandleForAddress (i.e. read/inspectAddresses). Consider execution. A segment is closed, a read in re-opens segment, segment files deleted. this happen</technical_language>

Target:
public CompletableFuture<Void> shutdown() { log.info("Shutdown LogUnit server. Current epoch: {}, ", serverContext.getServerEpoch()); markShutdown(); return shutdownServerExecutor(executor) .exceptionally(ex -> { log.error("LogUitServer shutdown error", ex); return null; }) .thenCompose(empty -> logCleaner.shutdown()) .thenCompose(empty -> batchWriter.asyncClose()) .thenRun(streamLog::close); }
Source:
<code>public void start(ConnectionFactoryConfiguration config, ClassLoader classLoader) throws PersistenceException { PooledConnectionFactoryConfiguration poolConfig; if (config instanceof PooledConnectionFactoryConfiguration) { poolConfig = (PooledConnectionFactoryConfiguration) config; } else { throw new PersistenceException("ConnectionFactoryConfiguration passed in must be an instance of " + "PooledConnectionFactoryConfiguration"); } try { String propsFile = poolConfig.propertyFile(); if (propsFile != null) { dataSource = AgroalDataSource.from(new AgroalPropertiesReader(PROPERTIES_PREFIX).readProperties(propsFile)); } else { <START> Class<?> driverClass = Util.loadClass(poolConfig.driverClass(), null); <END> Class<?> driverClass = Util.loadClass(poolConfig.driverClass(), null); String password = poolConfig.password() != null ? poolConfig.password() : ""; AgroalDataSourceConfigurationSupplier configuration = new AgroalDataSourceConfigurationSupplier() .connectionPoolConfiguration(cp -> cp .maxSize(10) .acquisitionTimeout(Duration.ofSeconds(30)) .connectionFactoryConfiguration(cf -> cf .jdbcUrl(poolConfig.connectionUrl()) .connectionProviderClass(driverClass) .jdbcTransactionIsolation(AgroalConnectionFactoryConfiguration.TransactionIsolation.UNDEFINED) .principal(new NamePrincipal(poolConfig.username())) .credential(new SimplePassword(password)) )); dataSource = AgroalDataSource.from(configuration); } } catch (Exception e) { throw new PersistenceException("Failed to create a AgroalDataSource", e); } }</code><technical_language>@tristantarrant is building, variable driverClass declared</technical_language>

Target:
public void start(ConnectionFactoryConfiguration config, ClassLoader classLoader) throws PersistenceException { PooledConnectionFactoryConfiguration poolConfig; if (config instanceof PooledConnectionFactoryConfiguration) { poolConfig = (PooledConnectionFactoryConfiguration) config; } else { throw new PersistenceException("ConnectionFactoryConfiguration passed in must be an instance of " + "PooledConnectionFactoryConfiguration"); } try { String propsFile = poolConfig.propertyFile(); if (propsFile != null) { dataSource = AgroalDataSource.from(new AgroalPropertiesReader(PROPERTIES_PREFIX).readProperties(propsFile)); } else { Class<?> driverClass = Util.loadClass(poolConfig.driverClass(), null); String password = poolConfig.password() != null ? poolConfig.password() : ""; AgroalDataSourceConfigurationSupplier configuration = new AgroalDataSourceConfigurationSupplier() .connectionPoolConfiguration(cp -> cp .maxSize(10) .acquisitionTimeout(Duration.ofSeconds(30)) .connectionFactoryConfiguration(cf -> cf .jdbcUrl(poolConfig.connectionUrl()) .connectionProviderClass(driverClass) .jdbcTransactionIsolation(AgroalConnectionFactoryConfiguration.TransactionIsolation.UNDEFINED) .principal(new NamePrincipal(poolConfig.username())) .credential(new SimplePassword(password)) )); dataSource = AgroalDataSource.from(configuration); } } catch (Exception e) { throw new PersistenceException("Failed to create a AgroalDataSource", e); } }
Source:
<code>public int hashCode() { final int prime = 31; int result = 1; <START> result = prime * result + ((getAbstract() == null) ? 0 : getAbstract().hashCode()); <END> result = prime * result + ((getAccessConstraints() == null) ? 0 : getAccessConstraints().hashCode()); result = prime * result + (citeCompliant ? 1231 : 1237); result = prime * result + (enabled ? 1231 : 1237); result = prime * result + ((exceptionFormats == null) ? 0 : exceptionFormats.hashCode()); result = prime * result + ((fees == null) ? 0 : fees.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((getKeywords() == null) ? 0 : getKeywords().hashCode()); result = prime * result + ((getMaintainer() == null) ? 0 : getMaintainer().hashCode()); result = prime * result + ((getMetadataLink() == null) ? 0 : getMetadataLink().hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((getOnlineResource() == null) ? 0 : getOnlineResource().hashCode()); result = prime * result + ((outputStrategy == null) ? 0 : outputStrategy.hashCode()); result = prime * result + ((getSchemaBaseURL() == null) ? 0 : getSchemaBaseURL().hashCode()); result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode()); result = prime * result + (verbose ? 1231 : 1237); result = prime * result + ((versions == null) ? 0 : versions.hashCode()); return result; }</code><technical_language>Confused, is commit changing field access getters? method visibility of fields I late/lazy inizialization of them. This kind of change is reverted next time a IDE code generator update hashCode/equals</technical_language>

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((abstrct == null) ? 0 : abstrct.hashCode()); result = prime * result + ((accessConstraints == null) ? 0 : accessConstraints .hashCode()); result = prime * result + (citeCompliant ? 1231 : 1237); result = prime * result + (enabled ? 1231 : 1237); result = prime * result + ((exceptionFormats == null) ? 0 : exceptionFormats.hashCode()); result = prime * result + ((fees == null) ? 0 : fees.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((keywords == null) ? 0 : keywords.hashCode()); result = prime * result + ((maintainer == null) ? 0 : maintainer.hashCode()); result = prime * result + ((metadataLink == null) ? 0 : metadataLink.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((onlineResource == null) ? 0 : onlineResource.hashCode()); result = prime * result + ((outputStrategy == null) ? 0 : outputStrategy.hashCode()); result = prime * result + ((schemaBaseURL == null) ? 0 : schemaBaseURL.hashCode()); result = prime * result + ((title == null) ? 0 : title.hashCode()); result = prime * result + (verbose ? 1231 : 1237); result = prime * result + ((versions == null) ? 0 : versions.hashCode()); return result; }
Source:
<code>public void onBackPressed() { if (pager.getCurrentItem() != 0) { pager.setCurrentItem(pager.getCurrentItem() - 1, true); } else { if(defaultKvStore.getBoolean("firstrun",true)){ <START> finishAffinity(); <END> } else{ finish(); } } }</code><technical_language>finishTask work too? I want task affinity</technical_language>

Target:
public void onBackPressed() { if (pager.getCurrentItem() != 0) { pager.setCurrentItem(pager.getCurrentItem() - 1, true); } else { if (defaultKvStore.getBoolean("firstrun", true)) { finishAffinity(); } else { super.onBackPressed(); } } }
Source:
<code>public void timestampIsCorrect() throws InterruptedException { assumeTrue(androidx.camera.testing.CameraUtil.hasCameraWithLensFacing(mLensFacing)); assumeTrue(ExtensionsManager.isExtensionAvailable(mEffectMode, mLensFacing)); enableExtension(mEffectMode, mLensFacing); ImageCapture imageCapture = new ImageCapture(mImageCaptureConfigBuilder.build()); PreviewConfig previewConfig = mPreviewConfigBuilder .build(); CaptureProcessor previewCaptureProcessor = previewConfig.getCaptureProcessor(null); assumeNotNull(previewCaptureProcessor); mPreviewConfigBuilder.setCaptureProcessor( new TimestampCaptureProcessor(previewCaptureProcessor, mTimestampListener)); Preview preview = new Preview(mPreviewConfigBuilder.build()); preview.setOnPreviewOutputUpdateListener(previewOutput -> { mProcessingHandler.post(() -> previewOutput.getSurfaceTexture() .attachToGLContext(GLUtil.getTexIdFromGLContext())); previewOutput.getSurfaceTexture().setOnFrameAvailableListener( mOnFrameAvailableListener, mProcessingHandler); mSurfaceTextureLatch.countDown(); } ); mMainHandler.post(() -> { CameraX.bindToLifecycle(mLifecycleOwner, preview, imageCapture); mLifecycleOwner.startAndResume(); }); assertTrue(mSurfaceTextureLatch.await(1000, TimeUnit.MILLISECONDS)); assertTrue(mInputTimestampsLatch.await(1000, TimeUnit.MILLISECONDS)); <START> mOutputTimestampsLatch.await(3000, TimeUnit.MILLISECONDS); <END> assertEquals(mInputTimestamps, mOutputTimestamps); }</code><technical_language>wait for 3 seconds confidence finish. input output this</technical_language>

Target:
public void timestampIsCorrect() throws InterruptedException { assumeTrue(androidx.camera.testing.CameraUtil.hasCameraWithLensFacing(mLensFacing)); assumeTrue(ExtensionsManager.isExtensionAvailable(mEffectMode, mLensFacing)); enableExtension(mEffectMode, mLensFacing); ImageCapture imageCapture = new ImageCapture(mImageCaptureConfigBuilder.build()); PreviewConfig previewConfig = mPreviewConfigBuilder .build(); CaptureProcessor previewCaptureProcessor = previewConfig.getCaptureProcessor(null); assumeNotNull(previewCaptureProcessor); mPreviewConfigBuilder.setCaptureProcessor( new TimestampCaptureProcessor(previewCaptureProcessor, mTimestampListener)); Preview preview = new Preview(mPreviewConfigBuilder.build()); preview.setOnPreviewOutputUpdateListener(previewOutput -> { mProcessingHandler.post(() -> previewOutput.getSurfaceTexture() .attachToGLContext(GLUtil.getTexIdFromGLContext())); previewOutput.getSurfaceTexture().setOnFrameAvailableListener( mOnFrameAvailableListener, mProcessingHandler); mSurfaceTextureLatch.countDown(); } ); mMainHandler.post(() -> { CameraX.bindToLifecycle(mLifecycleOwner, preview, imageCapture); mLifecycleOwner.startAndResume(); }); assertTrue(mSurfaceTextureLatch.await(1000, TimeUnit.MILLISECONDS)); assertTrue(mInputTimestampsLatch.await(1000, TimeUnit.MILLISECONDS)); assertTrue(mOutputTimestampsLatch.await(1000, TimeUnit.MILLISECONDS)); assertEquals(mInputTimestamps, mOutputTimestamps); }
Source:
<code>public Map<Locator, MetricData> getEnumMetricDataForRangeForLocatorList(final List<Locator> locators, final Range range, final Granularity gran) { String columnFamily = CassandraModel.getColumnFamily(BluefloodEnumRollup.class, gran).getName(); <START> if ( columnFamily == null ) { <END> throw new IllegalArgumentException("invalid granularity: " + gran); } return getEnumMetricDataForRangeForLocatorList(locators, range, columnFamily); }</code><technical_language>this happen</technical_language>

Target:
public Map<Locator, MetricData> getEnumMetricDataForRangeForLocatorList(final List<Locator> locators, final Range range, final Granularity gran) { String columnFamily = CassandraModel.getColumnFamily(BluefloodEnumRollup.class, gran).getName(); return getEnumMetricDataForRangeForLocatorList(locators, range, columnFamily); }
Source:
<code>public boolean conforms() { final T inType = in().firstElement(); return inType instanceof Unsigned128BitType || inType instanceof UnsignedLongType || inType instanceof UnboundedIntegerType || <START> inType instanceof LongType; <END> }</code><technical_language>this replaced like: java final T inType = in().firstElement(); if (inType instanceof IntegerType) { final IntegerType<?> copy = (IntegerType<?>) inType.createVariable(); copy.setInteger(Long.MAX_VALUE); return copy.getIntegerLong() == Long.MAX_VALUE; } return false; This need instanceofs (still ). work if another large IntegerType added</technical_language>

Target:
public boolean conforms() { final Object inType = in().firstElement(); if (!(inType instanceof IntegerType)) return false; final T copy = in().firstElement().createVariable(); copy.setInteger(Long.MAX_VALUE); return copy.getIntegerLong() == Long.MAX_VALUE; }
Source:
<code>protected void setPatternListener() { mPatternLockView.addPatternLockListener(new PatternLockViewListener() { @Override public void onStarted() { Log_OC.d(TAG, "Pattern Drawing Started"); } @Override public void onProgress(List<PatternLockView.Dot> list) { Log_OC.d(TAG, "Pattern Progress " + PatternLockUtils.patternToString(mPatternLockView, list)); } @Override public void onComplete(List<PatternLockView.Dot> list) { if (ACTION_REQUEST_WITH_RESULT.equals(getIntent().getAction())) { <START> if (mCount == 0) { <END> mPatternValue = PatternLockUtils.patternToString(mPatternLockView, list); mCount++; } else { mNewPatternValue = PatternLockUtils.patternToString(mPatternLockView, list); mCount = 0; } } else { mPatternValue = PatternLockUtils.patternToString(mPatternLockView, list); } Log_OC.d(TAG, "Pattern " + PatternLockUtils.patternToString(mPatternLockView, list)); processPattern(); } @Override public void onCleared() { Log_OC.d(TAG, "Pattern has been cleared"); } }); }</code><technical_language>Do need this counter? check time mPatternValue is empty set input mNewPatternValue in case</technical_language>

Target:
protected void setPatternListener() { mPatternLockView.addPatternLockListener(new PatternLockViewListener() { @Override public void onStarted() { Log_OC.d(TAG, "Pattern Drawing Started"); } @Override public void onProgress(List<PatternLockView.Dot> list) { Log_OC.d(TAG, "Pattern Progress " + PatternLockUtils.patternToString(mPatternLockView, list)); } @Override public void onComplete(List<PatternLockView.Dot> list) { if (ACTION_REQUEST_WITH_RESULT.equals(getIntent().getAction())) { if (mPatternValue == null || mPatternValue.length() <= 0) { mPatternValue = PatternLockUtils.patternToString(mPatternLockView, list); } else { mNewPatternValue = PatternLockUtils.patternToString(mPatternLockView, list); } } else { mPatternValue = PatternLockUtils.patternToString(mPatternLockView, list); } Log_OC.d(TAG, "Pattern " + PatternLockUtils.patternToString(mPatternLockView, list)); processPattern(); } @Override public void onCleared() { Log_OC.d(TAG, "Pattern has been cleared"); } }); }
Source:
<code>public void frameSpecificValues() throws Throwable { SyncUtil.runToLocation("PrintHello"); MIStoppedEvent stoppedEvent = SyncUtil.step(StepType.STEP_OVER); <START> Integer depth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); <END> assertTrue((depth == Integer.valueOf(4))); String sp_name = resolveStackPointerName(); IFrameDMContext frame0 = SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 0); IRegisterDMContext[] registers_f0 = getRegisters(frame0); MIRegisterDMC sp_reg_f0 = (MIRegisterDMC) findStackPointerRegister(sp_name, registers_f0); assertNotNull(sp_reg_f0); String sp_f0_str = getModelDataForRegisterDataValue(frame0, IFormattedValues.HEX_FORMAT, sp_reg_f0.getRegNo()); IFrameDMContext frame1 = SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 1); IRegisterDMContext[] registers_f1 = getRegisters(frame1); MIRegisterDMC sp_reg_f1 = (MIRegisterDMC) findStackPointerRegister(sp_name, registers_f1); assertNotNull(sp_reg_f1); String sp_f1_str = getModelDataForRegisterDataValue(frame1, IFormattedValues.HEX_FORMAT, sp_reg_f1.getRegNo()); assertNotEquals("Stack pointers shall be different among frames", sp_f0_str, sp_f1_str); }</code><technical_language>making this int? replace assertTrue with: assertEquals(4, depth);</technical_language>

Target:
public void frameSpecificValues() throws Throwable { SyncUtil.runToLocation("PrintHello"); MIStoppedEvent stoppedEvent = SyncUtil.step(StepType.STEP_OVER); int depth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); assertEquals(4, depth); String sp_name = resolveStackPointerName(); assertNotNull(sp_name); IFrameDMContext frame0 = SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 0); IRegisterDMContext[] registers_f0 = getRegisters(frame0); MIRegisterDMC sp_reg_f0 = (MIRegisterDMC) findStackPointerRegister(sp_name, registers_f0); assertNotNull(sp_reg_f0); String sp_f0_str = getModelDataForRegisterDataValue(frame0, IFormattedValues.HEX_FORMAT, sp_reg_f0.getRegNo()); IFrameDMContext frame1 = SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 1); IRegisterDMContext[] registers_f1 = getRegisters(frame1); MIRegisterDMC sp_reg_f1 = (MIRegisterDMC) findStackPointerRegister(sp_name, registers_f1); assertNotNull(sp_reg_f1); String sp_f1_str = getModelDataForRegisterDataValue(frame1, IFormattedValues.HEX_FORMAT, sp_reg_f1.getRegNo()); assertNotEquals("Stack pointers shall be different among frames", sp_f0_str, sp_f1_str); }
Source:
<code>private static List<SqlDecimal> decimalSequence(String start, String step, int items, int precision, int scale) { BigInteger decimalStep = new BigInteger(step); List<SqlDecimal> values = new ArrayList<>(); BigInteger nextValue = new BigInteger(start); for (int i = 0; i < items; i++) { <START> SqlDecimal s = new SqlDecimal(nextValue, precision, scale); <END> values.add(s); nextValue = nextValue.add(decimalStep); } return values; }</code><technical_language>abbreviate; here, inline variable: values.add(new SqlDecimal(nextValue, precision, scale));</technical_language>

Target:
private static List<SqlDecimal> decimalSequence(String start, String step, int items, int precision, int scale) { BigInteger decimalStep = new BigInteger(step); List<SqlDecimal> values = new ArrayList<>(); BigInteger nextValue = new BigInteger(start); for (int i = 0; i < items; i++) { values.add(new SqlDecimal(nextValue, precision, scale)); nextValue = nextValue.add(decimalStep); } return values; }
Source:
<code>public static String formatCaptions(List<UploadMediaDetail> uploadMediaDetails) { StringBuilder captionListString = new StringBuilder(); <START> captionListString.append("{\\\"labels\\\":{"); <END> UploadMediaDetail uploadMediaDetail = uploadMediaDetails.get(0); String individualDescription = "\\\""+uploadMediaDetail.getLanguageCode()+"\\\":{\\\"language\\\":\\\""+uploadMediaDetail.getLanguageCode()+"\\\",\\\"value\\\":\\\""+uploadMediaDetail.getLanguageCode()+"-"+uploadMediaDetail.getCaptionText()+"\\\"}"; captionListString.append(individualDescription); for (int i = 1;i<= uploadMediaDetails.size() - 1; i++) { uploadMediaDetail = uploadMediaDetails.get(i); individualDescription = ",\\\""+uploadMediaDetail.getLanguageCode()+"\\\":{\\\"language\\\":\\\""+uploadMediaDetail.getLanguageCode()+"\\\",\\\"value\\\":\\\""+uploadMediaDetail.getLanguageCode()+"-"+uploadMediaDetail.getCaptionText()+"\\\"}"; captionListString.append(individualDescription); } Timber.e(captionListString.toString()); return captionListString.toString(); }</code><technical_language>This is confusing prone error, Please JsonObject obect.toJson()(using Gson), for making this JSONObject</technical_language>

Target:
public static HashMap<String, String> formatCaptions(List<UploadMediaDetail> uploadMediaDetails) { HashMap<String, String> caption = new HashMap<>(); for (UploadMediaDetail uploadMediaDetail : uploadMediaDetails) { caption.put(uploadMediaDetail.getLanguageCode(),uploadMediaDetail.getCaptionText()); } return caption; }
Source:
<code>TokenCacheItem getRegularRefreshTokenCacheItem(final String resource, final String clientId, final String user) { <START> CacheEvent cacheEvent = startCacheTelemetryRequest(EventStrings.TOKEN_TYPE_RT); <END> final String cacheKey = CacheKey.createCacheKeyForRTEntry(mAuthority, resource, clientId, user); final TokenCacheItem item = mTokenCacheStore.getItem(cacheKey); if (item != null) { cacheEvent.setTokenTypeRT(true); } Telemetry.getInstance().stopEvent(mTelemetryRequestId, cacheEvent, EventStrings.TOKEN_CACHE_LOOKUP); return item; }</code><technical_language>CacheEvent cacheEvent [](start = 8, length = 21) line 94 line 111 :) #Closed</technical_language>

Target:
TokenCacheItem getRegularRefreshTokenCacheItem(final String resource, final String clientId, final String user) { final CacheEvent cacheEvent = startCacheTelemetryRequest(EventStrings.TOKEN_TYPE_RT); final String cacheKey = CacheKey.createCacheKeyForRTEntry(mAuthority, resource, clientId, user); final TokenCacheItem item = mTokenCacheStore.getItem(cacheKey); if (item != null) { cacheEvent.setTokenTypeRT(true); } Telemetry.getInstance().stopEvent(mTelemetryRequestId, cacheEvent, EventStrings.TOKEN_CACHE_LOOKUP); return item; }
Source:
<code>BasePackSubscribeConnection(PackTransport packTransport) { super(packTransport); <START> closed = false; <END> }</code><technical_language>Unnecessary, booleans default false</technical_language>

Target:
BasePackSubscribeConnection(PackTransport packTransport) { super(packTransport); }
Source:
<code>public static MetadataTypeArgs parseArguments(CommandArgIterator argIter) { String typeName = null; Integer typeId = null; while (argIter.hasNextSubArg() && typeName == null && typeId == null) { String optName = argIter.nextArg("Expecting " + TYPE_NAME + " or " + TYPE_ID); switch (optName) { case TYPE_NAME: typeName = argIter.nextArg("type name"); break; case TYPE_ID: typeId = argIter.nextIntArg("typeId"); break; } } if (typeName == null && typeId == null) { throw new IllegalArgumentException("Type to remove is not specified. " + <START> "Please add one of the options: --typeName <type_name> or --typeId <type_ID>"); <END> } return new MetadataTypeArgs(typeName, typeId); }</code><technical_language>type_ID -> type_id</technical_language>

Target:
public static MetadataTypeArgs parseArguments(CommandArgIterator argIter) { String typeName = null; Integer typeId = null; while (argIter.hasNextSubArg() && typeName == null && typeId == null) { String optName = argIter.nextArg("Expecting " + TYPE_NAME + " or " + TYPE_ID); switch (optName) { case TYPE_NAME: typeName = argIter.nextArg("type name"); break; case TYPE_ID: typeId = argIter.nextIntArg("typeId"); break; } } if (typeName == null && typeId == null) { throw new IllegalArgumentException("Type to remove is not specified. " + "Please add one of the options: --typeName <type_name> or --typeId <type_id>"); } return new MetadataTypeArgs(typeName, typeId); }
Source:
<code>public Integer get(Cursor cursor) { <START> return new SmartDarkening(mDarkenThreshold, super.get(cursor)).argb(); <END> }</code><technical_language>consider this return Color instead of Integer</technical_language>

Target:
public Integer get(Cursor cursor) { return new SmoothLightnessCapped(mDarkenThreshold, super.get(cursor)).argb(); }
Source:
<code>private void sendQueries() { long elapsedNs = System.nanoTime() - start; if (elapsedNs > timeoutNs) { LOG.warn("[{}] Schema agreement not reached after {}", logPrefix, NanoTime.format(elapsedNs)); result.complete(false); } CompletionStage<AdminResult> localQuery = query("SELECT schema_version FROM system.local WHERE key='local'"); CompletionStage<AdminResult> peersQuery = query("SELECT peer, rpc_address, schema_version FROM system.peers"); localQuery .thenCombine(peersQuery, this::extractSchemaVersions) <START> .whenComplete(this::completeOrReschedule); <END> }</code><technical_language>Noticed while testing checker future completes, code return here? verify schema agrees. I.e., default timeout set 10s, i noticed logs after: 14:45:27.949 [c0-io-0] WARN c.d.o.d.i.c.m.SchemaAgreementChecker - [c0] Schema agreement reached 22 s</technical_language>

Target:
private void sendQueries() { long elapsedNs = System.nanoTime() - start; if (elapsedNs > timeoutNs) { String message = String.format( "[%s] Schema agreement not reached after %s", logPrefix, NanoTime.format(elapsedNs)); if (warnOnFailure) { LOG.warn(message); } else { LOG.debug(message); } result.complete(false); } else { CompletionStage<AdminResult> localQuery = query("SELECT schema_version FROM system.local WHERE key='local'"); CompletionStage<AdminResult> peersQuery = query("SELECT peer, rpc_address, schema_version FROM system.peers"); localQuery .thenCombine(peersQuery, this::extractSchemaVersions) .whenComplete(this::completeOrReschedule); } }
Source:
<code>protected void setEscalationRules(DocumentModel node, Map<String, Serializable>... rules) { <START> node.setPropertyValue(GraphNode.PROP_ESCALATION_RULES, (Serializable) Arrays.asList(rules)); <END> }</code><technical_language>List.of in Cleanup / Format commit</technical_language>

Target:
protected void setEscalationRules(DocumentModel node, Map<String, Serializable>... rules) { node.setPropertyValue(GraphNode.PROP_ESCALATION_RULES, (Serializable) List.of(rules)); }
Source:
<code>public void removeItem(Column<T, ?> column) { <START> ColumnContextMenuItem<T> item = items.get(column); <END> if (item != null) { items.remove(column); container.remove(item); } }</code><technical_language>simplify this a this: ColumnContextMenuItem<T> removedItem = items.remove(column); if (removedItem != null) { container.remove(item); } if item exist in map, calling remove return null</technical_language>

Target:
public void removeItem(Column<T, ?> column) { ColumnContextMenuItem<T> removedItem = items.remove(column); if (removedItem != null) { container.remove(removedItem); } }
Source:
<code><START> protected ClientProxyConnector initializeProxyConnector() throws Exception { <END> ClientProxyConnector proxyConnector = getClientProxyConnector(); if (proxyConnector == null) { return null; } try { proxyConnector.sendClientProxyMetadata(this); return proxyConnector; } catch (Throwable t) { log.warn("initializeProxyConnector({}) failed ({}) to send proxy metadata: {}", this, t.getClass().getSimpleName(), t.getMessage()); if (log.isDebugEnabled()) { log.debug("initializeProxyConnector(" + this + ") proxy metadata send failure details", t); } if (t instanceof Exception) { throw (Exception) t; } else { throw new RuntimeSshException(t); } } }</code><technical_language>return ClientProxyConnector here? place called return is ignored, subclasses get getClientProxyConnector() anyway</technical_language>

Target:
protected void initializeProxyConnector() throws Exception { ClientProxyConnector proxyConnector = getClientProxyConnector(); boolean debugEnabled = log.isDebugEnabled(); if (proxyConnector == null) { if (debugEnabled) { log.debug("initializeProxyConnector({}) no proxy to initialize", this); } return; } try { if (debugEnabled) { log.debug("initializeProxyConnector({}) initialize proxy={}", this, proxyConnector); } proxyConnector.sendClientProxyMetadata(this); if (debugEnabled) { log.debug("initializeProxyConnector({}) proxy={} initialized", this, proxyConnector); } } catch (Throwable t) { log.warn("initializeProxyConnector({}) failed ({}) to send proxy metadata: {}", this, t.getClass().getSimpleName(), t.getMessage()); if (debugEnabled) { log.debug("initializeProxyConnector(" + this + ") proxy metadata send failure details", t); } if (t instanceof Exception) { throw (Exception) t; } else { throw new RuntimeSshException(t); } } }
Source:
<code>public void typeAndWaitText(String text) { <START> waitFormToOpen(); <END> new WebDriverWait(seleniumWebDriver, TestTimeoutsConstants.LOAD_PAGE_TIMEOUT_SEC) .until(ExpectedConditions.visibilityOf(input)) .sendKeys(text); waitInputNameContains(text); }</code><technical_language>checked call of method</technical_language>

Target:
public void typeAndWaitText(String text) { loadPageWait.until(visibilityOf(input)).sendKeys(text); waitInputNameContains(text); }
Source:
<code>protected void addDescriptiveTextsAndExtensions(XmlStringBuilder xml) { for (Map.Entry<String, String> entry : descriptiveTexts.entrySet()) { String xmllang = entry.getKey(); String text = entry.getValue(); xml.halfOpenElement("text").xmlnsAttribute(textNamespace) <START> .xmllangAttribute("".equals(xmllang) ? null : xmllang) <END> .rightAngleBracket(); xml.escape(text); xml.closeElement("text"); } for (ExtensionElement packetExtension : extensions) { xml.append(packetExtension.toXML()); } }</code><technical_language>is a bit trickier. While is XmlStringBuilder.optXmlLangAttribute(String) method checks if argument is null. I safe extend semantic of optXmlLangAttribute() StringUtils.isNotNullOrEmpty(String), suitable here. avoid conditional operator construct</technical_language>

Target:
protected void addDescriptiveTextsAndExtensions(XmlStringBuilder xml) { for (Map.Entry<String, String> entry : descriptiveTexts.entrySet()) { String xmllang = entry.getKey(); String text = entry.getValue(); xml.halfOpenElement("text").xmlnsAttribute(textNamespace) .optXmlLangAttribute(xmllang) .rightAngleBracket(); xml.escape(text); xml.closeElement("text"); } for (ExtensionElement packetExtension : extensions) { xml.append(packetExtension.toXML()); } }
Source:
<code>public void visitExpressionStatement(ExpressionStatementTree tree) { ExpressionTree expression = tree.expression(); if (expression.is(USELESS_KINDS)) { uselessNodes.add(tree); } if (expression.is(Kind.REGULAR_STRING_LITERAL) <START> && regularStringExceptionsPatterns().anyMatch(pattern -> !pattern.matcher(expression.toString()).find())) { <END> uselessNodes.add(tree); } super.visitExpressionStatement(tree); }</code><technical_language>expression.toString(), I prefer more explicit ((LiteralTree) expression).value()</technical_language>

Target:
public void visitExpressionStatement(ExpressionStatementTree tree) { ExpressionTree expression = tree.expression(); if (expression.is(USELESS_KINDS)) { uselessNodes.add(tree); } if (expression.is(Kind.REGULAR_STRING_LITERAL) && !STRING_LITERAL_EXCEPTION_PATTERN.matcher(((LiteralTree) expression).value()).find()) { uselessNodes.add(tree); } super.visitExpressionStatement(tree); }
Source:
<code>public void unlock() { <START> lockRefreshToken.ifPresent(lockService::unlock); <END> }</code><technical_language>lockRefreshToken set Optional.empty() here, isHeld() return true. a test for this</technical_language>

Target:
public void unlock() { timeLock.unlock(ImmutableSet.of(lockToken)); }
Source:
<code>public Object getConfigurationData(final HttpServletRequest request) { <START> final Response configurationResponse = configurationResource.list(request); <END> final Object entity = ResponseEntityView.class.cast(configurationResponse.getEntity()).getEntity(); return entity; }</code><technical_language>here: Instead of resource class, Helper class for ConfigurationResource</technical_language>

Target:
public Map<String, Object> getConfigurationData(final HttpServletRequest request) { try { return configurationHelper.getConfigProperties(request); } catch (LanguageException e) { throw new LanguageRuntimeException(e); } }
Source:
<code>public static OffsetTime of(LocalTime localTime, ZoneOffset zoneOffset) { <START> <END> final OffsetTime result = OffsetTime.newBuilder() .setTime(localTime) .setOffset(zoneOffset) .build(); return result; }</code><technical_language>I blank line adds value. Please remove</technical_language>

Target:
public static OffsetTime of(LocalTime localTime, ZoneOffset zoneOffset) { checkNotNull(localTime); checkNotNull(zoneOffset); final OffsetTime result = OffsetTime.newBuilder() .setTime(localTime) .setOffset(zoneOffset) .build(); return result; }
Source:
<code>private void _flushBloomFilter() { _logger.info("Flushing out bloom filter entries"); <START> writeTagsBloomFilterToFile(); <END> bloomFilter = BloomFilter.create(Funnels.stringFunnel(Charset.defaultCharset()), bloomFilterExpectedNumberInsertions , bloomFilterErrorRate); bloomFilterScopeOnly = BloomFilter.create(Funnels.stringFunnel(Charset.defaultCharset()), bloomFilterScopeOnlyExpectedNumberInsertions , bloomFilterScopeOnlyErrorRate); bloomFilterScopeAndMetricOnly = BloomFilter.create(Funnels.stringFunnel(Charset.defaultCharset()), bloomFilterScopeAndMetricOnlyExpectedNumberInsertions , bloomFilterScopeAndMetricOnlyErrorRate); bloomFilterMetatags = BloomFilter.create(Funnels.stringFunnel(Charset.defaultCharset()), bloomFilterMetatagsExpectedNumberInsertions , bloomFilterMetatagsErrorRate); randomNumber = rand.nextInt(); }</code><technical_language>writing state of bloom filter do a periodic daily flush _flushBloomFilter case restart schema client a day elapsed - BF a state, saving this a restart</technical_language>

Target:
private void _flushBloomFilter() { _logger.info("Flushing out bloom filter entries"); writeTagsBloomFilterToFile(); bloomFilter = BloomFilter.create(Funnels.stringFunnel(Charset.defaultCharset()), bloomFilterExpectedNumberInsertions , bloomFilterErrorRate); bloomFilterScopeOnly = BloomFilter.create(Funnels.stringFunnel(Charset.defaultCharset()), bloomFilterScopeOnlyExpectedNumberInsertions , bloomFilterScopeOnlyErrorRate); bloomFilterScopeAndMetricOnly = BloomFilter.create(Funnels.stringFunnel(Charset.defaultCharset()), bloomFilterScopeAndMetricOnlyExpectedNumberInsertions , bloomFilterScopeAndMetricOnlyErrorRate); bloomFilterMetatags = BloomFilter.create(Funnels.stringFunnel(Charset.defaultCharset()), bloomFilterMetatagsExpectedNumberInsertions , bloomFilterMetatagsErrorRate); }
Source:
<code><START> public boolean equals(Object o) { <END> if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } DistributionTrait other = (DistributionTrait) o; return type == other.type; }</code><technical_language>Suspicious traitDef is for in equals hashCode</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } DistributionTrait other = (DistributionTrait) o; return traitDef.equals(other.traitDef) && type == other.type; }
Source:
<code>public void constructor_constructRepoPickerState_oneRepoSelected() { <START> Set<String> existingRepositories = new HashSet<>(Arrays.asList("A/A", "B/B")); <END> RepositoryPickerState state = new RepositoryPickerState(existingRepositories); assertEquals("A/A", state.getSelectedRepositoryId()); }</code><technical_language>test data typical. letter org/repo names typical</technical_language>

Target:
public void constructor_constructRepoPickerState_oneRepoSelected() { Set<String> existingRepositories = new HashSet<>(Arrays.asList("atom/atom", "HubTurbo/HubTurbo")); RepositoryPickerState state = new RepositoryPickerState(existingRepositories); assertEquals("atom/atom", state.getSelectedRepositoryId()); }
Source:
<code>public boolean exists() { <START> return isDeleted || resource.exists(); <END> }</code><technical_language>implementation is strange this return true (meaning resource exists) a call delete, isDeleted true ???? do ? return resource.exists();</technical_language>

Target:
public boolean exists() { return !isDeleted && resource.exists(); }
Source:
<code>public static void increaseClientCountToOne() { if (ACTIVE_CLIENT_COUNT.get() == 0) { <START> ACTIVE_CLIENT_COUNT.set(1); <END> } }</code><technical_language>ACTIVE_CLIENT_COUNT.compareAndSet(0,1)</technical_language>

Target:
public static void increaseClientCountToOne() { ACTIVE_CLIENT_COUNT.compareAndSet(0,1); }
Source:
<code>public List<String> tables() { <START> final long TIMEOUT = 10000; <END> synchronized (db) { long started = System.currentTimeMillis(); long now = started; while (tables == null && now - started < TIMEOUT) { try { db.wait(TIMEOUT - (now - started)); } catch (InterruptedException e) { } now = System.currentTimeMillis(); } if (tables == null) { throw new CopycatException("Tables could not be updated quickly enough."); } return tables; } }</code><technical_language>10000L</technical_language>

Target:
public List<String> tables() { final long TIMEOUT = 10000L; synchronized (db) { long started = System.currentTimeMillis(); long now = started; while (tables == null && now - started < TIMEOUT) { try { db.wait(TIMEOUT - (now - started)); } catch (InterruptedException e) { } now = System.currentTimeMillis(); } if (tables == null) { throw new CopycatException("Tables could not be updated quickly enough."); } return tables; } }
Source:
<code>private void fillEventTypeAndTargetFromConfig( Set<EventTypeAndTarget> set, List<String> stringList) { for (String item : stringList) { if (item.trim().equals("")) { continue; } String[] split = item.split("-"); if (split.length != 2) { throw new IllegalArgumentException("Invalid include/exclude rule: " + item + "Each filter auditing" + "include/exclude must be in format TYPE-TARGET. For example MODIFIED-CONSUMER."); } try { Type type = Enum.valueOf(Type.class, split[0].trim()); Target target = Enum.valueOf(Target.class, split[1].trim()); set.add(new EventTypeAndTarget(type, target)); } catch (Exception ex) { <START> throw new IllegalArgumentException("Invalid filtering touple: " + item + <END> " . Please use only enum values of Type and Target enums, e.g. MODIFIED-CONSUMER"); } } }</code><technical_language>"tuple" here</technical_language>

Target:
private void fillEventTypeAndTargetFromConfig( Set<EventTypeAndTarget> set, List<String> stringList) { for (String item : stringList) { if (item.trim().equals("")) { continue; } String[] split = item.split("-"); if (split.length != 2) { throw new IllegalArgumentException("Invalid include/exclude rule: " + item + "Each filter auditing" + "include/exclude must be in format TYPE-TARGET. For example MODIFIED-CONSUMER."); } try { Type type = Enum.valueOf(Type.class, split[0].trim()); Target target = Enum.valueOf(Target.class, split[1].trim()); set.add(new EventTypeAndTarget(type, target)); } catch (Exception ex) { throw new IllegalArgumentException("Invalid filtering tuple: " + item + " . Please use only enum values of Type and Target enums, e.g. MODIFIED-CONSUMER"); } } }
Source:
<code>public void testDefault() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(TypecastParenPadCheck.class); final String[] expected = { "89:14: " + getCheckMessage(MSG_WS_FOLLOWED, "("), "89:21: " + getCheckMessage(MSG_WS_PRECEDED, ")"), }; <START> verify(checkConfig, getPath("InputWhitespace[TypecastParenPad].java"), expected); <END> }</code><technical_language>update original issue explain brackets. for show in file name. for confusion. check name right Input I expecting names InputTypecastParenPad.java, InputTypecastParenPadWhitespace.java, InputTypecastParenPadAround.java, etc. Naming InputTypecastParenPad similar original name is easier file if copied moved</technical_language>

Target:
public void testDefault() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(TypecastParenPadCheck.class); final String[] expected = { "89:14: " + getCheckMessage(MSG_WS_FOLLOWED, "("), "89:21: " + getCheckMessage(MSG_WS_PRECEDED, ")"), }; verify(checkConfig, getPath("InputTypecastParenPadWhitespace.java"), expected); }
Source:
<code>public LeasableRefreshLockResponse refresh(Set<LockToken> tokens) { <START> NanoTime startTime = NanoTime.now(); <END> Set<LockToken> refreshedTokens = heldLocks.refresh(tokens); return LeasableRefreshLockResponse.of( refreshedTokens, leaseWithStart(startTime)); }</code><technical_language>this mechanism, too</technical_language>

Target:
public RefreshLockResponseV2 refresh(Set<LockToken> tokens) { Leased<Set<LockToken>> refreshedTokens = heldLocks.refresh(tokens); return RefreshLockResponseV2.of( refreshedTokens.value(), refreshedTokens.lease()); }
Source:
<code>public List<String> tokenize(String input) { try (TokenStream ts = this.tokenStream("", input)) { ts.reset(); List<String> words = new ArrayList<>(); CharTermAttribute charTermAttribute = ts.getAttribute(CharTermAttribute.class); while (ts.incrementToken()) { words.add(charTermAttribute.toString()); } return <START> Collections.unmodifiableList(words); <END> } catch (IOException e) { throw new Error(e); } }</code><technical_language>guava is a dependency, I suggest ImmutableList, is slightly more space efficient</technical_language>

Target:
public final List<String> tokenize(String input) { try (TokenStream ts = this.tokenStream("", input)) { ts.reset(); ImmutableList.Builder<String> builder = ImmutableList.builder(); CharTermAttribute charTermAttribute = ts.getAttribute(CharTermAttribute.class); while (ts.incrementToken()) { builder.add(charTermAttribute.toString()); } return builder.build(); } catch (IOException e) { throw new Error(e); } }
Source:
<code><START> void trivialMatchers() <END> { assertMatch(any(), 42); assertMatch(any(), "John Doe"); assertMatch(typeOf(Integer.class), 42); assertMatch(typeOf(Number.class), 42); assertNoMatch(typeOf(Integer.class), "John Doe"); }</code><technical_language>[DONE] public</technical_language>

Target:
public void trivialMatchers() { assertMatch(any(), 42); assertMatch(any(), "John Doe"); assertMatch(typeOf(Integer.class), 42); assertMatch(typeOf(Number.class), 42); assertNoMatch(typeOf(Integer.class), "John Doe"); }
Source:
<code>public Iterator<Event> getEvents() { final File[] fileArray = bufferDir.listFiles(); if (fileArray == null) { <START> return new ArrayList<Event>(0).iterator(); <END> } final Iterator<File> files = Arrays.asList(fileArray).iterator(); return new Iterator<Event>() { private Event next = getNextEvent(files); @Override public boolean hasNext() { return next != null; } @Override public Event next() { Event toReturn = next; next = getNextEvent(files); return toReturn; } @Override public void remove() { throw new UnsupportedOperationException(); } }; }</code><technical_language>Collections.emptyIterator()</technical_language>

Target:
public Iterator<Event> getEvents() { final File[] fileArray = bufferDir.listFiles(); if (fileArray == null) { return Collections.emptyIterator(); } final Iterator<File> files = Arrays.asList(fileArray).iterator(); return new Iterator<Event>() { private Event next = getNextEvent(files); @Override public boolean hasNext() { return next != null; } @Override public Event next() { Event toReturn = next; next = getNextEvent(files); return toReturn; } @Override public void remove() { throw new UnsupportedOperationException(); } }; }
Source:
<code>public VDS getRandomUpServer(Guid clusterId) { List<VDS> servers = getAllUpServers(clusterId); if <START> (servers == null || servers.isEmpty()) { <END> return null; } return servers.get(new Random().nextInt(servers.size())); }</code><technical_language>this replaced org.apache.commons.collections.CollectionUtils.isEmpty(servers)</technical_language>

Target:
public VDS getRandomUpServer(Guid clusterId) { List<VDS> servers = getAllUpServers(clusterId); if (CollectionUtils.isEmpty(servers)) { return null; } return servers.get(new Random().nextInt(servers.size())); }