[jboss-cvs] javassist/src/main/javassist/expr ...
Shigeru Chiba
chiba at is.titech.ac.jp
Fri Jun 22 07:50:48 EDT 2007
User: chiba
Date: 07/06/22 07:50:48
Modified: src/main/javassist/expr MethodCall.java Cast.java
NewArray.java NewExpr.java Instanceof.java
FieldAccess.java Expr.java
Log:
fixed a bug of CtClassType#releaseClassFiles()
Revision Changes Path
1.20 +1 -0 javassist/src/main/javassist/expr/MethodCall.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MethodCall.java
===================================================================
RCS file: /cvsroot/jboss/javassist/src/main/javassist/expr/MethodCall.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- MethodCall.java 4 Jun 2007 03:11:12 -0000 1.19
+++ MethodCall.java 22 Jun 2007 11:50:48 -0000 1.20
@@ -176,6 +176,7 @@
* @param statement a Java statement.
*/
public void replace(String statement) throws CannotCompileException {
+ thisClass.getClassFile(); // to call checkModify().
ConstPool constPool = getConstPool();
int pos = currentPos;
int index = iterator.u16bitAt(pos + 1);
1.13 +1 -0 javassist/src/main/javassist/expr/Cast.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Cast.java
===================================================================
RCS file: /cvsroot/jboss/javassist/src/main/javassist/expr/Cast.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- Cast.java 4 Jun 2007 03:11:12 -0000 1.12
+++ Cast.java 22 Jun 2007 11:50:48 -0000 1.13
@@ -87,6 +87,7 @@
* @param statement a Java statement.
*/
public void replace(String statement) throws CannotCompileException {
+ thisClass.getClassFile(); // to call checkModify().
ConstPool constPool = getConstPool();
int pos = currentPos;
int index = iterator.u16bitAt(pos + 1);
1.6 +1 -0 javassist/src/main/javassist/expr/NewArray.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NewArray.java
===================================================================
RCS file: /cvsroot/jboss/javassist/src/main/javassist/expr/NewArray.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- NewArray.java 4 Jun 2007 03:11:12 -0000 1.5
+++ NewArray.java 22 Jun 2007 11:50:48 -0000 1.6
@@ -170,6 +170,7 @@
throws CompileError, NotFoundException, BadBytecode,
CannotCompileException
{
+ thisClass.getClassFile(); // to call checkModify().
ConstPool constPool = getConstPool();
int pos = currentPos;
CtClass retType;
1.19 +2 -0 javassist/src/main/javassist/expr/NewExpr.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NewExpr.java
===================================================================
RCS file: /cvsroot/jboss/javassist/src/main/javassist/expr/NewExpr.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- NewExpr.java 4 Jun 2007 03:11:12 -0000 1.18
+++ NewExpr.java 22 Jun 2007 11:50:48 -0000 1.19
@@ -160,6 +160,8 @@
* @param statement a Java statement.
*/
public void replace(String statement) throws CannotCompileException {
+ thisClass.getClassFile(); // to call checkModify().
+
final int bytecodeSize = 3;
int pos = newPos;
1.13 +1 -0 javassist/src/main/javassist/expr/Instanceof.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Instanceof.java
===================================================================
RCS file: /cvsroot/jboss/javassist/src/main/javassist/expr/Instanceof.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- Instanceof.java 4 Jun 2007 03:11:12 -0000 1.12
+++ Instanceof.java 22 Jun 2007 11:50:48 -0000 1.13
@@ -90,6 +90,7 @@
* @param statement a Java statement.
*/
public void replace(String statement) throws CannotCompileException {
+ thisClass.getClassFile(); // to call checkModify().
ConstPool constPool = getConstPool();
int pos = currentPos;
int index = iterator.u16bitAt(pos + 1);
1.14 +1 -0 javassist/src/main/javassist/expr/FieldAccess.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FieldAccess.java
===================================================================
RCS file: /cvsroot/jboss/javassist/src/main/javassist/expr/FieldAccess.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- FieldAccess.java 4 Jun 2007 03:11:12 -0000 1.13
+++ FieldAccess.java 22 Jun 2007 11:50:48 -0000 1.14
@@ -147,6 +147,7 @@
* @param statement a Java statement.
*/
public void replace(String statement) throws CannotCompileException {
+ thisClass.getClassFile(); // to call checkModify().
ConstPool constPool = getConstPool();
int pos = currentPos;
int index = iterator.u16bitAt(pos + 1);
1.17 +5 -0 javassist/src/main/javassist/expr/Expr.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Expr.java
===================================================================
RCS file: /cvsroot/jboss/javassist/src/main/javassist/expr/Expr.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- Expr.java 4 Jun 2007 03:11:12 -0000 1.16
+++ Expr.java 22 Jun 2007 11:50:48 -0000 1.17
@@ -247,6 +247,11 @@
}
}
+ // The implementation of replace() should call thisClass.checkModify()
+ // so that isModify() will return true. Otherwise, thisClass.classfile
+ // might be released during compilation and the compiler might generate
+ // bytecode with a wrong copy of ConstPool.
+
/**
* Replaces this expression with the bytecode derived from
* the given source text.
More information about the jboss-cvs-commits
mailing list