Skip to content
Permalink
Browse files

Merge pull request #19 from Vlatombe/JENKINS-24827

Restore jdk6 compatibility
  • Loading branch information...
Vlatombe committed Jul 28, 2015
2 parents 78247d3 + 669169a commit 68fbbd106a1a863f79a48e3fca734230ccf5a67b
27 pom.xml
@@ -51,6 +51,7 @@
<dollar>$</dollar>
<openbracket>{</openbracket>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.level>6</java.level>
</properties>

<repositories>
@@ -293,6 +294,32 @@
</filterProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.14</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java1${java.level}</artifactId>
<version>1.0</version>
</signature>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.${java.level}</source>
<target>1.${java.level}</target>
</configuration>
</plugin>
</plugins>
<extensions>
<extension>
@@ -0,0 +1,21 @@
package org.jenkinsci.maven.plugins.hpi;

import java.util.Enumeration;
import java.util.NoSuchElementException;

/**
* Taken from jdk7 Collections
*/
class CollectionUtils {

public static <T> Enumeration<T> emptyEnumeration() {
return (Enumeration<T>) EmptyEnumeration.EMPTY_ENUMERATION;
}

private static class EmptyEnumeration<E> implements Enumeration<E> {
static final EmptyEnumeration<Object> EMPTY_ENUMERATION = new EmptyEnumeration<Object>();

public boolean hasMoreElements() { return false; }
public E nextElement() { throw new NoSuchElementException(); }
}
}
@@ -2,7 +2,6 @@

import java.io.IOException;
import java.net.URL;
import java.util.Collections;
import java.util.Enumeration;

/**
@@ -27,7 +26,7 @@ public JettyAndServletApiOnlyClassLoader(ClassLoader parent, ClassLoader jettyCl
if (name.equals("jndi.properties")) {
return jettyClassLoader.getResources(name);
}
return Collections.emptyEnumeration();
return CollectionUtils.emptyEnumeration();
}

@Override

0 comments on commit 68fbbd1

Please sign in to comment.
You can’t perform that action at this time.