Skip to content

Commit 602b2fc

Browse files
authored
Interfaces must be public in Java (#158)
1 parent 5e0e196 commit 602b2fc

File tree

14 files changed

+124
-12
lines changed

14 files changed

+124
-12
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,11 @@ trait AST { this: TransformCake ⇒
160160
}
161161

162162
private def access(m: Modifiers, topLevel: Boolean): String = {
163-
if (m.isPublic) "public"
163+
if (m.isTrait || m.isInterface) "public"
164+
else if (m.isPublic) "public"
164165
else if (m.isProtected && !topLevel) "protected"
165166
else if (m.isPrivate && !topLevel) {
166-
if (m.isInterface || m.hasStaticFlag) "" else "private"
167+
if (m.hasStaticFlag) "" else "private"
167168
}
168169
else if (strictVisibility && m.privateWithin != tpnme.EMPTY) ""
169170
else "public" // this is the case for top level classes
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package akka.actor.dsl;
2+
public interface Inbox {
3+
public interface InboxExtension {
4+
public int DSLInboxQueueSize () ;
5+
}
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package akka.actor.dsl
2+
3+
trait Inbox {
4+
protected trait InboxExtension {
5+
val DSLInboxQueueSize = 42
6+
}
7+
}

plugin/src/test/resources/patches/2.12.0.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,12 @@
8080
public Object messageId () { throw new RuntimeException(); }
8181
// not preceding
8282
public Identify (Object messageId) { throw new RuntimeException(); }
83+
--- target/expected_output/basic/akka/actor/dsl/Inbox.java 2018-12-13 15:51:52.473679518 +0100
84+
+++ target/expected_output/basic/akka/actor/dsl/Inbox.java 2018-12-13 15:51:51.473673128 +0100
85+
@@ -2,5 +2,6 @@
86+
public interface Inbox {
87+
public interface InboxExtension {
88+
public int DSLInboxQueueSize () ;
89+
+ public void akka$actor$dsl$Inbox$InboxExtension$_setter_$DSLInboxQueueSize_$eq (int x$1) ;
90+
}
91+
}

plugin/src/test/resources/patches/2.12.1.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,12 @@
8080
public Object messageId () { throw new RuntimeException(); }
8181
// not preceding
8282
public Identify (Object messageId) { throw new RuntimeException(); }
83+
--- target/expected_output/basic/akka/actor/dsl/Inbox.java 2018-12-13 15:51:52.473679518 +0100
84+
+++ target/expected_output/basic/akka/actor/dsl/Inbox.java 2018-12-13 15:51:51.473673128 +0100
85+
@@ -2,5 +2,6 @@
86+
public interface Inbox {
87+
public interface InboxExtension {
88+
public int DSLInboxQueueSize () ;
89+
+ public void akka$actor$dsl$Inbox$InboxExtension$_setter_$DSLInboxQueueSize_$eq (int x$1) ;
90+
}
91+
}

plugin/src/test/resources/patches/2.12.2.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,12 @@
8080
public Object messageId () { throw new RuntimeException(); }
8181
// not preceding
8282
public Identify (Object messageId) { throw new RuntimeException(); }
83+
--- target/expected_output/basic/akka/actor/dsl/Inbox.java 2018-12-13 15:51:52.473679518 +0100
84+
+++ target/expected_output/basic/akka/actor/dsl/Inbox.java 2018-12-13 15:51:51.473673128 +0100
85+
@@ -2,5 +2,6 @@
86+
public interface Inbox {
87+
public interface InboxExtension {
88+
public int DSLInboxQueueSize () ;
89+
+ public void akka$actor$dsl$Inbox$InboxExtension$_setter_$DSLInboxQueueSize_$eq (int x$1) ;
90+
}
91+
}

plugin/src/test/resources/patches/2.12.3.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,12 @@
8080
public Object messageId () { throw new RuntimeException(); }
8181
// not preceding
8282
public Identify (Object messageId) { throw new RuntimeException(); }
83+
--- target/expected_output/basic/akka/actor/dsl/Inbox.java 2018-12-13 15:51:52.473679518 +0100
84+
+++ target/expected_output/basic/akka/actor/dsl/Inbox.java 2018-12-13 15:51:51.473673128 +0100
85+
@@ -2,5 +2,6 @@
86+
public interface Inbox {
87+
public interface InboxExtension {
88+
public int DSLInboxQueueSize () ;
89+
+ public void akka$actor$dsl$Inbox$InboxExtension$_setter_$DSLInboxQueueSize_$eq (int x$1) ;
90+
}
91+
}

plugin/src/test/resources/patches/2.12.4.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,12 @@
8080
public Object messageId () { throw new RuntimeException(); }
8181
// not preceding
8282
public Identify (Object messageId) { throw new RuntimeException(); }
83+
--- target/expected_output/basic/akka/actor/dsl/Inbox.java 2018-12-13 15:51:52.473679518 +0100
84+
+++ target/expected_output/basic/akka/actor/dsl/Inbox.java 2018-12-13 15:51:51.473673128 +0100
85+
@@ -2,5 +2,6 @@
86+
public interface Inbox {
87+
public interface InboxExtension {
88+
public int DSLInboxQueueSize () ;
89+
+ public void akka$actor$dsl$Inbox$InboxExtension$_setter_$DSLInboxQueueSize_$eq (int x$1) ;
90+
}
91+
}

plugin/src/test/resources/patches/2.12.5.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,12 @@
8080
public Object messageId () { throw new RuntimeException(); }
8181
// not preceding
8282
public Identify (Object messageId) { throw new RuntimeException(); }
83+
--- target/expected_output/basic/akka/actor/dsl/Inbox.java 2018-12-13 15:51:52.473679518 +0100
84+
+++ target/expected_output/basic/akka/actor/dsl/Inbox.java 2018-12-13 15:51:51.473673128 +0100
85+
@@ -2,5 +2,6 @@
86+
public interface Inbox {
87+
public interface InboxExtension {
88+
public int DSLInboxQueueSize () ;
89+
+ public void akka$actor$dsl$Inbox$InboxExtension$_setter_$DSLInboxQueueSize_$eq (int x$1) ;
90+
}
91+
}

plugin/src/test/resources/patches/2.12.6.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,12 @@
8080
public Object messageId () { throw new RuntimeException(); }
8181
// not preceding
8282
public Identify (Object messageId) { throw new RuntimeException(); }
83+
--- target/expected_output/basic/akka/actor/dsl/Inbox.java 2018-12-13 15:51:52.473679518 +0100
84+
+++ target/expected_output/basic/akka/actor/dsl/Inbox.java 2018-12-13 15:51:51.473673128 +0100
85+
@@ -2,5 +2,6 @@
86+
public interface Inbox {
87+
public interface InboxExtension {
88+
public int DSLInboxQueueSize () ;
89+
+ public void akka$actor$dsl$Inbox$InboxExtension$_setter_$DSLInboxQueueSize_$eq (int x$1) ;
90+
}
91+
}

0 commit comments

Comments
 (0)