KNOX-1349 - Fix Knox versioning for service defs. (UnitTest to be followed in next...
authorSandeep More <more@apache.org>
Fri, 8 Jun 2018 21:39:02 +0000 (17:39 -0400)
committerSandeep More <more@apache.org>
Fri, 8 Jun 2018 21:44:06 +0000 (17:44 -0400)
gateway-server/src/main/java/org/apache/knox/gateway/deploy/DeploymentFactory.java

index b3eabb2..285bb43 100644 (file)
@@ -557,7 +557,7 @@ public abstract class DeploymentFactory {
       }
       if ( versionMap != null && !versionMap.isEmpty()) {
         if( version == null ) {
-          contributor = ((TreeMap<Version, ServiceDeploymentContributor>) versionMap).firstEntry().getValue();
+          contributor = ((TreeMap<Version, ServiceDeploymentContributor>) versionMap).lastEntry().getValue();
         } else {
           contributor = versionMap.get( version );
         }