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 210279 - Items randomly disappear from lookup
Summary: Items randomly disappear from lookup
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Lookup (show other bugs)
Version: 7.2
Hardware: PC Linux
: P1 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: REGRESSION
: 210514 210622 210952 211363 (view as bug list)
Depends on: 209322
Blocks: 207396 209642 210358
  Show dependency tree
 
Reported: 2012-03-28 13:14 UTC by Petr Hejl
Modified: 2012-06-11 10:28 UTC (History)
11 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
quick fix (1.30 KB, patch)
2012-03-28 13:16 UTC, Petr Hejl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Hejl 2012-03-28 13:14:43 UTC
It looks like recent changes to ProxyLookup introduced a random bug where items are not visible when looked up by Lookup.Result.allInstances().

In my case the ProxyLookup is composed of Folder and custom AbstractLookup (afaik I don't plumb these together explicitly).

Instances stored in ServerInstanceProviderLookup (j2eeserver, lookup registered in layer) are sometimes not visible when queried from RootNode (server module) via Lookups.forPath(path).lookupResult(ServerInstanceProvider.class).allItems(). So server nodes are missing in the UI.
Comment 1 Petr Hejl 2012-03-28 13:16:32 UTC
Created attachment 117403 [details]
quick fix

This quick fix seems to solve an issue to give you an idea what might be wrong.
Comment 2 Jaroslav Tulach 2012-04-03 13:20:07 UTC
Jirka has similar problem in DB tests. After disabling the caches, his problem also disappears.
Comment 3 Jaroslav Tulach 2012-04-03 13:38:14 UTC
*** Bug 210514 has been marked as a duplicate of this bug. ***
Comment 4 Jaroslav Tulach 2012-04-03 13:38:48 UTC
Comment from bug 210514:
> A step to reproduce - just run
> db/test/org.netbeans.modules.db.explorer.DatabaseConnectionTest
Comment 5 Jiri Rechtacek 2012-04-03 13:56:26 UTC
*** Bug 210622 has been marked as a duplicate of this bug. ***
Comment 6 Jaroslav Tulach 2012-04-03 14:18:57 UTC
Revision 94b01928cb3d is fine, revision 5feee5505c73

$ hg log -r 5feee5505c73:94b01928cb3d openide.util.lookup
changeset:   214274:5feee5505c73
user:        Jesse Glick <jglick@netbeans.org>
date:        Fri Mar 02 20:14:31 2012 -0500
summary:     Suppressing Kind.NOTE messages in processors as they just tend to clutter already lengthy compiler output.

changeset:   214473:b0fba5722029
branch:      IterativeProxyIterator209322
user:        Jaroslav Tulach <jtulach@netbeans.org>
date:        Thu Mar 08 14:29:45 2012 +0100
summary:     First step towards iterative iterator. Making the collections ready for laziness.

changeset:   214474:df21bceaa1d4
branch:      IterativeProxyIterator209322
user:        Jaroslav Tulach <jtulach@netbeans.org>
date:        Thu Mar 08 14:32:13 2012 +0100
summary:     Encapsulate obtaining the template into a method

changeset:   214475:604ca7c64e35
branch:      IterativeProxyIterator209322
user:        Jaroslav Tulach <jtulach@netbeans.org>
date:        Thu Mar 08 15:58:12 2012 +0100
summary:     Lazy iterator for ProxyLookup.R.allXYZ

changeset:   214622:49f78bc9c543
branch:      IterativeProxyIterator209322
parent:      214476:0dde69af399c
user:        Jaroslav Tulach <jtulach@netbeans.org>
date:        Fri Mar 09 10:14:24 2012 +0100
summary:     Documenting the laziness as semantically incompatible change

changeset:   214623:318f6e044a95
branch:      IterativeProxyIterator209322
user:        Jaroslav Tulach <jtulach@netbeans.org>
date:        Fri Mar 09 14:14:47 2012 +0100
summary:     Modify the content of cache only if the iterator went through all proxy results

changeset:   214625:94b01928cb3d
user:        Jaroslav Tulach <jtulach@netbeans.org>
date:        Fri Mar 09 14:22:22 2012 +0100
summary:     It's 2012
Comment 7 Jaroslav Tulach 2012-04-04 09:37:08 UTC
This test used to pass in 5feee5505c73, but now it is broken:

package org.openide.util.lookup;
import org.openide.util.Lookup;
public class ProxyProxyLookupTest extends ProxyLookupTest {
    public ProxyProxyLookupTest(String testName) {
        super(testName);
    }
    @Override
    public Lookup createLookup(Lookup lookup) {
        return new ProxyLookup(new ProxyLookup(lookup));
    }
    public static ProxyProxyLookupTest suite() {
        return new ProxyProxyLookupTest("testDoubleAddIssue35274");
    }
}
Comment 8 Stanislav Aubrecht 2012-04-10 14:00:50 UTC
*** Bug 210952 has been marked as a duplicate of this bug. ***
Comment 9 Jaroslav Tulach 2012-04-20 15:54:20 UTC
ergonomics#a3e4f5271879
Comment 10 Sergey Petrov 2012-04-24 06:13:09 UTC
it's not in main-silver yet
Comment 11 Quality Engineering 2012-04-26 10:35:41 UTC
Integrated into 'main-golden', will be available in build *201204260400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a3e4f5271879
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #210279: Before we use the cached values we need to call beforeLookup on all sub-results
Comment 12 Jaroslav Tulach 2012-05-14 15:15:39 UTC
*** Bug 211363 has been marked as a duplicate of this bug. ***
Comment 13 Petr Hejl 2012-06-08 09:19:45 UTC
It's back. Servers randomly disappears in daily builds.
Comment 14 Jaroslav Tulach 2012-06-09 11:51:54 UTC
Recent regression might be caused by fix for bug 213325.
Comment 15 Stanislav Aubrecht 2012-06-11 08:59:56 UTC
*** Bug 213901 has been marked as a duplicate of this bug. ***
Comment 16 Jaroslav Tulach 2012-06-11 10:28:32 UTC
The original occurrence of this bug was also manifested by running a db test and seeing the failure. I've just executed all db tests and none of them failed. That is why I don't think this is the same bug.

That is why we have to start the evaluation again. Leaving the old priority and comments in the bug is just confusing. Closing as fixed, open new bug. With steps to reproduce.