I've met the `unexpected error invoking equal_dcomp_instrumented` when I use Daikon to detect invariants against Closure project in defects4j dataset. From the exception stack trace, I think it is the accessible issue related to the instrumented code. Below I paste the detailed stack trace,
java.lang.ExceptionInInitializerError
at com.google.javascript.jscomp.RhinoErrorReporter.<init>(RhinoErrorReporter.java:77)
at com.google.javascript.jscomp.RhinoErrorReporter.<init>(RhinoErrorReporter.java:32)
at com.google.javascript.jscomp.RhinoErrorReporter$OldRhinoErrorReporter.<init>(RhinoErrorReporter.java:144)
at com.google.javascript.jscomp.RhinoErrorReporter$OldRhinoErrorReporter.<init>(RhinoErrorReporter.java:140)
at com.google.javascript.jscomp.RhinoErrorReporter.forOldRhino(RhinoErrorReporter.java:109)
at com.google.javascript.jscomp.Compiler.<init>(Compiler.java:168)
at com.google.javascript.jscomp.CommandLineRunner.createCompiler(CommandLineRunner.java:815)
at com.google.javascript.jscomp.AbstractCommandLineRunner.doRun(AbstractCommandLineRunner.java:744)
at com.google.javascript.jscomp.AbstractCommandLineRunner.run(AbstractCommandLineRunner.java:383)
at com.google.javascript.jscomp.CommandLineRunnerTest.compile(CommandLineRunnerTest.java:1303)
at com.google.javascript.jscomp.CommandLineRunnerTest.test(CommandLineRunnerTest.java:1186)
at com.google.javascript.jscomp.CommandLineRunnerTest.test(CommandLineRunnerTest.java:1175)
at com.google.javascript.jscomp.CommandLineRunnerTest.testSame(CommandLineRunnerTest.java:1163)
at com.google.javascript.jscomp.CommandLineRunnerTest.testSame(CommandLineRunnerTest.java:1159)
at com.google.javascript.jscomp.CommandLineRunnerTest.testSimpleModeLeavesUnusedParams(CommandLineRunnerTest.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at junit.framework.TestCase.runTest(TestCase.java:177)
at junit.framework.TestCase.runBare(TestCase.java:142)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:130)
at junit.framework.TestSuite.runTest(TestSuite.java:241)
at junit.framework.TestSuite.run(TestSuite.java:236)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at TestRunner.main(TestRunner.java:12)
Caused by: java.lang.RuntimeException: unexpected error invoking equal_dcomp_instrumented
at daikon.dcomp.DCRuntime.dcomp_equals(DCRuntime.java:273)
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:947)
at sun.util.locale.LocaleObjectCache.get(LocaleObjectCache.java:55)
at sun.util.locale.BaseLocale.getInstance(BaseLocale.java:87)
at java.util.Locale.<init>(Locale.java:650)
at java.util.Locale.<init>(Locale.java:701)
at com.google.javascript.rhino.head.ScriptRuntime.<clinit>(ScriptRuntime.java:126)
... 31 more
Caused by: java.lang.IllegalAccessException: Class daikon.dcomp.DCRuntime can not access a member of class sun.util.locale.BaseLocale$Key with modifiers "public"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296)
at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288)
at java.lang.reflect.Method.invoke(Method.java:491)
at daikon.dcomp.DCRuntime.dcomp_equals(DCRuntime.java:271)
... 37 more
[testSimpleModeLeavesUnusedParams(com.google.javascript.jscomp.CommandLineRunnerTest): null]
FAILURE
java.lang.NoClassDefFoundError: Could not initialize class com.google.javascript.rhino.head.ScriptRuntime
at com.google.javascript.jscomp.RhinoErrorReporter.<init>(RhinoErrorReporter.java:77)
at com.google.javascript.jscomp.RhinoErrorReporter.<init>(RhinoErrorReporter.java:32)
at com.google.javascript.jscomp.RhinoErrorReporter$OldRhinoErrorReporter.<init>(RhinoErrorReporter.java:144)
at com.google.javascript.jscomp.RhinoErrorReporter$OldRhinoErrorReporter.<init>(RhinoErrorReporter.java:140)
at com.google.javascript.jscomp.RhinoErrorReporter.forOldRhino(RhinoErrorReporter.java:109)
at com.google.javascript.jscomp.Compiler.<init>(Compiler.java:168)
at com.google.javascript.jscomp.CommandLineRunner.createCompiler(CommandLineRunner.java:815)
at com.google.javascript.jscomp.AbstractCommandLineRunner.doRun(AbstractCommandLineRunner.java:744)
at com.google.javascript.jscomp.AbstractCommandLineRunner.run(AbstractCommandLineRunner.java:383)
at com.google.javascript.jscomp.CommandLineRunnerTest.compile(CommandLineRunnerTest.java:1303)
at com.google.javascript.jscomp.CommandLineRunnerTest.test(CommandLineRunnerTest.java:1186)
at com.google.javascript.jscomp.CommandLineRunnerTest.test(CommandLineRunnerTest.java:1175)
at com.google.javascript.jscomp.CommandLineRunnerTest.testForwardDeclareDroppedTypes(CommandLineRunnerTest.java:754)[testForwardDeclareDroppedTypes(com.google.javascript.jscomp.CommandLineRunnerTest): null]
FAILURE
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at junit.framework.TestCase.runTest(TestCase.java:177)
at junit.framework.TestCase.runBare(TestCase.java:142)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:130)
at junit.framework.TestSuite.runTest(TestSuite.java:241)
at junit.framework.TestSuite.run(TestSuite.java:236)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at TestRunner.main(TestRunner.java:12)
java.lang.NoClassDefFoundError: Could not initialize class com.google.javascript.rhino.head.ScriptRuntime
at com.google.javascript.jscomp.RhinoErrorReporter.<init>(RhinoErrorReporter.java:77)
at com.google.javascript.jscomp.RhinoErrorReporter.<init>(RhinoErrorReporter.java:32)
at com.google.javascript.jscomp.RhinoErrorReporter$OldRhinoErrorReporter.<init>(RhinoErrorReporter.java:144)
at com.google.javascript.jscomp.RhinoErrorReporter$OldRhinoErrorReporter.<init>(RhinoErrorReporter.java:140)
at com.google.javascript.jscomp.RhinoErrorReporter.forOldRhino(RhinoErrorReporter.java:109)
at com.google.javascript.jscomp.Compiler.<init>(Compiler.java:168)
at com.google.javascript.jscomp.CommandLineRunner.createCompiler(CommandLineRunner.java:815)
at com.google.javascript.jscomp.AbstractCommandLineRunner.doRun(AbstractCommandLineRunner.java:744)
at com.google.javascript.jscomp.AbstractCommandLineRunner.run(AbstractCommandLineRunner.java:383)
at com.google.javascript.jscomp.CommandLineRunnerTest.compile(CommandLineRunnerTest.java:1303)
at com.google.javascript.jscomp.CommandLineRunnerTest.test(CommandLineRunnerTest.java:1186)
at com.google.javascript.jscomp.CommandLineRunnerTest.test(CommandLineRunnerTest.java:1175)
at com.google.javascript.jscomp.CommandLineRunnerTest.test(CommandLineRunnerTest.java:1167)
at com.google.javascript.jscomp.CommandLineRunnerTest.testDebugFlag1(CommandLineRunnerTest.java:476)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at junit.framework.TestCase.runTest(TestCase.java:177)
at junit.framework.TestCase.runBare(TestCase.java:142)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:130)
at junit.framework.TestSuite.runTest(TestSuite.java:241)
at junit.framework.TestSuite.run(TestSuite.java:236)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at TestRunner.main(TestRunner.java:12)
[testDebugFlag1(com.google.javascript.jscomp.CommandLineRunnerTest): null]
FAILURE
[testIssue787(com.google.javascript.jscomp.IntegrationTest): Could not initialize class com.google.javascript.rhino.head.ScriptRuntime]
FAILURE
[testRemoveGlobal1(com.google.javascript.jscomp.RemoveUnusedVarsTest): Could not initialize class com.google.javascript.rhino.head.ScriptRuntime]
FAILURE
[testRemoveGlobal2(com.google.javascript.jscomp.RemoveUnusedVarsTest): Could not initialize class com.google.javascript.rhino.head.ScriptRuntime]
FAILURE
[testRemoveGlobal3(com.google.javascript.jscomp.RemoveUnusedVarsTest): Could not initialize class com.google.javascript.rhino.head.ScriptRuntime]
FAILURE
[testIssue168b(com.google.javascript.jscomp.RemoveUnusedVarsTest): Could not initialize class com.google.javascript.rhino.head.ScriptRuntime]
FAILURE
However, if I run the tests without DynComp, all the tests passed.
2. checkout the Closure1f using `defects4j checkout -p Closure -v 1f -w Closure1f`
3. go to Closure1f and compile the project using `defects4j compile`
4. compile the attached TestRunner.java
5. go to Closure1f and run `CLASSPATH=$(find "$PWD" -name '*.jar' -type f -printf ':%p\n' | sort -u | tr -d '\n'); java -Xmx43G -cp $DAIKONDIR/daikon.jar:build/classes/:build/test/$CLASSPATH:<TestRunner path> daikon.DynComp '--ppt-select-pattern=^com\.google\.javascript\.jscomp\.RemoveUnusedVars' TestRunner com.google.javascript.jscomp.CommandLineRunnerTest::testSimpleModeLeavesUnusedParams com.google.javascript.jscomp.CommandLineRunnerTest::testForwardDeclareDroppedTypes com.google.javascript.jscomp.CommandLineRunnerTest::testDebugFlag1 com.google.javascript.jscomp.IntegrationTest::testIssue787 com.google.javascript.jscomp.RemoveUnusedVarsTest::testRemoveGlobal1 com.google.javascript.jscomp.RemoveUnusedVarsTest::testRemoveGlobal2 com.google.javascript.jscomp.RemoveUnusedVarsTest::testRemoveGlobal3 com.google.javascript.jscomp.RemoveUnusedVarsTest::testIssue168b`, you will need to replace the <TestRunner path> to the path of the compile TestRunner at step 4.
Please let me know if there are any problem to reproduce the issue. Thank you very much for your help and your time.