mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +00:00
65997: checkstyle
This commit is contained in:
@@ -85,15 +85,14 @@ public class DspaceObjectMetadataOperation<R extends DSpaceObject> extends Patch
|
|||||||
/**
|
/**
|
||||||
* Implements the patch operation for metadata operations.
|
* Implements the patch operation for metadata operations.
|
||||||
* @param context context we're performing patch in
|
* @param context context we're performing patch in
|
||||||
* @param resource the dso.
|
* @param dso the dso.
|
||||||
* @param operation the metadata patch operation.
|
* @param operation the metadata patch operation.
|
||||||
* @return the updated dso
|
* @return the updated dso
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R perform(Context context, R resource, Operation operation) {
|
public R perform(Context context, R dso, Operation operation) {
|
||||||
DSpaceObject dSpaceObject = (DSpaceObject) resource;
|
performPatchOperation(context, dso, operation);
|
||||||
performPatchOperation(context, dSpaceObject, operation);
|
return dso;
|
||||||
return (R) dSpaceObject;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -242,8 +241,10 @@ public class DspaceObjectMetadataOperation<R extends DSpaceObject> extends Patch
|
|||||||
* Replaces metadata in the dso; 4 cases:
|
* Replaces metadata in the dso; 4 cases:
|
||||||
* - If we replace everything: clearMetadata & add the new ones
|
* - If we replace everything: clearMetadata & add the new ones
|
||||||
* - If we replace for a single field: clearMetadata on the field & add the new ones
|
* - If we replace for a single field: clearMetadata on the field & add the new ones
|
||||||
* - A single existing metadata value: Retrieve the metadatavalue object & make alerations directly on this object
|
* - A single existing metadata value:
|
||||||
* - A single existing metadata property: Retrieve the metadatavalue object & make alerations directly on this object
|
* Retrieve the metadatavalue object & make alerations directly on this object
|
||||||
|
* - A single existing metadata property:
|
||||||
|
* Retrieve the metadatavalue object & make alerations directly on this object
|
||||||
* @param context context patch is being performed in
|
* @param context context patch is being performed in
|
||||||
* @param dso dso being patched
|
* @param dso dso being patched
|
||||||
* @param dsoService service doing the patch in db
|
* @param dsoService service doing the patch in db
|
||||||
@@ -363,7 +364,7 @@ public class DspaceObjectMetadataOperation<R extends DSpaceObject> extends Patch
|
|||||||
List<MetadataValue> metadataValues = dsoService.getMetadata(dso, schema, element, qualifier, Item.ANY);
|
List<MetadataValue> metadataValues = dsoService.getMetadata(dso, schema, element, qualifier, Item.ANY);
|
||||||
try {
|
try {
|
||||||
int indexToCopyFromInt = Integer.parseInt(indexToCopyFrom);
|
int indexToCopyFromInt = Integer.parseInt(indexToCopyFrom);
|
||||||
if (indexToCopyFromInt >= 0 && metadataValues.size() >indexToCopyFromInt
|
if (indexToCopyFromInt >= 0 && metadataValues.size() > indexToCopyFromInt
|
||||||
&& metadataValues.get(indexToCopyFromInt) != null) {
|
&& metadataValues.get(indexToCopyFromInt) != null) {
|
||||||
MetadataValue metadataValueToCopy = metadataValues.get(indexToCopyFromInt);
|
MetadataValue metadataValueToCopy = metadataValues.get(indexToCopyFromInt);
|
||||||
// Add mdv to end of md list
|
// Add mdv to end of md list
|
||||||
|
Reference in New Issue
Block a user