Removed declaration of runtime exception
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
parent
8b52ba5d49
commit
583f3146fd
@ -116,8 +116,7 @@ public abstract class ParametrizedCommand extends Command {
|
||||
* @param flag the boolean flag
|
||||
* @throws InvalidParameterException if the parameter is already defined as a
|
||||
* string parameter */
|
||||
protected final void addBooleanParameter(final String flag)
|
||||
throws InvalidParameterException {
|
||||
protected final void addBooleanParameter(final String flag) {
|
||||
data.addBooleanParameter(flag);
|
||||
}
|
||||
|
||||
@ -127,8 +126,7 @@ public abstract class ParametrizedCommand extends Command {
|
||||
* @param needed if the parameter's absence should cause an exception
|
||||
* @throws InvalidParameterException if the parameter is already defined as a
|
||||
* boolean parameter */
|
||||
protected final void addStringParameter(final String flag, final boolean needed)
|
||||
throws InvalidParameterException {
|
||||
protected final void addStringParameter(final String flag, final boolean needed) {
|
||||
data.addStringParameter(flag, needed);
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ public final class ParametrizedCommandData {
|
||||
* @param flag the boolean flag
|
||||
* @throws InvalidParameterException if the parameter is already defined as a
|
||||
* string parameter */
|
||||
public void addBooleanParameter(final String flag) throws InvalidParameterException {
|
||||
public void addBooleanParameter(final String flag) {
|
||||
if (params.containsKey(flag) && stringParams.containsKey(flag)) {
|
||||
throw new InvalidParameterException("Parameter is already defined as string"); //$NON-NLS-1$
|
||||
}
|
||||
@ -134,8 +134,7 @@ public final class ParametrizedCommandData {
|
||||
* @param needed if the parameter's absence should cause an exception
|
||||
* @throws InvalidParameterException if the parameter is already defined as a
|
||||
* boolean parameter */
|
||||
public void addStringParameter(final String flag, final boolean needed)
|
||||
throws InvalidParameterException {
|
||||
public void addStringParameter(final String flag, final boolean needed) {
|
||||
if (params.containsKey(flag)) {
|
||||
checkParam(flag, needed);
|
||||
return;
|
||||
@ -149,9 +148,8 @@ public final class ParametrizedCommandData {
|
||||
* @param param the string parameter
|
||||
* @param needed if the parameter is needed
|
||||
* @throws InvalidParameterException if the new definition is invalid */
|
||||
private void checkParam(final String param, final boolean needed)
|
||||
throws InvalidParameterException {
|
||||
Boolean val = stringParams.get(param);
|
||||
private void checkParam(final String param, final boolean needed) {
|
||||
final Boolean val = stringParams.get(param);
|
||||
if (val != null) {
|
||||
final Boolean need = Boolean.valueOf(needed || val.booleanValue());
|
||||
stringParams.put(param, need);
|
||||
@ -217,7 +215,7 @@ public final class ParametrizedCommandData {
|
||||
* @param param the parameter name
|
||||
* @return if the parameter is needed */
|
||||
public boolean isNeeded(final String param) {
|
||||
Boolean val = params.get(param);
|
||||
final Boolean val = params.get(param);
|
||||
return val != null && val.booleanValue();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user