Commit Graph
740 Commits
Author SHA1 Message Date
Adam Heath fb997ed8e9 If there is no ${, then don't create a list just to add a single item to
it.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@912284 13f79535-47bb-0310-9956-ffa450edef68
2010-02-21 01:33:44 +00:00
Adam Heath e2712b8a9e BUG FIX: Fix getOriginal and toString, to return the unparsed version.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@912283 13f79535-47bb-0310-9956-ffa450edef68
2010-02-21 01:33:12 +00:00
Adam Heath 15876ae52d Add variant of getInstance that allows the caching to be skipped.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@912282 13f79535-47bb-0310-9956-ffa450edef68
2010-02-21 01:32:39 +00:00
Adam Heath 34d06a62c1 BUG FIX: Fix parsing of currency when there is no variable, and no
trailing ).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@912281 13f79535-47bb-0310-9956-ffa450edef68
2010-02-21 01:32:00 +00:00
Adam Heath cadd966d80 BUG FIX: Fix parsing of currency, by using the correct subExpression,
instead of the entire parent expression.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@912280 13f79535-47bb-0310-9956-ffa450edef68
2010-02-21 01:31:30 +00:00
Adam Heath 60765d55f4 Lots and lots of tests for FSE; not 100% coverage, there are some bugs
that need to be fixed.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@912279 13f79535-47bb-0310-9956-ffa450edef68
2010-02-21 01:30:59 +00:00
Adam Heath 9a104c6b8d BUG FIX: During static expansion, if the context was null, then the
passed expression would be returned.  This is not what would occur if
you called getInstance(null), as that always returns an FSE that expands
to "".  So, fix static expansion to return "" if the expression is null.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@912278 13f79535-47bb-0310-9956-ffa450edef68
2010-02-21 01:30:27 +00:00
Adam Heath 2f952125f2 Move the testMap assignments to the beginning of the method.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@912277 13f79535-47bb-0310-9956-ffa450edef68
2010-02-21 01:29:57 +00:00
Adam Heath ada3f15e23 Extend fseTest to check isEmpty.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@912276 13f79535-47bb-0310-9956-ffa450edef68
2010-02-21 01:29:29 +00:00
Adam Heath a06cf78184 Create an fseTest helper method.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@912275 13f79535-47bb-0310-9956-ffa450edef68
2010-02-21 01:29:02 +00:00
Adam Heath edf6b0952a Remove local compare object.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@912274 13f79535-47bb-0310-9956-ffa450edef68
2010-02-21 01:28:27 +00:00
Adam Heath 0f4bed043d Switch assertTrue calls to assertEquals.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@912273 13f79535-47bb-0310-9956-ffa450edef68
2010-02-21 01:28:00 +00:00
Adam Heath f7ec7cb185 Move FlexibleStringExpander tests to a separate file.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@912272 13f79535-47bb-0310-9956-ffa450edef68
2010-02-21 01:27:32 +00:00
Adrian Crum 96fb7950ad Added a test for TimeDuration pre-epoch elapsed time, plus added SVN properties.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911182 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 21:40:41 +00:00
Adrian Crum b0d8ce0ebf Improved TimeDuration.java JavaDocs.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911181 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 21:38:13 +00:00
Adrian Crum aa1eb37875 Changed parameter name and JavaDoc for the TimeDuration fromLong method. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911131 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 18:16:55 +00:00
Adrian Crum 276a0b2f6d Fixed catch clause in TimeDuration equals method.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911125 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 18:00:56 +00:00
Adam Heath 4c6bee67d5 Add support for arrays to doHashCode.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911099 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:29:41 +00:00
Adam Heath fb9b6107e6 Add comments about unreachable blocks.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911098 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:28:18 +00:00
Adam Heath 11b69ae10a Test for static helper pattern.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911097 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:27:48 +00:00
Adam Heath 0c3320bfe3 Add assertion helper to verify that a class is a static helper.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911096 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:26:53 +00:00
Adam Heath acc29cc257 Follow the static helper class pattern.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911095 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:26:16 +00:00
Adam Heath 151a9dbc1a Refactored the object serialization methods to not have to test for null
as much.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911093 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:25:43 +00:00
Adam Heath e0eb9976f6 Some tests for UtilObject; not full coverage, but very close.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911092 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:25:09 +00:00
Adam Heath a3191bd5c0 Helper method for testing compareTo results.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911090 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:24:22 +00:00
Adam Heath b6c4fc80a9 Rename millis parameters everywhere to milliseconds. Also rename the
millis method.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911089 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:23:39 +00:00
Adam Heath 0f004e41d5 Remove calls to toLong in compareTo.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911088 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:23:07 +00:00
Adam Heath f5d3f7cec4 Remove isNegative field.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911087 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:22:33 +00:00
Adam Heath 33174cf039 The fields in TimeDuration are now final.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911086 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:22:07 +00:00
Adam Heath 0e65841e71 Remove makeNegative calls.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911085 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:21:39 +00:00
Adam Heath afe6cde3af Switch fromLong to use the 7-arg constructor, instead of setting each
field directly.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911084 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:20:57 +00:00
Adam Heath 122abb4afe Don't need to set default values for variables.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911083 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:20:31 +00:00
Adam Heath 8a71e50c8b Move the calendar helper methods to right after the constructor.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911082 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:20:04 +00:00
Adam Heath 8285aad542 Make calendar constructor helper methods private static.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911081 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:19:31 +00:00
Adam Heath 6eea736c18 Inline set(Calendar, Calendar) into the constructor.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911080 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:18:31 +00:00
Adrian Crum 6134cdd88b Fixed a bug in TimeDuration.java reported by Adam Heath on the dev mailing list. The elapsed time constructor would produce an incorrect duration if either Calendar was prior to the epoch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911054 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 16:25:55 +00:00
Adam Heath 17a5647902 A rather complex fix for dealing with calendar dates that have a DAY
value that is in the special window of 29-31.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910830 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 05:18:27 +00:00
Adam Heath d24e18f72c Fix parsing of trailing empty components in TimeDuration string values.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910829 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 05:17:37 +00:00
Adam Heath 66d451e590 In isZero(), remove useless check for this == ZeroTimeDuration, as the
latter overrides the isZero method, so the comparison never succeeds.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910828 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 05:16:48 +00:00
Adam Heath 2feee8bec9 Add TimeDurationTests; full line coverage, almost full branch coverage.
There are some bugs not fixed by this commit, those will come shortly.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910827 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 05:15:59 +00:00
Adrian Crum 690df1644b Fixed misspelling in conversion framework - no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910367 13f79535-47bb-0310-9956-ffa450edef68
2010-02-16 00:10:36 +00:00
Adam Heath 679342925f Add more DateTime conversion tests.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910357 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 22:25:33 +00:00
Adam Heath c9099d5741 Explicitly test the canConvert method on each converter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910356 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 22:24:54 +00:00
Adam Heath b75fb11cb2 Refactored the DateTime conversion tests.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910355 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 22:24:27 +00:00
Adam Heath 3e476eedcd Move DateTime conversion tests to separate class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910354 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 22:23:55 +00:00
Adam Heath 1f90f3dfd3 Fix errors and warnings with the JSON grammar.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910353 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 22:23:15 +00:00
Adam Heath 95ba1bdffd s/Hex onversions/Hex conversions/
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910352 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 22:22:45 +00:00
Adrian Crum 341526dd5a Cleaned up imports in the conversion framework.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910241 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 15:52:10 +00:00
Adam Heath 035e852ef7 Make PassThruConverterCreater function like NullConverter, which handles
any class to Object conversion, and also handles FooObject ->
FooInterface.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910167 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 07:16:51 +00:00
Adam Heath 5da12fa6cd Move all JSON converters to a separate class, change the collection
converters that used to use JSON back to calling toString, and implement
separate JSON conversion.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910112 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:44:39 +00:00