Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/4980495/static/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class Test {

public static void main(String argv[]) {
public static void meth() {
f = 1;
}
}
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/4980495/std/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class Test {

public static void main(String argv[]) {
public static void meth() {
new f();
}
}
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/6491592/T6491592.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

public class T6491592 {
public static void main(String... args) {
public static void meth() {
Object o = null;
o += null;
}
Expand Down
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/6857948/T6857948.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Foo {
};

class Test {
public static void main() {
public static void meth() {
Foo f = new Foo("Hello!",nosuchfunction()) {};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

public class UnresolvableClassNPEInAttrTest {
public static void main(String[] args) {
public static void meth() {
new Undefined() {
void test() {
new Object() {};
Expand Down
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/8161985/T8161985a.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

class T8161985 {
public static void main(String [] arg) {
public static void meth() {
T8161985 t = new T8161985();
t.getClass();

Expand Down
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/8238735/T8238735.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

class T8238735 {
public static void main(String[] args) {
public static void meth() {
boolean first = true;
first = first ? false : (boolean)(() -> false) ;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,4 @@ void foo() {
}
}); }
}

public static void main(String[] args) {
new JavacBug();
}
}
}
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/BreakAcrossClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

class BreakAcrossClass {
public static void main(String argv[]) {
public static void meth() {
final int i = 6;
M: {
class A {
Expand Down
10 changes: 0 additions & 10 deletions test/langtools/tools/javac/CaptureInSubtype.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,4 @@ public static class ShowFlaw extends SuperOfShowFlaw {

Flaw<?> m(){return fn;}
}

public static void main(String[] args) {
SuperOfShowFlaw sosf = new ShowFlaw();
SuperOfFlaw<List<?>> sof = sosf.m();
List<String> ls = new ArrayList<String>();
ls.add("Smalltalk rules!");
sof.put(ls);
Number n = ShowFlaw.fn.get().get(0);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

public class DASwitch {
public static void main(final String[] args) {
public static void meth() {
int t = 1;
{
final int x;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

class T4717164 {
public static void main(String[] args) {
public static void meth() {
try {
try {
throw new ClassNotFoundException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static class E extends Exception {}
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/OverrideChecks/T4721069.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static void f(I i) {
x.getClass();
}
}
public static void main(String[] args) {
public static void meth() {
f(null);
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/ParseConditional.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/SwitchScope.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/SynthName2.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/T5003235/T5003235b.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private class Inner {
}

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);
Expand Down
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/T6306967.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

public class T6306967 {
public static void main(String[] args) {
public static void meth() {
final int x;
while(true) {
if (true) {
Expand Down
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/T6326754.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public <T>void setT(T t){
}
}
public class T6326754{
public static void main(String... arg){
public static void meth() {
TestC tC =new TestC();
tC.setT();
TestConstructor tc = new TestConstructor("saaa");
Expand Down
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/T6379327.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 0 additions & 3 deletions test/langtools/tools/javac/T6407257.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@
class T6407257a extends T6407257a {}

public class T6407257 extends T6407257a {
public static void main(String... args) {
main(args);
}
}
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/TryWithResources/BadTwr.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
6 changes: 3 additions & 3 deletions test/langtools/tools/javac/TryWithResources/BadTwr.out
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) { }
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/TryWithResources/PlainTry.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
;
}
Expand Down
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/TryWithResources/T7022711.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class TwrAndLambda {

public static void main(String... args) {
public static void meth() {

// Lambda expression
AutoCloseable v1 = () -> {};
Expand Down
2 changes: 1 addition & 1 deletion test/langtools/tools/javac/TryWithResources/TwrFlow.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading