From 69d3d8f2b00ec270659b927446cc9953ae55f94e Mon Sep 17 00:00:00 2001 From: buczekp <buczekp> Date: Wed, 9 Mar 2011 20:22:02 +0000 Subject: [PATCH] [LMS-1979] minor: improved error logging & javadoc SVN: 20273 --- .../ManagedPropertyGridActionDialog.java | 8 +++---- .../PropertiesBatchEvaluationErrors.java | 22 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGridActionDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGridActionDialog.java index 1ccfcd312c2..00a7b78e476 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGridActionDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGridActionDialog.java @@ -182,14 +182,14 @@ public final class ManagedPropertyGridActionDialog extends if (managedAction.getSelectionType() == ManagedTableActionRowSelectionType.REQUIRED_SINGLE && data.size() == 1) { - String bindedColumnTitleOrNull = + String boundedColumnTitleOrNull = managedAction.getBindings().get(inputDescription.getLabel()); - if (bindedColumnTitleOrNull != null) + if (boundedColumnTitleOrNull != null) { if (viewContext.isLoggingEnabled()) { Info.display("found binding", inputDescription.getLabel() + "->" - + bindedColumnTitleOrNull); + + boundedColumnTitleOrNull); } TableModelRowWithObject<ReportRowModel> selectedRow = data.get(0); TableModel tableModel = @@ -198,7 +198,7 @@ public final class ManagedPropertyGridActionDialog extends for (TableModelColumnHeader header : tableModel.getHeader()) { - if (header.getTitle().equals(bindedColumnTitleOrNull)) + if (header.getTitle().equals(boundedColumnTitleOrNull)) { ISerializableComparable value = selectedRow.getValues().get(header.getIndex()); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/PropertiesBatchEvaluationErrors.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/PropertiesBatchEvaluationErrors.java index 61465daafc6..d7bc1eb79fd 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/PropertiesBatchEvaluationErrors.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/PropertiesBatchEvaluationErrors.java @@ -35,8 +35,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ScriptPE; class PropertiesBatchEvaluationErrors { /** - * limitation on the number of ErrorDetails objects kept in memory. This guards us from - * scripts generating unique error messages for excessively large batches. + * limitation on the number of ErrorDetails objects kept in memory. This guards us from scripts + * generating unique error messages for excessively large batches. */ static final int MAX_ERROR_DETAILS_KEPT = 10; @@ -111,8 +111,7 @@ class PropertiesBatchEvaluationErrors } /** - * @return <code>true</code> when the memory is full and no more errors should be - * accumulated. + * @return <code>true</code> when the memory is full and no more errors should be accumulated. */ boolean shouldSkipDetailsAccumulation(String errorMessage) { @@ -120,11 +119,11 @@ class PropertiesBatchEvaluationErrors && errorDetails.size() >= MAX_ERROR_DETAILS_KEPT; } - boolean hasErrors() { + boolean hasErrors() + { return totalFailedRowsNumber > 0; } - /** * creates a messages to be displayed to the user. */ @@ -137,7 +136,7 @@ class PropertiesBatchEvaluationErrors message.append(" out of "); message.append(totalRowsNumber); message.append(" rows."); - + // construct a mapping between message line and failed rows List<String> errorMessageLines = new ArrayList<String>(); Map<String, List<Integer>> failedRows = new HashMap<String, List<Integer>>(); @@ -187,10 +186,10 @@ class PropertiesBatchEvaluationErrors for (ErrorDetail errDetail : sortErrorDetailsByRow()) { - message.append("\n\n"); + message.append("\n\n- "); message.append(formatRows(errDetail.rows)); appendErrorDetails(message, errDetail, true); - message.append(": "); + message.append(":\n"); StringWriter sw = new StringWriter(); errDetail.evaluationError.printStackTrace(new PrintWriter(sw)); message.append(sw.toString()); @@ -199,8 +198,9 @@ class PropertiesBatchEvaluationErrors return message.toString(); } - - private List<ErrorDetail> sortErrorDetailsByRow() { + + private List<ErrorDetail> sortErrorDetailsByRow() + { List<ErrorDetail> result = new ArrayList<ErrorDetail>(errorDetails.values()); Collections.sort(result, new Comparator<ErrorDetail>() { -- GitLab