Beispiel

public static abstract class Base implements Comparable {
public Base( Object other ) {
super();
System.out.println( compareTo( other ) );
}
}

public static final class Derived extends Base {
public Derived( String str, Object other ) {
super( other );
this .str = str;
}

public int compareTo( Object other ) {
// str is null
return str.compareTo( other.toString() );
}
private String str;

}

public static void main( String[] args ) {
Derived derived = new Derived( "Hello World!", "Hello World!" ); //$NON-NLS-1$ //$NON-NLS-2$
}

Lösung
Entfernen Sie den Aufruf der abstrakten Methode aus dem Konstruktor.

public static abstract class Base implements Comparable {
public Base() {}
}

public static final class Derived extends Base {
public Derived( String str ) {
super();
this .str = str;
}

public int compareTo( Object other ) {
return str.compareTo( other.toString() );
}

private String str;
}

public static void main( String[] args ) {
Derived derived = new Derived( "Hello World!" ); //$NON-NLS-1$
System.out.println( derived.compareTo( "Hello World!" ) ); //$NON-NLS-1$
}