Open
Description
Bug description
When I attempt to create an instance of com.google.common.collect.testing.IteratorTester
from guava-testlib
version 29-jre, I end up with the following compilation error message:
/path/to/IteratorTesterExampleTests.java:3: error: package com.google.common.collect.testing.AbstractIteratorTester does not exist
import com.google.common.collect.testing.AbstractIteratorTester.KnownOrder;
^
/path/to/IteratorTesterExampleTests.java:26: error: cannot find symbol
3, IteratorFeature.UNMODIFIABLE, Arrays.asList("a", "b", "c"), KnownOrder.KNOWN_ORDER) {
^
symbol: variable KnownOrder
location: class IteratorTesterExampleTests
My workaround is to copy IteratorTester
, AbstractIteratorTester
and Helpers
into my project.
How to reproduce
git clone https://github.com/jbduncan/iteratortester-compilation-bug.git
./gradlew build
Possible fixes
- Make
AbstractIteratorTester
public and its constructor non-public, documenting that it's not intended to be extended - Move
KnownOrder
into a separate file (breaking change) - Make
IteratorTester
non-public, at the risk of making guava-testlib users except Guava itself not being able to use it anymore (breaking change)