Author: jdillon
Date: Sat Mar 3 15:42:12 2007
New Revision: 514276
URL: http://svn.apache.org/viewvc?view=rev&rev=514276
Log:
Use assert instead of if/throw
Modified:
geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/ExpressionParser.java
Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/ExpressionParser.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/ExpressionParser.java?view=diff&rev=514276&r1=514275&r2=514276
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/ExpressionParser.java
(original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/ExpressionParser.java
Sat Mar 3 15:42:12 2007
@@ -38,9 +38,7 @@
protected JexlContext context;
public ExpressionParser(final Map vars) {
- if (vars == null) {
- throw new IllegalArgumentException("vars");
- }
+ assert vars != null;
context = JexlHelper.createContext();
context.setVars(vars);
@@ -59,33 +57,25 @@
}
public Object getVariable(final Object name) {
- if (name == null) {
- throw new IllegalArgumentException("name");
- }
+ assert name != null;
return getVariables().get(name);
}
public Object setVariable(final Object name, final Object value) {
- if (name == null) {
- throw new IllegalArgumentException("name");
- }
+ assert name != null;
return getVariables().put(name, value);
}
public Object unsetVariable(final Object name) {
- if (name == null) {
- throw new IllegalArgumentException("name");
- }
+ assert name != null;
return getVariables().remove(name);
}
public void addVariables(final Map map) {
- if (map == null) {
- throw new IllegalArgumentException("map");
- }
+ assert map != null;
getVariables().putAll(map);
}
@@ -102,9 +92,7 @@
}
public Object evaluate(final String expression) throws Exception {
- if (expression == null) {
- throw new IllegalArgumentException("expression");
- }
+ assert expression != null;
boolean trace = log.isTraceEnabled();
if (trace) {
@@ -121,9 +109,7 @@
}
public String parse(final String input) {
- if (input == null) {
- throw new IllegalArgumentException("input");
- }
+ assert input != null;
boolean trace = log.isTraceEnabled();
if (trace) {
|