Netbeans IDE 6.5 don't autocomplete import statement

Bug #353080 reported by Tiago Hillebrandt
38
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Netbeans Core
Invalid
Unknown
netbeans (Ubuntu)
Fix Released
Undecided
Yulia Novozhilova
Jaunty
Fix Released
Medium
Yulia Novozhilova
Karmic
Fix Released
Undecided
Yulia Novozhilova

Bug Description

Binary package hint: netbeans

I tried to import a Sun Java package (java.io.Serializable) to my project, but when I press Ctrl+Space shortcut to autocomplete the statement his get only autocomplete to active project packages.
If I enter the package name manually, it works.

My environment variables are:
JAVA_HOME="/usr/lib/jvm/java-6-sun/jre"
export JAVA_HOME

PATH="$JAVA_HOME/bin:$PATH"
CLASSPATH="$JAVA_HOME/lib"
export PATH CLASSPATH

My Java Version:
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)

This is a critical bug. Fix imports and code completion are affected.
So this issue breaks usage of NB 6.5 packages in Jaunty. Developers have to remove NB packages and install the IDE from the netbeans.org site.

The bug is caused by incompatibility between lucene-core 2.4.0 and netbeans (which is adjusted to use lucene-core 2.3.2). It has been addressed in development version by adding a patch "96-fix-lucene.patch" which corrects
"java.source/src/org/netbeans/modules/java/source/usages/LuceneIndex.java" file in netbeans upstream.
The patch is small. It updates close() method in order to avoid AlreadyClosedException which is thrown by lucene-core 2.4.0 and which breaks the things.

Source package netbeans 6.5-0ubutu2 has been modified in karmic, so netbeans 6.5-0ubuntu3 contains the fix now.
netbeans_6.5-0ubuntu3.debdiff for Jaunty is attached.

TEST CASE:
1. install netbeans:
sudo apt-get install netbeans=6.5-0ubuntu2
and run netbeans IDE (Applications -> Programming -> NetBeans IDE 6.5).
Note: if you downgrade netbeans from 6.5-0ubuntu3 you should also remove your netbeans user dir (rm -rf ~/.netbeans/6.5)
2. Create a Java Application project (Menu File -> New Project -> Next -> Finish ).
3. Type 'import ' right under "package < package name>;" line and press Ctrl-Space, make sure you see only your project packages in an autocomplete suggestion box.
Expected behavior: to see an autocomplete suggestion box with all java packages (javax, java, org, etc...)

This fix is absolutely safe and will not cause any regression.

Revision history for this message
Marek Slama (mslama-email) wrote :

Sorry not sure what you exactly do ie. what you have in editor at current line when you press Ctrl-Space what you expect and what actually happens. In addition it is better to file such IDE issues directly to Issuezilla and netbeans.org. I have to do it anyway and it is cumbersome to work as bridge between LP and IZ. We solve only packaging specific problems here directly. Thanks.

If you cannot file issue to IZ yourself I can of course do it but I need exact description.

Revision history for this message
Tiago Hillebrandt (tiagohillebrandt) wrote :

Hi Marek,

When I type 'import ' and press Ctrl-Space, expect see a autocomplete suggestion box with all java packages (javax, java, org, etc...) but what shows in this box is only a my project packages.

For help purposes, I send a attached image from ide.

Sorry for my bad English.

Revision history for this message
Marek Slama (mslama-email) wrote :

I filed http://www.netbeans.org/issues/show_bug.cgi?id=162037. Please regiser at netbeans.org and add yourself to CC of this issue so that you can answer questions directly.

Changed in netbeans:
status: Unknown → Confirmed
Revision history for this message
Richard Senior (sanhozay) wrote :

I think this is the same issue as:

http://www.netbeans.org/issues/show_bug.cgi?id=160498

The current version of NetBeans available at netbeans.org doesn't have this bug. I've manually installed NetBeans 6.5.1 on Ubuntu 9.04 and the problem goes away. Does that make it a packaging issue?

I should add that, although it sounds a trivial issue, auto-completing imports is important to Java developers.

Changed in netbeans:
status: Confirmed → Invalid
Revision history for this message
Marcus Carlson (0-launchpad-mejlamej-nu) wrote :

I've got the same issue. Right after starting Netbeans 6.5 in 9.04 I get this stacktrace and finding imports automatic is impossible and makes it (almost) impossible to code. Also tried to remove the profile folder imported from 6.1 but same issue, just that it crashes at another jar file.

So it sure does look like the same as http://www.netbeans.org/issues/show_bug.cgi?id=160498 .

*** Stacktrace ***
Annotation: While scanning: jar:file:/usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar!/
Annotation: While scanning: jar:file:/usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar!/
While scanning: jar:file:/usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar!/
While scanning: jar:file:/usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar!/
Caused: org.apache.lucene.store.AlreadyClosedException: this Directory is closed
 at org.apache.lucene.store.Directory.ensureOpen(Directory.java:220)
 at org.apache.lucene.store.FSDirectory.list(FSDirectory.java:320)
 at org.netbeans.modules.java.source.usages.LuceneIndex.clear(Unknown Source)
 at org.netbeans.modules.java.source.usages.BinaryAnalyser.start(Unknown Source)
 at org.netbeans.modules.java.source.usages.RepositoryUpdater$CompileWorker.scanRoots(Unknown Source)
 at org.netbeans.modules.java.source.usages.RepositoryUpdater$CompileWorker.access$2700(Unknown Source)
 at org.netbeans.modules.java.source.usages.RepositoryUpdater$CompileWorker$1.run(Unknown Source)
 at org.netbeans.modules.java.source.usages.RepositoryUpdater$CompileWorker$1.run(Unknown Source)
 at org.netbeans.modules.java.source.usages.ClassIndexManager.writeLock(Unknown Source)
 at org.netbeans.modules.java.source.usages.RepositoryUpdater$CompileWorker.run(Unknown Source)
 at org.netbeans.modules.java.source.usages.RepositoryUpdater$CompileWorker.run(Unknown Source)
 at org.netbeans.api.java.source.JavaSource$CompilationJob.run(Unknown Source)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
 at java.util.concurrent.FutureTask.run(FutureTask.java:166)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
[catch] at java.lang.Thread.run(Thread.java:636)

Revision history for this message
Nith (nith1210) wrote :

Hi, first, confirming this issue. Both autocomplete stops functioning (only showing packages in current project) and also org.w3c.dom could not be found. I ensured that rt.jar was present it was.

Second, It seems to be an issue with the package. I've installed Netbeans 6.5.1 from netbeans.org and this issue is not present.

Revision history for this message
twak (twakered) wrote :

Confirming this issue. Deleting the var/cache doesn't help. Cripples the IDE.

Seems to happen with Sun's jvm and not the default openJDK. (openJDK barfs up the font sizes)

Installing from the netbeans website (6.5.1) resolves the issue.

Revision history for this message
Marek Slama (mslama-email) wrote :

It is problem with lucene library. We will try to backport fix for this from NB 6.7 to NB 6.5. Issue is http://www.netbeans.org/issues/show_bug.cgi?id=157028. Then we must decide the best way how to deliver this fix to packages of NB 6.5 for Ubuntu Jaunty 9.04. One possibility is to put update to backport repo. Another one is to put patch to NB Update Center specific for NB packages for Ubuntu.

Revision history for this message
Yulia Novozhilova (yulia-novozhilova) wrote :

Fix for this bug is attached.

Emmet Hikory (persia)
Changed in netbeans (Ubuntu Karmic):
assignee: nobody → Yulia Novozhilova (yulia-novozhilova)
status: New → In Progress
Emmet Hikory (persia)
Changed in netbeans (Ubuntu Jaunty):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Yulia Novozhilova (yulia-novozhilova) wrote :
Emmet Hikory (persia)
Changed in netbeans (Ubuntu Jaunty):
assignee: nobody → Yulia Novozhilova (yulia-novozhilova)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netbeans - 6.5-0ubuntu3

---------------
netbeans (6.5-0ubuntu3) karmic; urgency=low

  * Bug fix upload (LP: #353080)
     - Added a critical patch 96-fix-lucene.patch

 -- Yulia Novozhilova <email address hidden> Mon, 25 May 2009 23:28:08 +0400

Changed in netbeans (Ubuntu Karmic):
status: In Progress → Fix Released
Revision history for this message
Yulia Novozhilova (yulia-novozhilova) wrote :

Attaching debdiff for Jaunty

description: updated
Revision history for this message
Yulia Novozhilova (yulia-novozhilova) wrote :
description: updated
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted netbeans into jaunty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in netbeans (Ubuntu Jaunty):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Emmet Hikory (persia) wrote :

I was able to replicate the issue from netbeans 6.5-0ubuntu2 in jaunty, installed netbeans (and dependencies from the same source) 6.5-0ubuntu2.1 from jaunty-proposed, and can confirm that this addresses the problem.

Martin Pitt (pitti)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Tiago Hillebrandt (tiagohillebrandt) wrote :

The fix to Jaunty will be released today in apt?

Revision history for this message
Emmet Hikory (persia) wrote :

The candidate fix is available in the jaunty-proposed repository now. While you may not want to install *all* applications from the proposed repository, you may find the documentation at https://wiki.ubuntu.com/Testing/EnableProposed to test the proposed update to netbeans, and confirm that is fixes the bug for you. Once enough of us have tested it, and nobody has found significant problems after a certain number of days, it will be promoted to jaunty-updates for distribution to everyone.

Revision history for this message
AlexeiMokeev (alexei-mokeev) wrote :

The issue was reproducible for me with netbeans 6.5-0ubuntu2 in Jaunty.
Installation of 6.5-0ubuntu2.1 from jaunty-proposed fixed it. Checked with keeping old and creating new userdirs - the imports and code completion works in booth cases.

Revision history for this message
ZelinskiyIS (ivze) wrote :

I have just updated Netbeans from 9.04 proposed repository. Platform - x86.
Import completion has started to work!
Thanks, Martin Pitt!
Thanks, Yulia Novozhilova!

Revision history for this message
Yulia Novozhilova (yulia-novozhilova) wrote :

Fix from proposed repository works for me as well. Hope to see it in jaunty-updates soon.
 Thanks a million to Emmet Hikory for a great help!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netbeans - 6.5-0ubuntu2.1

---------------
netbeans (6.5-0ubuntu2.1) jaunty-proposed; urgency=low

  * Bug fix upload (LP: #353080)
     - Added a critical patch 96-fix-lucene.patch

 -- Yulia Novozhilova <email address hidden> Mon, 25 May 2009 23:28:08 +0400

Changed in netbeans (Ubuntu Jaunty):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.