Author: scabanovich
Date: 2011-09-15 17:52:12 -0400 (Thu, 15 Sep 2011)
New Revision: 34789
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java
Log:
Anonymous types and non-static inner types should not be loaded as CDI beans.
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java 2011-09-15
21:19:44 UTC (rev 34788)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java 2011-09-15
21:52:12 UTC (rev 34789)
@@ -38,6 +38,12 @@
allpaths.add(path);
if(!checkType(type, path)) {
//do nothing, bug JDT
+ } else if(type.isAnonymous()) {
+ //is not bean
+ } else if(type.getDeclaringType() != null && !Flags.isStatic(type.getFlags()))
{
+ //is not bean
+ } else if(type.getFullyQualifiedName().indexOf('$') > 0 &&
!Flags.isStatic(type.getFlags())) {
+ //is not bean
} else if(type.isAnnotation()) {
add(annotations, path, type);
} else if(type.isInterface()) {