The xsd for the resource xml files is invalid. In addition, the format of the value of the xml:lang attribute in resource xml files is invalid, according to the xml standard.
The attached patch:
provides a valid xsd
updates UtilProperties and the Label Manager to deal with the correct formatting of the xml:lang value, while still working with the old format, following Adrian Crum's recommendation on the mailing list
includes simple unit tests for UtilProperties to ensure it does work with both formats
changes the Label Manager to include a reference to the new xsd, and to use the correct format of the xml:lang value, when writing a resource xml file.
Some minor code cleanups to these files.
jleroux: the base test suite was successfully run locally once UtilIOTests have been commented out (still an issue with it on Windows)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1305004 13f79535-47bb-0310-9956-ffa450edef68
The xsd for the resource xml files is invalid. In addition, the format of the value of the xml:lang attribute in resource xml files is invalid, according to the xml standard.
The attached patch:
provides a valid xsd
updates UtilProperties and the Label Manager to deal with the correct formatting of the xml:lang value, while still working with the old format, following Adrian Crum's recommendation on the mailing list
includes simple unit tests for UtilProperties to ensure it does work with both formats
changes the Label Manager to include a reference to the new xsd, and to use the correct format of the xml:lang value, when writing a resource xml file.
Some minor code cleanups to these files.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1304193 13f79535-47bb-0310-9956-ffa450edef68
Similarly to Groovy services, the Groovy Events Handler sets the base script class containing helper methods; these helper methods have been enhanced in order to be used by groovy method executed as services or events in a transparent way.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1298908 13f79535-47bb-0310-9956-ffa450edef68
The engine comes from http://java.net/projects/scripting. I had to modify the code slightly because the BshScriptEngine class implemented Compilable - but the Compilable methods were not implemented. So I removed implements Compilable. I renamed the jar to signify that the code has been modified.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1297478 13f79535-47bb-0310-9956-ffa450edef68
In particular these chenges should make it easier to implement JSR-223 (even if I think that we should still treat Groovy in a special way).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1296762 13f79535-47bb-0310-9956-ffa450edef68
Deserialization of arrays with UtilObject.getObject() throws a ClassNotFoundException. This happened to us when we enabled the distributed cache clear feature and it was sending arrays of EntityExpr objects to other OFBiz instances.
The reason is, that the org.ofbiz.base.util.ObjectInputStream calls classLoader.loadClass(name) directly instead of using Class.forName(name, init, classLoader).
According to java bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6446627 ClassLoader.loadClass() is not intended to being used this way and doesn't support loading arrays.
jleroux: Sun/Oracle is pretty clear about that <<[When you want to reflectively load a class by name initiated using a specific class loader, you should not invoke that loader's public loadClass method directly-- instead, you should always use the static three-argument Class.forName method. The ClassLoader.loadClass instance method is more intended for delegation from one class loader to another within a class loading operation (although this is a common confusion and not well described in the documentation). In other words, replace L.loadClass(N) with Class.forName(N,false,L). The Class.forName invocation may eventually end up invoking loadClass on the specified loader, but only after taking care of some other aspects of the VM's standard symbolic class name resolution process-- the significant bit in this case being the support for loading/creation of array classes.]>> More at the link above
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1226223 13f79535-47bb-0310-9956-ffa450edef68
Fortunately, on my side, it was an easy fix: I just forgot to re-add the old strToMap(String str, boolean trim) signature.
So here it is
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1212749 13f79535-47bb-0310-9956-ffa450edef68
We have observed the same issue in past and provided a patch for the same. For more details please refer the commit r995384.
Fixing bug of reading node name. When we read first child element of the response of any third party integration for example ups etc, node name can't be read using "node.getLocalName()". So changing node.getLocalName() --> node.getNodeName().
This time before I revert my changes I will wait for Bilgin's comment to understand the exact problem with SOAP call due to which he did this changes. Bilgin please post your comment on this as soon as you get a chance.
http://svn.apache.org/viewvc?view=revision&revision=894359
Thanks Kiran, Sascha for the contribution. We were also observing this issue since quite long so for now it is better to put the code in trunk and releasebranch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1183314 13f79535-47bb-0310-9956-ffa450edef68
String[] temp = (String[]) foo.toArray(); <-- may cause class cast exception it is better to use: String[] temp = foo.toArray(new String[foo.size()])
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1173607 13f79535-47bb-0310-9956-ffa450edef68
Some value assignments to local variables without reading or using it.
jleroux: indeed I don't see any reasons to set the size of a byte array before feeding it with String.getBytes(), since NPE is handled above. I have even simplified it more using function composition style.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1172015 13f79535-47bb-0310-9956-ffa450edef68
ShoppingCart.java: a tabs has been automatically replaced by 8 spaces, fixes it
UtilValidate.java: removes useless parentheses
GeneriDao.java: fixes a wrong UtilValidate.isNotEmpty
ModelFormField.java: revert all UtilValidate.is(Not)Empty() changes though I ddid not find an error there, it must be one because https://localhost:8443/humanres/control/EditResponsibilityTypes is not rendered correctly. I will check again
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1169754 13f79535-47bb-0310-9956-ffa450edef68
Changes implementation of UtilValidate.isEmpty() for Collection and Map by using isEmpty() instead of c.size() == 0). It's more clear and as efficient. Removes also useless parentheses there.
Makes use of UtilValidate.is(Not)Empty() everywhere it makes senses. This for 2 reasons:
* Make the code more readable by replacing the (!)null/isEmpty pattern.
* Avoid possible NPEs when only isEmpty() was used (after Entity.find... for instance). I found a lot of cases (242 today) where isEmpty() could perhaps be replaced in Framework. But I guess no NPE checks were missing there and anyway it was too much for me to check them all... So I only did the relevant changes in Applications...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1169478 13f79535-47bb-0310-9956-ffa450edef68
Actually I hastily did it bad using static instead of caching. Anyway, I checked there are no real needs to change current code in OFBiz for perf.: one instance is in an exception and the other not called OOTB...
Was: Closes https://issues.apache.org/jira/browse/OFBIZ-4201
"DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance"
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1165084 13f79535-47bb-0310-9956-ffa450edef68
"DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance"
jlr: It's not really cache but a static class constant
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1165076 13f79535-47bb-0310-9956-ffa450edef68