You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/06/01 14:48:23 UTC

svn commit: r780636 - in /maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model: ./ io/ profile/ profile/activator/ resolver/

Author: bentmann
Date: Mon Jun  1 12:48:22 2009
New Revision: 780636

URL: http://svn.apache.org/viewvc?rev=780636&view=rev
Log:
o Polished exceptions

Modified:
    maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/InvalidModelException.java
    maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/InvalidProfileException.java
    maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/ModelBuildingException.java
    maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/UnresolvableParentException.java
    maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/io/DefaultModelReader.java
    maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/io/ModelParseException.java
    maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/ProfileActivationException.java
    maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/activator/FileProfileActivator.java
    maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/activator/JdkVersionProfileActivator.java
    maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/activator/PropertyProfileActivator.java
    maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/resolver/InvalidRepositoryException.java

Modified: maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/InvalidModelException.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/InvalidModelException.java?rev=780636&r1=780635&r2=780636&view=diff
==============================================================================
--- maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/InvalidModelException.java (original)
+++ maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/InvalidModelException.java Mon Jun  1 12:48:22 2009
@@ -30,14 +30,29 @@
     extends ModelBuildingException
 {
 
+    /**
+     * The validation result, can be {@code null}.
+     */
     private ModelValidationResult validationResult;
 
+    /**
+     * Creates a new exception with specified detail message and validation result.
+     * 
+     * @param message The detail message, may be {@code null}.
+     * @param validationResult The validation result, may be {@code null}.
+     */
     public InvalidModelException( String message, ModelValidationResult validationResult )
     {
         super( message );
         this.validationResult = validationResult;
     }
 
+    /**
+     * Creates a new exception with specified detail message and cause.
+     * 
+     * @param message The detail message, may be {@code null}.
+     * @param cause The cause, may be {@code null}.
+     */
     public InvalidModelException( String message, Throwable cause )
     {
         super( message, cause );
@@ -45,6 +60,11 @@
         validationResult.addMessage( ( cause != null ) ? cause.getMessage() : message );
     }
 
+    /**
+     * Gets the validation result.
+     * 
+     * @return The validation result or {@code null} if unknown.
+     */
     public ModelValidationResult getValidationResult()
     {
         return validationResult;

Modified: maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/InvalidProfileException.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/InvalidProfileException.java?rev=780636&r1=780635&r2=780636&view=diff
==============================================================================
--- maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/InvalidProfileException.java (original)
+++ maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/InvalidProfileException.java Mon Jun  1 12:48:22 2009
@@ -47,9 +47,9 @@
     }
 
     /**
-     * Gets the profile that causes this error (if any).
+     * Gets the profile that caused this error (if any).
      * 
-     * @return The profile that causes this error or {@code null} if not applicable.
+     * @return The profile that caused this error or {@code null} if not applicable.
      */
     public Profile getProfile()
     {

Modified: maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/ModelBuildingException.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/ModelBuildingException.java?rev=780636&r1=780635&r2=780636&view=diff
==============================================================================
--- maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/ModelBuildingException.java (original)
+++ maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/ModelBuildingException.java Mon Jun  1 12:48:22 2009
@@ -28,11 +28,22 @@
     extends Exception
 {
 
+    /**
+     * Creates a new exception with specified detail message.
+     * 
+     * @param message The detail message, may be {@code null}.
+     */
     public ModelBuildingException( String message )
     {
         super( message );
     }
 
+    /**
+     * Creates a new exception with specified detail message and cause.
+     * 
+     * @param message The detail message, may be {@code null}.
+     * @param cause The cause, may be {@code null}.
+     */
     public ModelBuildingException( String message, Throwable cause )
     {
         super( message, cause );

Modified: maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/UnresolvableParentException.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/UnresolvableParentException.java?rev=780636&r1=780635&r2=780636&view=diff
==============================================================================
--- maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/UnresolvableParentException.java (original)
+++ maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/UnresolvableParentException.java Mon Jun  1 12:48:22 2009
@@ -28,11 +28,22 @@
     extends ModelBuildingException
 {
 
+    /**
+     * Creates a new exception with specified detail message and cause.
+     * 
+     * @param message The detail message, may be {@code null}.
+     * @param cause The cause, may be {@code null}.
+     */
     public UnresolvableParentException( String message, Throwable cause )
     {
         super( message, cause );
     }
 
+    /**
+     * Creates a new exception with specified detail message.
+     * 
+     * @param message The detail message, may be {@code null}.
+     */
     public UnresolvableParentException( String message )
     {
         super( message );

Modified: maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/io/DefaultModelReader.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/io/DefaultModelReader.java?rev=780636&r1=780635&r2=780636&view=diff
==============================================================================
--- maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/io/DefaultModelReader.java (original)
+++ maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/io/DefaultModelReader.java Mon Jun  1 12:48:22 2009
@@ -72,7 +72,7 @@
         }
         catch ( XmlPullParserException e )
         {
-            throw new ModelParseException( e.getMessage(), e, e.getLineNumber(), e.getColumnNumber() );
+            throw new ModelParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e );
         }
         finally
         {
@@ -95,7 +95,7 @@
         }
         catch ( XmlPullParserException e )
         {
-            throw new ModelParseException( e.getMessage(), e, e.getLineNumber(), e.getColumnNumber() );
+            throw new ModelParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e );
         }
         finally
         {

Modified: maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/io/ModelParseException.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/io/ModelParseException.java?rev=780636&r1=780635&r2=780636&view=diff
==============================================================================
--- maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/io/ModelParseException.java (original)
+++ maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/io/ModelParseException.java Mon Jun  1 12:48:22 2009
@@ -58,11 +58,11 @@
      * Creates a new parser exception with the specified details.
      * 
      * @param message The error message, may be {@code null}.
-     * @param cause The nested cause of this error, may be {@code null}.
      * @param lineNumber The one-based index of the line containing the error or {@code -1} if unknown.
      * @param columnNumber The one-based index of the column containing the error or {@code -1} if unknown.
+     * @param cause The nested cause of this error, may be {@code null}.
      */
-    public ModelParseException( String message, Throwable cause, int lineNumber, int columnNumber )
+    public ModelParseException( String message, int lineNumber, int columnNumber, Throwable cause )
     {
         super( message );
         initCause( cause );

Modified: maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/ProfileActivationException.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/ProfileActivationException.java?rev=780636&r1=780635&r2=780636&view=diff
==============================================================================
--- maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/ProfileActivationException.java (original)
+++ maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/ProfileActivationException.java Mon Jun  1 12:48:22 2009
@@ -38,11 +38,11 @@
     /**
      * Creates a new exception with specified detail message and cause for the given profile.
      * 
-     * @param profile The profile that caused the error, may be {@code null}.
      * @param message The detail message, may be {@code null}.
+     * @param profile The profile that caused the error, may be {@code null}.
      * @param cause The cause, may be {@code null}.
      */
-    public ProfileActivationException( Profile profile, String message, Throwable cause )
+    public ProfileActivationException( String message, Profile profile, Throwable cause )
     {
         super( message, cause );
         this.profile = profile;
@@ -51,18 +51,18 @@
     /**
      * Creates a new exception with specified detail message for the given profile.
      * 
-     * @param profile The profile that caused the error, may be {@code null}.
      * @param message The detail message, may be {@code null}.
+     * @param profile The profile that caused the error, may be {@code null}.
      */
-    public ProfileActivationException( Profile profile, String message )
+    public ProfileActivationException( String message, Profile profile )
     {
         super( message );
     }
 
     /**
-     * Gets the profile that causes this error (if any).
+     * Gets the profile that caused this error (if any).
      * 
-     * @return The profile that causes this error or {@code null} if not applicable.
+     * @return The profile that caused this error or {@code null} if not applicable.
      */
     public Profile getProfile()
     {

Modified: maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/activator/FileProfileActivator.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/activator/FileProfileActivator.java?rev=780636&r1=780635&r2=780636&view=diff
==============================================================================
--- maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/activator/FileProfileActivator.java (original)
+++ maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/activator/FileProfileActivator.java Mon Jun  1 12:48:22 2009
@@ -68,9 +68,8 @@
                     }
                     catch ( Exception e )
                     {
-                        throw new ProfileActivationException( profile,
-                                                              "Failed to interpolate file location for profile "
-                                                                  + profile.getId() + ": " + existingPath );
+                        throw new ProfileActivationException( "Failed to interpolate file location for profile "
+                            + profile.getId() + ": " + existingPath, profile );
                     }
                     active = new File( existingPath ).exists();
                 }
@@ -82,9 +81,8 @@
                     }
                     catch ( Exception e )
                     {
-                        throw new ProfileActivationException( profile,
-                                                              "Failed to interpolate file location for profile "
-                                                                  + profile.getId() + ": " + existingPath );
+                        throw new ProfileActivationException( "Failed to interpolate file location for profile "
+                            + profile.getId() + ": " + existingPath, profile );
                     }
                     active = !new File( missingPath ).exists();
                 }

Modified: maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/activator/JdkVersionProfileActivator.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/activator/JdkVersionProfileActivator.java?rev=780636&r1=780635&r2=780636&view=diff
==============================================================================
--- maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/activator/JdkVersionProfileActivator.java (original)
+++ maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/activator/JdkVersionProfileActivator.java Mon Jun  1 12:48:22 2009
@@ -56,8 +56,8 @@
 
                 if ( version.length() <= 0 )
                 {
-                    throw new ProfileActivationException( profile, "Failed to determine Java version for profile "
-                        + profile.getId() );
+                    throw new ProfileActivationException( "Failed to determine Java version for profile "
+                        + profile.getId(), profile );
                 }
 
                 if ( jdk.startsWith( "!" ) )

Modified: maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/activator/PropertyProfileActivator.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/activator/PropertyProfileActivator.java?rev=780636&r1=780635&r2=780636&view=diff
==============================================================================
--- maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/activator/PropertyProfileActivator.java (original)
+++ maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/profile/activator/PropertyProfileActivator.java Mon Jun  1 12:48:22 2009
@@ -55,9 +55,8 @@
 
                 if ( name == null )
                 {
-                    throw new ProfileActivationException( profile,
-                                                          "The property name is required to activate the profile "
-                                                              + profile.getId() );
+                    throw new ProfileActivationException( "The property name is required to activate the profile "
+                        + profile.getId(), profile );
                 }
 
                 if ( name.startsWith( "!" ) )

Modified: maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/resolver/InvalidRepositoryException.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/resolver/InvalidRepositoryException.java?rev=780636&r1=780635&r2=780636&view=diff
==============================================================================
--- maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/resolver/InvalidRepositoryException.java (original)
+++ maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/resolver/InvalidRepositoryException.java Mon Jun  1 12:48:22 2009
@@ -30,6 +30,9 @@
     extends Exception
 {
 
+    /**
+     * The repository that raised this error, can be {@code null}.
+     */
     private Repository repository;
 
     /**