Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 54705 - propertyTest not found for implementing type of interface
Summary: propertyTest not found for implementing type of interface
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Chris Tilt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-12 15:31 EST by Chris Tilt CLA
Modified: 2004-05-26 15:05 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Tilt CLA 2004-03-12 15:31:08 EST
I20040210

Dirk,
Since yesterday, one of my expressions will not evaluate any longer. Here is the
fragment from org.eclipse.jdt.debug.ui/plugin.xml

<enablement>
 <with variable="selection">
 <count value="1"/>
 <iterate>
   <or>
     <test property="org.eclipse.debug.ui.matchesPattern" value="*.java"/>
     <test property="org.eclipse.debug.ui.matchesPattern" value="*.class"/>
   </or>
   <test property="org.eclipse.jdt.hasMainType"/>  <<<<< ERROR HERE
 </iterate>
 </with>
</enablement>

I get an error from the evaulator that says "No property tester contributes a
property hasMainType to type class org.eclipse.core.internal.resources.File"

I have added a propertyTester to the jdt/ui plugin with the following syntax:
<propertyTester
  namespace="org.eclipse.jdt.ui"
  properties="isCompilationUnit, hasMainType, isApplet"
  type="org.eclipse.core.resources.IFile"
  class="org.eclipse.jdt.internal.corext.refactoring.
      participants.xml.FileExtender"
  id="org.eclipse.jdt.IFileExtender">
</propertyTester>

And the FileExtender type has the new test method. I am confused to see that the
propertyTester wants a binding for the internal type, File, rather than IFile. I
don't know how to correct this. However, it worked yesterday, so I am confused.
Please give some advice for this. Thanks.
Comment 1 Dirk Baeumer CLA 2004-03-14 17:21:33 EST
Chris,

why do you need this to be added to JDT/UI. If this has to be located in a 
lower level plug-in which exports them then I think it should be hosted by 
JDT/Core since the testers don't depend on JDT/UI code.

The problem is that the poperty is defined for the 
namespace "org.eclipse.jdt.ui" but referenced 
as "org.eclipse.jdt.hasMainType".  So the "ui" is missing in the name
Comment 2 Dirk Baeumer CLA 2004-03-14 17:24:01 EST
The property tester doesn't want to bind File. The situation is that the 
object to be inspected is of type File and the common expression language 
checks all super classes and interfaces. So if you contribute a tester to 
IFile, which is a super interface of File, the tester works for files as well.
Comment 3 Chris Tilt CLA 2004-03-15 17:25:59 EST
I debugged the expression checker and got to the point where it was looking for
the type File in a hashmap. I couldn't see where it was trying to look at the
interface hierarchy, but I understand the logic of what you are saying. I am ok
with closing this bug report. If I encounter it again, I will try to create a
solid test case. Thanks for the discussion.
Comment 4 Dirk Baeumer CLA 2004-03-16 03:26:06 EST
Chris, I move the PR back to you because I still think the tester you added to 
JDT/UI should be added to JDT/Core. Can you please comment on this ?
Comment 5 Darin Wright CLA 2004-05-26 15:05:39 EDT
Closing - this works for me.