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

Summary: Lookup for SourceElement does not return ProjectMember.
Product: java Reporter: Michael Ottati <ottati>
Component: UnsupportedAssignee: issues@java <issues>
Status: RESOLVED WONTFIX    
Severity: blocker CC: cliffwd, pswisnov
Priority: P3    
Version: 3.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: DEFECT Exception Reporter:
Attachments: Full description of this bug.
Projects which reproduce this case

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