barry-m / checker-framework

Automatically exported from code.google.com/p/checker-framework
Other
0 stars 0 forks source link

Preventing unannotated reflection APIs #349

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, every type system needs to include, in its annotated libraries,
a conservative annotation for reflection methods such as

  java.lang.reflect.Method.invoke(Object...)
  java.lang.reflect.InvocationHandler.invoke(Object, Method,
  java.lang.Object[])
  javax.xml.ws.spi.Invoker(Method, Object...)

This is error-prone:  the designer of a type system may forget this detail.  It 
would be nicer to prevent this error from occurring, and then reflection would 
not be a source of unsoundness in the Checker Framework.

I propose to define a method annotation @ReflectionMethod, and to write it on 
the above methods in the annotated JDK.
The Checker Framework will treat any method annotated with @ReflectionMethod as 
having maximally-conservative annotations.

Original issue reported on code.google.com by michael.ernst@gmail.com on 28 Aug 2014 at 8:09

GoogleCodeExporter commented 9 years ago

Original comment by michael.ernst@gmail.com on 20 Feb 2015 at 4:25