@ -345,24 +345,14 @@ public class ClassWriter {
}
}
}
}
// class annotations
if ( isDeprecated ) {
boolean hasDeprecatedAnno = false ;
List < AnnotationExprent > lstAnn = getAllAnnotations ( cl . getAttributes ( ) ) ;
for ( AnnotationExprent annexpr : lstAnn ) {
if ( "java/lang/Deprecated" . equals ( annexpr . getClassname ( ) ) ) {
hasDeprecatedAnno = true ;
}
}
if ( ( isDeprecated | | hasDeprecatedAnno ) & & DecompilerContext . getOption ( IFernflowerPreferences . DEPRECATED_COMMENT ) ) {
writer . write ( indstr ) ;
writer . write ( indstr ) ;
writer . write ( "/** @deprecated */" ) ;
writer . write ( "/** @deprecated */" ) ;
writer . newLine ( ) ;
writer . newLine ( ) ;
}
}
if ( isDeprecated & & ! hasDeprecatedAnno ) {
writer . write ( indstr ) ;
// class annotations
writer . write ( "@Deprecated" ) ;
List < AnnotationExprent > lstAnn = getAllAnnotations ( cl . getAttributes ( ) ) ;
writer . newLine ( ) ;
}
for ( AnnotationExprent annexpr : lstAnn ) {
for ( AnnotationExprent annexpr : lstAnn ) {
writer . write ( annexpr . toJava ( indent ) ) ;
writer . write ( annexpr . toJava ( indent ) ) ;
writer . newLine ( ) ;
writer . newLine ( ) ;
@ -491,24 +481,14 @@ public class ClassWriter {
boolean isDeprecated = fd . getAttributes ( ) . containsKey ( "Deprecated" ) ;
boolean isDeprecated = fd . getAttributes ( ) . containsKey ( "Deprecated" ) ;
// field annotations
if ( isDeprecated ) {
boolean hasDeprecatedAnno = false ;
List < AnnotationExprent > lstAnn = getAllAnnotations ( fd . getAttributes ( ) ) ;
for ( AnnotationExprent annexpr : lstAnn ) {
if ( "java/lang/Deprecated" . equals ( annexpr . getClassname ( ) ) ) {
hasDeprecatedAnno = true ;
}
}
if ( ( isDeprecated | | hasDeprecatedAnno ) & & DecompilerContext . getOption ( IFernflowerPreferences . DEPRECATED_COMMENT ) ) {
writer . write ( indstr ) ;
writer . write ( indstr ) ;
writer . write ( "/** @deprecated */" ) ;
writer . write ( "/** @deprecated */" ) ;
writer . newLine ( ) ;
writer . newLine ( ) ;
}
}
if ( isDeprecated & & ! hasDeprecatedAnno ) {
writer . write ( indstr ) ;
// field annotations
writer . write ( "@Deprecated" ) ;
List < AnnotationExprent > lstAnn = getAllAnnotations ( fd . getAttributes ( ) ) ;
writer . newLine ( ) ;
}
for ( AnnotationExprent annexpr : lstAnn ) {
for ( AnnotationExprent annexpr : lstAnn ) {
writer . write ( annexpr . toJava ( indent ) ) ;
writer . write ( annexpr . toJava ( indent ) ) ;
writer . newLine ( ) ;
writer . newLine ( ) ;
@ -729,24 +709,14 @@ public class ClassWriter {
}
}
}
}
// method annotations
if ( isDeprecated ) {
boolean hasDeprecatedAnno = false ;
List < AnnotationExprent > lstAnn = getAllAnnotations ( mt . getAttributes ( ) ) ;
for ( AnnotationExprent annexpr : lstAnn ) {
if ( "java/lang/Deprecated" . equals ( annexpr . getClassname ( ) ) ) {
hasDeprecatedAnno = true ;
}
}
if ( ( isDeprecated | | hasDeprecatedAnno ) & & DecompilerContext . getOption ( IFernflowerPreferences . DEPRECATED_COMMENT ) ) {
writer . write ( indstr ) ;
writer . write ( indstr ) ;
writer . write ( "/** @deprecated */" ) ;
writer . write ( "/** @deprecated */" ) ;
writer . newLine ( ) ;
writer . newLine ( ) ;
}
}
if ( isDeprecated & & ! hasDeprecatedAnno ) {
bufstrwriter . write ( indstr ) ;
// method annotations
bufstrwriter . write ( "@Deprecated" ) ;
List < AnnotationExprent > lstAnn = getAllAnnotations ( mt . getAttributes ( ) ) ;
bufstrwriter . newLine ( ) ;
}
for ( AnnotationExprent annexpr : lstAnn ) {
for ( AnnotationExprent annexpr : lstAnn ) {
bufstrwriter . write ( annexpr . toJava ( indent ) ) ;
bufstrwriter . write ( annexpr . toJava ( indent ) ) ;
bufstrwriter . newLine ( ) ;
bufstrwriter . newLine ( ) ;