Bug 391360 - jdt refactoring extensions load the jpa.core plug-in even when there are no JPA faceted projects
Summary: jdt refactoring extensions load the jpa.core plug-in even when there are no J...
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M5   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 397757
Blocks:
  Show dependency tree
 
Reported: 2012-10-08 11:34 EDT by Karen Butzke CLA
Modified: 2013-01-11 10:54 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2012-10-08 11:34:34 EDT
Currently our extensions to org.eclipse.ltk.core.refactoring loads the org.eclipse.jpt.jpa.core plugin and dependencies even when there are not any JPA faceted projects. It does not load the jpt.jpa.core.ui plug-in so at least the JpaProjectManager is not started (bug 386171)

We probably need a plug-in just for determining if there are any projects with the JPA facet. Then our extension points would be able to define an enablement expression based on a property tester that checks that.
Comment 1 Paul Fullbright CLA 2012-10-08 11:37:05 EDT
There is a faceted project tester that can test the project without loading *our* plugins.
Comment 2 Karen Butzke CLA 2012-10-08 11:42:38 EDT
Can it test if any project in the workspace is a jpa faceted project? 

A Java class rename refactoring could be done on a class that is in a non-JPA faceted project, but it could be referenced in a persistence.xml in a JPA faceted project. So I can't just test that the particular IType is in a JPA faceted project.
Comment 3 Paul Fullbright CLA 2012-10-08 11:47:40 EDT
So the refactoring participant is not invoked on each prospective project?  No, you'd have to have a project upon which to invoke the tester.
Comment 4 Karen Butzke CLA 2013-01-08 16:54:19 EST
(In reply to comment #0)
> It does not load the jpt.jpa.core.ui plug-in so at
> least the JpaProjectManager is not started (bug 386171)

this comment is not correct, not sure where I got that idea :( I'm looking at fixing this now.
Comment 5 Karen Butzke CLA 2013-01-09 12:48:32 EST
In maintenance we are partially fixing this issue with bug 397778. It checked if any of the 'affectedNatures' are the facet nature.
Comment 6 Karen Butzke CLA 2013-01-11 10:54:34 EST
The platform fixed a bug where forcePluginActivation=true was not working for refactoring participant enablement property testers.

Now I have fixed this bug by putting the property tester class in org.eclipse.jpt.common.core.internal.bundleexclude, this package is excluded in the manifest.mf BundleActivation-Policy so it does not cause the plug-in to be activated.

Now a jdt refactoring will only activate our plug-ins if the refactored element is in a project with a referencing project that has the JPA facet (another JPA faceted project references the project involved in the refactoring).


http://git.eclipse.org/c/dali/webtools.dali.git/commit/?id=1583e09bb0f6def90ef454c8eda036d4331d20aa