Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-414 [created] 8cd807acf


# IGNITE-414: Common construction API for all exceptions.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c24583c0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c24583c0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c24583c0

Branch: refs/heads/ignite-414
Commit: c24583c0fcbc79222c2d28446f732f728d863098
Parents: dab66dc
Author: vozerov-gridgain <voze...@gridgain.com>
Authored: Tue Mar 10 13:52:19 2015 +0300
Committer: vozerov-gridgain <voze...@gridgain.com>
Committed: Tue Mar 10 13:52:19 2015 +0300

----------------------------------------------------------------------
 .../IgfsConcurrentModificationException.java    | 29 +++++++++++++++++---
 .../ignite/igfs/IgfsCorruptedFileException.java | 16 +++++++----
 .../igfs/IgfsDirectoryNotEmptyException.java    | 20 ++++++++++++--
 .../org/apache/ignite/igfs/IgfsException.java   | 16 +++++------
 .../igfs/IgfsInvalidHdfsVersionException.java   | 23 +++++++++++++---
 .../ignite/igfs/IgfsInvalidPathException.java   | 16 +++++------
 .../ignite/igfs/IgfsOutOfSpaceException.java    | 16 +++++------
 .../igfs/IgfsParentNotDirectoryException.java   | 18 ++++++++----
 .../igfs/IgfsPathAlreadyExistsException.java    | 16 +++++++----
 .../ignite/igfs/IgfsPathNotFoundException.java  | 20 +++++++++++---
 .../processors/igfs/IgfsMetaManager.java        |  3 +-
 11 files changed, 137 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c24583c0/modules/core/src/main/java/org/apache/ignite/igfs/IgfsConcurrentModificationException.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsConcurrentModificationException.java
 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsConcurrentModificationException.java
index 3c7e970..63ff70e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsConcurrentModificationException.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsConcurrentModificationException.java
@@ -17,6 +17,8 @@
 
 package org.apache.ignite.igfs;
 
+import org.jetbrains.annotations.*;
+
 /**
  * {@code IGFS} exception indicating that file system structure was modified 
concurrently. This error
  * indicates that an operation performed in DUAL mode cannot proceed due to 
these changes.
@@ -26,11 +28,30 @@ public class IgfsConcurrentModificationException extends 
IgfsException {
     private static final long serialVersionUID = 0L;
 
     /**
-     * Creates new exception.
+     * Constructor.
+     *
+     * @param msg Message.
+     */
+    public IgfsConcurrentModificationException(String msg) {
+        super(msg);
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param cause Cause.
+     */
+    public IgfsConcurrentModificationException(Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * Constructor.
      *
-     * @param path Affected path.
+     * @param msg Message.
+     * @param cause Cause.
      */
-    public IgfsConcurrentModificationException(IgfsPath path) {
-        super("File system entry has been modified concurrently: " + path, 
null);
+    public IgfsConcurrentModificationException(@Nullable String msg, @Nullable 
Throwable cause) {
+        super(msg, cause);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c24583c0/modules/core/src/main/java/org/apache/ignite/igfs/IgfsCorruptedFileException.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsCorruptedFileException.java
 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsCorruptedFileException.java
index dea19e8..c2a6fd8 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsCorruptedFileException.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsCorruptedFileException.java
@@ -27,24 +27,30 @@ public class IgfsCorruptedFileException extends 
IgfsException {
     private static final long serialVersionUID = 0L;
 
     /**
-     * @param msg Error message.
+     * Constructor.
+     *
+     * @param msg Message.
      */
     public IgfsCorruptedFileException(String msg) {
         super(msg);
     }
 
     /**
-     * @param cause Error cause.
+     * Constructor.
+     *
+     * @param cause Cause.
      */
     public IgfsCorruptedFileException(Throwable cause) {
         super(cause);
     }
 
     /**
-     * @param msg Error message.
-     * @param cause Error cause.
+     * Constructor.
+     *
+     * @param msg Message.
+     * @param cause Cause.
      */
-    public IgfsCorruptedFileException(String msg, @Nullable Throwable cause) {
+    public IgfsCorruptedFileException(@Nullable String msg, @Nullable 
Throwable cause) {
         super(msg, cause);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c24583c0/modules/core/src/main/java/org/apache/ignite/igfs/IgfsDirectoryNotEmptyException.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsDirectoryNotEmptyException.java
 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsDirectoryNotEmptyException.java
index 38a7eaf..2df6faa 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsDirectoryNotEmptyException.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsDirectoryNotEmptyException.java
@@ -17,6 +17,8 @@
 
 package org.apache.ignite.igfs;
 
+import org.jetbrains.annotations.*;
+
 /**
  * Exception indicating that directory can not be deleted because it is not 
empty.
  */
@@ -25,18 +27,30 @@ public class IgfsDirectoryNotEmptyException extends 
IgfsException {
     private static final long serialVersionUID = 0L;
 
     /**
-     * @param msg Exception message.
+     * Constructor.
+     *
+     * @param msg Message.
      */
     public IgfsDirectoryNotEmptyException(String msg) {
         super(msg);
     }
 
     /**
-     * Creates an instance of IGFS exception caused by nested exception.
+     * Constructor.
      *
-     * @param cause Exception cause.
+     * @param cause Cause.
      */
     public IgfsDirectoryNotEmptyException(Throwable cause) {
         super(cause);
     }
+
+    /**
+     * Constructor.
+     *
+     * @param msg Message.
+     * @param cause Cause.
+     */
+    public IgfsDirectoryNotEmptyException(@Nullable String msg, @Nullable 
Throwable cause) {
+        super(msg, cause);
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c24583c0/modules/core/src/main/java/org/apache/ignite/igfs/IgfsException.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsException.java 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsException.java
index a704fe8..630be38 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsException.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsException.java
@@ -28,30 +28,30 @@ public class IgfsException extends IgniteException {
     private static final long serialVersionUID = 0L;
 
     /**
-     * Creates an instance of IGFS exception with descriptive error message.
+     * Constructor.
      *
-     * @param msg Error message.
+     * @param msg Message.
      */
     public IgfsException(String msg) {
         super(msg);
     }
 
     /**
-     * Creates an instance of IGFS exception caused by nested exception.
+     * Constructor.
      *
-     * @param cause Exception cause.
+     * @param cause Cause.
      */
     public IgfsException(Throwable cause) {
         super(cause);
     }
 
     /**
-     * Creates an instance of IGFS exception with error message and underlying 
cause.
+     * Constructor.
      *
-     * @param msg Error message.
-     * @param cause Exception cause.
+     * @param msg Message.
+     * @param cause Cause.
      */
-    public IgfsException(String msg, @Nullable Throwable cause) {
+    public IgfsException(@Nullable String msg, @Nullable Throwable cause) {
         super(msg, cause);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c24583c0/modules/core/src/main/java/org/apache/ignite/igfs/IgfsInvalidHdfsVersionException.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsInvalidHdfsVersionException.java
 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsInvalidHdfsVersionException.java
index 4375d47..4b4a72e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsInvalidHdfsVersionException.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsInvalidHdfsVersionException.java
@@ -17,6 +17,8 @@
 
 package org.apache.ignite.igfs;
 
+import org.jetbrains.annotations.*;
+
 /**
  * Exception thrown when Ignite detects that remote HDFS version differs from 
version of HDFS libraries
  * in Ignite classpath.
@@ -26,17 +28,30 @@ public class IgfsInvalidHdfsVersionException extends 
IgfsException {
     private static final long serialVersionUID = 0L;
 
     /**
-     * @param msg Error message.
+     * Constructor.
+     *
+     * @param msg Message.
      */
     public IgfsInvalidHdfsVersionException(String msg) {
         super(msg);
     }
 
     /**
-     * @param msg Error message.
-     * @param cause Error cause.
+     * Constructor.
+     *
+     * @param cause Cause.
+     */
+    public IgfsInvalidHdfsVersionException(Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param msg Message.
+     * @param cause Cause.
      */
-    public IgfsInvalidHdfsVersionException(String msg, Throwable cause) {
+    public IgfsInvalidHdfsVersionException(@Nullable String msg, @Nullable 
Throwable cause) {
         super(msg, cause);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c24583c0/modules/core/src/main/java/org/apache/ignite/igfs/IgfsInvalidPathException.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsInvalidPathException.java
 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsInvalidPathException.java
index bb7b5da..8049afe 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsInvalidPathException.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsInvalidPathException.java
@@ -28,30 +28,30 @@ public class IgfsInvalidPathException extends IgfsException 
{
     private static final long serialVersionUID = 0L;
 
     /**
-     * Creates exception with given error message.
+     * Constructor.
      *
-     * @param msg Error message.
+     * @param msg Message.
      */
     public IgfsInvalidPathException(String msg) {
         super(msg);
     }
 
     /**
-     * Creates exception with given exception cause.
+     * Constructor.
      *
-     * @param cause Exception cause.
+     * @param cause Cause.
      */
     public IgfsInvalidPathException(Throwable cause) {
         super(cause);
     }
 
     /**
-     * Creates exception with given error message and exception cause.
+     * Constructor.
      *
-     * @param msg Error message.
-     * @param cause Error cause.
+     * @param msg Message.
+     * @param cause Cause.
      */
-    public IgfsInvalidPathException(String msg, @Nullable Throwable cause) {
+    public IgfsInvalidPathException(@Nullable String msg, @Nullable Throwable 
cause) {
         super(msg, cause);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c24583c0/modules/core/src/main/java/org/apache/ignite/igfs/IgfsOutOfSpaceException.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsOutOfSpaceException.java
 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsOutOfSpaceException.java
index a4fd60e..029afff 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsOutOfSpaceException.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsOutOfSpaceException.java
@@ -29,30 +29,30 @@ public class IgfsOutOfSpaceException extends IgfsException {
     private static final long serialVersionUID = 0L;
 
     /**
-     * Creates exception with given error message.
+     * Constructor.
      *
-     * @param msg Error message.
+     * @param msg Message.
      */
     public IgfsOutOfSpaceException(String msg) {
         super(msg);
     }
 
     /**
-     * Creates an instance of exception with given exception cause.
+     * Constructor.
      *
-     * @param cause Exception cause.
+     * @param cause Cause.
      */
     public IgfsOutOfSpaceException(Throwable cause) {
         super(cause);
     }
 
     /**
-     * Creates an instance of IGFS exception with given error message and 
given exception cause.
+     * Constructor.
      *
-     * @param msg Error message.
-     * @param cause Exception cause.
+     * @param msg Message.
+     * @param cause Cause.
      */
-    public IgfsOutOfSpaceException(String msg, @Nullable Throwable cause) {
+    public IgfsOutOfSpaceException(@Nullable String msg, @Nullable Throwable 
cause) {
         super(msg, cause);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c24583c0/modules/core/src/main/java/org/apache/ignite/igfs/IgfsParentNotDirectoryException.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsParentNotDirectoryException.java
 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsParentNotDirectoryException.java
index 62d8887..86e1167 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsParentNotDirectoryException.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsParentNotDirectoryException.java
@@ -27,24 +27,30 @@ public class IgfsParentNotDirectoryException extends 
IgfsInvalidPathException {
     private static final long serialVersionUID = 0L;
 
     /**
-     * @param msg Error message.
+     * Constructor.
+     *
+     * @param msg Message.
      */
     public IgfsParentNotDirectoryException(String msg) {
         super(msg);
     }
 
     /**
-     * @param cause Exception cause.
+     * Constructor.
+     *
+     * @param cause Cause.
      */
     public IgfsParentNotDirectoryException(Throwable cause) {
         super(cause);
     }
 
     /**
-     * @param msg Error message.
-     * @param cause Exception cause.
+     * Constructor.
+     *
+     * @param msg   Message.
+     * @param cause Cause.
      */
-    public IgfsParentNotDirectoryException(String msg, @Nullable Throwable 
cause) {
+    public IgfsParentNotDirectoryException(@Nullable String msg, @Nullable 
Throwable cause) {
         super(msg, cause);
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c24583c0/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathAlreadyExistsException.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathAlreadyExistsException.java
 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathAlreadyExistsException.java
index ca8b8a1..f8a39ca 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathAlreadyExistsException.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathAlreadyExistsException.java
@@ -27,24 +27,30 @@ public class IgfsPathAlreadyExistsException extends 
IgfsInvalidPathException {
     private static final long serialVersionUID = 0L;
 
     /**
-     * @param msg Error message.
+     * Constructor.
+     *
+     * @param msg Message.
      */
     public IgfsPathAlreadyExistsException(String msg) {
         super(msg);
     }
 
     /**
-     * @param cause Exception cause.
+     * Constructor.
+     *
+     * @param cause Cause.
      */
     public IgfsPathAlreadyExistsException(Throwable cause) {
         super(cause);
     }
 
     /**
-     * @param msg Error message.
-     * @param cause Exception cause.
+     * Constructor.
+     *
+     * @param msg   Message.
+     * @param cause Cause.
      */
-    public IgfsPathAlreadyExistsException(String msg, @Nullable Throwable 
cause) {
+    public IgfsPathAlreadyExistsException(@Nullable String msg, @Nullable 
Throwable cause) {
         super(msg, cause);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c24583c0/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathNotFoundException.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathNotFoundException.java
 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathNotFoundException.java
index 1f6a6ad..46ada9a 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathNotFoundException.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathNotFoundException.java
@@ -17,6 +17,8 @@
 
 package org.apache.ignite.igfs;
 
+import org.jetbrains.annotations.*;
+
 /**
  * {@code IGFS} exception indicating that target resource is not found.
  */
@@ -25,20 +27,30 @@ public class IgfsPathNotFoundException extends 
IgfsInvalidPathException {
     private static final long serialVersionUID = 0L;
 
     /**
-     * Creates exception with error message specified.
+     * Constructor.
      *
-     * @param msg Error message.
+     * @param msg Message.
      */
     public IgfsPathNotFoundException(String msg) {
         super(msg);
     }
 
     /**
-     * Creates exception with given exception cause.
+     * Constructor.
      *
-     * @param cause Exception cause.
+     * @param cause Cause.
      */
     public IgfsPathNotFoundException(Throwable cause) {
         super(cause);
     }
+
+    /**
+     * Constructor.
+     *
+     * @param msg   Message.
+     * @param cause Cause.
+     */
+    public IgfsPathNotFoundException(@Nullable String msg, @Nullable Throwable 
cause) {
+        super(msg, cause);
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c24583c0/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index d340089..cbc20d6 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -2452,7 +2452,8 @@ public class IgfsMetaManager extends IgfsManager {
                 if (changed != null) {
                     finished = true;
 
-                    throw fsException(new 
IgfsConcurrentModificationException(changed));
+                    throw fsException(new 
IgfsConcurrentModificationException("File system entry has been " +
+                        "modified concurrently: " + changed));
                 }
                 else {
                     boolean newParents = false;

Reply via email to