From eacc721fa513a53708669f0ccc78aea14764e534 Mon Sep 17 00:00:00 2001 From: chiba Date: Sat, 23 Aug 2003 03:54:06 +0000 Subject: [PATCH] fixed a bug in CtField. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@36 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- src/main/javassist/CtField.java | 2 ++ 1 file changed, 2 insertions(+) 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)); } -- 2.39.5