Hi Adrian, In JDK 8 the HashMap does not respect order of insertion. I explained this bug earlier in detail. Please take a look at what i wrote and you will see why it is now a linkedhashmap.
Taher Alkhateeb On Jun 8, 2015 5:52 PM, "Adrian Crum" <[email protected]> wrote: > This commit does not make sense and it is unnecessary. Please revert it. > > Adrian Crum > Sandglass Software > www.sandglass-software.com > > On 6/7/2015 9:03 AM, [email protected] wrote: > >> Author: jleroux >> Date: Sun Jun 7 16:03:04 2015 >> New Revision: 1684042 >> >> URL: http://svn.apache.org/r1684042 >> Log: >> 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 >> >> Modified: >> ofbiz/trunk/framework/base/src/org/ofbiz/base/util/StringUtil.java >> >> Modified: >> ofbiz/trunk/framework/base/src/org/ofbiz/base/util/StringUtil.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/StringUtil.java?rev=1684042&r1=1684041&r2=1684042&view=diff >> >> ============================================================================== >> --- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/StringUtil.java >> (original) >> +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/StringUtil.java >> Sun Jun 7 16:03:04 2015 >> @@ -24,6 +24,7 @@ import java.net.URLEncoder; >> import java.util.Collection; >> import java.util.HashMap; >> import java.util.Iterator; >> +import java.util.LinkedHashMap; >> import java.util.LinkedHashSet; >> import java.util.LinkedList; >> import java.util.List; >> @@ -48,7 +49,7 @@ public class StringUtil { >> protected static final Map<String, Pattern> substitutionPatternMap; >> >> static { >> - substitutionPatternMap = new HashMap<String, Pattern>(); >> + substitutionPatternMap = new LinkedHashMap<String, Pattern>(); >> substitutionPatternMap.put("&&", Pattern.compile("@and", >> Pattern.LITERAL)); >> substitutionPatternMap.put("||", Pattern.compile("@or", >> Pattern.LITERAL)); >> substitutionPatternMap.put("<=", Pattern.compile("@lteq", >> Pattern.LITERAL)); >> >> >>
