From: Andy Clement Date: Thu, 21 Sep 2017 04:34:21 +0000 (-0700) Subject: Merged post 1.8.5 changes into Java9 branch X-Git-Tag: V1_9_0_RC3~2^2~82 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=03752862ba3bc6ef132195673903dcf9109e8b93;p=aspectj.git Merged post 1.8.5 changes into Java9 branch --- 03752862ba3bc6ef132195673903dcf9109e8b93 diff --cc ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java index afa27b319,afa27b319..42e8254cc --- a/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java +++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java @@@ -17,7 -17,7 +17,7 @@@ import java.util.List import org.aspectj.util.FileUtil; import org.aspectj.util.LangUtil; --import com.sun.org.apache.xml.internal.serializer.utils.Utils; ++//import com.sun.org.apache.xml.internal.serializer.utils.Utils; /** diff --cc bcel-builder/src/org/aspectj/apache/bcel/Constants.java index 41d75a7cf,0bba78fc4..5f37d106a --- a/bcel-builder/src/org/aspectj/apache/bcel/Constants.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/Constants.java @@@ -107,10 -105,10 +107,12 @@@ public interface Constants public final static short ACC_INTERFACE = 0x0200; public final static short ACC_ABSTRACT = 0x0400; public final static short ACC_STRICT = 0x0800; - + + public final static short ACC_SYNTHETIC = 0x1000; ++ public final static short ACC_ANNOTATION = 0x2000; public final static short ACC_ENUM = 0x4000; + public final static int ACC_MODULE = 0x8000; public final static short ACC_BRIDGE = 0x0040; public final static short ACC_VARARGS = 0x0080; diff --cc weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java index ee315172f,f176f8880..d041327aa --- a/weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java +++ b/weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java @@@ -101,14 -88,10 +106,15 @@@ public class ClassPathManager return; } try { - entries.add(new ZipFileEntry(f)); + if (lc.endsWith(LangUtil.JRT_FS)) { + // Java9 + entries.add(new JImageEntry(new File(f.getParentFile()+File.separator+"lib"+File.separator+"modules"))); + } else { + entries.add(new ZipFileEntry(f)); + } } catch (IOException ioe) { - MessageUtil.warn(handler, WeaverMessages.format(WeaverMessages.ZIPFILE_ENTRY_INVALID, name, ioe.getMessage())); + MessageUtil.warn(handler, + WeaverMessages.format(WeaverMessages.ZIPFILE_ENTRY_INVALID, name, ioe.getMessage())); return; } } else { @@@ -175,44 -153,7 +176,42 @@@ public abstract static class Entry { public abstract ClassFile find(String name) throws IOException; - - // public abstract List getAllClassFiles() throws IOException; } + + private static class ByteBasedClassFile extends ClassFile { + + private byte[] bytes; + private ByteArrayInputStream bais; + private String path; + + public ByteBasedClassFile(byte[] bytes, String path) { + this.bytes = bytes; + this.path = path; + } + + @Override + public InputStream getInputStream() throws IOException { + this.bais = new ByteArrayInputStream(bytes); + return this.bais; + } + + @Override + public String getPath() { + return this.path; + } + + @Override + public void close() { + if (this.bais!=null) { + try { + this.bais.close(); + } catch (IOException e) { + } + this.bais = null; + } + } + + } private static class FileClassFile extends ClassFile { private File file;