You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jl...@apache.org on 2016/12/03 16:56:13 UTC

[19/50] tomee git commit: backporting resource ordering bck compatibility

backporting resource ordering bck compatibility


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/4f00d26e
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/4f00d26e
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/4f00d26e

Branch: refs/heads/tomee-1.7.x
Commit: 4f00d26e4cea0f81b7db469b74bc8b8c7cc70bf1
Parents: 7ec80b9
Author: Romain manni-Bucau <rm...@gmail.com>
Authored: Tue Jul 12 10:06:59 2016 +0200
Committer: Romain manni-Bucau <rm...@gmail.com>
Committed: Tue Jul 12 10:07:28 2016 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/openejb/config/AutoConfig.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/4f00d26e/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java b/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
index d850fa9..23e9a08 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
@@ -2020,15 +2020,15 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
         Collections.sort(resourceIds, new Comparator<String>() { // sort from webapp to global resources
             @Override
             public int compare(final String o1, final String o2) { // don't change global order, just put app scoped resource before others
-                  if (o1.startsWith(prefix) && o2.startsWith(prefix)) {
+                if (o1.startsWith(prefix) && o2.startsWith(prefix)) {
                     return resourceIds.indexOf(o1) - resourceIds.indexOf(o2);
                 } else if (o1.startsWith(prefix)) {
                     return -1;
                 } else if (o2.startsWith(prefix)) {
                     return 1;
-                } else {
-                    return resourceIds.indexOf(o2) - resourceIds.indexOf(o1);
                 }
+                // make it stable with prefixed comparison + keep existing ordering (bck compat)
+                return resourceIds.indexOf(o1) - resourceIds.indexOf(o2);
             }
         });
         String idd = null;