playframework / playframework

The Community Maintained High Velocity Web Framework For Java and Scala.
http://www.playframework.com
Apache License 2.0
12.53k stars 4.09k forks source link

ScalaDoc generation fails for docker:stage and universal:packageBin #5083

Closed nblomquist closed 9 years ago

nblomquist commented 9 years ago

I am seeing an error with: activator docker:stage

It fails during ScalaDoc generation:

C:\java\projects\scala-doc-failure>activator docker:stage
[info] Loading project definition from C:\java\projects\scala-doc-failure\projec
t
[info] Set current project to play-java (in build file:/C:/java/projects/scala-d
oc-failure/)
[info] Main Scala API documentation to C:\java\projects\scala-doc-failure\target
\scala-2.11\api...
[info] Wrote C:\java\projects\scala-doc-failure\target\scala-2.11\play-java_2.11
-1.0-SNAPSHOT.pom
[error] C:\java\projects\scala-doc-failure\app\controllers\ArrayNodeCollector.ja
va:82: not found: type Characteristics
[error]     public Set<Characteristics> characteristics() {
[error]                ^
model contains 21 documentable templates
[error] one error found
[error] (compile:doc) Scaladoc generation failed
[error] Total time: 8 s, completed Sep 9, 2015 10:49:23 AM

image

I have created a github repo that can reproduce the issue: https://github.com/nblomquist/scala-doc-failure

Steps to reproduce:

  1. Checkout the above repo
  2. run: activator docker:stage
  3. or run: activator universal:packageBin

I have tested this with both Windows and Linux.

Not sure what is going on here.

nblomquist commented 9 years ago

Ok, I found a workaround--add this import to ArrayNodeCollector.java: import java.util.stream.Collector.Characteristics;

Apparently ScalaDoc isn't seeing that the Characteristics enum is part of the base class, Collector. But if we manually import it, then it sees it.

nblomquist commented 9 years ago

Much smaller test case Base.java

public class Base {
    public enum BaseEnum{
        ONE,
        TWO
    }
}

Child.java

import java.util.EnumSet;
import java.util.Set;

public class Child extends Base {
    public Set<BaseEnum> get(){
        return EnumSet.of(BaseEnum.ONE);
    }
}
nblomquist commented 9 years ago

I apologize, this has already been reported in the Scala project: https://issues.scala-lang.org/browse/SI-8993