Community
Participate
Working Groups
Fup of bug 334978. javac doesn't report deprecation warnings for: import java.util.ArrayList; import java.util.List; public class DeprecatedTest { private final List<Object> instances; public DeprecatedTest(){ instances = new ArrayList<Object>(); instances.add(new Depr()); instances.add(new Depr1()); instances.add(new Depr2()); instances.add(new Depr3()); } @Deprecated public class Depr{} @Deprecated public class Depr1{} @Deprecated public class Depr2{} @Deprecated public class Depr3{} } but does for: import java.util.ArrayList; import java.util.List; public class DeprecatedTest { private final List<Object> instances; public DeprecatedTest(){ instances = new ArrayList<Object>(); instances.add(new Depr()); instances.add(new Depr1()); instances.add(new Depr2()); instances.add(new Depr3()); } } @Deprecated class Depr{} @Deprecated class Depr1{} @Deprecated class Depr2{} @Deprecated class Depr3{} where all types are defined in the same unit. The Eclipse compiler only reports deprecation if the deprecated types come from a different compilation unit.
Srikanth, please let me know what you think.
(In reply to comment #1) > Srikanth, please let me know what you think. Unless there is strong sentiment otherwise, I am inclined to leave the current behavior as it is. When the compilation units are different, the potential for provenance of the the client code and service providing code differing is there and as such the warning is useful to communicate intent and avoid "out of sight out of mind" situations. When things are in the same compilation unit, the authorship/ownership is the same and fixing the uses of about to deprecated code can be taken atomically with the act of deprecation itself.
Closing as WONT_FIX.
Verified for 3.7M7