auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static JsonObject mergeTenantConfScopes(JsonElement existingTenantConfScopes, JsonElement newTenantConfScopes) { JsonArray existingTenantConfScopesArray = (JsonArray) existingTenantConfScopes.getAsJsonObject(). get(APIConstants.REST_API_SCOPE); JsonArray newTenantConfScopesArray = (JsonArray) newTenantConfScopes.getAsJsonObject(). get(APIConstants.REST_API_SCOPE); <START> JsonArray mergedTenantConfScopesArray = newTenantConfScopesArray; <END> for (int i = 0; i < existingTenantConfScopesArray.size(); i++) { JsonObject existingScopeRoleMapping = existingTenantConfScopesArray.get(i).getAsJsonObject(); String existingScopeName = existingScopeRoleMapping.get(APIConstants.REST_API_SCOPE_NAME).getAsString(); Boolean isExist = false; for (int j = 0; j < newTenantConfScopesArray.size(); j++) { JsonObject newScopeRoleMapping = newTenantConfScopesArray.get(j).getAsJsonObject(); String newScopeName = newScopeRoleMapping.get(APIConstants.REST_API_SCOPE_NAME).getAsString(); if (StringUtils.equals(existingScopeName, newScopeName)) { isExist = true; break; } } if (!isExist) { mergedTenantConfScopesArray.add(existingTenantConfScopesArray.get(i)); } } JsonObject mergedTenantConfScopes = new JsonObject(); mergedTenantConfScopes.add(APIConstants.REST_API_SCOPE, mergedTenantConfScopesArray); return mergedTenantConfScopes; }</code><technical_language>Assigning newTenantConfScopesArray mergedTenantConfScopesArray references. adding element mergedTenantConfScopesArray, in newTenantConfScopesArray. a copy assign instead? eg: JsonElement newTenantConfScopes = new JsonParser().parse(newScopeRoleJson.toJSONString());</technical_language>

Target:
public static JsonObject mergeTenantConfScopes(JsonElement existingTenantConfScopes, JsonElement newTenantConfScopes) { JsonArray existingTenantConfScopesArray = (JsonArray) existingTenantConfScopes.getAsJsonObject(). get(APIConstants.REST_API_SCOPE); JsonArray newTenantConfScopesArray = (JsonArray) newTenantConfScopes.getAsJsonObject(). get(APIConstants.REST_API_SCOPE); JsonArray mergedTenantConfScopesArray = new JsonParser().parse(newTenantConfScopesArray.toString()). getAsJsonArray(); for (JsonElement existingScopeRoleMapping : existingTenantConfScopesArray) { String existingScopeName = existingScopeRoleMapping.getAsJsonObject().get(APIConstants.REST_API_SCOPE_NAME). getAsString(); Boolean scopeRoleMappingExists = false; for (JsonElement newScopeRoleMapping : newTenantConfScopesArray) { String newScopeName = newScopeRoleMapping.getAsJsonObject().get(APIConstants.REST_API_SCOPE_NAME). getAsString(); if (StringUtils.equals(existingScopeName, newScopeName)) { scopeRoleMappingExists = true; break; } } if (!scopeRoleMappingExists) { mergedTenantConfScopesArray.add(existingScopeRoleMapping); } } JsonObject mergedTenantConfScopes = new JsonObject(); mergedTenantConfScopes.add(APIConstants.REST_API_SCOPE, mergedTenantConfScopesArray); return mergedTenantConfScopes; }
Source:
<code>protected Range doSetCell(final int rowIndex, final int columnIndex, final Function<Pair<Integer, Integer>, GridCell<?>> cellSupplier) { if (rowIndex < 0 || rowIndex > rows.size() - 1) { return new Range(rowIndex); } if (columnIndex < 0 || columnIndex > columns.size() - 1) { return new Range(rowIndex); } final int _columnIndex = columns.get(columnIndex).getIndex(); if (!isMerged) { ((BaseGridRow) rows.get(rowIndex)).setCell(_columnIndex, <START> cellSupplier.apply(new Pair<>(rowIndex, columnIndex))); <END> return new Range(rowIndex); } final int minRowIndex = findMinRowIndexForCellUpdate(rowIndex, _columnIndex); final int maxRowIndex = findMaxRowIndexForCellUpdate(rowIndex, _columnIndex); final Range range = new Range(minRowIndex, maxRowIndex); for (int i = minRowIndex; i <= maxRowIndex; i++) { final GridRow row = rows.get(i); ((BaseGridRow) row).setCell(_columnIndex, cellSupplier.apply(new Pair<>(i, columnIndex))); } indexManager.onSetCell(range, _columnIndex); return range; }</code><technical_language>Hmm, for eyes is nicer Pair.newPair(rowIndex, columnIndex), if prefer this variant, know, prevent merging</technical_language>

Target:
protected Range doSetCell(final int rowIndex, final int columnIndex, final Function<Pair<Integer, Integer>, GridCell<?>> cellSupplier) { if (rowIndex < 0 || rowIndex > rows.size() - 1) { return new Range(rowIndex); } if (columnIndex < 0 || columnIndex > columns.size() - 1) { return new Range(rowIndex); } final int _columnIndex = columns.get(columnIndex).getIndex(); if (!isMerged) { ((BaseGridRow) rows.get(rowIndex)).setCell(_columnIndex, cellSupplier.apply(Pair.newPair(rowIndex, columnIndex))); return new Range(rowIndex); } final int minRowIndex = findMinRowIndexForCellUpdate(rowIndex, _columnIndex); final int maxRowIndex = findMaxRowIndexForCellUpdate(rowIndex, _columnIndex); final Range range = new Range(minRowIndex, maxRowIndex); for (int i = minRowIndex; i <= maxRowIndex; i++) { final GridRow row = rows.get(i); ((BaseGridRow) row).setCell(_columnIndex, cellSupplier.apply(Pair.newPair(i, columnIndex))); } indexManager.onSetCell(range, _columnIndex); return range; }
Source:
<code>public static ConfiguredTarget incompatibleConfiguredTarget( RuleContext ruleContext, OrderedSetMultimap<DependencyKind, ConfiguredTargetAndData> prerequisiteMap) throws ActionConflictException { <START> if ("toolchain".equals(ruleContext.getRule().getRuleClass())) { <END> return null; } if (ruleContext.attributes().has("target_compatible_with")) { Iterable<ConstraintValueInfo> constraintValues = PlatformProviderUtils.constraintValues( ruleContext.getPrerequisites("target_compatible_with")); for (ConstraintValueInfo constraintValue : constraintValues) { if (!ruleContext.targetPlatformHasConstraint(constraintValue)) { return createIncompatibleConfiguredTarget(ruleContext, null, constraintValue); } } } for (ConfiguredTargetAndData infoCollection : prerequisiteMap.values()) { ConfiguredTarget dependency = infoCollection.getConfiguredTarget(); if (dependency instanceof OutputFileConfiguredTarget) { dependency = ((OutputFileConfiguredTarget) dependency).getGeneratingRule(); } if (dependency.getProvider(IncompatiblePlatformProvider.class) != null) { return createIncompatibleConfiguredTarget(ruleContext, dependency, null); } } return null; }</code><technical_language>Explicitly exempting "toolchain" rule sense (it target_compatible_with differently), this re-use existing RuleClass.useToolchainResolution() check instead? toolchain resolution check target compatibility</technical_language>

Target:
public static ConfiguredTarget incompatibleConfiguredTarget( RuleContext ruleContext, OrderedSetMultimap<DependencyKind, ConfiguredTargetAndData> prerequisiteMap) throws ActionConflictException { if (!ruleContext.getRule().getRuleClassObject().useToolchainResolution()) { return null; } if (ruleContext.attributes().has("target_compatible_with")) { ImmutableList<ConstraintValueInfo> invalidConstraintValues = Streams.stream( PlatformProviderUtils.constraintValues( ruleContext.getPrerequisites("target_compatible_with"))) .filter(cv -> !ruleContext.targetPlatformHasConstraint(cv)) .collect(ImmutableList.toImmutableList()); if (!invalidConstraintValues.isEmpty()) { return createIncompatibleConfiguredTarget(ruleContext, null, invalidConstraintValues); } } ImmutableList.Builder<ConfiguredTarget> incompatibleDependenciesBuilder = ImmutableList.builder(); for (ConfiguredTargetAndData infoCollection : prerequisiteMap.values()) { ConfiguredTarget dependency = infoCollection.getConfiguredTarget(); if (dependency instanceof OutputFileConfiguredTarget) { dependency = ((OutputFileConfiguredTarget) dependency).getGeneratingRule(); } if (dependency.getProvider(IncompatiblePlatformProvider.class) != null) { incompatibleDependenciesBuilder.add(dependency); } } ImmutableList<ConfiguredTarget> incompatibleDependencies = incompatibleDependenciesBuilder.build(); if (!incompatibleDependencies.isEmpty()) { return createIncompatibleConfiguredTarget(ruleContext, incompatibleDependencies, null); } return null; }
Source:
<code>public void findRoleTestIdNull() { <START> Role returedRole = roleManagerImpl.findRole(null); <END> Assert.assertNull(returedRole); }</code><technical_language>TYPO. I returnedRole( r -> n ). Next tests here</technical_language>

Target:
public void findRoleTestIdNull() { Role returnedRole = roleManagerImpl.findRole(null); Assert.assertNull(returnedRole); }
Source:
<code>public final void execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap) { Configuration config = new Configuration(metaDataMap); try { ResourceResolver resourceResolver = workflowHelper.getResourceResolver(workflowSession); TagManager tagManager = resourceResolver.adaptTo(TagManager.class); if (tagManager == null) { log.error("Unable to adapt to Tag Manager. This step can't do it's work"); return; } final List<String> payloads = workflowPackageManager.getPaths(resourceResolver, (String) workItem.getWorkflowData().getPayload()); for (final String payload : payloads) { log.debug("Processing {}", payload); Resource payloadResource = resourceResolver.resolve(payload); Asset asset = DamUtil.resolveToAsset(payloadResource); Resource assetResource = asset.adaptTo(Resource.class); if (assetResource != null) { AssetDetails assetDetails = new AssetDetails(assetResource); String tagId = getOrientation(assetDetails, config); log.debug("Orientation tag is {}", tagId); if (tagId != null) { Tag tag = tagManager.resolve(tagId); if (tag != null) { addTagToResource(assetResource, tag, tagManager); log.debug("Orientation tag set"); } else { log.warn("Unable to resolve tag - check configuration for Set Image Orientation workflow step", tagId); } } else { log.warn("Unable to set tag."); } } } } catch (RepositoryException re) { <START> log.error("Repository Exception", re); <END> } }</code><technical_language>suggestion log.error("Unable apply orientation tags for workflow payload [ ], workItem.getWorkflowData().getPayload(), re);</technical_language>

Target:
public final void execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap) { Configuration config = new Configuration(metaDataMap); try { ResourceResolver resourceResolver = workflowHelper.getResourceResolver(workflowSession); TagManager tagManager = resourceResolver.adaptTo(TagManager.class); if (tagManager == null) { log.error("Unable to adapt to Tag Manager. This step can't do it's work"); return; } final List<String> payloads = workflowPackageManager.getPaths(resourceResolver, (String) workItem.getWorkflowData().getPayload()); for (final String payload : payloads) { log.debug("Processing {}", payload); Resource payloadResource = resourceResolver.resolve(payload); Asset asset = DamUtil.resolveToAsset(payloadResource); Resource assetResource = null; if (asset != null) { assetResource = asset.adaptTo(Resource.class); } if (assetResource != null) { processAsset(assetResource, config, tagManager); } else { log.warn("Unable to access asset resource for payload [ ]", payload); } } } catch (RepositoryException re) { log.error("Unable to apply orientation tags for workflow payload [ ]", workItem.getWorkflowData().getPayload(), re); } }
Source:
<code><START> private void onBreedFeed(EntityPlayer player, EnumHand hand, CallbackInfoReturnable<Boolean> cir, ItemStack itemStack) { <END> SpongeImpl.postEvent(SpongeEventFactory.createFeedAnimalEventLove(Cause.of(NamedCause.source(player)), Optional.of(this.getLocation()), itemStack.createSnapshot(), this)); }</code><technical_language>of injections API itemstacks net.minecraft.item.ItemStacks</technical_language>

Target:
private void onBreedFeed(EntityPlayer player, EnumHand hand, CallbackInfoReturnable<Boolean> cir, ItemStack itemStack) { Sponge.getCauseStackManager().pushCause(player); FeedAnimalEvent.Love event = SpongeEventFactory.createFeedAnimalEventLove(Sponge.getCauseStackManager().getCurrentCause(), Optional.of(this.getLocation()), ((org.spongepowered.api.item.inventory.ItemStack) itemStack).createSnapshot(), this); if (SpongeImpl.postEvent(event)) { cir.setReturnValue(true); } Sponge.getCauseStackManager().popCause(); }
Source:
<code>public void performEngineNicsHealthCheck() { List<NetworkInterface> nicsToCheck = networkInterfacesToCheck(); <START> log.debug("Performing engine NICs health check on: " + StringUtils.join(toNicsDisplayNames(nicsToCheck), ", ")); <END> checkNicsAndUpdateEngineStatus(nicsToCheck); log.debug("Health check done, engine NICs are {}.", engineNicHealthCache.isAllNicHealthy() ? "healthy" : "unhealthy"); }</code><technical_language>Please string concatenation: log.debug("Performing engine NICs health check on: {}", StringUtils.join(toNicsDisplayNames(nicsToCheck), ", "));</technical_language>

Target:
public void performEngineNicsHealthCheck() { List<NetworkInterface> nicsToCheck = networkInterfacesToCheck(); log.debug("Performing engine NICs health check on: {}", StringUtils.join(toNicsDisplayNames(nicsToCheck), ", ")); checkNicsAndUpdateEngineStatus(nicsToCheck); log.debug("Health check done, engine NICs are {}.", engineNicHealthCache.isAllNicHealthy() ? "healthy" : "unhealthy"); }
Source:
<code>public boolean handleNetworkException(VDSNetworkException ex, VDS vds) { if (vds.getStatus() != VDSStatus.Down) { long timeoutToFence = calcTimeoutToFence(vds.getVmCount(), vds.getSpmStatus()); if (mUnrespondedAttempts.get() < Config.<Integer> GetValue(ConfigValues.VDSAttemptsToResetCount) || (lastUpdate + timeoutToFence) > System.currentTimeMillis()) { boolean result = false; if (vds.getStatus() != VDSStatus.Connecting && vds.getStatus() != VDSStatus.PreparingForMaintenance && vds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.Connecting, vds); result = true; } mUnrespondedAttempts.incrementAndGet(); return result; } if (vds.getStatus() == VDSStatus.NonResponsive || vds.getStatus() == VDSStatus.Maintenance) { setStatus(VDSStatus.NonResponsive, vds); return true; } setStatus(VDSStatus.NonResponsive, vds); log.infoFormat( "Server failed to respond, vds_id = {0}, vds_name = {1}, vm_count = {2}, " + "spm_status = {3}, non-responsive_timeout (seconds) = {4}, error = {5}", vds.getId(), vds.getName(), vds.getVmCount(), vds.getSpmStatus(), TimeUnit.MILLISECONDS.toSeconds(timeoutToFence), ex.getMessage()); AuditLogableBase logable = new AuditLogableBase(vds.getId()); AuditLogDirector.log(logable, AuditLogType.VDS_FAILURE); boolean executeSshSoftFencing = false; if (!sshSoftFencingExecuted.getAndSet(true)) { executeSshSoftFencing = true; } <START> ResourceManager.getInstance().getEventListener().vdsNotResponding(vds, executeSshSoftFencing); <END> } return true; }</code><technical_language>is this logic here? instead of passing boolean, I part of command</technical_language>

Target:
public boolean handleNetworkException(VDSNetworkException ex, VDS vds) { if (vds.getStatus() != VDSStatus.Down) { long timeoutToFence = calcTimeoutToFence(vds.getVmCount(), vds.getSpmStatus()); if (mUnrespondedAttempts.get() < Config.<Integer> GetValue(ConfigValues.VDSAttemptsToResetCount) || (lastUpdate + timeoutToFence) > System.currentTimeMillis()) { boolean result = false; if (vds.getStatus() != VDSStatus.Connecting && vds.getStatus() != VDSStatus.PreparingForMaintenance && vds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.Connecting, vds); result = true; } mUnrespondedAttempts.incrementAndGet(); return result; } if (vds.getStatus() == VDSStatus.NonResponsive || vds.getStatus() == VDSStatus.Maintenance) { setStatus(VDSStatus.NonResponsive, vds); return true; } setStatus(VDSStatus.NonResponsive, vds); log.infoFormat( "Server failed to respond, vds_id = {0}, vds_name = {1}, vm_count = {2}, " + "spm_status = {3}, non-responsive_timeout (seconds) = {4}, error = {5}", vds.getId(), vds.getName(), vds.getVmCount(), vds.getSpmStatus(), TimeUnit.MILLISECONDS.toSeconds(timeoutToFence), ex.getMessage()); AuditLogableBase logable = new AuditLogableBase(vds.getId()); logable.updateCallStackFromThrowable(ex); AuditLogDirector.log(logable, AuditLogType.VDS_FAILURE); boolean executeSshSoftFencing = false; if (!sshSoftFencingExecuted.getAndSet(true)) { executeSshSoftFencing = true; } ResourceManager.getInstance().getEventListener().vdsNotResponding(vds, executeSshSoftFencing); } return true; }
Source:
<code>public String getUUID() { String uuid = EntityPlayer.getUUID(player.getGameProfile()).toString().toLowerCase(); <START> if (uuid != null && !uuid.equals("")) <END> return uuid; return EntityPlayer.getOfflineUUID(player.getName()).toString().toLowerCase(); }</code><technical_language>uuid null if EntityPlayer.getUUID(player.getGameProfile()) return null get a NPE in line 44. java UUID uuid = EntityPlayer.getUUID(player.getGameProfile()); if(uuid == null) { uuid = EntityPlayer.getOfflineUUID(player.getName()); } if(uuid == null) { CrafttweakerAPI.logError("Could get UUID for player " + getName()); return ""; } return uuid.toString().toLowerCase(); Also, I vanilla methods well, player.getGameProfile return null, if can, getUUID(null) throw error</technical_language>

Target:
public String getUUID() { UUID uuid = null; if (player.getGameProfile() != null) { uuid = EntityPlayer.getUUID(player.getGameProfile()); } if(uuid == null) { uuid = EntityPlayer.getOfflineUUID(getName()); } if(uuid == null) { CraftTweakerAPI.logError("Could not get UUID for player " + getName()); return ""; } return uuid.toString().toLowerCase(); }
Source:
<code>protected String getKey(String name) { <START> return null; <END> }</code><technical_language>key for encryption? ;-)</technical_language>

Target:
protected String getKey(String name) { return Encryptor.hash(name + "W00h00t!11", name + "G@nd01f"); }
Source:
<code>public boolean isExtensionLoaded(String classname) { <START> getLoadedExtensions(); <END> getLoadedExtensionsWithDeps(); for (Extension extension : getLoadedExtensions()) { if (classname.equals(extension.getClass().getCanonicalName())) { return true; } } return false; }</code><technical_language>allExtensions instead of getLoadedExtensions()</technical_language>

Target:
public boolean isExtensionLoaded(String classname) { for (Extension extension : getLoadedExtensions()) { if (classname.equals(extension.getClass().getCanonicalName())) { return true; } } return false; }
Source:
<code>public Runnable getWrappedRunnable() { <START> return get(); <END> }</code><technical_language>dispose() swap in a null method is defined @NotNull. interface allow nulls this return Functions.EMPTY_RUNNABLE: java Runnable r = get(); return r != null ? r : Functions.EMPTY_RUNNABLE;</technical_language>

Target:
public Runnable getWrappedRunnable() { Runnable r = get(); return r != null ? r : Functions.EMPTY_RUNNABLE; }
Source:
<code>private void deleteOldPacks(Collection<PackFile> oldPacks, Collection<PackFile> newPacks) throws ParseException, IOException { <START> final <END> HashSet<ObjectId> ids = new HashSet<>(); for (PackFile pack : newPacks) { for (PackIndex.MutableEntry entry : pack) { ids.add(entry.toObjectId()); } } final ObjectReader reader = repo.newObjectReader(); final ObjectDirectory dir = repo.getObjectDatabase(); final ObjectDirectoryInserter inserter = dir.newInserter(); final boolean shouldLoosen = getExpireDate() < Long.MAX_VALUE; prunePreserved(); long packExpireDate = getPackExpireDate(); oldPackLoop: for (PackFile oldPack : oldPacks) { String oldName = oldPack.getPackName(); for (PackFile newPack : newPacks) if (oldName.equals(newPack.getPackName())) continue oldPackLoop; if (!oldPack.shouldBeKept() && repo.getFS().lastModified( oldPack.getPackFile()) < packExpireDate) { oldPack.close(); if (shouldLoosen) { loosen(inserter, reader, oldPack, ids); } prunePack(oldName); } } repo.getObjectDatabase().close(); }</code><technical_language>'final' (and below)</technical_language>

Target:
private void deleteOldPacks(Collection<PackFile> oldPacks, Collection<PackFile> newPacks) throws ParseException, IOException { HashSet<ObjectId> ids = new HashSet<>(); for (PackFile pack : newPacks) { for (PackIndex.MutableEntry entry : pack) { ids.add(entry.toObjectId()); } } ObjectReader reader = repo.newObjectReader(); ObjectDirectory dir = repo.getObjectDatabase(); ObjectDirectoryInserter inserter = dir.newInserter(); boolean shouldLoosen = getExpireDate() < Long.MAX_VALUE; prunePreserved(); long packExpireDate = getPackExpireDate(); oldPackLoop: for (PackFile oldPack : oldPacks) { String oldName = oldPack.getPackName(); for (PackFile newPack : newPacks) if (oldName.equals(newPack.getPackName())) continue oldPackLoop; if (!oldPack.shouldBeKept() && repo.getFS().lastModified( oldPack.getPackFile()) < packExpireDate) { oldPack.close(); if (shouldLoosen) { loosen(inserter, reader, oldPack, ids); } prunePack(oldName); } } repo.getObjectDatabase().close(); }
Source:
<code>public void init(FMLInitializationEvent event) { if (DISABLED) return; try { TestEnum.class.getDeclaredMethod("$$newInstance", String.class, int.class); } catch (NoSuchMethodException e){ throw new Error("$$newInstance method not present", e); } for (int i = 1; i <= 10000; i++) { EnumHelper.addEnum(TestEnum.class, "V_" + i, EMPTY_CLASSES, EMPTY_ARGS); TestEnum.values(); } TestEnum[] arr = TestEnum.values(); last = arr[arr.length - 1]; if (!last.name().equals("V_10000")) throw new Error("The enum values field was incorrectly inlined!"); <START> LogManager.getLogger(EnumValuesInlineTest.class).info("EnumValuesInlineTest completed successfully."); <END> }</code><technical_language>Change event preinit getModLog instead</technical_language>

Target:
public void init(FMLInitializationEvent event) { if (DISABLED) return; try { TestEnum.class.getDeclaredMethod("$$newInstance", String.class, int.class); } catch (NoSuchMethodException e){ throw new Error("$$newInstance method not present", e); } for (int i = 1; i <= 10000; i++) { EnumHelper.addEnum(TestEnum.class, "V_" + i, EMPTY_CLASSES, EMPTY_ARGS); TestEnum.values(); } TestEnum[] arr = TestEnum.values(); last = arr[arr.length - 1]; if (!last.name().equals("V_10000")) throw new Error("The enum values field was incorrectly inlined!"); LogManager.getLogger(MOD_ID).info("EnumValuesInlineTest completed successfully."); }
Source:
<code>@Override public void handleClick(MonthCellDescriptor cell) { if (!betweenDates(cell.getDate(), minCal, maxCal)) { String errMessage = getResources().getString(R.string.invalid_date, fullDateFormat.format(minCal.getTime()), fullDateFormat.format(maxCal.getTime())); Toast.makeText(getContext(), errMessage, Toast.LENGTH_SHORT).show(); } else { selectedCell.setSelected(false); selectedCell = cell; selectedCell.setSelected(true); selectedCal.setTime(cell.getDate()); adapter.notifyDataSetChanged(); <START> if(mOnDateSelectedListener != null) <END> mOnDateSelectedListener.onDateSelected(cell.getDate()); } }</code><technical_language>Space if, wrap block in curly braces</technical_language>

Target:
@Override public void handleClick(MonthCellDescriptor cell) { if (!betweenDates(cell.getDate(), minCal, maxCal)) { String errMessage = getResources().getString(R.string.invalid_date, fullDateFormat.format(minCal.getTime()), fullDateFormat.format(maxCal.getTime())); Toast.makeText(getContext(), errMessage, Toast.LENGTH_SHORT).show(); } else { selectedCell.setSelected(false); selectedCell = cell; selectedCell.setSelected(true); selectedCal.setTime(cell.getDate()); adapter.notifyDataSetChanged(); if (dateListener != null) { dateListener.onDateSelected(cell.getDate()); } } }
Source:
<code>String[] getValueAsStringArray(Object value) { if (value instanceof String) { LOGGER.trace("requestMap value '" + value + "'"); return new String[] { value.toString() }; } else if (value instanceof String[]) { <START> LOGGER.trace("requestMap value '" + Arrays.toString((String[]) value) + "'"); <END> return (String[]) value; } else { throw new IllegalArgumentException("Invalid requestMap value type"); } }</code><technical_language>a warning: printing array touches elements. For long arrays wrap this call in if LOGGER.isTraceEnabled(). for fields in a request long arrays extremely rare occur all</technical_language>

Target:
String[] getValueAsStringArray(Object value) { if (value instanceof String) { LOGGER.trace("requestMap value '" + value + "'"); return new String[] { value.toString() }; } else if (value instanceof String[]) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("requestMap value '" + Arrays.toString((String[]) value) + "'"); } return (String[]) value; } else { throw new IllegalArgumentException("Invalid requestMap value type"); } }
Source:
<code>public final List<IElkProgressMonitor> getSubMonitors() { <START> return children; <END> }</code><technical_language>Collections.unmodifiableList(children)</technical_language>

Target:
public final List<IElkProgressMonitor> getSubMonitors() { return Collections.unmodifiableList(children); }
Source:
<code>public void commitKey(OmKeyArgs args, long clientID) throws IOException { Preconditions.checkNotNull(args); String volumeName = args.getVolumeName(); String bucketName = args.getBucketName(); String keyName = args.getKeyName(); List<OmKeyLocationInfo> locationInfoList = args.getLocationInfoList(); String objectKey = metadataManager .getOzoneKey(volumeName, bucketName, keyName); String openKey = metadataManager .getOpenKey(volumeName, bucketName, keyName, clientID); Preconditions.checkNotNull(locationInfoList); try { metadataManager.getLock().acquireBucketLock(volumeName, bucketName); validateBucket(volumeName, bucketName); OmKeyInfo keyInfo = metadataManager.getOpenKeyTable().get(openKey); if (keyInfo == null) { throw new OMException("Commit a key without corresponding entry " + <START> openKey, KEY_NOT_FOUND); <END> } keyInfo.setDataSize(args.getDataSize()); keyInfo.setModificationTime(Time.now()); keyInfo.updateLocationInfoList(locationInfoList); metadataManager.getStore().move( openKey, objectKey, keyInfo, metadataManager.getOpenKeyTable(), metadataManager.getKeyTable()); } catch (OMException e) { throw e; } catch (IOException ex) { LOG.error("Key commit failed for volume:{} bucket:{} key:{}", volumeName, bucketName, keyName, ex); throw new OMException(ex.getMessage(), ResultCodes.KEY_ALLOCATION_ERROR); } finally { metadataManager.getLock().releaseBucketLock(volumeName, bucketName); } }</code><technical_language>exception message is confusing. elaborate error failed commit key entry in open key table</technical_language>

Target:
public void commitKey(OmKeyArgs args, long clientID) throws IOException { Preconditions.checkNotNull(args); String volumeName = args.getVolumeName(); String bucketName = args.getBucketName(); String keyName = args.getKeyName(); List<OmKeyLocationInfo> locationInfoList = args.getLocationInfoList(); String objectKey = metadataManager .getOzoneKey(volumeName, bucketName, keyName); String openKey = metadataManager .getOpenKey(volumeName, bucketName, keyName, clientID); Preconditions.checkNotNull(locationInfoList); try { metadataManager.getLock().acquireBucketLock(volumeName, bucketName); validateBucket(volumeName, bucketName); OmKeyInfo keyInfo = metadataManager.getOpenKeyTable().get(openKey); if (keyInfo == null) { throw new OMException("Failed to commit key, as " + openKey + "entry " + "is not found in the openKey table", KEY_NOT_FOUND); } keyInfo.setDataSize(args.getDataSize()); keyInfo.setModificationTime(Time.now()); keyInfo.updateLocationInfoList(locationInfoList); metadataManager.getStore().move( openKey, objectKey, keyInfo, metadataManager.getOpenKeyTable(), metadataManager.getKeyTable()); } catch (OMException e) { throw e; } catch (IOException ex) { LOG.error("Key commit failed for volume:{} bucket:{} key:{}", volumeName, bucketName, keyName, ex); throw new OMException(ex.getMessage(), ResultCodes.KEY_ALLOCATION_ERROR); } finally { metadataManager.getLock().releaseBucketLock(volumeName, bucketName); } }
Source:
<code>public void incrementWarnings() { this.warning++; <START> if (warning >= 2) <END> { this.player.getWorld().strikeLightning(this.player.getLocation()); this.player.sendMessage(ChatColor.RED + "You have been warned at least twice now, make sure to read the rules at <LINK_0>"); } }</code><technical_language>this happen warnings. this.warningCount % 2 == 0</technical_language>

Target:
public void incrementWarnings() { this.warningCount++; if (this.warningCount % 2 == 0) { this.player.getWorld().strikeLightning(this.player.getLocation()); TFM_Util.playerMsg(this.player, ChatColor.RED + "You have been warned at least twice now, make sure to read the rules at " + TFM_ConfigEntry.SERVER_BAN_URL.getString()); } }
Source:
<code>public int hashCode() { return Objects.hashCode( account, firstName, lastName, company, address1, address2, city, state, zip, country, phone, vatNumber, ipAddress, ipAddressCountry, cardType, year, month, firstSix, lastFour, <START> updatedAt <END> ); }</code><technical_language>Missing geoCode</technical_language>

Target:
public int hashCode() { return Objects.hashCode( account, firstName, lastName, company, address1, address2, city, state, zip, country, phone, vatNumber, ipAddress, ipAddressCountry, cardType, year, month, firstSix, lastFour, updatedAt, geoCode ); }
Source:
<code>public int getInt(String key) throws NumberFormatException { String setting = items.get(key); if (setting == null) { throw new NumberFormatException( "There is no setting associated with the key \"" + key + "\""); } <START> return Integer.valueOf(setting).intValue(); <END> }</code><technical_language>exception</technical_language>

Target:
public int getInt(String key) throws NumberFormatException { String setting = items.get(key); if (setting == null) { throw new NumberFormatException( "There is no setting associated with the key \"" + key + "\""); } return Integer.parseInt(setting); }
Source:
<code>protected ITmfTreeColumnDataProvider getColumnDataProvider() { return () -> ImmutableList.of( <START> createTmfTreeColumnData(Messages.SegmentStoreStatistics_LevelLabel, Comparator.comparing(TmfGenericTreeEntry::getName)), <END> createTmfTreeColumnData(Messages.SegmentStoreStatistics_Statistics_MinLabel, Comparator.comparingLong(s -> s.getModel().getMin())), createTmfTreeColumnData(Messages.SegmentStoreStatistics_MaxLabel, Comparator.comparingLong(s -> s.getModel().getMax())), createTmfTreeColumnData(Messages.SegmentStoreStatistics_AverageLabel, Comparator.comparingDouble(s -> s.getModel().getMean())), createTmfTreeColumnData(Messages.SegmentStoreStatisticsViewer_StandardDeviation, Comparator.comparingDouble(s -> s.getModel().getStdDev())), createTmfTreeColumnData(Messages.SegmentStoreStatisticsViewer_Count, Comparator.comparingLong(s -> s.getModel().getNbElements())), createTmfTreeColumnData(Messages.SegmentStoreStatisticsViewer_Total, Comparator.comparingDouble(s -> s.getModel().getTotal())), new TmfTreeColumnData("")); }</code><technical_language>need support legacy entries in comparator</technical_language>

Target:
protected ITmfTreeColumnDataProvider getColumnDataProvider() { return () -> ImmutableList.of( createTmfTreeColumnData(Messages.SegmentStoreStatistics_LevelLabel, Comparator.comparing(TmfTreeViewerEntry::getName)), createTmfTreeColumnData(Messages.SegmentStoreStatistics_Statistics_MinLabel, Comparator.comparing(keyExtractor(IStatistics<ISegment>::getMin, SegmentStoreStatisticsModel::getMin))), createTmfTreeColumnData(Messages.SegmentStoreStatistics_MaxLabel, Comparator.comparing(keyExtractor(IStatistics<ISegment>::getMax, SegmentStoreStatisticsModel::getMax))), createTmfTreeColumnData(Messages.SegmentStoreStatistics_AverageLabel, Comparator.comparing(keyExtractor(IStatistics<ISegment>::getMean, SegmentStoreStatisticsModel::getMean))), createTmfTreeColumnData(Messages.SegmentStoreStatisticsViewer_StandardDeviation, Comparator.comparing(keyExtractor(IStatistics<ISegment>::getStdDev, SegmentStoreStatisticsModel::getStdDev))), createTmfTreeColumnData(Messages.SegmentStoreStatisticsViewer_Count, Comparator.comparing(keyExtractor(IStatistics<ISegment>::getNbElements, SegmentStoreStatisticsModel::getNbElements))), createTmfTreeColumnData(Messages.SegmentStoreStatisticsViewer_Total, Comparator.comparing(keyExtractor(IStatistics<ISegment>::getTotal, SegmentStoreStatisticsModel::getTotal))), new TmfTreeColumnData("")); }
Source:
<code>public Session load(String id) throws ClassNotFoundException, IOException { File file = file(id); if (file == null) { return null; } if (!file.exists()) { return null; } Context context = getManager().getContext(); Log contextLog = context.getLogger(); if (contextLog.isDebugEnabled()) { contextLog.debug(sm.getString(getStoreName()+".loading", id, file.getAbsolutePath())); } ClassLoader oldThreadContextCL = context.bind(Globals.IS_SECURITY_ENABLED, null); try (FileInputStream fis = new FileInputStream(file.getAbsolutePath()); ObjectInputStream ois = getObjectInputStream(fis)) { <START> <END> StandardSession session = (StandardSession) manager.createEmptySession(); session.readObjectData(ois); session.setManager(manager); return session; } catch (FileNotFoundException e) { if (contextLog.isDebugEnabled()) { contextLog.debug("No persisted data file found"); } return null; } finally { context.unbind(Globals.IS_SECURITY_ENABLED, oldThreadContextCL); } }</code><technical_language>This change is incorrect. original indent of 8 spaces is correct</technical_language>

Target:
public Session load(String id) throws ClassNotFoundException, IOException { File file = file(id); if (file == null || !file.exists()) { return null; } Context context = getManager().getContext(); Log contextLog = context.getLogger(); if (contextLog.isDebugEnabled()) { contextLog.debug(sm.getString(getStoreName()+".loading", id, file.getAbsolutePath())); } ClassLoader oldThreadContextCL = context.bind(Globals.IS_SECURITY_ENABLED, null); try (FileInputStream fis = new FileInputStream(file.getAbsolutePath()); ObjectInputStream ois = getObjectInputStream(fis)) { StandardSession session = (StandardSession) manager.createEmptySession(); session.readObjectData(ois); session.setManager(manager); return session; } catch (FileNotFoundException e) { if (contextLog.isDebugEnabled()) { contextLog.debug("No persisted data file found"); } return null; } finally { context.unbind(Globals.IS_SECURITY_ENABLED, oldThreadContextCL); } }
Source:
<code>protected MemoryDataView() { if (!(this instanceof DataContainer)) { throw new IllegalStateException( <START> "Cannot construct a root MemoryDataView without a " <END> + "container!"); } this.path = new DataQuery(); this.parent = this; this.container = (DataContainer) this; }</code><technical_language>need for harsh line wrapping, style guide states is 150 characters</technical_language>

Target:
protected MemoryDataView() { checkState(this instanceof DataContainer,"Cannot construct a root MemoryDataView without a container!"); this.path = new DataQuery(); this.parent = this; this.container = (DataContainer) this; }
Source:
<code>private void validateEmailBuilderConfig() { for (int i = 0; i < mProviders.size(); i++) { IdpConfig config = mProviders.get(i); if (config.getProviderId().equals(EMAIL_LINK_PROVIDER)) { if (!config.getParams().containsKey(ExtraConstants.FORCE_SAME_DEVICE)) { <START> throw new IllegalStateException("You must force the same device flow " + <END> "when using email link sign in with anonymous user upgrade"); } } } }</code><technical_language>setForceSameDevice() "This enabled anonymous upgrade." this message ... is it</technical_language>

Target:
private void validateEmailBuilderConfig() { for (int i = 0; i < mProviders.size(); i++) { IdpConfig config = mProviders.get(i); if (config.getProviderId().equals(EMAIL_LINK_PROVIDER)) { boolean emailLinkForceSameDevice = config.getParams().getBoolean(ExtraConstants.FORCE_SAME_DEVICE, true); if (!emailLinkForceSameDevice) { throw new IllegalStateException("You must force the same device flow " + "when using email link sign in with anonymous user upgrade"); } } } }
Source:
<code><START> private static void applyNonOverridableOptions(Configuration configuration) { <END> configuration.setInt("mapred.map.max.attempts", 1); configuration.setBoolean("mapred.map.tasks.speculative.execution", false); configuration.setBoolean("mapreduce.map.speculative", false); configuration.setBoolean("mapreduce.task.classpath.user.precedence", true); configuration.setInt("mapreduce.task.timeout", 0); }</code><technical_language>overridden users</technical_language>

Target:
private static void applyNonOverridableOptions(Configuration configuration) { configuration.setInt("mapred.map.max.attempts", 1); configuration.setBoolean("mapred.map.tasks.speculative.execution", false); configuration.setBoolean("mapreduce.map.speculative", false); configuration.setBoolean("mapreduce.task.classpath.user.precedence", true); }
Source:
<code>public void setUpdateMode(boolean enabled) { if (this.field.isShowLabel()) { TextView label = findViewById(R.id.liferay_ddm_label); if (label != null) { label.setEnabled(enabled); <START> } <END> } List<Option> availableOptions = field.getAvailableOptions(); if (availableOptions != null) { for (Option opt : availableOptions) { CompoundButton compoundButton = findViewWithTag(opt); compoundButton.setEnabled(enabled); } } setEnabled(enabled); }</code><technical_language>extract this code a utility class? is repeated in places</technical_language>

Target:
public void setUpdateMode(boolean enabled) { if (this.field.isShowLabel()) { TextView label = findViewById(R.id.liferay_ddm_label); AndroidUtil.updateViewState(label, enabled); } List<Option> availableOptions = field.getAvailableOptions(); if (availableOptions != null) { for (Option opt : availableOptions) { CompoundButton compoundButton = findViewWithTag(opt); compoundButton.setEnabled(enabled); } } setEnabled(enabled); }
Source:
<code>public void gracefulShutdown(ContextClosedEvent evt) { WebServer container = serverHolder().get(); LOG.debug("Received application context closed event {}. Shutting down...", evt); LOG.info("Early shutdown of Jetty connectors on {}", container); if (container != null) { if(shouldSleepBeforeShutdown) { <START> LOG.info("Application config requesting sleep for "+sleepDurationMillisBeforeShutdown+" ms before jetty shutdown"); <END> try { LOG.info("Sleeping for "+sleepDurationMillisBeforeShutdown+" ms before jetty shutdown"); Thread.sleep(sleepDurationMillisBeforeShutdown); } catch (InterruptedException e) { LOG.error("Failed to sleep before shutdown "+e.getMessage() ); } } container.stop(); LOG.info("Jetty is stopped."); } else { LOG.warn("Never got a Jetty?"); } }</code><technical_language>markers {}</technical_language>

Target:
public void gracefulShutdown(ContextClosedEvent evt) { WebServer container = serverHolder().get(); LOG.debug("Received application context closed event {}. Shutting down...", evt); LOG.info("Early shutdown of Jetty connectors on {}", container); if (container != null) { if(shouldSleepBeforeShutdown) { long sleepDurationMillisBeforeShutdown = sleepDurationBeforeShutdown.toMillis(); LOG.info("Application config requesting sleep for ms before Jetty shutdown", sleepDurationMillisBeforeShutdown); sleepBeforeJettyShutdown(sleepDurationMillisBeforeShutdown); } container.stop(); LOG.info("Jetty is stopped."); } else { LOG.warn("Never got a Jetty?"); } }
Source:
<code><START> public Map<String, Collection<String>> toMap() { <END> Map<String, Collection<String>> params = new HashMap<String, Collection<String>>(); if (null != location) { ArrayList<String> valueList = new ArrayList<String>(); valueList.add(location); params.put("location", valueList); } if (p2p) { ArrayList<String> valueList = new ArrayList<String>(); valueList.add("enabled"); params.put("p2p.preference", valueList); } return params; }</code><technical_language>is Collection of Strings (instead of String)</technical_language>

Target:
public Map<String, Collection<String>> toMap() { Map<String, Collection<String>> params = new HashMap<String, Collection<String>>(); if (null != location) { ArrayList<String> valueList = new ArrayList<String>(); valueList.add(location); params.put("location", valueList); } ArrayList<String> valueList = new ArrayList<String>(); valueList.add(mediaMode.toString()); params.put("p2p.preference", valueList); return params; }
Source:
<code>private String getDefaultCidr(ClaudiaData claudiaData, String region) throws InvalidEntityException, AlreadyExistsEntityException, InfrastructureException { int cidrOpenstack = 1; if (!(claudiaData.getVdc() == null || claudiaData.getVdc().isEmpty())) { cidrOpenstack = getNumberDeployedNetwork(claudiaData, region) + 1; } <START> return "10.1." + cidrOpenstack + ".0/24"; <END> }</code><technical_language>Magic Number..</technical_language>

Target:
public String getDefaultCidr(ClaudiaData claudiaData, String region) throws InvalidEntityException, AlreadyExistsEntityException, InfrastructureException { int subNetElement = 1; int cidrOpenstack = 0; if (!(claudiaData.getVdc() == null || claudiaData.getVdc().isEmpty())) { cidrOpenstack = getNumberDeployedNetwork(claudiaData, region) + 1; } if (cidrOpenstack > MAX_NETWORK) { NET_ELEMENT += 1; subNetElement = cidrOpenstack / NET_ELEMENT; } else { subNetElement = cidrOpenstack; } return getValidCidr (claudiaData, region, subNetElement); }
Source:
<code>protected void bindInternal(@NonNull final CompositeDisposable s) { s.add(viewModel.getRepositories() .observeOn(AndroidSchedulers.mainThread()) .subscribe(view::setRepositories)); s.add(viewModel.getNetworkRequestStatusText() .observeOn(AndroidSchedulers.mainThread()) .subscribe(view::setNetworkRequestStatus)); s.add(view.searchStringObservable .observeOn(AndroidSchedulers.mainThread()) .subscribe(viewModel::setSearchString)); s.add(Observable.create( <START> emitter -> { <END> view.repositoriesAdapter.setOnClickListener(this::repositoriesAdapterOnClick); }) .subscribeOn(AndroidSchedulers.mainThread()) .subscribe()); }</code><technical_language>replaced with: Completable.fromAction( () -> view.repositoriesAdapter.setOnClickListener(this::repositoriesAdapterOnClick)</technical_language>

Target:
protected void bindInternal(@NonNull final CompositeDisposable s) { s.add(viewModel.getRepositories() .observeOn(AndroidSchedulers.mainThread()) .subscribe(view::setRepositories)); s.add(viewModel.getNetworkRequestStatusText() .observeOn(AndroidSchedulers.mainThread()) .subscribe(view::setNetworkRequestStatus)); s.add(view.searchStringObservable .observeOn(AndroidSchedulers.mainThread()) .subscribe(viewModel::setSearchString)); s.add(Completable.fromAction(() -> view.repositoriesAdapter.setOnClickListener(this::repositoriesAdapterOnClick)) .subscribeOn(AndroidSchedulers.mainThread()) .subscribe()); }
Source:
<code>public void parse() { String line = ""; String setupLine = ""; List<String> vars = new ArrayList<String>(); List<String> list = new ArrayList<String>(); int offset = 0; try { RandomAccessFile raf = new RandomAccessFile(file.getRawLocation().makeAbsolute().toFile(), "r"); long bytesToSkip = findStartSetup(raf); <START> if (bytesToSkip == -1) <END> return; long stop = findEndSetup(raf, bytesToSkip); if (stop == -1) return; raf.seek(0); while ((line = raf.readLine()) != null) { if (!line.trim().startsWith("#")) { if (isLineSimpleDefinition(line)) { vars.add(line); } else if (!vars.isEmpty() && vars.get(vars.size()-1).trim().endsWith("\\") && isLineContinuation(line)){ offset = vars.get(vars.size()-1).lastIndexOf('\\'); vars.set(vars.size() -1, vars.get(vars.size() - 1).substring(0, offset)); vars.set(vars.size() - 1, vars.get(vars.size() - 1) .concat(line.trim())); } } } raf.seek(bytesToSkip); while ((line = raf.readLine()) != null && raf.getFilePointer() <= stop) { line = line.trim(); if (!line.startsWith("#")) { if (setupLine.equals("")) setupLine = line.trim(); else setupLine = setupLine.concat(line.trim()); } } list = prepareSetupOptions(setupLine); for (String str : vars) { variables.putAll(parseLine(str)); } for (String str : list) { setupOptions.putAll(parseLine(str)); } resolveVariables(variables, setupOptions); raf.close(); } catch (FileNotFoundException e) { StubbyLog.logError(e); } catch (IOException e) { StubbyLog.logError(e); } }</code><technical_language>Missing {}</technical_language>

Target:
public void parse() { String line = ""; String setupLine = ""; List<String> vars = new ArrayList<String>(); List<String> list = new ArrayList<String>(); int offset = 0; try { RandomAccessFile raf = new RandomAccessFile(file.getRawLocation().makeAbsolute().toFile(), "r"); long bytesToSkip = findStartSetup(raf); if (bytesToSkip == -1) { return; } long stop = findEndSetup(raf, bytesToSkip); if (stop == -1) { return; } raf.seek(0); while ((line = raf.readLine()) != null) { if (!line.trim().startsWith("#")) { if (isLineSimpleDefinition(line)) { vars.add(line); } else if (!vars.isEmpty() && vars.get(vars.size()-1).trim().endsWith("\\") && isLineContinuation(line)){ offset = vars.get(vars.size()-1).lastIndexOf('\\'); vars.set(vars.size() -1, vars.get(vars.size() - 1).substring(0, offset)); vars.set(vars.size() - 1, vars.get(vars.size() - 1) .concat(line.trim())); } } } raf.seek(bytesToSkip); while ((line = raf.readLine()) != null && raf.getFilePointer() <= stop) { line = line.trim(); if (!line.startsWith("#")) { if (setupLine.equals("")) { setupLine = line.trim(); } else { setupLine = setupLine.concat(line.trim()); } } } list = prepareSetupOptions(setupLine); for (String str : vars) { variables.putAll(parseLine(str)); } for (String str : list) { setupOptions.putAll(parseLine(str)); } resolveVariables(variables, setupOptions); raf.close(); } catch (FileNotFoundException e) { StubbyLog.logError(e); } catch (IOException e) { StubbyLog.logError(e); } }
Source:
<code>public Collection<Integer> selectNextChildren(long t) { <START> return Collections.emptyList(); <END> }</code><technical_language>EMPTY_LIST;</technical_language>

Target:
public Collection<Integer> selectNextChildren(long t) { return Collections.EMPTY_LIST; }
Source:
<code>public static void bootstrap( CatalogFramework catalogFramework, EndpointUtil endpointUtil, List<Metacard> systemTemplates) { Subject systemSubject = SECURITY.runAsAdmin(SECURITY::getSystemSubject); if (systemSubject == null) { throw new SecurityException("Could not get systemSubject to initialize system templates"); } ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); Failsafe.with( new RetryPolicy() .retryOn(Collections.singletonList(RuntimeException.class)) .withMaxRetries(5) .withBackoff(2, 60, TimeUnit.SECONDS)) .with(executor) .onComplete( (connection, failure) -> { if (connection != null) { <START> LOGGER.info("Successfully loaded System Search Forms", connection); <END> } else if (failure != null) { LOGGER.error("Failed to load System Search Forms", failure); } executor.shutdown(); }) .run( () -> systemSubject.execute( () -> SearchFormsLoader.createSystemMetacards( endpointUtil, systemTemplates, catalogFramework))); }</code><technical_language>is this called connection? is expected passed executing a Runnable return a result</technical_language>

Target:
public static void bootstrap( CatalogFramework catalogFramework, EndpointUtil endpointUtil, List<Metacard> systemTemplates) { Subject systemSubject = SECURITY.runAsAdmin(SECURITY::getSystemSubject); if (systemSubject == null) { throw new SecurityException("Could not get systemSubject to initialize system templates"); } ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); Failsafe.with( new RetryPolicy() .retryOn(Collections.singletonList(RuntimeException.class)) .withMaxRetries(5) .withBackoff(2, 60, TimeUnit.SECONDS)) .with(executor) .onComplete( (result, error) -> { if (result != null) { LOGGER.info("Successfully loaded System Search Forms {}", result); } else if (error != null) { LOGGER.error("Failed to load System Search Forms", error); } executor.shutdown(); }) .run( () -> systemSubject.execute( () -> SearchFormsLoader.createSystemMetacards( endpointUtil, systemTemplates, catalogFramework))); }
Source:
<code>public Ds3Param toDs3Param() { <START> Ds3Param ds3Param = new Ds3Param(name, type); <END> return ds3Param; }</code><technical_language>missing final</technical_language>

Target:
public Ds3Param toDs3Param() { final Ds3Param ds3Param = new Ds3Param(name, type); return ds3Param; }