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 java.awt.*;
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 java.awt.Component;
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;
}
}`