aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/bytecode/ClassFile.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/javassist/bytecode/ClassFile.java')
-rw-r--r--src/main/javassist/bytecode/ClassFile.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/main/javassist/bytecode/ClassFile.java b/src/main/javassist/bytecode/ClassFile.java
index bab40b70..8f2fc66b 100644
--- a/src/main/javassist/bytecode/ClassFile.java
+++ b/src/main/javassist/bytecode/ClassFile.java
@@ -675,7 +675,7 @@ public final class ClassFile {
}
/**
- * Set the Major version.
+ * Set the major version.
*
* @param major
* the major version
@@ -685,7 +685,7 @@ public final class ClassFile {
}
/**
- * Get the Minor version.
+ * Get the minor version.
*
* @return the minor version
*/
@@ -694,7 +694,7 @@ public final class ClassFile {
}
/**
- * Set the Minor version.
+ * Set the minor version.
*
* @param minor
* the minor version
@@ -702,4 +702,16 @@ public final class ClassFile {
public void setMinorVersion(int minor) {
this.minor = minor;
}
+
+ /**
+ * Sets the major and minor version to Java 5.
+ *
+ * If the major version is older than 49, Java 5
+ * extensions such as annotations are ignored
+ * by the JVM.
+ */
+ public void setVersionToJava5() {
+ this.major = 49;
+ this.minor = 0;
+ }
}