Consider the following code sample:
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) {
The real question is; why can you use raw type? For backward compatibility. If it's for backward compatibility, the assumption is only raw types should be used.
How generic type of passed argument could affect generic type of method return value while generic type of return value is fixed in method signature?
A method or constructor has either of two modes. It is either completely generic, or it is completely raw typed for backward compatibility. There is no mode mode of use where it is partly raw typed and partly generic. The only reason raw types are an option is for backward compatibility and in this situation it assumes all types are/were raw types.
Why there is such backward incompatible change in behavior between Java7 and Java8?
Since Java 1.4 is not supported any more and hasn't been for a while, the backward compatibility argument doesn't hold as strongly and make some sense to give raw types a place in the current language.