Status Update
Comments
sg...@google.com <sg...@google.com> #2
Uploaded
tn...@google.com <tn...@google.com> #3
Hi Søren, before fixing it I thought I would create a failing unit tests with the above, but I can't get it to fail attempting to sort just the above items (in any order). Is this boiled down from a larger sample? If you have a repro scenario it would be great if you could just share on drive the whole jar file (or zipped class folder).
sg...@google.com <sg...@google.com> #4
Hi Tor, I have extracted a "minimal" list based on the input I have seen, and sent it to you via email. I also implemented a transitive validation method, which might be easier to use for a test:
static <T extends Comparable<T>> void checkCompareToTransitive(List<T> data) {
for(int i = 0; i < data.size(); ++i) {
for(int j = 0; j < data.size(); ++j) {
for(int k = 0; k < data.size(); ++k) {
T x = data.get(i);
T y = data.get(j);
T z = data.get(k);
int a = Integer.signum(x.compareTo(y));
int b = Integer.signum(y.compareTo(z));
int c = Integer.signum(x.compareTo(z));
if (a != -Integer.signum(y.compareTo(x))) {
System.out.println("BAD A " + x + " " + y);
}
if (b != -Integer.signum(z.compareTo(y))) {
System.out.println("BAD B " + y + " " + z);
}
String message = "Not transitive " + x + " " + y + " " + z + " " + a + " " + b + " " + c;
if (a != 0 && b != 0) {
// x != y && y != z.
if (a == b && c != a) {
// Either of the following did not hold:
// x > y && y > z => x > z
// x < y && y < z => x < z
System.out.println(message);
} else {
// Don't check anything if a != b.
}
} else if (a == b) {
// x == y && y == z.
if (c != 0) {
// This did not hold:
// x == y && y == z => x = y
System.out.println(message);
}
} else if (a != 0) {
// x != y && y == z
if (c != a) {
// Either of the following did not hold:
// x < y && y == z => x < z
// x > y && y == z => x > z
System.out.println(message);
}
} else if (b != 0) {
if (c != b) {
// Either of the following did not hold:
// x == y && y < z => x < z
// x == y && y > z => x > z
System.out.println(message);
}
} else {
throw new RuntimeException(("Unreachable"));
}
}
}
}
}
This can probably be condensed.
tn...@google.com <tn...@google.com> #5
Fix pending for Change-Id: Ib0e42ac4655993f0dfbd53f0bd4c1bce126ce320
tn...@google.com <tn...@google.com>
tn...@google.com <tn...@google.com> #6
Fixed for AGP 7.0-alpha07 and 4.2 Beta 5.
Description
A recent change in D8 changed the class names generated for synthetic classes including lambdas. Now the following three names can be present:
The sorting used is not transitive with these names.
In some settings D8 desugars to class file and not directly to
DEX
, and if the desugared class files are passed to lint then the following exception can happen:See b/178715340 .
Always sorting '.' lowest - as in the following patch (which fixes b/178715340 ) - could be an option, but I am not familiar with the internal order requirements in lint.