diff --git a/pom.xml b/pom.xml index ecc15b7adb..e13d6edd3a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.alfresco alfresco-super-pom - 9 + 10 alfresco-data-model @@ -31,7 +31,7 @@ - 7.4 + 7.5 diff --git a/src/main/java/org/alfresco/util/BaseApplicationContextHelper.java b/src/main/java/org/alfresco/util/BaseApplicationContextHelper.java index a6dcb44609..1666a33e69 100644 --- a/src/main/java/org/alfresco/util/BaseApplicationContextHelper.java +++ b/src/main/java/org/alfresco/util/BaseApplicationContextHelper.java @@ -32,6 +32,7 @@ import java.util.Arrays; import java.util.Enumeration; import java.util.LinkedList; import java.util.List; +import java.util.NoSuchElementException; import org.springframework.beans.BeansException; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; @@ -42,8 +43,6 @@ import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; import org.springframework.web.context.support.ServletContextResourcePatternResolver; -import sun.misc.CompoundEnumeration; - /** * Helper class to provide static and common access to the Spring * {@link org.springframework.context.ApplicationContext application context}. @@ -302,3 +301,37 @@ public abstract class BaseApplicationContextHelper } } } + +/* + * A utility class that will enumerate over an array of enumerations. + * was removed in version JDK 1.9 + */ +final class CompoundEnumeration implements Enumeration { + private final Enumeration[] enums; + private int index; + + public CompoundEnumeration(Enumeration[] enums) { + this.enums = enums; + } + + private boolean next() { + while (index < enums.length) { + if (enums[index] != null && enums[index].hasMoreElements()) { + return true; + } + index++; + } + return false; + } + + public boolean hasMoreElements() { + return next(); + } + + public E nextElement() { + if (!next()) { + throw new NoSuchElementException(); + } + return enums[index].nextElement(); + } +}