/[classpath]/classpath/java/io/ObjectStreamField.java
ViewVC logotype

Diff of /classpath/java/io/ObjectStreamField.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by mark, Tue Jan 22 22:26:59 2002 UTC revision 1.8 by cbj, Mon Mar 25 05:12:18 2002 UTC
# Line 47  public class ObjectStreamField implement Line 47  public class ObjectStreamField implement
47    {    {
48      this.name = name;      this.name = name;
49      this.type = type;      this.type = type;
50        this.typename = TypeSignature.getEncodingOfClass(type);
51    }    }
52    
53      /**
54       * There're many cases you can't get java.lang.Class from typename if your context
55       * class loader can't load it, then use typename to construct the field
56       */
57      ObjectStreamField (String name, String typename){
58        this.name = name;
59        this.typename = typename;
60        try{
61          type = TypeSignature.getClassForEncoding(typename);
62        }catch(ClassNotFoundException e){
63          type = Object.class; //??
64        }
65      }
66      
67    public String getName ()    public String getName ()
68    {    {
69      return name;      return name;
# Line 61  public class ObjectStreamField implement Line 76  public class ObjectStreamField implement
76    
77    public char getTypeCode ()    public char getTypeCode ()
78    {    {
79      return TypeSignature.getEncodingOfClass (type).charAt (0);      return typename.charAt (0);
80    }    }
81    
82    public String getTypeString ()    public String getTypeString ()
83    {    {
84      return TypeSignature.getEncodingOfClass (type);      // use intern()
85        return typename.intern();
86    }    }
87    
88    public int getOffset ()    public int getOffset ()
# Line 106  public class ObjectStreamField implement Line 122  public class ObjectStreamField implement
122    
123    private String name;    private String name;
124    private Class type;    private Class type;
125      private String typename;
126    private int offset = -1; // XXX make sure this is correct    private int offset = -1; // XXX make sure this is correct
127  }  }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26