incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1050445 [1/3] - in /incubator/isis/trunk: core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/ core/metamodel/src/main/java/org/apache/isis/core/metamodel/java5/ core/metamodel/src/main/java/org/apache/isis/core/metamodel/sp...
Date Fri, 17 Dec 2010 16:40:08 GMT
Author: danhaywood
Date: Fri Dec 17 16:40:06 2010
New Revision: 1050445

URL: http://svn.apache.org/viewvc?rev=1050445&view=rev
Log:
tidying up public API, removal of arrays in return types (ISIS-58)

Added:
    incubator/isis/trunk/src/docbkx/guide/images/soyatec-eclipse35-install-1.png
      - copied unchanged from r1049824, incubator/isis/trunk/src/docbkx/guide/images/soyatec-install-1.png
    incubator/isis/trunk/src/docbkx/guide/images/soyatec-eclipse35-install-2.png
      - copied unchanged from r1049824, incubator/isis/trunk/src/docbkx/guide/images/soyatec-install-2.png
Removed:
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/InterfaceBasedFacetFactory.java
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/java5/AnnotationBasedFacetFactory.java
    incubator/isis/trunk/src/docbkx/guide/images/soyatec-install-1.png
    incubator/isis/trunk/src/docbkx/guide/images/soyatec-install-2.png
Modified:
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetFactory.java
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetFactoryAbstract.java
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/java5/AnnotationBasedFacetFactoryAbstract.java
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectFeatureType.java
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/internal/facetprocessor/FacetProcessor.java
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/internal/introspector/MethodFinderUtils.java
    incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/MethodPrefixBasedFacetFactoryAbstract.java
    incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/PropertyOrCollectionIdentifyingFacetFactoryAbstract.java
    incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/SyntheticMethodFilteringFacetFactory.java
    incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/SimpleOrderSet.java
    incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/memberorder/DeweyOrderSet.java
    incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/specloader/internal/introspector/JavaIntrospector.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/AbstractFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/Utils.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actcoll/typeof/TypeOfAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/ActionMethodsFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/IteratorFilteringFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/executed/ExecutedAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notinrepositorymenu/NotInRepositoryMenuAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/collections/CollectionFieldMethodsFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/disable/DisabledAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/hide/HiddenAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/naming/describedas/DescribedAsAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/naming/named/NamedAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/aggregated/AggregatedAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/bounded/BoundedAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/bounded/BoundedMarkerInterfaceFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/CreatedCallbackFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/DeleteCallbackFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/LoadCallbackFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/PersistCallbackFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/RemoveCallbackFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/SaveCallbackFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/UpdateCallbackFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/defaults/DefaultedFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/dirty/DirtyMethodsFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/encodable/EncodableFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/facets/FacetsAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconMethodFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralMethodFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/singular/SingularMethodFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleMethodFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableMarkerInterfaceFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableMarkerInterfaceFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/validate/ObjectValidMethodFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/value/ValueFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/ordering/actionorder/ActionOrderAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/ordering/fieldorder/FieldOrderAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/ordering/memberorder/DeweyOrderSetTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/ordering/memberorder/MemberOrderAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propcoll/notpersisted/NotPersistedAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/properties/PropertyFieldMethodsFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/multiline/MultiLineAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/typicallength/TypicalLengthAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mandatory/OptionalAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mask/MaskAnnotationFacetFactoryTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/RegExAnnotationFacetFactoryTest.java
    incubator/isis/trunk/examples/metamodel-examples/namefile/src/main/java/org/apache/isis/metamodel/examples/facets/namefile/NameFileFacetFactory.java
    incubator/isis/trunk/examples/metamodel-examples/namefile/src/test/java/org/apache/isis/metamodel/examples/facets/namefile/NameFileFacetFactoryFeatureTypesTest.java

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetFactory.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetFactory.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetFactory.java Fri Dec 17 16:40:06 2010
@@ -21,8 +21,9 @@
 package org.apache.isis.core.metamodel.facets;
 
 
-import java.lang.reflect.Method;
-
+import java.lang.reflect.Method;
+import java.util.List;
+
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
 
 
@@ -35,7 +36,7 @@ public interface FacetFactory {
      * Used by the Java5 Reflector's <tt>ProgrammingModel</tt> to reduce the number of {@link FacetFactory factory}s that are
      * queried when building up the meta-model.
      */
-    ObjectFeatureType[] getFeatureTypes();
+    List<ObjectFeatureType> getFeatureTypes();
 
     /**
      * Process the class, and return the correctly setup annotation if present.

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetFactoryAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetFactoryAbstract.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetFactoryAbstract.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetFactoryAbstract.java Fri Dec 17 16:40:06 2010
@@ -21,8 +21,11 @@
 package org.apache.isis.core.metamodel.facets;
 
 
-import java.lang.reflect.Method;
-
+import java.lang.reflect.Method;
+import java.util.List;
+
+import com.google.common.collect.ImmutableList;
+
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
 import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
 import org.apache.isis.core.metamodel.specloader.SpecificationLoaderAware;
@@ -30,26 +33,30 @@ import org.apache.isis.core.metamodel.sp
 
 public abstract class FacetFactoryAbstract implements FacetFactory, SpecificationLoaderAware {
 
-    private final ObjectFeatureType[] featureTypes;
+    private final List<ObjectFeatureType> featureTypes;
     
     private SpecificationLoader specificationLoader;
 
-    public FacetFactoryAbstract(final ObjectFeatureType[] featureTypes) {
-        this.featureTypes = featureTypes;
+    public FacetFactoryAbstract(final List<ObjectFeatureType> featureTypes) {
+        this.featureTypes = ImmutableList.copyOf(featureTypes);
     }
 
-    public ObjectFeatureType[] getFeatureTypes() {
+    @Override
+    public List<ObjectFeatureType> getFeatureTypes() {
         return featureTypes;
     }
 
+    @Override
     public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
         return false;
     }
 
+    @Override
     public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover, final FacetHolder holder) {
         return false;
     }
 
+    @Override
     public boolean processParams(final Method method, final int paramNum, final FacetHolder holder) {
         return false;
     }
@@ -66,6 +73,7 @@ public abstract class FacetFactoryAbstra
     /**
      * Injected
      */
+    @Override
     public void setSpecificationLoader(final SpecificationLoader specificationLoader) {
         this.specificationLoader = specificationLoader;
     }

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/java5/AnnotationBasedFacetFactoryAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/java5/AnnotationBasedFacetFactoryAbstract.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/java5/AnnotationBasedFacetFactoryAbstract.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/java5/AnnotationBasedFacetFactoryAbstract.java Fri Dec 17 16:40:06 2010
@@ -22,15 +22,16 @@ package org.apache.isis.core.metamodel.j
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
+import java.util.List;
 
 import org.apache.isis.core.metamodel.facets.FacetFactory;
 import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
 
 
-public abstract class AnnotationBasedFacetFactoryAbstract extends FacetFactoryAbstract implements AnnotationBasedFacetFactory {
+public abstract class AnnotationBasedFacetFactoryAbstract extends FacetFactoryAbstract {
 
-    public AnnotationBasedFacetFactoryAbstract(final ObjectFeatureType[] featureTypes) {
+    public AnnotationBasedFacetFactoryAbstract(final List<ObjectFeatureType> featureTypes) {
         super(featureTypes);
     }
 

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectFeatureType.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectFeatureType.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectFeatureType.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectFeatureType.java Fri Dec 17 16:40:06 2010
@@ -20,6 +20,10 @@
 
 package org.apache.isis.core.metamodel.spec.feature;
 
+import java.util.List;
+
+import com.google.common.collect.ImmutableList;
+
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 
 
@@ -43,27 +47,27 @@ public final class ObjectFeatureType {
     public final static ObjectFeatureType ACTION = new ObjectFeatureType(3, "Action");
     public final static ObjectFeatureType ACTION_PARAMETER = new ObjectFeatureType(4, "Parameter");
 
-    public final static ObjectFeatureType[] COLLECTIONS_ONLY = new ObjectFeatureType[] { COLLECTION };
-    public final static ObjectFeatureType[] ACTIONS_ONLY = new ObjectFeatureType[] { ACTION };
-    public final static ObjectFeatureType[] PARAMETERS_ONLY = new ObjectFeatureType[] { ACTION_PARAMETER };
-    public final static ObjectFeatureType[] ACTIONS_AND_PARAMETERS = new ObjectFeatureType[] { ACTION, ACTION_PARAMETER };
-    public final static ObjectFeatureType[] COLLECTIONS_AND_ACTIONS = new ObjectFeatureType[] { COLLECTION, ACTION };
-    public final static ObjectFeatureType[] PROPERTIES_AND_PARAMETERS = new ObjectFeatureType[] { PROPERTY,
-            ACTION_PARAMETER };
-    public final static ObjectFeatureType[] OBJECTS_PROPERTIES_AND_PARAMETERS = new ObjectFeatureType[] { OBJECT,
-            PROPERTY, ACTION_PARAMETER };
-    public final static ObjectFeatureType[] OBJECTS_AND_PROPERTIES = new ObjectFeatureType[] { OBJECT, PROPERTY };
-    public final static ObjectFeatureType[] PROPERTIES_ONLY = new ObjectFeatureType[] { PROPERTY };
-    public final static ObjectFeatureType[] OBJECTS_ONLY = new ObjectFeatureType[] { OBJECT };
-    public final static ObjectFeatureType[] OBJECTS_PROPERTIES_AND_COLLECTIONS = new ObjectFeatureType[] { OBJECT,
-            PROPERTY, COLLECTION };
-    public final static ObjectFeatureType[] PROPERTIES_AND_COLLECTIONS = new ObjectFeatureType[] { PROPERTY, COLLECTION };
-    public final static ObjectFeatureType[] PROPERTIES_COLLECTIONS_AND_ACTIONS = new ObjectFeatureType[] { PROPERTY,
-            COLLECTION, ACTION };
-    public final static ObjectFeatureType[] EVERYTHING_BUT_PARAMETERS = new ObjectFeatureType[] { OBJECT, PROPERTY,
-            COLLECTION, ACTION };
-    public final static ObjectFeatureType[] EVERYTHING = new ObjectFeatureType[] { OBJECT, PROPERTY, COLLECTION,
-            ACTION, ACTION_PARAMETER };
+    public final static List<ObjectFeatureType> COLLECTIONS_ONLY = ImmutableList.of( COLLECTION );
+    public final static List<ObjectFeatureType> ACTIONS_ONLY = ImmutableList.of( ACTION );
+    public final static List<ObjectFeatureType> PARAMETERS_ONLY = ImmutableList.of( ACTION_PARAMETER );
+    public final static List<ObjectFeatureType> ACTIONS_AND_PARAMETERS = ImmutableList.of( ACTION, ACTION_PARAMETER );
+    public final static List<ObjectFeatureType> COLLECTIONS_AND_ACTIONS = ImmutableList.of( COLLECTION, ACTION );
+    public final static List<ObjectFeatureType> PROPERTIES_AND_PARAMETERS = ImmutableList.of( PROPERTY,
+            ACTION_PARAMETER );
+    public final static List<ObjectFeatureType> OBJECTS_PROPERTIES_AND_PARAMETERS = ImmutableList.of( OBJECT,
+            PROPERTY, ACTION_PARAMETER );
+    public final static List<ObjectFeatureType> OBJECTS_AND_PROPERTIES = ImmutableList.of( OBJECT, PROPERTY );
+    public final static List<ObjectFeatureType> PROPERTIES_ONLY = ImmutableList.of( PROPERTY );
+    public final static List<ObjectFeatureType> OBJECTS_ONLY = ImmutableList.of( OBJECT );
+    public final static List<ObjectFeatureType> OBJECTS_PROPERTIES_AND_COLLECTIONS = ImmutableList.of( OBJECT,
+            PROPERTY, COLLECTION );
+    public final static List<ObjectFeatureType> PROPERTIES_AND_COLLECTIONS = ImmutableList.of( PROPERTY, COLLECTION );
+    public final static List<ObjectFeatureType> PROPERTIES_COLLECTIONS_AND_ACTIONS = ImmutableList.of( PROPERTY,
+            COLLECTION, ACTION );
+    public final static List<ObjectFeatureType> EVERYTHING_BUT_PARAMETERS = ImmutableList.of( OBJECT, PROPERTY,
+            COLLECTION, ACTION );
+    public final static List<ObjectFeatureType> EVERYTHING = ImmutableList.of(OBJECT, PROPERTY, COLLECTION,
+            ACTION, ACTION_PARAMETER);
 
     private final int num;
     private final String name;

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/internal/facetprocessor/FacetProcessor.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/internal/facetprocessor/FacetProcessor.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/internal/facetprocessor/FacetProcessor.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/internal/facetprocessor/FacetProcessor.java Fri Dec 17 16:40:06 2010
@@ -74,17 +74,23 @@ public class FacetProcessor implements R
      * All method prefixes to check in {@link #recognizes(Method)}.
      * 
      * <p>
-     * Derived from factories that implement {@link MethodPrefixBasedFacetFactory}.
+     * Derived from factories that implement {@link MethodPrefixBasedFacetFactory}.
+     * 
+     * <p>
+     * If <tt>null</tt>, indicates that the cache hasn't been built.
      */
-    private List<String> methodPrefixes;
+    private List<String> cachedMethodPrefixes;
 
     /**
      * All registered {@link FacetFactory factories} that implement {@link MethodFilteringFacetFactory}.
      * 
      * <p>
      * Used within {@link #recognizes(Method)}.
+     * 
+     * <p>
+     * If <tt>null</tt>, indicates that the cache hasn't been built.
      */
-    private List<MethodFilteringFacetFactory> methodFilteringFactories;
+    private List<MethodFilteringFacetFactory> cachedMethodFilteringFactories;
 
     /**
      * All registered {@link FacetFactory factories} that implement
@@ -92,8 +98,11 @@ public class FacetProcessor implements R
      * 
      * <p>
      * Used within {@link #recognizes(Method)}.
+     * 
+     * <p>
+     * If <tt>null</tt>, indicates that the cache hasn't been built.
      */
-    private List<PropertyOrCollectionIdentifyingFacetFactory> propertyOrCollectionIdentifyingFactories;
+    private List<PropertyOrCollectionIdentifyingFacetFactory> cachedPropertyOrCollectionIdentifyingFactories;
 
     /**
      * ObjectFeatureType => List<FacetFactory>
@@ -170,14 +179,13 @@ public class FacetProcessor implements R
      * <p>
      * Delegates to all known {@link PropertyOrCollectionIdentifyingFacetFactory}s.
      */
-    public Set<Method> findPropertyOrCollectionCandidateAccessors(final Method[] methods, final Set<Method> candidates) {
+    public Set<Method> findPropertyOrCollectionCandidateAccessors(final List<Method> methods, final Set<Method> candidates) {
         cachePropertyOrCollectionIdentifyingFacetFactoriesIfRequired();
-        for (int i = 0; i < methods.length; i++) {
-            final Method method = methods[i];
+        for (Method method: methods) {
             if (method == null) {
                 continue;
             }
-            for (final PropertyOrCollectionIdentifyingFacetFactory facetFactory : propertyOrCollectionIdentifyingFactories) {
+            for (final PropertyOrCollectionIdentifyingFacetFactory facetFactory : cachedPropertyOrCollectionIdentifyingFactories) {
                 if (facetFactory.isPropertyOrCollectionAccessorCandidate(method)) {
                     candidates.add(method);
                 }
@@ -199,7 +207,7 @@ public class FacetProcessor implements R
      *      List)
      */
     public void findAndRemovePropertyAccessors(final MethodRemover methodRemover, final List<Method> methodListToAppendTo) {
-        for (final PropertyOrCollectionIdentifyingFacetFactory facetFactory : propertyOrCollectionIdentifyingFactories) {
+        for (final PropertyOrCollectionIdentifyingFacetFactory facetFactory : cachedPropertyOrCollectionIdentifyingFactories) {
             facetFactory.findAndRemovePropertyAccessors(methodRemover, methodListToAppendTo);
         }
     }
@@ -213,7 +221,7 @@ public class FacetProcessor implements R
      */
     public void findAndRemoveCollectionAccessors(final MethodRemover methodRemover, final List<Method> methodListToAppendTo) {
         cachePropertyOrCollectionIdentifyingFacetFactoriesIfRequired();
-        for (final PropertyOrCollectionIdentifyingFacetFactory facetFactory : propertyOrCollectionIdentifyingFactories) {
+        for (final PropertyOrCollectionIdentifyingFacetFactory facetFactory : cachedPropertyOrCollectionIdentifyingFactories) {
             facetFactory.findAndRemoveCollectionAccessors(methodRemover, methodListToAppendTo);
         }
     }
@@ -238,14 +246,14 @@ public class FacetProcessor implements R
     public boolean recognizes(final Method method) {
         cacheMethodPrefixesIfRequired();
         final String methodName = method.getName();
-        for (final String prefix : methodPrefixes) {
+        for (final String prefix : cachedMethodPrefixes) {
             if (methodName.startsWith(prefix)) {
                 return true;
             }
         }
 
         cacheMethodFilteringFacetFactoriesIfRequired();
-        for (final MethodFilteringFacetFactory factory : methodFilteringFactories) {
+        for (final MethodFilteringFacetFactory factory : cachedMethodFilteringFactories) {
             if (factory.recognizes(method)) {
                 return true;
             }
@@ -347,9 +355,9 @@ public class FacetProcessor implements R
 
     private void clearCaches() {
         factoryListByFeatureType = null;
-        methodPrefixes = null;
-        methodFilteringFactories = null;
-        propertyOrCollectionIdentifyingFactories = null;
+        cachedMethodPrefixes = null;
+        cachedMethodFilteringFactories = null;
+        cachedPropertyOrCollectionIdentifyingFactories = null;
     }
 
     private synchronized void cacheByFeatureTypeIfRequired() {
@@ -358,51 +366,51 @@ public class FacetProcessor implements R
         }
         factoryListByFeatureType = new HashMap<ObjectFeatureType, List<FacetFactory>>();
         for (final FacetFactory factory : factories) {
-            final ObjectFeatureType[] featureTypes = factory.getFeatureTypes();
-            for (int i = 0; i < featureTypes.length; i++) {
-                final List<FacetFactory> factoryList = getList(factoryListByFeatureType, featureTypes[i]);
+            final List<ObjectFeatureType> featureTypes = factory.getFeatureTypes();
+            for (ObjectFeatureType featureType: featureTypes) {
+                final List<FacetFactory> factoryList = getList(factoryListByFeatureType, featureType);
                 factoryList.add(factory);
             }
         }
     }
 
     private synchronized void cacheMethodPrefixesIfRequired() {
-        if (methodPrefixes != null) {
+        if (cachedMethodPrefixes != null) {
             return;
         }
-        methodPrefixes = new ArrayList<String>();
+        cachedMethodPrefixes = new ArrayList<String>();
         for (final FacetFactory facetFactory : factories) {
             if (facetFactory instanceof MethodPrefixBasedFacetFactory) {
                 final MethodPrefixBasedFacetFactory methodPrefixBasedFacetFactory = (MethodPrefixBasedFacetFactory) facetFactory;
-                ListUtils.combine(methodPrefixes, methodPrefixBasedFacetFactory.getPrefixes());
+                ListUtils.combine(cachedMethodPrefixes, methodPrefixBasedFacetFactory.getPrefixes());
             }
         }
     }
 
     private synchronized void cacheMethodFilteringFacetFactoriesIfRequired() {
-        if (methodFilteringFactories != null) {
+        if (cachedMethodFilteringFactories != null) {
             return;
         }
-        methodFilteringFactories = new ArrayList<MethodFilteringFacetFactory>();
+        cachedMethodFilteringFactories = new ArrayList<MethodFilteringFacetFactory>();
         for (final FacetFactory factory : factories) {
             if (factory instanceof MethodFilteringFacetFactory) {
                 final MethodFilteringFacetFactory methodFilteringFacetFactory = (MethodFilteringFacetFactory) factory;
-                methodFilteringFactories.add(methodFilteringFacetFactory);
+                cachedMethodFilteringFactories.add(methodFilteringFacetFactory);
             }
         }
     }
 
     private synchronized void cachePropertyOrCollectionIdentifyingFacetFactoriesIfRequired() {
-        if (propertyOrCollectionIdentifyingFactories != null) {
+        if (cachedPropertyOrCollectionIdentifyingFactories != null) {
             return;
         }
-        propertyOrCollectionIdentifyingFactories = new ArrayList<PropertyOrCollectionIdentifyingFacetFactory>();
+        cachedPropertyOrCollectionIdentifyingFactories = new ArrayList<PropertyOrCollectionIdentifyingFacetFactory>();
         final Iterator<FacetFactory> iter = factories.iterator();
         while (iter.hasNext()) {
             final FacetFactory factory = iter.next();
             if (factory instanceof PropertyOrCollectionIdentifyingFacetFactory) {
                 final PropertyOrCollectionIdentifyingFacetFactory identifyingFacetFactory = (PropertyOrCollectionIdentifyingFacetFactory) factory;
-                propertyOrCollectionIdentifyingFactories.add(identifyingFacetFactory);
+                cachedPropertyOrCollectionIdentifyingFactories.add(identifyingFacetFactory);
             }
         }
     }
@@ -448,7 +456,8 @@ public class FacetProcessor implements R
      * Injected so can propogate to any {@link #registerFactory(FacetFactory) registered} {@link FacetFactory}
      * s that are also {@link RuntimeContextAware}.
      */
-	public void setRuntimeContext(RuntimeContext runtimeContext) {
+	@Override
+    public void setRuntimeContext(RuntimeContext runtimeContext) {
 		this.runtimeContext = runtimeContext;
 	}
 

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/internal/introspector/MethodFinderUtils.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/internal/introspector/MethodFinderUtils.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/internal/introspector/MethodFinderUtils.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/internal/introspector/MethodFinderUtils.java Fri Dec 17 16:40:06 2010
@@ -20,13 +20,13 @@
 
 package org.apache.isis.core.metamodel.specloader.internal.introspector;
 
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.isis.core.commons.lang.JavaClassUtils;
 import org.apache.isis.core.commons.lang.WrapperUtils;
 import org.apache.isis.core.metamodel.facets.MethodScope;
@@ -78,17 +78,17 @@ public final class MethodFinderUtils {
      * @return Method
      */
     public static Method removeMethod(
-            final Method[] methods,
+            final List<Method> methods,
             final MethodScope methodScope,
             final String name,
             final Class<?> returnType,
             final Class<?>[] paramTypes) {
-        method: for (int i = 0; i < methods.length; i++) {
-            if (methods[i] == null) {
+        method: for (int i = 0; i < methods.size(); i++) {
+            if (methods.get(i) == null) {
                 continue;
             }
 
-            final Method method = methods[i];
+            final Method method = methods.get(i);
             final int modifiers = method.getModifiers();
 
             // check for public modifier
@@ -124,7 +124,7 @@ public final class MethodFinderUtils {
                     }
                 }
             }
-            methods[i] = null;
+            methods.set(i, null);
 
             return method;
         }
@@ -161,7 +161,7 @@ public final class MethodFinderUtils {
      * @return Method
      */
     public static List<Method> removeMethods(
-            final Method[] methods,
+            final List<Method> methods,
             final MethodScope forClass,
             final String prefix,
             final Class<?> returnType,
@@ -170,12 +170,12 @@ public final class MethodFinderUtils {
 
         final List<Method> validMethods = new ArrayList<Method>();
 
-        for (int i = 0; i < methods.length; i++) {
-            if (methods[i] == null) {
+        for (int i = 0; i < methods.size(); i++) {
+            if (methods.get(i) == null) {
                 continue;
             }
 
-            final Method method = methods[i];
+            final Method method = methods.get(i);
 
             if (!inScope(forClass, method)) {
                 continue;
@@ -189,7 +189,7 @@ public final class MethodFinderUtils {
 
             if (goodPrefix && goodCount && goodReturn) {
                 validMethods.add(method);
-                methods[i] = null;
+                methods.set(i, null);
             }
         }
         return validMethods;

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/MethodPrefixBasedFacetFactoryAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/MethodPrefixBasedFacetFactoryAbstract.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/MethodPrefixBasedFacetFactoryAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/MethodPrefixBasedFacetFactoryAbstract.java Fri Dec 17 16:40:06 2010
@@ -20,11 +20,11 @@
 
 package org.apache.isis.core.progmodel.facets;
 
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.List;
-
-import org.apache.isis.applib.security.UserMemento;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.List;
+
+import org.apache.isis.applib.security.UserMemento;
 import org.apache.isis.core.commons.lang.ListUtils;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
@@ -69,11 +69,12 @@ public abstract class MethodPrefixBasedF
 
     private final List<String> prefixes;
 
-    public MethodPrefixBasedFacetFactoryAbstract(final String[] prefixes, final ObjectFeatureType[] featureTypes) {
+    public MethodPrefixBasedFacetFactoryAbstract(final String[] prefixes, final List<ObjectFeatureType> featureTypes) {
         super(featureTypes);
         this.prefixes = ListUtils.combine(prefixes, PREFIXES);
     }
 
+    @Override
     public List<String> getPrefixes() {
         return prefixes;
     }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/PropertyOrCollectionIdentifyingFacetFactoryAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/PropertyOrCollectionIdentifyingFacetFactoryAbstract.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/PropertyOrCollectionIdentifyingFacetFactoryAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/PropertyOrCollectionIdentifyingFacetFactoryAbstract.java Fri Dec 17 16:40:06 2010
@@ -20,6 +20,8 @@
 
 package org.apache.isis.core.progmodel.facets;
 
+import java.util.List;
+
 import org.apache.isis.core.metamodel.facets.FacetFactory;
 import org.apache.isis.core.metamodel.facets.PropertyOrCollectionIdentifyingFacetFactory;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
@@ -34,7 +36,7 @@ public abstract class PropertyOrCollecti
 
     public PropertyOrCollectionIdentifyingFacetFactoryAbstract(
             final String[] prefixes,
-            final ObjectFeatureType[] featureTypes) {
+            final List<ObjectFeatureType> featureTypes) {
         super(prefixes, featureTypes);
     }
 
@@ -54,6 +56,7 @@ public abstract class PropertyOrCollecti
      * Injected so can propogate to any {@link #registerFactory(FacetFactory) registered} {@link FacetFactory}
      * s that are also {@link CollectionTypeRegistryAware}.
      */
+    @Override
     public void setCollectionTypeRegistry(final CollectionTypeRegistry collectionTypeRegistry) {
         this.collectionTypeRegistry = collectionTypeRegistry;
     }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/SyntheticMethodFilteringFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/SyntheticMethodFilteringFacetFactory.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/SyntheticMethodFilteringFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/SyntheticMethodFilteringFacetFactory.java Fri Dec 17 16:40:06 2010
@@ -20,8 +20,9 @@
 
 package org.apache.isis.core.progmodel.facets.actions;
 
-import java.lang.reflect.Method;
-
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
@@ -38,9 +39,10 @@ import org.apache.isis.core.metamodel.sp
 public class SyntheticMethodFilteringFacetFactory extends FacetFactoryAbstract implements MethodFilteringFacetFactory {
 
     public SyntheticMethodFilteringFacetFactory() {
-        super(new ObjectFeatureType[0]);
+        super(new ArrayList<ObjectFeatureType>());
     }
 
+    @Override
     public boolean recognizes(final Method method) {
         return isSynthetic(method);
     }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/SimpleOrderSet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/SimpleOrderSet.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/SimpleOrderSet.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/SimpleOrderSet.java Fri Dec 17 16:40:06 2010
@@ -20,6 +20,7 @@
 
 package org.apache.isis.core.progmodel.facets.ordering;
 
+import java.util.List;
 import java.util.StringTokenizer;
 
 import org.apache.isis.core.metamodel.specloader.internal.peer.ObjectMemberPeer;
@@ -27,7 +28,7 @@ import org.apache.isis.core.metamodel.ut
 
 
 public class SimpleOrderSet extends OrderSet {
-    public static SimpleOrderSet createOrderSet(final String order, final ObjectMemberPeer[] members) {
+    public static SimpleOrderSet createOrderSet(final String order, final List<ObjectMemberPeer> members) {
         SimpleOrderSet set = new SimpleOrderSet(members);
 
         final StringTokenizer st = new StringTokenizer(order, ",");
@@ -57,9 +58,9 @@ public class SimpleOrderSet extends Orde
     }
 
     private final SimpleOrderSet parent;
-    private final ObjectMemberPeer[] members;
+    private final List<ObjectMemberPeer> members;
 
-    private SimpleOrderSet(final ObjectMemberPeer[] members) {
+    private SimpleOrderSet(final List<ObjectMemberPeer> members) {
         super("");
         this.members = members;
         parent = null;
@@ -69,7 +70,7 @@ public class SimpleOrderSet extends Orde
             final SimpleOrderSet set,
             final String groupName,
             final String name,
-            final ObjectMemberPeer[] members) {
+            final List<ObjectMemberPeer> members) {
         super(groupName);
         parent = set;
         parent.addElement(this);
@@ -85,9 +86,10 @@ public class SimpleOrderSet extends Orde
     }
 
     private void addAnyRemainingMember() {
-        for (int i = 0; i < members.length; i++) {
-            if (members[i] != null) {
-                addElement(members[i]);
+        for (int i = 0; i < members.size(); i++) {
+            if (members.get(i) != null) {
+                ObjectMemberPeer member = members.get(i);
+                addElement(member);
             }
         }
 
@@ -99,12 +101,12 @@ public class SimpleOrderSet extends Orde
 
     private ObjectMemberPeer getMemberWithName(final String name) {
         final String searchName = NameUtils.simpleName(name);
-        for (int i = 0; i < members.length; i++) {
-            final ObjectMemberPeer member = members[i];
+        for (int i = 0; i < members.size(); i++) {
+            final ObjectMemberPeer member = members.get(i);
             if (member != null) {
                 final String testName = NameUtils.simpleName(member.getIdentifier().getMemberName());
                 if (testName.equals(searchName)) {
-                    members[i] = null;
+                    members.set(i, null);
                     return member;
                 }
             }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/memberorder/DeweyOrderSet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/memberorder/DeweyOrderSet.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/memberorder/DeweyOrderSet.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/memberorder/DeweyOrderSet.java Fri Dec 17 16:40:06 2010
@@ -21,6 +21,7 @@
 package org.apache.isis.core.progmodel.facets.ordering.memberorder;
 
 import java.util.Iterator;
+import java.util.List;
 import java.util.Set;
 import java.util.SortedMap;
 import java.util.SortedSet;
@@ -65,15 +66,14 @@ import org.apache.isis.core.progmodel.fa
  * 
  */
 public class DeweyOrderSet extends OrderSet {
-    public static DeweyOrderSet createOrderSet(final ObjectMemberPeer[] members) {
+    public static DeweyOrderSet createOrderSet(final List<ObjectMemberPeer> members) {
 
         final SortedMap sortedMembersByGroup = new TreeMap();
         final SortedSet nonAnnotatedGroup = new TreeSet(new MemberIdentifierComparator());
 
         // spin over all the members and put them into a Map of SortedSets
         // any non-annotated members go into additional nonAnnotatedGroup set.
-        for (int i = 0; i < members.length; i++) {
-            final ObjectMemberPeer member = members[i];
+        for (ObjectMemberPeer member : members) {
             final MemberOrderFacet memberOrder = member.getFacet(MemberOrderFacet.class);
             if (memberOrder == null) {
                 nonAnnotatedGroup.add(member);
@@ -102,7 +102,6 @@ public class DeweyOrderSet extends Order
         }
 
         // now populate the OrderSets
-
         for (final Iterator iter = groupNames.iterator(); iter.hasNext();) {
             final String groupName = (String) iter.next();
             final DeweyOrderSet deweyOrderSet = (DeweyOrderSet) orderSetsByGroup.get(groupName);

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/specloader/internal/introspector/JavaIntrospector.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/specloader/internal/introspector/JavaIntrospector.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/specloader/internal/introspector/JavaIntrospector.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/specloader/internal/introspector/JavaIntrospector.java Fri Dec 17 16:40:06 2010
@@ -20,16 +20,21 @@
 
 package org.apache.isis.core.progmodel.specloader.internal.introspector;
 
-import java.beans.Introspector;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-import org.apache.isis.applib.Identifier;
+import java.beans.Introspector;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+
+import com.google.common.collect.Lists;
+
+import org.apache.isis.applib.Identifier;
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.commons.lang.JavaClassUtils;
 import org.apache.isis.core.commons.lang.ToString;
@@ -67,6 +72,7 @@ public class JavaIntrospector {
 
     private final class JavaIntrospectorMethodRemover implements MethodRemover {
 
+        @Override
         public void removeMethod(
                 final MethodScope methodScope,
                 final String methodName,
@@ -76,6 +82,7 @@ public class JavaIntrospector {
             		methods, methodScope, methodName, returnType, parameterTypes);
         }
 
+        @Override
         public List<Method> removeMethods(
                 final MethodScope methodScope,
                 final String prefix,
@@ -85,26 +92,28 @@ public class JavaIntrospector {
             return MethodFinderUtils.removeMethods(methods, methodScope, prefix, returnType, canBeVoid, paramCount);
         }
 
+        @Override
         public void removeMethod(final Method method) {
-            for (int i = 0; i < methods.length; i++) {
-                if (methods[i] == null) {
+            for (int i = 0; i < methods.size(); i++) {
+                if (methods.get(i) == null) {
                     continue;
                 }
-                if (methods[i].equals(method)) {
-                    methods[i] = null;
+                if (methods.get(i).equals(method)) {
+                    methods.set(i, null);
                 }
             }
         }
 
+        @Override
         public void removeMethods(final List<Method> methodList) {
             final List<Method> methodList2 = methodList;
-            for (int i = 0; i < methods.length; i++) {
-                if (methods[i] == null) {
+            for (int i = 0; i < methods.size(); i++) {
+                if (methods.get(i) == null) {
                     continue;
                 }
                 for (final Method method : methodList2) {
-                    if (methods[i].equals(method)) {
-                        methods[i] = null;
+                    if (methods.get(i).equals(method)) {
+                        methods.set(i, null);
                         break;
                     }
                 }
@@ -122,7 +131,7 @@ public class JavaIntrospector {
 
     private final String className;
     private final Class<?> type;
-    private final Method methods[];
+    private final List<Method> methods;
 
     private OrderSet orderedFields;
     private OrderSet orderedObjectActions;
@@ -154,7 +163,7 @@ public class JavaIntrospector {
         // interfaces or non-public concrete implementations. Therefore the test
         // has been removed.
 
-        methods = type.getMethods();
+        methods = Arrays.asList(type.getMethods());
         className = type.getName();
     }
 
@@ -231,13 +240,13 @@ public class JavaIntrospector {
         getFacetProcessor().process(type, methodRemover, javaSpecification);
 
         // if this class has additional facets (as per @Facets), then process them.
-        final FacetsFacet facetsFacet = (FacetsFacet) javaSpecification.getFacet(FacetsFacet.class);
+        final FacetsFacet facetsFacet = javaSpecification.getFacet(FacetsFacet.class);
         if (facetsFacet != null) {
             final Class<? extends FacetFactory>[] facetFactories = facetsFacet.facetFactories();
             for (int i = 0; i < facetFactories.length; i++) {
                 FacetFactory facetFactory = null;
                 try {
-                    facetFactory = (FacetFactory) facetFactories[i].newInstance();
+                    facetFactory = facetFactories[i].newInstance();
                 } catch (final InstantiationException e) {
                     throw new IsisException(e);
                 } catch (final IllegalAccessException e) {
@@ -253,11 +262,11 @@ public class JavaIntrospector {
         LOG.debug("introspecting " + className() + ": properties and collections");
 
         // find the properties and collections (fields) ...
-        final ObjectAssociationPeer[] findFieldMethods = findAndCreateFieldPeers();
+        final List<ObjectMemberPeer> fieldPeers = findAndCreateFieldPeers();
 
         // ... and the ordering of the properties and collections
         String fieldOrder;
-        final FieldOrderFacet fieldOrderFacet = (FieldOrderFacet) javaSpecification.getFacet(FieldOrderFacet.class);
+        final FieldOrderFacet fieldOrderFacet = javaSpecification.getFacet(FieldOrderFacet.class);
         if (fieldOrderFacet == null) {
             fieldOrder = null;
         } else {
@@ -268,7 +277,7 @@ public class JavaIntrospector {
             // TODO: the calling of fieldOrder() should be a facet
             fieldOrder = invokeSortOrderMethod("field");
         }
-        orderedFields = createOrderSet(fieldOrder, findFieldMethods);
+        orderedFields = createOrderSet(fieldOrder, fieldPeers);
     }
 
     public void introspectActions() {
@@ -276,12 +285,12 @@ public class JavaIntrospector {
 
         // find the actions ...
         MethodScope methodScope = MethodScope.OBJECT;
-		final ObjectActionPeer[] actionPeers = findActionMethodsPeers(methodScope);
+		final List<ObjectMemberPeer> actionPeers = findActionMethodsPeers(methodScope);
 
 
         // ... and the ordering of actions ...
         String actionOrder;
-        final ActionOrderFacet actionOrderFacet = (ActionOrderFacet) javaSpecification.getFacet(ActionOrderFacet.class);
+        final ActionOrderFacet actionOrderFacet = javaSpecification.getFacet(ActionOrderFacet.class);
         if (actionOrderFacet == null) {
             actionOrder = null;
         } else {
@@ -295,7 +304,7 @@ public class JavaIntrospector {
 
         // find the class actions ...
         MethodScope methodsScope2 = MethodScope.CLASS;
-		final ObjectActionPeer[] findClassActionMethods = findActionMethodsPeers(methodsScope2);
+		final List<ObjectMemberPeer> findClassActionMethods = findActionMethodsPeers(methodsScope2);
 
         // ... and the ordering of class actions
         actionOrder = null;
@@ -310,8 +319,10 @@ public class JavaIntrospector {
     // find Properties and Collections (fields)
     // ////////////////////////////////////////////////////////////////////////////
 
-    private ObjectAssociationPeer[] findAndCreateFieldPeers() {
-        LOG.debug("  looking for fields for " + type);
+    private List<ObjectMemberPeer> findAndCreateFieldPeers() {
+        if(LOG.isDebugEnabled()) {
+            LOG.debug("  looking for fields for " + type);
+        }
 
         // Ensure all return types are known
         final Set<Method> propertyOrCollectionCandidates = getFacetProcessor().findPropertyOrCollectionCandidateAccessors(
@@ -324,19 +335,15 @@ public class JavaIntrospector {
 		reflector.loadSpecifications(typesToLoad, type);
 
         // now create FieldPeers for value properties, for collections and for reference properties
-        final List<ObjectAssociationPeer> fieldPeers = new ArrayList<ObjectAssociationPeer>();
+        final List<ObjectMemberPeer> fieldPeers = new ArrayList<ObjectMemberPeer>();
 
         findAndRemoveCollectionAccessorsAndCreateCorrespondingFieldPeers(fieldPeers);
         findAndRemovePropertyAccessorsAndCreateCorrespondingFieldPeers(fieldPeers);
 
-        return toArray(fieldPeers);
-    }
-
-    private ObjectAssociationPeer[] toArray(final List<ObjectAssociationPeer> fields) {
-        return (ObjectAssociationPeer[]) fields.toArray(new ObjectAssociationPeer[] {});
+        return Collections.unmodifiableList(fieldPeers);
     }
 
-    private void findAndRemoveCollectionAccessorsAndCreateCorrespondingFieldPeers(final List<ObjectAssociationPeer> associationPeers) {
+    private void findAndRemoveCollectionAccessorsAndCreateCorrespondingFieldPeers(final List<ObjectMemberPeer> associationPeers) {
         final List<Method> collectionAccessors = new ArrayList<Method>();
         getFacetProcessor().findAndRemoveCollectionAccessors(new JavaIntrospectorMethodRemover(), collectionAccessors);
         createCollectionPeersFromAccessors(collectionAccessors, associationPeers);
@@ -346,7 +353,7 @@ public class JavaIntrospector {
      * Since the value properties and collections have already been processed, this will pick up the remaining
      * reference properties.
      */
-    private void findAndRemovePropertyAccessorsAndCreateCorrespondingFieldPeers(final List<ObjectAssociationPeer> fields) {
+    private void findAndRemovePropertyAccessorsAndCreateCorrespondingFieldPeers(final List<ObjectMemberPeer> fields) {
         final List<Method> propertyAccessors = new ArrayList<Method>();
         getFacetProcessor().findAndRemovePropertyAccessors(new JavaIntrospectorMethodRemover(), propertyAccessors);
 
@@ -356,7 +363,7 @@ public class JavaIntrospector {
         createPropertyPeersFromAccessors(propertyAccessors, fields);
     }
 
-    private void createCollectionPeersFromAccessors(final List<Method> collectionAccessors, final List<ObjectAssociationPeer> associationPeerListToAppendto) {
+    private void createCollectionPeersFromAccessors(final List<Method> collectionAccessors, final List<ObjectMemberPeer> associationPeerListToAppendto) {
         for (final Method getMethod : collectionAccessors) {
             LOG.debug("  identified one-many association method " + getMethod);
             final String capitalizedName = NameUtils.javaBaseName(getMethod.getName());
@@ -377,7 +384,7 @@ public class JavaIntrospector {
             }
             collection.setElementType(elementType);
 
-            // skip if class strategy says so.
+            // skip if class substituor says so.
             if (getClassSubstitutor().getClass(elementType) == null) {
                 continue;
             }
@@ -386,7 +393,7 @@ public class JavaIntrospector {
         }
     }
 
-    private void createPropertyPeersFromAccessors(final List<Method> propertyAccessors, final List<ObjectAssociationPeer> associationPeerListToAppendto)
+    private void createPropertyPeersFromAccessors(final List<Method> propertyAccessors, final List<ObjectMemberPeer> associationPeerListToAppendto)
             throws ReflectionException {
 
         for (final Method accessorMethod : propertyAccessors) {
@@ -421,41 +428,49 @@ public class JavaIntrospector {
     // find Actions
     // ////////////////////////////////////////////////////////////////////////////
 
-	private ObjectActionPeer[] findActionMethodsPeers(
+	private List<ObjectMemberPeer> findActionMethodsPeers(
 			MethodScope methodScope) {
-		final ObjectActionPeer[] actionPeers1 = findActionMethodPeers(methodScope, true);
-        final ObjectActionPeer[] actionPeers2 = findActionMethodPeers(methodScope, false);
-        final ObjectActionPeer[] actionPeers = new ObjectActionPeer[actionPeers1.length + actionPeers2.length];
-        System.arraycopy(actionPeers1, 0, actionPeers, 0, actionPeers1.length);
-        System.arraycopy(actionPeers2, 0, actionPeers, actionPeers1.length, actionPeers2.length);
-		return actionPeers;
+		final List<ObjectMemberPeer> actionPeers1 = findActionMethodPeers(methodScope, RecognisedHelpersStrategy.SKIP);
+        final List<ObjectMemberPeer> actionPeers2 = findActionMethodPeers(methodScope, RecognisedHelpersStrategy.DONT_SKIP);
+		List<ObjectMemberPeer> peers = Lists.newArrayList(actionPeers1);
+        peers.addAll(actionPeers2);
+        return peers;
 	}
 
-
-    private ObjectActionPeer[] findActionMethodPeers(final MethodScope methodScope, boolean skipRecognisedHelperMethod) {
+
+	private enum RecognisedHelpersStrategy {
+	    SKIP,
+	    DONT_SKIP;
+        public boolean skip() {
+            return this == SKIP;
+        }
+	}
+	
+    private List<ObjectMemberPeer> findActionMethodPeers(final MethodScope methodScope, RecognisedHelpersStrategy skipRecognisedHelpers) {
     	if(LOG.isDebugEnabled()) {
     		LOG.debug("  looking for action methods");
     	}
 
-        final List<ObjectActionPeer> actionPeers = new ArrayList<ObjectActionPeer>();
+        final List<ObjectMemberPeer> actionPeers = new ArrayList<ObjectMemberPeer>();
 
-        for (int i = 0; i < methods.length; i++) {
-            if (methods[i] == null) {
+        for (int i = 0; i < methods.size(); i++) {
+            Method method = methods.get(i);
+            if (method == null) {
                 continue;
             }
-            ObjectActionPeer actionPeer = findActionMethodPeer(methodScope, skipRecognisedHelperMethod, methods[i]);
+            ObjectActionPeer actionPeer = findActionMethodPeer(methodScope, skipRecognisedHelpers, method);
             if (actionPeer != null) {
-            	methods[i] = null;
+            	methods.set(i, null);
             	actionPeers.add(actionPeer);
             }
         }
 
-        return convertToArray(actionPeers);
+        return actionPeers;
     }
 
-    private ObjectActionPeer findActionMethodPeer(final MethodScope methodScope, boolean skipRecognisedHelperMethod, final Method actionMethod) {
+    private ObjectActionPeer findActionMethodPeer(final MethodScope methodScope, RecognisedHelpersStrategy skipRecognisedHelpers, final Method actionMethod) {
 
-    	if (!representsAction(methodScope, skipRecognisedHelperMethod, actionMethod)) {
+    	if (!representsAction(methodScope, skipRecognisedHelpers, actionMethod)) {
     		return null;
     	}
 
@@ -491,7 +506,7 @@ public class JavaIntrospector {
         return action;
 	}
 
-    private boolean representsAction(final MethodScope methodScope, boolean skipRecognisedHelperMethod, final Method actionMethod) {
+    private boolean representsAction(final MethodScope methodScope, RecognisedHelpersStrategy skipRecognisedHelpers, final Method actionMethod) {
 
         if (!MethodFinderUtils.inScope(methodScope, actionMethod)) {
             return false;
@@ -513,7 +528,7 @@ public class JavaIntrospector {
             if (actionMethod.getName().startsWith("set")) {
             	return false;
             }
-            if (skipRecognisedHelperMethod) {
+            if (skipRecognisedHelpers.skip()) {
                 LOG.info("  skipping possible helper method " + actionMethod);
             	return false;
             }
@@ -558,7 +573,7 @@ public class JavaIntrospector {
 	}
 
 	private ObjectActionPeer[] convertToArray(final List<ObjectActionPeer> actions) {
-        return (ObjectActionPeer[]) actions.toArray(new ObjectActionPeer[] {});
+        return actions.toArray(new ObjectActionPeer[] {});
     }
 
     // ////////////////////////////////////////////////////////////////////////////
@@ -614,7 +629,7 @@ public class JavaIntrospector {
     // Sort Member Peers
     // ////////////////////////////////////////////////////////////////////////////
 
-    private OrderSet createOrderSet(final String order, final ObjectMemberPeer[] members) {
+    private OrderSet createOrderSet(final String order, final List<ObjectMemberPeer> members) {
         if (order != null) {
             OrderSet set;
             set = SimpleOrderSet.createOrderSet(order, members);
@@ -697,7 +712,7 @@ public class JavaIntrospector {
      * <p>
      * Have therefore made private.
      */
-    private static ObjectAssociationPeer[] orderArray(final ObjectAssociationPeer[] original, final String[] order) {
+    private static List<ObjectAssociationPeer> orderArray(final List<ObjectAssociationPeer> original, final String[] order) {
         if (order == null) {
             return original;
 
@@ -706,20 +721,20 @@ public class JavaIntrospector {
                 order[i] = NameUtils.simpleName(order[i]);
             }
 
-            final ObjectAssociationPeer[] ordered = new ObjectAssociationPeer[original.length];
+            final List<ObjectAssociationPeer> ordered = Lists.newArrayListWithCapacity(original.size());
 
             // work through each order element and find, if there is one, a
             // matching member.
             int orderedIndex = 0;
             ordering: for (int orderIndex = 0; orderIndex < order.length; orderIndex++) {
-                for (int memberIndex = 0; memberIndex < original.length; memberIndex++) {
-                    final ObjectAssociationPeer member = original[memberIndex];
+                for (int memberIndex = 0; memberIndex < original.size(); memberIndex++) {
+                    final ObjectAssociationPeer member = original.get(memberIndex);
                     if (member == null) {
                         continue;
                     }
                     if (member.getIdentifier().getMemberName().equalsIgnoreCase(order[orderIndex])) {
-                        ordered[orderedIndex++] = original[memberIndex];
-                        original[memberIndex] = null;
+                        ordered.set(orderedIndex++, original.get(memberIndex));
+                        original.set(memberIndex, null);
 
                         continue ordering;
                     }
@@ -730,23 +745,22 @@ public class JavaIntrospector {
                 }
             }
 
-            final ObjectAssociationPeer[] results = new ObjectAssociationPeer[original.length];
-            int index = 0;
-            for (int i = 0; i < ordered.length; i++) {
-                final ObjectAssociationPeer member = ordered[i];
-                if (member != null) {
-                    results[index++] = member;
-                }
-            }
-            for (int i = 0; i < original.length; i++) {
-                final ObjectAssociationPeer member = original[i];
-                if (member != null) {
-                    results[index++] = member;
-                }
-            }
+            final List<ObjectAssociationPeer> results = Lists.newArrayListWithCapacity(original.size());
+            int index = append(0, results, ordered);
+            index = append(index, results, original);
 
             return results;
         }
+    }
+
+    protected static int append(int index, final List<ObjectAssociationPeer> to, List<ObjectAssociationPeer> from) {
+        for (int i = 0; i < from.size(); i++) {
+            final ObjectAssociationPeer member = from.get(i);
+            if (member != null) {
+                to.set(index++, member);
+            }
+        }
+        return index;
     }
 
 
@@ -759,6 +773,7 @@ public class JavaIntrospector {
         return reflector;
     }
 
+    @Override
     public String toString() {
         ToString str = new ToString(this);
         str.append("class", className);

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/AbstractFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/AbstractFacetFactoryTest.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/AbstractFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/AbstractFacetFactoryTest.java Fri Dec 17 16:40:06 2010
@@ -20,11 +20,13 @@
 
 package org.apache.isis.core.progmodel.facets;
 
-import java.lang.reflect.Method;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.BasicConfigurator;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.BasicConfigurator;
+
 import org.apache.isis.core.metamodel.facets.FacetHolderImpl;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
 
@@ -57,7 +59,7 @@ public abstract class AbstractFacetFacto
     	return Utils.contains(types, type);
     }
 
-    protected boolean contains(final ObjectFeatureType[] featureTypes, final ObjectFeatureType featureType) {
+    protected boolean contains(final List<ObjectFeatureType> featureTypes, final ObjectFeatureType featureType) {
     	return Utils.contains(featureTypes, featureType);
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/Utils.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/Utils.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/Utils.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/Utils.java Fri Dec 17 16:40:06 2010
@@ -20,8 +20,9 @@
 
 package org.apache.isis.core.progmodel.facets;
 
-import java.lang.reflect.Method;
-
+import java.lang.reflect.Method;
+import java.util.List;
+
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
 
 
@@ -45,6 +46,10 @@ class Utils {
         return false;
     }
 
+    protected static boolean contains(final List<ObjectFeatureType> list, final ObjectFeatureType val) {
+        return list.contains(val);
+    }
+
     protected static Method findMethod(final Class<?> type, final String methodName, final Class<?>[] methodTypes) {
         try {
             return type.getMethod(methodName, methodTypes);

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actcoll/typeof/TypeOfAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actcoll/typeof/TypeOfAnnotationFacetFactoryTest.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actcoll/typeof/TypeOfAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actcoll/typeof/TypeOfAnnotationFacetFactoryTest.java Fri Dec 17 16:40:06 2010
@@ -20,21 +20,17 @@
 
 package org.apache.isis.core.progmodel.facets.actcoll.typeof;
 
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.isis.applib.annotation.TypeOf;
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.isis.applib.annotation.TypeOf;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
 import org.apache.isis.core.metamodel.specloader.collectiontyperegistry.CollectionTypeRegistryDefault;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.actcoll.typeof.TypeOfAnnotationFacetFactory;
-import org.apache.isis.core.progmodel.facets.actcoll.typeof.TypeOfFacetInferredFromArray;
-import org.apache.isis.core.progmodel.facets.actcoll.typeof.TypeOfFacetInferredFromGenerics;
-import org.apache.isis.core.progmodel.facets.actcoll.typeof.TypeOfFacetViaAnnotation;
 
 
 public class TypeOfAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -57,7 +53,7 @@ public class TypeOfAnnotationFacetFactor
 
     @Override
     public void testFeatureTypes() {
-        final ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
+        final List<ObjectFeatureType> featureTypes = facetFactory.getFeatureTypes();
         assertFalse(contains(featureTypes, ObjectFeatureType.OBJECT));
         assertFalse(contains(featureTypes, ObjectFeatureType.PROPERTY));
         assertTrue(contains(featureTypes, ObjectFeatureType.COLLECTION));

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/ActionMethodsFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/ActionMethodsFacetFactoryTest.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/ActionMethodsFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/ActionMethodsFacetFactoryTest.java Fri Dec 17 16:40:06 2010
@@ -20,13 +20,13 @@
 
 package org.apache.isis.core.progmodel.facets.actions;
 
-import java.lang.reflect.Method;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.security.UserMemento;
+import java.lang.reflect.Method;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.applib.Identifier;
+import org.apache.isis.applib.annotation.Named;
+import org.apache.isis.applib.security.UserMemento;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.When;
 import org.apache.isis.core.metamodel.facets.actions.choices.ActionChoicesFacet;
@@ -47,7 +47,6 @@ import org.apache.isis.core.metamodel.sp
 import org.apache.isis.core.metamodel.specloader.internal.peer.ObjectActionPeer;
 import org.apache.isis.core.metamodel.testspec.TestProxySpecification;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.actions.ActionMethodsFacetFactory;
 import org.apache.isis.core.progmodel.facets.actions.choices.ActionChoicesFacetViaMethod;
 import org.apache.isis.core.progmodel.facets.actions.choices.ActionParameterChoicesFacetViaMethod;
 import org.apache.isis.core.progmodel.facets.actions.defaults.ActionDefaultsFacetViaMethod;
@@ -91,7 +90,7 @@ public class ActionMethodsFacetFactoryTe
 
     @Override
     public void testFeatureTypes() {
-        final ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
+        final List<ObjectFeatureType> featureTypes = facetFactory.getFeatureTypes();
         assertFalse(contains(featureTypes, ObjectFeatureType.OBJECT));
         assertFalse(contains(featureTypes, ObjectFeatureType.PROPERTY));
         assertFalse(contains(featureTypes, ObjectFeatureType.COLLECTION));

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/IteratorFilteringFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/IteratorFilteringFacetFactoryTest.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/IteratorFilteringFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/IteratorFilteringFacetFactoryTest.java Fri Dec 17 16:40:06 2010
@@ -20,12 +20,12 @@
 
 package org.apache.isis.core.progmodel.facets.actions;
 
-import java.lang.reflect.Method;
-import java.util.Iterator;
-
+import java.lang.reflect.Method;
+import java.util.Iterator;
+import java.util.List;
+
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.actions.IteratorFilteringFacetFactory;
 
 
 public class IteratorFilteringFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -47,7 +47,7 @@ public class IteratorFilteringFacetFacto
 
     @Override
     public void testFeatureTypes() {
-        final ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
+        final List<ObjectFeatureType> featureTypes = facetFactory.getFeatureTypes();
         assertTrue(contains(featureTypes, ObjectFeatureType.OBJECT));
         assertFalse(contains(featureTypes, ObjectFeatureType.PROPERTY));
         assertFalse(contains(featureTypes, ObjectFeatureType.COLLECTION));
@@ -83,6 +83,7 @@ public class IteratorFilteringFacetFacto
         class Customer implements Iterable {
             public void someAction() {}
 
+            @Override
             public Iterator iterator() {
                 return null;
             }

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugAnnotationFacetFactoryTest.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugAnnotationFacetFactoryTest.java Fri Dec 17 16:40:06 2010
@@ -20,15 +20,14 @@
 
 package org.apache.isis.core.progmodel.facets.actions.debug;
 
-import java.lang.reflect.Method;
-
-import org.apache.isis.applib.annotation.Debug;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.apache.isis.applib.annotation.Debug;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.actions.debug.DebugFacet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.actions.debug.DebugAnnotationFacetFactory;
-import org.apache.isis.core.progmodel.facets.actions.debug.DebugFacetAbstract;
 
 
 public class DebugAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -50,7 +49,7 @@ public class DebugAnnotationFacetFactory
 
     @Override
     public void testFeatureTypes() {
-        final ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
+        final List<ObjectFeatureType> featureTypes = facetFactory.getFeatureTypes();
         assertFalse(contains(featureTypes, ObjectFeatureType.OBJECT));
         assertFalse(contains(featureTypes, ObjectFeatureType.PROPERTY));
         assertFalse(contains(featureTypes, ObjectFeatureType.COLLECTION));

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/executed/ExecutedAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/executed/ExecutedAnnotationFacetFactoryTest.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/executed/ExecutedAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/executed/ExecutedAnnotationFacetFactoryTest.java Fri Dec 17 16:40:06 2010
@@ -20,17 +20,16 @@
 
 package org.apache.isis.core.progmodel.facets.actions.executed;
 
-import java.lang.reflect.Method;
-
-import org.apache.isis.applib.annotation.Executed;
-import org.apache.isis.applib.annotation.Executed.Where;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.apache.isis.applib.annotation.Executed;
+import org.apache.isis.applib.annotation.Executed.Where;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.actions.executed.ExecutedFacet;
 import org.apache.isis.core.metamodel.spec.Target;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.actions.executed.ExecutedAnnotationFacetFactory;
-import org.apache.isis.core.progmodel.facets.actions.executed.ExecutedFacetAbstract;
 
 
 public class ExecutedAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -52,7 +51,7 @@ public class ExecutedAnnotationFacetFact
 
     @Override
     public void testFeatureTypes() {
-        final ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
+        final List<ObjectFeatureType> featureTypes = facetFactory.getFeatureTypes();
         assertFalse(contains(featureTypes, ObjectFeatureType.OBJECT));
         assertFalse(contains(featureTypes, ObjectFeatureType.PROPERTY));
         assertFalse(contains(featureTypes, ObjectFeatureType.COLLECTION));

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationAnnotationFacetFactoryTest.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationAnnotationFacetFactoryTest.java Fri Dec 17 16:40:06 2010
@@ -20,15 +20,14 @@
 
 package org.apache.isis.core.progmodel.facets.actions.exploration;
 
-import java.lang.reflect.Method;
-
-import org.apache.isis.applib.annotation.Exploration;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.apache.isis.applib.annotation.Exploration;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.actions.exploration.ExplorationFacet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.actions.exploration.ExplorationAnnotationFacetFactory;
-import org.apache.isis.core.progmodel.facets.actions.exploration.ExplorationFacetAbstract;
 
 
 public class ExplorationAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -50,7 +49,7 @@ public class ExplorationAnnotationFacetF
 
     @Override
     public void testFeatureTypes() {
-        final ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
+        final List<ObjectFeatureType> featureTypes = facetFactory.getFeatureTypes();
         assertFalse(contains(featureTypes, ObjectFeatureType.OBJECT));
         assertFalse(contains(featureTypes, ObjectFeatureType.PROPERTY));
         assertFalse(contains(featureTypes, ObjectFeatureType.COLLECTION));

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedAnnotationFacetFactoryTest.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedAnnotationFacetFactoryTest.java Fri Dec 17 16:40:06 2010
@@ -20,17 +20,13 @@
 
 package org.apache.isis.core.progmodel.facets.actions.notcontributed;
 
-import java.lang.reflect.Method;
-
-import org.apache.isis.applib.annotation.Exploration;
-import org.apache.isis.applib.annotation.NotContributed;
-import org.apache.isis.applib.annotation.Prototype;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.apache.isis.applib.annotation.NotContributed;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.actions.notcontributed.NotContributedAnnotationFacetFactory;
-import org.apache.isis.core.progmodel.facets.actions.notcontributed.NotContributedFacet;
-import org.apache.isis.core.progmodel.facets.actions.notcontributed.NotContributedFacetAbstract;
 
 
 public class NotContributedAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -52,7 +48,7 @@ public class NotContributedAnnotationFac
 
     @Override
     public void testFeatureTypes() {
-        final ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
+        final List<ObjectFeatureType> featureTypes = facetFactory.getFeatureTypes();
         assertFalse(contains(featureTypes, ObjectFeatureType.OBJECT));
         assertFalse(contains(featureTypes, ObjectFeatureType.PROPERTY));
         assertFalse(contains(featureTypes, ObjectFeatureType.COLLECTION));

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notinrepositorymenu/NotInRepositoryMenuAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notinrepositorymenu/NotInRepositoryMenuAnnotationFacetFactoryTest.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notinrepositorymenu/NotInRepositoryMenuAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notinrepositorymenu/NotInRepositoryMenuAnnotationFacetFactoryTest.java Fri Dec 17 16:40:06 2010
@@ -20,12 +20,10 @@
 
 package org.apache.isis.core.progmodel.facets.actions.notinrepositorymenu;
 
-import java.lang.reflect.Method;
-
-import org.apache.isis.applib.annotation.Exploration;
-import org.apache.isis.applib.annotation.NotContributed;
-import org.apache.isis.applib.annotation.NotInServiceMenu;
-import org.apache.isis.applib.annotation.Prototype;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.apache.isis.applib.annotation.NotInServiceMenu;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
@@ -53,7 +51,7 @@ public class NotInRepositoryMenuAnnotati
 
     @Override
     public void testFeatureTypes() {
-        final ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
+        final List<ObjectFeatureType> featureTypes = facetFactory.getFeatureTypes();
         assertFalse(contains(featureTypes, ObjectFeatureType.OBJECT));
         assertFalse(contains(featureTypes, ObjectFeatureType.PROPERTY));
         assertFalse(contains(featureTypes, ObjectFeatureType.COLLECTION));

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactoryTest.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactoryTest.java Fri Dec 17 16:40:06 2010
@@ -20,15 +20,14 @@
 
 package org.apache.isis.core.progmodel.facets.actions.prototype;
 
-import java.lang.reflect.Method;
-
-import org.apache.isis.applib.annotation.Prototype;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.apache.isis.applib.annotation.Prototype;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.actions.prototype.PrototypeFacet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.actions.prototype.PrototypeAnnotationFacetFactory;
-import org.apache.isis.core.progmodel.facets.actions.prototype.PrototypeFacetAbstract;
 
 
 public class PrototypeAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -50,7 +49,7 @@ public class PrototypeAnnotationFacetFac
 
     @Override
     public void testFeatureTypes() {
-        final ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
+        final List<ObjectFeatureType> featureTypes = facetFactory.getFeatureTypes();
         assertFalse(contains(featureTypes, ObjectFeatureType.OBJECT));
         assertFalse(contains(featureTypes, ObjectFeatureType.PROPERTY));
         assertFalse(contains(featureTypes, ObjectFeatureType.COLLECTION));



Mime
View raw message