From 8242ef42ef19f1f6a3f15e9b230f0317067f3863 Mon Sep 17 00:00:00 2001 From: chiba Date: Tue, 29 May 2007 09:33:53 +0000 Subject: [PATCH] the version of the class file generated from scratch was changed from JDK 1.1 to 1.3. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@377 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- src/main/javassist/bytecode/ClassFile.java | 6 +++--- src/main/javassist/compiler/MemberCodeGen.java | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/javassist/bytecode/ClassFile.java b/src/main/javassist/bytecode/ClassFile.java index e28e6c63..3d743d7b 100644 --- a/src/main/javassist/bytecode/ClassFile.java +++ b/src/main/javassist/bytecode/ClassFile.java @@ -47,9 +47,9 @@ public final class ClassFile { /** * The major version number of class files created - * from scratch. The value is 45 (JDK 1.1). + * from scratch. The value is 47 (JDK 1.3). */ - public static final int MAJOR_VERSION = 45; + public static final int MAJOR_VERSION = 47; /** * Constructs a class file from a byte stream. @@ -70,7 +70,7 @@ public final class ClassFile { */ public ClassFile(boolean isInterface, String classname, String superclass) { major = MAJOR_VERSION; - minor = 3; // JDK 1.1 or later + minor = 0; // JDK 1.3 or later constPool = new ConstPool(classname); thisClass = constPool.getThisClassInfo(); if (isInterface) diff --git a/src/main/javassist/compiler/MemberCodeGen.java b/src/main/javassist/compiler/MemberCodeGen.java index bd77b878..3d7ed373 100644 --- a/src/main/javassist/compiler/MemberCodeGen.java +++ b/src/main/javassist/compiler/MemberCodeGen.java @@ -24,9 +24,7 @@ import java.util.ArrayList; /* Code generator methods depending on javassist.* classes. */ public class MemberCodeGen extends CodeGen { - public static final int JAVA1_VER = 45; public static final int JAVA5_VER = 49; - public static final int JAVA6_VER = 50; protected MemberResolver resolver; protected CtClass thisClass; @@ -48,7 +46,7 @@ public class MemberCodeGen extends CodeGen { public int getMajorVersion() { ClassFile cf = thisClass.getClassFile2(); if (cf == null) - return JAVA1_VER; + return ClassFile.MAJOR_VERSION; // JDK 1.3 else return cf.getMajorVersion(); } -- 2.39.5