Author Topic: Java tagging symbol not found  (Read 1384 times)

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Java tagging symbol not found
« on: September 18, 2021, 07:45:43 AM »
Using SE 26 beta 3 on Windows 10 with Oracle JDK 8u262.  Also using Netty 4.1.63.

I have code that uses a Netty ChannelFuture (io.netty.channel.ChannelFuture) and calls the await(), isDone() and cancel() methods.  await() is correctly coloured as a public member function, however, cancel() and await are shown in red (symbol not found).

The difference appears to be because await() is overridden in the ChannelFuture interface whilst isDone() and cancel() are inherited from the java.util.concurrent.Future<V> interface via io.netty.util.concurrent.Future<V> 

Both JDK 8 and Netty 4 are tagged as well as the workspace.  Can you suggest why isDone() and cancel() can't be correctly resolved please?

Dennis

  • Senior Community Member
  • Posts: 3960
  • Hero Points: 517
Re: Java tagging symbol not found
« Reply #1 on: September 20, 2021, 02:11:00 PM »
Reproduced.  Will look into this today.

Dennis

  • Senior Community Member
  • Posts: 3960
  • Hero Points: 517
Re: Java tagging symbol not found
« Reply #2 on: September 20, 2021, 11:02:04 PM »
This will be fixed in the next build of version 26 (SlickEdit 2021).  Not hot-fixable, so nothing I can do for SlickEdit 2020 at this time.

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Re: Java tagging symbol not found
« Reply #3 on: September 21, 2021, 02:16:08 AM »
Hi Dennis, that's good to hear, thanks for looking into this.

Does your fix address another similar issue that I found?

I have code that uses io.netty.handler.codec.http.HttpHeaders.  It retrieves them from an HTTP request using request.headers() where request is an io.netty.handler.codec.http.HttpRequest.

The code then interates over the headers using the following for loop:

for (Map.Entry<String, String> h: requestHeaders) {
    if (h.getKey().equalsIgnoreCase(HttpHeaderNames.CONTENT_TYPE.toString())) {
        CharSequence value = h.getValue();
        do_something_with_value(value);
    }
}

the getKey() and getValue() methods are coloured as symbol not found as is equalsIgnoreCase().




Dennis

  • Senior Community Member
  • Posts: 3960
  • Hero Points: 517
Re: Java tagging symbol not found
« Reply #4 on: September 21, 2021, 02:18:44 PM »
I'll test that case too.

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Re: Java tagging symbol not found
« Reply #5 on: October 13, 2021, 08:22:03 PM »
Hi Dennis
Not sure if you got anywhere with this, but here's another example:

Code: [Select]
public final class EventLoop {

  public static final class Event {
    private final String key;
    private final Object data;

    public Event(String key, Object data) {
      this.key = key;
      this.data = data;
    }
  }

  private final ConcurrentLinkedDeque<Event> events = new ConcurrentLinkedDeque<>();
  private final ConcurrentHashMap<String, Consumer<Object>> handlers = new ConcurrentHashMap<>();

  public EventLoop on(String key, Consumer<Object> handler) {
    handlers.put(key, handler);
    return this;
  }

  public void dispatch(Event event) {
    events.add(event);
  }

  public void run() {
    while (!(events.isEmpty() && Thread.interrupted())) {
      if (!events.isEmpty()) {
        Event event = events.pop();
        if (handlers.containsKey(event.key)) {
          handlers.get(event.key).accept(event.data);
        } else {
          System.err.println("No handler for key " + event.key);
        }

In the run() method, event.key and event.data are both unidentified symbols.

Thanks.


There also seems to be an issue identifying lambda parameters:

Code: [Select]
eventLoop
      .on("hello", s -> System.out.println("hello " + s))
      .on("tick", n -> System.out.println("tick #" + n))
      .on("stop", v -> eventLoop.stop())
      .run();

s and v are unidentified and n is identified as an index variable used for a for loop earlier in the code.



Dennis

  • Senior Community Member
  • Posts: 3960
  • Hero Points: 517
Re: Java tagging symbol not found
« Reply #6 on: October 14, 2021, 07:35:39 PM »
This issue will be fixed in 26.0.1.  It required C++ code changes so it can not be fixed with a hot fix.  Thank you again for providing detailed, reproducible examples.  I'm still looking at the next one.

Code: [Select]
for (Map.Entry<String, String> h: requestHeaders) {
    if (h.getKey().equalsIgnoreCase(HttpHeaderNames.CONTENT_TYPE.toString())) {
        CharSequence value = h.getValue();
        do_something_with_value(value);
    }
}

Dennis

  • Senior Community Member
  • Posts: 3960
  • Hero Points: 517
Re: Java tagging symbol not found
« Reply #7 on: October 15, 2021, 09:54:16 PM »
The issue with private members of nested classes will be fixed in a hot fix.

Parsing Java 8 lamba functions will be fixed in 26.0.1 (not hot-fixable).

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Re: Java tagging symbol not found
« Reply #8 on: October 15, 2021, 11:24:17 PM »
Hi Dennis
Thanks for looking into this and providing fixes, it's appreciated.