Eddie-
(As background for anyone reading this who doesn't know what a method
receiver is, see
http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#faq-receiver
.)
You are getting the error because you have a call like
x.myMethod(y, z)
but the receiver argument x is not compatible with the method declaration.
At the declaration of myMethod, you can state the requirements on the
type of each formal parameter. You can annotate the receiver formal
parameter of a method in the same way as you annotate any other formal
parameter.
By default, each formal parameter is implicitly annotated as
@Initialized. The receiver parameter is always named "this", and you
are allowed to omit it if you are just accepting the default
annotation.
Suppose that myMethod doesn't depend on the receiver being fully
initialized; in other words, it's OK to call x.myMethod(y, z) even if
x is not initialized. Here is how you would do that:
class MyClass {
int myMethod(@UnknownInitialization MyClass this, String param1, boolean param2) { ... }
}
If you are using annotations in comments, you would write:
class MyClass {
int myMethod(/*>>>@UnknownInitialization MyClass this,*/ String param1, boolean param2) { ... }
}
-Mike