auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static okhttp3.RequestBody toOkHttpRequestBody(Flux<ByteBuffer> bbFlux, HttpHeaders headers) { okio.ByteString byteString = okio.ByteString.EMPTY; if (bbFlux != null) { <START> byteString = aggregate(bbFlux).block(); <END> } String contentType = headers.value("Content-Type"); if (contentType == null) { return okhttp3.RequestBody.create(byteString, MEDIA_TYPE_OCTET_STREAM); } else { return okhttp3.RequestBody.create(byteString, okhttp3.MediaType.parse(contentType)); } }</code><technical_language>this method return Mono<okhttp3.RequestBody> eventually send() method returns a Mono</technical_language>

Target:
private static Mono<okhttp3.RequestBody> toOkHttpRequestBody(Flux<ByteBuffer> bbFlux, HttpHeaders headers) { Mono<okio.ByteString> bsMono = bbFlux == null ? EMPTY_BYTE_STRING_MONO : aggregate(bbFlux); return bsMono.map(byteString1 -> { String contentType = headers.value("Content-Type"); if (contentType == null) { return RequestBody.create(byteString1, MEDIA_TYPE_OCTET_STREAM); } else { return RequestBody.create(byteString1, okhttp3.MediaType.parse(contentType)); } }); }
Source:
<code>public void start() { if (started) { LOG.warn("Skipping attempt to start an already started ContainerHeartbeatMonitor."); return; } LOG.info("Starting ContainerHeartbeatMonitor"); scheduler.scheduleAtFixedRate(() -> { ContainerHeartbeatResponse response = containerHeartbeatClient.requestHeartbeat(); if (!response.isAlive()) { if (isApplicationMasterHighAvailabilityEnabled) { LOG.warn("Failed to establish connection with {}. Checking for new AM", coordinatorUrl); <START> try { if (checkAndEstablishConnectionWithNewAM()) { return; } } catch (Exception e) { LOG.warn("Exception trying to connect with new AM", e); throw new SamzaException(e); <END> } } scheduler.schedule(() -> { LOG.error("Graceful shutdown timeout expired. Force exiting."); ThreadUtil.logThreadDump("Thread dump at heartbeat monitor shutdown timeout."); System.exit(1); }, SHUTDOWN_TIMOUT_MS, TimeUnit.MILLISECONDS); onContainerExpired.run(); } }, 0, SCHEDULE_MS, TimeUnit.MILLISECONDS); started = true; }</code><technical_language>kill thread recreate one. suggest instead proceed exit code log error of exception too. Recreating thread guarantee subsequent thread recover previous error potentially run this in a loop of some sorts concrete action</technical_language>

Target:
public void start() { if (started) { LOG.warn("Skipping attempt to start an already started ContainerHeartbeatMonitor."); return; } LOG.info("Starting ContainerHeartbeatMonitor"); scheduler.scheduleAtFixedRate(() -> { ContainerHeartbeatResponse response = containerHeartbeatClient.requestHeartbeat(); if (!response.isAlive()) { if (isApplicationMasterHighAvailabilityEnabled) { LOG.warn("Failed to establish connection with {}. Checking for new AM", coordinatorUrl); try { if (checkAndEstablishConnectionWithNewAM()) { return; } } catch (Exception e) { LOG.error("Exception trying to connect with new AM", e); forceExit("failure in establishing cconnection with new AM", 0); return; } } forceExit("Graceful shutdown timeout expired. Force exiting.", SHUTDOWN_TIMOUT_MS); } }, 0, SCHEDULE_MS, TimeUnit.MILLISECONDS); started = true; }
Source:
<code>public void adjustThreadNum(final int threadNum) { final int currentThreadNum = eventProcessors.size(); if (currentThreadNum <= threadNum) { addNewThreadsToSet(threadNum - currentThreadNum); } else if (currentThreadNum > threadNum) { final Set<EventProcessor> processorsToBeClosed = new HashSet<>(); <START> for (final EventProcessor eventProcessor : eventProcessors) { <END> processorsToBeClosed.add(eventProcessor); eventProcessor.close(); if (processorsToBeClosed.size() >= currentThreadNum - threadNum) { break; } } processorsToBeClosed.forEach(eventProcessor -> eventProcessors.remove(eventProcessor)); } }</code><technical_language>iterator? processorsToBeClosed if Iterator</technical_language>

Target:
public void adjustThreadNum(final int threadNum) { final int currentThreadNum = eventProcessors.size(); if (currentThreadNum <= threadNum) { addNewThreadsToSet(threadNum - currentThreadNum); } else if (currentThreadNum > threadNum) { int closedProcessorNum = 0; final Iterator<EventProcessor> iterator = eventProcessors.iterator(); while(iterator.hasNext()) { final EventProcessor eventProcessor = iterator.next(); eventProcessor.close(); iterator.remove(); closedProcessorNum++; if (closedProcessorNum >= currentThreadNum - threadNum) { break; } } } }
Source:
<code>private boolean isBackupContainsRawDisksOnly() { return getParameters().getVmBackup() .getDisks() .stream() .filter(DiskImage::isQcowFormat) <START> .findFirst() .orElse(null) == <END> null; }</code><technical_language>I ".collect(Collectors.toList())" checking for "!isEmpty()" is more readable. defining "List qcowDisks" temp local variable line: return !qcowDisks,isEmpty()</technical_language>

Target:
private boolean isBackupContainsRawDisksOnly() { return getParameters().getVmBackup() .getDisks() .stream() .noneMatch(DiskImage::isQcowFormat); }
Source:
<code>private static Map<String, String> asMap(final KeyValueStore<String, String> store) { final HashMap<String, String> result = new HashMap<>(); store.all().forEachRemaining(kv -> { <START> System.out.println(kv); <END> result.put(kv.key, kv.value); }); return result; }</code><technical_language>remove this println</technical_language>

Target:
private static Map<String, String> asMap(final KeyValueStore<String, String> store) { final HashMap<String, String> result = new HashMap<>(); store.all().forEachRemaining(kv -> result.put(kv.key, kv.value)); return result; }
Source:
<code>public Map<String, String> entityPrefixes() { return <START> Collections.singletonMap("wd", entity); <END> }</code><technical_language>This a constant, more instance variable</technical_language>

Target:
public Map<String, String> entityPrefixes() { return Collections.singletonMap(ENTITY_PREFIX, entity); }
Source:
<code>protected TMIterator(TransactionMap<K,?> transactionMap, K from, K to, boolean includeAllUncommitted) { this.transactionMap = transactionMap; TransactionStore store = transactionMap.transaction.store; MVMap<K, VersionedValue> map = transactionMap.map; BitSet committingTransactions; MVMap.RootReference mapRootReference; do { committingTransactions = store.committingTransactions.get(); mapRootReference = map.getRoot(); <START> } while (committingTransactions != store.committingTransactions.get()); <END> this.cursor = new Cursor<>(mapRootReference.root, from, to); this.includeAllUncommitted = includeAllUncommitted; this.committingTransactions = committingTransactions; }</code><technical_language>relationship map.getRoot() store.committingTransactions.get() briefly described? This loop is executed more in some tests, needed, oblivious TransactionStore.commit() changes them. a bit strange similar loop in sizeAsLong() checks mapRootReference in condition. reason of this difference</technical_language>

Target:
protected TMIterator(TransactionMap<K,?> transactionMap, K from, K to, boolean includeAllUncommitted) { this.transactionMap = transactionMap; TransactionStore store = transactionMap.transaction.store; MVMap<K, VersionedValue> map = transactionMap.map; BitSet committingTransactions; MVMap.RootReference mapRootReference; do { committingTransactions = store.committingTransactions.get(); mapRootReference = map.getRoot(); } while (committingTransactions != store.committingTransactions.get()); this.cursor = new Cursor<>(mapRootReference.root, from, to); this.committingTransactions = committingTransactions; this.includeAllUncommitted = includeAllUncommitted; }
Source:
<code>public GerritSystemInfo getInfo(IProgressMonitor monitor) throws GerritException { <START> checkSupportedVersion(monitor); <END> List<ContributorAgreement> contributorAgreements = null; Account account = null; if (!isAnonymous()) { account = execute(monitor, new Operation<Account>() { @Override public void execute(IProgressMonitor monitor) throws GerritException { getAccountService().myAccount(this); } }); } else { executeQuery(monitor, "status:open"); } refreshConfigOnce(monitor); return new GerritSystemInfo(contributorAgreements, account); }</code><technical_language>version included in GerritSystemInfo a validation method check versions work</technical_language>

Target:
public GerritSystemInfo getInfo(IProgressMonitor monitor) throws GerritException { Version version = getCachedVersion(monitor); List<ContributorAgreement> contributorAgreements = null; Account account = null; if (!isAnonymous()) { account = execute(monitor, new Operation<Account>() { @Override public void execute(IProgressMonitor monitor) throws GerritException { getAccountService().myAccount(this); } }); } else { executeQuery(monitor, "status:open"); } refreshConfigOnce(monitor); return new GerritSystemInfo(version, contributorAgreements, account); }
Source:
<code>public Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String, String> headers) { return new CancellableTask(id, type, action, toString(), parentTaskId, headers) { @Override public boolean shouldCancelChildrenOnCancellation() { return false; } @Override public String getDescription() { return "waitForCompletionTimeout[" + waitForCompletionTimeout + "], keepOnCompletion[" + keepOnCompletion + "] keepAlive[" + keepAlive + <START> "], request=" + request.getDescription(); <END> } }; }</code><technical_language>SubmitAsyncSearchRequest override getDescription</technical_language>

Target:
public Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String, String> headers) { return new CancellableTask(id, type, action, null, parentTaskId, headers) { @Override public boolean shouldCancelChildrenOnCancellation() { return false; } @Override public String getDescription() { return "waitForCompletionTimeout[" + waitForCompletionTimeout + "], keepOnCompletion[" + keepOnCompletion + "] keepAlive[" + keepAlive + "], request=" + request.buildDescription(); } }; }
Source:
<code>public Concept hydrate(String s) { try { return Context.getConceptService().getConcept(Integer.valueOf(s)); } catch (Exception e) { <START> logger.error("Error", e); <END> } return null; }</code><technical_language>Change this log</technical_language>

Target:
public Concept hydrate(String s) { try { return Context.getConceptService().getConcept(Integer.valueOf(s)); } catch (Exception e) { log.error("Error", e); } return null; }
Source:
<code>public void testThrowParseExceptions(){ InputRow in = new MapBasedInputRow( timestamp, dims, event ); AggregatorFactory[] aggregatorFactories = new AggregatorFactory[] { new DoubleSumAggregatorFactory("agg_non_existing", "agg_non_existing_in"), new DoubleSumAggregatorFactory("m1out", "m1"), new LongSumAggregatorFactory("m2out", "m2"), new HyperUniquesAggregatorFactory("m3out", "m3"), new LongSumAggregatorFactory("unparseable", "m3") }; try { InputRowSerde.toBytes(in, aggregatorFactories, true); Assert.fail("Should have thrown parseException"); <START> } catch (ParseException e){ <END> } }</code><technical_language>org.junit.rules.ExpectedException @Rule @Test(expected = ParseException.class)</technical_language>

Target:
public void testThrowParseExceptions() { InputRow in = new MapBasedInputRow( timestamp, dims, event ); AggregatorFactory[] aggregatorFactories = new AggregatorFactory[]{ new DoubleSumAggregatorFactory("agg_non_existing", "agg_non_existing_in"), new DoubleSumAggregatorFactory("m1out", "m1"), new LongSumAggregatorFactory("m2out", "m2"), new HyperUniquesAggregatorFactory("m3out", "m3"), new LongSumAggregatorFactory("unparseable", "m3") }; InputRowSerde.toBytes(in, aggregatorFactories, true); }
Source:
<code>protected File generateFiles(final Study study, final DatasetDTO dataSetDto, final Map<Integer, StudyInstance> selectedDatasetInstancesMap, final Map<Integer, List<ObservationUnitRow>> observationUnitRowMap, final List<MeasurementVariable> columns, final DatasetFileGenerator generator, final String fileExtension) throws IOException { final List<File> files = new ArrayList<>(); final File temporaryFolder = Files.createTempDir(); for(final Integer instanceDBID: observationUnitRowMap.keySet()) { final String sanitizedFileName = FileUtils.sanitizeFileName(String .format( "%s_%s_%s_%s." + fileExtension, study.getName() + "-" + selectedDatasetInstancesMap.get(instanceDBID).getInstanceNumber(), selectedDatasetInstancesMap.get(instanceDBID).getLocationAbbreviation(), DataSetType.findById(dataSetDto.getDatasetTypeId()).getReadableName(), dataSetDto.getName())); final String fileNameFullPath = temporaryFolder.getAbsolutePath() + File.separator + sanitizedFileName; files.add( generator.generateSingleInstanceFile(study.getId(), dataSetDto, columns, observationUnitRowMap.get(instanceDBID), fileNameFullPath)); } <START> if(this instanceof DatasetKSUCSVExportServiceImpl || this instanceof DatasetKSUExcelExportServiceImpl) { <END> final String sanitizedTraitsAndSelectionFilename = FileUtils.sanitizeFileName(String .format( "%s_%s_%s.trt", study.getName(), DataSetType.findById(dataSetDto.getDatasetTypeId()).getReadableName(), dataSetDto.getName())); final String traitsAndSelectionFilename = temporaryFolder.getAbsolutePath() + File.separator + sanitizedTraitsAndSelectionFilename; final List<MeasurementVariable> traitAndSelectionVariables = this.getTraitAndSelectionVariables(dataSetDto.getDatasetId()); files.add( generator.generateTraitAndSelectionVariablesFile(this.convertTraitAndSelectionVariablesData(traitAndSelectionVariables), traitsAndSelectionFilename)); } if (files.size() == 1) { return files.get(0); } else { return this.zipUtil.zipFiles(study.getName(), files); } }</code><technical_language>of instanceof is a code smell in OOP world. If tempted it, opportunity assess practicing practices in OOP</technical_language>

Target:
File generateFiles(final Study study, final DatasetDTO dataSetDto, final Map<Integer, StudyInstance> selectedDatasetInstancesMap, final Map<Integer, List<ObservationUnitRow>> observationUnitRowMap, final List<MeasurementVariable> columns, final DatasetFileGenerator generator, final String fileExtension) throws IOException { final File temporaryFolder = Files.createTempDir(); final List<File> files = this.getInstanceFiles(study, dataSetDto, selectedDatasetInstancesMap, observationUnitRowMap, columns, generator, fileExtension, temporaryFolder); return this.getReturnFile(study, files); }
Source:
<code>public void testDoesNotPromoteIfMasterTimeoutNotExpired() throws Exception { persister.delta(ManagementPlaneSyncRecordDeltaImpl.builder() .node(newManagerMemento(ownNodeId, ManagementNodeState.STANDBY, currentTimeMillis())) .node(newManagerMemento("node1", ManagementNodeState.MASTER, currentTimeMillis())) .setMaster("node1") .build()); manager.start(HighAvailabilityMode.AUTO); <START> incrementClock(20, TimeUnit.SECONDS); <END> Asserts.succeedsContinually(new Runnable() { @Override public void run() { assertTrue(promotionListener.callTimestamps.isEmpty(), "calls="+promotionListener.callTimestamps); }}); }</code><technical_language>change this? a real clock changing 29 give time explicitly change again. is behaving differently that</technical_language>

Target:
public void testDoesNotPromoteIfMasterTimeoutNotExpired() throws Exception { persister.delta(ManagementPlaneSyncRecordDeltaImpl.builder() .node(newManagerMemento(ownNodeId, ManagementNodeState.STANDBY, currentTimeMillis())) .node(newManagerMemento("node1", ManagementNodeState.MASTER, currentTimeMillis())) .setMaster("node1") .build()); manager.start(HighAvailabilityMode.AUTO); incrementClock(29, TimeUnit.SECONDS); Asserts.succeedsContinually(new Runnable() { @Override public void run() { assertTrue(promotionListener.callTimestamps.isEmpty(), "calls="+promotionListener.callTimestamps); }}); }
Source:
<code><START> @Override public <END> void onDestroyView() { recyclerView.setAdapter(null); unbinder.unbind(); unbinder = null; super.onDestroyView(); }</code><technical_language>Needs a line break for consistency</technical_language>

Target:
public void onDestroyView() { recyclerView.setAdapter(null); unbinder.unbind(); unbinder = null; super.onDestroyView(); }
Source:
<code>public QuerySchemaPatch makePatch(CacheConfiguration<?, ?> targetCfg, Collection<QueryEntity> target) { synchronized (mux) { Map<String, QueryEntity> localEntities = new HashMap<>(); Collection<SchemaAbstractOperation> patchOperations = new ArrayList<>(); Collection<QueryEntity> entityToAdd = new ArrayList<>(); if (entities.isEmpty() && targetCfg != null) { patchOperations.add(new SchemaAddQueryEntityOperation( UUID.randomUUID(), targetCfg.getName(), targetCfg.getSqlSchema(), target, targetCfg.getQueryParallelism(), targetCfg.isSqlEscapeAll() )); <START> return new QuerySchemaPatch(patchOperations, entityToAdd, ""); <END> } for (QueryEntity entity : entities) { if (localEntities.put(entity.getTableName(), entity) != null) throw new IllegalStateException("Duplicate key"); } StringBuilder conflicts = new StringBuilder(); for (QueryEntity queryEntity : target) { if (localEntities.containsKey(queryEntity.getTableName())) { QueryEntity localEntity = localEntities.get(queryEntity.getTableName()); QueryEntityPatch entityPatch = localEntity.makePatch(queryEntity); if (entityPatch.hasConflict()) { if (conflicts.length() > 0) conflicts.append("\n"); conflicts.append(entityPatch.getConflictsMessage()); } if (!entityPatch.isEmpty()) patchOperations.addAll(entityPatch.getPatchOperations()); } else entityToAdd.add(QueryUtils.copy(queryEntity)); } return new QuerySchemaPatch(patchOperations, entityToAdd, conflicts.toString()); } }</code><technical_language>Collections.singletonList Collections.emptyList() omit declaration of patchOperations, entityToAdd localEntities</technical_language>

Target:
public QuerySchemaPatch makePatch(CacheConfiguration<?, ?> targetCfg, Collection<QueryEntity> target) { synchronized (mux) { if (entities.isEmpty() && targetCfg != null) { SchemaAddQueryEntityOperation op = new SchemaAddQueryEntityOperation( UUID.randomUUID(), targetCfg.getName(), targetCfg.getSqlSchema(), target, targetCfg.getQueryParallelism(), targetCfg.isSqlEscapeAll() ); return new QuerySchemaPatch(Collections.singletonList(op), Collections.emptyList(), ""); } Map<String, QueryEntity> localEntities = new HashMap<>(); for (QueryEntity entity : entities) { if (localEntities.put(entity.getTableName(), entity) != null) throw new IllegalStateException("Duplicate key"); } Collection<SchemaAbstractOperation> patchOperations = new ArrayList<>(); Collection<QueryEntity> entityToAdd = new ArrayList<>(); StringBuilder conflicts = new StringBuilder(); for (QueryEntity queryEntity : target) { if (localEntities.containsKey(queryEntity.getTableName())) { QueryEntity localEntity = localEntities.get(queryEntity.getTableName()); QueryEntityPatch entityPatch = localEntity.makePatch(queryEntity); if (entityPatch.hasConflict()) { if (conflicts.length() > 0) conflicts.append("\n"); conflicts.append(entityPatch.getConflictsMessage()); } if (!entityPatch.isEmpty()) patchOperations.addAll(entityPatch.getPatchOperations()); } else entityToAdd.add(QueryUtils.copy(queryEntity)); } return new QuerySchemaPatch(patchOperations, entityToAdd, conflicts.toString()); } }
Source:
<code>public void testGetDocContent_shortCheckpoint() throws Exception { config.overrideKey("feed.maxUrls", "5"); adaptor.init(context); long startTime = new Date().getTime(); RecordingResponse response = new RecordingResponse(); adaptor.getDocContent(new MockRequest(new DocId("pseudo/type=document")), response); List<Record> golden = ImmutableList.of( new Record.Builder( new DocId("guid/{AAAAAAAA-0000-0000-0000-000000000001}")) .build(), new Record.Builder( new DocId("guid/{AAAAAAAA-0000-0000-0000-000000000002}")) .build(), new Record.Builder( new DocId("guid/{AAAAAAAA-0000-0000-0000-000000000003}")) .build(), new Record.Builder( new DocId("guid/{AAAAAAAA-0000-0000-0000-000000000004}")) .build()); <START> RecordingDocIdPusher pusher <END> = (RecordingDocIdPusher) context.getDocIdPusher(); List<Record> actual = pusher.getRecords(); assertEquals(golden, actual.subList(0, actual.size() - 1)); Record continuation = actual.get(actual.size() - 1); String docid = continuation.getDocId().getUniqueId(); assertTrue(docid, docid.startsWith("pseudo/")); Checkpoint checkpoint = new Checkpoint(docid.substring(docid.indexOf('/') + 1)); assertEquals("document", checkpoint.type); assertEquals(new Id("{AAAAAAAA-0000-0000-0000-000000000004}"), checkpoint.guid); assertTrue((checkpoint.timestamp.getTime() - startTime) < 2000); }</code><technical_language>a while decipher this. a helper method RecordingDocIdPusher getContextPusher()</technical_language>

Target:
public void testGetDocContent_shortCheckpoint() throws Exception { config.overrideKey("feed.maxUrls", "5"); adaptor.init(context); RecordingResponse response = new RecordingResponse(); adaptor.getDocContent( new MockRequest(newDocId(new Checkpoint("type=document"))), response); List<Record> actual = getContextPusher().getRecords(); assertEquals(ImmutableList.of( new Record.Builder(newDocId("{AAAAAAAA-0000-0000-0000-000000000001}")) .build(), new Record.Builder(newDocId("{AAAAAAAA-0000-0000-0000-000000000002}")) .build(), new Record.Builder(newDocId("{AAAAAAAA-0000-0000-0000-000000000003}")) .build(), new Record.Builder(newDocId("{AAAAAAAA-0000-0000-0000-000000000004}")) .build()), actual.subList(0, actual.size() - 1)); Record continuation = actual.get(actual.size() - 1); String docid = continuation.getDocId().getUniqueId(); assertTrue(docid, docid.startsWith("pseudo/")); Checkpoint checkpoint = new Checkpoint(docid.substring(docid.indexOf('/') + 1)); assertEquals("document", checkpoint.type); assertEquals("{AAAAAAAA-0000-0000-0000-000000000004}", checkpoint.guid); }
Source:
<code>Map<String, Object> toMapping() { Map<String, Object> mapping = new HashMap<>(); addTypeOptions(mapping); mapping.put("type", typeNameForESMapping()); if (position != null) { mapping.put("position", position); } if (indexType == Reference.IndexType.NO) { mapping.put("index", false); } if (copyToTargets != null) { mapping.put("copy_to", copyToTargets); } if ("array".equals(collectionType)) { Map<String, Object> outerMapping = new HashMap<>(); outerMapping.put("type", "array"); if (dataType().id() == ObjectType.ID) { objectMapping(mapping); } outerMapping.put("inner", mapping); return outerMapping; } else if (dataType().id() == ObjectType.ID) { objectMapping(mapping); } if (columnStore == false) { mapping.put(DOC_VALUES, "false"); } if (formattedDefaultExpression != null) { mapping.put("default_expr", formattedDefaultExpression); } <START> <END> return mapping; }</code><technical_language>add assertion formattedDefaultExpression null if defaultExpression is null. a programming error initialized correctly. Generally I this AnalyzedColumnDefinition some work, out of scope of this PR</technical_language>

Target:
Map<String, Object> toMapping() { Map<String, Object> mapping = new HashMap<>(); addTypeOptions(mapping); mapping.put("type", typeNameForESMapping()); if (position != null) { mapping.put("position", position); } if (indexType == Reference.IndexType.NO) { mapping.put("index", false); } if (copyToTargets != null) { mapping.put("copy_to", copyToTargets); } if ("array".equals(collectionType)) { Map<String, Object> outerMapping = new HashMap<>(); outerMapping.put("type", "array"); if (dataType().id() == ObjectType.ID) { objectMapping(mapping); } outerMapping.put("inner", mapping); return outerMapping; } else if (dataType().id() == ObjectType.ID) { objectMapping(mapping); } if (columnStore == false) { mapping.put(DOC_VALUES, "false"); } assert ((formattedDefaultExpression != null && defaultExpression != null) || (formattedDefaultExpression == null && defaultExpression == null)) : "Default Expression is not properly initialized"; if (formattedDefaultExpression != null) { mapping.put("default_expr", formattedDefaultExpression); } return mapping; }
Source:
<code>protected ImagePickerSheetView(final Builder builder) { super(builder.context); inflate(getContext(), R.layout.grid_sheet_view, this); tileGrid = (GridView) findViewById(R.id.grid); if(builder.spacing>0){ spacing = builder.spacing; <START> }else { <END> spacing = getResources().getDimensionPixelSize(R.dimen.bottomsheet_image_tile_spacing); } tileGrid.setDrawSelectorOnTop(true); tileGrid.setVerticalSpacing(spacing); tileGrid.setHorizontalSpacing(spacing); tileGrid.setPadding(spacing, 0, spacing, 0); titleView = (TextView) findViewById(R.id.title); originalGridPaddingTop = tileGrid.getPaddingTop(); setTitle(builder.title); if (builder.onTileSelectedListener != null) { tileGrid.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(@NonNull AdapterView<?> parent, @NonNull View view, int position, long id) { builder.onTileSelectedListener.onTileSelected(adapter.getItem(position)); } }); } maxItems = builder.maxItems; imageProvider = builder.imageProvider; showCameraOption = builder.showCameraOption; showPickerOption = builder.showPickerOption; cameraDrawable = builder.cameraDrawable; pickerDrawable = builder.pickerDrawable; ViewCompat.setElevation(this, Util.dp2px(getContext(), 16f)); }</code><technical_language>Please update this match code style in this file: java if (builder.spacing > 0) { spacing = builder.spacing; } else { spacing = getResources().getDimensionPixelSize(R.dimen.bottomsheet_image_tile_spacing); }</technical_language>

Target:
protected ImagePickerSheetView(final Builder builder) { super(builder.context); inflate(getContext(), R.layout.grid_sheet_view, this); tileGrid = (GridView) findViewById(R.id.grid); if(builder.spacing>=0){ spacing = builder.spacing; }else { spacing = getResources().getDimensionPixelSize(R.dimen.bottomsheet_image_tile_spacing); } tileGrid.setDrawSelectorOnTop(true); tileGrid.setVerticalSpacing(spacing); tileGrid.setHorizontalSpacing(spacing); tileGrid.setPadding(spacing, 0, spacing, 0); titleView = (TextView) findViewById(R.id.title); originalGridPaddingTop = tileGrid.getPaddingTop(); setTitle(builder.title); if (builder.onTileSelectedListener != null) { tileGrid.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(@NonNull AdapterView<?> parent, @NonNull View view, int position, long id) { builder.onTileSelectedListener.onTileSelected(adapter.getItem(position)); } }); } maxItems = builder.maxItems; imageProvider = builder.imageProvider; showCameraOption = builder.showCameraOption; showPickerOption = builder.showPickerOption; cameraDrawable = builder.cameraDrawable; pickerDrawable = builder.pickerDrawable; ViewCompat.setElevation(this, Util.dp2px(getContext(), 16f)); }
Source:
<code><START> protected StorageDomain getNewMaster() { <END> if (newMaster == null) { newMaster = electNewMaster(true, canChooseInactiveDomainAsMaster, canChooseCurrentMasterAsNewMaster); } return newMaster; }</code><technical_language>in theory domains status change run of reconstruct command, lead unexpected results. i preserve behavior in electNewMaster executed avoid corner cases</technical_language>

Target:
protected StorageDomain getNewMaster() { if (newMaster == null) { newMaster = electNewMaster(true, getParameters().isCanChooseInactiveDomainAsMaster(), getParameters().isCanChooseCurrentMasterAsNewMaster()); } return newMaster; }
Source:
<code><START> public Matrix addi(final Matrix matrix) { <END> if (matrix.isDense()) { throw new UnsupportedOperationException(); } else { ((NumericOps) breezeMatrix).$plus$eq(((CSCMatrix) matrix).breezeMatrix, MatrixOps.ADDI_SS); return this; } }</code><technical_language>UnsupportedOperationException thrown this method</technical_language>

Target:
public Matrix addi(final Matrix matrix) { if (matrix.isDense()) { ((NumericOps) breezeMatrix).$plus$eq(((DenseMatrix) matrix).getBreezeMatrix(), MatrixOps.ADDI_MM); } else { ((NumericOps) breezeMatrix).$plus$eq(((CSCMatrix) matrix).breezeMatrix, MatrixOps.ADDI_SS); } return this; }
Source:
<code><START> public Assembly() { <END> }</code><technical_language>If frameworks, this package protected</technical_language>

Target:
Assembly() { }
Source:
<code>private void setupProjects() { if (projectController.canReadProjects()) { projects = projects.stream() .filter(p -> projectController.canReadProject(p)) .collect(Collectors.toList()); <START> projects.sort((p1, p2) -> p1.getProjectName().compareTo(p2.getProjectName())); <END> updateView(projects); } }</code><technical_language>(optional) this more conscise project.sort(Comparator.comparing(Project::getProjectName))</technical_language>

Target:
private void setupProjects() { if (projectController.canReadProjects()) { projects = projects.stream() .filter(p -> projectController.canReadProject(p)) .collect(Collectors.toList()); projects.sort((p1, p2) -> p1.getProjectName().toUpperCase().compareTo(p2.getProjectName().toUpperCase())); updateView(projects); } }
Source:
<code>public List<V> get(@Nullable K k) { List<V> value = null; Slice valueSlice = store.getSync(getBucketId(k), streamCodec.toByteArray(k)); if (isKeyContainsMultiValue) { value = (List<V>)streamCodec.fromByteArray(valueSlice); } else { <START> if (valueSlice == null || valueSlice.length == 0 || valueSlice.buffer == null) { <END> return null; } value = new ArrayList<>(); value.add((V)streamCodec.fromByteArray(valueSlice)); } return value; }</code><technical_language>this if block nested if? Perhaps, populate valueSlice store.getSync()</technical_language>

Target:
public List<V> get(@Nullable K k) { List<V> value = null; Slice valueSlice = store.getSync(getBucketId(k), streamCodec.toByteArray(k)); if (valueSlice == null || valueSlice.length == 0 || valueSlice.buffer == null) { return null; } if (isKeyContainsMultiValue) { return (List<V>)streamCodec.fromByteArray(valueSlice); } value = new ArrayList<>(); value.add((V)streamCodec.fromByteArray(valueSlice)); return value; }
Source:
<code>public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { String configuredConnection = (String) config.get("connection"); if (StringUtils.isNotBlank(configuredConnection)) { connectionString = configuredConnection; logger.debug("Setting connection from config: {}", connectionString); } <START> String configuredRepeatMode = ((String) config.get("repeatMode")).toLowerCase(); <END> if (StringUtils.isNotBlank(configuredRepeatMode)) { if (configuredRepeatMode.matches("always")) { repeatMode = DmxTransmitter.REPEAT_MODE_ALWAYS; logger.debug("repeatMode set to always"); } else if (configuredRepeatMode.matches("never")) { repeatMode = DmxTransmitter.REPEAT_MODE_NEVER; logger.debug("repeatMode set to never"); } else if (configuredRepeatMode.matches("reduced")) { repeatMode = DmxTransmitter.REPEAT_MODE_REDUCED; logger.debug("repeatMode set to reduced"); } else { repeatMode = DmxTransmitter.REPEAT_MODE_ALWAYS; logger.warn("repeatMode not recognized, set to default 'always'"); } if (transmitter != null) { transmitter.setRepeatMode(repeatMode); } } } if (connection != null) { if (!connection.isClosed()) { connection.close(); } } }</code><technical_language>This NPE if repeatMode is configured in configuration, in order compatible for existing users, code allow repeatMode is configured. advice earlier enum type</technical_language>

Target:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { String configuredConnection = (String) config.get("connection"); if (StringUtils.isNotBlank(configuredConnection)) { connectionString = configuredConnection; logger.debug("Setting connection from config: {}", connectionString); } String configuredRepeatMode = ((String) config.get("repeatMode")); if (StringUtils.isNotBlank(configuredRepeatMode)) { repeatMode = DmxTransmitter.DmxRepeatMode.fromString(configuredRepeatMode); if (repeatMode == null) { repeatMode = DmxTransmitter.DmxRepeatMode.ALWAYS; logger.error("repeatMode not recognized, set to {}", configuredRepeatMode, repeatMode); } else { logger.debug("repeatMode set to {}", repeatMode.toString()); } if (transmitter != null) { transmitter.setRepeatMode(repeatMode); } } } if (connection != null) { if (!connection.isClosed()) { connection.close(); } } }
Source:
<code>public void flush() throws RemoteException { int size = whereArgs.size(); if (size > 0) { String foo = new String [size]; foo = whereArgs.toArray(foo); int numrows = mProvider.delete(mBaseUri, MediaStore.MediaColumns._ID + " IN (" + whereClause.toString() + ")", foo); <START> Log.i(TAG, "rows deleted: " + numrows); <END> whereClause.setLength(0); whereArgs.clear(); } }</code><technical_language>guard this if (DEBUG)</technical_language>

Target:
public void flush() throws RemoteException { int size = whereArgs.size(); if (size > 0) { String foo = new String [size]; foo = whereArgs.toArray(foo); int numrows = mProvider.delete(mBaseUri, MediaStore.MediaColumns._ID + " IN (" + whereClause.toString() + ")", foo); if (DEBUG) Log.i(TAG, "rows deleted: " + numrows); whereClause.setLength(0); whereArgs.clear(); } }
Source:
<code>protected void executeVdsIdCommand() { final SetVdsStatusVDSCommandParameters parameters = getParameters(); if (_vdsManager != null) { final VDS vds = getVds(); if (vds.getSpmStatus() != VdsSpmStatus.None && parameters.getStatus() != VDSStatus.Up) { log.infoFormat("VDS {0} is spm and moved from up calling resetIrs.", vds.getName()); getVDSReturnValue().setSucceeded( ResourceManager .getInstance() .runVdsCommand( VDSCommandType.ResetIrs, new ResetIrsVDSCommandParameters(vds.getStoragePoolId(), vds.getId())) .getSucceeded()); if (!getVDSReturnValue().getSucceeded() && getParameters().shouldLogStopSpmFailure()) { AuditLogableBase base = new AuditLogableBase(); base.setVds(vds); <START> AuditLogDirector.log(base, AuditLogType.FAILED_TO_STOP_SPM_ON_HOST); <END> } } if (getVDSReturnValue().getSucceeded()) { updateVdsFromParameters(parameters, vds); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { _vdsManager.setStatus(parameters.getStatus(), vds); _vdsManager.updateDynamicData(vds.getDynamicData()); _vdsManager.updateStatisticsData(vds.getStatisticsData()); return null; } }); } } else { getVDSReturnValue().setSucceeded(false); } }</code><technical_language>IMO distinguish situation spm stop failed situation performed</technical_language>

Target:
protected void executeVdsIdCommand() { final SetVdsStatusVDSCommandParameters parameters = getParameters(); if (_vdsManager != null) { final VDS vds = getVds(); if (vds.getSpmStatus() != VdsSpmStatus.None && parameters.getStatus() != VDSStatus.Up) { log.infoFormat("VDS {0} is spm and moved from up calling resetIrs.", vds.getName()); getVDSReturnValue().setSucceeded( ResourceManager .getInstance() .runVdsCommand( VDSCommandType.ResetIrs, new ResetIrsVDSCommandParameters(vds.getStoragePoolId(), vds.getId())) .getSucceeded()); if (!getVDSReturnValue().getSucceeded()) { if (getParameters().isStopSpmFailureLogged()) { AuditLogableBase base = new AuditLogableBase(); base.setVds(vds); AuditLogDirector.log(base, AuditLogType.FAILED_TO_STOP_SPM_ON_HOST); } return; } } updateVdsFromParameters(parameters, vds); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { _vdsManager.setStatus(parameters.getStatus(), vds); _vdsManager.updateDynamicData(vds.getDynamicData()); _vdsManager.updateStatisticsData(vds.getStatisticsData()); return null; } }); } else { getVDSReturnValue().setSucceeded(false); } }
Source:
<code>public static TissueOrigin to(TissueOriginDto from) { TissueOrigin to = new TissueOriginImpl(); <START> to.setAlias(from.getAlias()); <END> to.setDescription(from.getDescription()); return to; }</code><technical_language>removing setIDs here</technical_language>

Target:
public static TissueOrigin to(TissueOriginDto from) { TissueOrigin to = new TissueOriginImpl(); to.setTissueOriginId(from.getId()); to.setAlias(from.getAlias()); to.setDescription(from.getDescription()); return to; }
Source:
<code>private void checkDefineArguments(FunctionCallTree tree) { SeparatedList<ExpressionTree> arguments = tree.arguments(); <START> if (arguments.size() >= 3 && arguments.get(2).is(Kind.BOOLEAN_LITERAL) && <END> "true".equalsIgnoreCase(((LiteralTree)arguments.get(2)).value())) { context().newIssue(this, tree, "Define this constant as case sensitive."); } }</code><technical_language>is a version more parameter 3? If i == 3 >=</technical_language>

Target:
private void checkDefineArguments(FunctionCallTree tree) { SeparatedList<ExpressionTree> arguments = tree.arguments(); if (arguments.size() == 3) { ExpressionTree caseInsensitiveArgument = arguments.get(2); if (caseInsensitiveArgument.is(Kind.BOOLEAN_LITERAL) && "true".equalsIgnoreCase(((LiteralTree) caseInsensitiveArgument).value())) { context().newIssue(this, tree, "Define this constant as case sensitive."); } } }
Source:
<code>private MessageChannel createNewSubflow(Message<?> message) { String host = (String) message.getHeaders().get("host"); Integer port = (Integer) message.getHeaders().get("port"); Assert.state(host != null && port != null, "host and/or port header missing"); String hostPort = host + port; TcpNetClientConnectionFactory cf = new TcpNetClientConnectionFactory(host, port); this.context.getBeanFactory().registerSingleton(hostPort + ".cf", cf); this.context.getBeanFactory().initializeBean(cf, hostPort+".cf"); cf.afterPropertiesSet(); TcpSendingMessageHandler handler = new TcpSendingMessageHandler(); handler.setConnectionFactory(cf); IntegrationFlow flow = f -> f.handle(handler); this.flowContext.register(hostPort + ".flow", flow); <START> MessageChannel channel = context.getBean(hostPort + ".flow.input", MessageChannel.class); <END> this.subFlows.put(hostPort, channel); return channel; }</code><technical_language>I avoid ctx.getBean() this.flowContext.messagingTemplateFor(hostPort + ".flow").getDefaultDestination(). I suggest more option-method in a refinement of IntegrationFlowContext: <LINK_0> WDYT</technical_language>

Target:
private MessageChannel createNewSubflow(Message<?> message) { String host = (String) message.getHeaders().get("host"); Integer port = (Integer) message.getHeaders().get("port"); Assert.state(host != null && port != null, "host and/or port header missing"); String hostPort = host + port; TcpNetClientConnectionFactory cf = new TcpNetClientConnectionFactory(host, port); this.context.getBeanFactory().registerSingleton(hostPort + ".cf", cf); this.context.getBeanFactory().initializeBean(cf, hostPort+".cf"); cf.afterPropertiesSet(); TcpSendingMessageHandler handler = new TcpSendingMessageHandler(); handler.setConnectionFactory(cf); IntegrationFlow flow = f -> f.handle(handler); this.flowContext.register(hostPort + ".flow", flow); MessageChannel channel = this.flowContext.messagingTemplateFor(hostPort + ".flow").getDefaultDestination(); this.subFlows.put(hostPort, channel); return channel; }
Source:
<code>private void createTaskDataBySprint(int sprintid) { SprintBacklogMapper backlog = (new SprintBacklogLogic(project, session, String.valueOf(sprintid))).getSprintBacklogMapper(); <START> List<IIssue> issues = backlog.getAllTasks(); <END> Date timeNode = new Date(this.m_chartStartDate.getTime()); while (timeNode.getTime() <= this.m_chartEndDate.getTime()) { if ((this.Today.getDate() == timeNode.getDate()) && (Math.abs(this.Today.getTime() - timeNode.getTime()) <= OneDay)) { this.countStatusChange(issues, this.Today); break; } else { this.countStatusChange(issues, timeNode); } timeNode = new Date(timeNode.getTime() + this.m_interval * OneDay); } }</code><technical_language>List => ArrayList</technical_language>

Target:
private void createTaskDataBySprint(int sprintid) { SprintBacklogMapper backlog = (new SprintBacklogLogic(project, session, String.valueOf(sprintid))).getSprintBacklogMapper(); ArrayList<TaskObject> issues = backlog.getAllTasks(); Date timeNode = new Date(this.m_chartStartDate.getTime()); while (timeNode.getTime() <= this.m_chartEndDate.getTime()) { if ((this.Today.getDate() == timeNode.getDate()) && (Math.abs(this.Today.getTime() - timeNode.getTime()) <= OneDay)) { this.countStatusChange(issues, this.Today); break; } else { this.countStatusChange(issues, timeNode); } timeNode = new Date(timeNode.getTime() + this.m_interval * OneDay); } }
Source:
<code>protected IResourceLoader createLoaderFor(HttpServletRequest req, String requestedExternalPath) { for (ResourceLoaders f : m_resourceLoaders) { <START> IResourceLoader candidate = f.create(req, requestedExternalPath); <END> if (candidate != null) { return candidate; } } return null; }</code><technical_language>Naming: Rename "f" "factory". Rename "candidate" "loader" (I expect candidate checked accept() method similar)</technical_language>

Target:
protected IResourceLoader createLoaderFor(HttpServletRequest req, String requestedExternalPath) { for (ResourceLoaders loaderFactory : m_resourceLoaders) { IResourceLoader loader = loaderFactory.create(req, requestedExternalPath); if (loader != null) { return loader; } } return null; }
Source:
<code><START> public static NotebookAuthorization init(ZeppelinConfiguration config) { <END> if (instance == null) { instance = new NotebookAuthorization(); } conf = config; filePath = conf.getNotebookAuthorizationPath(); GsonBuilder builder = new GsonBuilder(); builder.setPrettyPrinting(); gson = builder.create(); try { loadFromFile(); } catch (IOException e) { LOG.error("Error loading NotebookAuthorization", e); } return instance; }</code><technical_language>moving constructor init method (factory method pattern)? Especially, conf object is static, calling multiple time init override conf field. state of NotebookAuthorization consistent</technical_language>

Target:
public static NotebookAuthorization init(ZeppelinConfiguration config) { if (instance == null) { instance = new NotebookAuthorization(); conf = config; filePath = conf.getNotebookAuthorizationPath(); GsonBuilder builder = new GsonBuilder(); builder.setPrettyPrinting(); gson = builder.create(); try { loadFromFile(); } catch (IOException e) { LOG.error("Error loading NotebookAuthorization", e); } } return instance; }
Source:
<code>public void updateClasspath(IProject project, IProgressMonitor monitor) { IJavaProject javaProject = JavaCore.create(project); if(javaProject != null) { <START> AbstractJavaProjectConfigurator.removeTestMavenClasspathContainer(javaProject); <END> try { IClasspathEntry containerEntry = getMavenContainerEntry(javaProject); IPath path = containerEntry != null ? containerEntry.getPath() : new Path(CONTAINER_ID); IClasspathEntry[] mainClasspath = getClasspath(project, CLASSPATH_RUNTIME, monitor); HashSet<IPath> mainPaths = new HashSet<>(); for(IClasspathEntry ce : mainClasspath) { mainPaths.add(ce.getPath()); } IClasspathEntry[] testClasspath = getClasspath(project, CLASSPATH_DEFAULT, monitor); IClasspathEntry[] classpath = new IClasspathEntry[testClasspath.length]; for(int i = 0; i < testClasspath.length; i++ ) { IClasspathEntry classpathEntry = testClasspath[i]; if(mainPaths.contains(classpathEntry.getPath())) { classpath[i] = classpathEntry; } else { classpath[i] = addTestAttribute(classpathEntry); } } IClasspathContainer container = new MavenClasspathContainer(path, classpath); JavaCore.setClasspathContainer(container.getPath(), new IJavaProject[] {javaProject}, new IClasspathContainer[] {container}, monitor); saveContainerState(project, container); } catch(CoreException ex) { log.error(ex.getMessage(), ex); } } }</code><technical_language>removed</technical_language>

Target:
public void updateClasspath(IProject project, IProgressMonitor monitor) { IJavaProject javaProject = JavaCore.create(project); if(javaProject != null) { try { IClasspathEntry containerEntry = getMavenContainerEntry(javaProject); IPath path = containerEntry != null ? containerEntry.getPath() : new Path(CONTAINER_ID); IClasspathEntry[] mainClasspath = getClasspath(project, CLASSPATH_RUNTIME, monitor); HashSet<IPath> mainPaths = new HashSet<>(); for(IClasspathEntry ce : mainClasspath) { mainPaths.add(ce.getPath()); } IClasspathEntry[] testClasspath = getClasspath(project, CLASSPATH_DEFAULT, monitor); IClasspathEntry[] classpath = new IClasspathEntry[testClasspath.length]; for(int i = 0; i < testClasspath.length; i++ ) { IClasspathEntry classpathEntry = testClasspath[i]; if(mainPaths.contains(classpathEntry.getPath())) { classpath[i] = classpathEntry; } else { classpath[i] = addTestAttribute(classpathEntry); } } IClasspathContainer container = new MavenClasspathContainer(path, classpath); JavaCore.setClasspathContainer(container.getPath(), new IJavaProject[] {javaProject}, new IClasspathContainer[] {container}, monitor); saveContainerState(project, container); } catch(CoreException ex) { log.error(ex.getMessage(), ex); } } }
Source:
<code>public void trackValuePropLearnMoreTapped(@NonNull String courseId, @Nullable String assignmentId, @NonNull String screenName) { final SegmentEvent aEvent = new SegmentEvent(); aEvent.properties.putValue(Keys.NAME, Values.VALUE_PROP_LEARN_MORE_CLICKED); aEvent.data.putValue(Keys.COURSE_ID, courseId); <START> if (assignmentId != null) { <END> aEvent.data.putValue(Keys.ASSIGNMENT_ID, assignmentId); } aEvent.data.putValue(Keys.SCREEN_NAME, screenName); trackSegmentEvent(Events.VALUE_PROP_LEARN_MORE_CLICKED, aEvent.properties); }</code><technical_language>condition replaced !TextUtils.isEmpty(assignmentId)</technical_language>

Target:
public void trackValuePropLearnMoreTapped(@NonNull String courseId, @Nullable String assignmentId, @NonNull String screenName) { final SegmentEvent aEvent = new SegmentEvent(); aEvent.properties.putValue(Keys.NAME, Values.VALUE_PROP_LEARN_MORE_CLICKED); aEvent.data.putValue(Keys.COURSE_ID, courseId); if (TextUtils.isEmpty(assignmentId)) { aEvent.data.putValue(Keys.ASSIGNMENT_ID, assignmentId); } aEvent.data.putValue(Keys.SCREEN_NAME, screenName); trackSegmentEvent(Events.VALUE_PROP_LEARN_MORE_CLICKED, aEvent.properties); }
Source:
<code>public void start(String scmId) throws IOException { LOG.info("Attempting to start container services."); <START> startContainerScrub(); <END> if (!writeChannel.isRunning()) { writeChannel.start(); } if (!readChannel.isRunning()) { readChannel.start(); } hddsDispatcher.init(); hddsDispatcher.setScmId(scmId); }</code><technical_language>Do need do similar for startContainerScrub also</technical_language>

Target:
public void start(String scmId) throws IOException { LOG.info("Attempting to start container services."); startContainerScrub(); writeChannel.start(); readChannel.start(); hddsDispatcher.init(); hddsDispatcher.setScmId(scmId); }
Source:
<code><START> private void backfillUpdateStrategy(JobUpdateSettings settings) { <END> IJobUpdateSettings updateSettings = IJobUpdateSettings.build(settings); if (!updateSettings.isSetUpdateStrategy()) { if (updateSettings.isWaitForBatchCompletion()) { settings.setUpdateStrategy( JobUpdateStrategy.batchStrategy( new BatchJobUpdateStrategy().setGroupSize(updateSettings.getUpdateGroupSize()))); } else { settings.setUpdateStrategy( JobUpdateStrategy.queueStrategy( new QueueJobUpdateStrategy().setGroupSize(updateSettings.getUpdateGroupSize()))); } } }</code><technical_language>I perform reverse operation if possible: If new settings set, write deprecated ones. This add complexity scheduler upgrade/downgrade paths easier reason about</technical_language>

Target:
public static void backfillUpdateStrategy(JobUpdateSettings settings) { IJobUpdateSettings updateSettings = IJobUpdateSettings.build(settings); if (!updateSettings.isSetUpdateStrategy()) { if (updateSettings.isWaitForBatchCompletion()) { settings.setUpdateStrategy( JobUpdateStrategy.batchStrategy( new BatchJobUpdateStrategy().setGroupSize(updateSettings.getUpdateGroupSize()))); } else { settings.setUpdateStrategy( JobUpdateStrategy.queueStrategy( new QueueJobUpdateStrategy().setGroupSize(updateSettings.getUpdateGroupSize()))); } } }