auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected static Map<String, String> createStructFromConnection(final StorageServerConnections connection, final StoragePool storagePool) { DefaultValueMap conParams = new DefaultValueMap(); conParams.put("id", connection.getid(), Guid.Empty.toString()); conParams.put("connection", connection.getconnection(), ""); <START> switch (connection.getstorage_type()) { <END> case ISCSI: conParams.put("portal", connection.getportal(), ""); conParams.put("port", connection.getport(), ""); conParams.put("iqn", connection.getiqn(), ""); conParams.put("user", connection.getuser_name(), ""); conParams.put("password", connection.getpassword(), ""); break; case POSIXFS: conParams.putIfNotEmpty("mnt_options", connection.getMountOptions()); conParams.putIfNotEmpty("vfs_type", connection.getVfsType()); break; case NFS: if (storagePool == null || Config.<Boolean> getValue(ConfigValues.AdvancedNFSOptionsEnabled, storagePool.getcompatibility_version().getValue())) { if (connection.getNfsVersion() != null) { conParams.put("protocol_version", connection.getNfsVersion().getValue()); } conParams.putIfNotEmpty("timeout", connection.getNfsTimeo()); conParams.putIfNotEmpty("retrans", connection.getNfsRetrans()); } break; } return conParams; }</code><technical_language>verified this change is safe for vdsm versions</technical_language>

Target:
protected static Map<String, String> createStructFromConnection(final StorageServerConnections connection, final StoragePool storagePool) { DefaultValueMap conParams = new DefaultValueMap(); conParams.put("id", connection.getid(), Guid.Empty.toString()); conParams.put("connection", connection.getconnection(), ""); switch (connection.getstorage_type()) { case ISCSI: conParams.put("portal", connection.getportal(), ""); conParams.put("port", connection.getport(), ""); conParams.put("iqn", connection.getiqn(), ""); conParams.put("user", connection.getuser_name(), ""); conParams.put("password", connection.getpassword(), ""); break; case POSIXFS: case GLUSTERFS: conParams.putIfNotEmpty("mnt_options", connection.getMountOptions()); conParams.putIfNotEmpty("vfs_type", connection.getVfsType()); break; case NFS: if (storagePool == null || Config.<Boolean> getValue(ConfigValues.AdvancedNFSOptionsEnabled, storagePool.getcompatibility_version().getValue())) { if (connection.getNfsVersion() != null) { conParams.put("protocol_version", connection.getNfsVersion().getValue()); } conParams.putIfNotEmpty("timeout", connection.getNfsTimeo()); conParams.putIfNotEmpty("retrans", connection.getNfsRetrans()); } break; } return conParams; }
Source:
<code>public void addCondition(ConditionExpression condition) { ConditionalEventDefinition conditionalEventDefinition = bpmn2.createConditionalEventDefinition(); FormalExpression conditionExpression = bpmn2.createFormalExpression(); String languageFormat = Scripts.scriptLanguageToUri(condition.getValue().getLanguage(), Scripts.LANGUAGE.DROOLS.format()); conditionExpression.setLanguage(languageFormat); String conditionScript = condition.getValue().getScript(); if (conditionScript != null && !conditionScript.isEmpty()) { <START> conditionExpression.setBody(asCData(StringEscapeUtils.escapeXml10(conditionScript))); <END> } conditionalEventDefinition.setCondition(conditionExpression); addEventDefinition(conditionalEventDefinition); }</code><technical_language>this is wrapped in CData, I escaping is needed</technical_language>

Target:
public void addCondition(ConditionExpression condition) { ConditionalEventDefinition conditionalEventDefinition = bpmn2.createConditionalEventDefinition(); FormalExpression conditionExpression = bpmn2.createFormalExpression(); String languageFormat = Scripts.scriptLanguageToUri(condition.getValue().getLanguage(), Scripts.LANGUAGE.DROOLS.format()); conditionExpression.setLanguage(languageFormat); String conditionScript = condition.getValue().getScript(); if (conditionScript != null && !conditionScript.isEmpty()) { conditionExpression.setBody(asCData(conditionScript)); } conditionalEventDefinition.setCondition(conditionExpression); addEventDefinition(conditionalEventDefinition); }
Source:
<code>private List<Document> toDocument(Collection<Policy> ps) { List<Document> docs = new ArrayList<Document>(); for (Policy p : ps) { try { <START> LOGGER.trace("Policy [" + p.getId() + "] for subject [" <END> + p.getSubject() + "]:\n" + p.getPolicy()); docs.add(Xml.toXml(p.getPolicy())); } catch (IOException e) { throw new RuntimeException(e); } catch (SAXException e) { throw new RuntimeException(e); } } return docs; }</code><technical_language><LINK_0></technical_language>

Target:
private List<Document> toDocument(Collection<Policy> ps) { List<Document> docs = new ArrayList<Document>(); for (Policy p : ps) { try { LOGGER.trace("Policy for subject [{}]: {}", p.getId(), p.getSubject(), p.getPolicy()); docs.add(Xml.toXml(p.getPolicy())); } catch (IOException | SAXException e) { throw new RuntimeException(e); } } return docs; }
Source:
<code>public RestClientFactory(String elasticSearchURL, String esusername, String espassword ) throws MalformedURLException { final List<String> targetHosts = Arrays.asList(elasticSearchURL.split(",")); final HttpClientConfig.Builder configBuilder = new HttpClientConfig.Builder(targetHosts).multiThreaded(true); if (!Strings.isNullOrEmpty(esusername) && !Strings.isNullOrEmpty(espassword)) { <START> final URL targetUrl = new URL(targetHosts.get(0)); <END> if (targetHosts.size() > 1) { LOG.warn("Username/Password have been defined, but multiple target hosts were found. Each host will use the same credentials."); LOG.warn("Username/Password have been defined, but multiple target hosts were found. Preemptive auth is only enabled for host {}", targetHosts.get(0)); } configBuilder.defaultCredentials(esusername, espassword); configBuilder.setPreemptiveAuth(new HttpHost(targetUrl.getHost(), targetUrl.getPort(), targetUrl.getProtocol())); } config = configBuilder.build(); factory = new JestClientFactory(); factory.setHttpClientConfig(config); }</code><technical_language>set preemptive auth for targets, a for() loop here? I missing something? thinking case happily forwarding target, cluster member switch target, performance suffer longer preemptive auth now. This difficult troubleshoot best</technical_language>

Target:
public RestClientFactory(String elasticSearchURL, String esusername, String espassword ) throws MalformedURLException { final List<String> targetHosts = Arrays.asList(elasticSearchURL.split(",")); final HttpClientConfig.Builder configBuilder = new HttpClientConfig.Builder(targetHosts).multiThreaded(true); if (!Strings.isNullOrEmpty(esusername) && !Strings.isNullOrEmpty(espassword)) { final URL targetUrl = new URL(targetHosts.get(0)); if (targetHosts.size() > 1) { LOG.warn("Credentials have been defined, but multiple target hosts were found. " + "Each host will use the same credentials. Preemptive auth is only enabled for host {}", targetHosts.get(0)); } configBuilder.defaultCredentials(esusername, espassword); configBuilder.setPreemptiveAuth(new HttpHost(targetUrl.getHost(), targetUrl.getPort(), targetUrl.getProtocol())); } config = configBuilder.build(); factory = new JestClientFactory(); factory.setHttpClientConfig(config); }
Source:
<code>public boolean isHeaderVisible() { try { wait.forElementVisible(h1Header); return true; <START> } catch (NoSuchElementException e) { <END> PageObjectLogging.log("verifyElementsOnPage", "verify that H1 is present", true); return false; } }</code><technical_language>timeout exception</technical_language>

Target:
public boolean isHeaderVisible() { try { wait.forElementVisible(h1Header); return true; } catch (TimeoutException e) { PageObjectLogging.logInfo("Header is not visible", e); return false; } }
Source:
<code>protected void onSaveMenuItem() { if (mValidator.validate(mEmailField.getText())) { mActivityHelper.getCurrentUser().updateEmail(mEmailField.getText().toString()) .addOnFailureListener( new TaskFailureLogger(TAG, "failure updating email")) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { <START> mEmailInputLayout.setError(e.getLocalizedMessage()); <END> } }) .addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(Void aVoid) { finish(); } }); } }</code><technical_language>e.getLocalizedMessage() a bit dangerous here. define some error messages in library instead choose based exception subclass</technical_language>

Target:
protected void onSaveMenuItem() { if (mValidator.validate(mEmailField.getText())) { mActivityHelper.getCurrentUser().updateEmail(mEmailField.getText().toString()) .addOnFailureListener( new TaskFailureLogger(TAG, "failure updating email")) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { if (e instanceof FirebaseAuthUserCollisionException) { mEmailInputLayout.setError( getResources().getString(R.string.error_user_collision)); } else { mEmailInputLayout.setError( getResources().getString(R.string.general_error)); } } }) .addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(Void aVoid) { finish(); } }); } }
Source:
<code>public static Tier getTier(TierConfig tierConfig, HelixManager helixManager) { TierSegmentSelector segmentSelector; TierStorage storageSelector; <START> String segmentSelectorType = tierConfig.getSegmentSelectorType(); <END> if (segmentSelectorType.equalsIgnoreCase(TierSegmentSelectorType.TIME.toString())) { segmentSelector = new TimeBasedTierSegmentSelector(helixManager, tierConfig.getSegmentAge()); } else { throw new IllegalStateException("Unsupported segmentSelectorType: " + segmentSelectorType); } String storageSelectorType = tierConfig.getStorageType(); if (storageSelectorType.equalsIgnoreCase(TierStorageType.PINOT_SERVER.toString())) { storageSelector = new PinotServerTierStorage(tierConfig.getServerTag()); } else { throw new IllegalStateException("Unsupported storageType: " + storageSelectorType); } return new Tier(tierConfig.getName(), segmentSelector, storageSelector); }</code><technical_language>enum</technical_language>

Target:
public static Tier getTier(TierConfig tierConfig, HelixManager helixManager) { TierSegmentSelector segmentSelector; TierStorage storageSelector; String segmentSelectorType = tierConfig.getSegmentSelectorType(); if (segmentSelectorType.equalsIgnoreCase(TierFactory.TIME_SEGMENT_SELECTOR_TYPE)) { segmentSelector = new TimeBasedTierSegmentSelector(helixManager, tierConfig.getSegmentAge()); } else { throw new IllegalStateException("Unsupported segmentSelectorType: " + segmentSelectorType); } String storageSelectorType = tierConfig.getStorageType(); if (storageSelectorType.equalsIgnoreCase(TierFactory.PINOT_SERVER_STORAGE_TYPE)) { storageSelector = new PinotServerTierStorage(tierConfig.getServerTag()); } else { throw new IllegalStateException("Unsupported storageType: " + storageSelectorType); } return new Tier(tierConfig.getName(), segmentSelector, storageSelector); }
Source:
<code>public String getKModuleText(final String path) { <START> return loadKieTextFromJar(path, META_INF, "kmodule.xml"); <END> }</code><technical_language>consistent introduce constant for kmodule.xml</technical_language>

Target:
public String getKModuleText(final String path) { return loadKieTextFromJar(path, META_INF, KMODULE_XML); }
Source:
<code>protected void eventHandle(@NonNull ITmfEvent event) { ITmfStateSystemBuilder ss = getStateSystemBuilder(); if (ss == null) { return; } for (CounterAspect aspect : fCounterAspects) { boolean isGrouped = aspect.getGroupIds().length > 0; <START> int rootQuark = isGrouped ? ss.getQuarkAbsoluteAndAdd(CounterAnalysis.GROUPED_COUNTER_ASPECTS_ATTRIB) : ss.getQuarkAbsoluteAndAdd(CounterAnalysis.UNGROUPED_COUNTER_ASPECTS_ATTRIB); <END> if (isGrouped) { handleGroupedCounterAspect(event, ss, aspect, rootQuark); } else { handleCounterAspect(event, ss, aspect, rootQuark); } } }</code><technical_language>place in if block</technical_language>

Target:
protected void eventHandle(@NonNull ITmfEvent event) { ITmfStateSystemBuilder ss = getStateSystemBuilder(); if (ss == null) { return; } for (ITmfEventAspect<?> aspect : fCounterAspects) { if (aspect instanceof CounterAspect) { CounterAspect counterAspect = (CounterAspect) aspect; if (counterAspect.getGroupIds().length > 0) { int rootQuark = ss.getQuarkAbsoluteAndAdd(CounterAnalysis.GROUPED_COUNTER_ASPECTS_ATTRIB); handleGroupedCounterAspect(event, ss, counterAspect, rootQuark); } else { int rootQuark = ss.getQuarkAbsoluteAndAdd(CounterAnalysis.UNGROUPED_COUNTER_ASPECTS_ATTRIB); handleCounterAspect(event, ss, counterAspect, rootQuark); } } } }
Source:
<code>public void onBackPressed() { if (doubleBackToExitPressedOnce) { super.onBackPressed(); return; } this.doubleBackToExitPressedOnce = true; <START> Toast.makeText(this, "Please press back again to exit", Toast.LENGTH_SHORT).show(); <END> new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce=false; } }, 2000); }</code><technical_language>Avoid hardcoded strings. This string internationalized</technical_language>

Target:
public void onBackPressed() { if (doubleBackToExitPressedOnce) { super.onBackPressed(); return; } this.doubleBackToExitPressedOnce = true; Toast.makeText(this, this.getString(R.string.app_exit_toast_message), Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce=false; } }, 2000); }
Source:
<code>private void removeImages() { List<CinderDisk> cinderDisks = new ArrayList<>(); for (final DiskImage source : getSourceImages()) { if (source.getDiskStorageType() == DiskStorageType.CINDER) { cinderDisks.add((CinderDisk) source); continue; } List<DiskImage> images = diskImageDao.getAllSnapshotsForParent(source.getImageId()); DiskImage dest = null; if (!images.isEmpty()) { dest = images.get(0); } if (getSnapshotActionType() == VdcActionType.RemoveSnapshotSingleDiskLive) { CommandCoordinatorUtil.executeAsyncCommand( getSnapshotActionType(), buildRemoveSnapshotSingleDiskParameters(source, dest, getSnapshotActionType()), cloneContextAndDetachFromParent()); } else { RemoveSnapshotSingleDiskParameters parameters = buildRemoveSnapshotSingleDiskParameters( source, dest, getSnapshotActionType()); VdcReturnValueBase vdcReturnValue = runInternalActionWithTasksContext( getSnapshotActionType(), parameters); if (getSnapshotActionType() == VdcActionType.RemoveSnapshotSingleDisk && vdcReturnValue != null && vdcReturnValue.getInternalVdsmTaskIdList() != null) { <START> getReturnValue().getVdsmTaskIdList().addAll(vdcReturnValue.getInternalVdsmTaskIdList()); <END> } } List<Guid> quotasToRemoveFromCache = new ArrayList<>(); quotasToRemoveFromCache.add(source.getQuotaId()); if (dest != null) { quotasToRemoveFromCache.add(dest.getQuotaId()); } getQuotaManager().removeQuotaFromCache(getStoragePoolId(), quotasToRemoveFromCache); } if (!cinderDisks.isEmpty()) { handleCinderSnapshotDisks(cinderDisks); } }</code><technical_language>add always. if command create tasks list empty</technical_language>

Target:
private void removeImages() { List<CinderDisk> cinderDisks = new ArrayList<>(); for (final DiskImage source : getSourceImages()) { if (source.getDiskStorageType() == DiskStorageType.CINDER) { cinderDisks.add((CinderDisk) source); continue; } List<DiskImage> images = diskImageDao.getAllSnapshotsForParent(source.getImageId()); DiskImage dest = null; if (!images.isEmpty()) { dest = images.get(0); } if (getSnapshotActionType() == VdcActionType.RemoveSnapshotSingleDiskLive) { CommandCoordinatorUtil.executeAsyncCommand( getSnapshotActionType(), buildRemoveSnapshotSingleDiskParameters(source, dest, getSnapshotActionType()), cloneContextAndDetachFromParent()); } else { RemoveSnapshotSingleDiskParameters parameters = buildRemoveSnapshotSingleDiskParameters( source, dest, getSnapshotActionType()); VdcReturnValueBase vdcReturnValue = runInternalActionWithTasksContext( getSnapshotActionType(), parameters); if (getSnapshotActionType() == VdcActionType.RemoveSnapshotSingleDisk) { getTaskIdList().addAll(vdcReturnValue.getInternalVdsmTaskIdList()); } } List<Guid> quotasToRemoveFromCache = new ArrayList<>(); quotasToRemoveFromCache.add(source.getQuotaId()); if (dest != null) { quotasToRemoveFromCache.add(dest.getQuotaId()); } getQuotaManager().removeQuotaFromCache(getStoragePoolId(), quotasToRemoveFromCache); } if (!cinderDisks.isEmpty()) { handleCinderSnapshotDisks(cinderDisks); } }
Source:
<code>private String encode(String user, String password) { try { byte[] message = (user + ":" + password).getBytes("UTF-8"); <START> String encoded = javax.xml.bind.DatatypeConverter.printBase64Binary(message); <END> return String.format("Basic %s", encoded); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e); } }</code><technical_language>This imported</technical_language>

Target:
private String encode(String user, String password) { try { byte[] credentialsBytes = (user + ":" + password).getBytes("UTF-8"); String encoded = DatatypeConverter.printBase64Binary(credentialsBytes); return String.format("Basic %s", encoded); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e); } }
Source:
<code><START> private TableDescriptor getTableDescriptor(String tableName) throws UndefinedTableException { <END> TableDescriptor tableDescriptor = null; if (tableName == null || tableName.isEmpty()) { throw new UndefinedTableException(tableName); } tableName = tableName.toUpperCase(); for (int idx = 0; idx < schemaInfoTableDescriptors.size(); idx++) { TableDescriptor testDescriptor = schemaInfoTableDescriptors.get(idx); if (testDescriptor.getTableNameString().equalsIgnoreCase(tableName)) { tableDescriptor = testDescriptor; break; } } return tableDescriptor; }</code><technical_language>I modified function signature throw exception. However, I a problem this function returns null instead of throwing UndefinedTableException table of name is found. check please</technical_language>

Target:
private TableDescriptor getTableDescriptor(String tableName) throws UndefinedTableException { TableDescriptor tableDescriptor = null; if (tableName == null || tableName.isEmpty()) { throw new UndefinedTableException(tableName); } tableName = tableName.toUpperCase(); for (int idx = 0; idx < schemaInfoTableDescriptors.size(); idx++) { TableDescriptor testDescriptor = schemaInfoTableDescriptors.get(idx); if (testDescriptor.getTableNameString().equalsIgnoreCase(tableName)) { tableDescriptor = testDescriptor; break; } } if (tableDescriptor == null) { throw new UndefinedTableException(tableName); } return tableDescriptor; }
Source:
<code>public AsyncFuture<LimitedSet<T>> transform(final SearchResponse response) throws Exception { final SearchHit[] hits = response.getHits().getHits(); for (final SearchHit hit : hits) { if (!results.add(converter.apply(hit))) { duplicates += 1; } else { size += 1; } if (limit.isGreater(size)) { <START> results.remove(converter.apply(hit)); <END> return async.resolved(new LimitedSet<>(limit.limitSet(results), true)); } } if (hits.length == 0) { return async.resolved(new LimitedSet<>(results, false)); } return scroller.get().lazyTransform(this); }</code><technical_language>need convert once</technical_language>

Target:
public AsyncFuture<LimitedSet<T>> transform(final SearchResponse response) throws Exception { final SearchHit[] hits = response.getHits().getHits(); for (final SearchHit hit : hits) { final T convertedHit = converter.apply(hit); if (!results.add(convertedHit)) { duplicates += 1; } else { size += 1; } if (limit.isGreater(size)) { results.remove(convertedHit); return async.resolved(new LimitedSet<>(limit.limitSet(results), true)); } } if (hits.length == 0) { return async.resolved(new LimitedSet<>(results, false)); } return scroller.get().lazyTransform(this); }
Source:
<code>private void saveToFile() { synchronized (authInfo) { NotebookAuthorizationInfoSaving info = new NotebookAuthorizationInfoSaving(); info.authInfo = authInfo; try { configStorage.save(info); } catch (IOException e) { <START> LOG.error("Error saving notebook authorization file: " + e.getMessage()); <END> } } }</code><technical_language>LOG.error("Error saving notebook authorization file", e);</technical_language>

Target:
private void saveToFile() { synchronized (authInfo) { NotebookAuthorizationInfoSaving info = new NotebookAuthorizationInfoSaving(); info.authInfo = authInfo; try { configStorage.save(info); } catch (IOException e) { LOG.error("Error saving notebook authorization file", e); } } }
Source:
<code>public void enableDocumentValidation() { for (final MappedClass mc : mapper.getMappedClasses()) { Validation validation = (Validation) mc.getAnnotation(Validation.class); if (validation != null) { String collectionName = mc.getCollectionName(); CommandResult result = getDB() .command(new BasicDBObject("collMod", collectionName) .append("validator", Document.parse(validation.value())) .append("validationLevel", validation.level().getValue()) .append("validationAction", validation.action().getValue()) ); <START> if (!result.ok()) { <END> if (result.getInt("code") == 26) { try { ValidationOptions options = new ValidationOptions() .validator(Document.parse(validation.value())) .validationLevel(validation.level()) .validationAction(validation.action()); getDatabase().createCollection(collectionName, new CreateCollectionOptions() .validationOptions(options)); } catch (JsonParseException e) { LOG.warning(format("Could not parse validator for '%s:' %s", collectionName, e.getMessage())); } } else { LOG.warning(format("Could not add document validation on '%s:' %s", collectionName, result.getErrorMessage())); } } } } }</code><technical_language>Question: If existing validation - overwritten? throw error</technical_language>

Target:
public void enableDocumentValidation() { for (final MappedClass mc : mapper.getMappedClasses()) { process(mc, (Validation) mc.getAnnotation(Validation.class)); } }
Source:
<code>public boolean segmentsAreFromSamePartitionSet( final Set<DataSegment> segments ) { Preconditions.checkArgument(!segments.isEmpty(), "segments nonempty"); final DataSegment firstSegment = segments.iterator().next(); for (final DataSegment segment : segments) { <START> if (!segment.getDataSource().equals(firstSegment.getDataSource())) { <END> return false; } if (!segment.getInterval().equals(firstSegment.getInterval())) { return false; } if (!segment.getVersion().equals(firstSegment.getVersion())) { return false; } } return true; }</code><technical_language>do this in statement</technical_language>

Target:
public boolean segmentsAreFromSamePartitionSet( final Set<DataSegment> segments ) { Preconditions.checkArgument(!segments.isEmpty(), "segments nonempty"); final DataSegment firstSegment = segments.iterator().next(); for (final DataSegment segment : segments) { if (!segment.getDataSource().equals(firstSegment.getDataSource()) || !segment.getInterval().equals(firstSegment.getInterval()) || !segment.getVersion().equals(firstSegment.getVersion())) { return false; } } return true; }
Source:
<code>public void fetchData(final String resourceClass) { fFetchingContent = true; notifyUI(); final DsfExecutor executor = fSession.getExecutor(); executor.submit(new DsfRunnable() { @Override public void run() { fHardwareOs.getResourcesInformation(fContext, resourceClass, new DataRequestMonitor<IGDBHardwareAndOS.IResourcesInformation>(executor, null) { @Override @ConfinedToDsfExecutor("fExecutor") protected void handleCompleted() { fFetchingContent = false; if (isSuccess()) { OSData data = new OSData(resourceClass, getData()); fExistingData.put(resourceClass, data); fTimestamp.put(resourceClass, new Date()); } else { <START> StatusManager.getManager().handle(getStatus(), StatusManager.BLOCK); <END> } notifyUI(); } }); } }); }</code><technical_language>is this supposed do</technical_language>

Target:
public void fetchData(final String resourceClass) { fFetchingContent = true; notifyUI(); final DsfExecutor executor = fSession.getExecutor(); executor.submit(new DsfRunnable() { @Override public void run() { fHardwareOs.getResourcesInformation(fContext, resourceClass, new DataRequestMonitor<IGDBHardwareAndOS2.IResourcesInformation>(executor, null) { @Override @ConfinedToDsfExecutor("fExecutor") protected void handleCompleted() { fFetchingContent = false; if (isSuccess()) { OSData data = new OSData(resourceClass, getData()); fExistingData.put(resourceClass, data); fTimestamp.put(resourceClass, new Date()); } else { StatusManager.getManager().handle(getStatus(), StatusManager.BLOCK); } notifyUI(); } }); } }); }
Source:
<code>private void testColumnsSort(String listTarget) { ListPage page = getList(listTarget); DataTable table = page.getTable(); List<String> headings = table.getColumnHeadings(); headings.forEach(heading -> { page.sortByColumn(heading); assertTrue("sort once on column '" + heading + "' without errors", LimsUtils.isStringEmptyOrNull(page.getErrors().getText())); page.sortByColumn(heading); <START> assertTrue("sort twice on column '" + heading + "' without errors", LimsUtils.isStringEmptyOrNull(page.getErrors().getText())); <END> }); }</code><technical_language>Ideally this method verify sorting worked error. long more items, do <sort once> String ascRow1Val = <get value>, ascRow2Val <get value> while (ascRow1Val.equals(ascRow2Val)) { <get row 2 3 (etc) instead> } <sort similarly determine descRow1Val descRow2Val> assertNotEquals(ascRow1Val.compareTo(ascRow2Val) > 0, descRow1Val.compareTo(descRow2Val) > 0);</technical_language>

Target:
private void testColumnsSort(String listTarget) { ListPage page = getList(listTarget); sortColumns(page.getTable(), page); }
Source:
<code>public OnThisDayPagesViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { View itemView = LayoutInflater. from(viewGroup.getContext()). inflate(R.layout.item_on_this_day_pages, viewGroup, false); <START> return new OnThisDayPagesViewHolder((Activity) viewGroup.getContext(), fragmentManager, (MaterialCardView) itemView, wiki); <END> }</code><technical_language>reason cast MaterialCardView</technical_language>

Target:
public OnThisDayPagesViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { View itemView = LayoutInflater. from(viewGroup.getContext()). inflate(R.layout.item_on_this_day_pages, viewGroup, false); return new OnThisDayPagesViewHolder((Activity) viewGroup.getContext(), fragmentManager, itemView, wiki); }
Source:
<code>private static String getSqlScriptsDir() throws IOException { final String dummyResourcePath = getUserManagerXmlFile(); Path resources = Paths.get(dummyResourcePath).getParent(); Path azkabanRoot = resources.getParent().getParent().getParent().getParent(); File sqlScriptDir = Paths.get(azkabanRoot.toString(), AZKABAN_DB_SQL_PATH).toFile(); <START> return props.getString(AzkabanDatabaseSetup.DATABASE_SQL_SCRIPT_DIR, sqlScriptDir.getCanonicalPath()); <END> }</code><technical_language>do need care entry is in props? test is in full control of in props. Right</technical_language>

Target:
private static String getSqlScriptsDir() throws IOException { final String dummyResourcePath = getUserManagerXmlFile(); Path resources = Paths.get(dummyResourcePath).getParent(); Path azkabanRoot = resources.getParent().getParent().getParent().getParent(); File sqlScriptDir = Paths.get(azkabanRoot.toString(), AZKABAN_DB_SQL_PATH).toFile(); return sqlScriptDir.getCanonicalPath(); }
Source:
<code>protected void createUniqueConstraints(DatastoreProvider provider, Database database) { List<UniqueConstraintDetails> constraints = new ArrayList<>(); for ( Namespace namespace : database.getNamespaces() ) { for ( Table table : namespace.getTables() ) { if ( table.isPhysicalTable() ) { Label label = label( table.getName() ); PrimaryKey primaryKey = table.getPrimaryKey(); createConstraint( constraints, table, label, primaryKey ); @SuppressWarnings("unchecked") Iterator<Column> columnIterator = table.getColumnIterator(); while ( columnIterator.hasNext() ) { Column column = columnIterator.next(); if ( column.isUnique() ) { constraints.add( new UniqueConstraintDetails( label, column.getName() ) ); } } Iterator<UniqueKey> uniqueKeyIterator = table.getUniqueKeyIterator(); while ( uniqueKeyIterator.hasNext() ) { <START> createConstraint( constraints, table, label, uniqueKeyIterator.next() ); <END> } } } } createUniqueConstraintsIfMissing( provider, constraints ); }</code><technical_language>rename this addConstraint create constraints anymore</technical_language>

Target:
protected void createUniqueConstraints(DatastoreProvider provider, Database database) { List<UniqueConstraintDetails> constraints = new ArrayList<>(); for ( Namespace namespace : database.getNamespaces() ) { for ( Table table : namespace.getTables() ) { if ( table.isPhysicalTable() ) { Label label = label( table.getName() ); PrimaryKey primaryKey = table.getPrimaryKey(); addConstraint( constraints, table, label, primaryKey ); @SuppressWarnings("unchecked") Iterator<Column> columnIterator = table.getColumnIterator(); while ( columnIterator.hasNext() ) { Column column = columnIterator.next(); if ( column.isUnique() ) { constraints.add( new UniqueConstraintDetails( label, column.getName() ) ); } } Iterator<UniqueKey> uniqueKeyIterator = table.getUniqueKeyIterator(); while ( uniqueKeyIterator.hasNext() ) { addConstraint( constraints, table, label, uniqueKeyIterator.next() ); } } } } createUniqueConstraintsIfMissing( provider, constraints ); }
Source:
<code>public void start(StartContext context) throws StartException { if (getSecurityDomainFutures != null) { Runnable task = () -> { try { getSecurityDomainFutures.forEach(FutureTask::run); List<Supplier<SecurityDomain>> domains = getSecurityDomainFutures.stream().map(f -> (Supplier<SecurityDomain>) (() -> toSecurityDomain(f))).collect(Collectors.toList()); <START> securityIdentitySupplier.setConfiguredSecurityDomainSupplier(domains.get(0)); <END> domains.remove(0); if (domains.size() > 0) { securityIdentitySupplier.setInflowSecurityDomainSuppliers(domains); } context.complete(); } catch (RuntimeException t) { context.failed(DomainManagementLogger.SECURITY_LOGGER.unableToConfigureManagementSecurityDomain(t)); } }; try { task.run(); } finally { context.asynchronous(); } } }</code><technical_language>IdentityService a separate field / setter for this one. distinct others need stuck in a list others</technical_language>

Target:
public void start(StartContext context) throws StartException { securityIdentitySupplier.setConfiguredSecurityDomainSupplier(configuredSecurityDomain::getValue); }
Source:
<code>public void enableDefaultSlf4jLoggingOfOutputData() { addSlf4jLogMessageConsumer((logMessage, ctx) -> { <START> if (ctx.level().equals(DEBUG)) { <END> ctx.logger().debug(logMessage); } else { ctx.logger().info(logMessage); } }); }</code><technical_language>This mapping is sufficient, Appium server more levels, for example warn error</technical_language>

Target:
public void enableDefaultSlf4jLoggingOfOutputData() { addSlf4jLogMessageConsumer((logMessage, ctx) -> { if (ctx.getLevel().equals(DEBUG)) { ctx.getLogger().debug(logMessage); } else { ctx.getLogger().info(logMessage); } }); }
Source:
<code>public void registerSupplyMessage(final UUID nodeId, final GridDhtPartitionSupplyMessage supplyMsg, final Runnable r) { final RebalanceFuture fut = rebalanceFut; if (fut.isActual(supplyMsg.rebalanceId())) { boolean historical = false; for (Integer p : supplyMsg.infos().keySet()) { fut.queued.get(p).increment(); <START> if (fut.histRebalancingParts.get(nodeId).contains(p)) <END> historical = true; } if (historical) ctx.kernalContext().getStripedRebalanceExecutorService().execute(r, Math.abs(nodeId.hashCode())); else ctx.kernalContext().getRebalanceExecutorService().execute(r); } }</code><technical_language>This change reverted, below</technical_language>

Target:
public void registerSupplyMessage(final UUID nodeId, final GridDhtPartitionSupplyMessage supplyMsg, final Runnable r) { final RebalanceFuture fut = rebalanceFut; if (fut.isActual(supplyMsg.rebalanceId())) { boolean historical = false; for (Integer p : supplyMsg.infos().keySet()) { fut.queued.get(p).increment(); if (fut.historical.contains(p)) historical = true; } if (historical) ctx.kernalContext().getStripedRebalanceExecutorService().execute(r, Math.abs(nodeId.hashCode())); else ctx.kernalContext().getRebalanceExecutorService().execute(r); } }
Source:
<code>private boolean isStatusChangeValid(final Long previousStatusTypeId, final Long newStatusTypeId) { try { crStatusTypeDAO.getChangeRequestStatusTypeById(newStatusTypeId); } catch (EntityRetrievalException e) { return false; } <START> if (previousStatusTypeId == this.cancelledByRequesterStatus) { <END> return false; } return true; }</code><technical_language>I "L"ong (as opposed "l"ong) .equals instead of ==. 100% I feel burned ==</technical_language>

Target:
private boolean isStatusChangeValid(final Long previousStatusTypeId, final Long newStatusTypeId) { try { crStatusTypeDAO.getChangeRequestStatusTypeById(newStatusTypeId); } catch (EntityRetrievalException e) { return false; } if (previousStatusTypeId.equals(this.cancelledByRequesterStatus)) { return false; } return true; }
Source:
<code>public static Session signIn(SignInCredentials signIn) { checkNotNull(signIn, "SignInCredentials required."); checkArgument(isNotBlank(signIn.getStudyIdentifier()), "Study identifier cannot be blank/null"); checkArgument(isNotBlank(signIn.getUsername()), "Username cannot be blank/null"); <START> checkArgument(isNotBlank(signIn.getPassword()), "Password cannot be blank/null"); <END> UserSession session = new BaseApiCaller(null).post(config.getAuthSignInApi(), signIn, UserSession.class); return new BridgeSession(session); }</code><technical_language>move null checks SignInCredentials constructor? This way, guarantee SignInCredentials non-blank fields. Similarly for SignUp Email</technical_language>

Target:
public static Session signIn(SignInCredentials signIn) { checkNotNull(signIn, "SignInCredentials required."); UserSession session = new BaseApiCaller(null).post(config.getAuthSignInApi(), signIn, UserSession.class); return new BridgeSession(session); }
Source:
<code>public PieceCount getPieceCount() { <START> PieceCount ret = new PieceCount(0); <END> for (AbstractPiece<I, V, E, M, WV, WM, S> innerPiece : innerPieces) { ret.add(innerPiece.getPieceCount()); } return ret; }</code><technical_language>this 1, this executes pieces simultaneously</technical_language>

Target:
public PieceCount getPieceCount() { return new PieceCount(1); }
Source:
<code>protected JDBCDataStore createDataStoreInternal(JDBCDataStore dataStore, Map params) throws IOException { PostGISDialect dialect = (PostGISDialect) dataStore.getSQLDialect(); Boolean loose = (Boolean) LOOSEBBOX.lookUp(params); dialect.setLooseBBOXEnabled(loose == null || Boolean.TRUE.equals(loose)); Boolean estimated = (Boolean) ESTIMATED_EXTENTS.lookUp(params); dialect.setEstimatedExtentsEnabled(estimated == null || Boolean.TRUE.equals(estimated)); Boolean encodeFunctions = (Boolean) ENCODE_FUNCTIONS.lookUp(params); dialect.setFunctionEncodingEnabled(encodeFunctions != null && encodeFunctions); Boolean usePs = (Boolean) PREPARED_STATEMENTS.lookUp(params); if(Boolean.TRUE.equals(usePs)) { dataStore.setSQLDialect(new PostGISPSDialect(dataStore, dialect)); } Boolean simplify = (Boolean) SIMPLIFY.lookUp(params); dialect.setSimplifyEnabled(simplify == null || simplify); <START> Boolean encodeBBOXAsEnvelope = (Boolean) ENCODE_BBOX_FILTER_USING_ENVELOPE.lookUp(params); <END> dialect.setEncodeBBOXFilterAsEnvelope(encodeBBOXAsEnvelope != null && Boolean.TRUE.equals(encodeBBOXAsEnvelope)); return dataStore; }</code><technical_language>Add note of parameter [PostGIS DataStore](<LINK_0> doc page</technical_language>

Target:
protected JDBCDataStore createDataStoreInternal(JDBCDataStore dataStore, Map params) throws IOException { PostGISDialect dialect = (PostGISDialect) dataStore.getSQLDialect(); Boolean loose = (Boolean) LOOSEBBOX.lookUp(params); dialect.setLooseBBOXEnabled(loose == null || Boolean.TRUE.equals(loose)); Boolean estimated = (Boolean) ESTIMATED_EXTENTS.lookUp(params); dialect.setEstimatedExtentsEnabled(estimated == null || Boolean.TRUE.equals(estimated)); Boolean encodeFunctions = (Boolean) ENCODE_FUNCTIONS.lookUp(params); dialect.setFunctionEncodingEnabled(encodeFunctions != null && encodeFunctions); Boolean usePs = (Boolean) PREPARED_STATEMENTS.lookUp(params); if(Boolean.TRUE.equals(usePs)) { dataStore.setSQLDialect(new PostGISPSDialect(dataStore, dialect)); } Boolean simplify = (Boolean) SIMPLIFY.lookUp(params); dialect.setSimplifyEnabled(simplify == null || simplify); Boolean encodeBBOXAsEnvelope = true; String largeGeometriesOptimized = System.getProperty("org.geotools.data.postgis.largeGeometriesOptimize"); if(largeGeometriesOptimized != null) { encodeBBOXAsEnvelope = largeGeometriesOptimized.toLowerCase().equals("true"); } dialect.setEncodeBBOXFilterAsEnvelope(encodeBBOXAsEnvelope != null && Boolean.TRUE.equals(encodeBBOXAsEnvelope)); return dataStore; }
Source:
<code><START> protected void setConnector(AbstractRepositoryConnector connector) { <END> this.connector = connector; }</code><technical_language>this private remove @since tag</technical_language>

Target:
private void setConnector(AbstractRepositoryConnector connector) { this.connector = connector; }
Source:
<code>private List<ServiceInfo> prepareServiceInfo(Map<String, Object> statusInfo) { List<ServiceInfo> serviceInfoList = new ArrayList<ServiceInfo>(); if (statusInfo.containsKey(NFS)) { Object[] nfsServiceInfo = (Object[]) statusInfo.get(NFS); for (Object nfsObj : nfsServiceInfo) { Map<String, Object> nfsMap = (Map<String, Object>) nfsObj; ServiceInfo nfsInfo = parseServiceInfo(nfsMap); nfsInfo.setNfsServices(true); serviceInfoList.add(nfsInfo); } } if (statusInfo.containsKey(SHD)) { Object[] shdServiceInfo = (Object[]) statusInfo.get(SHD); for (Object shdObj : shdServiceInfo) { Map<String, Object> shdMap = (Map<String, Object>) shdObj; ServiceInfo shdInfo = parseServiceInfo(shdMap); shdInfo.setShdServices(true); serviceInfoList.add(shdInfo); } <START> } <END> return serviceInfoList; }</code><technical_language>if blocks reduced calls a single method takes service name argument</technical_language>

Target:
private List<ServiceInfo> prepareServiceInfo(Map<String, Object> statusInfo) { List<ServiceInfo> serviceInfoList = new ArrayList<ServiceInfo>(); getServiceInfo(statusInfo, serviceInfoList, ServiceType.NFS); getServiceInfo(statusInfo, serviceInfoList, ServiceType.SHD); return serviceInfoList; }
Source:
<code>private void gracefulShutdownCrate(ExecutorDriver driver) { <START> driver.sendStatusUpdate(TaskStatus.newBuilder() <END> .setTaskId(currentTaskId) .setState(TaskState.TASK_KILLING) .build()); boolean success = task.gracefulStop(); if (success) { driver.sendStatusUpdate(TaskStatus.newBuilder() .setTaskId(currentTaskId) .setState(TaskState.TASK_KILLED) .build()); driver.stop(); } else { driver.sendStatusUpdate(TaskStatus.newBuilder() .setTaskId(currentTaskId) .setState(TaskState.TASK_RUNNING) .build()); } }</code><technical_language>try move sendStatusUpdate TaskStatus builder method. code block repeats times, difference is task state</technical_language>

Target:
private void gracefulShutdownCrate(ExecutorDriver driver) { sendTaskStatus(driver, TaskState.TASK_KILLING); boolean success = task.gracefulStop(); if (success) { sendTaskStatus(driver, TaskState.TASK_KILLED); driver.stop(); } else { sendTaskStatus(driver, TaskState.TASK_RUNNING); } }
Source:
<code>private void loadUDDIConnectionInfo() throws ConnectionManagerException { BusinessDetail businessDetail = null; try { businessDetail = getUddiConnectionManagerDAO().loadBusinessDetail(); } catch (Exception ex) { LOG.error("Could not load UDDI business details: " + ex.getLocalizedMessage(), ex); } if (businessDetail != null) { synchronized (m_hUDDIConnectInfo) { m_hUDDIConnectInfo.clear(); if (businessDetail.getBusinessEntity() != null && !businessDetail.getBusinessEntity().isEmpty()) { for (BusinessEntity oEntity : businessDetail.getBusinessEntity()) { ConnectionManagerCacheHelper helper = new ConnectionManagerCacheHelper(); String sHomeCommunityId = helper.getCommunityId(oEntity); <START> if (sHomeCommunityId != null && sHomeCommunityId.length() > 0) { <END> m_hUDDIConnectInfo.put(sHomeCommunityId, oEntity); } } } m_bUDDILoaded = true; m_lUDDIFileLastModified = getUddiConnectionManagerDAO().getLastModified(); } } else { LOG.warn("No UDDI information was found"); } }</code><technical_language>StringUtils.isNotEmpty</technical_language>

Target:
private void loadUDDIConnectionInfo() throws ConnectionManagerException { BusinessDetail businessDetail = null; try { businessDetail = getUddiConnectionManagerDAO().loadBusinessDetail(); } catch (Exception ex) { LOG.error("Could not load UDDI business details: " + ex.getLocalizedMessage(), ex); } if (businessDetail != null) { synchronized (m_hUDDIConnectInfo) { m_hUDDIConnectInfo.clear(); if (businessDetail.getBusinessEntity() != null && !businessDetail.getBusinessEntity().isEmpty()) { for (BusinessEntity oEntity : businessDetail.getBusinessEntity()) { ConnectionManagerCacheHelper helper = new ConnectionManagerCacheHelper(); String sHomeCommunityId = helper.getCommunityId(oEntity); if (StringUtils.isNotEmpty(sHomeCommunityId)) { m_hUDDIConnectInfo.put(sHomeCommunityId, oEntity); } } } m_bUDDILoaded = true; m_lUDDIFileLastModified = getUddiConnectionManagerDAO().getLastModified(); } } else { LOG.warn("No UDDI information was found"); } }
Source:
<code>@Override void runSynchronousPart() { if (column != null) { column.setLastSaveTime(this.colInfo.world.getTotalWorldTime()); } <START> } <END></code><technical_language>Callbacks removed - why</technical_language>

Target:
@Override void runSynchronousPart() { if (column != null) { column.setLastSaveTime(this.colInfo.world.getTotalWorldTime()); } runCallbacks(); }
Source:
<code>public boolean isJobAlreadyProcessed(byte[] row) { Get get = new Get(row); get.addColumn(Constants.INFO_FAM_BYTES, Constants.JOB_PROCESSED_SUCCESS_COL_BYTES); <START> boolean success = false; <END> Result result = null; try { result = rawTable.get(get); } catch (IOException e) { return success; } try { if (result != null && !result.isEmpty()) { byte[] successBytes = result.getValue(Constants.INFO_FAM_BYTES, Constants.JOB_PROCESSED_SUCCESS_COL_BYTES); if (successBytes != null) { success = Bytes.toBoolean(successBytes); } } } catch (Exception e) { return success; } return success; }</code><technical_language>Nit: bit easier read code this is named "processed" "alreadyProcessed". "Success" a confusing</technical_language>

Target:
public boolean isJobAlreadyProcessed(byte[] row) throws ProcessingException { if (row == null) { throw new ProcessingException("Row key can't be null"); } Get get = new Get(row); get.addColumn(Constants.INFO_FAM_BYTES, Constants.JOB_PROCESSED_SUCCESS_COL_BYTES); Result result = null; try { result = rawTable.get(get); } catch (IOException e) { return false; } if (result != null && !result.isEmpty()) { byte[] processedSuccessBytes = result.getValue(Constants.INFO_FAM_BYTES, Constants.JOB_PROCESSED_SUCCESS_COL_BYTES); if (processedSuccessBytes != null) { return Bytes.toBoolean(processedSuccessBytes); } } return false; }
Source:
<code>public MutateRowRequest adapt(Put put) { <START> Mutation mutation = Mutation.create(); <END> mutationAdapters.putAdapter.adapt(put, mutation); return toMutateRowRequest(put.getRow(), mutation); }</code><technical_language>sense a RowMutation PutAdapter a MutationApi interface</technical_language>

Target:
public MutateRowRequest adapt(Put put) { RowMutation rowMutation = newRowMutationModel(put.getRow()); adapt(put, rowMutation); return rowMutation.toProto(requestContext); }
Source:
<code>private void updateList() { if (mLinear) { mList.setLayoutManager(mLinearManager); } else { mList.setLayoutManager(mGridManager); } mList.setAdapter(null); mAdapter.notifyDataSetChanged(); mAdapter.setLinear(mLinear); mList.setAdapter(mAdapter); if (mSwitch != null) { <START> boolean isLight = ThemeHelper.isLightThemeSelected(mContext); int icon; if (mLinear) icon = R.drawable.ic_apps_white_24dp; else icon = R.drawable.ic_list_white_24dp; mSwitch.setIcon(icon); <END> mSwitch.setTitle(mLinear ? R.string.grid : R.string.list); mPrefs.edit().putBoolean("linear", mLinear).apply(); } }</code><technical_language>I prefer ?: syntax, I isLight is a leftover merge, is needed suggestion mSwitch.setIcon(mLinear ? R.drawable.ic_apps_white_24dp : R.drawable.ic_list_white_24dp);</technical_language>

Target:
private void updateList() { if (mLinear) { mList.setLayoutManager(mLinearManager); } else { mList.setLayoutManager(mGridManager); } mList.setAdapter(null); mAdapter.notifyDataSetChanged(); mAdapter.setLinear(mLinear); mList.setAdapter(mAdapter); if (mSwitch != null) { mSwitch.setIcon(mLinear ? R.drawable.ic_apps_white_24dp : R.drawable.ic_list_white_24dp); mSwitch.setTitle(mLinear ? R.string.grid : R.string.list); mPrefs.edit().putBoolean("linear", mLinear).apply(); } }
Source:
<code>public void onSuggestedEditsCardClick(@NotNull PageTitle pageTitle, @NotNull String sourceDescription, @NotNull String sourceLangCode, @NotNull SuggestedEditsCardView view) { suggestedEditsCardView = view; descriptionEditPageTitle = pageTitle; FeedFragment.this.sourceDescription = sourceDescription; FeedFragment.this.sourceLangCode = sourceLangCode; if (Prefs.showEditTaskOnboarding()) { startActivityForResult(SuggestedEditsOnboardingActivity.Companion.newIntent(requireContext(), Constants.InvokeSource.FEED), <START> ACTIVITY_REQUEST_SUGGESTED_EDITS_ONBOARDING); <END> } else { startDescriptionEditScreen(); } }</code><technical_language>handle action correctly. clicking a "Translate description" card, "Add description" screen</technical_language>

Target:
public void onSuggestedEditsCardClick(@NotNull PageTitle pageTitle, @NotNull String sourceDescription, @NotNull String sourceLangCode, @NotNull SuggestedEditsCardView view) { suggestedEditsCardView = view; descriptionEditPageTitle = pageTitle; FeedFragment.this.sourceDescription = sourceDescription; FeedFragment.this.sourceLangCode = sourceLangCode; if (Prefs.showEditTaskOnboarding()) { startActivityForResult(SuggestedEditsOnboardingActivity.Companion.newIntent(requireContext(), FEED_CARD_SUGGESTED_EDITS_ADD_DESC), ACTIVITY_REQUEST_SUGGESTED_EDITS_ONBOARDING); } else { startDescriptionEditScreen(); } }
Source:
<code>public void setShipping(final Shipping shipping) { this.shipping = shipping; addUnsavedProperty("shipping"); <START> } <END></code><technical_language>I remember, addUnsavedProperty do useful removed. pollute code, please confirm refactor needed</technical_language>

Target:
public void setShipping(final Shipping shipping) { this.shipping = shipping; }
Source:
<code>public void callPrivateMethodWithCalendarParam() { Assert.assertNull(controller.getModel().getCalendarValue()); <START> Calendar value = Calendar.getInstance(); <END> controller.invoke(PUBLIC_WITH_CALENDER_PARAM_ACTION, new Param(PARAM_NAME, value)); Assert.assertEquals(controller.getModel().getCalendarValue().getTime(), value.getTime()); }</code><technical_language>final</technical_language>

Target:
public void callPrivateMethodWithCalendarParam() { Assert.assertNull(controller.getModel().getCalendarValue()); final Calendar value = Calendar.getInstance(); controller.invoke(PUBLIC_WITH_CALENDER_PARAM_ACTION, new Param(PARAM_NAME, value)); Assert.assertEquals(controller.getModel().getCalendarValue().getTime(), value.getTime()); }
Source:
<code>public ModelAndView viewServiceRecord(@PathVariable(value = "recordId") Long recordId, ModelMap model) throws IOException { SequencerServiceRecord sr = requestManager.getSequencerServiceRecordById(recordId); if (sr != null) { model.put("serviceRecord", sr); model.put("serviceRecordFiles", populateServiceRecordFiles(sr)); } else { <START> throw new IOException("Cannot retrieve the requested Service Record"); <END> } return new ModelAndView("/pages/editServiceRecord.jsp", model); }</code><technical_language>Is this good of exception? returning error response suffice. - cares wrong id client? client / user. a this in this file, open discussion :ear:</technical_language>

Target:
public ModelAndView viewServiceRecord(@PathVariable(value = "recordId") Long recordId, ModelMap model) throws IOException { SequencerServiceRecord sr = requestManager.getSequencerServiceRecordById(recordId); if (sr != null) { model.put(ModelKeys.RECORD.getKey(), sr); model.put(ModelKeys.FILES.getKey(), populateServiceRecordFiles(sr)); } else { throw new IOException("No such Service Record"); } return new ModelAndView("/pages/editServiceRecord.jsp", model); }