Skip to content

Commit

Permalink
Remove redundant capability checks
Browse files Browse the repository at this point in the history
Just a minor code improvement.
  • Loading branch information
mederly committed Nov 7, 2023
1 parent d08ef80 commit ade50c9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ private AsynchronousOperationResult doExecute(OperationResult result)
SchemaDebugUtil.debugDump(identifiers));
}

if (!ResourceTypeUtil.isDeleteCapabilityEnabled(ctx.getResource())) {
throw new UnsupportedOperationException(
String.format("Resource does not support 'delete' operation (%s)", ctx.getExceptionDescription()));
}

connectorAsyncOpRet =
connector.deleteObject(
ctx.getObjectDefinitionRequired(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,6 @@ private AsynchronousOperationReturnValue<Collection<PropertyModificationOperatio
primaryIdentification.debugDump(1), SchemaDebugUtil.debugDump(operations, 1));
}

// TODO wasn't this checked above?
if (!ResourceTypeUtil.isUpdateCapabilityEnabled(ctx.getResource())) {
if (operations.isEmpty()) {
LOGGER.debug("No modifications for connector object specified (after filtering). Skipping processing.");
result.recordSuccess();
return null;
}
UnsupportedOperationException e = new UnsupportedOperationException("Resource does not support 'update' operation");
result.recordFatalError(e);
throw e;
}

// because identifiers can be modified e.g. on rename operation (TODO: is this really needed?)
ResourceObjectIdentification identificationClone = primaryIdentification.clone();
List<Collection<Operation>> operationsWaves = sortOperationsIntoWaves(operations, objectDefinition);
Expand Down

0 comments on commit ade50c9

Please sign in to comment.