src/share/classes/com/sun/tools/javap/ClassWriter.java

changeset 300
ed989c347b3c
parent 283
cd0630109de5
child 348
743f17b55b44
     1.1 --- a/src/share/classes/com/sun/tools/javap/ClassWriter.java	Tue Jun 16 10:46:37 2009 +0100
     1.2 +++ b/src/share/classes/com/sun/tools/javap/ClassWriter.java	Fri Jun 19 11:40:47 2009 -0700
     1.3 @@ -93,17 +93,25 @@
     1.4          this.lastModified = lastModified;
     1.5      }
     1.6  
     1.7 -    ClassFile getClassFile() {
     1.8 +    protected ClassFile getClassFile() {
     1.9          return classFile;
    1.10      }
    1.11  
    1.12 -    Method getMethod() {
    1.13 +    protected void setClassFile(ClassFile cf) {
    1.14 +        classFile = cf;
    1.15 +        constant_pool = classFile.constant_pool;
    1.16 +    }
    1.17 +
    1.18 +    protected Method getMethod() {
    1.19          return method;
    1.20      }
    1.21  
    1.22 +    protected void setMethod(Method m) {
    1.23 +        method = m;
    1.24 +    }
    1.25 +
    1.26      public void write(ClassFile cf) {
    1.27 -        classFile = cf;
    1.28 -        constant_pool = classFile.constant_pool;
    1.29 +        setClassFile(cf);
    1.30  
    1.31          if ((options.sysInfo || options.verbose) && !options.compat) {
    1.32              if (uri != null) {
    1.33 @@ -197,13 +205,13 @@
    1.34          println();
    1.35      }
    1.36  
    1.37 -    void writeFields() {
    1.38 +    protected void writeFields() {
    1.39          for (Field f: classFile.fields) {
    1.40              writeField(f);
    1.41          }
    1.42      }
    1.43  
    1.44 -    void writeField(Field f) {
    1.45 +    protected void writeField(Field f) {
    1.46          if (!options.checkAccess(f.access_flags))
    1.47              return;
    1.48  
    1.49 @@ -259,12 +267,12 @@
    1.50              println();
    1.51      }
    1.52  
    1.53 -    void writeMethods() {
    1.54 +    protected void writeMethods() {
    1.55          for (Method m: classFile.methods)
    1.56              writeMethod(m);
    1.57      }
    1.58  
    1.59 -    void writeMethod(Method m) {
    1.60 +    protected void writeMethod(Method m) {
    1.61          if (!options.checkAccess(m.access_flags))
    1.62              return;
    1.63  

mercurial