0

NetBeans 8.2 Patch 2 (Build 201705191307)

My package hierarchy is:

spider;
spider.ui;
spider.ui.output;

My classes w/functions are:

spider.ui.DisplayManager.stateMachine
spider.ui.output.DisplayManager.stateMachine

The duplication of class names and function names is deliberate. All stateMachine functions are static, that is,

public static stateMachine() { }

I attempt to reference the spider.ui.output.DisplayManager.stateMachine in the spider.ui.DisplayManager.stateMachine using:

import spider.ui.output.DisplayManager;
stateMachine() {
   spider.ui.output.DisplayManager.stateMachine()
}

and get a "ui" variable not found.

Cannot find symbol

symbol: variable ui

location: variable spider of type JFrame

I would have expected that if there was an error it would be in using duplicate names not in identifying the "ui" in spider.ui.output.DisplayManager.stateMachine() as being wrong.

It is not a great labor to change the names so that they are unique, but can anyone tell me why I get the error message I do?

Dinnerspy
  • 310
  • 1
  • 17
lostbits
  • 928
  • 1
  • 9
  • 23
  • There are [many questions on SO about "Cannot find symbol" for NetBeans](https://stackoverflow.com/search?q=%5Bnetbeans%5D+%22cannot+find+symbol%22+), but the unresolved NetBeans [Bug 269504 - Netbeans 8.2 'cannot find symbol' error on variable from another <%@ include file](https://netbeans.org/bugzilla/show_bug.cgi?id=269504) may be relevant for your specific problem. If this is a NetBeans bug, and I suspect it is, then only the person fixing the problem can tell you exactly why it is occurring. – skomisa Jul 23 '19 at 20:50
  • Also, you might try removing that import from your code snippet to see if that changes anything. I don't suppose it will, but it's redundant, and it can't hurt to try. – skomisa Jul 23 '19 at 20:51

1 Answers1

0

I apologize and thank you all. This was most definitely an Operator ERROR, that is, it was created by me.

What was pointed out to me was that:

Spider spider; //variable and
   o o o 
spider.ui.*;   // collide

Once "Spider spider;" was removed, the error was cleared.

What mystified me was that the error message said that 'ui' in "spider.ui." was at fault because "ui" was a variable which could not be found. If I had given it an even moment of thought I would have guessed that the compiler was treating "spider" as an variable name and not a package name. But mystified or not, the error went pfft once "Spider spider;" was removed.

Thanks again and I am sorry to have wasted your time.

The good news is that I earned some StackOverflow brouwnie points for giving a faulty analysis about an error. So I am just wonderful.

art

lostbits
  • 928
  • 1
  • 9
  • 23