Most people I’ve seen with this problem were using = where they needed ==. What’s causing my problem here?
com\callmeyer\jopp\FieldCoordinator.java:303: unexpected type
required: class, package
found : variable
if (event.getType() == event.Type.INSERT) {
^
The enum definition and accessor:
public class DataLayoutEvent {
public static enum Type { INSERT, DELETE, RENAME, MOVE, RESIZE }
private Type type = null;
public Type getType() {
return type;
}
...
}
and the method where the error occurs:
public void layoutChanged(DataLayoutEvent event) {
if (event.getType() == event.Type.INSERT) {
fieldAdded(event.getField(), event.getToIndex());
}
...
Use static access instead of instance access:
You can (but shouldn’t) use instance access for static members (methods and fields), but not for inner types.