sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sseif...@apache.org
Subject svn commit: r1632023 - in /sling/trunk/bundles/extensions/models: api/src/main/java/org/apache/sling/models/factory/ModelFactory.java impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
Date Wed, 15 Oct 2014 13:41:31 GMT
Author: sseifert
Date: Wed Oct 15 13:41:31 2014
New Revision: 1632023

URL: http://svn.apache.org/r1632023
Log:
SLING-4057 ModelFactory: Ordering of method arguments inconsistent

Modified:
    sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/ModelFactory.java
    sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java

Modified: sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/ModelFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/ModelFactory.java?rev=1632023&r1=1632022&r2=1632023&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/ModelFactory.java
(original)
+++ sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/ModelFactory.java
Wed Oct 15 13:41:31 2014
@@ -43,7 +43,7 @@ public interface ModelFactory {
      * @return false in case the given class can not be adapted from the given adaptable
      * @throws InvalidModelException in case the given class does not have a model annotation
      */
-    public boolean canCreateFromAdaptable(Class<?> modelClass, Object adaptable) throws
InvalidModelException;
+    public boolean canCreateFromAdaptable(Object adaptable, Class<?> modelClass) throws
InvalidModelException;
 
     /**
      * 

Modified: sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java?rev=1632023&r1=1632022&r2=1632023&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
(original)
+++ sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
Wed Oct 15 13:41:31 2014
@@ -179,7 +179,7 @@ public class ModelAdapterFactory impleme
     }
 
     @Override
-    public boolean canCreateFromAdaptable(Class<?> modelClass, Object adaptable) throws
InvalidModelException {
+    public boolean canCreateFromAdaptable(Object adaptable, Class<?> modelClass) throws
InvalidModelException {
         return innerCanCreateFromAdaptable(modelClass, adaptable);
     }
 
@@ -897,7 +897,7 @@ public class ModelAdapterFactory impleme
     private Object adaptIfNecessary(Object value, Class<?> type, Type genericType,
Result<?> parentResult) {
         if (!isAcceptableType(type, genericType, value)) {
             Class<?> declaredType = type;
-            if (isModelClass(type) && canCreateFromAdaptable(type, value)) {
+            if (isModelClass(type) && canCreateFromAdaptable(value, type)) {
                 Result<?> result = internalCreateModel(value, type);
                 if (result.getModel() == null) {
                     parentResult.appendFailures(result);



Mime
View raw message