Commit Graph
1414 Commits
Author SHA1 Message Date
Michael Brohl 82b7386e3d Applied patch for OFBIZ-6621: MapContext.entrySet() slows down when ByteBuffer objects are in the context.
Introduces a private inner class ListSet representing a Set backed by a List instead of the HashSet implementation.

Thanks Gareth Carter for spotting this and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1703954 13f79535-47bb-0310-9956-ffa450edef68
2015-09-19 08:43:40 +00:00
Jacques Le Roux f98543b1ff A patch from Gaudin Pierre for "error in isValidEan util" https://issues.apache.org/jira/browse/OFBIZ-6624
There is an error in isValidEan util. It should be 12 and not 13 in the methods charAt and calcChecksum  because they start at 0.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1703586 13f79535-47bb-0310-9956-ffa450edef68
2015-09-17 12:05:19 +00:00
Adrian Crum 6066e4e42f Make primitive initialization explicit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1700864 13f79535-47bb-0310-9956-ffa450edef68
2015-09-02 18:43:41 +00:00
Adrian Crum 26198405b9 Added a FIXME comment. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1698406 13f79535-47bb-0310-9956-ffa450edef68
2015-08-28 20:26:01 +00:00
Jacques Le Roux 067df90ae1 After r1695126, I found that most of the Java files have svn:eol-style=native. So only 116 Java files were missing svn:eol-style=native. I guess those have been added by committers who are not using the OFBiz svn config file on their machines. So rather than removing svn:eol-style=native, this commits add the property to the files which miss it. Here 116+89=205 files have their svn:eol-style property changed to native.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1695129 13f79535-47bb-0310-9956-ffa450edef68
2015-08-10 16:33:23 +00:00
Jacques Le Roux dca48b0893 Reverts r1044202. No functional change.
This reverts svn:eol-style=native on Java files which were forced by r1044202n, 89 Java files are concerned. This commit hopefully makes things more consistent. 
It's indeed hard to see the impact of this change before it's committed. I'll check once done, I already found 116 Java files w/o svn:eol-style=native but there are 1231 Java files at all, so not sure how most are set...


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1695126 13f79535-47bb-0310-9956-ffa450edef68
2015-08-10 16:15:37 +00:00
Deepak Dixit cc7d7333c1 (OFBIZ-6562) Used getCombinedMap instead of getParameterMap while preparing param map for string-map-prefix. Now string-map-prefix will work fine in case of ajax call as well.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1693393 13f79535-47bb-0310-9956-ffa450edef68
2015-07-30 08:07:20 +00:00
Jacques Le Roux 1d9f55c71f A patch from Francis Douet for "streamContentToBrowser fails when the file name contains a comma, only with Chrome." https://issues.apache.org/jira/browse/OFBIZ-6554
streamContentToBrowser fails when the file name contains a comma, happens only with Google Chrome.
Can easily be reproduced for example by uploading the Logo Image URL of the default organization in the party manager, that includes a comma of course.
Fixed in my patch by wrapping the file name in quotes.
Error on the browser console:
GET https://localhost:8443/content/control/stream?contentId=10020 net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION

jleroux: at 1935.1 section of http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html I read this example << Content-Disposition: attachment; filename="fname.ext">> So Francis's solution is the right one

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1690086 13f79535-47bb-0310-9956-ffa450edef68
2015-07-09 12:30:22 +00:00
Jacopo Cappellato eb6d01b066 New implementation of the two-way cryptographic services of OFBiz based on Apache Shiro:
* two-way encryption is now delegated to Apache Shiro, with stronger initialization vectors
* the mechanism is backward compatible
* new tools to update the encryption of private keys, useful to upgrade older versions of OFBiz and most of all to replace old keys with new ones (this is critical to implement stronger security practices as requested by PCI) 
* unit tests



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1684608 13f79535-47bb-0310-9956-ffa450edef68
2015-06-10 09:01:30 +00:00
Adrian Crum a73c51bb49 Fix a thread-safety issue. Trivial unit test changes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1684216 13f79535-47bb-0310-9956-ffa450edef68
2015-06-08 16:12:30 +00:00
Jacques Le Roux af9ccf0c17 A patch from Taher Alkhateeb "Upgrade OFBiz to Java JDK 8" https://issues.apache.org/jira/browse/OFBIZ-6458
1st step: fixes a test which was not passing 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1684042 13f79535-47bb-0310-9956-ffa450edef68
2015-06-07 16:03:04 +00:00
Adrian Crum 240ba74d82 Replace ClassCastException with type check - https://issues.apache.org/jira/browse/OFBIZ-6291.
Ignoring a thrown ClassCastException is a common pattern in the project (one I have used myself), but it should be avoided in the future because it makes debugging difficult, plus it creates objects unnecessarily.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1680058 13f79535-47bb-0310-9956-ffa450edef68
2015-05-18 17:18:54 +00:00
Adrian Crum a84272b1ba Trivial code cleanup in ObjectType.java - no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1677386 13f79535-47bb-0310-9956-ffa450edef68
2015-05-03 11:25:08 +00:00
Adrian Crum ebf03ea721 Some work on ComponentContainer.java:
1. Improved thread safety
2. Optimization
3. Code cleanup
4. Use String constant instead of hard-coded value


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676985 13f79535-47bb-0310-9956-ffa450edef68
2015-04-30 13:46:46 +00:00
Adrian Crum d82005c958 Use String constant instead of hard-coded value.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676975 13f79535-47bb-0310-9956-ffa450edef68
2015-04-30 12:42:17 +00:00
Adrian Crum ec9d5d5416 Small fixup for my last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676974 13f79535-47bb-0310-9956-ffa450edef68
2015-04-30 12:41:26 +00:00
Adrian Crum ef710ed02f Some work on ComponentLoaderConfig.java:
1. Thread safety
2. Optimization
3. Code cleanup
4. Improved error handling

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676970 13f79535-47bb-0310-9956-ffa450edef68
2015-04-30 12:12:17 +00:00
Adrian Crum c2de699ca6 Fixed some bugs in startup code (https://issues.apache.org/jira/browse/OFBIZ-6268):
1. Class path loading was ignoring component settings, so class paths for disabled components were being loaded.
2. Configuration files were parsed twice.
3. Potential problem with unloading a loader that failed loading.

I was unable to test Cobertura because the necessary class (org.ofbiz.base.config.CoberturaInstrumenter) isn't being compiled for some reason.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676746 13f79535-47bb-0310-9956-ffa450edef68
2015-04-29 13:52:27 +00:00
Adrian Crum cd4f6cdbb3 Fixed a bug in UtilMisc.java where the List returned by the availableLocales() method included an empty Locale - causing errors in FreeMarker templates.
https://issues.apache.org/jira/browse/OFBIZ-6309

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676674 13f79535-47bb-0310-9956-ffa450edef68
2015-04-29 06:10:01 +00:00
Nicolas Malin 5f6c13b369 correct String conversion to Set on StringUtil that not respect the field order, thanks to Francis Douet to raise it on the issue (OFBIZ-6299 Field order is not correct in the auto-complete for look-ups.)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1675998 13f79535-47bb-0310-9956-ffa450edef68
2015-04-25 07:00:42 +00:00
Adrian Crum a2fc70daff A small change to the behavior of the UtilProperties.createProperties() method: if the file is not found, return null instead of throwing an exception.
https://issues.apache.org/jira/browse/OFBIZ-6261

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1674453 13f79535-47bb-0310-9956-ffa450edef68
2015-04-18 08:30:03 +00:00
Adrian Crum a1bb4ff6bc Fix warnings in trunk in Java source code - https://issues.apache.org/jira/browse/OFBIZ-6217.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1674064 13f79535-47bb-0310-9956-ffa450edef68
2015-04-16 13:05:55 +00:00
Adrian Crum f315f0d5be Fix warnings in trunk in Java source code - https://issues.apache.org/jira/browse/OFBIZ-6217.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1669537 13f79535-47bb-0310-9956-ffa450edef68
2015-03-27 10:04:14 +00:00
Deepak Dixit bdba71d230 OFBIZ-6183: Update ComponentConfig code to allow empty mount point, as if need to mount website on root then mount-point should be "" instead of "/".
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1668236 13f79535-47bb-0310-9956-ffa450edef68
2015-03-21 11:14:55 +00:00
Jacopo Cappellato f69e599355 Upgrade to latest bug fix release of Freemarker: 2.3.22
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1666949 13f79535-47bb-0310-9956-ffa450edef68
2015-03-16 10:31:13 +00:00
Jacopo Cappellato 34beacd425 Relaxing default behavior of canonicalization in order to allow mixed and multiple encodings: with this change, in these cases, instead of throwing an error it will simply log a worning message.
This should fix, at least as a temporary solution, the recent issues happening after the upgrade to the new ESAPI.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1659224 13f79535-47bb-0310-9956-ffa450edef68
2015-02-12 11:17:46 +00:00
Adrian Crum 14e3b15252 Some small fixups for some of my previous commits.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1650347 13f79535-47bb-0310-9956-ffa450edef68
2015-01-08 17:53:59 +00:00
Adrian Crum 7c9aa8e489 Some optimizations for URL lookups.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649979 13f79535-47bb-0310-9956-ffa450edef68
2015-01-07 00:24:28 +00:00
Adrian Crum b85eb53598 Removed an unused method from UtilURL.java, added some JavaDocs.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649971 13f79535-47bb-0310-9956-ffa450edef68
2015-01-06 23:22:56 +00:00
Adrian Crum 1df97ce20c Fixed a bug in FlexibleLocation.java where the optional locationresolvers.properties file was not being loaded due to static initializer recursion.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649934 13f79535-47bb-0310-9956-ffa450edef68
2015-01-06 20:21:28 +00:00
Adrian Crum c201d5f6f3 Small change to Debug.java - to avoid static initializer recursion.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649933 13f79535-47bb-0310-9956-ffa450edef68
2015-01-06 20:19:56 +00:00
Adrian Crum 38c358671f A new method for UtilProperties.java - to be used in upcoming changes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649931 13f79535-47bb-0310-9956-ffa450edef68
2015-01-06 20:18:43 +00:00
Adrian Crum b20c4adfbc Make sure InputStream is closed.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649701 13f79535-47bb-0310-9956-ffa450edef68
2015-01-06 01:05:29 +00:00
Adrian Crum a02828a34e Improvement: Remove unnecessary resource check from UtilURL.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649696 13f79535-47bb-0310-9956-ffa450edef68
2015-01-05 23:58:06 +00:00
Adrian Crum ffc11dc5a3 Some code cleanup in UtilProperties.java:
1. Removed redundant cache.
2. Removed unnecessary synchronized block.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649686 13f79535-47bb-0310-9956-ffa450edef68
2015-01-05 22:54:42 +00:00
Adrian Crum 184fe56ac1 Improvement: Enable XML validation for properties files.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649675 13f79535-47bb-0310-9956-ffa450edef68
2015-01-05 21:46:54 +00:00
Adrian Crum e64fbd6c9f Improvement: Replace library-specific concrete class with library-agnostic factory method call in UtilXml.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649674 13f79535-47bb-0310-9956-ffa450edef68
2015-01-05 21:43:46 +00:00
Adrian Crum 66adcd9de2 Fix Web Tools FindGeneric screen so it can display byte-array field types.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649615 13f79535-47bb-0310-9956-ffa450edef68
2015-01-05 19:15:24 +00:00
Ashish Vijaywargiya cbbdc011d3 Applied patch from jira issue - OFBIZ-3464 - Added check if the creditcard number string is numeric in validation method isCreditcard in UtilValidate.
Thanks Nils for creating the issue and providing the patch for the same. Thanks Divesh for your help in verification. 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649393 13f79535-47bb-0310-9956-ffa450edef68
2015-01-04 19:53:29 +00:00
Jacopo Cappellato 9ce782f90b Removed a bunch of dependencies of Owasp Esapi classes after I realized (by studying the Esapi source files and the integration in OFBiz) that we were using a small part of that product; this made it possible to upgrade to the latest release of Owasp Esapi (2.1.0) without having to include a bunch of jars.
I had to comment out two lines in the unit tests because they were failing after the upgrade; still investigating on this.
This commit resolves OFBIZ-5343.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648747 13f79535-47bb-0310-9956-ffa450edef68
2014-12-31 17:31:16 +00:00
Jacopo Cappellato a5879b6f8f Moved code dependent on OWASP ESAPI and utilities for codec tasks from StringUtil to a new UtilCodec class: now the UtilCodec class is the only class dependent on OWASP ESAPI.
The DefaultEncoder from OWASP ESAPI, used internally by UtilCodec is now built with the default constructor that also adds the JavascriptCodec to the list of codecs used to canonicalize and validate the input.
Renamed the UrlEncoder class to UrlCodec in order to better describe its behavior.
Misc minor cleanups.
Added to the list of tests of the base component a series of Junit test classes that were missing.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648403 13f79535-47bb-0310-9956-ffa450edef68
2014-12-29 18:24:57 +00:00
Jacopo Cappellato b969e376ed A series of cleanup to the integration with OWASP ESAPI. Isolated dependencies on the external OWASP ESAPI jar into the StringUtil class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648298 13f79535-47bb-0310-9956-ffa450edef68
2014-12-29 09:24:46 +00:00
Adrian Crum 5f231ec005 Fixed a NPE I introduced in rev 1647606. Reported by Pierre Smits on dev mailing list.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648139 13f79535-47bb-0310-9956-ffa450edef68
2014-12-28 00:58:44 +00:00
Adrian Crum 9be5ed5e06 UtilMisc.java improvements:
1. Replace DCL code with lazy-initializer class.
2. Small code cleanup.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647873 13f79535-47bb-0310-9956-ffa450edef68
2014-12-25 05:41:13 +00:00
Adrian Crum fc86aee024 UtilProperties.java improvements:
1. Replace DCL code with lazy-initializer class.
2. Remove class name from static method calls.
3. Remove some @Deprecated annotations.

When they were written, the deprecated methods simulated forthcoming Java 6 functionality - with the intent that they would be replaced with Java 6 equivalents, but the Java 6 functionality behaves differently than the deprecated methods. So, replacing the deprecated methods with Java 6 equivalents would cause undesired behavior.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647866 13f79535-47bb-0310-9956-ffa450edef68
2014-12-25 00:45:18 +00:00
Adrian Crum 06b7bcbb8b UtilDateTime.java improvements:
1. Replace DCL code with lazy-initializer class.
2. Remove class name from static method calls.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647861 13f79535-47bb-0310-9956-ffa450edef68
2014-12-24 23:37:06 +00:00
Adrian Crum 6731e764ef Bug fix: Make DateRange.java truly immutable.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647839 13f79535-47bb-0310-9956-ffa450edef68
2014-12-24 20:21:46 +00:00
Adrian Crum 209a0261fb Remove references to immutability from ComparableRange.java - because its contained objects might be mutable.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647838 13f79535-47bb-0310-9956-ffa450edef68
2014-12-24 20:19:42 +00:00
Adrian Crum 7aa7ea5769 Fixed a bug in UtilDateTime.java where SimpleDateFormat instances were not initialized with the locale.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647606 13f79535-47bb-0310-9956-ffa450edef68
2014-12-23 16:21:14 +00:00
Jacopo Cappellato 4384b31ed9 Removed two unnecessary overloaded methods.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647289 13f79535-47bb-0310-9956-ffa450edef68
2014-12-22 11:08:07 +00:00