Author: scabanovich
Date: 2011-10-14 13:07:21 -0400 (Fri, 14 Oct 2011)
New Revision: 35672
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/persistence/CDIPersistenceConstants.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/persistence/CDISeamPersistenceExtension.java
Log:
JBIDE-9852
https://issues.jboss.org/browse/JBIDE-9852
Seam persistence updated according to migration of solder to 3.1.
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/persistence/CDIPersistenceConstants.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/persistence/CDIPersistenceConstants.java 2011-10-14
17:07:06 UTC (rev 35671)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/persistence/CDIPersistenceConstants.java 2011-10-14
17:07:21 UTC (rev 35672)
@@ -16,7 +16,8 @@
*
*/
public interface CDIPersistenceConstants {
- public String EXTENSION_MANAGED_ANNOTATION_TYPE_NAME =
"org.jboss.seam.solder.core.ExtensionManaged";
+ public String EXTENSION_MANAGED_ANNOTATION_TYPE_NAME =
"org.jboss.solder.core.ExtensionManaged";
+ public String EXTENSION_MANAGED_ANNOTATION_TYPE_NAME_30 =
"org.jboss.seam.solder.core.ExtensionManaged";
public String ENTITY_MANAGER_FACTORY_TYPE_NAME =
"javax.persistence.EntityManagerFactory";
public String ENTITY_MANAGER_TYPE_NAME = "javax.persistence.EntityManager";
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/persistence/CDISeamPersistenceExtension.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/persistence/CDISeamPersistenceExtension.java 2011-10-14
17:07:06 UTC (rev 35671)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/persistence/CDISeamPersistenceExtension.java 2011-10-14
17:07:21 UTC (rev 35672)
@@ -19,7 +19,6 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.CDIConstants;
-import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.IProducer;
import org.jboss.tools.cdi.core.extension.AbstractDefinitionContextExtension;
import org.jboss.tools.cdi.core.extension.ICDIExtension;
@@ -28,12 +27,12 @@
import org.jboss.tools.cdi.internal.core.impl.BeanMember;
import org.jboss.tools.cdi.internal.core.impl.CDIProject;
import org.jboss.tools.cdi.internal.core.impl.ClassBean;
-import org.jboss.tools.cdi.internal.core.impl.definition.BeanMemberDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.FieldDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.MethodDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
import org.jboss.tools.cdi.internal.core.scanner.FileSet;
import org.jboss.tools.cdi.seam.core.CDISeamCorePlugin;
+import org.jboss.tools.common.java.IAnnotated;
import org.jboss.tools.common.java.ParametedType;
import org.jboss.tools.common.java.TypeDeclaration;
import org.jboss.tools.common.model.XModelObject;
@@ -102,7 +101,7 @@
bean.setDefinition(def);
Set<IProducer> ps = bean.getProducers();
for (IProducer p: ps) {
- if(p.getAnnotation(CDIPersistenceConstants.EXTENSION_MANAGED_ANNOTATION_TYPE_NAME) !=
null) {
+ if(isArtefact(p)) {
BeanMember m = (BeanMember)p;
TypeDeclaration d = m.getTypeDeclaration();
@@ -140,9 +139,10 @@
return false;
}
- boolean isArtefact(BeanMemberDefinition m) {
- return m.isAnnotationPresent(CDIConstants.PRODUCES_ANNOTATION_TYPE_NAME)
- &&
m.isAnnotationPresent(CDIPersistenceConstants.EXTENSION_MANAGED_ANNOTATION_TYPE_NAME);
+ boolean isArtefact(IAnnotated m) {
+ return (m instanceof IProducer ||
m.isAnnotationPresent(CDIConstants.PRODUCES_ANNOTATION_TYPE_NAME))
+ &&
(m.isAnnotationPresent(CDIPersistenceConstants.EXTENSION_MANAGED_ANNOTATION_TYPE_NAME)
+ ||
m.isAnnotationPresent(CDIPersistenceConstants.EXTENSION_MANAGED_ANNOTATION_TYPE_NAME_30));
}
private ParametedType getType(String name, CDIProject project) {