I have an inner class, which extends AbstractTableModel.
import javax.swing.table.AbstractTableModel;
public class MyClass extends MyAbstractClass {
...
public static class MyTableModel extends AbstractTableModel {
}
...
}
The compiler gives me the following error.
...\MyClass.java:190: error: cannot find symbol
public static class MyTableModel extends AbstractTableModel {
^
symbol: class AbstractTableModel
location: class MyClass
When changing
MyTableModel extends AbstractTableModel
to
MyTableModel extends javax.swing.table.AbstractTableModel
everything works fine.
I use Gradle for building the project. Before I switched to Gradle, I used Eclipse to build the project. I didn't have the problem with Eclipse, the error only occurs, if I build with Gradle.
Do you have an idea what could be the reason for that strange behavior?
The error was caused by my order of imports. MyTableModel contains a MyTableListener interface, which is also imported by MyClass.java.
import MyClass.MyTableModel.MyTableListener;
...
import javax.swing.table.AbstractTableModel;
...
public class MyClass extends MyAbstractClass {
...
public static class MyTableModel extends AbstractTableModel {
public interface MyTableListener {
public void entryChanged();
}
...
}
...
}
When I put the MyTableListener import before the AbstractTableModel import Gradle gives me the cannot find symbol error.
When I put the AbstractTableModel import before the MyTableListener import everythings works fine.
So far so good, but why is the import order not a problem when building with Eclipse?!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With