Your problem is the first line:
public class MsgLog<Boolean,String>
You are declaring type parameters named "Boolean" and "String". These are shadowing the actual Boolean
and String
types. You don't even need type parameters for this class, as far as I can see; just remove them. If you do want to keep them, you should rename them to avoid shadowing the existing types.
Semantically, the code you posted is equivalent to (with some snipped for brevity):
public class MsgLog<T,U> {
private boolean sentOk ;
private U theMsg ;
private MsgLog(T sentOkp, U theMsg)
{
this.sentOk = sentOkp ; // compile error - assignment to incompatible type
this.theMsg = theMsg ;
}
}