Skip to content

Commit

Permalink
fixes of log messages, mostly missing or superfluous {}, some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Jan 20, 2020
1 parent 8ad0601 commit 7c4ba9f
Show file tree
Hide file tree
Showing 23 changed files with 33 additions and 32 deletions.
Expand Up @@ -3161,7 +3161,7 @@ public static List<RefinedAssociationDefinition> getRefinedAssociationDefinition
return associationDefinitions;
}
} catch (Exception ex) {
LOGGER.error("Association for {}/{} not supported by resource {}", kind, intent, resource, ex.getLocalizedMessage());
LOGGER.error("Association for {}/{} not supported by resource {}: {}", kind, intent, resource, ex.getLocalizedMessage());
}
return associationDefinitions;
}
Expand Down Expand Up @@ -3273,7 +3273,7 @@ public static <O extends ObjectType> ArchetypePolicyType getArchetypeSpecificati
spec = locator.getModelInteractionService().determineArchetypePolicy((PrismObject<? extends AssignmentHolderType>) object, result);
} catch (SchemaException | ConfigurationException ex){
result.recordPartialError(ex.getLocalizedMessage());
LOGGER.error("Cannot load ArchetypeInteractionSpecification for object ", object, ex.getLocalizedMessage());
LOGGER.error("Cannot load ArchetypeInteractionSpecification for object {}: {}", object, ex.getLocalizedMessage());
}
return spec;
}
Expand Down Expand Up @@ -3851,7 +3851,7 @@ public static SceneDto createSceneDto(CaseType caseObject, PageBase pageBase, St
pageBase.getPrismContext(), pageBase.getModelInteractionService(), objectRef, task, result);
return new SceneDto(deltasScene);
} catch (SchemaException | ExpressionEvaluationException ex){
LOGGER.error("Unable to create delta visualization for case " + caseObject.getName(), ex.getLocalizedMessage());
LOGGER.error("Unable to create delta visualization for case {}: {}", caseObject, ex.getLocalizedMessage(), ex);
}
return null;
}
Expand Down
Expand Up @@ -111,7 +111,7 @@ private String getActivationLabelLabel(ActivationType activation){
try {
lifecycle = assignmentModel.findProperty(AssignmentType.F_LIFECYCLE_STATE);
} catch (SchemaException e) {
LOGGER.error("Cannot find lifecycle property: ", e.getMessage(), e);
LOGGER.error("Cannot find lifecycle property: {}", e.getMessage(), e);
}

String lifecycleState = getLifecycleState(lifecycle);
Expand Down
Expand Up @@ -85,7 +85,7 @@ public PrismContainerValueWrapper<C> createValueWrapper(PrismContainerWrapper<C>
Item<?,?> childItem = value.findItem(def.getItemName());

if (childItem == null && def instanceof PrismContainerDefinition) {
LOGGER.trace("Skipping craeting wrapper for {}, only property and refernce wrappers are created for heterogenous containers.");
LOGGER.trace("Skipping creating wrapper for {}, only property and reference wrappers are created for heterogeneous containers.", def);
continue;
}

Expand Down
Expand Up @@ -159,13 +159,13 @@ private boolean skipCreateWrapper(ItemDefinition<?> def, ItemStatus status, Wrap
}

if (ItemStatus.ADDED == context.getObjectStatus() && !def.canAdd()) {
LOGGER.trace("Skipping creating wrapper for {}, becasue ADD operation is not supported");
LOGGER.trace("Skipping creating wrapper for {}, because ADD operation is not supported.", def);
return false;
}

if (ItemStatus.NOT_CHANGED == context.getObjectStatus()) {
if (!def.canRead()) {
LOGGER.trace("Skipping creating wrapper for {}, because read operation is not supported");
LOGGER.trace("Skipping creating wrapper for {}, because read operation is not supported.", def);
return false;
}

Expand Down Expand Up @@ -195,7 +195,7 @@ private boolean determineReadOnly(IW itemWrapper, WrapperContext context) {

if (ItemStatus.NOT_CHANGED == objectStatus) {
if (!itemWrapper.canModify()) {
LOGGER.trace("Setting {} as readonly because authZ said so");
LOGGER.trace("Setting {} as readonly because authZ said so.", itemWrapper);
return true;
}
}
Expand Down
Expand Up @@ -58,7 +58,7 @@ public <IW extends ItemWrapper> boolean match(IW wrapper) {
((PrismReferenceWrapperImpl) wrapper).getValue();
valueWrapper.setLink(true);
} catch (SchemaException e){
LOGGER.warn("Unable to set isLink status for PrismReferenceValueWrapper, ", e.getLocalizedMessage());
LOGGER.warn("Unable to set isLink status for PrismReferenceValueWrapper: {}", e.getLocalizedMessage());
}
}
return match;
Expand Down
Expand Up @@ -144,7 +144,7 @@ private void expressionValueAddPerformed(AjaxRequestTarget target, ExpressionVal
getModelObject().getValues().add(newExpressionValueWrapper);
getModelObject().getItem().setRealValue(newExpressionValue);
} catch (SchemaException ex){
LOGGER.error("Unable to create new expression value, ", ex.getLocalizedMessage());
LOGGER.error("Unable to create new expression value: {}", ex.getLocalizedMessage());
}

target.add(ExpressionPropertyPanel.this);
Expand Down
Expand Up @@ -88,7 +88,7 @@ protected PrismObject<ResourceType> load() {
PrismObject<ResourceType> resource = WebModelServiceUtils.loadObject(resourceRef, getPageBase(), loadResourceTask, result);
result.computeStatusIfUnknown();
if (!result.isAcceptable()) {
LOGGER.error("Cannot find resource referenced from construction. {}", construction, result.getMessage());
LOGGER.error("Cannot find resource {} referenced from construction {}.", construction, result.getMessage());
result.recordPartialError("Could not find resource referenced from construction.");
return null;
}
Expand Down Expand Up @@ -175,7 +175,7 @@ protected void removeValuePerformed(AjaxRequestTarget target, ListItem<ObjectRef
});
});
} catch (SchemaException ex){
LOGGER.error("Couldn't remove association value, ", ex.getLocalizedMessage());
LOGGER.error("Couldn't remove association value: {}", ex.getLocalizedMessage());
}
super.removeValuePerformed(target, item);
}
Expand Down Expand Up @@ -289,7 +289,7 @@ protected void onSelectPerformed(AjaxRequestTarget target, ShadowType object) {
ExpressionUtil.addShadowRefEvaluatorValue(newAssociationExpression, object.getOid(),
getPageBase().getPrismContext());
} catch (SchemaException ex){
LOGGER.error("Couldn't find association container, ", ex.getLocalizedMessage());
LOGGER.error("Couldn't find association container: {}", ex.getLocalizedMessage());
}
target.add(ConstructionAssociationPanel.this);
}
Expand Down
Expand Up @@ -337,7 +337,7 @@ private ExpressionType getExpressionFromRowModel(IModel<PrismContainerValueWrapp
}
return expressionType;
} catch (SchemaException ex) {
LOGGER.error("Unable to find association container in the construction, ", ex.getLocalizedMessage());
LOGGER.error("Unable to find association container in the construction: {}", ex.getLocalizedMessage());
}
return null;
}
Expand Down
Expand Up @@ -695,7 +695,7 @@ public String getObject() {
return WebComponentUtil.getEffectiveName(caseModelObject.getObjectRef(), AbstractRoleType.F_DISPLAY_NAME, pageBase,
pageBase.getClass().getSimpleName() + "." + "loadCaseObjectRefName");
} catch (Exception ex) {
LOGGER.error("Unable find the object for reference: ", caseModelObject.getObjectRef());
LOGGER.error("Unable find the object for reference: {}", caseModelObject.getObjectRef());
}
}
}
Expand Down
Expand Up @@ -115,7 +115,7 @@ private boolean isLiteralExpressionValueNotEmpty(){
try {
return ExpressionUtil.isLiteralExpressionValueNotEmpty(SimpleValueExpressionPanel.this.getModelObject());
} catch (SchemaException ex){
LOGGER.error("Unable to load literal expression value, ", ex.getLocalizedMessage());
LOGGER.error("Unable to load literal expression value: {}", ex.getLocalizedMessage());
}
return false;
}
Expand Down
Expand Up @@ -63,7 +63,7 @@ public String[] getInputAsArray() {
try {
input.add(new String (IOUtils.toByteArray(getStream())));
} catch (IOException e) {
LOGGER.error("Unable to define file content type, ", e.getLocalizedMessage());
LOGGER.error("Unable to define file content type: {}", e.getLocalizedMessage());
}
return input.toArray(new String[input.size()]);
}
Expand Down Expand Up @@ -108,7 +108,7 @@ protected InputStream initStream() {
setContentType(newContentType);
}
} catch (IOException ex){
LOGGER.error("Unable to define download file content type, ", ex.getLocalizedMessage());
LOGGER.error("Unable to define download file content type: {}", ex.getLocalizedMessage());
}
return is;
}
Expand Down
Expand Up @@ -73,7 +73,7 @@ protected List<SceneDto> load() {
pageBase.getModelInteractionService(), pageBase.getPrismContext(), task, result);
return sceneDtoList;
} catch (Exception ex){
LOGGER.error("Couldn't prepare delta visualization, ", ex.getLocalizedMessage());
LOGGER.error("Couldn't prepare delta visualization: {}", ex.getLocalizedMessage());
}
return null;
}
Expand Down
Expand Up @@ -271,7 +271,7 @@ private void stopCaseProcessConfirmed(AjaxRequestTarget target, List<CaseType> c
try {
getWorkflowService().cancelCase(caseObject.getOid(), task, result);
} catch (Exception ex){
LOGGER.error("Couldn't stop case process, ", ex.getLocalizedMessage());
LOGGER.error("Couldn't stop case process: {}", ex.getLocalizedMessage());
result.recordFatalError(createStringResource("PageCases.message.stopCaseProcessConfirmed.fatalError").getString(), ex);
}
});
Expand Down
Expand Up @@ -332,7 +332,7 @@ public void onClick(AjaxRequestTarget target) {
try {
mergeConfiguration = getModelInteractionService().getMergeConfiguration(result);
} catch (ObjectNotFoundException | SchemaException ex){
LOGGER.error("Couldn't load merge configuration, ", ex.getLocalizedMessage());
LOGGER.error("Couldn't load merge configuration: {}", ex.getLocalizedMessage());
result.recomputeStatus();
getFeedbackMessages().error(PageUsers.this, ex.getLocalizedMessage());
target.add(getFeedbackPanel());
Expand Down
Expand Up @@ -295,7 +295,7 @@ private boolean isAuthorizedForActions(){
boolean isAuthorizedToClaim = getPageBase().getWorkflowManager().isCurrentUserAuthorizedToClaim(getModelObject());
return isAuthorizedToSubmit || isAuthorizedToClaim || isAuthorizedToDelegate;
} catch (Exception ex){
LOGGER.error("Unable to check user authorization for workitem actions, ", ex.getLocalizedMessage());
LOGGER.error("Unable to check user authorization for workitem actions: {}", ex.getLocalizedMessage());
}
return false;
}
Expand Down
Expand Up @@ -99,7 +99,7 @@ public boolean handleUnresolvedVariableExpression(VariableExpression vexp) {
String contextDescription = context.getContextDescription();

if (!isDynamic(vexp)) {
LOGGER.error("Unresolved script variable {} because it is not dynamic, in {}", contextDescription);
LOGGER.error("Unresolved script variable {} because it is not dynamic, in {}", variableName, contextDescription);
return false;
}

Expand Down Expand Up @@ -135,7 +135,7 @@ public boolean handleUnresolvedVariableExpression(VariableExpression vexp) {
}
}

LOGGER.error("Unresolved script variable {} because no declaration for it cannot be found in {}", contextDescription);
LOGGER.error("Unresolved script variable {} because no declaration for it cannot be found in {}", variableName, contextDescription);
return false;
}
}
Expand Up @@ -688,7 +688,7 @@ private <F extends FocusType> void loadLinkRefsFromFocus(LensContext<F> context,
projectionContext.setExists(ShadowUtil.isExists(shadow.asObjectable()));
if (ShadowUtil.isDead(shadow.asObjectable())) {
projectionContext.markTombstone();
LOGGER.trace("Loading dead shadow {} for projection", shadow, projectionContext.getHumanReadableName());
LOGGER.trace("Loading dead shadow {} for projection {}.", shadow, projectionContext.getHumanReadableName());
continue;
}
}
Expand Down
Expand Up @@ -182,7 +182,7 @@ private <O extends ObjectType> void transformFocusExecutionDeltaForPasswords(Len
LOGGER.trace("Credential {} should be encrypted, nothing to do", credentialName);
return;
} else if (storageType == CredentialsStorageTypeType.HASHING) {
LOGGER.trace("Hashing credential", credentialName);
LOGGER.trace("Hashing credential: {}", credentialName);
if (delta.isAdd()) {
PrismProperty<ProtectedStringType> prop = delta.getObjectToAdd().findProperty(valuePropertyPath);
if (prop != null) {
Expand Down Expand Up @@ -219,7 +219,7 @@ private <O extends ObjectType> void transformFocusExecutionDeltaForPasswords(Len
}
}
} else if (storageType == CredentialsStorageTypeType.NONE) {
LOGGER.trace("Removing credential", credentialName);
LOGGER.trace("Removing credential: {}", credentialName);
if (delta.isAdd()) {
delta.getObjectToAdd().removeProperty(valuePropertyPath);
} else {
Expand Down
Expand Up @@ -200,7 +200,7 @@ void processException(Trace LOGGER, Throwable t, OperationResult opResult, TaskR
opResult.recordFatalError("Unspecified error: "+t.getMessage(), t);
setRunResultStatus(t, partition, CriticalityType.FATAL, runResult);
} else {
LOGGER.error("{}: Internal Error: {}", ctx, t, t.getMessage());
LOGGER.error("{}: Internal Error: {}", ctx, t.getMessage(), t);
// Can be anything ... but we can't recover from that.
// It is most likely a programming error. Does not make much sense to retry.
opResult.recordFatalError("Internal Error: "+t.getMessage(), t);
Expand Down
Expand Up @@ -341,7 +341,7 @@ public void collectEntitlementChange(ProvisioningContext ctx, ContainerDelta<Sha
Map<QName, PropertyModificationOperation> operationsMap = new HashMap<>();

if (CollectionUtils.isNotEmpty(itemDelta.getValuesToReplace())) {
LOGGER.error("Replace delta not supported for association, modifications {},\n provisioning context: ", itemDelta, ctx);
LOGGER.error("Replace delta not supported for association, modifications {},\n provisioning context: {}", itemDelta, ctx);
throw new SchemaException("Cannot perform replace delta for association, replace values: " + itemDelta.getValuesToReplace());
}
collectEntitlementToAttrsDelta(ctx, operationsMap, itemDelta.getValuesToAdd(), ModificationType.ADD);
Expand Down
Expand Up @@ -2573,7 +2573,8 @@ private void executeProvisioningScripts(ProvisioningContext ctx, ProvisioningOpe
Object returnedValue = connector.executeScript(operation, reporter, result);

if (LOGGER.isDebugEnabled()) {
LOGGER.debug("PROVISIONING SCRIPT EXECUTION {} {} successful, returned value: {}", returnedValue);
LOGGER.debug("PROVISIONING SCRIPT EXECUTION {} {} successful, returned value: {}",
beforeAfter.value(), provisioningOperationType.value(), returnedValue);
}

} catch (CommunicationException ex) {
Expand Down
Expand Up @@ -990,7 +990,7 @@ private String modifyShadowAttempt(ProvisioningContext ctx,
shadowManager.recordModifyResult(ctx, repoShadow, modifications, opState, now, parentResult);
return repoShadow.getOid();
} else {
LOGGER.trace("Shadow exists: ", repoShadow.debugDump());
LOGGER.trace("Shadow exists: {}", repoShadow.debugDump());
}

AsynchronousOperationReturnValue<Collection<PropertyDelta<PrismPropertyValue>>> asyncReturnValue =
Expand Down
Expand Up @@ -176,7 +176,7 @@ public void setProcessor(Processor processor) {
public void setDelayProcessor(long delay) {
setProcessor((task, bucket, i) -> {
if (delay > 0) {
LOGGER.info("Sleeping for {} ms; task = {}", task);
LOGGER.info("Sleeping for {} ms; task = {}", delay, task);
try {
Thread.sleep(delay);
} catch (InterruptedException e) {
Expand Down

0 comments on commit 7c4ba9f

Please sign in to comment.