Skip to content

Commit 1fb582f

Browse files
committed
Flatten more recursively
1 parent 50ae3bb commit 1fb582f

File tree

4 files changed

+73
-1
lines changed

4 files changed

+73
-1
lines changed

plugin/src/main/scala/com/typesafe/genjavadoc/Output.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@ trait Output { this: TransformCake ⇒
104104
Some(MethodInfo(x x, "public static final", s"${obj.name}$$ MODULE$$ = null;",
105105
Seq("/**", " * Static reference to the singleton instance of this Scala object.", " */")))
106106
else None
107-
val members = (moduleInstance ++: obj.members) filter (!pruneClasses || _.isInstanceOf[MethodInfo])
107+
108+
val members = moduleInstance ++: (
109+
if (pruneClasses) obj.methodMembers
110+
else flatten(obj.classMembers) ++ obj.methodMembers
111+
)
112+
108113
val (com: Seq[String], moduleMembers: Vector[Templ]) = ((obj.comment, Vector.empty[Templ]) /: members)((p, mem) mem match {
109114
case x: MethodInfo if x.name == obj.name (p._1 ++ x.comment, p._2 :+ x.copy(name = x.name + '$', comment = Seq()))
110115
case x (p._1, p._2 :+ x)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package akka.rk.buh.is.it;
2+
public class CompressionProtocol$ {
3+
/**
4+
* Static reference to the singleton instance of this Scala object.
5+
*/
6+
public static final CompressionProtocol$ MODULE$ = null;
7+
public CompressionProtocol$ () { throw new RuntimeException(); }
8+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package akka.rk.buh.is.it;
2+
public class CompressionProtocol {
3+
static public class Events$ {
4+
/**
5+
* Static reference to the singleton instance of this Scala object.
6+
*/
7+
public static final Events$ MODULE$ = null;
8+
public final class HeavyHitterDetected implements akka.rk.buh.is.it.CompressionProtocol.Events.Event, scala.Product, scala.Serializable {
9+
static public akka.rk.buh.is.it.CompressionProtocol.Events.HeavyHitterDetected apply (Object key, int id, long count) { throw new RuntimeException(); }
10+
static public scala.Option<scala.Tuple3<java.lang.Object, java.lang.Object, java.lang.Object>> unapply (akka.rk.buh.is.it.CompressionProtocol.Events.HeavyHitterDetected x$0) { throw new RuntimeException(); }
11+
static private java.lang.Object readResolve () { throw new RuntimeException(); }
12+
public Object key () { throw new RuntimeException(); }
13+
public int id () { throw new RuntimeException(); }
14+
public long count () { throw new RuntimeException(); }
15+
// not preceding
16+
public HeavyHitterDetected (Object key, int id, long count) { throw new RuntimeException(); }
17+
public akka.rk.buh.is.it.CompressionProtocol.Events.HeavyHitterDetected copy (Object key, int id, long count) { throw new RuntimeException(); }
18+
// not preceding
19+
public Object copy$default$1 () { throw new RuntimeException(); }
20+
public int copy$default$2 () { throw new RuntimeException(); }
21+
public long copy$default$3 () { throw new RuntimeException(); }
22+
// not preceding
23+
public java.lang.String productPrefix () { throw new RuntimeException(); }
24+
public int productArity () { throw new RuntimeException(); }
25+
public Object productElement (int x$1) { throw new RuntimeException(); }
26+
public scala.collection.Iterator<java.lang.Object> productIterator () { throw new RuntimeException(); }
27+
public boolean canEqual (Object x$1) { throw new RuntimeException(); }
28+
public int hashCode () { throw new RuntimeException(); }
29+
public java.lang.String toString () { throw new RuntimeException(); }
30+
public boolean equals (Object x$1) { throw new RuntimeException(); }
31+
}
32+
public class HeavyHitterDetected$ extends scala.runtime.AbstractFunction3<java.lang.Object, java.lang.Object, java.lang.Object, akka.rk.buh.is.it.CompressionProtocol.Events.HeavyHitterDetected> implements scala.Serializable {
33+
/**
34+
* Static reference to the singleton instance of this Scala object.
35+
*/
36+
public static final HeavyHitterDetected$ MODULE$ = null;
37+
public HeavyHitterDetected$ () { throw new RuntimeException(); }
38+
public final java.lang.String toString () { throw new RuntimeException(); }
39+
public akka.rk.buh.is.it.CompressionProtocol.Events.HeavyHitterDetected apply (Object key, int id, long count) { throw new RuntimeException(); }
40+
public scala.Option<scala.Tuple3<java.lang.Object, java.lang.Object, java.lang.Object>> unapply (akka.rk.buh.is.it.CompressionProtocol.Events.HeavyHitterDetected x$0) { throw new RuntimeException(); }
41+
private java.lang.Object readResolve () { throw new RuntimeException(); }
42+
}
43+
public interface Event {
44+
}
45+
public Events$ () { throw new RuntimeException(); }
46+
}
47+
}

plugin/src/test/resources/input/basic/test.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,4 +389,16 @@ class ClassWithInner {
389389
val companionObjectValue = 32
390390
}
391391

392+
}
393+
394+
private[buh] object CompressionProtocol {
395+
396+
private[buh] object Events {
397+
398+
private[buh] sealed trait Event
399+
400+
final case class HeavyHitterDetected(key: Any, id: Int, count: Long) extends Event
401+
402+
}
403+
392404
}

0 commit comments

Comments
 (0)