auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean performNextOperationLiveMerge(int completedChildren) { if (completedChildren != 0) { checkImageIdConsistency(completedChildren - 1); } Guid nextImageId = getParameters().getImageIds().get(completedChildren); log.info("Starting child command of {}, image '{}'", completedChildren + 1, getParameters().getImageIds().size(), nextImageId); ImagesContainterParametersBase parameters = buildRemoveSnapshotSingleDiskLiveParameters(nextImageId, completedChildren); <START> updateParameters(completedChildren, <END> parameters.getDestinationImageId()); CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.RemoveSnapshotSingleDiskLive, parameters, cloneContextAndDetachFromParent()); return true; }</code><technical_language>I updateParameters updates command params persist command. recommend do persistence here, i.e. out of updateParameters method</technical_language>

Target:
private boolean performNextOperationLiveMerge(int completedChildren) { if (completedChildren != 0) { checkImageIdConsistency(completedChildren - 1); } Guid nextImageId = getParameters().getImageIds().get(completedChildren); log.info("Starting child command of {}, image '{}'", completedChildren + 1, getParameters().getImageIds().size(), nextImageId); ImagesContainterParametersBase parameters = buildRemoveSnapshotSingleDiskLiveParameters(nextImageId, completedChildren); updateParameters(completedChildren, parameters.getDestinationImageId()); persistCommand(getParameters().getParentCommand(), true); CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.RemoveSnapshotSingleDiskLive, parameters, cloneContextAndDetachFromParent()); return true; }
Source:
<code>public <T> Flux<T> runQuery(SqlQuerySpec querySpec, Class<?> domainType, Class<T> returnType) { String containerName = domainType.getSimpleName(); CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); return cosmosAsyncClient.getDatabase(this.databaseName) .getContainer(containerName) .queryItems(querySpec, options, returnType) <START> .byPage() <END> .flatMap(cosmosItemFeedResponse -> { CosmosUtils .fillAndProcessResponseDiagnostics(this.responseDiagnosticsProcessor, cosmosItemFeedResponse.getCosmosDiagnostics(), cosmosItemFeedResponse); return Flux.fromIterable(cosmosItemFeedResponse.getResults()); }) .onErrorResume(throwable -> CosmosExceptionUtils.exceptionHandler("Failed to find items", throwable)); }</code><technical_language>Do need .publishOn(Schedulers.parallel()) here</technical_language>

Target:
public <T> Flux<T> runQuery(SqlQuerySpec querySpec, Class<?> domainType, Class<T> returnType) { String containerName = domainType.getSimpleName(); CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); return cosmosAsyncClient.getDatabase(this.databaseName) .getContainer(containerName) .queryItems(querySpec, options, returnType) .byPage() .publishOn(Schedulers.parallel()) .flatMap(cosmosItemFeedResponse -> { CosmosUtils .fillAndProcessResponseDiagnostics(this.responseDiagnosticsProcessor, cosmosItemFeedResponse.getCosmosDiagnostics(), cosmosItemFeedResponse); return Flux.fromIterable(cosmosItemFeedResponse.getResults()); }) .onErrorResume(throwable -> CosmosExceptionUtils.exceptionHandler("Failed to find items", throwable)); }
Source:
<code>public void testParcelling_withSmallBitmap_bitmapPreservedAfterParcelled() { final int testBitmapSize = 200; Bitmap testBitmap = Bitmap.createBitmap( testBitmapSize, testBitmapSize, Bitmap.Config.ARGB_8888); testBitmap.setPixel(2, 2, Color.GREEN); String testKey = MediaMetadata.METADATA_KEY_ALBUM_ART; MediaMetadata metadata = new Builder().putBitmap(testKey, testBitmap).build(); ParcelImpl parcelImpl = (ParcelImpl) ParcelUtils.toParcelable(metadata); try (AutoCloseableParcel p = AutoCloseableParcel.createWithParcelImpl(parcelImpl)) { MediaMetadata metadataFromParcel = ParcelUtils.fromParcelable(ParcelImpl.CREATOR.createFromParcel(p.parcel)); <START> assertEquals(testBitmapSize, metadata.getBitmap(testKey).getHeight()); assertEquals(testBitmapSize, metadata.getBitmap(testKey).getWidth()); assertTrue(testBitmap.sameAs(metadata.getBitmap(testKey))); <END> } }</code><technical_language>nit: sameAs sufficient</technical_language>

Target:
public void testParcelling_withSmallBitmap_bitmapPreservedAfterParcelled() { final int testBitmapSize = 200; Bitmap testBitmap = Bitmap.createBitmap( testBitmapSize, testBitmapSize, Bitmap.Config.ARGB_8888); testBitmap.setPixel(2, 2, Color.GREEN); String testKey = MediaMetadata.METADATA_KEY_ALBUM_ART; MediaMetadata metadata = new Builder().putBitmap(testKey, testBitmap).build(); ParcelImpl parcelImpl = (ParcelImpl) ParcelUtils.toParcelable(metadata); Parcel parcel = Parcel.obtain(); try { parcelImpl.writeToParcel(parcel, 0 ); parcel.setDataPosition(0); MediaMetadata metadataFromParcel = ParcelUtils.fromParcelable(ParcelImpl.CREATOR.createFromParcel(parcel)); assertEquals(testBitmapSize, metadata.getBitmap(testKey).getHeight()); assertEquals(testBitmapSize, metadata.getBitmap(testKey).getWidth()); assertTrue(testBitmap.sameAs(metadata.getBitmap(testKey))); } finally { parcel.recycle(); } }
Source:
<code><START> public String toString() { <END> try { return String.format("%s%s%s%s", getActivityId(), getDashedString(getActivityName()), getDashedString(getWorkPackageId()), getDashedString(getName())); } catch (OseeCoreException ex) { OseeLog.log(org.eclipse.osee.ats.core.client.internal.Activator.class, OseeLevel.SEVERE_POPUP, ex); } return String.format("%s - Exception (see log file)", getName()); }</code><technical_language>A more readable alternative this be: StringBuilder builder = new StringBuilder(getActivityId()); addWithHypen(builder, getActivityName()); addWithHypen(builder, getWorkPackageId()); addWithHypen(builder, getName()); return builder.toString(); addWithHypen is: private void addWithHypen(builder, String value){ if(Strings.isValid(value)){ builder.append(" - "); builder.append(value); } }</technical_language>

Target:
public String toString() { try { StringBuilder builder = new StringBuilder(getActivityId()); addWithHypen(builder, getActivityName()); addWithHypen(builder, getWorkPackageId()); addWithHypen(builder, getName()); return builder.toString(); } catch (OseeCoreException ex) { OseeLog.log(org.eclipse.osee.ats.core.client.internal.Activator.class, OseeLevel.SEVERE_POPUP, ex); } return String.format("%s - Exception (see log file)", getName()); }
Source:
<code>public UserVideosResponse getUserVideos( @PathParam("userid") int userid, @QueryParam("page") String page) { Statement statement = videosByUser.bind(userid).setPageSize(ITEMS_PER_PAGE); if (page != null) { <START> statement = statement.setPagingState(Bytes.fromHexString(page)); <END> } ResultSet rs = session.execute(statement); String nextPage = Bytes.toHexString(rs.getExecutionInfo().getPagingState()); int remaining = rs.getAvailableWithoutFetching(); List<UserVideo> videos = new ArrayList<>(remaining); if (remaining > 0) { for (Row row : rs) { UserVideo video = new UserVideo(row.getInt("videoid"), row.getString("title"), row.getInstant("added")); videos.add(video); if (--remaining == 0) { break; } } } URI next = null; if (nextPage != null) next = uri.getAbsolutePathBuilder().queryParam("page", nextPage).build(); return new UserVideosResponse(videos, next); }</code><technical_language>a builder: java BoundStatementBuilder statementBuilder = videosByUser.boundStatementBuilder(userid).setPageSize(ITEMS_PER_PAGE); if (page != null) { statementBuilder.setPagingState(Bytes.fromHexString(page)); } ResultSet rs = session.execute(statementBuilder.build());</technical_language>

Target:
public UserVideosResponse getUserVideos( @PathParam("userid") int userid, @QueryParam("page") String page) { BoundStatementBuilder statementBuilder = videosByUser.boundStatementBuilder(userid).setPageSize(ITEMS_PER_PAGE); if (page != null) { statementBuilder.setPagingState(Bytes.fromHexString(page)); } ResultSet rs = session.execute(statementBuilder.build()); String nextPage = Bytes.toHexString(rs.getExecutionInfo().getPagingState()); int remaining = rs.getAvailableWithoutFetching(); List<UserVideo> videos = new ArrayList<>(remaining); if (remaining > 0) { for (Row row : rs) { UserVideo video = new UserVideo(row.getInt("videoid"), row.getString("title"), row.getInstant("added")); videos.add(video); if (--remaining == 0) { break; } } } URI next = null; if (nextPage != null) next = uri.getAbsolutePathBuilder().queryParam("page", nextPage).build(); return new UserVideosResponse(videos, next); }
Source:
<code>public BlockEncodingManager(TypeManager typeManager, Set<BlockEncodingFactory<?>> blockEncodingFactories) { <START> requireNonNull(typeManager, "typeManager is null"); <END> addBlockEncodingFactory(new VariableWidthBlockEncodingFactory()); addBlockEncodingFactory(new FixedWidthBlockEncodingFactory()); addBlockEncodingFactory(new ByteArrayBlockEncodingFactory()); addBlockEncodingFactory(new ShortArrayBlockEncodingFactory()); addBlockEncodingFactory(new IntArrayBlockEncodingFactory()); addBlockEncodingFactory(new LongArrayBlockEncodingFactory()); addBlockEncodingFactory(new DictionaryBlockEncodingFactory()); addBlockEncodingFactory(new ArrayBlockEncodingFactory()); addBlockEncodingFactory(new MapBlockEncodingFactory(typeManager)); addBlockEncodingFactory(new SingleMapBlockEncodingFactory(typeManager)); addBlockEncodingFactory(new RowBlockEncodingFactory()); addBlockEncodingFactory(new SingleRowBlockEncodingFactory()); addBlockEncodingFactory(new RunLengthBlockEncodingFactory()); for (BlockEncodingFactory<?> factory : requireNonNull(blockEncodingFactories, "blockEncodingFactories is null")) { addBlockEncodingFactory(factory); } }</code><technical_language>removed altogether, typeManager is passed through. MapBlockEncodingFactory SingleMapBlockEncodingFactory validate</technical_language>

Target:
public BlockEncodingManager(TypeManager typeManager, Set<BlockEncodingFactory<?>> blockEncodingFactories) { addBlockEncodingFactory(new VariableWidthBlockEncodingFactory()); addBlockEncodingFactory(new FixedWidthBlockEncodingFactory()); addBlockEncodingFactory(new ByteArrayBlockEncodingFactory()); addBlockEncodingFactory(new ShortArrayBlockEncodingFactory()); addBlockEncodingFactory(new IntArrayBlockEncodingFactory()); addBlockEncodingFactory(new LongArrayBlockEncodingFactory()); addBlockEncodingFactory(new DictionaryBlockEncodingFactory()); addBlockEncodingFactory(new ArrayBlockEncodingFactory()); addBlockEncodingFactory(new MapBlockEncodingFactory(typeManager)); addBlockEncodingFactory(new SingleMapBlockEncodingFactory(typeManager)); addBlockEncodingFactory(new RowBlockEncodingFactory()); addBlockEncodingFactory(new SingleRowBlockEncodingFactory()); addBlockEncodingFactory(new RunLengthBlockEncodingFactory()); for (BlockEncodingFactory<?> factory : requireNonNull(blockEncodingFactories, "blockEncodingFactories is null")) { addBlockEncodingFactory(factory); } }
Source:
<code>public Optional<Application> applicationForKey(String apiKey) { return Optional.fromNullable(translator.fromDBObject( applications.findOne( where().fieldEquals( <START> String.format("%s.%s", <END> MongoApplicationTranslator.CREDENTIALS_KEY, ApplicationCredentialsTranslator.API_KEY_KEY), apiKey) .build()) ) ); }</code><technical_language>This is constant extracted, nutty indentation here</technical_language>

Target:
public Optional<Application> applicationForKey(String apiKey) { return Optional.fromNullable(translator.fromDBObject( applications.findOne( where().fieldEquals(CREDENTIALS_API_KEY, apiKey).build()) ) ); }
Source:
<code>public CustomTrust() { SSLSocketFactory sslSocketFactory; try { KeyAndTrustManagers keyAndTrustManagers = trustManagerForCertificates(trustedCertificatesInputStream()); SSLContext sslContext = SSLContext.getInstance("TLS"); <START> sslContext.init(keyAndTrustManagers.keyManagers, keyAndTrustManagers.trustManagers, null); <END> sslSocketFactory = sslContext.getSocketFactory(); client = new OkHttpClient.Builder() .sslSocketFactory(sslSocketFactory, (X509TrustManager) keyAndTrustManagers.trustManagers[0]) .build(); } catch (GeneralSecurityException e) { throw new RuntimeException(e); } }</code><technical_language>Yes</technical_language>

Target:
public CustomTrust() { SSLSocketFactory sslSocketFactory; try { KeyAndTrustManagers keyAndTrustManagers = trustManagerForCertificates(trustedCertificatesInputStream()); SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(keyAndTrustManagers.keyManagers, keyAndTrustManagers.trustManagers, null); sslSocketFactory = sslContext.getSocketFactory(); X509TrustManager trustManager = (X509TrustManager) keyAndTrustManagers.trustManagers[0]; client = new OkHttpClient.Builder() .sslSocketFactory(sslSocketFactory, trustManager) .build(); } catch (GeneralSecurityException e) { throw new RuntimeException(e); } }
Source:
<code>public static void copyFileFromAssets(String fileSourcePath, String fileDestPath) throws IOException { AssetManager assetManager = InstrumentationRegistry.getInstrumentation().getContext().getAssets(); try (InputStream input = assetManager.open(fileSourcePath); OutputStream output = new FileOutputStream(fileDestPath)) { <START> byte[] buffer = new byte[1024]; <END> int length; while ((length = input.read(buffer)) != -1) { output.write(buffer, 0, length); } } }</code><technical_language>IOUtils.copy in <LINK_0> I forgot I introduced this method</technical_language>

Target:
public static void copyFileFromAssets(String fileSourcePath, String fileDestPath) throws IOException { AssetManager assetManager = InstrumentationRegistry.getInstrumentation().getContext().getAssets(); try (InputStream input = assetManager.open(fileSourcePath); OutputStream output = new FileOutputStream(fileDestPath)) { IOUtils.copy(input, output); } }
Source:
<code>protected List<ScheduledActivity> performMerge(List<ScheduledActivity> scheduledActivities, Map<String, ScheduledActivity> dbMap) { List<ScheduledActivity> saves = Lists.newArrayList(); for (int i=0; i < scheduledActivities.size(); i++) { ScheduledActivity activity = scheduledActivities.get(i); ScheduledActivity dbActivity = dbMap.remove(activity.getGuid()); boolean updatableStatus = dbActivity != null && UPDATABLE_STATUSES.contains(dbActivity.getStatus()); <START> if (dbActivity != null && (!updatableStatus || dbActivity.getClientData() != null)) { <END> scheduledActivities.set(i, dbActivity); } else if (activity.getStatus() != ScheduledActivityStatus.EXPIRED) { saves.add(activity); } } return saves; }</code><technical_language>Minor: dbActivity != null clause in updatableStatus is redundant dbActivity != null in if statement. simplify if (dbActivity != null && (!UPDATABLE_STATUSES.contains(dbActivity.getStatus()) || dbActivity.getClientData() != null)) {</technical_language>

Target:
protected List<ScheduledActivity> performMerge(List<ScheduledActivity> scheduledActivities, Map<String, ScheduledActivity> dbMap) { List<ScheduledActivity> saves = Lists.newArrayList(); for (int i=0; i < scheduledActivities.size(); i++) { ScheduledActivity activity = scheduledActivities.get(i); ScheduledActivity dbActivity = dbMap.remove(activity.getGuid()); if (dbActivity != null && (!UPDATABLE_STATUSES.contains(dbActivity.getStatus()) || dbActivity.getClientData() != null)) { scheduledActivities.set(i, dbActivity); } else if (activity.getStatus() != ScheduledActivityStatus.EXPIRED) { saves.add(activity); } } return saves; }
Source:
<code>static InternationalFixedDate create(final int prolepticYear, final int month, final int dayOfMonth) { InternationalFixedChronology.YEAR_RANGE.checkValidValue(prolepticYear, ChronoField.YEAR_OF_ERA); InternationalFixedChronology.MONTH_OF_YEAR_RANGE.checkValidValue(month, ChronoField.MONTH_OF_YEAR); InternationalFixedChronology.DAY_OF_MONTH_RANGE.checkValidValue(dayOfMonth, ChronoField.DAY_OF_MONTH); <START> if (1 > prolepticYear) { <END> throw new DateTimeException("Invalid date: " + prolepticYear + '-' + month + '-' + dayOfMonth); } return new InternationalFixedDate(prolepticYear, month, dayOfMonth); }</code><technical_language>Condition is again</technical_language>

Target:
static InternationalFixedDate create(final int prolepticYear, final int month, final int dayOfMonth) { YEAR_RANGE.checkValidValue(prolepticYear, ChronoField.YEAR_OF_ERA); MONTH_OF_YEAR_RANGE.checkValidValue(month, ChronoField.MONTH_OF_YEAR); DAY_OF_MONTH_RANGE.checkValidValue(dayOfMonth, ChronoField.DAY_OF_MONTH); if ((month < 1 || dayOfMonth < 1) && (dayOfMonth != month)) { throw new DateTimeException("Ambiguous Year or Leap Day: " + prolepticYear + '/' + month + '/' + dayOfMonth); } if ((month == -1) && (dayOfMonth == -1) && !INSTANCE.isLeapYear(prolepticYear)) { throw new DateTimeException("Invalid Leap Day as '" + prolepticYear + "' is not a leap year"); } return new InternationalFixedDate(prolepticYear, month, dayOfMonth); }
Source:
<code>public Market(String name) { <START> this.marketName = name; <END> stockList = new HashMap<String, Stock>(); marketHistory = new MarketHistory(this); orderBook = new OrderBook(this); }</code><technical_language>Redundant variable name - "name"</technical_language>

Target:
public Market(String name) { this.name = name; stockList = new HashMap<String, Stock>(); marketHistory = new MarketHistory(this); orderBook = new OrderBook(this); }
Source:
<code>private void recordSaveables(Saveable[] sourceSaveables) { if (knownSaveables == null) <START> knownSaveables = new HashSet<Saveable>(); <END> for (int i = 0; i < sourceSaveables.length; i++) { Saveable saveable = sourceSaveables[i]; knownSaveables.add(saveable); } }</code><technical_language>new HashSet<></technical_language>

Target:
private void recordSaveables(Saveable[] sourceSaveables) { if (knownSaveables == null) knownSaveables = new HashSet<>(); Collections.addAll(knownSaveables, sourceSaveables); }
Source:
<code><START> public void saveSubscription(final Subscription subscription) throws InternalNakadiException, <END> DuplicatedSubscriptionException { try { jdbcTemplate.update("INSERT INTO zn_data.subscription (s_id, s_subscription_object) VALUES (?, ?::jsonb)", subscription.getId(), jsonMapper.writer().writeValueAsString(subscription)); } catch (JsonProcessingException e) { throw new InternalNakadiException("Serialization problem during persistence of event type", e); } catch (DuplicateKeyException e) { throw new DuplicatedSubscriptionException("Subscription with the same key properties already exists", e); } }</code><technical_language>is plan for usage this method? point of view that: id = saveSubscription(subscriptionData)</technical_language>

Target:
public void saveSubscription(final Subscription subscription) throws InternalNakadiException, DuplicatedSubscriptionException { try { jdbcTemplate.update("INSERT INTO zn_data.subscription (s_id, s_subscription_object) VALUES (?, ?::jsonb)", subscription.getId(), jsonMapper.writer().writeValueAsString(subscription)); } catch (final JsonProcessingException e) { throw new InternalNakadiException("Serialization problem during persistence of event type", e); } catch (final DuplicateKeyException e) { throw new DuplicatedSubscriptionException("Subscription with the same key properties already exists", e); } }
Source:
<code>public boolean isSoftLimitReached(Guid volumeId) { GlusterVolumeEntity volume = getGlusterVolumeDao().getById(volumeId); if (volume != null) { GlusterVolumeSnapshotConfig config = getGlusterVolumeSnapshotConfigDao().getConfigByClusterIdAndName(volume.getClusterId(), "snap-max-soft-limit"); if (config != null) { <START> String configValue = config.getParamValue().substring(0, config.getParamValue().length() - 1); <END> int snapMaxSoftLimitPcnt = Integer.parseInt(configValue); int snapshotCount = volume.getSnapshotsCount(); int snapMaxLimit = volume.getSnapMaxLimit(); return snapshotCount >= (snapMaxLimit * snapMaxSoftLimitPcnt) / 100; } } return false; }</code><technical_language>I strip % sign if present. if gluster changes return 90, instead of 90%</technical_language>

Target:
public boolean isSoftLimitReached(Guid volumeId) { GlusterVolumeEntity volume = getGlusterVolumeDao().getById(volumeId); if (volume != null) { GlusterVolumeSnapshotConfig config = getGlusterVolumeSnapshotConfigDao().getConfigByClusterIdAndName(volume.getClusterId(), "snap-max-soft-limit"); if (config != null) { String configValue = config.getParamValue(); if (configValue.endsWith("%")) { configValue = configValue.substring(0, configValue.length() - 1); } int snapMaxSoftLimitPcnt = Integer.parseInt(configValue); int snapshotCount = volume.getSnapshotsCount(); int snapMaxLimit = volume.getSnapMaxLimit(); return snapshotCount >= (snapMaxLimit * snapMaxSoftLimitPcnt) / 100; } } return false; }
Source:
<code>public void populateDAG(DAG dag, Configuration conf) { RandomGenerator generator = dag.addOperator("DataGenerator", new RandomGenerator()); KafkaOutputOperator kafkaOutput = dag.addOperator("KafkaWriter", new KafkaOutputOperator()); generator.setTuplesBlast(maxTuplesPerWindow); generator.setInitialOffset(initialOffset); kafkaOutput.setTopic(topic); Properties configProperties = new Properties(); configProperties.setProperty("metadata.broker.list",broker); kafkaOutput.setConfigProperties(configProperties); KafkaInputModule input = dag.addModule("KafkaReader", new KafkaInputModule()); <START> Validator valid = dag.addOperator("Validation", new Validator()); <END> valid.setMaxTuplesPerWindow(maxTuplesPerWindow); input.setTopic(topic); input.setZookeeper(zookeeper); if(offsetFilePath != null) { input.setOffsetFilePath(offsetFilePath); } input.setInitialOffset(initialOffset); input.setParallelReads(parallelReads); input.setMaxTuplesPerWindow(maxTuplesPerWindow); input.setStrategy(strategy); input.setBandwidth(bandwidth); dag.addStream("ToKafka", generator.output, kafkaOutput.inputPort); dag.addStream("ToValidator", generator.integer_data, valid.generatePort); dag.addStream("FromKafka", input.output, valid.kafkaPort); }</code><technical_language>name of operator: Validator ? rename variable accordingly</technical_language>

Target:
public void populateDAG(DAG dag, Configuration conf) { RandomGenerator generator = dag.addOperator("DataGenerator", new RandomGenerator()); KafkaOutputOperator kafkaOutput = dag.addOperator("KafkaWriter", new KafkaOutputOperator()); generator.setTuplesBlast(maxTuplesPerWindow); generator.setInitialOffset(initialOffset); generator.setDisableGenerate(disableValidation); kafkaOutput.setTopic(topic); Properties configProperties = new Properties(); configProperties.setProperty("metadata.broker.list",broker); kafkaOutput.setConfigProperties(configProperties); KafkaInputModule input = dag.addModule("KafkaReader", new KafkaInputModule()); ValidatorOperator validator = dag.addOperator("Validation", new ValidatorOperator()); validator.setMaxTuplesPerWindow(maxTuplesPerWindow); validator.setDisableValidation(disableValidation); input.setTopic(topic); input.setZookeeper(zookeeper); if(offsetFilePath != null) { input.setOffsetFilePath(offsetFilePath); } input.setInitialOffset(initialOffset); if(parallelReads != 0) { input.setParallelReads(parallelReads); } input.setMaxTuplesPerWindow(maxTuplesPerWindow); if(bandwidth != 0) { input.setBandwidth(bandwidth); } dag.addStream("ToKafka", generator.output, kafkaOutput.inputPort); dag.addStream("ToValidator", generator.integer_data, validator.randomPort); dag.addStream("FromKafka", input.output, validator.kafkaPort); }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; JavadocInlineTag that = (JavadocInlineTag) o; <START> return type == that.type && content.equals(that.content); <END> }</code><technical_language>If allow for Unknown type store actual name of tag in equals method toString method</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; JavadocInlineTag that = (JavadocInlineTag) o; if (tagName != null ? !tagName.equals(that.tagName) : that.tagName != null) return false; if (type != that.type) return false; return content != null ? content.equals(that.content) : that.content == null; }
Source:
<code>public Scale getInventoryScaleByName(final String name) { Scale scale = new Scale(); try { StringBuilder sql = this.buildQueryForInventoryScales(); sql.append(" AND prs.name = :name"); SQLQuery query = this.getSession().createSQLQuery(sql.toString()).addScalar("id").addScalar("scalename").addScalar("methodname") .addScalar("name").addScalar("definition"); query.setParameter("name", name); <START> List<Object[]> result = query.list(); <END> if (result != null && !result.isEmpty()) { Object[] row = result.get(0); String displayName = row[1] + " - " + row[2]; scale = new Scale(new Term((Integer) row[0], row[3].toString(), row[4].toString())); scale.setDisplayName(displayName); return scale; } } catch (HibernateException e) { this.logAndThrowException("Error in getAllInventoryScales in CVTermDao: " + e.getMessage(), e); } return scale; }</code><technical_language>a list query expecting result. If unique result need get(0)</technical_language>

Target:
public Scale getInventoryScaleByName(final String name) { Scale scale = new Scale(); try { StringBuilder sql = this.buildQueryForInventoryScales(); sql.append(" AND prs.name = :name"); SQLQuery query = this.getSession().createSQLQuery(sql.toString()).addScalar("id").addScalar("scalename").addScalar("methodname") .addScalar("name").addScalar("definition"); query.setParameter("name", name); Object[] result = (Object[]) query.uniqueResult(); if (result != null) { String displayName = result[1] + " - " + result[2]; scale = new Scale(new Term((Integer) result[0], result[3].toString(), result[4].toString())); scale.setDisplayName(displayName); return scale; } } catch (HibernateException e) { this.logAndThrowException("Error in getAllInventoryScales in CVTermDao: " + e.getMessage(), e); } return scale; }
Source:
<code>public boolean add(DocumentWriteOperation documentWriteOperation) { <START> System.out.println(operations); <END> return operations.add(documentWriteOperation); }</code><technical_language>a log statement slipped through</technical_language>

Target:
public boolean add(DocumentWriteOperation documentWriteOperation) { return operations.add(documentWriteOperation); }
Source:
<code>private SimpleReportEntry createReportEntry(TestIdentifier testIdentifier, Optional<Throwable> throwable) { String className = getClassName(testIdentifier); StackTraceWriter traceWriter = new PojoStackTraceWriter(className, testIdentifier.getLegacyReportingName(), throwable.orElse(null)); <START> return new SimpleReportEntry(className, testIdentifier.getDisplayName(), traceWriter, null); <END> }</code><technical_language>SimpleReportEntry _always_ testIdentifier.getLegacyReportingName() name testPlan.flatMap(plan -> plan.getParent(testIdentifier)).map(TestIdentifier::getLegacyReportingName) .orElse("<unrooted>") source</technical_language>

Target:
private SimpleReportEntry createReportEntry(TestIdentifier testIdentifier, Optional<Throwable> throwable) { Optional<String> className = getClassName(testIdentifier); Optional<StackTraceWriter> stackTraceWriter = throwable.flatMap( t -> className.map(name -> new PojoStackTraceWriter(name, getMethodName(testIdentifier).orElse(""), t))); String source = sourceLegacyReportingName(testIdentifier); return new SimpleReportEntry(source, testIdentifier.getLegacyReportingName(), stackTraceWriter.orElse(null), null); }
Source:
<code>public static CommitMessageComponentState loadState(Repository repository) { IDialogSettings dialogSettings = getDialogSettings(); String[] values = dialogSettings.getArray(repository.getDirectory() .getAbsolutePath()); if (values == null || values.length < MEMBER_COUNT) return null; CommitMessageComponentState state = new CommitMessageComponentState(); state.setAmend(Boolean.parseBoolean(values[0])); state.setAuthor(values[1]); state.setCommitMessage(values[2]); <START> state.setCaretPosition(Integer.parseInt(values[3])); <END> state.setCommitter(values[4]); state.setHeadCommit(ObjectId.fromString(values[5])); return state; }</code><technical_language>This *must* compatible work saved states do caret position</technical_language>

Target:
public static CommitMessageComponentState loadState(Repository repository) { IDialogSettings dialogSettings = getDialogSettings(); String[] values = dialogSettings.getArray(repository.getDirectory() .getAbsolutePath()); if (values == null) { return null; } CommitMessageComponentState state = new CommitMessageComponentState(); state.setAmend(Boolean.parseBoolean(values[0])); state.setAuthor(values[1]); state.setCommitMessage(values[2]); if (values.length == MEMBER_COUNT) { state.setCaretPosition(Integer.parseInt(values[3])); state.setCommitter(values[4]); state.setHeadCommit(ObjectId.fromString(values[5])); } else if (values.length == MEMBER_COUNT_WITHOUT_CARET_POSITION) { state.setCommitter(values[3]); state.setHeadCommit(ObjectId.fromString(values[4])); } else { return null; } return state; }
Source:
<code>public static Html toValue(Field field, JsonNode value) { <START> if (field.getDatatype().equals(Datatype.TEXT)) { <END> return Html.apply(new MarkdownProcessor().markdown(toRawValue(field, value))); } else if (field.getDatatype().equals(Datatype.COLOUR)) { return Html.apply(new MarkdownProcessor().markdown(toColourValue(field, value))); } else { return Html.apply(toRawValue(field, value)); } }</code><technical_language>'==' compare constants</technical_language>

Target:
public static Html toValue(Field field, JsonNode value) { if (field.getDatatype() == Datatype.TEXT) { return Html.apply(new MarkdownProcessor().markdown(toRawValue(field, value))); } else if (field.getDatatype() == Datatype.COLOUR) { return Html.apply(new MarkdownProcessor().markdown(toColourValue(field, value))); } else { return Html.apply(toRawValue(field, value)); } }
Source:
<code>public boolean isDataAvailable(String keyspace, Token token) { Pair<Set<Range<Token>>, Set<Range<Token>>> availableRanges = getAvailableRanges(keyspace, token.getPartitioner()); return Streams.concat(availableRanges.left.stream(), <START> availableRanges.right.stream()).anyMatch(range -> range.contains(token)); <END> }</code><technical_language>clearer IMO .anyMatch indent newline, preferably inline .concat() - I initially read this performing anyMatch right, figure out</technical_language>

Target:
public boolean isDataAvailable(String keyspace, Token token) { SystemKeyspace.AvailableRanges availableRanges = getAvailableRanges(keyspace, token.getPartitioner()); return Streams.concat(availableRanges.full.stream(), availableRanges.trans.stream()) .anyMatch(range -> range.contains(token)); }
Source:
<code>public static void main(String[] args) throws InvalidKeyException, NoSuchAlgorithmException, <START> NoSuchProviderException, SignatureException, InvalidKeySpecException { <END> Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); try { String publicKey = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqTxd43gyp8IOEto2LdIfjRQrIbsd4SXZkLW6jDutdhXSJCWHw8REntlo7aNDthvj+y7GjUuFDb/R1NGe1OPzpA=="; String payload = "[{\"email\":\"example@test.com\",\"timestamp\":1583532164,\"smtp-id\":\"<14c5d75ce93.dfd.64b469@ismtpd-555>\",\"event\":\"processed\",\"category\":\"cat facts\",\"sg_event_id\":\"sg_event_id\",\"sg_message_id\":\"sg_message_id\"}]"; String signature = "MEUCIB3PweCEFCNC0kCi6XFmlDSeFV9INyue8XmKejxu6OrKAiEAguMqCpe/5HpuK21G/+QxcZSKQm3lzM4YAblVHAhoXeU="; String timestamp = "1587162961"; boolean valid = EventWebhook.VerifySignature(publicKey, payload, signature, timestamp); System.out.println("Valid Signature: " + valid); } catch (Exception exception) { Logger.getLogger(Example.class.getName()).log(Level.SEVERE, "something went wrong", exception); } }</code><technical_language>needed</technical_language>

Target:
public static void main(String[] args) { Security.addProvider(new BouncyCastleProvider()); try { String publicKey = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEDr2LjtURuePQzplybdC+u4CwrqDqBaWjcMMsTbhdbcwHBcepxo7yAQGhHPTnlvFYPAZFceEu/1FwCM/QmGUhA=="; String payload = "{\"category\":\"example_payload\",\"event\":\"test_event\",\"message_id\":\"message_id\"}"; String signature = "MEUCIQCtIHJeH93Y+qpYeWrySphQgpNGNr/U+UyUlBkU6n7RAwIgJTz2C+8a8xonZGi6BpSzoQsbVRamr2nlxFDWYNH2j/0="; String timestamp = "1588788367"; EventWebhook ew = new EventWebhook(); ECPublicKey ellipticCurvePublicKey = ew.ConvertPublicKeyToECDSA(publicKey); boolean valid = ew.VerifySignature(ellipticCurvePublicKey, payload, signature, timestamp); System.out.println("Valid Signature: " + valid); } catch (Exception exception) { Logger.getLogger(Example.class.getName()).log(Level.SEVERE, "something went wrong", exception); } }
Source:
<code>public String getComponent(String digitalTwinId, String componentPath) { <START> return digitalTwinsAsyncClient.getComponent(digitalTwinId, componentPath).block(); <END> }</code><technical_language>format async APIs call async overloads, max overload API calls PL. Similarly, sync APIs call sync overloads, max overload sync API calls async API</technical_language>

Target:
public String getComponent(String digitalTwinId, String componentPath) { return getComponentWithResponse(digitalTwinId, componentPath, Context.NONE).getValue(); }
Source:
<code>public Solution_ call() { <START> synchronized (this) { if (solverStatus != SolverStatus.SOLVING_SCHEDULED) { return problemFinder.apply(problemId); } solverStatus = SolverStatus.SOLVING_ACTIVE; } <END> try { Solution_ problem = problemFinder.apply(problemId); final Solution_ finalBestSolution = solver.solve(problem); if (finalBestSolutionConsumer != null) { finalBestSolutionConsumer.accept(finalBestSolution); } return finalBestSolution; } catch (Exception e) { exceptionHandler.accept(problemId, e); throw new IllegalStateException("Solving failed for problemId (" + problemId + ").", e); } finally { solvingTerminated(); } }</code><technical_language>suggestion SolverStatus previousSolverStatus = solverStatus.getAndSet(SOLVING_ACTIVE); if (previousSolverStatus != SolverStatus.SOLVING_SCHEDULED) { // This job canceled started return problemFinder.apply(problemId); }</technical_language>

Target:
public Solution_ call() { SolverStatus solverStatus = solverStatusReference.getAndSet(SolverStatus.SOLVING_ACTIVE); if (solverStatus != SolverStatus.SOLVING_SCHEDULED) { return problemFinder.apply(problemId); } try { Solution_ problem = problemFinder.apply(problemId); final Solution_ finalBestSolution = solver.solve(problem); if (finalBestSolutionConsumer != null) { finalBestSolutionConsumer.accept(finalBestSolution); } return finalBestSolution; } catch (Exception e) { exceptionHandler.accept(problemId, e); throw new IllegalStateException("Solving failed for problemId (" + problemId + ").", e); } finally { solvingTerminated(); } }
Source:
<code>public int getToolTipTimeDisplayed(Object object_p) { <START> return 2000; <END> }</code><technical_language>this refer a platform-relative constant</technical_language>

Target:
public int getToolTipTimeDisplayed(Object object_p) { return TOOLTIP_TIME_DISPLAYED; }
Source:
<code>private MultipartInfoInitiateResponse initiateMultiPartUpload( MultipartInfoInitiateRequest request) throws IOException { MultipartInfoInitiateResponse.Builder resp = MultipartInfoInitiateResponse .newBuilder(); KeyArgs keyArgs = request.getKeyArgs(); OmKeyArgs omKeyArgs = new OmKeyArgs.Builder() .setVolumeName(keyArgs.getVolumeName()) .setBucketName(keyArgs.getBucketName()) .setKeyName(keyArgs.getKeyName()) .setType(keyArgs.getType()) <START> .setFactor(keyArgs.getFactor()) <END> .setAcls(keyArgs.getAclsList().stream().map(a -> OzoneAcl.fromProtobuf(a)).collect(Collectors.toList())) .setFactor(keyArgs.getFactor()) .build(); OmMultipartInfo multipartInfo = impl.initiateMultipartUpload(omKeyArgs); resp.setVolumeName(multipartInfo.getVolumeName()); resp.setBucketName(multipartInfo.getBucketName()); resp.setKeyName(multipartInfo.getKeyName()); resp.setMultipartUploadID(multipartInfo.getUploadID()); return resp.build(); }</code><technical_language>Minor: need this, in line 827 is done</technical_language>

Target:
private MultipartInfoInitiateResponse initiateMultiPartUpload( MultipartInfoInitiateRequest request) throws IOException { MultipartInfoInitiateResponse.Builder resp = MultipartInfoInitiateResponse .newBuilder(); KeyArgs keyArgs = request.getKeyArgs(); OmKeyArgs omKeyArgs = new OmKeyArgs.Builder() .setVolumeName(keyArgs.getVolumeName()) .setBucketName(keyArgs.getBucketName()) .setKeyName(keyArgs.getKeyName()) .setType(keyArgs.getType()) .setFactor(keyArgs.getFactor()) .setAcls(keyArgs.getAclsList().stream().map(a -> OzoneAcl.fromProtobuf(a)).collect(Collectors.toList())) .build(); OmMultipartInfo multipartInfo = impl.initiateMultipartUpload(omKeyArgs); resp.setVolumeName(multipartInfo.getVolumeName()); resp.setBucketName(multipartInfo.getBucketName()); resp.setKeyName(multipartInfo.getKeyName()); resp.setMultipartUploadID(multipartInfo.getUploadID()); return resp.build(); }
Source:
<code>public void testBlobDataReader() throws Exception { String clientId = this.getConfiguration().get(TestConfigurationKeys.FS_AZURE_BLOB_DATA_READER_CLIENT_ID); Assume.assumeTrue("Reader client id not provided", clientId != null); String secret = this.getConfiguration().get(TestConfigurationKeys.FS_AZURE_BLOB_DATA_READER_CLIENT_SECRET); Assume.assumeTrue("Reader client secret not provided", secret != null); prepareFiles(); final AzureBlobFileSystem fs = getBlobReader(); AzureBlobFileSystemStore abfsStore = fs.getAbfsStore(); Map<String, String> properties = abfsStore.getFilesystemProperties(); assertTrue(fs.exists(EXISTED_FOLDER_PATH)); try { abfsStore.delete(EXISTED_FOLDER_PATH, true); } catch (AbfsRestOperationException e) { assertEquals(AzureServiceErrorCode.AUTHORIZATION_PERMISSION_MISS_MATCH, e.getErrorCode()); } try (InputStream inputStream = abfsStore.openFileForRead(EXISTED_FILE_PATH, null)) { assertTrue(inputStream.read() != 0); } try { <START> abfsStore.openFileForWrite(EXISTED_FILE_PATH, fs.getFsStatistics(),true); <END> } catch (AbfsRestOperationException e) { assertEquals(AzureServiceErrorCode.AUTHORIZATION_PERMISSION_MISS_MATCH, e.getErrorCode()); } }</code><technical_language>nit, add a space comma</technical_language>

Target:
public void testBlobDataReader() throws Exception { String clientId = this.getConfiguration().get(TestConfigurationKeys.FS_AZURE_BLOB_DATA_READER_CLIENT_ID); Assume.assumeTrue("Reader client id not provided", clientId != null); String secret = this.getConfiguration().get(TestConfigurationKeys.FS_AZURE_BLOB_DATA_READER_CLIENT_SECRET); Assume.assumeTrue("Reader client secret not provided", secret != null); prepareFiles(); final AzureBlobFileSystem fs = getBlobReader(); AzureBlobFileSystemStore abfsStore = fs.getAbfsStore(); Map<String, String> properties = abfsStore.getFilesystemProperties(); assertTrue(fs.exists(EXISTED_FOLDER_PATH)); try { abfsStore.delete(EXISTED_FOLDER_PATH, true); } catch (AbfsRestOperationException e) { assertEquals(AzureServiceErrorCode.AUTHORIZATION_PERMISSION_MISS_MATCH, e.getErrorCode()); } try (InputStream inputStream = abfsStore.openFileForRead(EXISTED_FILE_PATH, null)) { assertTrue(inputStream.read() != 0); } try { abfsStore.openFileForWrite(EXISTED_FILE_PATH, fs.getFsStatistics(), true); } catch (AbfsRestOperationException e) { assertEquals(AzureServiceErrorCode.AUTHORIZATION_PERMISSION_MISS_MATCH, e.getErrorCode()); } finally { IOUtils.cleanupWithLogger(LOG, abfsStore); } }
Source:
<code>public void createWithPrimaryKeyField_string() { realmSchema.createWithPrimaryKeyField("FooNonNull", "pkField", String.class, FieldAttribute.REQUIRED); <START> RealmObjectSchema objectSchema = realmSchema.getSchemaForClass("FooNonNull"); <END> assertEquals("pkField", objectSchema.getPrimaryKey()); assertEquals(RealmFieldType.STRING, objectSchema.getFieldType("pkField")); assertFalse(objectSchema.isNullable("pkField")); realmSchema.createWithPrimaryKeyField("FooNull", "pkField", String.class); objectSchema = realmSchema.getSchemaForClass("FooNull"); assertEquals("pkField", objectSchema.getPrimaryKey()); assertEquals(RealmFieldType.STRING, objectSchema.getFieldType("pkField")); assertTrue(objectSchema.isNullable("pkField")); }</code><technical_language>test return of createWithPrimaryKeyField()? RealmObjectSchema objectSchema = realmSchema.createWithPrimaryKeyField("FooNonNull", "pkField", String.class, FieldAttribute.REQUIRED); assertSame(objectSchema, realmSchema.getSchemaForClass("FooNonNull"));</technical_language>

Target:
public void createWithPrimaryKeyField_string() { realmSchema.createWithPrimaryKeyField("FooNonNull", "pkField", String.class, FieldAttribute.REQUIRED); RealmObjectSchema objectSchema = realmSchema.getSchemaForClass("FooNonNull"); assertEquals("pkField", objectSchema.getPrimaryKey()); assertEquals(RealmFieldType.STRING, objectSchema.getFieldType("pkField")); assertFalse(objectSchema.isNullable("pkField")); assertTrue(objectSchema.hasIndex("pkField")); realmSchema.createWithPrimaryKeyField("FooNull", "pkField", String.class); objectSchema = realmSchema.getSchemaForClass("FooNull"); assertEquals("pkField", objectSchema.getPrimaryKey()); assertEquals(RealmFieldType.STRING, objectSchema.getFieldType("pkField")); assertTrue(objectSchema.isNullable("pkField")); assertTrue(objectSchema.hasIndex("pkField")); }
Source:
<code>void setProcessStateNotifier(ProcessStateNotifier notifier) { assert this.processStateNotifier == null; this.processStateNotifier = notifier; if (notifier != null) { this.propertyChangeListener = new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (ControlledProcessState.State.RUNNING == evt.getNewValue()) { synchronized (this) { if (scanEnabled) { undeployScanTask = scheduledExecutor.submit(new UndeployScanRunnable()); } } } else if (ControlledProcessState.State.STOPPING == evt.getNewValue()) { scanEnabled = false; <START> if(undeployScanTask != null) { <END> undeployScanTask.cancel(true); undeployScanTask = null; } processStateNotifier.removePropertyChangeListener(this); } } }; this.processStateNotifier.addPropertyChangeListener(propertyChangeListener); } else { this.propertyChangeListener = null; } }</code><technical_language>I realized this is moved, this synchronized this is in running state</technical_language>

Target:
void setProcessStateNotifier(ProcessStateNotifier notifier) { assert this.processStateNotifier == null; this.processStateNotifier = notifier; if (notifier != null) { this.propertyChangeListener = new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (ControlledProcessState.State.RUNNING == evt.getNewValue()) { synchronized (FileSystemDeploymentService.this) { if (scanEnabled) { undeployScanTask = scheduledExecutor.submit(new UndeployScanRunnable()); } } } else if (ControlledProcessState.State.STOPPING == evt.getNewValue()) { synchronized (FileSystemDeploymentService.this) { scanEnabled = false; if (undeployScanTask != null) { undeployScanTask.cancel(true); undeployScanTask = null; } } processStateNotifier.removePropertyChangeListener(this); } } }; this.processStateNotifier.addPropertyChangeListener(propertyChangeListener); } else { this.propertyChangeListener = null; } }
Source:
<code>public int hashCode() { <START> final int prime = 31; int result = 1; result = prime * result + ((this.logEntry == null) ? 0 : this.logEntry.hashCode()); return result; <END> }</code><technical_language>simply Objects.hashCode(logEntry)</technical_language>

Target:
public int hashCode() { return this.logEntry.hashCode(); }
Source:
<code>public void access(final Path path, final FsAction mode) throws IOException { LOG.debug("AzureBlobFileSystem.access path : {}, mode : {}", path, mode); <START> Path qualifiedPath = path == null ? null : makeQualified(path); <END> try { this.abfsStore.access(qualifiedPath, mode); } catch (AzureBlobFileSystemException ex) { checkCheckAccessException(path, ex); } }</code><technical_language>original line 949 is correct. If path is null, FileSystem.access throw IllegalArgumentException calling makeQualified(path) do</technical_language>

Target:
public void access(final Path path, final FsAction mode) throws IOException { LOG.debug("AzureBlobFileSystem.access path : {}, mode : {}", path, mode); Path qualifiedPath = makeQualified(path); try { this.abfsStore.access(qualifiedPath, mode); } catch (AzureBlobFileSystemException ex) { checkCheckAccessException(path, ex); } }
Source:
<code>public void copyRightToLeft(Diff target, Monitor monitor) { if (target.getState() != DifferenceState.UNRESOLVED) { return; } long start = System.currentTimeMillis(); target.setState(DifferenceState.MERGED); final Set<Diff> dependencies = getDirectMergeDependencies(target, true); boolean requiresMerging = requiresMerging(target, true); for (Diff mergeMe : dependencies) { mergeDiff(mergeMe, true, monitor); } for (Diff transitiveMerge : getDirectResultingMerges(target, true)) { transitiveMerge.setState(DifferenceState.MERGED); } if (requiresMerging) { if (target.getSource() == DifferenceSource.LEFT) { reject(target, true); } else { accept(target, true); } } if (isHandleSubDiffs()) { Set<Diff> subDiffs = Sets.newLinkedHashSet(ComparisonUtil.getDirectSubDiffs(false).apply(target)); for (Diff subDiff : subDiffs) { mergeDiff(subDiff, true, monitor); } } if (LOGGER.isDebugEnabled()) { long duration = System.currentTimeMillis() - start; LOGGER.debug("copyLeftToRight(Diff, Monitor) - diff " + target.hashCode() + " merged in " <START> + duration + "s"); END> } }</code><technical_language>milliseconds ;). Please check other locations in change too</technical_language>

Target:
public void copyRightToLeft(Diff target, Monitor monitor) { if (target.getState() != DifferenceState.UNRESOLVED) { return; } long start = System.currentTimeMillis(); target.setState(DifferenceState.MERGED); final Set<Diff> dependencies = getDirectMergeDependencies(target, true); boolean requiresMerging = requiresMerging(target, true); for (Diff mergeMe : dependencies) { mergeDiff(mergeMe, true, monitor); } for (Diff transitiveMerge : getDirectResultingMerges(target, true)) { transitiveMerge.setState(DifferenceState.MERGED); } if (requiresMerging) { if (target.getSource() == DifferenceSource.LEFT) { reject(target, true); } else { accept(target, true); } } if (isHandleSubDiffs()) { Set<Diff> subDiffs = Sets.newLinkedHashSet(ComparisonUtil.getDirectSubDiffs(false).apply(target)); for (Diff subDiff : subDiffs) { mergeDiff(subDiff, true, monitor); } } if (LOGGER.isDebugEnabled()) { long duration = System.currentTimeMillis() - start; LOGGER.debug("copyLeftToRight(Diff, Monitor) - diff " + target.hashCode() + " merged in " + duration + "ms"); } }
Source:
<code>private void computeWidgetX() { GC gc= new GC(fTextWidget); Font font= fTextWidget.getFont(); fFontForCachedWidgetX= font; gc.setFont(font); StringBuilder sb= new StringBuilder(fMarginWidth); String sampleText= <START> "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; <END> while (sb.length() < fMarginWidth) { sb.append(sampleText, 0, Math.min(sampleText.length(), fMarginWidth - sb.length())); } fCachedWidgetX= gc.textExtent(sb.toString()).x; gc.dispose(); }</code><technical_language>characters other languages Chinese Japanese? some special French characters</technical_language>

Target:
private void computeWidgetX() { GC gc= new GC(fTextWidget); fFontForCachedWidgetX= fTextWidget.getFont(); double pixels= gc.getFontMetrics().getAverageCharacterWidth(); gc.dispose(); fCachedWidgetX= (int) (pixels * fMarginWidth + 0.5); }
Source:
<code>public void testEncryption() throws Throwable { <START> super.testEncryption(); <END> }</code><technical_language>needed</technical_language>

Target:
public void testEncryption() throws Throwable { }
Source:
<code>public void update(float delta) { if (metricsLabel != null) { if (metricsModes.isEmpty()) { metricsLabel.setText("No metric modes are available!"); return; } <START> metricsLabel.setText(metricsModes.get(currentMode).getMetrics()); <END> } }</code><technical_language>I typical case is metricsLabel is empty. So, put in part of "if" block handle metricsMode.isEmpty() case "else" block. Also, situations in metricsLabel is null</technical_language>

Target:
public void update(float delta) { metricsLabel.setText(debugMetricsSystem.getCurrentMode().getMetrics()); }