mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
[WIP] REPO-3918 java 11 (#32)
* REPO-3918 use java 11 + Added CompoundEnumeration manually because it was removed in Java 9
This commit is contained in:
4
pom.xml
4
pom.xml
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-super-pom</artifactId>
|
||||
<version>9</version>
|
||||
<version>10</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>alfresco-data-model</artifactId>
|
||||
@@ -31,7 +31,7 @@
|
||||
</distributionManagement>
|
||||
|
||||
<properties>
|
||||
<dependency.alfresco-core.version>7.4</dependency.alfresco-core.version>
|
||||
<dependency.alfresco-core.version>7.5</dependency.alfresco-core.version>
|
||||
|
||||
<!-- Files to exclude from SonarQube analysis -->
|
||||
<sonar.exclusions>
|
||||
|
@@ -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<E> implements Enumeration<E> {
|
||||
private final Enumeration<E>[] enums;
|
||||
private int index;
|
||||
|
||||
public CompoundEnumeration(Enumeration<E>[] 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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user