Closed
Description
Operator argument naming should match between base classes on the same operators.
For example Observable::buffer(boundary)
vs. Flowable::buffer(boundaryIndicator)
.
Source-level comparison would be too complicated so reflection can be used for this, provided the class saves the argument names. Javac 8 has this option that must be enabled in the IDE and in build.gradle
:
[compileJava, compileTestJava]*.options*.compilerArgs << "-parameters"
tasks.withType(JavaCompile) {
options.compilerArgs << "-parameters";
}
An extra test is preferrable to remind users enabling this option:
void method(int paramName) {
// deliberately empty
}
@Test
public void javacParametersEnabled() throws Exception {
assertEquals("Please enable saving parameter names via the -parameters javac argument",
"paramName",
getClass()
.getDeclaredMethod("method", Integer.TYPE)
.getParameters()[0].getName());
}
There are some common operator names across all base classes, these should match as well.