Re: Passing objects (not stones)

From: NotAsDumbAsILook (toyota_trekker_at_yahoo.com)
Date: 02/26/04


Date: 26 Feb 2004 09:42:43 -0800

toyota_trekker@yahoo.com (NotAsDumbAsILook) wrote in message news:<e3d370c6.0402251210.1e5215b3@posting.google.com>...
>
> The error I get is:
>
> myTestModel.java [40:1] cannot resolve symbol
> symbol : method objectForValue (int)
> location: class MPNode
> Object o = mine.objectForValue(i);
>
>

Oops! I was "simplifying" the code I posted and didn't rename that
MPNode as MyClass. That might be a little confusing.

Anyhoo, I figured out what the problem was, but I don't understand why
it was a problem. So, I'm going to alter the question.

Like I said before, I'm using NetBeans 3.5.1. I was putting together a
little sample application so that I could figure out how to make a
good TableClass while working with an ArrayList of Objects. Well, in
order to save time coding, I copied over the class MyClass from
another project I am working on using the NetBeans Filesystem Explorer
(you right-click, copy, and then paste-as-copy in the new Filesystem).
Apparently there is something in the background that was giving
NetBeans grief. I could declare a new MyClass() object, and then use
the Code Completion to see the methods and variables in it. But, when
it came to compile time, the compiler couldn't see those methods, so
it was giving the "cannot resolve symbol" error.

I vaguely remembered seeing a similar problem with Delphi a few years
ago, and I tried a similar fix I used then. I created a new class
inside of the Filesystem I was working in - by doing a right-click,
new, java class. Then I cut and pasted the code from the original
MyClass into this new one, and referenced it instead of the old
MyClass object. Now the code complies just fine.

So, the error lies in copying a class from one filesystem into
another. I know that you normally wouldn't do that, but there is the
rare occasion where you would. Any thoughts?



Relevant Pages

  • Re: Klappt das mit Generics? Instanz eines generischen Typs erstellen
    ... Vielleicht kann ja mal jemand einen Kommentar dazu geben, ... Listen mit Objekten, welche aus dem Filesystem heraus de-serialisiert ... T myClass = new T; ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Passing objects (not stones)
    ... > order to save time coding, I copied over the class MyClass from ... > another project I am working on using the NetBeans Filesystem Explorer ... considered part of a Java package. ... statement in the source file and import the package in order to use class. ...
    (comp.lang.java)