daikon icon indicating copy to clipboard operation
daikon copied to clipboard

java.lang.AssertionError: not comparable

Open boyang9602 opened this issue 6 years ago • 0 comments

  1. Daikon version: 5.7.2
  2. Description: I ran daikon on "tests/org/jfree/chart/renderer/category/junit/AbstractCategoryItemRendererTests.java" of Chart project, which is the defects4j, bug 1 version with a plausible patch. The exact steps: 1). Checkout the Chart1b from defects4j: a. clone and compile defects4j(https://github.com/rjust/defects4j), b. defects4j checkout -p Chart -v 1b -w /workdir 2). Patch the Chart project with the plausible patch below
--- a/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java
+++ b/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java 
@@ -1794,9 +1794,6 @@ public abstract class AbstractCategoryItemRenderer extends AbstractRenderer
         }
         int index = this.plot.getIndexOf(this);
         CategoryDataset dataset = this.plot.getDataset(index);
-        if (dataset != null) {
-            return result;
-        }
         int seriesCount = dataset.getRowCount();
         if (plot.getRowRenderingOrder().equals(SortOrder.ASCENDING)) {
             for (int i = 0; i < seriesCount; i++) {
3). Comment all the test cases except "public void test2947660()"
4). Compile Chart: 1. cd /workdir 2. defects4j compile
5). Generate decls-DynComp file: java -cp /workdir/build/:/workdir/build-tests:/workdir/lib/:$DAIKONDIR/daikon.jar daikon.DynComp junit.textui.TestRunner org.jfree.chart.renderer.category.junit.AbstractCategoryItemRendererTests
6). Generate dtrace file: java -cp /workdir/build/:/workdir/build-tests:/workdir/lib/:$DAIKONDIR/daikon.jar daikon.Chicory --comparability-file=TestRunner.decls-DynComp junit.textui.TestRunner org.jfree.chart.renderer.category.junit.AbstractCategoryItemRendererTests
7). Generate invariants: java -cp -Xmx8192M -ea $DAIKONDIR/daikon.jar daikon.Daikon TestRunner.dtrace.gz

All steps above worked well except step 7. 3. Attached is a compiled Chart project, containing the source code, compiled files, decls-Comp file, dtrace file, etc. So you can skip step 1 to 4 and use it directly. 4. Jdk/jre version: openjdk version "1.8.0_222" OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10) OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode) System version: Ubuntu 18.04.3 5. Other information: Error message:

Exception in thread "main" java.lang.AssertionError: not comparable
org.jfree.chart.util.GradientPaintTransformType.HORIZONTAL.name org.jfree.chart.util.GradientPaintTransformType.CENTER_VERTICAL.name at ppt org.jfree.chart.util.GradientPaintTransformType:::OBJECT
at daikon.inv.Equality.<init>(Equality.java:125)
at daikon.PptSliceEquality.instantiate_from_pairs(PptSliceEquality.java:236)
at daikon.PptTopLevel.mergeInvs(PptTopLevel.java:3637)
at daikon.PptTopLevel.mergeInvs(PptTopLevel.java:3467)
at daikon.Daikon.createUpperPpts(Daikon.java:1737)
at daikon.Daikon.process_data(Daikon.java:2337)
at daikon.Daikon.mainHelper(Daikon.java:772)
at daikon.Daikon.main(Daikon.java:657)

I debug daikon and found that the data leads to fail is a list contains 3 VarComparabilityImplicit objects with different base values. I also found these values are equal to the comparability value of variables in dtrace file. So I wonder how these values are computed and why they are different. If they should be different, why they are put into the same collection to compare.

boyang9602 avatar Oct 07 '19 20:10 boyang9602