Community
Participate
Working Groups
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.
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
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.
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.
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 ?
Closing - this works for me.