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.
I have a fairly large application that I moved over from NB 5.0 that consists of 4 projects and 2 jar libraries. What is happening is 2 things, though they may be related... If I load a simple class with getters/setters for primatives and classes out of the java.lang and java.util packages, doing a FIX-IMPORTS (ALT-SHFT-F), the primatives are recognized, but the classes are not, even though they are shown in the imports section of the code. This gets worse if I am extending a class from one of the other projects. Then things like java.lang.Object are not recognized, along with, any classes from the libraries, yet they are defined in the project. Secondly, if the IDE start to have the above problem, and I am using something like java.util.List in the class that is clearly defined in the imports section, if I do an ALT-SHFT-F, java.awt.List is added to the imports section right above the java.util.List import. I then have to go back and remove the erroneous java.awt.List definition for the class to compile correctly. Again, this is a fairly LARGE application and our legal department would not allow me to post any intellectual property to this site for showing examples.
This issue was discused on nbusers: http://www.netbeans.org/servlets/BrowseList?list=nbusers&by=thread&from=535470
It looks like your project is not correctly configured. Please check Tools | Java Platform Manager configuration and project properties. Let us know, if you find something... Thanks.
kvgeorge1 wrote: Ok, after deleting my userdir and re-creating it, it is still not working. Also, once the failure occurs, it seems that if a class that is being used is from an external library, though it is in the classpath, and though it is defined in the project properties, the IDE does not recognize the classes in it for IMPORT FIX. However, compilation occurs without error. Furthermore, I noticed that once this occurs, even things like java.lang.Object are not even recognized. As if this wasn't enough, if I attempt to do a fix imports, and I am using a java.util.List object, and it is defined specifically as an import, the IDE insists on adding a java.awt.List object to the imports area of the code. For example: Before FIXING.... import java.util.List public class Test { List list = new List(); } After FIXING.... import java.awt.List import java.util.List public class Test { List list = new List(); } This is a serious issue.
And what kind of project do you use? j2se project? project with existing sources? Project with existing ant script? Thanks
I use j2se and web applications (Struts). All of them seem to have the same issues. Is there a major change to the private project directories from NB 5.0 -> NB 5.5?
It definately looks as if any external reference to a class contained in a .jar file is not being refereneced by the IDE for purposes of fixing imports. I created a new class library project. Checked-out the source from my SVN repository, added the external library, set the platform to the version of Java that we are using (jdk 1.4.2). When I do a fix-imports on a Class that I created extending a Class in the external .jar file (3rd-party library from HP), the Classes that are being used are not recognized by the IDE during the fix-imports function. However, the Class compiles without errors. I do not experience this issue if I follow the same steps using NB 5.0, so this is definately isolated to NB 5.5 beta 2.
Maybe this will help....here is a Class that I created that I can share with you: /* * TandemDate.java * * Created on February 17, 2006, 4:46 PM */ package com.myco.utils; import java.util.Date; /** * This class extends <code>java.util.Date</code> with 2 additional * methods that will either accept a Date object and return the julian * value using the offset for the Tandem server, or accept the julian * value and return a new Date object. * * @author Ken George * @see java.util.Date */ public class TandemDate extends Date { // JulianTS epoch for Tandem private static final long julianEpoch = 210866760000000L; // Jan. 1, 1970 00:00:00 GMT. /** * Returns the date in julianTS * * @param date * The date to convert * * @return long */ public static long convertToJulianTS(Date date) { return ((date.getTime() + julianEpoch) * 1000); } /** * Returns the date in Date format * * @param julianTS * The timestamp to convert * * @return Date */ public static Date convertToGregorianTS(long julianTS) { return new Date((julianTS / 1000) - julianEpoch); } } When I do a fix-imports (ALT-SHFT-F), I get the followng error: No imports found for the following types: - Date
jiriprox, can you reproduce that? Thanks.
Yes, easily. I have another thread running on the nbusers list discussing the same issue recently (today actually), that is about the same information. It appears that any class in an external jar file is being ignored, along with, any class that is not in the immediate package (i.e. java.util.Date, etc.).
It looks like a regression. I guess, that this regression could not be introduced by javacore module, since there is only few commits in this module since 5.0. Tomasi, I see similar issue in classpath module (issue 82883) and there is also issue 75469, which might be related.
Issue 82843 and issue 82513 looks similar as well. I can not reproduced it on my machine. But Petr Blaha did it and provided messages.log.
Created attachment 33054 [details] messages.log
See: http://www.netbeans.org/issues/show_bug.cgi?id=82843 and there is lots of exceptions coming from MDR.
*** Issue 82843 has been marked as a duplicate of this issue. ***
Steps to reproduce: 1. Open fresh IDE 2. Create new project 3. Wait scan finished 4. Kill the IDE (don't shut down, but kill) 5. Restart ide -> CC is broken Probably introduced by issue 77982 or related fixes.
Dan is working on fix.
Fixed in trunk. /cvs/java/javacore/src/org/netbeans/modules/javacore/scanning/ClassUpdater.java new revision: 1.19; previous revision: 1.18
Fixed merged into release55 branch. /cvs/java/javacore/src/org/netbeans/modules/javacore/scanning/ClassUpdater.java new revision: 1.11.34.7; previous revision: 1.11.34.6
I just downloaded the latest daily build (200608230000) and the problem still exists. Things like java.util.List are not recognized, but are replaced with java.awt.List when doing an ALT-SHFT-F (Fix Imports).
The fix was merged into release55 branch on August 23, it is not included in build 200608230000, it will be in 200608240000.
Reporter, can you verify the fix, please?
My apologies. This is indeed fixed.
Reorganization of java component