From 382fe51b6d7eba7094afa070032bedaa9ffc0633 Mon Sep 17 00:00:00 2001 From: "Archie L. Cobbs" Date: Tue, 17 Jan 2023 04:43:40 +0000 Subject: [PATCH] 8163229: several regression tests have a main method that is never executed Reviewed-by: vromero --- test/langtools/tools/javac/4980495/static/Test.java | 2 +- test/langtools/tools/javac/4980495/std/Test.java | 2 +- test/langtools/tools/javac/6491592/T6491592.java | 2 +- test/langtools/tools/javac/6857948/T6857948.java | 2 +- .../javac/8062359/UnresolvableClassNPEInAttrTest.java | 2 +- test/langtools/tools/javac/8161985/T8161985a.java | 2 +- test/langtools/tools/javac/8238735/T8238735.java | 2 +- .../AnonymousClass/AnonymousInSuperCallNegTest.java | 6 +----- test/langtools/tools/javac/BreakAcrossClass.java | 2 +- test/langtools/tools/javac/CaptureInSubtype.java | 10 ---------- .../tools/javac/DefiniteAssignment/DASwitch.java | 2 +- .../tools/javac/DefiniteAssignment/DUParam1.java | 2 +- .../javac/DefiniteAssignment/DefAssignAfterTry1.java | 2 +- .../javac/DefiniteAssignment/DefAssignAfterTry2.java | 2 +- .../javac/DefiniteAssignment/DefAssignAfterTry3.java | 2 +- .../tools/javac/DefiniteAssignment/T4717164.java | 2 +- .../tools/javac/DefiniteAssignment/T4718142.java | 2 +- .../tools/javac/DefiniteAssignment/T4718142a.java | 2 +- .../javac/DefiniteAssignment/UncaughtException.java | 4 ---- .../langtools/tools/javac/OverrideChecks/T4721069.java | 2 +- test/langtools/tools/javac/ParseConditional.java | 2 +- test/langtools/tools/javac/SwitchScope.java | 2 +- test/langtools/tools/javac/SynthName2.java | 2 +- test/langtools/tools/javac/T5003235/T5003235b.java | 2 +- test/langtools/tools/javac/T6306967.java | 2 +- test/langtools/tools/javac/T6326754.java | 2 +- test/langtools/tools/javac/T6379327.java | 2 +- test/langtools/tools/javac/T6407257.java | 3 --- .../langtools/tools/javac/TryWithResources/BadTwr.java | 2 +- test/langtools/tools/javac/TryWithResources/BadTwr.out | 6 +++--- .../tools/javac/TryWithResources/BadTwrSyntax.java | 2 +- .../javac/TryWithResources/DuplicateResourceDecl.java | 2 +- .../javac/TryWithResources/DuplicateResourceDecl.out | 2 +- .../tools/javac/TryWithResources/ImplicitFinal.java | 2 +- .../tools/javac/TryWithResources/PlainTry.java | 2 +- .../tools/javac/TryWithResources/T7022711.java | 2 +- .../tools/javac/TryWithResources/TwrAndLambda.java | 2 +- .../tools/javac/TryWithResources/TwrFlow.java | 2 +- .../tools/javac/TryWithResources/TwrForVariable2.java | 2 +- .../tools/javac/TryWithResources/TwrForVariable3.java | 2 +- .../tools/javac/TryWithResources/TwrForVariable4.java | 2 +- .../tools/javac/TryWithResources/TwrOnNonResource.java | 2 +- .../tools/javac/TryWithResources/TwrVarKinds.java | 2 +- .../javac/TryWithResources/TwrVarRedeclaration.java | 2 +- .../javac/TryWithResources/TwrVarRedeclaration.out | 6 +++--- test/langtools/tools/javac/UseEnum.java | 2 +- test/langtools/tools/javac/annotations/neg/Cycle3.java | 4 ---- .../typeAnnotations/failures/StaticFields.java | 2 +- .../typeAnnotations/failures/target/DotClass.java | 2 +- test/langtools/tools/javac/capture/Martin.java | 2 +- .../tools/javac/defaultMethods/private/Private06.java | 4 ++-- .../tools/javac/defaultMethods/static/Static02.java | 2 +- .../javac/depDocComment/DeprecatedDocComment.java | 2 +- .../tools/javac/generics/6245699/T6245699b.java | 2 +- .../tools/javac/generics/6413682/T6413682.java | 2 +- .../tools/javac/generics/6495506/T6495506.java | 2 +- .../tools/javac/generics/6723444/T6723444.java | 2 +- test/langtools/tools/javac/generics/GetClass.java | 2 +- test/langtools/tools/javac/generics/Nonlinear.java | 2 +- .../tools/javac/generics/UnsoundInference.java | 2 +- .../tools/javac/generics/diamond/neg/Neg08.java | 2 +- .../tools/javac/generics/diamond/neg/Neg13.java | 2 +- .../tools/javac/generics/diamond/neg/Neg14.java | 2 +- .../tools/javac/generics/diamond/neg/Neg15.java | 2 +- .../tools/javac/generics/diamond/neg/Neg17.java | 2 +- .../tools/javac/generics/diamond/neg/Neg18.java | 2 +- .../tools/javac/generics/diamond/neg/Neg19.java | 2 +- .../javac/generics/inference/4972073/T4972073.java | 5 ----- .../tools/javac/generics/inference/5081782/Neg.java | 2 +- .../tools/javac/generics/odersky/BadTest.java | 2 +- .../tools/javac/generics/odersky/BadTest3.java | 2 +- .../tools/javac/generics/typeargs/Metharg1.java | 6 ------ .../tools/javac/generics/typeargs/Metharg2.java | 2 +- .../tools/javac/generics/typeargs/Newarg1.java | 2 +- .../tools/javac/generics/typeargs/Newarg2.java | 2 +- .../tools/javac/generics/typeargs/Superarg1.java | 6 ------ .../tools/javac/generics/typeargs/Superarg2.java | 6 ------ .../tools/javac/generics/typeargs/ThisArg.java | 6 ------ .../javac/generics/wildcards/6437894/T6437894.java | 2 +- .../generics/wildcards/AssignmentDifferentTypes.java | 2 +- .../javac/generics/wildcards/AssignmentSameType.java | 2 +- .../tools/javac/generics/wildcards/T6450290.java | 2 +- .../javac/implicitThis/NewBeforeOuterConstructed2.java | 5 ----- .../langtools/tools/javac/lambda/8071432/T8071432.java | 2 +- test/langtools/tools/javac/lambda/LambdaConv10.java | 2 +- .../tools/javac/lambda/MethodReference20.java | 2 +- .../tools/javac/lambda/MethodReference25.java | 2 +- .../tools/javac/lambda/MethodReference41.java | 2 +- .../tools/javac/lambda/MethodReference42.java | 2 +- .../tools/javac/lambda/MethodReference43.java | 2 +- .../tools/javac/lambda/MethodReference44.java | 2 +- .../tools/javac/lambda/MethodReference46.java | 2 +- .../tools/javac/lambda/MethodReference47.java | 2 +- .../tools/javac/lambda/MethodReference48.java | 2 +- .../tools/javac/lambda/MethodReference60.java | 2 +- test/langtools/tools/javac/lambda/MostSpecific04.java | 2 +- test/langtools/tools/javac/lambda/MostSpecific05.java | 2 +- .../javac/lambda/funcInterfaces/LambdaTest2_neg1.java | 2 +- .../methodReference/MethodRefIntColonColonNewTest.java | 2 +- .../methodReference/MethodRefToInnerWithoutOuter.java | 2 +- .../MethodReferenceTestVarHandle_neg.java | 2 +- .../lambda/typeInference/InferenceTest_neg1_2.java | 2 +- test/langtools/tools/javac/limits/ArrayDims1.java | 2 -- test/langtools/tools/javac/limits/ArrayDims2.java | 2 -- test/langtools/tools/javac/limits/ArrayDims3.java | 2 -- test/langtools/tools/javac/limits/ArrayDims4.java | 2 -- test/langtools/tools/javac/limits/PoolSize2.java | 2 -- test/langtools/tools/javac/limits/StringLength.java | 3 --- test/langtools/tools/javac/nested/5009484/X.java | 2 +- test/langtools/tools/javac/overload/T5090220.java | 2 +- .../tools/javac/patterns/BindingsTest1Merging.java | 2 +- test/langtools/tools/javac/patterns/BindingsTest2.java | 2 +- .../tools/javac/patterns/CastConversionMatch.java | 2 +- .../javac/patterns/DeconstructionPatternErrors.java | 2 +- .../javac/patterns/DeconstructionPatternErrors.out | 4 ++-- .../tools/javac/patterns/EnsureTypesOrderTest.java | 2 +- .../tools/javac/patterns/ImpossibleTypeTest.java | 2 +- .../tools/javac/patterns/MatchBindingScopeTest.java | 2 +- .../tools/javac/patterns/NullsInPatterns.java | 2 +- .../javac/patterns/PatternVariablesAreNonFinal.java | 2 +- .../javac/patterns/UncheckedWarningOnMatchesTest.java | 2 +- .../langtools/tools/javac/scope/6225935/Estatico4.java | 2 +- .../tools/javac/staticImport/ImportPrivate.java | 2 +- .../tools/javac/switchexpr/DefiniteAssignment2.java | 2 +- .../javac/switchexpr/ExpressionSwitchUnreachable.java | 2 +- .../tools/javac/switchextra/DefiniteAssignment2.java | 2 +- test/langtools/tools/javac/unicode/NonasciiDigit.java | 2 +- .../tools/javac/varargs/6313164/T7175433.java | 2 +- test/langtools/tools/javac/varargs/Warn2.java | 2 +- 129 files changed, 119 insertions(+), 191 deletions(-) diff --git a/test/langtools/tools/javac/4980495/static/Test.java b/test/langtools/tools/javac/4980495/static/Test.java index 28153ed8810..09321e5addd 100644 --- a/test/langtools/tools/javac/4980495/static/Test.java +++ b/test/langtools/tools/javac/4980495/static/Test.java @@ -11,7 +11,7 @@ import static p2.A2.f; public class Test { - public static void main(String argv[]) { + public static void meth() { f = 1; } } diff --git a/test/langtools/tools/javac/4980495/std/Test.java b/test/langtools/tools/javac/4980495/std/Test.java index 7f5c6734df8..dbc21b25cb6 100644 --- a/test/langtools/tools/javac/4980495/std/Test.java +++ b/test/langtools/tools/javac/4980495/std/Test.java @@ -12,7 +12,7 @@ import p2.A2.f; public class Test { - public static void main(String argv[]) { + public static void meth() { new f(); } } diff --git a/test/langtools/tools/javac/6491592/T6491592.java b/test/langtools/tools/javac/6491592/T6491592.java index 0513fbdedff..2e39b1180c4 100644 --- a/test/langtools/tools/javac/6491592/T6491592.java +++ b/test/langtools/tools/javac/6491592/T6491592.java @@ -7,7 +7,7 @@ */ public class T6491592 { - public static void main(String... args) { + public static void meth() { Object o = null; o += null; } diff --git a/test/langtools/tools/javac/6857948/T6857948.java b/test/langtools/tools/javac/6857948/T6857948.java index e4f7ee527d9..ab98a4fee6e 100644 --- a/test/langtools/tools/javac/6857948/T6857948.java +++ b/test/langtools/tools/javac/6857948/T6857948.java @@ -12,7 +12,7 @@ class Foo { }; class Test { - public static void main() { + public static void meth() { Foo f = new Foo("Hello!",nosuchfunction()) {}; } } diff --git a/test/langtools/tools/javac/8062359/UnresolvableClassNPEInAttrTest.java b/test/langtools/tools/javac/8062359/UnresolvableClassNPEInAttrTest.java index 0880fde6cfc..292e3396372 100644 --- a/test/langtools/tools/javac/8062359/UnresolvableClassNPEInAttrTest.java +++ b/test/langtools/tools/javac/8062359/UnresolvableClassNPEInAttrTest.java @@ -7,7 +7,7 @@ */ public class UnresolvableClassNPEInAttrTest { - public static void main(String[] args) { + public static void meth() { new Undefined() { void test() { new Object() {}; diff --git a/test/langtools/tools/javac/8161985/T8161985a.java b/test/langtools/tools/javac/8161985/T8161985a.java index 99277f68cf2..c06cfc40449 100644 --- a/test/langtools/tools/javac/8161985/T8161985a.java +++ b/test/langtools/tools/javac/8161985/T8161985a.java @@ -6,7 +6,7 @@ */ class T8161985 { - public static void main(String [] arg) { + public static void meth() { T8161985 t = new T8161985(); t.getClass(); diff --git a/test/langtools/tools/javac/8238735/T8238735.java b/test/langtools/tools/javac/8238735/T8238735.java index eb71c9a9fe6..a69c08035f8 100644 --- a/test/langtools/tools/javac/8238735/T8238735.java +++ b/test/langtools/tools/javac/8238735/T8238735.java @@ -6,7 +6,7 @@ */ class T8238735 { - public static void main(String[] args) { + public static void meth() { boolean first = true; first = first ? false : (boolean)(() -> false) ; } diff --git a/test/langtools/tools/javac/AnonymousClass/AnonymousInSuperCallNegTest.java b/test/langtools/tools/javac/AnonymousClass/AnonymousInSuperCallNegTest.java index b7d0a73d576..411c99728be 100644 --- a/test/langtools/tools/javac/AnonymousClass/AnonymousInSuperCallNegTest.java +++ b/test/langtools/tools/javac/AnonymousClass/AnonymousInSuperCallNegTest.java @@ -24,8 +24,4 @@ public class AnonymousInSuperCallNegTest { } }); } } - - public static void main(String[] args) { - new JavacBug(); - } -} \ No newline at end of file +} diff --git a/test/langtools/tools/javac/BreakAcrossClass.java b/test/langtools/tools/javac/BreakAcrossClass.java index b253cb894e6..9d5407b6d12 100644 --- a/test/langtools/tools/javac/BreakAcrossClass.java +++ b/test/langtools/tools/javac/BreakAcrossClass.java @@ -8,7 +8,7 @@ */ class BreakAcrossClass { - public static void main(String argv[]) { + public static void meth() { final int i = 6; M: { class A { diff --git a/test/langtools/tools/javac/CaptureInSubtype.java b/test/langtools/tools/javac/CaptureInSubtype.java index 3b73e20a6dd..f3e7ecb7498 100644 --- a/test/langtools/tools/javac/CaptureInSubtype.java +++ b/test/langtools/tools/javac/CaptureInSubtype.java @@ -37,14 +37,4 @@ public class CaptureInSubtype { Flaw m(){return fn;} } - - public static void main(String[] args) { - SuperOfShowFlaw sosf = new ShowFlaw(); - SuperOfFlaw> sof = sosf.m(); - List ls = new ArrayList(); - ls.add("Smalltalk rules!"); - sof.put(ls); - Number n = ShowFlaw.fn.get().get(0); - } - } diff --git a/test/langtools/tools/javac/DefiniteAssignment/DASwitch.java b/test/langtools/tools/javac/DefiniteAssignment/DASwitch.java index 6cef2023cd8..cb112d78c9c 100644 --- a/test/langtools/tools/javac/DefiniteAssignment/DASwitch.java +++ b/test/langtools/tools/javac/DefiniteAssignment/DASwitch.java @@ -8,7 +8,7 @@ */ public class DASwitch { - public static void main(final String[] args) { + public static void meth() { int t = 1; { final int x; diff --git a/test/langtools/tools/javac/DefiniteAssignment/DUParam1.java b/test/langtools/tools/javac/DefiniteAssignment/DUParam1.java index c55abd74e15..6215eec3b55 100644 --- a/test/langtools/tools/javac/DefiniteAssignment/DUParam1.java +++ b/test/langtools/tools/javac/DefiniteAssignment/DUParam1.java @@ -8,7 +8,7 @@ */ public class DUParam1 { - public static void main(final String[] args) { + public static void meth(final String[] args) { // 8.4.1 makes it illegal to assign to a final parameter. if (false) args = null; } diff --git a/test/langtools/tools/javac/DefiniteAssignment/DefAssignAfterTry1.java b/test/langtools/tools/javac/DefiniteAssignment/DefAssignAfterTry1.java index d15cfa70b2c..9c7c26ab885 100644 --- a/test/langtools/tools/javac/DefiniteAssignment/DefAssignAfterTry1.java +++ b/test/langtools/tools/javac/DefiniteAssignment/DefAssignAfterTry1.java @@ -11,7 +11,7 @@ class E1 extends Exception {} class E2 extends Exception {} public class DefAssignAfterTry1 { - public static void main(String argv[]) { + public static void meth() { boolean t = true; E1 se1 = new E1(); E2 se2 = new E2(); diff --git a/test/langtools/tools/javac/DefiniteAssignment/DefAssignAfterTry2.java b/test/langtools/tools/javac/DefiniteAssignment/DefAssignAfterTry2.java index 6af6748ef50..479cd5b1c81 100644 --- a/test/langtools/tools/javac/DefiniteAssignment/DefAssignAfterTry2.java +++ b/test/langtools/tools/javac/DefiniteAssignment/DefAssignAfterTry2.java @@ -11,7 +11,7 @@ class E1 extends Exception {} class E2 extends Exception {} public class DefAssignAfterTry2 { - public static void main(String argv[]) { + public static void meth() { boolean t = true; E1 se1 = new E1(); E2 se2 = new E2(); diff --git a/test/langtools/tools/javac/DefiniteAssignment/DefAssignAfterTry3.java b/test/langtools/tools/javac/DefiniteAssignment/DefAssignAfterTry3.java index 955d83de816..1cdad7c5bea 100644 --- a/test/langtools/tools/javac/DefiniteAssignment/DefAssignAfterTry3.java +++ b/test/langtools/tools/javac/DefiniteAssignment/DefAssignAfterTry3.java @@ -11,7 +11,7 @@ class E1 extends Exception {} class E2 extends Exception {} public class DefAssignAfterTry3 { - public static void main(String argv[]) { + public static void meth() { boolean t = true; E1 se1 = new E1(); E2 se2 = new E2(); diff --git a/test/langtools/tools/javac/DefiniteAssignment/T4717164.java b/test/langtools/tools/javac/DefiniteAssignment/T4717164.java index 7cdfa9fab92..8c067982d10 100644 --- a/test/langtools/tools/javac/DefiniteAssignment/T4717164.java +++ b/test/langtools/tools/javac/DefiniteAssignment/T4717164.java @@ -8,7 +8,7 @@ */ class T4717164 { - public static void main(String[] args) { + public static void meth() { try { try { throw new ClassNotFoundException(); diff --git a/test/langtools/tools/javac/DefiniteAssignment/T4718142.java b/test/langtools/tools/javac/DefiniteAssignment/T4718142.java index d6e218992ec..5167d96aac1 100644 --- a/test/langtools/tools/javac/DefiniteAssignment/T4718142.java +++ b/test/langtools/tools/javac/DefiniteAssignment/T4718142.java @@ -12,7 +12,7 @@ class T4718142 { static void thr() throws E { throw new E(); } - public static void main(String[] args) { + public static void meth() { int count = 0; final int i; while (true) { diff --git a/test/langtools/tools/javac/DefiniteAssignment/T4718142a.java b/test/langtools/tools/javac/DefiniteAssignment/T4718142a.java index d70fc227b6c..24d152e7f19 100644 --- a/test/langtools/tools/javac/DefiniteAssignment/T4718142a.java +++ b/test/langtools/tools/javac/DefiniteAssignment/T4718142a.java @@ -8,7 +8,7 @@ */ class T4718142a { - public static void main(String[] args) { + public static void meth() { final int i; for (int n=0; n<10; n++) { b: { diff --git a/test/langtools/tools/javac/DefiniteAssignment/UncaughtException.java b/test/langtools/tools/javac/DefiniteAssignment/UncaughtException.java index f43bbea96f0..d12eae05196 100644 --- a/test/langtools/tools/javac/DefiniteAssignment/UncaughtException.java +++ b/test/langtools/tools/javac/DefiniteAssignment/UncaughtException.java @@ -21,8 +21,4 @@ class B extends A implements I { } public class UncaughtException { - public static void main (String[] args) { - I b = new B(); - b.throwCheckedException(); - } } diff --git a/test/langtools/tools/javac/OverrideChecks/T4721069.java b/test/langtools/tools/javac/OverrideChecks/T4721069.java index ea8f4da567d..99c4f5baab3 100644 --- a/test/langtools/tools/javac/OverrideChecks/T4721069.java +++ b/test/langtools/tools/javac/OverrideChecks/T4721069.java @@ -18,7 +18,7 @@ interface I { x.getClass(); } } - public static void main(String[] args) { + public static void meth() { f(null); } } diff --git a/test/langtools/tools/javac/ParseConditional.java b/test/langtools/tools/javac/ParseConditional.java index afedfc41216..ca909da59cb 100644 --- a/test/langtools/tools/javac/ParseConditional.java +++ b/test/langtools/tools/javac/ParseConditional.java @@ -9,7 +9,7 @@ */ public class ParseConditional { - public static void main(String[] args) { + public static void meth() { boolean condition = true; int a = 1; int b = 2; diff --git a/test/langtools/tools/javac/SwitchScope.java b/test/langtools/tools/javac/SwitchScope.java index a7c0aabe75f..970132e4f6f 100644 --- a/test/langtools/tools/javac/SwitchScope.java +++ b/test/langtools/tools/javac/SwitchScope.java @@ -8,7 +8,7 @@ */ public class SwitchScope { - public static void main(String[] args) { + public static void meth(String[] args) { switch (args.length) { case 0: final int k; diff --git a/test/langtools/tools/javac/SynthName2.java b/test/langtools/tools/javac/SynthName2.java index ee0a183a448..8570044f43b 100644 --- a/test/langtools/tools/javac/SynthName2.java +++ b/test/langtools/tools/javac/SynthName2.java @@ -10,7 +10,7 @@ import java.io.PrintStream; class SynthName2 { - public static void main(String args[]) { + public static void meth(String args[]) { run(args, System.out); } public static void run(String args[],PrintStream out) { diff --git a/test/langtools/tools/javac/T5003235/T5003235b.java b/test/langtools/tools/javac/T5003235/T5003235b.java index 7787a267712..8cb9bdaf85f 100644 --- a/test/langtools/tools/javac/T5003235/T5003235b.java +++ b/test/langtools/tools/javac/T5003235/T5003235b.java @@ -22,7 +22,7 @@ class Outer { } class Access { - public static void main(String[] args) { + public static void meth() { Outer outer = new Outer(); outer.create(); System.out.println("Value of k: " + outer.inner.k); diff --git a/test/langtools/tools/javac/T6306967.java b/test/langtools/tools/javac/T6306967.java index 53c52a6ee35..7bdfe8b8990 100644 --- a/test/langtools/tools/javac/T6306967.java +++ b/test/langtools/tools/javac/T6306967.java @@ -7,7 +7,7 @@ */ public class T6306967 { - public static void main(String[] args) { + public static void meth() { final int x; while(true) { if (true) { diff --git a/test/langtools/tools/javac/T6326754.java b/test/langtools/tools/javac/T6326754.java index 5612ac65c0c..209cc2e825c 100644 --- a/test/langtools/tools/javac/T6326754.java +++ b/test/langtools/tools/javac/T6326754.java @@ -42,7 +42,7 @@ class TestC{ } } public class T6326754{ - public static void main(String... arg){ + public static void meth() { TestC tC =new TestC(); tC.setT(); TestConstructor tc = new TestConstructor("saaa"); diff --git a/test/langtools/tools/javac/T6379327.java b/test/langtools/tools/javac/T6379327.java index dc7bae36d13..2fe690e4dea 100644 --- a/test/langtools/tools/javac/T6379327.java +++ b/test/langtools/tools/javac/T6379327.java @@ -8,7 +8,7 @@ import java.security.*; public class T6379327 { - public static void main(String[] args) { + public static void meth(String[] args) { final String name = args[0]; try { new PrivilegedExceptionAction() { diff --git a/test/langtools/tools/javac/T6407257.java b/test/langtools/tools/javac/T6407257.java index f2b4ea7149e..7d5da43cab0 100644 --- a/test/langtools/tools/javac/T6407257.java +++ b/test/langtools/tools/javac/T6407257.java @@ -9,7 +9,4 @@ class T6407257a extends T6407257a {} public class T6407257 extends T6407257a { - public static void main(String... args) { - main(args); - } } diff --git a/test/langtools/tools/javac/TryWithResources/BadTwr.java b/test/langtools/tools/javac/TryWithResources/BadTwr.java index 73de447d2f4..6043c527af1 100644 --- a/test/langtools/tools/javac/TryWithResources/BadTwr.java +++ b/test/langtools/tools/javac/TryWithResources/BadTwr.java @@ -7,7 +7,7 @@ */ public class BadTwr implements AutoCloseable { - public static void main(String... args) { + public static void meth(String... args) { // illegal repeated name try(BadTwr r1 = new BadTwr(); BadTwr r1 = new BadTwr()) { System.out.println(r1.toString()); diff --git a/test/langtools/tools/javac/TryWithResources/BadTwr.out b/test/langtools/tools/javac/TryWithResources/BadTwr.out index d426f747532..a11fc90e071 100644 --- a/test/langtools/tools/javac/TryWithResources/BadTwr.out +++ b/test/langtools/tools/javac/TryWithResources/BadTwr.out @@ -1,5 +1,5 @@ -BadTwr.java:12:46: compiler.err.already.defined: kindname.variable, r1, kindname.method, main(java.lang.String...) -BadTwr.java:17:20: compiler.err.already.defined: kindname.variable, args, kindname.method, main(java.lang.String...) +BadTwr.java:12:46: compiler.err.already.defined: kindname.variable, r1, kindname.method, meth(java.lang.String...) +BadTwr.java:17:20: compiler.err.already.defined: kindname.variable, args, kindname.method, meth(java.lang.String...) BadTwr.java:20:13: compiler.err.cant.assign.val.to.final.var: thatsIt -BadTwr.java:25:24: compiler.err.already.defined: kindname.variable, name, kindname.method, main(java.lang.String...) +BadTwr.java:25:24: compiler.err.already.defined: kindname.variable, name, kindname.method, meth(java.lang.String...) 4 errors diff --git a/test/langtools/tools/javac/TryWithResources/BadTwrSyntax.java b/test/langtools/tools/javac/TryWithResources/BadTwrSyntax.java index f080b758972..988249cef20 100644 --- a/test/langtools/tools/javac/TryWithResources/BadTwrSyntax.java +++ b/test/langtools/tools/javac/TryWithResources/BadTwrSyntax.java @@ -8,7 +8,7 @@ import java.io.IOException; public class BadTwrSyntax implements AutoCloseable { - public static void main(String... args) throws Exception { + public static void meth() { // illegal double semicolon ending resources try(BadTwr twrflow = new BadTwr();;) { System.out.println(twrflow.toString()); diff --git a/test/langtools/tools/javac/TryWithResources/DuplicateResourceDecl.java b/test/langtools/tools/javac/TryWithResources/DuplicateResourceDecl.java index 52b8d243eee..a2d7ea74c3f 100644 --- a/test/langtools/tools/javac/TryWithResources/DuplicateResourceDecl.java +++ b/test/langtools/tools/javac/TryWithResources/DuplicateResourceDecl.java @@ -8,7 +8,7 @@ class DuplicateResourceDecl { - public static void main(String[] args) { + public static void meth() { try(MyResource c = new MyResource();MyResource c = new MyResource()) { //do something } catch (Exception e) { } diff --git a/test/langtools/tools/javac/TryWithResources/DuplicateResourceDecl.out b/test/langtools/tools/javac/TryWithResources/DuplicateResourceDecl.out index c6406eb7768..11c07b24cb3 100644 --- a/test/langtools/tools/javac/TryWithResources/DuplicateResourceDecl.out +++ b/test/langtools/tools/javac/TryWithResources/DuplicateResourceDecl.out @@ -1,2 +1,2 @@ -DuplicateResourceDecl.java:12:56: compiler.err.already.defined: kindname.variable, c, kindname.method, main(java.lang.String[]) +DuplicateResourceDecl.java:12:56: compiler.err.already.defined: kindname.variable, c, kindname.method, meth() 1 error diff --git a/test/langtools/tools/javac/TryWithResources/ImplicitFinal.java b/test/langtools/tools/javac/TryWithResources/ImplicitFinal.java index 33e80365c36..1f55aba09e4 100644 --- a/test/langtools/tools/javac/TryWithResources/ImplicitFinal.java +++ b/test/langtools/tools/javac/TryWithResources/ImplicitFinal.java @@ -9,7 +9,7 @@ import java.io.IOException; class ImplicitFinal implements AutoCloseable { - public static void main(String... args) { + public static void meth() { try(ImplicitFinal r = new ImplicitFinal()) { r = null; //disallowed } catch (IOException ioe) { // Not reachable diff --git a/test/langtools/tools/javac/TryWithResources/PlainTry.java b/test/langtools/tools/javac/TryWithResources/PlainTry.java index cd46153cd71..edbb233578b 100644 --- a/test/langtools/tools/javac/TryWithResources/PlainTry.java +++ b/test/langtools/tools/javac/TryWithResources/PlainTry.java @@ -6,7 +6,7 @@ * @compile/fail/ref=PlainTry.out -XDrawDiagnostics PlainTry.java */ public class PlainTry { - public static void main(String... args) { + public static void meth() { try { ; } diff --git a/test/langtools/tools/javac/TryWithResources/T7022711.java b/test/langtools/tools/javac/TryWithResources/T7022711.java index 0994630e6a1..1b9ab730eca 100644 --- a/test/langtools/tools/javac/TryWithResources/T7022711.java +++ b/test/langtools/tools/javac/TryWithResources/T7022711.java @@ -8,7 +8,7 @@ import java.io.*; class T7022711 { - public static void main (String args[]) throws Exception { + public static void meth() { // declared resource try (DataInputStream is = new DataInputStream(new FileInputStream("x"))) { while (true) { diff --git a/test/langtools/tools/javac/TryWithResources/TwrAndLambda.java b/test/langtools/tools/javac/TryWithResources/TwrAndLambda.java index da693b3686b..1e9ec29be68 100644 --- a/test/langtools/tools/javac/TryWithResources/TwrAndLambda.java +++ b/test/langtools/tools/javac/TryWithResources/TwrAndLambda.java @@ -7,7 +7,7 @@ public class TwrAndLambda { - public static void main(String... args) { + public static void meth() { // Lambda expression AutoCloseable v1 = () -> {}; diff --git a/test/langtools/tools/javac/TryWithResources/TwrFlow.java b/test/langtools/tools/javac/TryWithResources/TwrFlow.java index eec9eb8e063..8ea54244570 100644 --- a/test/langtools/tools/javac/TryWithResources/TwrFlow.java +++ b/test/langtools/tools/javac/TryWithResources/TwrFlow.java @@ -8,7 +8,7 @@ import java.io.IOException; public class TwrFlow implements AutoCloseable { - public static void main(String... args) { + public static void meth() { try(TwrFlow twrFlow = new TwrFlow()) { System.out.println(twrFlow.toString()); } catch (IOException ioe) { // Not reachable diff --git a/test/langtools/tools/javac/TryWithResources/TwrForVariable2.java b/test/langtools/tools/javac/TryWithResources/TwrForVariable2.java index 73dd3fa2571..fb203f5a24a 100644 --- a/test/langtools/tools/javac/TryWithResources/TwrForVariable2.java +++ b/test/langtools/tools/javac/TryWithResources/TwrForVariable2.java @@ -5,7 +5,7 @@ * @compile/fail/ref=TwrForVariable2.out -XDrawDiagnostics -Xlint:-options TwrForVariable2.java */ public class TwrForVariable2 implements AutoCloseable { - public static void main(String... args) { + public static void meth() { TwrForVariable2 v = new TwrForVariable2(); TwrForVariable3[] v2 = new TwrForVariable3[1]; TwrForVariable3[][] v3 = new TwrForVariable3[1][1]; diff --git a/test/langtools/tools/javac/TryWithResources/TwrForVariable3.java b/test/langtools/tools/javac/TryWithResources/TwrForVariable3.java index c947fc8f0a4..e9254ae927d 100644 --- a/test/langtools/tools/javac/TryWithResources/TwrForVariable3.java +++ b/test/langtools/tools/javac/TryWithResources/TwrForVariable3.java @@ -4,7 +4,7 @@ * @compile/fail/ref=TwrForVariable3.out -XDrawDiagnostics -Xlint:-options TwrForVariable3.java */ public class TwrForVariable3 implements AutoCloseable { - public static void main(String... args) { + public static void meth() { TwrForVariable3 v1 = new TwrForVariable3(); Object v2 = new Object(); Object v3 = new Object() { diff --git a/test/langtools/tools/javac/TryWithResources/TwrForVariable4.java b/test/langtools/tools/javac/TryWithResources/TwrForVariable4.java index d8437a0d295..9209f56b2af 100644 --- a/test/langtools/tools/javac/TryWithResources/TwrForVariable4.java +++ b/test/langtools/tools/javac/TryWithResources/TwrForVariable4.java @@ -5,7 +5,7 @@ * @compile/fail/ref=TwrForVariable4.out -XDrawDiagnostics -Xlint:-options TwrForVariable4.java */ public class TwrForVariable4 implements AutoCloseable { - public static void main(String... args) { + public static void meth() { TwrForVariable4 uninitialized; try (uninitialized) { diff --git a/test/langtools/tools/javac/TryWithResources/TwrOnNonResource.java b/test/langtools/tools/javac/TryWithResources/TwrOnNonResource.java index 84d1d563161..ac0a72645ba 100644 --- a/test/langtools/tools/javac/TryWithResources/TwrOnNonResource.java +++ b/test/langtools/tools/javac/TryWithResources/TwrOnNonResource.java @@ -7,7 +7,7 @@ */ class TwrOnNonResource { - public static void main(String... args) { + public static void meth() { try(TwrOnNonResource aonr = new TwrOnNonResource()) { System.out.println(aonr.toString()); } diff --git a/test/langtools/tools/javac/TryWithResources/TwrVarKinds.java b/test/langtools/tools/javac/TryWithResources/TwrVarKinds.java index 5d9c3c5aff4..65fd1fc837d 100644 --- a/test/langtools/tools/javac/TryWithResources/TwrVarKinds.java +++ b/test/langtools/tools/javac/TryWithResources/TwrVarKinds.java @@ -12,7 +12,7 @@ public class TwrVarKinds implements AutoCloseable { static TwrVarKinds r3 = new TwrVarKinds(); TwrVarKinds r4 = new TwrVarKinds(); - public static void main(String... args) { + public static void meth() { TwrVarKinds r5 = new TwrVarKinds(); diff --git a/test/langtools/tools/javac/TryWithResources/TwrVarRedeclaration.java b/test/langtools/tools/javac/TryWithResources/TwrVarRedeclaration.java index 3bc4b83082e..8c31354d629 100644 --- a/test/langtools/tools/javac/TryWithResources/TwrVarRedeclaration.java +++ b/test/langtools/tools/javac/TryWithResources/TwrVarRedeclaration.java @@ -7,7 +7,7 @@ public class TwrVarRedeclaration implements AutoCloseable { - public static void main(String... args) { + public static void meth() { TwrVarRedeclaration r = new TwrVarRedeclaration(); try (r) { diff --git a/test/langtools/tools/javac/TryWithResources/TwrVarRedeclaration.out b/test/langtools/tools/javac/TryWithResources/TwrVarRedeclaration.out index d2e219cf783..82652229605 100644 --- a/test/langtools/tools/javac/TryWithResources/TwrVarRedeclaration.out +++ b/test/langtools/tools/javac/TryWithResources/TwrVarRedeclaration.out @@ -1,4 +1,4 @@ -TwrVarRedeclaration.java:14:33: compiler.err.already.defined: kindname.variable, r, kindname.method, main(java.lang.String...) -TwrVarRedeclaration.java:18:20: compiler.err.already.defined: kindname.variable, r, kindname.method, main(java.lang.String...) -TwrVarRedeclaration.java:23:23: compiler.err.already.defined: kindname.variable, r, kindname.method, main(java.lang.String...) +TwrVarRedeclaration.java:14:33: compiler.err.already.defined: kindname.variable, r, kindname.method, meth() +TwrVarRedeclaration.java:18:20: compiler.err.already.defined: kindname.variable, r, kindname.method, meth() +TwrVarRedeclaration.java:23:23: compiler.err.already.defined: kindname.variable, r, kindname.method, meth() 3 errors diff --git a/test/langtools/tools/javac/UseEnum.java b/test/langtools/tools/javac/UseEnum.java index 642e84b1d73..315be40a749 100644 --- a/test/langtools/tools/javac/UseEnum.java +++ b/test/langtools/tools/javac/UseEnum.java @@ -10,7 +10,7 @@ import static java.lang.System.out; class UseEnum { enum Animal {cat, dog, bird, fish}; - public static void main(String args[]) { + public static void meth() { Animal pet; pet = Animal.cat; diff --git a/test/langtools/tools/javac/annotations/neg/Cycle3.java b/test/langtools/tools/javac/annotations/neg/Cycle3.java index 7aff00a3d6d..04e6d577b6a 100644 --- a/test/langtools/tools/javac/annotations/neg/Cycle3.java +++ b/test/langtools/tools/javac/annotations/neg/Cycle3.java @@ -19,8 +19,4 @@ import static java.lang.annotation.RetentionPolicy.*; @A class Main { - public static void main(String[] args) { - A a = Main.class.getAnnotation(A.class); - System.out.println(a); - } } diff --git a/test/langtools/tools/javac/annotations/typeAnnotations/failures/StaticFields.java b/test/langtools/tools/javac/annotations/typeAnnotations/failures/StaticFields.java index a76ea3a6b91..6cd803ef11f 100644 --- a/test/langtools/tools/javac/annotations/typeAnnotations/failures/StaticFields.java +++ b/test/langtools/tools/javac/annotations/typeAnnotations/failures/StaticFields.java @@ -18,7 +18,7 @@ class C { // static method static int f() { return @A C.f; } // main - public static void main(String... args) { + public static void meth() { int a = @A C.f; } } diff --git a/test/langtools/tools/javac/annotations/typeAnnotations/failures/target/DotClass.java b/test/langtools/tools/javac/annotations/typeAnnotations/failures/target/DotClass.java index b2ac84e213b..4a51a9995e6 100644 --- a/test/langtools/tools/javac/annotations/typeAnnotations/failures/target/DotClass.java +++ b/test/langtools/tools/javac/annotations/typeAnnotations/failures/target/DotClass.java @@ -30,7 +30,7 @@ class T0x1E { } class ClassLiterals { - public static void main(String[] args) { + public static void meth() { if (String.class != @A String.class) throw new Error(); if (@A int.class != int.class) throw new Error(); if (@A int.class != Integer.TYPE) throw new Error(); diff --git a/test/langtools/tools/javac/capture/Martin.java b/test/langtools/tools/javac/capture/Martin.java index 05052fdb1e1..472b5f1c239 100644 --- a/test/langtools/tools/javac/capture/Martin.java +++ b/test/langtools/tools/javac/capture/Martin.java @@ -9,7 +9,7 @@ import java.util.List; public class Martin { - public static void main(String[] args) throws Throwable { + public static void meth() { List x1 = null; List x2 = null; x1.addAll(x2); diff --git a/test/langtools/tools/javac/defaultMethods/private/Private06.java b/test/langtools/tools/javac/defaultMethods/private/Private06.java index 338741d558b..6a3c6438ad7 100644 --- a/test/langtools/tools/javac/defaultMethods/private/Private06.java +++ b/test/langtools/tools/javac/defaultMethods/private/Private06.java @@ -17,14 +17,14 @@ public class Private06 { void foo(NAFI nafi); } - public static void main(String [] args) { + public static void meth() { Private06.NAFI nafi = () -> {}; Private06.FI fi = Private06.NAFI::foo; // OK. } } class Private06_01 { - public static void main(String [] args) { + public static void meth() { Private06.FI fi = Private06.NAFI::foo; // NOT OK. } } diff --git a/test/langtools/tools/javac/defaultMethods/static/Static02.java b/test/langtools/tools/javac/defaultMethods/static/Static02.java index da01aa7ee6e..2f27479c27e 100644 --- a/test/langtools/tools/javac/defaultMethods/static/Static02.java +++ b/test/langtools/tools/javac/defaultMethods/static/Static02.java @@ -11,7 +11,7 @@ class Static02 { public static void test() { } } - public static void main(String[] args) { + public static void meth() { I.test(); //ok I i = new I() {}; i.test(); //no! diff --git a/test/langtools/tools/javac/depDocComment/DeprecatedDocComment.java b/test/langtools/tools/javac/depDocComment/DeprecatedDocComment.java index 51f2f4a25d6..5ee0317fbdf 100644 --- a/test/langtools/tools/javac/depDocComment/DeprecatedDocComment.java +++ b/test/langtools/tools/javac/depDocComment/DeprecatedDocComment.java @@ -23,7 +23,7 @@ public class DeprecatedDocComment { - public static void main(String argv[]) { + public static void meth() { DeprecatedDocComment2.deprecatedTest1(); DeprecatedDocComment2.deprecatedTest2(); DeprecatedDocComment2.deprecatedTest3(); diff --git a/test/langtools/tools/javac/generics/6245699/T6245699b.java b/test/langtools/tools/javac/generics/6245699/T6245699b.java index 8aafcf4e0d1..0e95c93e81e 100644 --- a/test/langtools/tools/javac/generics/6245699/T6245699b.java +++ b/test/langtools/tools/javac/generics/6245699/T6245699b.java @@ -6,7 +6,7 @@ */ public class T6245699b { - public static void main(String[] args) { + public static void meth() { IBar b = new Bar(); String x = b.doIt(); } diff --git a/test/langtools/tools/javac/generics/6413682/T6413682.java b/test/langtools/tools/javac/generics/6413682/T6413682.java index f1d7dabf78e..74574ed762b 100644 --- a/test/langtools/tools/javac/generics/6413682/T6413682.java +++ b/test/langtools/tools/javac/generics/6413682/T6413682.java @@ -6,7 +6,7 @@ */ public class T6413682 { - public static void main(String... args) { + public static void meth() { Object[] text = new ,and.thanks.Mr.Vince>Object[5]; } diff --git a/test/langtools/tools/javac/generics/6495506/T6495506.java b/test/langtools/tools/javac/generics/6495506/T6495506.java index 1f8ed916f89..7fab9357b60 100644 --- a/test/langtools/tools/javac/generics/6495506/T6495506.java +++ b/test/langtools/tools/javac/generics/6495506/T6495506.java @@ -7,7 +7,7 @@ */ public class T6495506 { - public static void main(String... args) { + public static void meth() { a.A myA = new a.A(); myA.p = myA.vec.get(0); } diff --git a/test/langtools/tools/javac/generics/6723444/T6723444.java b/test/langtools/tools/javac/generics/6723444/T6723444.java index 6e325658c33..9bf7365dead 100644 --- a/test/langtools/tools/javac/generics/6723444/T6723444.java +++ b/test/langtools/tools/javac/generics/6723444/T6723444.java @@ -23,7 +23,7 @@ public class T6723444 { T6723444(Foo foo, int i) throws X1, X2 {} - public static void main(String[] args) throws Exception { + public static void meth() throws Exception { // the following 8 statements should compile without error diff --git a/test/langtools/tools/javac/generics/GetClass.java b/test/langtools/tools/javac/generics/GetClass.java index 0321f3d535d..0571daacfac 100644 --- a/test/langtools/tools/javac/generics/GetClass.java +++ b/test/langtools/tools/javac/generics/GetClass.java @@ -8,7 +8,7 @@ */ public class GetClass { - public static void main(String[] args) { + public static void meth() { Class> x = GetClass.class.getClass(); } } diff --git a/test/langtools/tools/javac/generics/Nonlinear.java b/test/langtools/tools/javac/generics/Nonlinear.java index 36004a07907..8bf88c07ca2 100644 --- a/test/langtools/tools/javac/generics/Nonlinear.java +++ b/test/langtools/tools/javac/generics/Nonlinear.java @@ -21,7 +21,7 @@ public class Nonlinear { // when executed, even though there are no explicit casts in // the program. - public static void main (String [] args) { + public static void meth() { Integer x = Integer.valueOf(5); String y = castit (x); System.out.println (y); diff --git a/test/langtools/tools/javac/generics/UnsoundInference.java b/test/langtools/tools/javac/generics/UnsoundInference.java index d2b3693a8f7..5b3f0909144 100644 --- a/test/langtools/tools/javac/generics/UnsoundInference.java +++ b/test/langtools/tools/javac/generics/UnsoundInference.java @@ -12,7 +12,7 @@ import java.util.Collection; public class UnsoundInference { - public static void main(String[] args) { + public static void meth() { Object[] objArray = {new Object()}; ArrayList strList = new ArrayList(); transferBug(objArray, strList); diff --git a/test/langtools/tools/javac/generics/diamond/neg/Neg08.java b/test/langtools/tools/javac/generics/diamond/neg/Neg08.java index e85e018425e..cbdaf07412e 100644 --- a/test/langtools/tools/javac/generics/diamond/neg/Neg08.java +++ b/test/langtools/tools/javac/generics/diamond/neg/Neg08.java @@ -9,7 +9,7 @@ */ class Neg08 { - public static void main(String[] args) { + public static void meth() { String s = new String<>("foo"); } } diff --git a/test/langtools/tools/javac/generics/diamond/neg/Neg13.java b/test/langtools/tools/javac/generics/diamond/neg/Neg13.java index 45c6ecaae98..9d4c1a8822b 100644 --- a/test/langtools/tools/javac/generics/diamond/neg/Neg13.java +++ b/test/langtools/tools/javac/generics/diamond/neg/Neg13.java @@ -15,7 +15,7 @@ class Neg13 { static void foo(A as) {} - public static void main(String[] args) { + public static void meth() { // Method invocation context - good <>(){} foo(new A<>() { diff --git a/test/langtools/tools/javac/generics/diamond/neg/Neg14.java b/test/langtools/tools/javac/generics/diamond/neg/Neg14.java index 0ad9114c784..d66071a74ed 100644 --- a/test/langtools/tools/javac/generics/diamond/neg/Neg14.java +++ b/test/langtools/tools/javac/generics/diamond/neg/Neg14.java @@ -15,7 +15,7 @@ class Neg14 { static void foo(A as) {} - public static void main(String[] args) { + public static void meth() { // Method invocation context - good <>(){} foo(new A<>() { diff --git a/test/langtools/tools/javac/generics/diamond/neg/Neg15.java b/test/langtools/tools/javac/generics/diamond/neg/Neg15.java index 573a5a1be3c..1bfca0a6e81 100644 --- a/test/langtools/tools/javac/generics/diamond/neg/Neg15.java +++ b/test/langtools/tools/javac/generics/diamond/neg/Neg15.java @@ -23,7 +23,7 @@ class Neg15 { throw new Error("Blew it"); } - public static void main(String[] args) { + public static void meth() { someMethod(new Predicate() { public boolean test(Integer n) { diff --git a/test/langtools/tools/javac/generics/diamond/neg/Neg17.java b/test/langtools/tools/javac/generics/diamond/neg/Neg17.java index 960fbd77a63..b82ec463129 100644 --- a/test/langtools/tools/javac/generics/diamond/neg/Neg17.java +++ b/test/langtools/tools/javac/generics/diamond/neg/Neg17.java @@ -11,7 +11,7 @@ abstract class Neg17 { abstract void m(); - public static void main(String[] args) { + void meth() { Collections.singletonList(new Neg17<>() { void m() {} }).get(0).m(); // good. Collections.singletonList(new Neg17<>() { void m() {} diff --git a/test/langtools/tools/javac/generics/diamond/neg/Neg18.java b/test/langtools/tools/javac/generics/diamond/neg/Neg18.java index 4acb7ef2f09..b02164af82b 100644 --- a/test/langtools/tools/javac/generics/diamond/neg/Neg18.java +++ b/test/langtools/tools/javac/generics/diamond/neg/Neg18.java @@ -10,7 +10,7 @@ import pkg.Neg18_01; class Neg18 { - public static void main(String[] args) { + public static void meth() { new Neg18_01<>() {}; } } diff --git a/test/langtools/tools/javac/generics/diamond/neg/Neg19.java b/test/langtools/tools/javac/generics/diamond/neg/Neg19.java index 173a72a8db9..e3b6d4f5e04 100644 --- a/test/langtools/tools/javac/generics/diamond/neg/Neg19.java +++ b/test/langtools/tools/javac/generics/diamond/neg/Neg19.java @@ -8,7 +8,7 @@ class Neg19 { - public static void main(String[] args) { + public static void meth() { new Neg19_01().foo(new Neg19_01<>()); // OK. new Neg19_01().foo(new Neg19_01<>() {}); // ERROR. } diff --git a/test/langtools/tools/javac/generics/inference/4972073/T4972073.java b/test/langtools/tools/javac/generics/inference/4972073/T4972073.java index 8a6dd65f1e7..2fffa48e868 100644 --- a/test/langtools/tools/javac/generics/inference/4972073/T4972073.java +++ b/test/langtools/tools/javac/generics/inference/4972073/T4972073.java @@ -22,9 +22,4 @@ public class T4972073 { } static class B & MyInterface> extends D {} - - - public static void main(String[] args) { - B b = new B(); - } } diff --git a/test/langtools/tools/javac/generics/inference/5081782/Neg.java b/test/langtools/tools/javac/generics/inference/5081782/Neg.java index f8869059944..eedee463f23 100644 --- a/test/langtools/tools/javac/generics/inference/5081782/Neg.java +++ b/test/langtools/tools/javac/generics/inference/5081782/Neg.java @@ -8,7 +8,7 @@ public class Neg { static void m() {} - public static void main(String... args) { + public static void meth() { Neg.m(); } } diff --git a/test/langtools/tools/javac/generics/odersky/BadTest.java b/test/langtools/tools/javac/generics/odersky/BadTest.java index 427a733e7a9..0f6b1506117 100644 --- a/test/langtools/tools/javac/generics/odersky/BadTest.java +++ b/test/langtools/tools/javac/generics/odersky/BadTest.java @@ -15,7 +15,7 @@ class BadTest { static Cell makeCell(A x) { return new Cell(x); } static A id(A x) { return x; } - public static void main(String[] args) { + public static void meth() { List> as = nil().prepend(makeCell(null)); List> bs = cons(makeCell(null), nil()); List xs = id(nil()); diff --git a/test/langtools/tools/javac/generics/odersky/BadTest3.java b/test/langtools/tools/javac/generics/odersky/BadTest3.java index 81f9c737751..c6f54c66eb3 100644 --- a/test/langtools/tools/javac/generics/odersky/BadTest3.java +++ b/test/langtools/tools/javac/generics/odersky/BadTest3.java @@ -27,7 +27,7 @@ class BadTest3 { static Cell makeCell(A x) { return new Cell(x); } static A id(A x) { return x; } - public static void main(String[] args) { + public static void meth() { List xs = nil(); f(null); f(nil()); diff --git a/test/langtools/tools/javac/generics/typeargs/Metharg1.java b/test/langtools/tools/javac/generics/typeargs/Metharg1.java index d3264126727..8cb95026542 100644 --- a/test/langtools/tools/javac/generics/typeargs/Metharg1.java +++ b/test/langtools/tools/javac/generics/typeargs/Metharg1.java @@ -32,10 +32,4 @@ class T { void f(K k) { this.f(""); } - - public static void main(String[] args) { - T x = new T(); - T.U y = x.new U(); - x.f(""); - } } diff --git a/test/langtools/tools/javac/generics/typeargs/Metharg2.java b/test/langtools/tools/javac/generics/typeargs/Metharg2.java index 2f0d2c3f0e3..239d1f2af1e 100644 --- a/test/langtools/tools/javac/generics/typeargs/Metharg2.java +++ b/test/langtools/tools/javac/generics/typeargs/Metharg2.java @@ -33,7 +33,7 @@ class T { this.f(""); } - public static void main(String[] args) { + public static void meth() { T x = new T(); T.U y = x.new U(); x.f(""); diff --git a/test/langtools/tools/javac/generics/typeargs/Newarg1.java b/test/langtools/tools/javac/generics/typeargs/Newarg1.java index 42f84164965..d44684d037b 100644 --- a/test/langtools/tools/javac/generics/typeargs/Newarg1.java +++ b/test/langtools/tools/javac/generics/typeargs/Newarg1.java @@ -14,7 +14,7 @@ class T { T(K x) { } - public static void main(String[] args) { + public static void meth() { new T(""); } } diff --git a/test/langtools/tools/javac/generics/typeargs/Newarg2.java b/test/langtools/tools/javac/generics/typeargs/Newarg2.java index d23a794c8f6..8794b722093 100644 --- a/test/langtools/tools/javac/generics/typeargs/Newarg2.java +++ b/test/langtools/tools/javac/generics/typeargs/Newarg2.java @@ -15,7 +15,7 @@ class T { U(B b) {} } - public static void main(String[] args) { + public static void meth() { new T().new U(""); } } diff --git a/test/langtools/tools/javac/generics/typeargs/Superarg1.java b/test/langtools/tools/javac/generics/typeargs/Superarg1.java index e1dae6a45df..6cb00eca5b7 100644 --- a/test/langtools/tools/javac/generics/typeargs/Superarg1.java +++ b/test/langtools/tools/javac/generics/typeargs/Superarg1.java @@ -32,10 +32,4 @@ class T { void f() { this.f(); } - - public static void main(String[] args) { - T x = new T(""); - T.U y = x.new U(); - x.f(); - } } diff --git a/test/langtools/tools/javac/generics/typeargs/Superarg2.java b/test/langtools/tools/javac/generics/typeargs/Superarg2.java index 62476951031..d10ce114868 100644 --- a/test/langtools/tools/javac/generics/typeargs/Superarg2.java +++ b/test/langtools/tools/javac/generics/typeargs/Superarg2.java @@ -32,10 +32,4 @@ class T { void f() { this.f(); } - - public static void main(String[] args) { - T x = new T(); - T.U y = x.new U(""); - x.f(); - } } diff --git a/test/langtools/tools/javac/generics/typeargs/ThisArg.java b/test/langtools/tools/javac/generics/typeargs/ThisArg.java index c2cf7f43b22..a4a447d3841 100644 --- a/test/langtools/tools/javac/generics/typeargs/ThisArg.java +++ b/test/langtools/tools/javac/generics/typeargs/ThisArg.java @@ -32,10 +32,4 @@ class T { void f() { this.f(); } - - public static void main(String[] args) { - T x = new T(); - T.U y = x.new U(""); - x.f(); - } } diff --git a/test/langtools/tools/javac/generics/wildcards/6437894/T6437894.java b/test/langtools/tools/javac/generics/wildcards/6437894/T6437894.java index f3bf10f79d4..e380be8832a 100644 --- a/test/langtools/tools/javac/generics/wildcards/6437894/T6437894.java +++ b/test/langtools/tools/javac/generics/wildcards/6437894/T6437894.java @@ -10,7 +10,7 @@ */ public class T6437894 { - public static void main(String... args) { + public static void meth() { b.B m; a.A.X x = null; Long.parseLong(x.toString()); diff --git a/test/langtools/tools/javac/generics/wildcards/AssignmentDifferentTypes.java b/test/langtools/tools/javac/generics/wildcards/AssignmentDifferentTypes.java index 558fe61c90e..e7e2972d320 100644 --- a/test/langtools/tools/javac/generics/wildcards/AssignmentDifferentTypes.java +++ b/test/langtools/tools/javac/generics/wildcards/AssignmentDifferentTypes.java @@ -7,7 +7,7 @@ public class AssignmentDifferentTypes { - public static void main(String[] args) { + public static void meth() { Ref derexact = null; Ref baseexact = null; Ref derext = null; diff --git a/test/langtools/tools/javac/generics/wildcards/AssignmentSameType.java b/test/langtools/tools/javac/generics/wildcards/AssignmentSameType.java index 39058ac8106..434aac431aa 100644 --- a/test/langtools/tools/javac/generics/wildcards/AssignmentSameType.java +++ b/test/langtools/tools/javac/generics/wildcards/AssignmentSameType.java @@ -7,7 +7,7 @@ public class AssignmentSameType { - public static void main(String[] args) { + public static void meth() { Ref exact = null; Ref ebound = null; Ref sbound = null; diff --git a/test/langtools/tools/javac/generics/wildcards/T6450290.java b/test/langtools/tools/javac/generics/wildcards/T6450290.java index 330922fffb3..d9d1f0099b6 100644 --- a/test/langtools/tools/javac/generics/wildcards/T6450290.java +++ b/test/langtools/tools/javac/generics/wildcards/T6450290.java @@ -14,7 +14,7 @@ public class T6450290 { static class A extends Box {} static class B extends Box {} - public static void main(String[] args) { + public static void meth() { Box b = new Box,Box>(); b.value.same = new Box(); //javac misses this bad assignment } diff --git a/test/langtools/tools/javac/implicitThis/NewBeforeOuterConstructed2.java b/test/langtools/tools/javac/implicitThis/NewBeforeOuterConstructed2.java index 1c9a299e266..f7cbdd94dc5 100644 --- a/test/langtools/tools/javac/implicitThis/NewBeforeOuterConstructed2.java +++ b/test/langtools/tools/javac/implicitThis/NewBeforeOuterConstructed2.java @@ -24,9 +24,4 @@ public class NewBeforeOuterConstructed2 { System.out.println("ok"); } } - public static void main(String[] args) { - NewBeforeOuterConstructed2 c = new NewBeforeOuterConstructed2(new Object()); - Middle m = c.new Middle(); - m.f(); - } } diff --git a/test/langtools/tools/javac/lambda/8071432/T8071432.java b/test/langtools/tools/javac/lambda/8071432/T8071432.java index 15f781e99d8..11d281287b0 100644 --- a/test/langtools/tools/javac/lambda/8071432/T8071432.java +++ b/test/langtools/tools/javac/lambda/8071432/T8071432.java @@ -41,7 +41,7 @@ class T8071432 { } } - public static void main(String[] args) { + public static void meth() { Collection c = Arrays.asList(new Point(1.0, 0.1)); System.out.println("------- 1 ---------------"); System.out.println(c.stream().reduce(0.0, diff --git a/test/langtools/tools/javac/lambda/LambdaConv10.java b/test/langtools/tools/javac/lambda/LambdaConv10.java index cc11f967f19..d71eb26576c 100644 --- a/test/langtools/tools/javac/lambda/LambdaConv10.java +++ b/test/langtools/tools/javac/lambda/LambdaConv10.java @@ -11,7 +11,7 @@ class LambdaConv10 { interface Method1 { public R call( A1 a1 ); } - public static void main( final String... notUsed ) { + public static void meth() { Method1 m1 = (int i) -> 2 * i; } } diff --git a/test/langtools/tools/javac/lambda/MethodReference20.java b/test/langtools/tools/javac/lambda/MethodReference20.java index e37ac797242..53f64fdd115 100644 --- a/test/langtools/tools/javac/lambda/MethodReference20.java +++ b/test/langtools/tools/javac/lambda/MethodReference20.java @@ -17,7 +17,7 @@ class MethodReference20 { static void test(SAM s) { } - public static void main(String[] args) { + public static void meth() { SAM s = MethodReference20::new; test(MethodReference20::new); } diff --git a/test/langtools/tools/javac/lambda/MethodReference25.java b/test/langtools/tools/javac/lambda/MethodReference25.java index ffd673b50f9..20f4ef63457 100644 --- a/test/langtools/tools/javac/lambda/MethodReference25.java +++ b/test/langtools/tools/javac/lambda/MethodReference25.java @@ -21,7 +21,7 @@ class MethodReference25 { static void call(int i, SAM1 s) { s.m(i); } static void call(int i, SAM2 s) { s.m(i); } - public static void main(String[] args) { + public static void meth() { call(1, MethodReference25::m); //ambiguous } } diff --git a/test/langtools/tools/javac/lambda/MethodReference41.java b/test/langtools/tools/javac/lambda/MethodReference41.java index c1c96efeb84..72b2b4485fb 100644 --- a/test/langtools/tools/javac/lambda/MethodReference41.java +++ b/test/langtools/tools/javac/lambda/MethodReference41.java @@ -34,7 +34,7 @@ public class MethodReference41 { static void m4(SAM2 s) { } static void m4(SAM3 s) { } - public static void main(String[] args) { + public static void meth() { m1(Foo::new); m2(Foo::new); m3(Foo::new); diff --git a/test/langtools/tools/javac/lambda/MethodReference42.java b/test/langtools/tools/javac/lambda/MethodReference42.java index 61bef68c770..b528582d236 100644 --- a/test/langtools/tools/javac/lambda/MethodReference42.java +++ b/test/langtools/tools/javac/lambda/MethodReference42.java @@ -34,7 +34,7 @@ public class MethodReference42 { static void m4(SAM2 s) { } static void m4(SAM3 s) { } - public static void main(String[] args) { + public static void meth() { m1(Foo::new); m2(Foo::new); m3(Foo::new); diff --git a/test/langtools/tools/javac/lambda/MethodReference43.java b/test/langtools/tools/javac/lambda/MethodReference43.java index e48ba12adea..3e3789fa0e7 100644 --- a/test/langtools/tools/javac/lambda/MethodReference43.java +++ b/test/langtools/tools/javac/lambda/MethodReference43.java @@ -41,7 +41,7 @@ public class MethodReference43 { static void m5(SAM3 s) { } static void m5(SAM4 s) { } - public static void main(String[] args) { + public static void meth() { m1(Foo::new); m2(Foo::new); m3(Foo::new); diff --git a/test/langtools/tools/javac/lambda/MethodReference44.java b/test/langtools/tools/javac/lambda/MethodReference44.java index 3a62d84657a..7ed6ac9fe8f 100644 --- a/test/langtools/tools/javac/lambda/MethodReference44.java +++ b/test/langtools/tools/javac/lambda/MethodReference44.java @@ -36,7 +36,7 @@ public class MethodReference44 { static void g4(SAM2 s) { } static void g4(SAM3 s) { } - public static void main(String[] args) { + public static void meth() { g1(MethodReference44::m); g2(MethodReference44::m); g3(MethodReference44::m); diff --git a/test/langtools/tools/javac/lambda/MethodReference46.java b/test/langtools/tools/javac/lambda/MethodReference46.java index 874c4eb5ca3..e7a4e6dfee3 100644 --- a/test/langtools/tools/javac/lambda/MethodReference46.java +++ b/test/langtools/tools/javac/lambda/MethodReference46.java @@ -36,7 +36,7 @@ public class MethodReference46 { static void g4(SAM2 s) { } static void g4(SAM3 s) { } - public static void main(String[] args) { + public static void meth() { g1(MethodReference46::m); g2(MethodReference46::m); g3(MethodReference46::m); diff --git a/test/langtools/tools/javac/lambda/MethodReference47.java b/test/langtools/tools/javac/lambda/MethodReference47.java index d5fff0dd4b4..29fcef2ba9b 100644 --- a/test/langtools/tools/javac/lambda/MethodReference47.java +++ b/test/langtools/tools/javac/lambda/MethodReference47.java @@ -25,7 +25,7 @@ public class MethodReference47 { static void g2(SAM1 s) { } static void g2(SAM2 s) { } - public static void main(String[] args) { + public static void meth() { g1(MethodReference47::m); g2(MethodReference47::m); } diff --git a/test/langtools/tools/javac/lambda/MethodReference48.java b/test/langtools/tools/javac/lambda/MethodReference48.java index 153ec900700..95ae39ed788 100644 --- a/test/langtools/tools/javac/lambda/MethodReference48.java +++ b/test/langtools/tools/javac/lambda/MethodReference48.java @@ -34,7 +34,7 @@ public class MethodReference48 { static void g4(SAM2 s) { } //ok static void g4(SAM3 s) { } //ok - public static void main(String[] args) { + public static void meth() { g1(Foo::m); g2(Foo::m); g3(Foo::m); diff --git a/test/langtools/tools/javac/lambda/MethodReference60.java b/test/langtools/tools/javac/lambda/MethodReference60.java index 4209e1b9a32..d4ed66fde27 100644 --- a/test/langtools/tools/javac/lambda/MethodReference60.java +++ b/test/langtools/tools/javac/lambda/MethodReference60.java @@ -22,7 +22,7 @@ public class MethodReference60 { X make(String s); } - public static void main(String[] args) { + public static void meth() { BadArrayFactory1 factory1 = int[]::new; //param mismatch BadArrayFactory2 factory2 = int[]::new; //param mismatch BadArrayFactory3 factory3 = int[]::new; //param mismatch diff --git a/test/langtools/tools/javac/lambda/MostSpecific04.java b/test/langtools/tools/javac/lambda/MostSpecific04.java index 363661964ad..2663e0d9060 100644 --- a/test/langtools/tools/javac/lambda/MostSpecific04.java +++ b/test/langtools/tools/javac/lambda/MostSpecific04.java @@ -20,7 +20,7 @@ public class MostSpecific04 { void map(LongMapper m) { } } - public static void main(String[] args) { + public static void meth() { MyList ls = new MyList(); ls.map(e->e.length()); //ambiguous - implicit ls.map((String e)->e.length()); //ok diff --git a/test/langtools/tools/javac/lambda/MostSpecific05.java b/test/langtools/tools/javac/lambda/MostSpecific05.java index 345578b509d..34d439d6a78 100644 --- a/test/langtools/tools/javac/lambda/MostSpecific05.java +++ b/test/langtools/tools/javac/lambda/MostSpecific05.java @@ -20,7 +20,7 @@ public class MostSpecific05 { void map(NumberConverter m) { } } - public static void main(String[] args) { + public static void meth() { MyMapper mm = new MyMapper(); mm.map(e->1.0); //ambiguous - implicit mm.map((Object e)->1.0); //ok diff --git a/test/langtools/tools/javac/lambda/funcInterfaces/LambdaTest2_neg1.java b/test/langtools/tools/javac/lambda/funcInterfaces/LambdaTest2_neg1.java index 2375733dea0..a2f618b0202 100644 --- a/test/langtools/tools/javac/lambda/funcInterfaces/LambdaTest2_neg1.java +++ b/test/langtools/tools/javac/lambda/funcInterfaces/LambdaTest2_neg1.java @@ -9,7 +9,7 @@ public class LambdaTest2_neg1 { - public static void main(String[] args) { + public static void meth() { LambdaTest2_neg1 test = new LambdaTest2_neg1(); //not convertible - QooRoo is not a SAM test.methodQooRoo((Integer i) -> { }); diff --git a/test/langtools/tools/javac/lambda/methodReference/MethodRefIntColonColonNewTest.java b/test/langtools/tools/javac/lambda/methodReference/MethodRefIntColonColonNewTest.java index 61cd10b4dc7..8b119dea28b 100644 --- a/test/langtools/tools/javac/lambda/methodReference/MethodRefIntColonColonNewTest.java +++ b/test/langtools/tools/javac/lambda/methodReference/MethodRefIntColonColonNewTest.java @@ -13,7 +13,7 @@ public class MethodRefIntColonColonNewTest { static SAM infmethod(SAM t) { return t; } - public static void main(String argv[]) { + public static void meth() { SAM s = infmethod(int::new); s.m(); } diff --git a/test/langtools/tools/javac/lambda/methodReference/MethodRefToInnerWithoutOuter.java b/test/langtools/tools/javac/lambda/methodReference/MethodRefToInnerWithoutOuter.java index 39b81f1b2e9..c0a7ab3929c 100644 --- a/test/langtools/tools/javac/lambda/methodReference/MethodRefToInnerWithoutOuter.java +++ b/test/langtools/tools/javac/lambda/methodReference/MethodRefToInnerWithoutOuter.java @@ -17,7 +17,7 @@ class MethodRefToInnerBase { } } public class MethodRefToInnerWithoutOuter extends MethodRefToInnerBase { - public static void main(String[] args) { + public static void meth() { List list = new ArrayList<>(); list.stream().forEach(TestString::new); } diff --git a/test/langtools/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestVarHandle_neg.java b/test/langtools/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestVarHandle_neg.java index f5f2993aa85..e86f2e67d9b 100644 --- a/test/langtools/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestVarHandle_neg.java +++ b/test/langtools/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestVarHandle_neg.java @@ -13,7 +13,7 @@ public class MethodReferenceTestVarHandle_neg { int apply(int[] arr, int idx, int val); } - public static void main(String[] args) { + public static void meth() { VarHandle vh = MethodHandles.arrayElementVarHandle(int[].class); // Return type of Setter::apply does not match return type of VarHandle::set diff --git a/test/langtools/tools/javac/lambda/typeInference/InferenceTest_neg1_2.java b/test/langtools/tools/javac/lambda/typeInference/InferenceTest_neg1_2.java index 3d77c95fd5a..c85a61a1fbf 100644 --- a/test/langtools/tools/javac/lambda/typeInference/InferenceTest_neg1_2.java +++ b/test/langtools/tools/javac/lambda/typeInference/InferenceTest_neg1_2.java @@ -9,7 +9,7 @@ public class InferenceTest_neg1_2 { - public static void main(String[] args) { + public static void meth() { InferenceTest_neg1_2 test = new InferenceTest_neg1_2(); test.method(n -> null); //method 1-5 all match test.method(n -> "a"); //method 2, 4 match diff --git a/test/langtools/tools/javac/limits/ArrayDims1.java b/test/langtools/tools/javac/limits/ArrayDims1.java index a68d65f18ac..5b0e5f29d2e 100644 --- a/test/langtools/tools/javac/limits/ArrayDims1.java +++ b/test/langtools/tools/javac/limits/ArrayDims1.java @@ -58,6 +58,4 @@ class ArrayDims1 { [][][][][][][][][][] [][][][][][][][][][] [][][][][] o; // 255 = limit (OK) - public static void main(String[] args) { - } } diff --git a/test/langtools/tools/javac/limits/ArrayDims2.java b/test/langtools/tools/javac/limits/ArrayDims2.java index 947fba8b850..67296dc5e86 100644 --- a/test/langtools/tools/javac/limits/ArrayDims2.java +++ b/test/langtools/tools/javac/limits/ArrayDims2.java @@ -35,6 +35,4 @@ class ArrayDims2 { [][][][][][][][][][] [][][][][][][][][][] [][][][][][] o; // 256 = too many - public static void main(String[] args) { - } } diff --git a/test/langtools/tools/javac/limits/ArrayDims3.java b/test/langtools/tools/javac/limits/ArrayDims3.java index 051beef028c..ad5f34976ce 100644 --- a/test/langtools/tools/javac/limits/ArrayDims3.java +++ b/test/langtools/tools/javac/limits/ArrayDims3.java @@ -58,6 +58,4 @@ class ArrayDims3 { [][][][][][][][][][] [][][][][][][][][][] [][][][][]; // 255 = limit (OK) - public static void main(String[] args) { - } } diff --git a/test/langtools/tools/javac/limits/ArrayDims4.java b/test/langtools/tools/javac/limits/ArrayDims4.java index 31a3f1a719d..7a9f83a8f66 100644 --- a/test/langtools/tools/javac/limits/ArrayDims4.java +++ b/test/langtools/tools/javac/limits/ArrayDims4.java @@ -35,6 +35,4 @@ class ArrayDims4 { [][][][][][][][][][] [][][][][][][][][][] [][][][][][]; // 256 = too many - public static void main(String[] args) { - } } diff --git a/test/langtools/tools/javac/limits/PoolSize2.java b/test/langtools/tools/javac/limits/PoolSize2.java index d5f946ca727..6cc529c31fe 100644 --- a/test/langtools/tools/javac/limits/PoolSize2.java +++ b/test/langtools/tools/javac/limits/PoolSize2.java @@ -3331,6 +3331,4 @@ class PoolSize2 { ,32762.0,32763.0,32764.0,32765.0,32766.0,32767.0 }; } - public static void main(String args[]) { - System.out.println("Ok"); } } diff --git a/test/langtools/tools/javac/limits/StringLength.java b/test/langtools/tools/javac/limits/StringLength.java index b7ce4d116d4..be17379406c 100644 --- a/test/langtools/tools/javac/limits/StringLength.java +++ b/test/langtools/tools/javac/limits/StringLength.java @@ -20,7 +20,4 @@ class StringLength { public static final String l65530 = l6e4 + l5e3 + l5e2 + l3e1; public static String X = l65530 + "abcdef"; // length 65536 - public static void main(String[] args) { - System.out.println(X.length()); - } } diff --git a/test/langtools/tools/javac/nested/5009484/X.java b/test/langtools/tools/javac/nested/5009484/X.java index b35f5584824..06718d86404 100644 --- a/test/langtools/tools/javac/nested/5009484/X.java +++ b/test/langtools/tools/javac/nested/5009484/X.java @@ -11,7 +11,7 @@ public class X { X(T t) { this.t = t; } - public static void main(String[] args) { + public static void meth() { new X("OUTER").bar(); } void bar() { diff --git a/test/langtools/tools/javac/overload/T5090220.java b/test/langtools/tools/javac/overload/T5090220.java index 96a897e2fae..c9b39ef22d1 100644 --- a/test/langtools/tools/javac/overload/T5090220.java +++ b/test/langtools/tools/javac/overload/T5090220.java @@ -12,7 +12,7 @@ class T5090220 { static void foo(Integer i1, double d) { System.out.println("double"); } - public static void main(String[] args) { + public static void meth() { foo(5, 5); } } diff --git a/test/langtools/tools/javac/patterns/BindingsTest1Merging.java b/test/langtools/tools/javac/patterns/BindingsTest1Merging.java index f6e1f6dd201..f9262ae385c 100644 --- a/test/langtools/tools/javac/patterns/BindingsTest1Merging.java +++ b/test/langtools/tools/javac/patterns/BindingsTest1Merging.java @@ -7,7 +7,7 @@ public class BindingsTest1Merging { public static boolean Ktrue() { return true; } - public static void main(String[] args) { + public static void meth() { Object o1 = "hello"; Integer i = 42; Object o2 = i; diff --git a/test/langtools/tools/javac/patterns/BindingsTest2.java b/test/langtools/tools/javac/patterns/BindingsTest2.java index d3247ea4273..b9bd372ddc8 100644 --- a/test/langtools/tools/javac/patterns/BindingsTest2.java +++ b/test/langtools/tools/javac/patterns/BindingsTest2.java @@ -6,7 +6,7 @@ */ public class BindingsTest2 { public static boolean Ktrue() { return true; } - public static void main(String[] args) { + public static void meth() { Object o1 = "hello"; Integer in = 42; Object o2 = in; diff --git a/test/langtools/tools/javac/patterns/CastConversionMatch.java b/test/langtools/tools/javac/patterns/CastConversionMatch.java index a6dde442082..ec249afee52 100644 --- a/test/langtools/tools/javac/patterns/CastConversionMatch.java +++ b/test/langtools/tools/javac/patterns/CastConversionMatch.java @@ -6,7 +6,7 @@ */ public class CastConversionMatch { - public static void main(String [] args) { + public static void meth() { Object o = 42; if (o instanceof int s) { System.out.println("Okay"); diff --git a/test/langtools/tools/javac/patterns/DeconstructionPatternErrors.java b/test/langtools/tools/javac/patterns/DeconstructionPatternErrors.java index 7c7d8a90a74..2a486c8042d 100644 --- a/test/langtools/tools/javac/patterns/DeconstructionPatternErrors.java +++ b/test/langtools/tools/javac/patterns/DeconstructionPatternErrors.java @@ -9,7 +9,7 @@ import java.util.List; public class DeconstructionPatternErrors { - public static void main(String... args) throws Throwable { + public static void meth() throws Throwable { Object p; p = new P(42); if (p instanceof P(_)); diff --git a/test/langtools/tools/javac/patterns/DeconstructionPatternErrors.out b/test/langtools/tools/javac/patterns/DeconstructionPatternErrors.out index d4fbf80b199..8fba5a32214 100644 --- a/test/langtools/tools/javac/patterns/DeconstructionPatternErrors.out +++ b/test/langtools/tools/javac/patterns/DeconstructionPatternErrors.out @@ -20,8 +20,8 @@ DeconstructionPatternErrors.java:27:29: compiler.err.instanceof.reifiable.not.sa DeconstructionPatternErrors.java:28:44: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.String, java.lang.Integer) DeconstructionPatternErrors.java:28:13: compiler.err.instanceof.reifiable.not.safe: java.lang.Object, DeconstructionPatternErrors.GenRecord DeconstructionPatternErrors.java:29:40: compiler.err.match.binding.exists -DeconstructionPatternErrors.java:30:56: compiler.err.already.defined: kindname.variable, v1, kindname.method, main(java.lang.String...) -DeconstructionPatternErrors.java:30:64: compiler.err.already.defined: kindname.variable, v2, kindname.method, main(java.lang.String...) +DeconstructionPatternErrors.java:30:56: compiler.err.already.defined: kindname.variable, v1, kindname.method, meth() +DeconstructionPatternErrors.java:30:64: compiler.err.already.defined: kindname.variable, v2, kindname.method, meth() DeconstructionPatternErrors.java:31:29: compiler.err.prob.found.req: (compiler.misc.not.applicable.types: int, byte) DeconstructionPatternErrors.java:32:29: compiler.err.prob.found.req: (compiler.misc.not.applicable.types: int, long) DeconstructionPatternErrors.java:34:21: compiler.err.prob.found.req: (compiler.misc.not.applicable.types: int, byte) diff --git a/test/langtools/tools/javac/patterns/EnsureTypesOrderTest.java b/test/langtools/tools/javac/patterns/EnsureTypesOrderTest.java index 5c18fd750ca..b2f01d20128 100644 --- a/test/langtools/tools/javac/patterns/EnsureTypesOrderTest.java +++ b/test/langtools/tools/javac/patterns/EnsureTypesOrderTest.java @@ -5,7 +5,7 @@ * @compile/fail/ref=EnsureTypesOrderTest.out -XDrawDiagnostics EnsureTypesOrderTest.java */ public class EnsureTypesOrderTest { - public static void main(String [] args) { + public static void meth(String[] args) { if (args instanceof String s) { System.out.println("Broken"); } diff --git a/test/langtools/tools/javac/patterns/ImpossibleTypeTest.java b/test/langtools/tools/javac/patterns/ImpossibleTypeTest.java index 2c4ba47adeb..2ff55f3f625 100644 --- a/test/langtools/tools/javac/patterns/ImpossibleTypeTest.java +++ b/test/langtools/tools/javac/patterns/ImpossibleTypeTest.java @@ -6,7 +6,7 @@ */ public class ImpossibleTypeTest { - public static void main(String[] args) { + public static void meth() { int in = 42; Integer i = 42; diff --git a/test/langtools/tools/javac/patterns/MatchBindingScopeTest.java b/test/langtools/tools/javac/patterns/MatchBindingScopeTest.java index 2e32428a67d..d8251ff32a2 100644 --- a/test/langtools/tools/javac/patterns/MatchBindingScopeTest.java +++ b/test/langtools/tools/javac/patterns/MatchBindingScopeTest.java @@ -11,7 +11,7 @@ public class MatchBindingScopeTest { static Object o1 = s; static Object o2 = i; - public static void main(String[] args) { + public static void meth() { if (o1 instanceof String j && j.length() == 5) { // OK System.out.println(j); // OK diff --git a/test/langtools/tools/javac/patterns/NullsInPatterns.java b/test/langtools/tools/javac/patterns/NullsInPatterns.java index 5873886b2ed..9f9afd425e9 100644 --- a/test/langtools/tools/javac/patterns/NullsInPatterns.java +++ b/test/langtools/tools/javac/patterns/NullsInPatterns.java @@ -8,7 +8,7 @@ import java.util.List; public class NullsInPatterns { - public static void main(String[] args) { + public static void meth() { if (null instanceof List t) { throw new AssertionError("broken"); } else { diff --git a/test/langtools/tools/javac/patterns/PatternVariablesAreNonFinal.java b/test/langtools/tools/javac/patterns/PatternVariablesAreNonFinal.java index 96cb69e8021..5129a15fe20 100644 --- a/test/langtools/tools/javac/patterns/PatternVariablesAreNonFinal.java +++ b/test/langtools/tools/javac/patterns/PatternVariablesAreNonFinal.java @@ -5,7 +5,7 @@ * @compile/fail/ref=PatternVariablesAreNonFinal.out -XDrawDiagnostics PatternVariablesAreNonFinal.java */ public class PatternVariablesAreNonFinal { - public static void main(String[] args) { + public static void meth() { Object o = 32; if (o instanceof String s) { s = "hello again"; diff --git a/test/langtools/tools/javac/patterns/UncheckedWarningOnMatchesTest.java b/test/langtools/tools/javac/patterns/UncheckedWarningOnMatchesTest.java index db0a58f5c41..239b7c32fe1 100644 --- a/test/langtools/tools/javac/patterns/UncheckedWarningOnMatchesTest.java +++ b/test/langtools/tools/javac/patterns/UncheckedWarningOnMatchesTest.java @@ -8,7 +8,7 @@ import java.util.ArrayList; public class UncheckedWarningOnMatchesTest { - public static void main(String [] args) { + public static void meth() { Object o = new ArrayList(); if (o instanceof ArrayList ai) { // unchecked conversion diff --git a/test/langtools/tools/javac/scope/6225935/Estatico4.java b/test/langtools/tools/javac/scope/6225935/Estatico4.java index c2b17d6cc00..212791786db 100644 --- a/test/langtools/tools/javac/scope/6225935/Estatico4.java +++ b/test/langtools/tools/javac/scope/6225935/Estatico4.java @@ -12,7 +12,7 @@ import static javax.swing.JLabel.*; public class Estatico4 { - public static void main(String[] s) { + public static void meth() { System.out.println(CENTER); } diff --git a/test/langtools/tools/javac/staticImport/ImportPrivate.java b/test/langtools/tools/javac/staticImport/ImportPrivate.java index b108d498f4e..3c53b20d696 100644 --- a/test/langtools/tools/javac/staticImport/ImportPrivate.java +++ b/test/langtools/tools/javac/staticImport/ImportPrivate.java @@ -18,7 +18,7 @@ class A { } class MyTest { - public static void main(String argv[]) { + public static void meth() { m(); } } diff --git a/test/langtools/tools/javac/switchexpr/DefiniteAssignment2.java b/test/langtools/tools/javac/switchexpr/DefiniteAssignment2.java index 61bfd2d9164..6abb0b81089 100644 --- a/test/langtools/tools/javac/switchexpr/DefiniteAssignment2.java +++ b/test/langtools/tools/javac/switchexpr/DefiniteAssignment2.java @@ -6,7 +6,7 @@ */ public class DefiniteAssignment2 { - public static void main(String[] args) { + public static void meth() { int a = 0; boolean b = true; boolean t; diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.java index 7ee015f59b4..ca1f3bac273 100644 --- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.java +++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.java @@ -7,7 +7,7 @@ public class ExpressionSwitchUnreachable { - public static void main(String[] args) { + public static void meth() { int z = 42; int i = switch (z) { case 0 -> { diff --git a/test/langtools/tools/javac/switchextra/DefiniteAssignment2.java b/test/langtools/tools/javac/switchextra/DefiniteAssignment2.java index d3789419760..09a74cfb8f2 100644 --- a/test/langtools/tools/javac/switchextra/DefiniteAssignment2.java +++ b/test/langtools/tools/javac/switchextra/DefiniteAssignment2.java @@ -5,7 +5,7 @@ */ public class DefiniteAssignment2 { - public static void main(String[] args) { + public static void meth() { int a = 0; E e = E.A; diff --git a/test/langtools/tools/javac/unicode/NonasciiDigit.java b/test/langtools/tools/javac/unicode/NonasciiDigit.java index 9a585d06ad1..1e64e7ebdb8 100644 --- a/test/langtools/tools/javac/unicode/NonasciiDigit.java +++ b/test/langtools/tools/javac/unicode/NonasciiDigit.java @@ -7,7 +7,7 @@ * @compile/fail/ref=NonasciiDigit.out -XDrawDiagnostics NonasciiDigit.java */ public class NonasciiDigit { - public static void main(String[] args) { + public static void meth() { // error: only ASCII allowed in constants int i1 = \uff11; int i2 = 1\uff11; diff --git a/test/langtools/tools/javac/varargs/6313164/T7175433.java b/test/langtools/tools/javac/varargs/6313164/T7175433.java index 4384cf5d9b9..b9453319f91 100644 --- a/test/langtools/tools/javac/varargs/6313164/T7175433.java +++ b/test/langtools/tools/javac/varargs/6313164/T7175433.java @@ -19,7 +19,7 @@ class Bar { public class T7175433 { - public static void main(String[] args) { + public static void meth() { Bar b = new Bar(); b.m(b.getFoo()); } diff --git a/test/langtools/tools/javac/varargs/Warn2.java b/test/langtools/tools/javac/varargs/Warn2.java index c4b32fc8bb0..9ba8b8f8832 100644 --- a/test/langtools/tools/javac/varargs/Warn2.java +++ b/test/langtools/tools/javac/varargs/Warn2.java @@ -14,7 +14,7 @@ package varargs.warn2; class T { static void f(String fmt, Object... args) {} - public static void main(String[] args) { + public static void meth() { f("foo", null); } }