Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340512

Summary: classHierarchy.lookupClass("<Extension,Lorg/eclipse/core/expressions/Expression>") leads to null
Product: z_Archived Reporter: Andreas Kaluza <andreas>
Component: RecommendersAssignee: Marcel Bruch <marcel.bruch>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Andreas Kaluza CLA 2011-03-20 11:32:55 EDT
classHierarchy.lookupClass("<Extension,Lorg/eclipse/core/expressions/Expression>") leads to null
Comment 1 Marcel Bruch CLA 2011-03-20 13:10:53 EDT
Sorry, need a bit more details on this :-)

Is this class in the project's classpath? Can you attach/name the sample project?
Comment 2 Andreas Kaluza CLA 2011-03-20 13:33:25 EDT
You need a TypeReference which has a <Extension,Lorg/eclipse/core/expressions/Expression> content. Then use the method lookupClass from the IClassHierarchy. This leads to null, which should not.

in the MethodChainElement class in line 70 extend following

        } else {
          type = classHierarchy.lookupClass(resultingType);
          if (type != null) {
            type = type.getClassLoader().lookupClass(type.getReference().getInnermostElementType().getName());
          } 
        }
to this:
        } else {
          if (completion.equals("getExpression")) {
            System.out.println(); // --> set break point here!!!!!!!
          }
          type = classHierarchy.lookupClass(resultingType);
          if (type != null) {
            type = type.getClassLoader().lookupClass(type.getReference().getInnermostElementType().getName());
          } 
        }

Now, use the CompletionOnThisAndLocal to get to break point. The next step should lookup the class, which leads to null.
Comment 3 Marcel Bruch CLA 2012-01-15 05:22:30 EST
this is obsolete for m5. closing. Andreas, please reopen this bug report if the same error occurs again.