mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-03 06:58:23 +00:00
8154504: javac tests fail after JDK API is deprecated
Reviewed-by: darcy
This commit is contained in:
parent
2d863bcd37
commit
8f62cdc8a0
@ -33,7 +33,7 @@ public class CaptureInSubtype {
|
||||
|
||||
|
||||
public static class ShowFlaw extends SuperOfShowFlaw {
|
||||
static Flaw<Number> fn = new Flaw<Number>(new Integer(3));
|
||||
static Flaw<Number> fn = new Flaw<Number>(Integer.valueOf(3));
|
||||
|
||||
Flaw<?> m(){return fn;}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ interface I {
|
||||
static class T {
|
||||
static void f(I i) {
|
||||
if (i == null) {
|
||||
Integer x = new Integer(2);
|
||||
Integer x = Integer.valueOf(2);
|
||||
} else {
|
||||
I x = i;
|
||||
x.getClass();
|
||||
|
||||
@ -22,7 +22,7 @@ public class Nonlinear {
|
||||
// the program.
|
||||
|
||||
public static void main (String [] args) {
|
||||
Integer x = new Integer (5);
|
||||
Integer x = Integer.valueOf(5);
|
||||
String y = castit (x);
|
||||
System.out.println (y);
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ class BadTest4 {
|
||||
static <A> Cell<A> makeCell(A x) { return new Cell<A>(x); }
|
||||
static <A> A id(A x) { return x; }
|
||||
|
||||
static Integer i = new Integer(1);
|
||||
static Integer i = Integer.valueOf(1);
|
||||
static Number n = i;
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@ -13,6 +13,7 @@ class T8074381a {
|
||||
boolean m(String s);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
void testRaw() {
|
||||
Sub s1 = c -> true;
|
||||
Sub s2 = Boolean::new;
|
||||
@ -22,6 +23,7 @@ class T8074381a {
|
||||
};
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
void testNonRaw() {
|
||||
Sub<Integer> s1 = c -> true;
|
||||
Sub<Integer> s2 = Boolean::new;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
T8074381a.java:17:18: compiler.err.prob.found.req: (compiler.misc.no.suitable.functional.intf.inst: T8074381a.Sub)
|
||||
T8074381a.java:18:18: compiler.err.prob.found.req: (compiler.misc.no.suitable.functional.intf.inst: T8074381a.Sub)
|
||||
T8074381a.java:19:28: compiler.err.does.not.override.abstract: compiler.misc.anonymous.class: T8074381a$1, m(java.lang.Object), T8074381a.Sup
|
||||
T8074381a.java:19:18: compiler.err.prob.found.req: (compiler.misc.no.suitable.functional.intf.inst: T8074381a.Sub)
|
||||
T8074381a.java:20:28: compiler.err.does.not.override.abstract: compiler.misc.anonymous.class: T8074381a$1, m(java.lang.Object), T8074381a.Sup
|
||||
3 errors
|
||||
|
||||
@ -15,6 +15,6 @@ class TargetType27 {
|
||||
<A, R> F<A, R> m(F<A, R> f) { return null; }
|
||||
|
||||
void test() {
|
||||
m((String s1) -> (String s2) -> new Integer(1));
|
||||
m((String s1) -> (String s2) -> Integer.valueOf(1));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user