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;
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 {
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;