mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
64 lines
1.5 KiB
HTML
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> |