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 36397 - [completion] Not existing classes in a cache of fastimport and completion
Summary: [completion] Not existing classes in a cache of fastimport and completion
Status: RESOLVED INVALID
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: -S1S-
Hardware: PC Windows ME/2000
: P4 blocker (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on: 42068
Blocks:
  Show dependency tree
 
Reported: 2003-10-02 09:01 UTC by jdi
Modified: 2007-11-05 13:38 UTC (History)
1 user (show)

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 jdi 2003-10-02 09:01:19 UTC
How to reproduce

1. Lets take a following class:
---test.java---
package test;
class test {
}
--------------
2. change package name in editor window couple of 
times and save results evety time:
test.test1 -- Ctrl-s
test.test1.test2 -- Ctrl-s
test.test1.test2.test3 -- Ctrl-s
......
3. Press Alt-Shift-I on "test" somewhere in 
edited code.

In result:
Dialog_windows - Import class :
test
test.test1
test.test1.test2
test.test1.test2.test3
.......

All previously typed packages have been cached. 
Fastimport and completion engine uses this cache 
to offer imports and possible completion. Since
all these cached classes are unexisted import of
such class will cause compilation error.
Comment 1 Vitezslav Stejskal 2003-11-11 15:34:23 UTC
There is a problem in synchronization of parser DB. Now, the JCUpdater
listens on files opened in the editor and starts updating parser DB
after they are saved and correctly reparsed (without errors). However,
this is done only incrementally by reading information from
SourceCookie and adding it in the DB. Currently there is no way how to
find parser DB entries created from particular SourceCookie and remove
them from parser DB properly when they get obsolete.

More specificaly, assume that there is a class test.ClassA which info
was already added in the parser DB. When the package declaration of
this class is changed form 'package test' to 'package test.test' then
CC creates new DB entry (JCClass) for test.test.Class, but doesn't
remove  existing entry for test.Class ...

We should probabaly change the JCUpdater to listen on org.openide.src
elements which fire more specific events notifying e.g. about the
package declaration change, etc. However, we might not want to solve
it at all if the java code completion would be rewritten to use MDR
anyway.

Reassigning back to editor guys.
Comment 2 psuk 2004-03-23 17:50:33 UTC
Changing subcomponent to code completion
Comment 3 Dusan Balek 2004-06-02 13:07:50 UTC
Can be closed after merging meta_stavbicka to trunk.
Comment 4 Martin Roskanin 2004-06-07 10:13:21 UTC
OK, I am closing it... meta_stavbicka was merged to maintrunk