Skip to content

Commit df9e2e8

Browse files
authored
Fix corner case found in Akka Persistence Testkit (#229)
* Fix travis, actually test different scala versions * Fix corner case found in Akka Persistence Testkit * Add patches to test on all Scala versions
1 parent ee8e158 commit df9e2e8

File tree

21 files changed

+301
-1
lines changed

21 files changed

+301
-1
lines changed

src/main/scala/com/typesafe/genjavadoc/JavaSig.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ trait JavaSig extends NeedsJavaSig { this: TransformCake =>
105105
if (!primitiveOK) jsig(ObjectClass.tpe)
106106
else if (sym == UnitClass) jsig(BoxedUnitClass.tpe)
107107
else toJava(tp)
108-
} else if (sym.isClass) {
108+
} else if (sym.isClass || sym.isModule) {
109109
val preRebound = pre.baseType(sym.owner) // #2585
110110
val name =
111111
if (needsJavaSig(preRebound)) {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package akka.persistence.testkit;
2+
public class EventStorage$ {
3+
/**
4+
* Static reference to the singleton instance of this Scala object.
5+
*/
6+
public static final EventStorage$ MODULE$ = null;
7+
public EventStorage$ () { throw new RuntimeException(); }
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package akka.persistence.testkit;
2+
public interface EventStorage {
3+
static public class JournalPolicies$ implements akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation> {
4+
/**
5+
* Static reference to the singleton instance of this Scala object.
6+
*/
7+
public static final JournalPolicies$ MODULE$ = null;
8+
public JournalPolicies$ () { throw new RuntimeException(); }
9+
}
10+
public akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation>.PassAll$ DefaultPolicy () ;
11+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package akka.persistence.testkit;
2+
public interface JournalOperation {
3+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package akka.persistence.testkit;
2+
public class ProcessingPolicy$ {
3+
/**
4+
* Static reference to the singleton instance of this Scala object.
5+
*/
6+
public static final ProcessingPolicy$ MODULE$ = null;
7+
public ProcessingPolicy$ () { throw new RuntimeException(); }
8+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package akka.persistence.testkit;
2+
public interface ProcessingPolicy<U extends java.lang.Object> {
3+
static public interface DefaultPolicies<U extends java.lang.Object> {
4+
public class PassAll {
5+
static public java.lang.String productPrefix () { throw new RuntimeException(); }
6+
static public int productArity () { throw new RuntimeException(); }
7+
static public Object productElement (int x$1) { throw new RuntimeException(); }
8+
static public scala.collection.Iterator<java.lang.Object> productIterator () { throw new RuntimeException(); }
9+
static public boolean canEqual (Object x$1) { throw new RuntimeException(); }
10+
static public int hashCode () { throw new RuntimeException(); }
11+
static public java.lang.String toString () { throw new RuntimeException(); }
12+
static public abstract boolean equals (Object that) ;
13+
}
14+
public class PassAll$ implements akka.persistence.testkit.ProcessingPolicy<U>, scala.Product, scala.Serializable {
15+
/**
16+
* Static reference to the singleton instance of this Scala object.
17+
*/
18+
public static final PassAll$ MODULE$ = null;
19+
public PassAll$ () { throw new RuntimeException(); }
20+
public java.lang.String productPrefix () { throw new RuntimeException(); }
21+
public int productArity () { throw new RuntimeException(); }
22+
public Object productElement (int x$1) { throw new RuntimeException(); }
23+
public scala.collection.Iterator<java.lang.Object> productIterator () { throw new RuntimeException(); }
24+
public boolean canEqual (Object x$1) { throw new RuntimeException(); }
25+
public int hashCode () { throw new RuntimeException(); }
26+
public java.lang.String toString () { throw new RuntimeException(); }
27+
}
28+
public akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<U>.PassAll$ PassAll () ;
29+
}
30+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package akka.persistence.testkit
2+
3+
import akka.persistence.testkit.ProcessingPolicy.DefaultPolicies
4+
5+
private[testkit] trait EventStorage {
6+
import EventStorage._
7+
8+
val DefaultPolicy = JournalPolicies.PassAll
9+
}
10+
11+
object EventStorage {
12+
object JournalPolicies extends DefaultPolicies[JournalOperation]
13+
}
14+
15+
sealed trait JournalOperation
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package akka.persistence.testkit
2+
3+
trait ProcessingPolicy[U]
4+
5+
object ProcessingPolicy {
6+
private[testkit] trait DefaultPolicies[U] {
7+
type PolicyType = ProcessingPolicy[U]
8+
9+
case object PassAll extends PolicyType
10+
}
11+
}

src/test/resources/patches/2.12.10.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,16 @@
5656
+ public void akka$actor$dsl$Inbox$InboxExtension$_setter_$DSLInboxQueueSize_$eq (int x$1) ;
5757
}
5858
}
59+
--- target/expected_output/basic/akka/persistence/testkit/EventStorage.java 2020-03-23 16:04:03.313049968 +0100
60+
+++ target/expected_output/basic/akka/persistence/testkit/EventStorage.java 2020-03-23 16:04:03.313049968 +0100
61+
@@ -5,7 +5,9 @@
62+
* Static reference to the singleton instance of this Scala object.
63+
*/
64+
public static final JournalPolicies$ MODULE$ = null;
65+
+ public akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation>.PassAll$ PassAll () { throw new RuntimeException(); }
66+
public JournalPolicies$ () { throw new RuntimeException(); }
67+
}
68+
- public akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation>.PassAll$ DefaultPolicy () ;
69+
+ public void akka$persistence$testkit$EventStorage$_setter_$DefaultPolicy_$eq (akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation>.PassAll x$1) ;
70+
+ public akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation>.PassAll DefaultPolicy () ;
71+
}

src/test/resources/patches/2.12.11.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,16 @@
5656
+ public void akka$actor$dsl$Inbox$InboxExtension$_setter_$DSLInboxQueueSize_$eq (int x$1) ;
5757
}
5858
}
59+
--- target/expected_output/basic/akka/persistence/testkit/EventStorage.java 2020-03-23 16:04:03.313049968 +0100
60+
+++ target/expected_output/basic/akka/persistence/testkit/EventStorage.java 2020-03-23 16:04:03.313049968 +0100
61+
@@ -5,7 +5,9 @@
62+
* Static reference to the singleton instance of this Scala object.
63+
*/
64+
public static final JournalPolicies$ MODULE$ = null;
65+
+ public akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation>.PassAll$ PassAll () { throw new RuntimeException(); }
66+
public JournalPolicies$ () { throw new RuntimeException(); }
67+
}
68+
- public akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation>.PassAll$ DefaultPolicy () ;
69+
+ public void akka$persistence$testkit$EventStorage$_setter_$DefaultPolicy_$eq (akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation>.PassAll x$1) ;
70+
+ public akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation>.PassAll DefaultPolicy () ;
71+
}

0 commit comments

Comments
 (0)