If a case class does not have a companion object, the following error message appears:
error: illegal combination of modifiers: abstract and static
[ERROR] static public abstract R apply () ;
[ERROR] ^
In JDK 8 using abstract and static is considered a warning. In JDK 11 this is an error.
expectation
A case class can be used without needing a companion object.
reproduction
To reproduce this issue, it is enough to create a file containing:
case class MyCaseClass() {}
However, the following does not have any problems:
case class MyCaseClass() {}
object MyCaseClass {}
In the generated Java code, one can see the difference. In the first case we see:
public class MyCaseClass implements scala.Product, java.io.Serializable {
static public abstract R apply () ;
static public java.lang.String toString () { throw new RuntimeException(); }
public MyCaseClass () { throw new RuntimeException(); }
}
In the second case we see:
public class MyCaseClass implements scala.Product, java.io.Serializable {
public MyCaseClass () { throw new RuntimeException(); }
}
problem
If a case class does not have a companion object, the following error message appears:
In JDK 8 using abstract and static is considered a warning. In JDK 11 this is an error.
expectation
A case class can be used without needing a companion object.
reproduction
To reproduce this issue, it is enough to create a file containing:
However, the following does not have any problems:
In the generated Java code, one can see the difference. In the first case we see:
In the second case we see:
configuration
This was compiled with:
related issues
These issues could be related: https://github.com/lightbend/genjavadoc/issues/181 https://github.com/lightbend/genjavadoc/issues/154