Merge
This commit is contained in:
commit
0eb4fd78fa
langtools
src/share/classes
com/sun/tools/javac
javax/lang/model/type
test/tools/javac
6464451
ArrayCloneCodeGen.javaClassLit.javaConditionalArgTypes_2.javaConditionalClass.javaIncorrectInheritance
JsrRet.javaNoNoClassDefFoundErrorError.javaT6266772.javaT6557865.javaUplevelFromAnonInSuperCall.javaannotations
neg
typeAnnotations
api
boxing
NoBoxingBool.javaNoBoxingByte.javaNoBoxingChar.javaNoBoxingDouble.javaNoBoxingFloat.javaNoBoxingInt.javaNoBoxingLong.javaNoBoxingShort.java
classfiles
enum
6384542
EnumAsIdentifier.javaEnumAsIdentifier.outEnumAsIdentifier4.outEnumAsIdentifier5.outFauxEnum2.javaforeach
generics
limits
linenumbers
meth
miranda
missingSuperRecovery
parser
proprietary
types
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -467,11 +467,24 @@ public abstract class Symbol extends AnnoConstruct implements Element {
|
||||
|
||||
private boolean hiddenIn(ClassSymbol clazz, Types types) {
|
||||
Symbol sym = hiddenInInternal(clazz, types);
|
||||
return sym != null && sym != this;
|
||||
Assert.check(sym != null, "the result of hiddenInInternal() can't be null");
|
||||
/* If we find the current symbol then there is no symbol hiding it
|
||||
*/
|
||||
return sym != this;
|
||||
}
|
||||
|
||||
private Symbol hiddenInInternal(ClassSymbol c, Types types) {
|
||||
Scope.Entry e = c.members().lookup(name);
|
||||
/** This method looks in the supertypes graph that has the current class as the
|
||||
* initial node, till it finds the current symbol or another symbol that hides it.
|
||||
* If the current class has more than one supertype (extends one class and
|
||||
* implements one or more interfaces) then null can be returned, meaning that
|
||||
* a wrong path in the supertypes graph was selected. Null can only be returned
|
||||
* as a temporary value, as a result of the recursive call.
|
||||
*/
|
||||
private Symbol hiddenInInternal(ClassSymbol currentClass, Types types) {
|
||||
if (currentClass == owner) {
|
||||
return this;
|
||||
}
|
||||
Scope.Entry e = currentClass.members().lookup(name);
|
||||
while (e.scope != null) {
|
||||
if (e.sym.kind == kind &&
|
||||
(kind != MTH ||
|
||||
@ -481,18 +494,19 @@ public abstract class Symbol extends AnnoConstruct implements Element {
|
||||
}
|
||||
e = e.next();
|
||||
}
|
||||
List<Symbol> hiddenSyms = List.nil();
|
||||
for (Type st : types.interfaces(c.type).prepend(types.supertype(c.type))) {
|
||||
Symbol hiddenSym = null;
|
||||
for (Type st : types.interfaces(currentClass.type)
|
||||
.prepend(types.supertype(currentClass.type))) {
|
||||
if (st != null && (st.hasTag(CLASS))) {
|
||||
Symbol sym = hiddenInInternal((ClassSymbol)st.tsym, types);
|
||||
if (sym != null) {
|
||||
hiddenSyms = hiddenSyms.prepend(hiddenInInternal((ClassSymbol)st.tsym, types));
|
||||
if (sym == this) {
|
||||
return this;
|
||||
} else if (sym != null) {
|
||||
hiddenSym = sym;
|
||||
}
|
||||
}
|
||||
}
|
||||
return hiddenSyms.contains(this) ?
|
||||
this :
|
||||
(hiddenSyms.isEmpty() ? null : hiddenSyms.head);
|
||||
return hiddenSym;
|
||||
}
|
||||
|
||||
/** Is this symbol inherited into a given class?
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -1481,8 +1481,21 @@ public abstract class Type extends AnnoConstruct implements TypeMirror {
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
if (inst != null) return inst.toString();
|
||||
else return qtype + "?";
|
||||
return (inst == null) ? qtype + "?" : inst.toString();
|
||||
}
|
||||
|
||||
public String debugString() {
|
||||
String result = "inference var = " + qtype + "\n";
|
||||
if (inst != null) {
|
||||
result += "inst = " + inst + '\n';
|
||||
}
|
||||
for (InferenceBound bound: InferenceBound.values()) {
|
||||
List<Type> aboundList = bounds.get(bound);
|
||||
if (aboundList.size() > 0) {
|
||||
result += bound + " = " + aboundList + '\n';
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1492,8 +1505,7 @@ public abstract class Type extends AnnoConstruct implements TypeMirror {
|
||||
|
||||
@Override
|
||||
public Type baseType() {
|
||||
if (inst != null) return inst.baseType();
|
||||
else return this;
|
||||
return (inst == null) ? this : inst.baseType();
|
||||
}
|
||||
|
||||
/** get all bounds of a given kind */
|
||||
|
@ -3208,6 +3208,7 @@ public class Types {
|
||||
return tvar.rank_field;
|
||||
}
|
||||
case ERROR:
|
||||
case NONE:
|
||||
return 0;
|
||||
default:
|
||||
throw new AssertionError();
|
||||
|
@ -808,9 +808,7 @@ public class Annotate {
|
||||
Attribute.TypeCompound tc =
|
||||
enterTypeAnnotation(a, syms.annotationType, env);
|
||||
|
||||
if (tc == null) {
|
||||
continue;
|
||||
}
|
||||
Assert.checkNonNull(tc, "Failed to create type annotation");
|
||||
|
||||
if (annotated.containsKey(a.type.tsym)) {
|
||||
if (!allowRepeatedAnnos) {
|
||||
@ -827,10 +825,9 @@ public class Annotate {
|
||||
}
|
||||
}
|
||||
|
||||
if (s != null) {
|
||||
s.appendTypeAttributesWithCompletion(
|
||||
new AnnotateRepeatedContext<>(env, annotated, pos, log, true));
|
||||
}
|
||||
Assert.checkNonNull(s, "Symbol argument to actualEnterTypeAnnotations is null");
|
||||
s.appendTypeAttributesWithCompletion(
|
||||
new AnnotateRepeatedContext<>(env, annotated, pos, log, true));
|
||||
} finally {
|
||||
if (prevLintPos != null)
|
||||
deferredLintHandler.setPos(prevLintPos);
|
||||
|
@ -2173,6 +2173,12 @@ public class Infer {
|
||||
//back-door to infer
|
||||
return Infer.this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Inference vars: " + inferencevars + '\n' +
|
||||
"Undet vars: " + undetvars;
|
||||
}
|
||||
}
|
||||
|
||||
final InferenceContext emptyContext = new InferenceContext(List.<Type>nil());
|
||||
|
@ -1037,7 +1037,7 @@ public class ClassWriter extends ClassFile {
|
||||
}
|
||||
databuf.appendChar(pool.get(inner));
|
||||
databuf.appendChar(
|
||||
inner.owner.kind == TYP ? pool.get(inner.owner) : 0);
|
||||
inner.owner.kind == TYP && !inner.name.isEmpty() ? pool.get(inner.owner) : 0);
|
||||
databuf.appendChar(
|
||||
!inner.name.isEmpty() ? pool.get(inner.name) : 0);
|
||||
databuf.appendChar(flags);
|
||||
|
@ -1910,6 +1910,7 @@ public class Gen extends JCTree.Visitor {
|
||||
if (!c.isFalse()) {
|
||||
code.resolve(c.trueJumps);
|
||||
int startpc = genCrt ? code.curCP() : 0;
|
||||
code.statBegin(tree.truepart.pos);
|
||||
genExpr(tree.truepart, pt).load();
|
||||
code.state.forceStackTop(tree.type);
|
||||
if (genCrt) code.crt.put(tree.truepart, CRT_FLOW_TARGET,
|
||||
@ -1919,6 +1920,7 @@ public class Gen extends JCTree.Visitor {
|
||||
if (elseChain != null) {
|
||||
code.resolve(elseChain);
|
||||
int startpc = genCrt ? code.curCP() : 0;
|
||||
code.statBegin(tree.falsepart.pos);
|
||||
genExpr(tree.falsepart, pt).load();
|
||||
code.state.forceStackTop(tree.type);
|
||||
if (genCrt) code.crt.put(tree.falsepart, CRT_FLOW_TARGET,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -70,6 +70,10 @@ public class MirroredTypeException extends MirroredTypesException {
|
||||
|
||||
/**
|
||||
* Explicitly set all transient fields.
|
||||
* @param s the serial stream
|
||||
* @throws ClassNotFoundException for a missing class during
|
||||
* deserialization
|
||||
* @throws IOException for an IO problem during deserialization
|
||||
*/
|
||||
private void readObject(ObjectInputStream s)
|
||||
throws IOException, ClassNotFoundException {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -85,6 +85,10 @@ public class MirroredTypesException extends RuntimeException {
|
||||
|
||||
/**
|
||||
* Explicitly set all transient fields.
|
||||
* @param s the serial stream
|
||||
* @throws ClassNotFoundException for a missing class during
|
||||
* deserialization
|
||||
* @throws IOException for an IO problem during deserialization
|
||||
*/
|
||||
private void readObject(ObjectInputStream s)
|
||||
throws IOException, ClassNotFoundException {
|
||||
|
@ -1,245 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @bug 6464451
|
||||
* @summary javac in 5.0ux can not compile try-finally block which has a lot of "return"
|
||||
* @author Wei Tao
|
||||
* @compile -source 5 -target 5 BigFinally.java
|
||||
* @clean BigFinally
|
||||
* @compile/fail BigFinally.java
|
||||
*/
|
||||
|
||||
public class BigFinally {
|
||||
static public int func(int i) {
|
||||
try {
|
||||
if(i == 1) return 1;
|
||||
} finally {
|
||||
try {
|
||||
if(i == 2) return 2;
|
||||
if(i == 3 ) return 3;
|
||||
if(i == 4 ) return 4;
|
||||
if(i == 5 ) return 5;
|
||||
if(i == 6 ) return 6;
|
||||
if(i == 7 ) return 7;
|
||||
if(i == 8 ) return 8;
|
||||
if(i == 9 ) return 9;
|
||||
if(i == 10 ) return 10;
|
||||
if(i == 11 ) return 11;
|
||||
if(i == 12 ) return 12;
|
||||
if(i == 13 ) return 13;
|
||||
if(i == 14 ) return 14;
|
||||
if(i == 15 ) return 15;
|
||||
if(i == 16 ) return 16;
|
||||
if(i == 17 ) return 17;
|
||||
if(i == 18 ) return 18;
|
||||
if(i == 19 ) return 19;
|
||||
if(i == 20 ) return 20;
|
||||
if(i == 21 ) return 21;
|
||||
if(i == 22 ) return 22;
|
||||
if(i == 23 ) return 23;
|
||||
if(i == 24 ) return 24;
|
||||
if(i == 25 ) return 25;
|
||||
if(i == 26 ) return 26;
|
||||
if(i == 27 ) return 27;
|
||||
if(i == 28 ) return 28;
|
||||
if(i == 29 ) return 29;
|
||||
if(i == 30 ) return 30;
|
||||
if(i == 31 ) return 31;
|
||||
if(i == 32 ) return 32;
|
||||
if(i == 33 ) return 33;
|
||||
if(i == 34 ) return 34;
|
||||
if(i == 35 ) return 35;
|
||||
if(i == 36 ) return 36;
|
||||
if(i == 37 ) return 37;
|
||||
if(i == 38 ) return 38;
|
||||
if(i == 39 ) return 39;
|
||||
if(i == 40 ) return 40;
|
||||
if(i == 41 ) return 41;
|
||||
if(i == 42 ) return 42;
|
||||
if(i == 43 ) return 43;
|
||||
if(i == 44 ) return 44;
|
||||
if(i == 45 ) return 45;
|
||||
if(i == 46 ) return 46;
|
||||
if(i == 47 ) return 47;
|
||||
if(i == 48 ) return 48;
|
||||
if(i == 49 ) return 49;
|
||||
if(i == 50 ) return 50;
|
||||
if(i == 51 ) return 51;
|
||||
if(i == 52 ) return 52;
|
||||
if(i == 53 ) return 53;
|
||||
if(i == 54 ) return 54;
|
||||
if(i == 55 ) return 55;
|
||||
if(i == 56 ) return 56;
|
||||
if(i == 57 ) return 57;
|
||||
if(i == 58 ) return 58;
|
||||
if(i == 59 ) return 59;
|
||||
if(i == 60 ) return 60;
|
||||
if(i == 61 ) return 61;
|
||||
if(i == 62 ) return 62;
|
||||
if(i == 63 ) return 63;
|
||||
if(i == 64 ) return 64;
|
||||
if(i == 65 ) return 65;
|
||||
if(i == 66 ) return 66;
|
||||
if(i == 67 ) return 67;
|
||||
if(i == 68 ) return 68;
|
||||
if(i == 69 ) return 69;
|
||||
if(i == 70 ) return 70;
|
||||
if(i == 71 ) return 71;
|
||||
if(i == 72 ) return 72;
|
||||
if(i == 73 ) return 73;
|
||||
if(i == 74 ) return 74;
|
||||
if(i == 75 ) return 75;
|
||||
if(i == 76 ) return 76;
|
||||
if(i == 77 ) return 77;
|
||||
if(i == 78 ) return 78;
|
||||
if(i == 79 ) return 79;
|
||||
if(i == 80 ) return 80;
|
||||
if(i == 81 ) return 81;
|
||||
if(i == 82 ) return 82;
|
||||
if(i == 83 ) return 83;
|
||||
if(i == 84 ) return 84;
|
||||
if(i == 85 ) return 85;
|
||||
if(i == 86 ) return 86;
|
||||
if(i == 87 ) return 87;
|
||||
if(i == 88 ) return 88;
|
||||
if(i == 89 ) return 89;
|
||||
if(i == 90 ) return 90;
|
||||
if(i == 91 ) return 91;
|
||||
if(i == 92 ) return 92;
|
||||
if(i == 93 ) return 93;
|
||||
if(i == 94 ) return 94;
|
||||
if(i == 95 ) return 95;
|
||||
if(i == 96 ) return 96;
|
||||
if(i == 97 ) return 97;
|
||||
if(i == 98 ) return 98;
|
||||
if(i == 99 ) return 99;
|
||||
if(i == 100 ) return 100;
|
||||
} finally {
|
||||
int x = 0;
|
||||
x += 1;
|
||||
x += 2;
|
||||
x += 3;
|
||||
x += 4;
|
||||
x += 5;
|
||||
x += 6;
|
||||
x += 7;
|
||||
x += 8;
|
||||
x += 9;
|
||||
x += 10;
|
||||
x += 11;
|
||||
x += 12;
|
||||
x += 13;
|
||||
x += 14;
|
||||
x += 15;
|
||||
x += 16;
|
||||
x += 17;
|
||||
x += 18;
|
||||
x += 19;
|
||||
x += 20;
|
||||
x += 21;
|
||||
x += 22;
|
||||
x += 23;
|
||||
x += 24;
|
||||
x += 25;
|
||||
x += 26;
|
||||
x += 27;
|
||||
x += 28;
|
||||
x += 29;
|
||||
x += 30;
|
||||
x += 31;
|
||||
x += 32;
|
||||
x += 33;
|
||||
x += 34;
|
||||
x += 35;
|
||||
x += 36;
|
||||
x += 37;
|
||||
x += 38;
|
||||
x += 39;
|
||||
x += 40;
|
||||
x += 41;
|
||||
x += 42;
|
||||
x += 43;
|
||||
x += 44;
|
||||
x += 45;
|
||||
x += 46;
|
||||
x += 47;
|
||||
x += 48;
|
||||
x += 49;
|
||||
x += 50;
|
||||
x += 51;
|
||||
x += 52;
|
||||
x += 53;
|
||||
x += 54;
|
||||
x += 55;
|
||||
x += 56;
|
||||
x += 57;
|
||||
x += 58;
|
||||
x += 59;
|
||||
x += 60;
|
||||
x += 61;
|
||||
x += 62;
|
||||
x += 63;
|
||||
x += 64;
|
||||
x += 65;
|
||||
x += 66;
|
||||
x += 67;
|
||||
x += 68;
|
||||
x += 69;
|
||||
x += 70;
|
||||
x += 71;
|
||||
x += 72;
|
||||
x += 73;
|
||||
x += 74;
|
||||
x += 75;
|
||||
x += 76;
|
||||
x += 77;
|
||||
x += 78;
|
||||
x += 79;
|
||||
x += 80;
|
||||
x += 81;
|
||||
x += 82;
|
||||
x += 83;
|
||||
x += 84;
|
||||
x += 85;
|
||||
x += 86;
|
||||
x += 87;
|
||||
x += 88;
|
||||
x += 89;
|
||||
x += 90;
|
||||
x += 91;
|
||||
x += 92;
|
||||
x += 93;
|
||||
x += 94;
|
||||
x += 95;
|
||||
x += 96;
|
||||
x += 97;
|
||||
x += 98;
|
||||
x += 99;
|
||||
x += 100;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @bug 6464451
|
||||
* @summary javac in 5.0ux can not compile try-finally block which has a lot of "return"
|
||||
* @author Wei Tao
|
||||
* @compile -source 5 -target 5 DeepNestedFinally.java
|
||||
* @clean DeepNestedFinally
|
||||
* @compile/fail DeepNestedFinally.java
|
||||
*/
|
||||
|
||||
public class DeepNestedFinally {
|
||||
static public int func(int i) {
|
||||
try {
|
||||
if(i == 1) return 1;
|
||||
} finally {
|
||||
try {
|
||||
if(i == 2) return 2;
|
||||
} finally {
|
||||
try {
|
||||
if(i == 3) return 3;
|
||||
} finally {
|
||||
try {
|
||||
if(i == 4) return 4;
|
||||
} finally {
|
||||
try {
|
||||
if(i == 5) return 5;
|
||||
} finally {
|
||||
try {
|
||||
if(i == 6) return 6;
|
||||
} finally {
|
||||
try {
|
||||
if (i == 7) return 7;
|
||||
} finally {
|
||||
int x = 0;
|
||||
x += 1;
|
||||
x += 2;
|
||||
x += 3;
|
||||
x += 4;
|
||||
x += 5;
|
||||
x += 6;
|
||||
x += 7;
|
||||
x += 8;
|
||||
x += 9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4267335
|
||||
* @summary Verify that code generated for Array.clone() with -target 1.2 passes verifier.
|
||||
* @author maddox
|
||||
*
|
||||
* @run compile -source 1.3 -target 1.2 ArrayCloneCodeGen.java
|
||||
* @run main/othervm -Xverify:all ArrayCloneCodeGen
|
||||
*/
|
||||
|
||||
public class ArrayCloneCodeGen {
|
||||
|
||||
public static void main(String[] args) {}
|
||||
|
||||
private String[] args = null;
|
||||
|
||||
public String[] getArgs() {
|
||||
return (String []) (args.clone());
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,9 +26,6 @@
|
||||
* @bug 4884387
|
||||
* @summary Use ldc instruction for class literals
|
||||
* @author gafter
|
||||
*
|
||||
* @compile -source 1.5 -target 1.5 ClassLit.java
|
||||
* @run main ClassLit
|
||||
*/
|
||||
|
||||
public class ClassLit {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,7 +27,6 @@
|
||||
* @summary Verify that both branches of a conditional expression must agree in type.
|
||||
* @author maddox
|
||||
*
|
||||
* @compile/fail -source 1.4 ConditionalArgTypes_2.java
|
||||
* @compile ConditionalArgTypes_2.java
|
||||
*/
|
||||
|
||||
|
@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4949627
|
||||
* @summary javac crashes on code for new rule for semantics of ? without -source 1.5
|
||||
* @author gafter
|
||||
*
|
||||
* @compile -source 1.4 ConditionalClass.java
|
||||
*/
|
||||
|
||||
package conditional.clazz;
|
||||
|
||||
class A{}
|
||||
class B{}
|
||||
|
||||
public class ConditionalClass {
|
||||
void foo(){
|
||||
boolean b = false;
|
||||
Class a = b ? A.class : B.class;
|
||||
System.out.println("a is " + a.getName());
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new ConditionalClass().foo();
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8034924
|
||||
* @summary Incorrect inheritance of inaccessible static method
|
||||
* @library /tools/javac/lib
|
||||
* @build ToolBox
|
||||
* @run main IncorrectInheritanceTest
|
||||
*/
|
||||
|
||||
public class IncorrectInheritanceTest {
|
||||
private static final String ASrc =
|
||||
"package pkg;\n" +
|
||||
"\n" +
|
||||
"public class A {\n" +
|
||||
" static void foo(Object o) {}\n" +
|
||||
" private static void bar(Object o) {}\n" +
|
||||
"}";
|
||||
|
||||
private static final String BSrc =
|
||||
"import pkg.A;\n" +
|
||||
"class B extends A {\n" +
|
||||
" public void foo(Object o) {}\n" +
|
||||
" public void bar(Object o) {}\n" +
|
||||
"}";
|
||||
|
||||
private static final String CSrc =
|
||||
"class C extends B {\n" +
|
||||
" public void m(Object o) {\n" +
|
||||
" foo(o);\n" +
|
||||
" bar(o);\n" +
|
||||
" }\n" +
|
||||
"}";
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
new IncorrectInheritanceTest().test();
|
||||
}
|
||||
|
||||
public void test() throws Exception {
|
||||
ToolBox.JavaToolArgs javacParams =
|
||||
new ToolBox.JavaToolArgs()
|
||||
.setSources(ASrc, BSrc, CSrc);
|
||||
ToolBox.javac(javacParams);
|
||||
}
|
||||
|
||||
}
|
@ -27,7 +27,7 @@
|
||||
* @summary StackOverflowError from javac
|
||||
* @author gafter
|
||||
*
|
||||
* @compile -source 1.5 -target 1.5 JsrRet.java
|
||||
* @compile JsrRet.java
|
||||
*/
|
||||
|
||||
package jsr.ret;
|
||||
|
@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4313429
|
||||
* @summary Compiling <Classname>.class on CLDC crashed the compiler.
|
||||
*
|
||||
* @compile/fail -source 1.4 -target 1.4 -XDfailcomplete=java.lang.NoClassDefFoundError NoNoClassDefFoundErrorError.java
|
||||
*/
|
||||
|
||||
class NoNoClassDefFoundErrorError {
|
||||
public static void main() {
|
||||
Class self = NoNoClassDefFoundErrorError.class;
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,9 +26,6 @@
|
||||
* @bug 6266772
|
||||
* @summary javac crashes, assertion failure in Lower.java
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail -source 1.4 T6266772.java
|
||||
* @compile T6266772.java
|
||||
* @run main T6266772
|
||||
*/
|
||||
|
||||
public class T6266772 {
|
||||
|
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6557865
|
||||
* @summary -source 5 -target 5 should not put ACC_SYNTHETIC on package-info
|
||||
* @author Wei Tao
|
||||
* @compile T6557865.java
|
||||
* @compile -source 5 -target 5 T6232928/package-info.java
|
||||
* @run main T6557865
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Modifier;
|
||||
|
||||
public class T6557865 {
|
||||
public static void main(String... args) throws Exception {
|
||||
Class pkginfo_cls = Class.forName("T6232928.package-info");
|
||||
int mod = pkginfo_cls.getModifiers();
|
||||
if ((mod & 0x1000) != 0) {
|
||||
throw new AssertionError("Test failed: interface package-info shouldn't be synthetic in -target 5.");
|
||||
}
|
||||
}
|
||||
}
|
@ -29,7 +29,6 @@
|
||||
* @author maddox (cribbed from bracha/lillibridge) gafter
|
||||
*
|
||||
* @compile UplevelFromAnonInSuperCall.java
|
||||
* @compile/fail -source 1.4 UplevelFromAnonInSuperCall.java
|
||||
*/
|
||||
|
||||
class UplevelFromAnonInSuperCall {
|
||||
|
@ -27,7 +27,6 @@
|
||||
* @summary Please add annotation <at>Deprecated to supplant the javadoc tag
|
||||
* @author gafter
|
||||
*
|
||||
* @compile -source 1.4 -Xlint:-options -Xlint:dep-ann -Werror Dep.java
|
||||
* @compile/fail -Xlint:dep-ann -Werror Dep.java
|
||||
* @compile -Xlint:dep-ann Dep.java
|
||||
*/
|
||||
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 5036565
|
||||
* @summary Annotations definitions are allowed using -source 1.4 but not annotations
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail -source 1.4 MixedSource.java
|
||||
*/
|
||||
|
||||
package mixed.source;
|
||||
|
||||
@interface foo {}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -49,7 +49,7 @@ public class ClassfileTestHelper {
|
||||
|
||||
File compile(File f) {
|
||||
int rc = com.sun.tools.javac.Main.compile(new String[] {
|
||||
"-source", "1.8", "-g", f.getPath() });
|
||||
"-g", f.getPath() });
|
||||
if (rc != 0)
|
||||
throw new Error("compilation failed. rc=" + rc);
|
||||
String path = f.getPath();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -146,7 +146,7 @@ public class NoTargetAnnotations {
|
||||
}
|
||||
|
||||
File compileTestFile(File f) {
|
||||
int rc = com.sun.tools.javac.Main.compile(new String[] { "-XDTA:writer", "-source", "1.8", "-g", f.getPath() });
|
||||
int rc = com.sun.tools.javac.Main.compile(new String[] { "-XDTA:writer", "-g", f.getPath() });
|
||||
if (rc != 0)
|
||||
throw new Error("compilation failed. rc=" + rc);
|
||||
String path = f.getPath();
|
||||
|
@ -180,7 +180,6 @@ public class Driver {
|
||||
|
||||
protected File compileTestFile(File f, String testClass, String... extraParams) {
|
||||
List<String> options = new ArrayList<>();
|
||||
options.addAll(Arrays.asList("-source", "1.8"));
|
||||
options.addAll(Arrays.asList(extraParams));
|
||||
options.add(f.getPath());
|
||||
int rc = com.sun.tools.javac.Main.compile(options.toArray(new String[options.size()]));
|
||||
|
@ -49,6 +49,6 @@ public class T6265137 {
|
||||
String srcdir = System.getProperty("test.src");
|
||||
Iterable<? extends JavaFileObject> files =
|
||||
fm.getJavaFileObjectsFromFiles(Arrays.asList(new File(srcdir, "T6265137a.java")));
|
||||
javac.getTask(null, fm, dl, Arrays.asList("-target","1.5"), null, files).call();
|
||||
javac.getTask(null, fm, dl, Arrays.asList("-target","9"), null, files).call();
|
||||
}
|
||||
}
|
||||
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6177400
|
||||
* @summary Boxing allowed with -source 1.4
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail -source 1.4 NoBoxingBool.java
|
||||
*/
|
||||
|
||||
public class NoBoxingBool {
|
||||
Boolean b = false;
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6177400
|
||||
* @summary Boxing allowed with -source 1.4
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail -source 1.4 NoBoxingByte.java
|
||||
*/
|
||||
|
||||
public class NoBoxingByte {
|
||||
Byte b = 0;
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6177400
|
||||
* @summary Boxing allowed with -source 1.4
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail -source 1.4 NoBoxingChar.java
|
||||
*/
|
||||
|
||||
public class NoBoxingChar {
|
||||
Character c = '\u0000';
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6177400
|
||||
* @summary Boxing allowed with -source 1.4
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail -source 1.4 NoBoxingDouble.java
|
||||
*/
|
||||
|
||||
public class NoBoxingDouble {
|
||||
Double d = 0D;
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6177400
|
||||
* @summary Boxing allowed with -source 1.4
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail -source 1.4 NoBoxingFloat.java
|
||||
*/
|
||||
|
||||
public class NoBoxingFloat {
|
||||
Float f = 0F;
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6177400
|
||||
* @summary Boxing allowed with -source 1.4
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail -source 1.4 NoBoxingInt.java
|
||||
*/
|
||||
|
||||
public class NoBoxingInt {
|
||||
Integer i = 0;
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6177400
|
||||
* @summary Boxing allowed with -source 1.4
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail -source 1.4 NoBoxingLong.java
|
||||
*/
|
||||
|
||||
public class NoBoxingLong {
|
||||
Long l = 0L;
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6177400
|
||||
* @summary Boxing allowed with -source 1.4
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail -source 1.4 NoBoxingShort.java
|
||||
*/
|
||||
|
||||
public class NoBoxingShort {
|
||||
Short s = 0;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -37,7 +37,7 @@ import java.util.regex.*;
|
||||
public class ClassVersionChecker {
|
||||
|
||||
int errors;
|
||||
String[] jdk = {"","1.2","1.3","1.4","1.5","1.6","1.7","1.8"};
|
||||
String[] jdk = {"","1.6","1.7","1.8"};
|
||||
File javaFile = null;
|
||||
|
||||
public static void main(String[] args) throws Throwable {
|
||||
@ -47,7 +47,7 @@ public class ClassVersionChecker {
|
||||
void run() throws Exception {
|
||||
writeTestFile();
|
||||
/* Rules applicable for -source and -target combinations
|
||||
* 1. If both empty, version num is for 1.7
|
||||
* 1. If both empty, version num is for the current release
|
||||
* 2. If source is not empty and target is empty, version is based on source
|
||||
* 3. If both non-empty, version is based on target
|
||||
*/
|
||||
@ -57,14 +57,10 @@ public class ClassVersionChecker {
|
||||
* -1 => invalid combinations
|
||||
*/
|
||||
int[][] ver =
|
||||
{{52, -1, -1, -1, -1, -1, -1, -1},
|
||||
{48, 46, 47, 48, 49, 50, 51, 52},
|
||||
{48, 46, 47, 48, 49, 50, 51, 52},
|
||||
{48, -1, -1, 48, 49, 50, 51, 52},
|
||||
{52, -1, -1, -1, 49, 50, 51, 52},
|
||||
{52, -1, -1, -1, -1, 50, 51, 52},
|
||||
{52, -1, -1, -1, -1, -1, 51, 52},
|
||||
{52, -1, -1, -1, -1, -1, -1, 52}};
|
||||
{{52, -1, -1, -1},
|
||||
{52, 50, 51, 52},
|
||||
{52, -1, 51, 52},
|
||||
{52, -1, -1, 52}};
|
||||
|
||||
// Loop to run all possible combinations of source/target values
|
||||
for (int i = 0; i< ver.length; i++) {
|
||||
|
@ -0,0 +1,97 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/** @test
|
||||
* @bug 8034854
|
||||
* @summary Verify that the InnerClasses attribute has outer_class_info_index zero if it has
|
||||
* inner_name_index zero (for synthetic classes)
|
||||
* @compile SyntheticClasses.java
|
||||
* @run main SyntheticClasses
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import com.sun.tools.classfile.*;
|
||||
|
||||
public class SyntheticClasses {
|
||||
|
||||
public static void main(String[] args) throws IOException, ConstantPoolException {
|
||||
new SyntheticClasses().run();
|
||||
}
|
||||
|
||||
private void run() throws IOException, ConstantPoolException {
|
||||
File testClasses = new File(System.getProperty("test.classes"));
|
||||
for (File classFile : testClasses.listFiles()) {
|
||||
ClassFile cf = ClassFile.read(classFile);
|
||||
if (cf.getName().matches(".*\\$[0-9]+")) {
|
||||
EnclosingMethod_attribute encl =
|
||||
(EnclosingMethod_attribute) cf.getAttribute(Attribute.EnclosingMethod);
|
||||
if (encl != null) {
|
||||
if (encl.method_index != 0)
|
||||
throw new IllegalStateException("Invalid EnclosingMethod.method_index: " +
|
||||
encl.method_index + ".");
|
||||
}
|
||||
}
|
||||
InnerClasses_attribute attr =
|
||||
(InnerClasses_attribute) cf.getAttribute(Attribute.InnerClasses);
|
||||
if (attr != null) {
|
||||
for (InnerClasses_attribute.Info info : attr.classes) {
|
||||
if (cf.major_version < 51)
|
||||
throw new IllegalStateException();
|
||||
if (info.inner_name_index == 0 && info.outer_class_info_index != 0)
|
||||
throw new IllegalStateException("Invalid outer_class_info_index=" +
|
||||
info.outer_class_info_index +
|
||||
"; inner_name_index=" +
|
||||
info.inner_name_index + ".");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class SyntheticConstructorAccessTag {
|
||||
|
||||
private static class A {
|
||||
private A(){}
|
||||
}
|
||||
|
||||
public void test() {
|
||||
new A();
|
||||
}
|
||||
}
|
||||
|
||||
class SyntheticEnumMapping {
|
||||
private int convert(E e) {
|
||||
switch (e) {
|
||||
case A: return 0;
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
enum E { A }
|
||||
}
|
||||
|
||||
interface SyntheticAssertionsDisabled {
|
||||
public default void test() {
|
||||
assert false;
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
/**
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 6384542
|
||||
* @summary crash: test/tools/javac/versions/check.sh
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail -source 1.4 -Xlint:-options T6384542.java
|
||||
* @compile/fail/ref=T6384542.out -source 1.4 -Xlint:-options -XDrawDiagnostics T6384542.java
|
||||
*/
|
||||
|
||||
import static java.lang.Math.sin;
|
||||
|
||||
public enum A { }
|
||||
class B {
|
||||
int i = 0xCafe.BabeP1;
|
||||
List<X> l;
|
||||
public static void main(String... args) {
|
||||
for (String arg : args) {
|
||||
System.out.println(arg);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String toString() { return null; }
|
||||
}
|
||||
public klass C { }
|
@ -1,9 +0,0 @@
|
||||
T6384542.java:10:8: compiler.err.static.import.not.supported.in.source: 1.4
|
||||
T6384542.java:12:8: compiler.err.enums.not.supported.in.source: 1.4
|
||||
T6384542.java:14:13: compiler.err.unsupported.fp.lit: 1.4
|
||||
T6384542.java:15:9: compiler.err.generics.not.supported.in.source: 1.4
|
||||
T6384542.java:16:35: compiler.err.varargs.not.supported.in.source: 1.4
|
||||
T6384542.java:17:25: compiler.err.foreach.not.supported.in.source: 1.4
|
||||
T6384542.java:21:6: compiler.err.annotations.not.supported.in.source: 1.4
|
||||
T6384542.java:24:8: compiler.err.expected3: class, interface, enum
|
||||
8 errors
|
@ -1,14 +0,0 @@
|
||||
/**
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 6384542
|
||||
* @summary crash: test/tools/javac/versions/check.sh
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail -source 5 T6384542a.java
|
||||
* @compile -source 1.4 T6384542a.java
|
||||
* @compile/fail/ref=T6384542a_5.out -source 5 -Xlint:-options -XDrawDiagnostics T6384542a.java
|
||||
* @compile/ref=T6384542a_1_4.out -source 1.4 -Xlint:-options -XDrawDiagnostics T6384542a.java
|
||||
*/
|
||||
|
||||
public class T6384542a {
|
||||
T6384542a enum = null;
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
T6384542a.java:13:15: compiler.warn.enum.as.identifier
|
||||
1 warning
|
@ -1,2 +0,0 @@
|
||||
T6384542a.java:13:15: compiler.err.enum.as.identifier
|
||||
1 error
|
@ -3,8 +3,6 @@
|
||||
* @bug 8025537
|
||||
* @author sogoel
|
||||
* @summary enum keyword used as an identifier
|
||||
* @compile/ref=EnumAsIdentifier4.out -XDrawDiagnostics -source 1.4 EnumAsIdentifier.java
|
||||
* @compile/fail/ref=EnumAsIdentifier5.out -XDrawDiagnostics -source 1.5 EnumAsIdentifier.java
|
||||
* @compile/fail/ref=EnumAsIdentifier.out -XDrawDiagnostics EnumAsIdentifier.java
|
||||
*/
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
EnumAsIdentifier.java:13:9: compiler.err.enum.as.identifier
|
||||
EnumAsIdentifier.java:11:9: compiler.err.enum.as.identifier
|
||||
1 error
|
||||
|
@ -1,6 +0,0 @@
|
||||
- compiler.warn.source.no.bootclasspath: 1.4
|
||||
- compiler.warn.option.obsolete.source: 1.4
|
||||
- compiler.warn.option.obsolete.target: 1.4
|
||||
- compiler.warn.option.obsolete.suppression
|
||||
EnumAsIdentifier.java:13:9: compiler.warn.enum.as.identifier
|
||||
5 warnings
|
@ -1,6 +0,0 @@
|
||||
- compiler.warn.source.no.bootclasspath: 1.5
|
||||
- compiler.warn.option.obsolete.source: 1.5
|
||||
- compiler.warn.option.obsolete.suppression
|
||||
EnumAsIdentifier.java:13:9: compiler.err.enum.as.identifier
|
||||
1 error
|
||||
3 warnings
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 5009574
|
||||
* @summary verify java.lang.Enum can't be directly subclassed
|
||||
* @author Joseph D. Darcy
|
||||
*
|
||||
* @compile/fail -source 1.4 FauxEnum2.java
|
||||
*/
|
||||
|
||||
public class FauxEnum2 extends java.lang.Enum {
|
||||
FauxEnum2() {
|
||||
super("", 0);
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6682380 6679509
|
||||
* @summary Foreach loop with generics inside finally block crashes javac with -target 1.5
|
||||
* @author Jan Lahoda, Maurizio Cimadamore
|
||||
* @compile -source 1.5 -target 1.5 T6682380.java
|
||||
*/
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class T6682380<X> {
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
} finally {
|
||||
List<T6682380<?>> l = null;
|
||||
T6682380<?>[] a = null;
|
||||
for (T6682380<?> e1 : l);
|
||||
for (T6682380<?> e2 : a);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4902704
|
||||
* @summary javac generates inappropriate bridge methods in -source 1.4
|
||||
* @author gafter
|
||||
*
|
||||
* @compile -source 1.4 -target 1.4 BridgeRestype.java
|
||||
* @run main BridgeRestype
|
||||
*/
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class BridgeRestype extends Vector {
|
||||
public static void main(String[] args) {
|
||||
BridgeRestype t = new BridgeRestype();
|
||||
for (int i=0; i<args.length; i++) t.add(args[i]);
|
||||
Iterator i = t.iterator();
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,7 +27,6 @@
|
||||
* @summary casting conversion checks changed for covariant returns
|
||||
* @author gafter
|
||||
*
|
||||
* @compile -source 1.4 RefEqual.java
|
||||
* @compile/fail RefEqual.java
|
||||
*/
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,8 +26,6 @@
|
||||
* @bug 5094318
|
||||
* @summary REGRESSION: Array cloning is not backwards compatible
|
||||
*
|
||||
* @compile -source 1.4 T5094318.java
|
||||
* @run main T5094318
|
||||
* @compile T5094318.java
|
||||
* @run main/fail T5094318
|
||||
*/
|
||||
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4836051
|
||||
* @summary generics: non-generic code should be able to call covariant method
|
||||
* @author gafter
|
||||
*
|
||||
* @compile CovariantCompat1.java
|
||||
* @compile -source 1.4 CovariantCompat2.java
|
||||
*/
|
||||
|
||||
class CovariantCompat1 {
|
||||
static class A {
|
||||
public A foo() { return this; }
|
||||
}
|
||||
static class B extends A {
|
||||
public B foo() { return this; }
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
class CovariantCompat2 {
|
||||
static {
|
||||
CovariantCompat1.B x = new CovariantCompat1.B();
|
||||
CovariantCompat1.B o = x.foo();
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4836048 4868021 5030040 5052968 5056864
|
||||
* @summary generics: compiler allows 1.4 code to override a bridge method
|
||||
* @author gafter
|
||||
*
|
||||
* @compile OverrideBridge1.java
|
||||
* @compile/fail -Werror -source 1.4 OverrideBridge2.java
|
||||
* @compile -source 1.4 OverrideBridge2.java
|
||||
* @compile OverrideBridge3.java
|
||||
*/
|
||||
|
||||
// ALLOW users to override bridge methods.
|
||||
|
||||
// Note the long list of bug numbers on this regression test. They
|
||||
// indicate the number of times we've flip-flopped on this issue.
|
||||
// 5030040 shows why we must give a diagnostic. 5052968 shows why it
|
||||
// must be a warning.
|
||||
|
||||
class OverrideBridge1 {
|
||||
static class A<T> {
|
||||
public void foo(T t) { }
|
||||
}
|
||||
static class B extends A<String> {
|
||||
public void foo(String t) { }
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
class OverrideBridge3 {
|
||||
static class C extends OverrideBridge2.B {
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4830291
|
||||
* @summary javac makes String non-backward compatible
|
||||
* @author gafter
|
||||
*
|
||||
* @compile -source 1.4 VisibleBridge.java
|
||||
*/
|
||||
|
||||
// Ensure that bridge methods are visible for maximum
|
||||
// backward compatibility.
|
||||
|
||||
class VisibleBridge {
|
||||
static {
|
||||
Object o = "b";
|
||||
if ("a".compareTo(o) > 0) {}
|
||||
}
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4739388
|
||||
* @summary regression: javac generates too much bytecode for deply nested try-finally
|
||||
* @author gafter
|
||||
*
|
||||
* @compile -source 1.4 -target 1.4 FinallyNesting.java
|
||||
*/
|
||||
// Source and target 1.4 are needed for the test to pass with default memory sizes.
|
||||
class FinallyNesting {
|
||||
public static void main(String[] args) {
|
||||
int x;
|
||||
try { x = 1; } finally {
|
||||
try { x = 1; } finally {
|
||||
try { x = 1; } finally {
|
||||
try { x = 1; } finally {
|
||||
try { x = 1; } finally {
|
||||
try { x = 1; } finally {
|
||||
try { x = 1; } finally {
|
||||
try { x = 1; } finally {
|
||||
try { x = 1; } finally {
|
||||
try { x = 1; } finally {
|
||||
try { x = 1; } finally {
|
||||
try { x = 1; } finally {
|
||||
try { x = 1; } finally {
|
||||
try { x = 1; } finally {
|
||||
try { x = 1; } finally {
|
||||
x = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8034091
|
||||
* @summary Add LineNumberTable attributes for conditional operator (?:) split across several lines.
|
||||
*/
|
||||
|
||||
import com.sun.tools.classfile.ClassFile;
|
||||
import com.sun.tools.classfile.ConstantPoolException;
|
||||
import com.sun.tools.classfile.Method;
|
||||
import com.sun.tools.classfile.Attribute;
|
||||
import com.sun.tools.classfile.Code_attribute;
|
||||
import com.sun.tools.classfile.LineNumberTable_attribute;
|
||||
import com.sun.tools.classfile.LineNumberTable_attribute.Entry;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class ConditionalLineNumberTest {
|
||||
public static void main(String[] args) throws Exception {
|
||||
// check that we have 5 consecutive entries for method()
|
||||
Entry[] lines = findEntries();
|
||||
if (lines == null || lines.length != 5)
|
||||
throw new Exception("conditional line number table incorrect");
|
||||
|
||||
int current = lines[0].line_number;
|
||||
for (Entry e : lines) {
|
||||
if (e.line_number != current)
|
||||
throw new Exception("conditional line number table incorrect");
|
||||
current++;
|
||||
}
|
||||
}
|
||||
|
||||
static Entry[] findEntries() throws IOException, ConstantPoolException {
|
||||
ClassFile self = ClassFile.read(ConditionalLineNumberTest.class.getResourceAsStream("ConditionalLineNumberTest.class"));
|
||||
for (Method m : self.methods) {
|
||||
if ("method".equals(m.getName(self.constant_pool))) {
|
||||
Code_attribute code_attribute = (Code_attribute)m.attributes.get(Attribute.Code);
|
||||
for (Attribute at : code_attribute.attributes) {
|
||||
if (Attribute.LineNumberTable.equals(at.getName(self.constant_pool))) {
|
||||
return ((LineNumberTable_attribute)at).line_number_table;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// This method should get one LineNumberTable entry per line
|
||||
// in the method body.
|
||||
public static String method(int field) {
|
||||
String s = field % 2 == 0 ?
|
||||
(field == 0 ? "false"
|
||||
: "true" + field) : //Breakpoint
|
||||
"false" + field; //Breakpoint
|
||||
return s;
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,7 +27,7 @@
|
||||
* @summary Generate call sites for method handle
|
||||
* @author jrose
|
||||
*
|
||||
* @compile -source 7 -target 7 -XDallowTransitionalJSR292=no InvokeMH.java
|
||||
* @compile InvokeMH.java
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,6 @@
|
||||
* @author gafter
|
||||
*
|
||||
* @compile T4711325.java
|
||||
* @compile/fail -source 1.4 T4711325.java
|
||||
*/
|
||||
|
||||
interface A {
|
||||
|
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8036007
|
||||
* @summary javac crashes when encountering an unresolvable interface
|
||||
* @build MissingInterfaceTestDep
|
||||
* @clean Closeable
|
||||
* @compile/fail/ref=MissingInterfaceTest.out -XDrawDiagnostics MissingInterfaceTest.java
|
||||
*/
|
||||
|
||||
public class MissingInterfaceTest {
|
||||
void test(MissingInterfaceTestDep s) {
|
||||
s.call();
|
||||
s.another();
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
MissingInterfaceTest.java:12:10: compiler.err.cant.access: Closeable, (compiler.misc.class.file.not.found: Closeable)
|
||||
MissingInterfaceTest.java:13:10: compiler.err.cant.resolve.location.args: kindname.method, another, , , (compiler.misc.location.1: kindname.variable, s, MissingInterfaceTestDep)
|
||||
2 errors
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -21,8 +21,6 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
class OverrideBridge2 {
|
||||
static class B extends OverrideBridge1.B {
|
||||
public void foo(Object o) { }
|
||||
}
|
||||
}
|
||||
public class MissingInterfaceTestDep implements Intermediate {}
|
||||
interface Intermediate extends Closeable { }
|
||||
interface Closeable {}
|
@ -21,10 +21,10 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
/*
|
||||
* @test
|
||||
* @bug 4910483
|
||||
* @summary javac shouldn't throw NPE while compiling invalid RuntimeInvisibleParameterAnnotations
|
||||
* @summary Javadoc renders the string ".*\\.pdf" as ".\*\.pdf"
|
||||
* @run main T4910483
|
||||
*/
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,6 @@
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile WarnClass.java
|
||||
* @compile/fail -Werror WarnClass.java
|
||||
* @compile/fail -Werror -source 1.4 -nowarn WarnClass.java
|
||||
* @compile/fail -Werror -nowarn WarnClass.java
|
||||
* @compile/fail -Werror -Xlint:none WarnClass.java
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,6 @@
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile WarnImport.java
|
||||
* @compile/fail -Werror WarnImport.java
|
||||
* @compile/fail -Werror -source 1.4 -nowarn WarnImport.java
|
||||
* @compile/fail -Werror -nowarn WarnImport.java
|
||||
* @compile/fail -Werror -Xlint:none WarnImport.java
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,6 @@
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile WarnMethod.java
|
||||
* @compile/fail -Werror WarnMethod.java
|
||||
* @compile/fail -Werror -source 1.4 -nowarn WarnMethod.java
|
||||
* @compile/fail -Werror -nowarn WarnMethod.java
|
||||
* @compile/fail -Werror -Xlint:none WarnMethod.java
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,6 @@
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile WarnStaticImport.java
|
||||
* @compile/fail -Werror WarnStaticImport.java
|
||||
* @compile/fail -Werror -source 1.4 -nowarn WarnStaticImport.java
|
||||
* @compile/fail -Werror -nowarn WarnStaticImport.java
|
||||
* @compile/fail -Werror -Xlint:none WarnStaticImport.java
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,6 @@
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile WarnVariable.java
|
||||
* @compile/fail -Werror WarnVariable.java
|
||||
* @compile/fail -Werror -source 1.4 -nowarn WarnVariable.java
|
||||
* @compile/fail -Werror -nowarn WarnVariable.java
|
||||
* @compile/fail -Werror -Xlint:none WarnVariable.java
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,6 @@
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile WarnWildcard.java
|
||||
* @compile/fail -Werror WarnWildcard.java
|
||||
* @compile/fail -Werror -source 1.4 -nowarn WarnWildcard.java
|
||||
* @compile/fail -Werror -nowarn WarnWildcard.java
|
||||
* @compile/fail -Werror -Xlint:none WarnWildcard.java
|
||||
*/
|
||||
|
@ -25,7 +25,6 @@
|
||||
* @test
|
||||
* @bug 7038363
|
||||
* @summary cast from object to primitive should be for source >= 1.7
|
||||
* @compile/fail/ref=CastObjectToPrimitiveTest.out -XDrawDiagnostics -Xlint:-options -source 5 CastObjectToPrimitiveTest.java
|
||||
* @compile/fail/ref=CastObjectToPrimitiveTest.out -XDrawDiagnostics -Xlint:-options -source 6 CastObjectToPrimitiveTest.java
|
||||
* @compile CastObjectToPrimitiveTest.java
|
||||
*/
|
||||
|
@ -1,2 +1,2 @@
|
||||
CastObjectToPrimitiveTest.java:36:23: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.Object, int)
|
||||
CastObjectToPrimitiveTest.java:35:23: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.Object, int)
|
||||
1 error
|
||||
|
Loading…
x
Reference in New Issue
Block a user