Jetty 9.4.x issue 2397asm jdk10 support (#2417)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Jan Bartel <janb@webtide.com>
This commit is contained in:
Jan Bartel 2018-04-06 12:00:09 +10:00 committed by GitHub
parent 09bfb77e5f
commit ea6d18f919
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 4 deletions

View File

@ -85,14 +85,14 @@ public class AnnotationParser
public static int asmVersion ()
{
int asmVersion = ASM_OPCODE_VERSION;
Package asm = Package.getPackage("org.objectweb.asm");
Package asm = Opcodes.class.getPackage();
if (asm == null)
LOG.warn("Unknown asm runtime version, assuming version {}", asmVersion);
else
{
String s = asm.getImplementationVersion();
if (s==null)
LOG.warn("Unknown asm runtime version, assuming version {}", asmVersion);
LOG.warn("Unknown asm implementation version, assuming version {}", asmVersion);
else
{
int dot = s.indexOf('.');

View File

@ -29,7 +29,6 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;
import java.net.URL;
import java.util.Arrays;
import java.util.Collections;
@ -48,6 +47,7 @@ import org.eclipse.jetty.toolchain.test.FS;
import org.eclipse.jetty.toolchain.test.IO;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.toolchain.test.TestingDir;
import org.eclipse.jetty.util.resource.PathResource;
import org.eclipse.jetty.util.resource.Resource;
import org.junit.Assert;
import org.junit.Rule;
@ -221,6 +221,17 @@ public class TestAnnotationParser
// Should throw no exceptions, and skip the META-INF/versions/9/* files
}
@Test
public void testJep238MultiReleaseInJar_JDK10() throws Exception
{
File jdk10Jar = MavenTestingUtils.getTestResourceFile("jdk10/multirelease-10.jar");
AnnotationParser parser = new AnnotationParser();
DuplicateClassScanHandler handler = new DuplicateClassScanHandler();
Set<Handler> handlers = Collections.singleton(handler);
parser.parse(handlers, new PathResource(jdk10Jar));
// Should throw no exceptions
}
@Test
public void testBasedirExclusion() throws Exception
{

View File

@ -0,0 +1,3 @@
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
#org.eclipse.jetty.LEVEL=DEBUG
#org.eclipse.jetty.annotations.LEVEL=DEBUG

View File

@ -24,7 +24,7 @@
<!-- default values are unsupported, but required to be defined for reactor sanity reasons -->
<alpn.version>undefined</alpn.version>
<conscrypt.version>1.0.0.RC11</conscrypt.version>
<asm.version>6.0</asm.version>
<asm.version>6.1.1</asm.version>
<jmh.version>1.20</jmh.version>
<jmhjar.name>benchmarks</jmhjar.name>
<surefireVersion>2.21.0</surefireVersion>