Menu

#107 [Generics] NullPointerException in static method

Self_Reported
open
nobody
5
2012-11-27
2006-11-16
No

The method call in the below class triggers a NullPointerException when compiled by the MultiJava compiler. I'm not sure why but if either the method foo() is declared non-static or the return type is non-generic, no exception is thrown.

==================================
public class Bug16<T> {
public static Bug16<Integer> foo() {
Bug16<Integer> bug16 = foo(); // NPE!
return null;
}
}
==================================

Discussion


Log in to post a comment.

Auth0 Logo