Skip to content

Commit

Permalink
petalslink#24 Correct usage of VariableUnsupportedTypeException
Browse files Browse the repository at this point in the history
  • Loading branch information
glaplace committed May 11, 2021
1 parent a70319e commit cdb1412
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/**
* Copyright (c) 2019-2021 Linagora
*
*
* This program/library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or (at your
* option) any later version.
*
*
* This program/library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program/library; If not, see http://www.gnu.org/licenses/
* for the GNU Lesser General Public License version 2.1.
Expand Down Expand Up @@ -41,14 +41,14 @@

/**
* Variable definition used as an internal model of a variable.
*
*
* @author Christophe DENEUX - Linagora
*
*/
public class VariableDefinition {

private final String name;

private final XPathExpression xpathExprValue;

private Templates preXmlTransformation;
Expand Down Expand Up @@ -174,7 +174,7 @@ public void setPreXmlTranformationResultJson(final boolean isPreXmlTranformation

/**
* Return the Flowable variable value in the right format according to its type
*
*
* @param stringValue
* The Flowable varaible value as {@link String} to convert in the right type
* @throws VariableException
Expand Down Expand Up @@ -224,12 +224,12 @@ private Object convert(final String variableValueAsStr) throws VariableException
} else if (this.type.equals("json")) {
return Boolean.valueOf(variableValueAsStr);
} else {
throw new VariableUnsupportedTypeException(this.type, this.name);
throw new VariableUnsupportedTypeException(this.name, this.type);
}
}

/**
*
*
* @param incomingPayload
* @param emptyVariableValueLogger
* A callback logger to log message about an empty value extracted
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/**
* Copyright (c) 2019-2021 Linagora
*
*
* This program/library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or (at your
* option) any later version.
*
*
* This program/library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program/library; If not, see http://www.gnu.org/licenses/
* for the GNU Lesser General Public License version 2.1.
Expand All @@ -28,7 +28,7 @@

/**
* Abstract variable implementation.
*
*
* @author Christophe DENEUX - Linagora
*
*/
Expand All @@ -40,7 +40,7 @@ private VariableImplBuilder() {

/**
* Builds a {@link VariableImpl} from its {@link VariableDefinition}.
*
*
* @param variable
* The variable definition. Not {@code null}.
* @return The variable implementation
Expand Down Expand Up @@ -74,13 +74,13 @@ public static final VariableImpl build(final VariableDefinition variable, final
variable.getNamespaceMappings(),
jacksonObjectMapper, logger);
} else {
throw new VariableUnsupportedTypeException(variable.getType(), variable.getName());
throw new VariableUnsupportedTypeException(variable.getName(), variable.getType());
}
}

/**
* Builds a list of {@link VariableImpl} from a list of {@link VariableDefinition}.
*
*
* @param variables
* The variable definitions. Not {@code null}.
* @return The variable implementations
Expand Down

0 comments on commit cdb1412

Please sign in to comment.