RFDI - Replacement For Demand Imports
Demand import-declarations must be replaced with a list of single import-declarations that are actually imported into the compilation unit. In other words, import-statements may not end with an asterisk.
Wrong
import javax.swing.*;
class RFDI {
public static JFrame getFrame (Component com) {
while (com != null) {
if (com instanceof JFrame)
return (JFrame)com;
com = com.getParent();
}
return null;
}
}
Tip: Replace demand imports with a list of single import declarations
Right
import javax.swing.JFrame;
class RFDI {
public static JFrame getFrame (Component com) {
while (com != null) {
if (com instanceof JFrame)
return (JFrame)com;
com =
com.getParent();
}
return null;
}
}