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 58408 - Fix imports still broken
Summary: Fix imports still broken
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker with 2 votes (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-28 16:16 UTC by snoopdave
Modified: 2007-09-26 09:14 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 snoopdave 2005-04-28 16:16:46 UTC
I'm working with a project that has a custom Ant script. I have all of my jars
in the classpath and the editor recognizes all of my classes (no red-lines), but
when I use Fix Imports Netbeans cannot find my classes and many built-in Java
classes (such as java.util.String).
Comment 1 Milan Kubec 2005-04-29 08:25:23 UTC
Please describe exactly your problem. And also describe steps how to reproduce
it. Does IDE break your source by doing Fix Imports? 
There is no class as java.util.String, so IDE cannot find such class.
Thanks
Comment 2 Tomas Zezula 2005-04-29 09:20:51 UTC
Definitelly no classpath problem. The classpath is used by all the features
including editor's red-lines. If it was broken the editor would not work.
Comment 3 Martin Matula 2005-04-29 11:00:00 UTC
Waiting for more info on how to reproduce it. No code loss -> P2.
Comment 4 snoopdave 2005-04-29 14:26:03 UTC
> Please describe exactly your problem. And also describe steps 
> how to reproduce it. 

Steps to reproduce:
1) Use CVS to retrieve latest source code from roller.dev.java.net
2) Edit the project's project.xml file to set project.dir
3) Open Java file (such as PlanetManagerImpl.java)
4) Observe no read lines in 27 imports, indicating that classpath is setup right
5) Right-click in editor, pick Fix Imports
6) See "Searching for dependencies" progress dialog 
7) See "No imports found for following types" and a listing of 25 classes
including many from java.util and java.lang
8) Click OK
9) See that there are now only 9 imports, code is broken, and will no longer
compile 

> Does IDE break your source by doing Fix Imports? 

Yes, the original list of imports is thrown away and my code is broken (I have
to do an undo to get back to my unbroken code)

> There is no class as java.util.String, so IDE cannot find such class.

Sorry, I meant to say java.lang.String
Comment 5 snoopdave 2005-05-11 04:53:07 UTC
Still broken in Netbeans 4.1 RC2.

One additional clue. If I delete the var/cache/mdrstorage directory, the problem
will go away for a while, but will return after a couple of hours of usage.

Comment 6 snoopdave 2005-05-12 16:50:13 UTC
Still broken in Netbeans 4.1 final
Comment 7 cpreisler 2005-05-12 21:34:02 UTC
A developer downloaded Netbeans 4.1 today and to my surprise after I helped him
set up his project, the Fix Imports could not find classes java.lang.Exception.
 This is a fairly annoying problem because fix imports is so handy.  I'll stick
with 4.0 until this is fixed.

In addition to Fix Imports not working as described below, the "Seperate
Classpath for Each Source Package Folder" in the project properties can not be
un-checked.  

Comment 8 Milan Kubec 2005-06-03 13:32:14 UTC
Don't you face also issue #59031? Isn't it related?
Comment 9 Jan Lahoda 2005-06-03 13:39:30 UTC
Hello,
    could you please look to Tools/Java Platform Manager whether there are any
invalid (shown in red) platforms?
Comment 10 snoopdave 2005-06-06 15:09:48 UTC
No, there are no red platforms.
Comment 11 Milan Kubec 2005-06-07 13:04:07 UTC
As I understand your project is j2seproject, isn't it? Could you attach zipped
nbproject dir that is placed under the project dir? Also there is patch for
issue #59031, you might want to try that patch to test if it fixes also your
problem. Thanks for your help.
Comment 12 Tomas Hurka 2005-08-05 15:27:28 UTC
Snoopdave,
I tried to follow your steps.
1) I downloaded roller-src-1.1.2.tar.gz and roller-tools-1.1.2.tar.gz
2) I edited ant.properties to set project.dir
3) I created Java Project with Existing Ant script. (sources set to roller/src - test set to roller/test)
 - I set Source package folder and test package folder
 - I did not add dependent  jars since there about thirty jars.
4) I was not able to find PlanetManagerImpl.java 
  - I found it in 
        ./sandbox/planetroller/build/planet-roller/src/org/roller/business/PlanetManagerImpl.java
       ./sandbox/planetroller/src/org/roller/business/PlanetManagerImpl.java
      but this looks like different projects.
5) I opened BookmarkManagerImpl.java instead. 
6) There was some unresolved classes like org.apache.commons.logging.Log or org.jdom.Document b 
ecause I did not add libraries. Other that that Fix All Imports worked fine and was able to resolve 
classes from JDK.

Please update your steps how to reproduce it. Especially the part about setting up NetBeans Project with 
Existing Ant Script is important.

Thanks.
Comment 13 Tomas Hurka 2005-10-25 13:20:49 UTC
Closing until more information is vailable.