I have a an Xtend subclass PubnubMessage
that inherits one field and has a constructor generated via active annotation. I can see the public constructor in the generated Java code, and it correctly accepts one argument for the field, but when I try to call that constructor from another Xtend class like so:
override successCallback(String channel, Object message)
{
send(new PubnubMessage(message))
}
I get this error on the constructor call:
Invalid number of arguments. The constructor PubnubMessage() is not applicable for the arguments (Object)
Only the default no-arg constructor is visible, but there shouldn't even be a default constructor since an explicit one is generated. If I make a Java class with the same call:
new PubnubMessage(message);
There is no error. Here is the relevant code:
SocketMessage.xtend
@JsonData class SocketMessage
{
Object message
}
SocketMessage.java (Xtend generated)
@JsonData
@SuppressWarnings("all")
public class SocketMessage {
private final Object message;
@JsonCreator
public SocketMessage(@JsonProperty final Object message) {
super();
this.message = message;
}
PubnubMessage.xtend
@JsonData class PubnubMessage extends SocketMessage {}
PubnubMessage.java (Xtend generated)
@JsonData
@SuppressWarnings("all")
public class PubnubMessage extends SocketMessage {
@JsonCreator
public PubnubMessage(@JsonProperty final Object message) {
super(message);
}
I've left out the generated hashCode(), equals(), and toString(). Everything about this Java code seems fine to me, and like I said, I can successfully call it from other Java classes, but not from Xtend.