]> source.dussan.org Git - javassist.git/commitdiff
fixed a bug in CtField.
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Sat, 23 Aug 2003 03:54:06 +0000 (03:54 +0000)
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Sat, 23 Aug 2003 03:54:06 +0000 (03:54 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@36 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

src/main/javassist/CtField.java

index ad40fcb718a4035cd2a595410c2931fb497a82c0..5d279d20a3a897bc5850e658be7583ec6c6bf0a9 100644 (file)
@@ -198,6 +198,7 @@ public class CtField extends CtMember {
      * Changes the name of the field.
      */
     public void setName(String newName) {
+        declaringClass.checkModify();
         fieldInfo.setName(newName);
     }
 
@@ -216,6 +217,7 @@ public class CtField extends CtMember {
      * @see Modifier
      */
     public void setModifiers(int mod) {
+        declaringClass.checkModify();
         fieldInfo.setAccessFlags(AccessFlag.of(mod));
     }