Don't use external annotations in compiler

External annotations will be re-enabled in the IDE later.

This fixes LazyJavaAnnotations which was breaking the contract of Annotations:
findAnnotation(FqName) was looking for external annotations, while iterator()
did not. This resulted in some inconsistencies in the compiler and IDE tests.

The other way, i.e. making iterator() look up external annotations, would have
been too costly for the compiler and with no clear benefit at the moment.
This commit is contained in:
Alexander Udalov
2015-04-13 14:48:54 +03:00
parent fe602d34ce
commit 24bad39e76
8 changed files with 56 additions and 90 deletions
@@ -1,33 +1,32 @@
import java.sql.DriverManager
fun getConnection(url: String?) {
DriverManager.getConnection(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>url<!>)
DriverManager.getConnection(url)
DriverManager.getConnection(url!!) : java.sql.Connection
}
fun getConnection(url: String?, props: java.util.Properties?) {
DriverManager.getConnection(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>url<!>, props)
DriverManager.getConnection(url, props)
DriverManager.getConnection(url!!, props) : java.sql.Connection
}
fun getConnection(url: String?, user: String?, password: String?) {
DriverManager.getConnection(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>url<!>, user!!, password!!)
DriverManager.getConnection(url, user!!, password!!)
DriverManager.getConnection(url!!, user, password<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>)
DriverManager.getConnection(url<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>, user<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>, password)
DriverManager.getConnection(url<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>, user<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>, password<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>) : java.sql.Connection
}
fun getDriver(url: String?) {
DriverManager.getDriver(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>url<!>)
DriverManager.getDriver(url)
DriverManager.getDriver(url!!) : java.sql.Driver
}
fun registerDriver(driver: java.sql.Driver?) {
DriverManager.registerDriver(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>driver<!>)
DriverManager.registerDriver(driver)
DriverManager.registerDriver(driver!!)
}
fun getDrivers() {
// todo fix to java.util.Enumeration<java.sql.Driver> bug in compiler fixed
DriverManager.getDrivers() : java.util.Enumeration<*>
}
DriverManager.getDrivers() : java.util.Enumeration<java.sql.Driver>
}
@@ -1,5 +1,5 @@
fun executeQuery(statement: java.sql.Statement, cmd: String?) {
statement.executeQuery(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>cmd<!>)
statement.executeQuery(cmd)
statement.executeQuery(cmd!!) : java.sql.ResultSet
}
@@ -8,6 +8,6 @@ fun executeQuery(statement: java.sql.PreparedStatement) {
}
fun executeUpdate(statement: java.sql.Statement, cmd: String?) {
statement.executeUpdate(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>cmd<!>)
statement.executeUpdate(cmd)
statement.executeUpdate(cmd!!)
}
}