This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 128614 - IDE claims symbol not found, but its there!
Summary: IDE claims symbol not found, but its there!
Status: RESOLVED DUPLICATE of bug 102290
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Max Sauer
URL:
Keywords:
Depends on:
Blocks: 121950
  Show dependency tree
 
Reported: 2008-02-27 19:50 UTC by mbarnes
Modified: 2009-05-27 15:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mbarnes 2008-02-27 19:50:44 UTC
Sorry, I don't know if this issue is with the core IDE, the Java implementation, the Java
compiler or the Java editor.



NetBeans 6.0.1 is reporting an error in several of my Java source files that are not errors.
The error indicates that a method with a certain signature in a certain class does not
exist, but if I navigate to the source for this class, the method with that signature is
clearly there.  I cannot navigate directly to the method Declaration, however.

When I do a clean build, there are no errors for the project, so I assume the problem is
with the internal Java compiler???



The code for which an error indicated is this:

<code>
    ParsedInfo cleanedText = new Parser().parse( ctx,
                                                 sb.toString(),
                                                 "batch import",
                                                 "IMPORTER",
                                                 "ParseCOntactInfo",
                                                 false,
                                                 false,
                                                 true );
</code>

1) ctx is a javax.Servlet.ServletContext
2) sb is a StringBuffer, so sb.toString() returns String.



Here the code the defined the desired parse() method of class Parser:

<code>
  public ParsedInfo parse( ServletContext ctx,
                           String         data,
                           String         sourceName,
                           String         name,
                           String         resultIsa,
                           boolean        doFailureCheck,
                           boolean        stripOnly,
                           boolean        emailCatastrophes )
                    throws Exception
</code>

ServletContext comes from package javax.servlet.



The IDE claims it cannot find symbol:
    method parse(javax.servlet.ServletContext,String,String,String,String,boolean,boolean,boolean)
in class Parser.

As I said, if I navigate to the source for the class, the method is there.
Also, if I highlight the method, and do a "Find Usages", 10 usages are
found, including the one listed above.  And, strangely enough, in the
Usages results, this particular usage is again flagged as an error.

There is a deprecated parse() method in this same class that has one less
String parameter, if that makes any difference.  If I remove the @deprecated
annotation from this method, nothing changes.

All of these classes are in the same NetBeans project.

I will see if I can come with some minimal code that can be used to reproduce
this problem.
Comment 1 mbarnes 2008-02-28 16:25:19 UTC
The is probably a duplicate of 102290
Comment 2 mbarnes 2008-02-28 16:36:05 UTC
This may or may not be a duplicate of 102290.

In this case, there's an actual piece of code that the IDE claims to be in error,
while it actually is NOT an error.

A full build confirms that.
Comment 3 Jan Lahoda 2008-02-29 17:42:29 UTC
I am afraid we will need much more information in order to track this down. A reproducible test case would be ideal.
But, if we do not have it, the following may help:
-could you please describe your project layout (which classes come from which project, do you have libraries, have these
libraries attached sources). If possible, please attach the project metadata (content of the nbproject directory) and
the libraries definition (content of ${nbuserdir}/config/org-netbeans-api-project-libraries).
-the sig files that correspond to the source files that are involved in the problem (please check for IP before
attaching them). Can be found in ${nbuserdir}/var/cache/index/. This folder contains numbered subfolders (specifies
version numbers), please choose the highest one. Inside is "segments" file, please find the source root in the file, it
will specify the "s<number>" directory. The sig files are inside "s<number>/classes" directory.

Thanks you very much.
Comment 4 duncank 2009-01-15 22:24:04 UTC
Getting same problem here, but usually after doing an SVN update.

For us we can usually get rid of the 'non-error' by opening up the file that actually contains the method definition and
then going back to the file that references that method. See my issue 156918 that this is part of. Of course, if you
have several hundred of these they can be very frustrating and time-consuming.
Comment 5 Sergey Petrov 2009-04-14 08:08:30 UTC
I got "methods error" trying to reproduce issue 123248, so this one seems to be reproducible in 6.7m3 but 123248 may be
need to be closed.
Comment 6 Max Sauer 2009-05-27 15:10:18 UTC
Info requested by jlahoda not provided by reporter -- marking as duplicate of #102290.

*** This issue has been marked as a duplicate of 102290 ***