javax.lang.model.util.Types.isSameType(...) API spec states:
Caveat: if either of the arguments to this method represents a wildcard, this method will return false. As a consequence, a wildcard is not the same type as itself.
However on JDK 9 build 126 isSameType returns true while false should be returned. The minimized testcase is attached, it produces following output on build 126:
Root class: Test22
Method: getList()
Return type: java.util.List<?>
Type argument: ta=?
processingEnv.getTypeUtils().isSameType(ta, ta)=true
In order to reproduce it, please:
1. Unzip attached archive on some Unix/Linux machine to a directory, say A.
2. Modify A/Test22/test.sh by setting JDK_HOME environment variable to your JDK installation.
3. Run A/Test22/test.sh.