From c2910ac85a86e2638260090fdaf48ef517c7f2c6 Mon Sep 17 00:00:00 2001 From: felmer <felmer> Date: Tue, 27 Nov 2007 16:13:36 +0000 Subject: [PATCH] Code review SVN: 2841 --- .../ch/systemsx/cisd/common/parser/IPropertiesSetter.java | 4 ++-- .../cisd/common/parser/PropertiesParserObjectFactory.java | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/common/source/java/ch/systemsx/cisd/common/parser/IPropertiesSetter.java b/common/source/java/ch/systemsx/cisd/common/parser/IPropertiesSetter.java index 7d069e62539..07f01e3a797 100644 --- a/common/source/java/ch/systemsx/cisd/common/parser/IPropertiesSetter.java +++ b/common/source/java/ch/systemsx/cisd/common/parser/IPropertiesSetter.java @@ -21,10 +21,10 @@ package ch.systemsx.cisd.common.parser; * * @author Tomasz Pylak on Oct 29, 2007 */ -public interface IPropertiesSetter<ConstructedType> +public interface IPropertiesSetter<T> { void setProperty(String name, String valueOrNull); /** returns constructed object, called after setting properties values */ - ConstructedType done(); + T getConstructedObject(); } \ No newline at end of file diff --git a/common/source/java/ch/systemsx/cisd/common/parser/PropertiesParserObjectFactory.java b/common/source/java/ch/systemsx/cisd/common/parser/PropertiesParserObjectFactory.java index f9d218e2a51..8553894ef41 100644 --- a/common/source/java/ch/systemsx/cisd/common/parser/PropertiesParserObjectFactory.java +++ b/common/source/java/ch/systemsx/cisd/common/parser/PropertiesParserObjectFactory.java @@ -48,7 +48,7 @@ public class PropertiesParserObjectFactory<E> implements IParserObjectFactory<E> String propertyValue = getPropertyValue(lineTokens, propertyModel); setter.setProperty(name, propertyValue); } - return setter.done(); + return setter.getConstructedObject(); } private String getPropertyValue(final String[] lineTokens, final IPropertyModel propertyModel) @@ -56,8 +56,10 @@ public class PropertiesParserObjectFactory<E> implements IParserObjectFactory<E> int column = propertyModel.getColumn(); if (column >= lineTokens.length) { - throw UserFailureException.fromTemplate("Value for column '%s' cannot be found in line '%s'", propertyModel - .getName(), merge(lineTokens)); + String name = propertyModel.getName(); + String mergedTokens = merge(lineTokens); + throw UserFailureException.fromTemplate("Value for column '%s' cannot be found in line '%s'", name, + mergedTokens); } return lineTokens[column]; } -- GitLab