@@ -75,7 +75,8 @@ class SimpleApi {
7575}
7676
7777class ApiReflectionTest extends AnyFunSuite {
78- test(" String API" ) {
78+ test(" String API JDK11" ) {
79+ assume(System .getProperty(" java.specification.version" ) == " 11" )
7980 assert(ApiInfo .materialize[String ].repr ==
8081 """ String {
8182 | def length(): Int
@@ -140,6 +141,79 @@ class ApiReflectionTest extends AnyFunSuite {
140141 )
141142 }
142143
144+ test(" String API JDK17" ) {
145+ assume(System .getProperty(" java.specification.version" ) == " 17" )
146+ assert(ApiInfo .materialize[String ].repr ==
147+ """ String {
148+ | def length(): Int
149+ | def isEmpty(): Boolean
150+ | def charAt(x$1: Int): Char
151+ | def codePointAt(x$1: Int): Int
152+ | def codePointBefore(x$1: Int): Int
153+ | def codePointCount(x$1: Int, x$2: Int): Int
154+ | def offsetByCodePoints(x$1: Int, x$2: Int): Int
155+ | def getChars(x$1: Int, x$2: Int, x$3: Array[Char], x$4: Int): Unit
156+ | def getBytes(x$1: Int, x$2: Int, x$3: Array[Byte], x$4: Int): Unit
157+ | def getBytes(x$1: String): Array[Byte]
158+ | def getBytes(x$1: java.nio.charset.Charset): Array[Byte]
159+ | def getBytes(): Array[Byte]
160+ | def contentEquals(x$1: StringBuffer): Boolean
161+ | def contentEquals(x$1: CharSequence): Boolean
162+ | def equalsIgnoreCase(x$1: String): Boolean
163+ | def compareTo(x$1: String): Int
164+ | def compareToIgnoreCase(x$1: String): Int
165+ | def regionMatches(x$1: Int, x$2: String, x$3: Int, x$4: Int): Boolean
166+ | def regionMatches(x$1: Boolean, x$2: Int, x$3: String, x$4: Int, x$5: Int): Boolean
167+ | def startsWith(x$1: String, x$2: Int): Boolean
168+ | def startsWith(x$1: String): Boolean
169+ | def endsWith(x$1: String): Boolean
170+ | def indexOf(x$1: Int): Int
171+ | def indexOf(x$1: Int, x$2: Int): Int
172+ | def lastIndexOf(x$1: Int): Int
173+ | def lastIndexOf(x$1: Int, x$2: Int): Int
174+ | def indexOf(x$1: String): Int
175+ | def indexOf(x$1: String, x$2: Int): Int
176+ | def lastIndexOf(x$1: String): Int
177+ | def lastIndexOf(x$1: String, x$2: Int): Int
178+ | def substring(x$1: Int): String
179+ | def substring(x$1: Int, x$2: Int): String
180+ | def subSequence(x$1: Int, x$2: Int): CharSequence
181+ | def concat(x$1: String): String
182+ | def replace(x$1: Char, x$2: Char): String
183+ | def matches(x$1: String): Boolean
184+ | def contains(x$1: CharSequence): Boolean
185+ | def replaceFirst(x$1: String, x$2: String): String
186+ | def replaceAll(x$1: String, x$2: String): String
187+ | def replace(x$1: CharSequence, x$2: CharSequence): String
188+ | def split(x$1: String, x$2: Int): Array[String]
189+ | def split(x$1: String): Array[String]
190+ | def toLowerCase(x$1: java.util.Locale): String
191+ | def toLowerCase(): String
192+ | def toUpperCase(x$1: java.util.Locale): String
193+ | def toUpperCase(): String
194+ | def trim(): String
195+ | def strip(): String
196+ | def stripLeading(): String
197+ | def stripTrailing(): String
198+ | def isBlank(): Boolean
199+ | def lines(): java.util.stream.Stream[String]
200+ | def indent(x$1: Int): String
201+ | def stripIndent(): String
202+ | def translateEscapes(): String
203+ | def transform[R](x$1: java.util.function.Function[_ >: String, _ <: R]): R
204+ | def chars(): java.util.stream.IntStream
205+ | def codePoints(): java.util.stream.IntStream
206+ | def toCharArray(): Array[Char]
207+ | def formatted(x$1: Seq[AnyRef]): String
208+ | def intern(): String
209+ | def repeat(x$1: Int): String
210+ | def describeConstable(): java.util.Optional[String]
211+ | def resolveConstantDesc(x$1: java.lang.invoke.MethodHandles.Lookup): String
212+ | final def +(x$1: Any): String
213+ |}""" .stripMargin
214+ )
215+ }
216+
143217 test(" Simple API" ) {
144218 assert(ApiInfo .materialize[SimpleApi ].repr ==
145219 """ com.avsystem.commons.rpc.SimpleApi {
0 commit comments