Search code examples
eclipsejavadoceclipse-jdteclipse-oxygen

eclipse won't always show javadoc or open declaration of rxjava2 Observable (erratically)


Eclipse oxygen3 (march 2018). Ordinary java project, with rxjava jar and sources. .classpath file:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk18"/>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="lib" path="rxjava-2.1.12.jar" sourcepath="rxjava-2.1.12-sources.jar"/>
    <classpathentry kind="lib" path="reactive-streams-1.0.2.jar"/>
    <classpathentry kind="output" path="output"/>
</classpath>

I can ctrl-click "Observable", and I can see the source. But if I use something like:

static void test1() throws InterruptedException {
    //Flowable.range(0, 1000)
    Observable.range(0, 1000)
        .doOnNext(i -> {
            System.out.println(", r"+i);
        })
        .subscribeOn(Schedulers.newThread())
        .observeOn(Schedulers.newThread())
        .doOnNext(i -> {
            System.out.println(", w"+i);
        })
        .subscribeOn(Schedulers.newThread())
        .subscribe( i -> System.out.println(", f"+i));

    Thread.sleep(5000);
}

then there is a number of methods that don't get javadoc hover popup AND are cannot have a ctrl-click open declaration.

The .range(), the 1st doOnNext(), the 1st subscribeOn() and the observeOn() CANNOT be opened and have javadoc but no tooltip poopup for it, and the others do! The 2nd doOnNext(), the 2nd subscribeOn() and the final subscribe() methods do show the javadoc tooltip and can be ctrl-clicked.

This is driving me nuts... What do I have to do with eclipse to fix this insanity? Do you know of an eclipse bug reported for this?

It appears to occur only on rxjava. Of course it's an IDE bug, but I cannot reproduce easily on others libs. I thought it was because "Observable" has too many methods, perhaps it cannot see more than N. But then it does this crap of showing me the javadoc/opendeclaration for the SAME method (like doOnNext()), just because it is somewhere else in the source... WTF?


Solution

  • This is probably Eclipse Bug 515758, i.e., RxJava seems to contain some signatures which breaks the use case of selecting / resolving a reference into that library. After resolving failed, the tool doesn't know for which element javadoc should be shown.