aboutsummaryrefslogtreecommitdiff
path: root/java/com/google/turbine/bytecode/ClassWriter.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/google/turbine/bytecode/ClassWriter.java')
-rw-r--r--java/com/google/turbine/bytecode/ClassWriter.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/java/com/google/turbine/bytecode/ClassWriter.java b/java/com/google/turbine/bytecode/ClassWriter.java
index de975f2..da4afc7 100644
--- a/java/com/google/turbine/bytecode/ClassWriter.java
+++ b/java/com/google/turbine/bytecode/ClassWriter.java
@@ -31,10 +31,6 @@ public final class ClassWriter {
private static final int MAGIC = 0xcafebabe;
private static final int MINOR_VERSION = 0;
- // use the lowest classfile version possible given the class file features
- // TODO(cushon): is there a reason to support --release?
- private static final int MAJOR_VERSION = 52;
- private static final int MODULE_MAJOR_VERSION = 53;
/** Writes a {@link ClassFile} to bytecode. */
public static byte[] writeClass(ClassFile classfile) {
@@ -79,7 +75,7 @@ public final class ClassWriter {
ConstantPool pool, ByteArrayDataOutput body, List<Attribute> attributes) {
body.writeShort(attributes.size());
for (Attribute attribute : attributes) {
- new AttributeWriter(pool, body).write(attribute);
+ new AttributeWriter(pool).write(body, attribute);
}
}
@@ -119,7 +115,7 @@ public final class ClassWriter {
ByteArrayDataOutput result = ByteStreams.newDataOutput();
result.writeInt(MAGIC);
result.writeShort(MINOR_VERSION);
- result.writeShort(classfile.module() != null ? MODULE_MAJOR_VERSION : MAJOR_VERSION);
+ result.writeShort(classfile.majorVersion());
writeConstantPool(pool, result);
result.write(body.toByteArray());
return result.toByteArray();