Files
openide/java/java-impl/resources/inspectionDescriptions/Deprecation.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

64 lines
1.5 KiB
HTML

<html>
<body>
Reports usages of deprecated classes, fields, and methods.
A quick-fix is available to automatically convert the deprecated usage,
when the necessary information can be extracted from the Javadoc of the deprecated member.
<p><b>Example:</b></p>
<pre><code lang="java">
class Interesting {
/**
* @deprecated Use {@link #newHotness()} instead
*/
@Deprecated
public void oldAndBusted() {}
public void newHotness() {}
}
class ElseWhere {
void x(Interesting i) {
i.oldAndBusted(); // deprecated warning here
}
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code lang="java">
class Interesting {
/**
* @deprecated Use {@link #newHotness()} instead
*/
@Deprecated
public void oldAndBusted() {}
public void newHotness() {}
}
class ElseWhere {
void x(Interesting i) {
i.newHotness();
}
}
</code></pre>
<p>By default, the inspection doesn't produce a warning if it's impossible or hard to avoid it. For example,
the following code won't be reported:</p>
<pre><code lang="java">
abstract class A { //library code
@Deprecated
abstract void m();
}
class B extends A { //project code
@Override
void m() {
//doSmth;
}
}
</code></pre>
<!-- tooltip end -->
<p>Configure the inspection:</p>
<p>
Use the options to disable this inspection inside deprecated members,
overrides of abstract deprecated methods, non-static import statements, methods of deprecated classes, or same top-level classes.
</p>
</body>
</html>