This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.models.api-1.2.0
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-api.git

commit 236a97cb9302b4cc4311a95182bccde35ff2ac91
Author: Konrad Windszus <[email protected]>
AuthorDate: Mon Jun 1 07:21:27 2015 +0000

    SLING-4767
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api@1682826
 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/models/factory/ModelClassException.java  |  2 +-
 .../apache/sling/models/factory/ModelFactory.java  |  5 +++--
 ...sException.java => PostConstructException.java} | 22 +++++++++-------------
 3 files changed, 13 insertions(+), 16 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/models/factory/ModelClassException.java 
b/src/main/java/org/apache/sling/models/factory/ModelClassException.java
index 6ef5118..9d503f9 100644
--- a/src/main/java/org/apache/sling/models/factory/ModelClassException.java
+++ b/src/main/java/org/apache/sling/models/factory/ModelClassException.java
@@ -25,7 +25,7 @@ package org.apache.sling.models.factory;
  * 
  * @see ModelFactory
  */
-public final class ModelClassException extends RuntimeException {
+public class ModelClassException extends RuntimeException {
 
     private static final long serialVersionUID = 4323592065808565135L;
 
diff --git a/src/main/java/org/apache/sling/models/factory/ModelFactory.java 
b/src/main/java/org/apache/sling/models/factory/ModelFactory.java
index 06488d0..7a88d81 100644
--- a/src/main/java/org/apache/sling/models/factory/ModelFactory.java
+++ b/src/main/java/org/apache/sling/models/factory/ModelFactory.java
@@ -34,12 +34,13 @@ public interface ModelFactory {
      * @return a new instance for the required model (never null)
      * @throws MissingElementsException in case no injector was able to inject 
some required values with the given types
      * @throws InvalidAdaptableException in case the given class cannot be 
instantiated from the given adaptable (different adaptable on the model 
annotation)
-     * @throws ModelClassException in case the model could not be instanciated 
because model annotation was missing, reflection failed, no valid constructor 
was found or post-construct has thrown an error
+     * @throws ModelClassException in case the model could not be instanciated 
because model annotation was missing, reflection failed, no valid constructor 
was found or post-construct could not be called
+     * @throws PostConstructException in case the post-construct method has 
thrown an exception itself
      * @throws InvalidValidationModelException in case an invalid validation 
model was found
      * @throws InvalidResourceException in case the resource (for the Sling 
Model) could not be validated through Sling Validation
      */
     public @Nonnull <ModelType> ModelType createModel(@Nonnull Object 
adaptable, @Nonnull Class<ModelType> type) throws MissingElementsException,
-            InvalidAdaptableException, ModelClassException, 
InvalidValidationModelException, InvalidResourceException;
+            InvalidAdaptableException, ModelClassException, 
PostConstructException, InvalidValidationModelException, 
InvalidResourceException;
 
     /**
      * 
diff --git 
a/src/main/java/org/apache/sling/models/factory/ModelClassException.java 
b/src/main/java/org/apache/sling/models/factory/PostConstructException.java
similarity index 60%
copy from src/main/java/org/apache/sling/models/factory/ModelClassException.java
copy to 
src/main/java/org/apache/sling/models/factory/PostConstructException.java
index 6ef5118..a1d3122 100644
--- a/src/main/java/org/apache/sling/models/factory/ModelClassException.java
+++ b/src/main/java/org/apache/sling/models/factory/PostConstructException.java
@@ -19,21 +19,17 @@
 package org.apache.sling.models.factory;
 
 /**
- * Exception which is triggered when the Model class could not be instantiated 
due to
- * not having a model annotation, some reflection error, invalid constructors 
or 
- * because some exception within the post construct method was triggered.
- * 
- * @see ModelFactory
+ * Exception which is triggered, whenever the post-construct method has thrown 
an exception.
  */
-public final class ModelClassException extends RuntimeException {
+public class PostConstructException extends ModelClassException {
 
-    private static final long serialVersionUID = 4323592065808565135L;
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -2527043835215727726L;
 
-    public ModelClassException(String message) {
-        super(message);
-    }
-    
-    public ModelClassException(String message, Throwable e) {
-        super(message, e);
+    public PostConstructException(String message, Throwable cause) {
+        super(message, cause);
     }
+
 }

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to