Skip to content

Commit

Permalink
Merge pull request #9323 from dwijnand/jdk11
Browse files Browse the repository at this point in the history
Fixes for JDK 11
  • Loading branch information
som-snytt committed Dec 4, 2020
2 parents aa37810 + 75093f7 commit e326432
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 19 deletions.
2 changes: 1 addition & 1 deletion test/files/neg/checksensible.check
Expand Up @@ -38,7 +38,7 @@ checksensible.scala:40: warning: comparing a fresh object using `==` will always
new AnyRef == 1
^
checksensible.scala:43: warning: comparing values of types Int and Boolean using `==` will always yield false
1 == (new java.lang.Boolean(true))
1 == java.lang.Boolean.valueOf(true)
^
checksensible.scala:45: warning: comparing values of types Int and Boolean using `!=` will always yield true
1 != true
Expand Down
10 changes: 5 additions & 5 deletions test/files/neg/checksensible.scala
Expand Up @@ -34,13 +34,13 @@ class EqEqValTest {
"abc" == 1 // warns because the lub of String and Int is Any
Some(1) == 1 // as above

true == new java.lang.Boolean(true) // none of these should warn except for deprecated API
new java.lang.Boolean(true) == true
true == java.lang.Boolean.valueOf(true) // none of these should warn
java.lang.Boolean.valueOf(true) == true

new AnyRef == 1
1 == new AnyRef // doesn't warn because it could be...
1 == (new java.lang.Integer(1)) // ...something like this
1 == (new java.lang.Boolean(true))
1 == new AnyRef // doesn't warn because it could be...
1 == java.lang.Integer.valueOf(1) // ...something like this
1 == java.lang.Boolean.valueOf(true)

1 != true
() == true
Expand Down
4 changes: 4 additions & 0 deletions test/files/neg/java-import-non-existing-selector.check
Expand Up @@ -2,5 +2,9 @@ java-import-non-existing-selector/BadClient.java:3: error: cannot find symbol
import static p1.Test.DoesNotExist;
^
symbol: static DoesNotExist
#partest java8
location: class
#partest !java8
location: class Test
#partest
1 error
11 changes: 0 additions & 11 deletions test/files/neg/t10680.check

This file was deleted.

2 changes: 2 additions & 0 deletions test/files/run/t7455.check
@@ -1,4 +1,6 @@
#partest java8
private[package <empty>] def <init>(x$1: String): Outer[E]
private[package <empty>] def <init>(): Outer$PrivateInner
private[package <empty>] def <init>(): Outer$PrivateStaticInner
private[package <empty>] def <init>(x$2: String): Outer$PublicInner
#partest
19 changes: 19 additions & 0 deletions test/scaladoc/run/anyref-doc.check
@@ -1,3 +1,4 @@
#partest java8
Some(Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(Wakes up all threads that are waiting on the receiver object's monitor), Text(.)))), Text(
))))))
)
Expand All @@ -14,4 +15,22 @@ Some(Body(List(Paragraph(Chain(List(Summary(Chain(List(Chain(List(Text(See ), Li
Some(Body(List(Paragraph(Chain(List(Summary(Chain(List(Chain(List(Text(Executes the code in ), Monospace(Text(body)), Text( with an exclusive lock on ), Monospace(Text(this)))), Text(.)))), Text(
))))))
@return Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(the result of ), Monospace(Text(body)))))))))))
#partest !java8
Some(Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(Wakes up all threads that are waiting on the receiver object's monitor), Text(.)))), Text(
))))))
)
List(scala.AnyRef#wait, scala.AnyRef#wait, scala.AnyRef#wait)
Some(Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(See ), Link(https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-,Text(https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)), Text(
), Text()))))))))
)
Some(Body(List(Paragraph(Chain(List(Summary(Chain(List(Chain(List(Text(See ), Link(https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-,Text(https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-)))), Text(.)))), Text(
))))))
)
Some(Body(List(Paragraph(Chain(List(Summary(Chain(List(Chain(List(Text(See ), Link(https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--,Text(https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--)))), Text(.)))), Text(
))))))
)
Some(Body(List(Paragraph(Chain(List(Summary(Chain(List(Chain(List(Text(Executes the code in ), Monospace(Text(body)), Text( with an exclusive lock on ), Monospace(Text(this)))), Text(.)))), Text(
))))))
@return Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(the result of ), Monospace(Text(body)))))))))))
#partest
Done.
5 changes: 3 additions & 2 deletions test/scaladoc/run/t191.scala
Expand Up @@ -34,6 +34,7 @@ object Test extends ScaladocModelTest {

def scalaURL = "http://bog.us"
val jdkURL = "http://java.us"
val jvmDir = if (scala.util.Properties.isJavaAtLeast(9)) "java.base/" else ""

override def scaladocSettings = {
val samplePath = getClass.getClassLoader.getResource("scala/Function1.class").getPath
Expand Down Expand Up @@ -77,14 +78,14 @@ object Test extends ScaladocModelTest {
case Seq(one) => scalaURL + "/" + one + ".html"
case Seq(one, two) => scalaURL + "/" + one + ".html#" + two
case x => throw new MatchError(x)
}) ++ Set(s"$jdkURL/java/lang/Throwable.html")
}) ++ Set(s"$jdkURL/${jvmDir}java/lang/Throwable.html")

def isExpectedExternalLink(l: EntityLink) = l.link match {
case LinkToExternalTpl(name, baseUrlString, tpl: TemplateEntity) =>
val baseUrl = new URI(Page.makeUrl(baseUrlString, Page.templateToPath(tpl)))
val url = if (name.isEmpty) baseUrl
else new URI(baseUrl.getScheme, baseUrl.getSchemeSpecificPart, name)
assert(expectedUrls contains url.toString, url.toString + " " + expectedUrls)
assert(expectedUrls.contains(url.toString), s"Expected $url in:${expectedUrls.map("\n " + _).mkString}")
true
case _ => false
}
Expand Down

0 comments on commit e326432

Please sign in to comment.