Okay, that's weird. I just realized my revert didn't revert anything.


Adrian Crum wrote:
I'm thinking about putting this back in. The Validate syntax seems kind of clunky to me. I despise re-inventing the wheel, but at the same time I liked my syntax better.

Using Validate:

public void myMethod(Object foo, Object bar) {
    Validate.notNull(foo);
    Validate.notNull(bar);
    // Throws NullPointerException "The validated object is null"
}

Using Assert:

public void myMethod(Object foo, Object bar) {
    Assert.argumentsNotNull("foo", foo, "bar", bar);
    // Throws IllegalArgumentException "foo (or bar) cannot be null"
}

Comments are welcome.

-Adrian

[email protected] wrote:
Author: adrianc
Date: Wed Apr 14 20:22:26 2010
New Revision: 934179

URL: http://svn.apache.org/viewvc?rev=934179&view=rev
Log:
Reverting my last commits. I just found out Apache Commons Validate does the same thing.

Removed:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/Assert.java
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/test/AssertTests.java
Modified:
    ofbiz/trunk/framework/base/build.xml

Modified: ofbiz/trunk/framework/base/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/build.xml?rev=934179&r1=934178&r2=934179&view=diff ==============================================================================
--- ofbiz/trunk/framework/base/build.xml (original)
+++ ofbiz/trunk/framework/base/build.xml Wed Apr 14 20:22:26 2010
@@ -41,7 +41,7 @@ under the License.
     </patternset>
<filelist id="test.classes" dir="${src.dir}">
-        <file name="org/ofbiz/base/util/test/AssertTests.java"/>
+        <!--
<file name="org/ofbiz/base/lang/test/ComparableRangeTests.java"/> <file name="org/ofbiz/base/util/test/IndentingWriterTests.java"/>
         <file name="org/ofbiz/base/util/test/ObjectTypeTests.java"/>
@@ -60,6 +60,7 @@ under the License.
<file name="org/ofbiz/base/concurrent/test/SyncTTLObjectTest.java"/> <file name="org/ofbiz/base/concurrent/test/AsyncTTLObjectTest.java"/> <file name="org/ofbiz/base/concurrent/test/TTLCachedObjectTest.java"/>
+        -->
     </filelist>
<target name="init">




Reply via email to