Commit Graph
10472 Commits
Author SHA1 Message Date
Adam Heath 6ccbf6362f Add UtilMisc.toSetArray, to mirror toListArray.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585697 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:58:05 +00:00
Adam Heath 46f7da9f56 Add utility methods that create writable copies of maps, lists, and
sets.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585696 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:57:09 +00:00
Adam Heath 2ac99fe7ff Add some varargs variants.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585695 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:53:50 +00:00
Adam Heath dac2c1bbc9 The java compiler in 1.5 and 1.6 is not as smart as it should be,
when it comes to inferring types for generics.  This class has
several helper methods, so that unnescessary warnings are only
issued for this file, and not every other file in the respository.
Once javac becomes smarter, than this class can be removed.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585690 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:51:21 +00:00
Adam Heath 401b4db0be Fix CCE in equals.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585686 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:46:20 +00:00
Adam Heath 2fcefefb8c More java 1.5 markup added for another set of base classes. Closes
https://issues.apache.org/jira/browse/OFBIZ-1341


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585683 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:44:11 +00:00
Adam Heath cc20789187 Java 1.5 feature usage; generics, enhanced-for, etc. Closes
https://issues.apache.org/jira/browse/OFBIZ-1331


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585681 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:41:01 +00:00
Adam Heath abd5c3b0d6 Used LinkedHashMap/LinkedHashSet, from collections 1.2, instead of
using local variants.  Deprecated OrderedMap/OrderedSet.  The filed
patch removed them, but that might break downstream code, so I'll
leave them in for now.  Closes
https://issues.apache.org/jira/browse/OFBIZ-1324


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585679 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:37:37 +00:00
Adam Heath f15d2f41d8 Add java 1.5 generics and enhanced-for to all UtilCache classes.
Closes https://issues.apache.org/jira/browse/OFBIZ-1306


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585673 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:33:02 +00:00
Adam Heath 92ebed76ba Fix compile error in last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585671 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:29:21 +00:00
Adam Heath d448302bc8 Don't use ObjectType.NULL for the in-memory table.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585670 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:27:50 +00:00
Adam Heath f82f88ff25 Switch to the new LRUMap implementation. Closes
https://issues.apache.org/jira/browse/OFBIZ-1305


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585669 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:25:56 +00:00
Adam Heath 2e31efd216 A java 1.5 LRU map implementation. Closes
https://issues.apache.org/jira/browse/OFBIZ-1304


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585668 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:23:08 +00:00
Adam Heath 05b48902f1 Forgot to add these for version 585661.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585667 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:19:51 +00:00
Adam Heath be4bf7ad16 CacheLineTable does not implement map; as such, there's no need to
return Object.  It's better to have it return CacheLine.  Closes
https://issues.apache.org/jira/browse/OFBIZ-1328


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585664 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:12:58 +00:00
Adam Heath ed0549624c Use sub-classes of CacheLine to manage hard/soft values. Closes
https://issues.apache.org/jira/browse/OFBIZ-1302


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585661 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:10:19 +00:00
Adam Heath bc6b4dc11a Switch all internal uses of StringBuffer over to StringBuilder; the
latter is unsynchronized, so is faster when there are no multi-
threaded concerns.  Closes
https://issues.apache.org/jira/browse/OFBIZ-1329


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585658 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:07:09 +00:00
Adam Heath fec1c8be69 Switch some base classes to FastMap. Closes
https://issues.apache.org/jira/browse/OFBIZ-1333


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585657 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:04:00 +00:00
Adam Heath 1a76c84a76 Add helper method for finding UtilCaches by name. Closes
https://issues.apache.org/jira/browse/OFBIZ-1301


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585656 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 20:00:49 +00:00
Adam Heath fdd427b037 Use auto-boxing/unboxing for default indices. Closes
https://issues.apache.org/jira/browse/OFBIZ-1299


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585654 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 19:58:25 +00:00
Adam Heath fa24abccba Creating a new Integer/Long, checking against null, then getting the
underlying value is an odd way to parse a string into a number.  It's
better to just call parseInt/parseLong.  Closes
https://issues.apache.org/jira/browse/OFBIZ-1300


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585653 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 19:56:32 +00:00
Adam Heath 78773e7215 The only public hasExpired method on UtilCache takes an Object; since
a CacheLine is passed, however, UtilCache never really finds the
correct value to check for expiration.  Closes
https://issues.apache.org/jira/browse/OFBIZ-1296


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585650 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 19:54:32 +00:00
Adam Heath 9490ed60f8 Move the hasExpired logic into CacheLine. Closes
https://issues.apache.org/jira/browse/OFBIZ-1295


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585647 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 19:52:19 +00:00
Adam Heath 397ea18a52 In clearInitialContext(), there's no reason to call get, then remove;
just call remove directly.  Closes
https://issues.apache.org/jira/browse/OFBIZ-1327


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585646 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 19:49:38 +00:00
Adam Heath 2a86a44888 Allow multiple files to be installed on the command line, by splitting
on comma.  Closes https://issues.apache.org/jira/browse/OFBIZ-1284


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585645 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 19:46:52 +00:00
Adam Heath 3eede5c55b Use FastMap/Map instead of Hashtable/Dictionary. Closes
https://issues.apache.org/jira/browse/OFBIZ-1326


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585644 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 19:43:55 +00:00
Adam Heath 25355eef63 Switch from LinkedMap to LinkedHashMap. Closes
https://issues.apache.org/jira/browse/OFBIZ-1334


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585641 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 19:42:06 +00:00
Adam Heath d3172979ca Use FastMap instead of HashMap. Closes
https://issues.apache.org/jira/browse/OFBIZ-1325


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585614 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 18:11:41 +00:00
Adam Heath 394a9508da Java 1.5 markup. Closes https://issues.apache.org/jira/browse/OFBIZ-1312
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585613 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 18:09:32 +00:00
Adam Heath bf5df1cc51 Use System.arraycopy to copy the loaderArgs array. Closes
https://issues.apache.org/jira/browse/OFBIZ-1309


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585612 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 18:07:29 +00:00
Adam Heath 9892eec19e Implement tri-state status management. The server status can now be
"Starting", "Running", or "Stopped".  I didn't implement "Stopping",
because it never was a problem for me.  Closes
https://issues.apache.org/jira/browse/OFBIZ-1297


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585607 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 17:56:23 +00:00
Adam Heath 478512ead6 Start the listener thread as soon as possible, so that the startup
status can be queried.  Before, it would be started very late in the
process, so it wasn't possible to see if java/ofbiz was actually
running.  Closes https://issues.apache.org/jira/browse/OFBIZ-1293


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585605 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 17:52:44 +00:00
Adam Heath 7ca8f182a6 Switch toString to StringBuilder, from StringBuffer. Closes
https://issues.apache.org/jira/browse/OFBIZ-1311


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585602 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 17:49:08 +00:00
Adam Heath 4e3a18d10a Use StringBuilder instead of string addition. Closes
https://issues.apache.org/jira/browse/OFBIZ-1339


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585600 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 17:47:11 +00:00
Adam Heath 1bf01bff57 Use ?: trinary for looking up NumberFormats. Closes
https://issues.apache.org/jira/browse/OFBIZ-1340


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585597 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 17:45:11 +00:00
Adam Heath c38212a6c3 Use Number.valueOf instead of new Number in simpleTypeConvert.
Closes https://issues.apache.org/jira/browse/OFBIZ-1337


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585596 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 17:40:55 +00:00
Adam Heath bcb983355d Make indexString use it's index variable(i), instead of always
using 0.  Closes: https://issues.apache.org/jira/browse/OFBIZ-1338


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585594 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 17:37:24 +00:00
Adam Heath 7197b591b8 Make addComponent(String) call addComponent(File). Closes
https://issues.apache.org/jira/browse/OFBIZ-1310


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585590 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 17:34:48 +00:00
Adam Heath cea96fee92 In simpleTypeConvert, where ever there was an if block that returned
TRUE/FALSE, they are now inlined, using ?:.  Closes
https://issues.apache.org/jira/browse/OFBIZ-1336,


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585589 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 17:32:47 +00:00
Adam Heath 3a0a201c34 Add internString(), which protects against NPE. Closes
https://issues.apache.org/jira/browse/OFBIZ-1307.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585578 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 17:12:17 +00:00
Adam Heath ddbcbed6d1 Remove was returning the *new* object, instead of the *old*. Closes
https://issues.apache.org/jira/browse/OFBIZ-1322.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585571 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 16:50:03 +00:00
Adam Heath 80398ba47a Don't use string addition in getMessage(), use a StringBuilder
instead.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585567 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 16:41:32 +00:00
Adam Heath fa3a837161 Implement the 2 other write variants, so that block-writing is
more efficient.  Closes https://issues.apache.org/jira/browse/OFBIZ-1323


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585557 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 16:26:45 +00:00
Adam Heath 69335961ab When sending a command to a running ofbiz instance, and waiting for
the response from the server, the socket is not ready; explicitly
checking for that will always fail.  This was the cause of the 'null'
messages during shutdown.  Applied patch from
 https://issues.apache.org/jira/browse/OFBIZ-1282 to fix the issue.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585526 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 14:53:07 +00:00
Adam Heath 1051352f0f Make all paths in these files relative; they no longer include
${ofbiz.home}.  Closes:
https://issues.apache.org/jira/browse/OFBIZ-1290.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585525 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 14:45:26 +00:00
Adam Heath 60d06ecee8 toString() would always append the first classpath element, for each
element in it's list; in other words, it wasn't using the loop index
variable i, but was using the constant 0 each time.  Closes:
https://issues.apache.org/jira/browse/OFBIZ-1308.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585523 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 14:39:12 +00:00
Adam Heath e481905579 getKeyFromMemory() wasn't incrementing currentIdx during the loop;
this means it would only ever be able to return the first key from
memory.  Resolves https://issues.apache.org/jira/browse/OFBIZ-1298.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585522 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 14:33:34 +00:00
Adam Heath bca4f0d9cf If a path in ofbiz-component.xml is not absolute, try to load the
sub-files relative to the location of the ofbiz-component.xml file.
This is from https://issues.apache.org/jira/browse/OFBIZ-1280.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585518 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 14:26:43 +00:00
Jacopo Cappellato e4723bd5b8 Fixed incorrect logic, introduced in rev. 584400, that was causing a problem in the main application bar: all the applications were visible to a user with the OFBTOOLS permission.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585432 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 10:00:52 +00:00
Jacopo Cappellato 449a91b728 Geo data for India. This is a modified version of the patch submitted by Vikash Anand in OFBIZ-1040
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585403 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 08:06:42 +00:00