@ -240,6 +240,7 @@ public final class ClassInfo extends BinaryInfo implements Comparable {
private ClassPath classpath ;
private ClassPath classpath ;
private int modifiers = - 1 ;
private int modifiers = - 1 ;
private boolean deprecatedFlag ;
private String name ;
private String name ;
private String className ;
private String className ;
private boolean methodScoped ;
private boolean methodScoped ;
@ -560,6 +561,11 @@ public final class ClassInfo extends BinaryInfo implements Comparable {
} else if ( howMuch > = ClassInfo . OUTERCLASS
} else if ( howMuch > = ClassInfo . OUTERCLASS
& & name . equals ( "InnerClasses" ) ) {
& & name . equals ( "InnerClasses" ) ) {
readInnerClassesAttribute ( length , cp , input ) ;
readInnerClassesAttribute ( length , cp , input ) ;
} else if ( name . equals ( "Deprecated" ) ) {
deprecatedFlag = true ;
if ( length ! = 0 )
throw new ClassFormatException
( "Deprecated attribute has wrong length" ) ;
} else
} else
super . readAttribute ( name , length , cp , input , howMuch ) ;
super . readAttribute ( name , length , cp , input , howMuch ) ;
}
}
@ -848,6 +854,8 @@ public final class ClassInfo extends BinaryInfo implements Comparable {
gcp . putUTF8 ( ci . className ) ;
gcp . putUTF8 ( ci . className ) ;
}
}
}
}
if ( deprecatedFlag )
gcp . putUTF8 ( "Deprecated" ) ;
prepareAttributes ( gcp ) ;
prepareAttributes ( gcp ) ;
}
}
@ -911,6 +919,10 @@ public final class ClassInfo extends BinaryInfo implements Comparable {
output . writeShort ( ci . modifiers ) ;
output . writeShort ( ci . modifiers ) ;
}
}
}
}
if ( deprecatedFlag ) {
output . writeShort ( gcp . putUTF8 ( "Deprecated" ) ) ;
output . writeInt ( 0 ) ;
}
}
}
@ -1191,6 +1203,15 @@ public final class ClassInfo extends BinaryInfo implements Comparable {
return Modifier . isInterface ( getModifiers ( ) ) ;
return Modifier . isInterface ( getModifiers ( ) ) ;
}
}
/ * *
* Checks whether this class was declared as deprecated . In bytecode
* this is represented by a special attribute .
* @return true if this class info represents a deprecated class .
* /
public boolean isDeprecated ( ) {
return deprecatedFlag ;
}
/ * *
/ * *
* Searches for a field with given name and type signature .
* Searches for a field with given name and type signature .
* @param name the name of the field .
* @param name the name of the field .
@ -1324,6 +1345,10 @@ public final class ClassInfo extends BinaryInfo implements Comparable {
modified = true ;
modified = true ;
}
}
public void setDeprecated ( boolean flag ) {
deprecatedFlag = flag ;
}
public void setMethods ( MethodInfo [ ] mi ) {
public void setMethods ( MethodInfo [ ] mi ) {
methods = mi ;
methods = mi ;
status = ALL ;
status = ALL ;