File tree Expand file tree Collapse file tree 10 files changed +76
-6
lines changed
main/scala/com/typesafe/genjavadoc
expected_output/basic/akka/rk/buh/is/it
scala/com/typesafe/genjavadoc Expand file tree Collapse file tree 10 files changed +76
-6
lines changed Original file line number Diff line number Diff line change @@ -96,9 +96,11 @@ trait AST { this: TransformCake =>
9696 def fabricateParams : Boolean
9797
9898 case class DeprecationInfo (msg : String , since : String ) {
99- def maybeDot = if (msg.endsWith(" ." )) " " else " . "
100- def maybeSinceDot = if (since.endsWith(" ." )) " " else " . "
101- def render = s " * @deprecated ${msg}${maybeDot}Since $since${maybeSinceDot}"
99+ def render = {
100+ val rMsg = if (msg.isEmpty) " " else s " ${msg.stripSuffix(" ." )}. "
101+ val rSince = if (since.isEmpty) " " else s " Since ${since.stripSuffix(" ." )}. "
102+ s " * @deprecated $rMsg$rSince"
103+ }
102104
103105 def appendToComment (comment : Seq [String ]): Seq [String ] = comment.toVector match {
104106 case init :+ " */" =>
Original file line number Diff line number Diff line change @@ -160,8 +160,9 @@ trait BasicTransform { this: TransformCake =>
160160 private def deprecationInfo (d : ImplDef ): Option [DeprecationInfo ] = deprecationInfo(d.symbol)
161161 private def deprecationInfo (symbol : Symbol ): Option [DeprecationInfo ] =
162162 if (symbol.isDeprecated) {
163- val deprec = symbol.getAnnotation(definitions.DeprecatedAttr ).get
164- Some (DeprecationInfo (deprec.stringArg(0 ).getOrElse(" " ), deprec.stringArg(1 ).getOrElse(" " )))
163+ // symbol either has `DeprecatedAttr` or `JavaDeprecatedAttr`
164+ val deprec = symbol.getAnnotation(definitions.DeprecatedAttr )
165+ Some (DeprecationInfo (deprec.flatMap(_.stringArg(0 )).getOrElse(" " ), deprec.flatMap(_.stringArg(1 )).getOrElse(" " )))
165166 } else None
166167
167168}
Original file line number Diff line number Diff line change @@ -10,6 +10,12 @@ public class DontTouchThis {
1010 * @deprecated This is already deprecated. Since now.
1111 */
1212 public void alreadyDeprecatedInComment () { throw new RuntimeException (); }
13+ /**
14+ * buh!
15+ *
16+ * @deprecated
17+ */
18+ public void javaDeprecatedThingie () { throw new RuntimeException (); }
1319 /**
1420 * Some methods are forever.
1521 *
Original file line number Diff line number Diff line change @@ -275,6 +275,12 @@ private[it] class DontTouchThis {
275275 */
276276 @ deprecated(" This will be ignored" , since = " ever" )
277277 def alreadyDeprecatedInComment = ()
278+
279+ /**
280+ * buh!
281+ */
282+ @ Deprecated
283+ def javaDeprecatedThingie = ()
278284}
279285
280286@ deprecated(" Les Scalac Voyages Extraordinaire" , since = " now" )
Original file line number Diff line number Diff line change 6969+ public void akka$persistence$testkit$EventStorage$_setter_$DefaultPolicy_$eq (akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation>.PassAll x$1) ;
7070+ public akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation>.PassAll DefaultPolicy () ;
7171 }
72+ --- target/expected_output/basic/akka/rk/buh/is/it/DontTouchThis.java
73+ +++ target/expected_output/basic/akka/rk/buh/is/it/DontTouchThis.java
74+ @@ -12,8 +12,6 @@
75+ public void alreadyDeprecatedInComment () { throw new RuntimeException(); }
76+ /**
77+ * buh!
78+ - *
79+ - * @deprecated
80+ */
81+ public void javaDeprecatedThingie () { throw new RuntimeException(); }
82+ /**
Original file line number Diff line number Diff line change 6969+ public void akka$persistence$testkit$EventStorage$_setter_$DefaultPolicy_$eq (akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation>.PassAll x$1) ;
7070+ public akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation>.PassAll DefaultPolicy () ;
7171 }
72+ --- target/expected_output/basic/akka/rk/buh/is/it/DontTouchThis.java
73+ +++ target/expected_output/basic/akka/rk/buh/is/it/DontTouchThis.java
74+ @@ -12,8 +12,6 @@
75+ public void alreadyDeprecatedInComment () { throw new RuntimeException(); }
76+ /**
77+ * buh!
78+ - *
79+ - * @deprecated
80+ */
81+ public void javaDeprecatedThingie () { throw new RuntimeException(); }
82+ /**
Original file line number Diff line number Diff line change 6969+ public void akka$persistence$testkit$EventStorage$_setter_$DefaultPolicy_$eq (akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation>.PassAll x$1) ;
7070+ public akka.persistence.testkit.ProcessingPolicy.DefaultPolicies<akka.persistence.testkit.JournalOperation>.PassAll DefaultPolicy () ;
7171 }
72+ --- target/expected_output/basic/akka/rk/buh/is/it/DontTouchThis.java
73+ +++ target/expected_output/basic/akka/rk/buh/is/it/DontTouchThis.java
74+ @@ -12,8 +12,6 @@
75+ public void alreadyDeprecatedInComment () { throw new RuntimeException(); }
76+ /**
77+ * buh!
78+ - *
79+ - * @deprecated
80+ */
81+ public void javaDeprecatedThingie () { throw new RuntimeException(); }
82+ /**
Original file line number Diff line number Diff line change 259259- public interface X extends scala.Serializable, akka.rk.buh.is.it.Y<akka.rk.buh.is.it.A> {
260260+ public interface X extends java.io.Serializable, akka.rk.buh.is.it.Y<akka.rk.buh.is.it.A> {
261261 }
262+ --- target/expected_output/basic/akka/rk/buh/is/it/DontTouchThis.java
263+ +++ target/expected_output/basic/akka/rk/buh/is/it/DontTouchThis.java
264+ @@ -12,8 +12,6 @@
265+ public void alreadyDeprecatedInComment () { throw new RuntimeException(); }
266+ /**
267+ * buh!
268+ - *
269+ - * @deprecated
270+ */
271+ public void javaDeprecatedThingie () { throw new RuntimeException(); }
272+ /**
Original file line number Diff line number Diff line change 259259- public interface X extends scala.Serializable, akka.rk.buh.is.it.Y<akka.rk.buh.is.it.A> {
260260+ public interface X extends java.io.Serializable, akka.rk.buh.is.it.Y<akka.rk.buh.is.it.A> {
261261 }
262+ --- target/expected_output/basic/akka/rk/buh/is/it/DontTouchThis.java
263+ +++ target/expected_output/basic/akka/rk/buh/is/it/DontTouchThis.java
264+ @@ -12,8 +12,6 @@
265+ public void alreadyDeprecatedInComment () { throw new RuntimeException(); }
266+ /**
267+ * buh!
268+ - *
269+ - * @deprecated
270+ */
271+ public void javaDeprecatedThingie () { throw new RuntimeException(); }
272+ /**
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class BasicSpec extends CompilerSpec {
2121 if (new java.io.File (patchFile).exists) { // we have a patch to apply to expected output for this scala version
2222 " rm -rf target/expected_output" .! // cleanup from previous runs
2323 " cp -r src/test/resources/expected_output target/" .! // copy expected output to a place which is going to be patched
24- s " patch -p0 -i $patchFile" .! // path expected output
24+ s " patch -p0 --no-backup-if-mismatch - i $patchFile" .! // path expected output
2525 " target/expected_output/basic"
2626 } else {
2727 " src/test/resources/expected_output/basic"
You can’t perform that action at this time.
0 commit comments