Bug 573694 - Static method completion inconsistency inside block statements above another complete statement
Summary: Static method completion inconsistency inside block statements above another ...
Status: CLOSED DUPLICATE of bug 573632
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.20   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-21 08:28 EDT by Gayan Perera CLA
Modified: 2021-05-21 12:57 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gayan Perera CLA 2021-05-21 08:28:49 EDT
Take the following example:

package workbench;

import javafx.beans.Observable;
import javafx.beans.property.ObjectProperty;
import javafx.scene.Scene;

public class App
{
  public static void boo()
  {

  }

    public void invalidated(Observable observable)
    {
      App.
      if (observable instanceof ObjectProperty<?>)
      {
        ObjectProperty<?> sceneProperty = (ObjectProperty<?>) observable;
        if (sceneProperty.get() != null)
        {
          App.
          observable.removeListener(null);
          App.
        }
      }
    }
}

At 1st and 3rd App. i get the suggestion for method boo, but at the 2nd App. i don't get the suggestion for boo or .class.

This works in Eclipse 4.19, seems to be a regression from recent completion enhancements.
Comment 1 Gayan Perera CLA 2021-05-21 08:39:45 EDT
Seems like in latest build the above problem is fixed, but we still have the following

package workbench;

import javafx.beans.Observable;
import javafx.beans.property.ObjectProperty;

public class App
{
  public static void boo()
  {

  }

  private static class Inner
  {
    public void invalidated(Observable observable)
    {
      App.
      if (observable instanceof ObjectProperty<?>)
      {
        App.
        ObjectProperty<?> sceneProperty = (ObjectProperty<?>) observable;
        if (sceneProperty.get() != null)
        {
          App.
          observable.removeListener(null);
        }
        App.
      }
    }
  }
}

At 1st and 4th App. i get the suggestion for method boo, but at the 2nd and 3rd App. i don't get the suggestion for boo or .class.
Comment 2 Andrey Loskutov CLA 2021-05-21 12:25:29 EDT
Gayan, probably this is related to bug 573632.
Comment 3 Gayan Perera CLA 2021-05-21 12:33:47 EDT
Yes @Andrey, I can check with @Stephans patch and see if my second scenario works as well. I think it should be a difference between inner and normal class.
Comment 4 Gayan Perera CLA 2021-05-21 12:50:41 EDT
yes this is same as the other bug. we can mark as duplicate
Comment 5 Andrey Loskutov CLA 2021-05-21 12:57:59 EDT

*** This bug has been marked as a duplicate of bug 573632 ***