From: chiba Date: Sat, 23 Aug 2003 03:54:06 +0000 (+0000) Subject: fixed a bug in CtField. X-Git-Tag: rel_3_17_1_ga~571 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=eacc721fa513a53708669f0ccc78aea14764e534;p=javassist.git fixed a bug in CtField. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@36 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- diff --git a/src/main/javassist/CtField.java b/src/main/javassist/CtField.java index ad40fcb7..5d279d20 100644 --- a/src/main/javassist/CtField.java +++ b/src/main/javassist/CtField.java @@ -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)); }