Skip to content

Failed

org.eclipse.jdt.core.tests.compiler.regression.ProblemTypeAndMethodTest.test117b - 1.8 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)

Failing for the past 4 builds (Since #6 )
Took 0.64 sec.

Error Message

test117b - Eclipse found error(s) but Javac only found warning(s).
----------- Expected ------------
----------\n
1. ERROR in X.java (at line 4)\n
 public void bar1(int i) {\n
             ^^^^^^^^^^^\n
The method bar1(int) from the type X can potentially be declared as static\n
----------\n
2. ERROR in X.java (at line 10)\n
 public void bar3(int i) {\n
             ^^^^^^^^^^^\n
The method bar3(int) from the type X can potentially be declared as static\n
----------\n
3. ERROR in X.java (at line 16)\n
 public void bar5(int i) {\n
             ^^^^^^^^^^^\n
The method bar5(int) from the type X can potentially be declared as static\n
----------\n
4. ERROR in X.java (at line 20)\n
 public void bar6(int i) {\n
             ^^^^^^^^^^^\n
The method bar6(int) from the type X can potentially be declared as static\n
----------\n
5. ERROR in X.java (at line 23)\n
 public void bar7(int i) {\n
             ^^^^^^^^^^^\n
The method bar7(int) from the type X can potentially be declared as static\n
----------\n
6. ERROR in X.java (at line 29)\n
 public void bar9(int i) {\n
             ^^^^^^^^^^^\n
The method bar9(int) from the type X can potentially be declared as static\n
----------\n
7. ERROR in X.java (at line 38)\n
 public void bar12(int i) {\n
             ^^^^^^^^^^^^\n
The method bar12(int) from the type X can potentially be declared as static\n
----------\n
8. ERROR in X.java (at line 41)\n
 public void bar13(int i) {\n
             ^^^^^^^^^^^^\n
The method bar13(int) from the type X can potentially be declared as static\n
----------\n
9. ERROR in X.java (at line 47)\n
 public void bar15(int i) {\n
             ^^^^^^^^^^^^\n
The method bar15(int) from the type X can potentially be declared as static\n
----------\n
10. ERROR in X.java (at line 50)\n
 public void bar16(int i) {\n
             ^^^^^^^^^^^^\n
The method bar16(int) from the type X can potentially be declared as static\n
----------\n

------------ but was ------------
X.java:8: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  this.field1 = 1;\n
      ^\n
X.java:14: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  System.out.println(this.field1);\n
                         ^\n
X.java:18: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  x.field1 = 1;\n
   ^\n
X.java:21: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  A.xA.field1 = 1;\n
      ^\n
X.java:27: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
  this.b1 = 1;\n
      ^\n
X.java:30: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
  new X().b1 = 1;\n
         ^\n
X.java:33: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  this.xfield.field1 = 1;\n
      ^\n
X.java:33: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  this.xfield.field1 = 1;\n
             ^\n
X.java:36: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  System.out.println(this.xfield.field1);\n
                         ^\n
X.java:36: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  System.out.println(this.xfield.field1);\n
                                ^\n
X.java:39: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
  System.out.println(new X().b1);\n
                            ^\n
X.java:45: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
  System.out.println(this.b1);\n
                         ^\n
X.java:48: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  xfield.field1 = 1;\n
        ^\n
X.java:51: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  System.out.println(xfield.field1);\n
                           ^\n
14 warnings\n

--------- Difference is ----------
 expected:<[----------\n
1. ERROR in X.java (at line 4)\n
 public void bar1(int i) {\n
             ^^^^^^^^^^^\n
The method bar1(int) from the type X can potentially be declared as static\n
----------\n
2. ERROR in X.java (at line 10)\n
 public void bar3(int i) {\n
             ^^^^^^^^^^^\n
The method bar3(int) from the type X can potentially be declared as static\n
----------\n
3. ERROR in X.java (at line 16)\n
 public void bar5(int i) {\n
             ^^^^^^^^^^^\n
The method bar5(int) from the type X can potentially be declared as static\n
----------\n
4. ERROR in X.java (at line 20)\n
 public void bar6(int i) {\n
             ^^^^^^^^^^^\n
The method bar6(int) from the type X can potentially be declared as static\n
----------\n
5. ERROR in X.java (at line 23)\n
 public void bar7(int i) {\n
             ^^^^^^^^^^^\n
The method bar7(int) from the type X can potentially be declared as static\n
----------\n
6. ERROR in X.java (at line 29)\n
 public void bar9(int i) {\n
             ^^^^^^^^^^^\n
The method bar9(int) from the type X can potentially be declared as static\n
----------\n
7. ERROR in X.java (at line 38)\n
 public void bar12(int i) {\n
             ^^^^^^^^^^^^\n
The method bar12(int) from the type X can potentially be declared as static\n
----------\n
8. ERROR in X.java (at line 41)\n
 public void bar13(int i) {\n
             ^^^^^^^^^^^^\n
The method bar13(int) from the type X can potentially be declared as static\n
----------\n
9. ERROR in X.java (at line 47)\n
 public void bar15(int i) {\n
             ^^^^^^^^^^^^\n
The method bar15(int) from the type X can potentially be declared as static\n
----------\n
10. ERROR in X.java (at line 50)\n
 public void bar16(int i) {\n
             ^^^^^^^^^^^^\n
The method bar16(int) from the type X can potentially be declared as static\n
----------]\n
> but was:<[X.java:8: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  this.field1 = 1;\n
      ^\n
X.java:14: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  System.out.println(this.field1);\n
                         ^\n
X.java:18: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  x.field1 = 1;\n
   ^\n
X.java:21: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  A.xA.field1 = 1;\n
      ^\n
X.java:27: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
  this.b1 = 1;\n
      ^\n
X.java:30: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
  new X().b1 = 1;\n
         ^\n
X.java:33: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  this.xfield.field1 = 1;\n
      ^\n
X.java:33: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  this.xfield.field1 = 1;\n
             ^\n
X.java:36: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  System.out.println(this.xfield.field1);\n
                         ^\n
X.java:36: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  System.out.println(this.xfield.field1);\n
                                ^\n
X.java:39: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
  System.out.println(new X().b1);\n
                            ^\n
X.java:45: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
  System.out.println(this.b1);\n
                         ^\n
X.java:48: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  xfield.field1 = 1;\n
        ^\n
X.java:51: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
  System.out.println(xfield.field1);\n
                           ^\n
14 warnings]\n
>

Stacktrace

junit.framework.ComparisonFailure: test117b - Eclipse found error(s) but Javac only found warning(s).
----------- Expected ------------
----------\n
1. ERROR in X.java (at line 4)\n
	public void bar1(int i) {\n
	            ^^^^^^^^^^^\n
The method bar1(int) from the type X can potentially be declared as static\n
----------\n
2. ERROR in X.java (at line 10)\n
	public void bar3(int i) {\n
	            ^^^^^^^^^^^\n
The method bar3(int) from the type X can potentially be declared as static\n
----------\n
3. ERROR in X.java (at line 16)\n
	public void bar5(int i) {\n
	            ^^^^^^^^^^^\n
The method bar5(int) from the type X can potentially be declared as static\n
----------\n
4. ERROR in X.java (at line 20)\n
	public void bar6(int i) {\n
	            ^^^^^^^^^^^\n
The method bar6(int) from the type X can potentially be declared as static\n
----------\n
5. ERROR in X.java (at line 23)\n
	public void bar7(int i) {\n
	            ^^^^^^^^^^^\n
The method bar7(int) from the type X can potentially be declared as static\n
----------\n
6. ERROR in X.java (at line 29)\n
	public void bar9(int i) {\n
	            ^^^^^^^^^^^\n
The method bar9(int) from the type X can potentially be declared as static\n
----------\n
7. ERROR in X.java (at line 38)\n
	public void bar12(int i) {\n
	            ^^^^^^^^^^^^\n
The method bar12(int) from the type X can potentially be declared as static\n
----------\n
8. ERROR in X.java (at line 41)\n
	public void bar13(int i) {\n
	            ^^^^^^^^^^^^\n
The method bar13(int) from the type X can potentially be declared as static\n
----------\n
9. ERROR in X.java (at line 47)\n
	public void bar15(int i) {\n
	            ^^^^^^^^^^^^\n
The method bar15(int) from the type X can potentially be declared as static\n
----------\n
10. ERROR in X.java (at line 50)\n
	public void bar16(int i) {\n
	            ^^^^^^^^^^^^\n
The method bar16(int) from the type X can potentially be declared as static\n
----------\n

------------ but was ------------
X.java:8: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		this.field1 = 1;\n
		    ^\n
X.java:14: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		System.out.println(this.field1);\n
		                       ^\n
X.java:18: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		x.field1 = 1;\n
		 ^\n
X.java:21: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		A.xA.field1 = 1;\n
		    ^\n
X.java:27: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
		this.b1 = 1;\n
		    ^\n
X.java:30: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
		new X().b1 = 1;\n
		       ^\n
X.java:33: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		this.xfield.field1 = 1;\n
		    ^\n
X.java:33: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		this.xfield.field1 = 1;\n
		           ^\n
X.java:36: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		System.out.println(this.xfield.field1);\n
		                       ^\n
X.java:36: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		System.out.println(this.xfield.field1);\n
		                              ^\n
X.java:39: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
		System.out.println(new X().b1);\n
		                          ^\n
X.java:45: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
		System.out.println(this.b1);\n
		                       ^\n
X.java:48: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		xfield.field1 = 1;\n
		      ^\n
X.java:51: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		System.out.println(xfield.field1);\n
		                         ^\n
14 warnings\n

--------- Difference is ----------
 expected:<[----------\n
1. ERROR in X.java (at line 4)\n
	public void bar1(int i) {\n
	            ^^^^^^^^^^^\n
The method bar1(int) from the type X can potentially be declared as static\n
----------\n
2. ERROR in X.java (at line 10)\n
	public void bar3(int i) {\n
	            ^^^^^^^^^^^\n
The method bar3(int) from the type X can potentially be declared as static\n
----------\n
3. ERROR in X.java (at line 16)\n
	public void bar5(int i) {\n
	            ^^^^^^^^^^^\n
The method bar5(int) from the type X can potentially be declared as static\n
----------\n
4. ERROR in X.java (at line 20)\n
	public void bar6(int i) {\n
	            ^^^^^^^^^^^\n
The method bar6(int) from the type X can potentially be declared as static\n
----------\n
5. ERROR in X.java (at line 23)\n
	public void bar7(int i) {\n
	            ^^^^^^^^^^^\n
The method bar7(int) from the type X can potentially be declared as static\n
----------\n
6. ERROR in X.java (at line 29)\n
	public void bar9(int i) {\n
	            ^^^^^^^^^^^\n
The method bar9(int) from the type X can potentially be declared as static\n
----------\n
7. ERROR in X.java (at line 38)\n
	public void bar12(int i) {\n
	            ^^^^^^^^^^^^\n
The method bar12(int) from the type X can potentially be declared as static\n
----------\n
8. ERROR in X.java (at line 41)\n
	public void bar13(int i) {\n
	            ^^^^^^^^^^^^\n
The method bar13(int) from the type X can potentially be declared as static\n
----------\n
9. ERROR in X.java (at line 47)\n
	public void bar15(int i) {\n
	            ^^^^^^^^^^^^\n
The method bar15(int) from the type X can potentially be declared as static\n
----------\n
10. ERROR in X.java (at line 50)\n
	public void bar16(int i) {\n
	            ^^^^^^^^^^^^\n
The method bar16(int) from the type X can potentially be declared as static\n
----------]\n
> but was:<[X.java:8: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		this.field1 = 1;\n
		    ^\n
X.java:14: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		System.out.println(this.field1);\n
		                       ^\n
X.java:18: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		x.field1 = 1;\n
		 ^\n
X.java:21: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		A.xA.field1 = 1;\n
		    ^\n
X.java:27: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
		this.b1 = 1;\n
		    ^\n
X.java:30: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
		new X().b1 = 1;\n
		       ^\n
X.java:33: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		this.xfield.field1 = 1;\n
		    ^\n
X.java:33: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		this.xfield.field1 = 1;\n
		           ^\n
X.java:36: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		System.out.println(this.xfield.field1);\n
		                       ^\n
X.java:36: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		System.out.println(this.xfield.field1);\n
		                              ^\n
X.java:39: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
		System.out.println(new X().b1);\n
		                          ^\n
X.java:45: warning: [static] static variable should be qualified by type name, B, instead of by an expression\n
		System.out.println(this.b1);\n
		                       ^\n
X.java:48: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		xfield.field1 = 1;\n
		      ^\n
X.java:51: warning: [static] static variable should be qualified by type name, X, instead of by an expression\n
		System.out.println(xfield.field1);\n
		                         ^\n
14 warnings]\n
>
	at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEquals(TestCase.java:260)
	at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(TestCase.java:236)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runJavac(AbstractRegressionTest.java:2048)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runTest(AbstractRegressionTest.java:2814)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runTest(AbstractRegressionTest.java:2539)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest(AbstractRegressionTest.java:2220)
	at org.eclipse.jdt.core.tests.compiler.regression.ProblemTypeAndMethodTest.test117b(ProblemTypeAndMethodTest.java:6429)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.ProblemTypeAndMethodTest#test117b - 1.8
X.java [
public class X extends B{
	public static int field1;
	public static X xfield;
	public void bar1(int i) {
		field1 = 1;
	}
	public void bar2(int i) {
		this.field1 = 1;
	}
	public void bar3(int i) {
		System.out.println(field1);
	}
	public void bar4(int i) {
		System.out.println(this.field1);
	}
	public void bar5(int i) {
		X x = new X();
		x.field1 = 1;
	}
	public void bar6(int i) {
		A.xA.field1 = 1;
	}
	public void bar7(int i) {
		b1 = 1;
	}
	public void bar8(int i) {
		this.b1 = 1;
	}
	public void bar9(int i) {
		new X().b1 = 1;
	}
	public void bar10(int i) {
		this.xfield.field1 = 1;
	}
	public void bar11(int i) {
		System.out.println(this.xfield.field1);
	}
	public void bar12(int i) {
		System.out.println(new X().b1);
	}
	public void bar13(int i) {
		System.out.println(b1);
	}
	public void bar14(int i) {
		System.out.println(this.b1);
	}
	public void bar15(int i) {
		xfield.field1 = 1;
	}
	public void bar16(int i) {
		System.out.println(xfield.field1);
	}
	public void baz() {
	}
}
class A{
	public static X xA;
}
class B{
	public static int b1;
}
]


Full results sent to /tmp/comptest/run.1514610271420/1.8.0_131_20171230_000432.txt

Standard Error

--- javac err: ---
X.java:8: warning: [static] static variable should be qualified by type name, X, instead of by an expression
		this.field1 = 1;
		    ^
X.java:14: warning: [static] static variable should be qualified by type name, X, instead of by an expression
		System.out.println(this.field1);
		                       ^
X.java:18: warning: [static] static variable should be qualified by type name, X, instead of by an expression
		x.field1 = 1;
		 ^
X.java:21: warning: [static] static variable should be qualified by type name, X, instead of by an expression
		A.xA.field1 = 1;
		    ^
X.java:27: warning: [static] static variable should be qualified by type name, B, instead of by an expression
		this.b1 = 1;
		    ^
X.java:30: warning: [static] static variable should be qualified by type name, B, instead of by an expression
		new X().b1 = 1;
		       ^
X.java:33: warning: [static] static variable should be qualified by type name, X, instead of by an expression
		this.xfield.field1 = 1;
		    ^
X.java:33: warning: [static] static variable should be qualified by type name, X, instead of by an expression
		this.xfield.field1 = 1;
		           ^
X.java:36: warning: [static] static variable should be qualified by type name, X, instead of by an expression
		System.out.println(this.xfield.field1);
		                       ^
X.java:36: warning: [static] static variable should be qualified by type name, X, instead of by an expression
		System.out.println(this.xfield.field1);
		                              ^
X.java:39: warning: [static] static variable should be qualified by type name, B, instead of by an expression
		System.out.println(new X().b1);
		                          ^
X.java:45: warning: [static] static variable should be qualified by type name, B, instead of by an expression
		System.out.println(this.b1);
		                       ^
X.java:48: warning: [static] static variable should be qualified by type name, X, instead of by an expression
		xfield.field1 = 1;
		      ^
X.java:51: warning: [static] static variable should be qualified by type name, X, instead of by an expression
		System.out.println(xfield.field1);
		                         ^
14 warnings

----------------------------------------