There are classes:
InterfaceInterval<C extends Comparable<C>, I extends InterfaceInterval<C, I>> extends Comparable<InterfaceInterval<C, ?>>
AbstractInterval<C extends Comparable<C>, I extends AbstractInterval<C, I>> implements InterfaceInterval<C, I>, Serializable, Cloneable
AbstractTimeInterval<I extends AbstractTimeInterval<I>> extends AbstractInterval<Date, I>
SortedIntervalsList<C extends Comparable<C>, I extends AbstractInterval<C, ?>> extends ArrayList<I>
Timeline extends SortedIntervalsList<Date, AbstractTimeInterval<?>>
and now adding this line:
Timeline t = (Timeline) super.clone();
to clone() method in Timeline class I get:
mvn -e clean compile
The system is out of resources.
Consult the following stack trace for details.
java.lang.StackOverflowError
at com.sun.tools.javac.code.Type$WildcardType.isSuperBound(Type.java:435)
at com.sun.tools.javac.code.Types$1.visitWildcardType(Types.java:102)
at com.sun.tools.javac.code.Types$1.visitWildcardType(Types.java:98)
at com.sun.tools.javac.code.Type$WildcardType.accept(Type.java:416)
at com.sun.tools.javac.code.Types$MapVisitor.visit(Types.java:3232)
at com.sun.tools.javac.code.Types.upperBound(Types.java:95)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2986)
at com.sun.tools.javac.code.Types.adapt(Types.java:3016)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2977)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2986)
at com.sun.tools.javac.code.Types.adapt(Types.java:3016)
...
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
... 16 more
BUT, when I comment that line:
//Timeline t = (Timeline) super.clone();
and:
mvn compile
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
...
then uncomment that line again:
Timeline t = (Timeline) super.clone();
and:
mvn compile
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
...
So it works fine with little help ;). On Eclipse it works also :/. What should I do? Is it a java compiler bug or something?