package org.jboss.forge.addon.parser.java.beans;

import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;

import org.jboss.forge.addon.parser.java.facets.JavaSourceFacet;
import org.jboss.forge.addon.parser.java.resources.JavaResource;
import org.jboss.forge.addon.parser.java.resources.JavaResourceVisitor;
import org.jboss.forge.addon.projects.Project;
import org.jboss.forge.addon.resource.visit.VisitContext;
import org.jboss.forge.roaster.model.source.JavaSource;

public class ProjectOperations
{
   public List<JavaResource> getProjectClasses(Project project)
   {
      final List<JavaResource> classes = new ArrayList<>();
      if (project != null)
      {
         project.getFacet(JavaSourceFacet.class).visitJavaSources(new JavaResourceVisitor()
         {

            @Override
            public void visit(VisitContext context, JavaResource resource)
            {
               try
               {
                  JavaSource<?> javaType = resource.getJavaType();
                  if (javaType.isClass())
                  {
                     classes.add(resource);
                  }
               }
               catch (FileNotFoundException e)
               {
                  // ignore
               }
            }
         });
      }
      return classes;

   }
}

@@ -497,16 +497,100 @@
 ource;%0A%0A
+/**%0A * @author %3Ca href=%22mailto:lincolnbaxter@gmail.com%22%3ELincoln Baxter, III%3C/a%3E%0A */%0A
 public c
@@ -848,27 +848,30 @@
 ces(new Java
-Res
+ClassS
 ourceVisitor
@@ -875,28 +875,302 @@
 tor(
-)%0A
+classes));%0A 
     
+ %7D%0A
      
-%7B%0A
+ return classes;%0A   %7D
 %0A   
+%0A
    
+private static class JavaClassSourceVisitor extends JavaResourceVisitor%0A   %7B%0A      private final List%3CJavaResource%3E classes;%0A%0A      private JavaClassSourceVisitor(List%3CJavaResource%3E classes)%0A      %7B%0A         this.classes = classes;%0A      %7D%0A%0A
     
@@ -1181,22 +1181,16 @@
 verride%0A
-      
       pu
@@ -1252,30 +1252,24 @@
 urce)%0A      
- 
-     
 %7B%0A          
@@ -1267,22 +1267,16 @@
         
- 
-     
 try%0A    
@@ -1276,38 +1276,26 @@
 ry%0A         
- 
-     %7B%0A      
+%7B%0A
             
@@ -1355,22 +1355,16 @@
         
-  
-    
 if (java
@@ -1387,35 +1387,26 @@
             
-      %7B%0A   
+%7B%0A
             
@@ -1408,19 +1408,16 @@
         
-   
 classes.
@@ -1447,39 +1447,16 @@
     
-      %7D%0A               
 %7D%0A      
     
@@ -1447,24 +1447,29 @@
     %7D%0A      
+   %7D%0A
          cat
@@ -1502,38 +1502,26 @@
 e)%0A         
-     
- 
 %7B%0A
-      
             
@@ -1543,30 +1543,18 @@
     
-     
- 
 %7D%0A
-      
       %7D%0A
     
@@ -1553,52 +1553,8 @@
   %7D%0A
-         %7D);%0A      %7D%0A      return classes;%0A%0A
    %7D

Fix CDI explosions. Weld doesn't like Anonmymous classes sometimes for some reason?