Author: vyemialyanchyk
Date: 2008-10-29 08:50:58 -0400 (Wed, 29 Oct 2008)
New Revision: 11279
Modified:
branches/jbosstools-3.0.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java
Log:
fix: ignore EnumDeclaration & AnnotationTypeDeclaration
Modified:
branches/jbosstools-3.0.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java 2008-10-29
12:12:15 UTC (rev 11278)
+++
branches/jbosstools-3.0.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java 2008-10-29
12:50:58 UTC (rev 11279)
@@ -17,6 +17,7 @@
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.EntityInfo;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.JPAConst;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.RefEntityInfo;
@@ -333,6 +334,16 @@
return;
}
org.eclipse.jdt.core.dom.CompilationUnit cu = Utils.getCompilationUnit(icu, true);
+ if (cu == null) {
+ return;
+ }
+ if (cu.types() != null && cu.types().size() > 0 ) {
+ Object tmp = cu.types().get(0);
+ if (!(tmp instanceof TypeDeclaration)) {
+ // ignore EnumDeclaration & AnnotationTypeDeclaration
+ return;
+ }
+ }
String fullyQualifiedName =
cu.getTypeRoot().findPrimaryType().getFullyQualifiedName();
if (mapCUs_Info.containsKey(fullyQualifiedName)) {
return;
Show replies by date