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 111218 - Packages of a well compiled project are not recognized by the editor
Summary: Packages of a well compiled project are not recognized by the editor
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: Macintosh All
: P4 blocker (vote)
Assignee: Svata Dedic
URL:
Keywords:
: 134885 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-07-27 11:24 UTC by crosati
Modified: 2016-07-07 07:17 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
A test case (17.81 KB, application/octet-stream)
2007-09-20 09:47 UTC, crosati
Details

Note You need to log in before you can comment on or make changes to this bug.
Description crosati 2007-07-27 11:24:14 UTC
Hi,

I've many projects that are perfectly compiled and built but have some packages (of libraries in the project) that are no recognized by the syntax 
highlighter and marked as error (package xxx does not exists).

Here a list of some problematic package import statements and the corresponding libraries (JAR file):

import org.apache.commons.lang.ClassUtils;    // Apache commons-lang-2.3.jar
import org.apache.commons.lang.StringUtils;

import org.apache.commons.cli.CommandLine;    // Apache commons-cli-2.0.jar
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.PosixParser;

import info.clearthought.layout.TableLayout;    // TableLayout.jar from https://tablelayout.dev.java.net

import javax.help.HelpBroker;    / JavaHelp 2.0, jh.jar
import javax.help.HelpSet;

import foxtrot.Task;    // foxtrot.jar from http://foxtrot.sourceforge.net
import foxtrot.Worker;

These just to mention some.
Comment 1 Jiri Prox 2007-07-30 10:19:30 UTC
Can you please try it with fresh userdir? (it's enough to delete ${userdir}/var/cache/mdrstorage folder)
Comment 2 crosati 2007-07-30 17:21:07 UTC
My platform is MacOS X using Java 5.

I've removed the content of ~/.netbeans/5.5.1/var/cache and the fix import problem with NB-5.5.1 still exists.
I've removed the content of ~/.netbeans/6.0m10/var/cache and the bar error marks related to imports and usage of imported classes still exists.
Comment 3 Jan Lahoda 2007-09-13 19:02:25 UTC
The problem is most probably that there are sources attached to the library jars, but the sources do not cover all
classes in the jar. In this case, the classes that are not in the sources are invisible to NB5.5 and NB6.0M10. This
problem has been fixed recently, and should not appear in daily builds and beta 1.

Could you please try a current daily build of NB6.0 or NB6.0 beta 1? Thanks.
Comment 4 crosati 2007-09-20 09:46:44 UTC
The problem still exists.

Here the version I'm using:

Product Version: NetBeans IDE Dev (Build 200709191200) 
Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-87 
System: Mac OS X version 10.4.10 running on i386; MacRoman; en_US (nb) 
Userdir: /Users/crosati/.netbeans/dev

I will attach a small JAR that has no sources inside but when included in a project and one of its classes (e.g. it.acsys.multimedia.base.BasUtils) imported 
rises the problem.
Comment 5 crosati 2007-09-20 09:47:43 UTC
Created attachment 49132 [details]
A test case
Comment 6 Jiri Prox 2007-09-20 13:30:19 UTC
So reopening then, but I cannot still reproduce it, even with your jar. Can you provide more info please? What type of
project do you use? Do you add jar as single jar or it is included in some library?
Comment 7 crosati 2007-09-20 14:02:46 UTC
The project is a Java Application (it was created with NB 4.x.x).
All jars with problems are in Libraries included in the project.
Comment 8 crosati 2007-11-20 20:28:47 UTC
I've found an interesting workarond!

Moving the local CVS repository from /User/crosati/Projects/Projects.CVS to just /Projects.CVS (thus shortening the path of all jar files inside my projects) 
solved the problem!!!!

I suspect the problem is related to the length of the involved jar files path names.
Comment 9 crosati 2007-11-22 15:38:49 UTC
The issue is still live.
This is what happens after installing NB 6.0rc2 starting from a new userdir:

- after starting with a new userdir I needed to re-open all projects I'm currently 
  working on (15 in total);
- as each project is opened it is re-scanned and no red fledge appear on the project
  icon, thus no bad imports were found by the editor incremental compiler (or scanner),
  just as I've indicated in my last comment to issue #111218;
- as soon as I close NB and restart it, after the initial rescan phase, the usual 4
  project affected by the issue #111218 have their icon with the red fledge, and opening
  involved sources I found the usual "bad import" error, that will slow down a lot the
  scanning phase (up to 3-5min, where NB is blocked) each time I modify one of these files.

Comment 10 crosati 2007-11-23 10:16:43 UTC
Verified with a collegue using the same NB6.0rc2 on windows: it is just a Mac OS version problem.
Comment 11 pribyl 2008-04-24 14:57:39 UTC
Switching INCOMPLETE -> NEW again ( I guess it is our "turn" now :) )

Jirka, please, did the additional info help?

Thanks
Comment 12 crosati 2008-04-24 15:13:55 UTC
I've switched to NB 6.1rc2 and the problem is disappeared.

The only thing is that are not recognized packaged of Web Services' clients (the one NB put in classes subdirectory).

Claudio 
Comment 13 Jiri Prox 2008-04-25 09:48:00 UTC
I'm glad to hear that the original problem is gone now.

To the second problem: Does it happen in project where are the WS client's classes generate or in some dependent project?
Comment 14 crosati 2008-04-28 09:16:40 UTC
The second problem happens in dependant projects.

For the project in which the WS client was generated I've defined a Library having:

- <project>/build/classes as "Classpath"
- <project>/src and <project>/build/generated/wsimport/client as "Sources"
- no "Javadoc"

The dependant project where the problem occurs have the Library between its Conmpile-time Libraries.

Claudio
Comment 15 Jiri Prox 2008-04-30 14:54:22 UTC
Try starting IDE with -J-DCacheClassPath.keepJars=true it may help. It seems that the project sources are preferred to
class files
Comment 16 crosati 2008-04-30 15:39:33 UTC
Please, can you remember me which file I must modify (on MAC OS X) to add the -J-DCacheClassPath.keepJars=true statement.

Thanks.
Comment 17 Jiri Prox 2008-04-30 17:20:47 UTC
It's netbeans.conf in folder 'etc' in NB install dir. Here you can modify the property netbeans_default_options
Unfortunately I don't remember where is the default install dir on Mac.

Comment 18 crosati 2008-04-30 17:45:00 UTC
Thank you.
It seems solve the problem (I've also enlarged the heap memory from the default 368m to 512m)

Claudio 
Comment 19 Jiri Prox 2008-05-13 10:28:44 UTC
*** Issue 134885 has been marked as a duplicate of this issue. ***
Comment 20 Rastislav Komara 2009-02-03 10:52:51 UTC
Overtake.
Comment 21 Jan Lahoda 2009-08-20 09:58:17 UTC
Reassigning all moonko's java/source bugs to myself.
Comment 22 Martin Balin 2016-07-07 07:17:54 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss