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 36729 - Lookup for SourceElement does not return ProjectMember.
Summary: Lookup for SourceElement does not return ProjectMember.
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-22 00:19 UTC by Michael Ottati
Modified: 2007-09-26 09:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Full description of this bug. (3.16 KB, text/plain)
2003-10-22 00:20 UTC, Michael Ottati
Details
Projects which reproduce this case (5.38 KB, application/octet-stream)
2003-10-22 00:24 UTC, Michael Ottati
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Ottati 2003-10-22 00:19:05 UTC
Full description is in attached text. Briefly 
the following code fragment does not work 
reliably under the conditions described in the 
attached text. 

Lookup lookup = sourceElement.getLookup();
    
if (lookup == null)
    throw new RuntimeException("Source element 
has no lookup");
    
ProjectMember member = (ProjectMember)
lookup.lookup(ProjectMember.class);

At this point sometimes a project member is 
returned, and sometimes it is not.
Comment 1 Michael Ottati 2003-10-22 00:20:27 UTC
Created attachment 11925 [details]
Full description of this bug.
Comment 2 Michael Ottati 2003-10-22 00:24:04 UTC
Created attachment 11926 [details]
Projects which reproduce this case
Comment 3 _ cliffwd 2003-10-22 00:57:41 UTC
Don't know if this helps.  But when I print to stdout the lookup, I
get very different things when it works, and when it fails.
Fails:
ProxyLookup(class=class
org.openide.util.lookup.ProxyLookup)->[org.openide.util.Lookup$Empty@1649b44,
SimpleLookup[package pkg;
public class WS2 extends java.lang.Object {
    public WS2() {}
    
    public int timesFour(int ) {}
    
    
}], AbstractLookup[]] 

Works (on a different class):
ProxyLookup(class=class
org.openide.util.lookup.ProxyLookup)->[ProxyLookup(class=class
org.netbeans.api.projects.ProjectMember$Environment)->[org.openide.util.Lookup$Empty@1649b44,
AbstractLookup[IL[org.netbeans.modules.java.compiler.CompilableProvider$SingleObjectCompilable@c03696],
SimpleLookup[org.netbeans.modules.web.components.JavaComponent@1cbdd11],
SimpleLookup[org.netbeans.modules.java.codesync.ModelEventAdapter@1225131,
org.netbeans.modules.java.parser.ParsingSupport@76e8,
org.netbeans.modules.java.JavaParserGlue@c8996d,
org.netbeans.modules.java.JavaParserGlue@c8996d,
org.netbeans.modules.java.JavaMember$PersistentConnectionSupport@7e9611,
null, org.netbeans.modules.java.JavaMember@ae49d5,
org.netbeans.modules.java.JavaMember$Open@71601f],
SimpleLookup[org.netbeans.modules.java.JavaFileOperations@b0f231],
SimpleLookup[org.netbeans.modules.java.project.classpath.ProjectPathConvertor$PF@15dcdeb],
org.openide.util.Lookup$Empty@1649b44,
SimpleLookup[org.netbeans.api.projects.ProjectMember@1887b7[nbprjres://project/ProjectFilePosition/src/com/foo/WSBlue.java,
org.netbeans.api.projects.Project@525d3[nb-project-1066780325321-0-9f2d7915]],
Context: [absoluteName=fileCtx22]
org.netbeans.api.registry.Context@17a3972,
org.netbeans.api.projects.Project$Resolver@11c1cdf],
AbstractLookup[IL[[JDO for
/home/cliffwd/Projects/wa9/src/com/foo/WSBlue.java]]],
SimpleLookup[package com/foo;

/**
 * @serviceName Blue
 */
public class WSBlue {
    
}], org.netbeans.modules.java.srcmodel.util.ElementCookieLookup@54ca71]
Comment 4 Jan Pokorsky 2003-11-26 15:29:01 UTC
The projects prototype has been canceled. For more details see
http://www.netbeans.org/servlets/ReadMsg?msgId=619519&listName=nbdiscuss
Comment 5 Quality Engineering 2007-09-20 10:09:15 UTC
Reorganization of java component