Failed
org.eclipse.jdt.core.tests.compiler.regression.ProblemConstructorTest.test004 - 1.8 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)
Error Message
test004 - Eclipse found warning(s) but Javac did not find any. ----------- Expected ------------ ------------ but was ------------ ----------\n 1. WARNING in X.java (at line 4)\n public int unusedMethod() { return this.state; }\n ^^^^^^^^^^^^^^\n The method unusedMethod() from the type X.M is never used locally\n ----------\n 2. WARNING in X.java (at line 5)\n public M (int state) { this.state = state;} \n ^^^^^^^^^^^^^\n The constructor X.M(int) is never used locally\n ----------\n 3. WARNING in X.java (at line 6)\n public int unusedField = 0;\n ^^^^^^^^^^^\n The value of the field X.M.unusedField is not used\n ----------\n 4. WARNING in X.java (at line 7)\n public class N {}\n ^\n The type X.M.N is never used locally\n ----------\n --------- Difference is ---------- expected:<[]> but was:<[----------\n 1. WARNING in X.java (at line 4)\n public int unusedMethod() { return this.state; }\n ^^^^^^^^^^^^^^\n The method unusedMethod() from the type X.M is never used locally\n ----------\n 2. WARNING in X.java (at line 5)\n public M (int state) { this.state = state;} \n ^^^^^^^^^^^^^\n The constructor X.M(int) is never used locally\n ----------\n 3. WARNING in X.java (at line 6)\n public int unusedField = 0;\n ^^^^^^^^^^^\n The value of the field X.M.unusedField is not used\n ----------\n 4. WARNING in X.java (at line 7)\n public class N {}\n ^\n The type X.M.N is never used locally\n ----------\n ]>
Stacktrace
junit.framework.ComparisonFailure: test004 - Eclipse found warning(s) but Javac did not find any. ----------- Expected ------------ ------------ but was ------------ ----------\n 1. WARNING in X.java (at line 4)\n public int unusedMethod() { return this.state; }\n ^^^^^^^^^^^^^^\n The method unusedMethod() from the type X.M is never used locally\n ----------\n 2. WARNING in X.java (at line 5)\n public M (int state) { this.state = state;} \n ^^^^^^^^^^^^^\n The constructor X.M(int) is never used locally\n ----------\n 3. WARNING in X.java (at line 6)\n public int unusedField = 0;\n ^^^^^^^^^^^\n The value of the field X.M.unusedField is not used\n ----------\n 4. WARNING in X.java (at line 7)\n public class N {}\n ^\n The type X.M.N is never used locally\n ----------\n --------- Difference is ---------- expected:<[]> but was:<[----------\n 1. WARNING in X.java (at line 4)\n public int unusedMethod() { return this.state; }\n ^^^^^^^^^^^^^^\n The method unusedMethod() from the type X.M is never used locally\n ----------\n 2. WARNING in X.java (at line 5)\n public M (int state) { this.state = state;} \n ^^^^^^^^^^^^^\n The constructor X.M(int) is never used locally\n ----------\n 3. WARNING in X.java (at line 6)\n public int unusedField = 0;\n ^^^^^^^^^^^\n The value of the field X.M.unusedField is not used\n ----------\n 4. WARNING in X.java (at line 7)\n public class N {}\n ^\n The type X.M.N is never used locally\n ----------\n ]> at org.eclipse.jdt.core.tests.compiler.regression.ProblemConstructorTest.test004(ProblemConstructorTest.java:151)
Standard Output
org.eclipse.jdt.core.tests.compiler.regression.ProblemConstructorTest#test004 - 1.8 X.java [ public class X { private class M { private int state = 0; public int unusedMethod() { return this.state; } public M (int state) { this.state = state;} public int unusedField = 0; public class N {} } private class N { private int state = 0; public int usedMethod() { new O(); return new N(this.state + this.usedField).state; } public N (int state) { this.state = state;} public int usedField = 0; public class O {} } public class P { private int state = 0; public int unusedMethod() { return this.state; } public P (int state) { this.state = state;} public int unusedField = 0; public class N {} } public M foo(M m, N n) { n.usedMethod(); return m; } } ] Full results sent to /home/jenkins/agent/workspace/eclipse.jdt.core-run.javac-1.8/tmp/comptest/run.1584479137560/1.8.0_202_20200317_210541.txt
Standard Error
----------------------------------------