Community
Participate
Working Groups
Created attachment 232305 [details] Log with exceptions I'm using 3.5 RC4 (http://download.eclipse.org/webtools/downloads/drops/R3.5.0/S-3.5.0RC4-20130610150119), and I found this: 1. Create an EAR 6 project with all default modules 2. In the Project Explorer of the Java EE perspective, click or double-click on the DD node of every project 3. You will see an exception like this (I'm attaching the complete log with exceptions for all the types of projects) !ENTRY org.eclipse.ui.navigator 4 2 2013-06-12 13:06:32.982 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.navigator". !STACK 1 org.eclipse.core.runtime.CoreException: No property tester contributes a property org.eclipse.core.resources.open to type class org.eclipse.jst.jee.ui.internal.navigator.ejb.GroupEJBProvider at org.eclipse.core.internal.expressions.TypeExtensionManager.getProperty(TypeExtensionManager.java:123) at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:96) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53) at org.eclipse.core.internal.expressions.AndExpression.evaluate(AndExpression.java:29) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateOr(CompositeExpression.java:68) at org.eclipse.core.internal.expressions.OrExpression.evaluate(OrExpression.java:21) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53) at org.eclipse.core.internal.expressions.EnablementExpression.evaluate(EnablementExpression.java:53) at org.eclipse.ui.internal.navigator.NavigatorPlugin$Evaluator.run(NavigatorPlugin.java:245) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.navigator.NavigatorPlugin.safeEvaluate(NavigatorPlugin.java:260) at org.eclipse.ui.internal.navigator.actions.CommonActionProviderDescriptor.isEnabledFor(CommonActionProviderDescriptor.java:235) at org.eclipse.ui.internal.navigator.actions.CommonActionDescriptorManager.addProviderIfRelevant(CommonActionDescriptorManager.java:258) at org.eclipse.ui.internal.navigator.actions.CommonActionDescriptorManager.findRelevantActionDescriptors(CommonActionDescriptorManager.java:235) at org.eclipse.ui.navigator.NavigatorActionService.fillActionBars(NavigatorActionService.java:248) at org.eclipse.ui.navigator.CommonNavigatorManager.selectionChanged(CommonNavigatorManager.java:222) at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:164) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:162) at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2188) at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1211) .............
I found that these exceptions are logged when the enablement expression of these action providers are evaluated: org.eclipse.jdt.ui.navigator.resources.GoIntoActions and org.eclipse.ui.navigator.resources.GoIntoActions Specifically, this is the expression that is causing the exceptions to be logged: <and> <adapt type="org.eclipse.core.resources.IProject" /> <test property="org.eclipse.core.resources.open" value="true"/> </and>
I found that these exceptions are logged when the enablement expression of these action providers are evaluated: org.eclipse.jdt.ui.navigator.resources.GoIntoActions and org.eclipse.ui.navigator.resources.GoIntoActions Specifically, this is the expression that is causing the exceptions to be logged: <and> <adapt type="org.eclipse.core.resources.IProject" /> <test property="org.eclipse.core.resources.open" value="true"/> </and> But the failure in the evaluation of this expression is caused by bug201743. Before bug201743, the adapter to IProject was never found for objects like GroupEJBProvider (even if they implement IAdaptable and adapt IProject). After bug201743, the adapter is found, and then, when the property is tested, the exception is logged. I'm investigating which is the best way to fix this.
Hi, I moved this bug to JDT UI because I believe this is a possible problem with the action provider org.eclipse.ui.navigator.resources.GoIntoActionProvider in org.eclipse-jdt.ui Its current enablement expression includes this: <and> <adapt type="org.eclipse.core.resources.IProject" /> <test property="org.eclipse.core.resources.open" value="true"/> </and> This causes that if the selection Adapts IProject, but is not an IProject, then the property org.eclipse.core.resources.open is tested against the original object (not the adapted one) and then the exception is logged. I believe this could be fixed by changing the expression to this: <and> <adapt type="org.eclipse.core.resources.IProject"/> <adapt type="org.eclipse.core.resources.IProject"> <test property="org.eclipse.core.resources.open" value="true"/> </adapt> </and> In this way, if the selection is adaptable to an IProject, then the property will be tested against an IProject object. Ideas?
To me this looks like the adapter you return for IProject is not a real IProject, which would be illegal. I just tried this on a random type and as long as it returns an IProject, there is no exception.
(In reply to Dani Megert from comment #4) > To me this looks like the adapter you return for IProject is not a real > IProject, which would be illegal. I just tried this on a random type and as > long as it returns an IProject, there is no exception. Thanks for taking a look at this. The object returned is an IProject. This is the getApadter(Class) method of GroupEJBProvider for example: public Object getAdapter(Class adapter) { if (IProject.class == adapter){ return ResourcesPlugin.getWorkspace().getRoot().getProject(getProjectName()); } return null; } Which random type did you test with?
(In reply to Roberto Sanchez Herrera from comment #5) I tried again and can now reproduce the problem with clean 'master' (not sure what went wrong the first time). Note that your suggested fix would not work and even if it did, it would be a workaround. Moving to Platform UI for further debugging. Bug 414912 looks similar which is claimed to be fixed for 4.4 M2.
*** Bug 298285 has been marked as a duplicate of this bug. ***
This one was added in bug 302791 for Helios. PW
It looks like this is suspect: <and> <adapt type="org.eclipse.core.resources.IProject" /> <test property="org.eclipse.core.resources.open" value="true"/> </and> The test element is outside the adapt element, so you have no gaurantee of the type of object that is being tested. PW
(In reply to Paul Webster from comment #9) > It looks like this is suspect: > > <and> > <adapt type="org.eclipse.core.resources.IProject" /> > <test property="org.eclipse.core.resources.open" value="true"/> > </and> > > > The test element is outside the adapt element, so you have no gaurantee of > the type of object that is being tested. > > PW Hi Paul, So was I in the right way in comment#3, and the test of the property should be inside the adapt element to make sure you are using an IProject for testing the property?
(In reply to Paul Webster from comment #9) > It looks like this is suspect: > > <and> > <adapt type="org.eclipse.core.resources.IProject" /> > <test property="org.eclipse.core.resources.open" value="true"/> > </and> > > > The test element is outside the adapt element, so you have no gaurantee of > the type of object that is being tested. > > PW I should have looked closer. The Expression Language implements conditional and/or but that does not mean it will use the adapter for the next evaluation. Fixed with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=9fe47a4ae03f3e28b7ced0985e1a160853459044 and also in the Navigator who makes the same contribution: Fixed with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=c490fbda2425322c236f96f019be38b60caf42e0
Thank you Dani and Paul.
In 4.4.0.I20130916-2330 PW
Thank you again for fixing this in Luna. However, it is possible to backport the fix to Kepler SR2?
(In reply to Roberto Sanchez Herrera from comment #14) > Thank you again for fixing this in Luna. However, it is possible to backport > the fix to Kepler SR2? Done, see bug 419992.
(In reply to Dani Megert from comment #15) > (In reply to Roberto Sanchez Herrera from comment #14) > > Thank you again for fixing this in Luna. However, it is possible to backport > > the fix to Kepler SR2? > > Done, see bug 419992. Thank you!
*** Bug 418241 has been marked as a duplicate of this bug. ***