Repository: reef
Updated Branches:
  refs/heads/master 9ff81875a -> cd89c5364


[REEF-1113] Update IllegalInstantiation checkstyle check

This patch:
 * Adds the IllegalInstantiation check to checkstyle.xml and 
checkstyle-strict.xml
   to detect instantiations of Throwable and Error
 * Configures as ignored the violation of the check in the REEF Java codebase

JIRA:
 [REEF-1113] (https://issues.apache.org/jira/browse/REEF-1113)

Pull request:
  This closes #781


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

Branch: refs/heads/master
Commit: cd89c5364df359622b9c2724d386b815d4c1614d
Parents: 9ff8187
Author: [email protected] <[email protected]>
Authored: Wed Jan 20 14:58:21 2016 +0100
Committer: Mariia Mykhailova <[email protected]>
Committed: Wed Jan 20 13:08:18 2016 -0800

----------------------------------------------------------------------
 lang/java/reef-common/src/main/resources/checkstyle-strict.xml   | 4 ++++
 lang/java/reef-common/src/main/resources/checkstyle.xml          | 4 ++++
 .../org/apache/reef/tang/implementation/StackBindLocation.java   | 1 +
 3 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/reef/blob/cd89c536/lang/java/reef-common/src/main/resources/checkstyle-strict.xml
----------------------------------------------------------------------
diff --git a/lang/java/reef-common/src/main/resources/checkstyle-strict.xml 
b/lang/java/reef-common/src/main/resources/checkstyle-strict.xml
index 9278cec..ce75ec3 100644
--- a/lang/java/reef-common/src/main/resources/checkstyle-strict.xml
+++ b/lang/java/reef-common/src/main/resources/checkstyle-strict.xml
@@ -242,6 +242,10 @@
             <property name="illegalClassNames" value="Throwable, 
RuntimeException, Error" />
         </module>
 
+        <module name="IllegalInstantiation">
+            <property name="classes" value="java.lang.Throwable, 
java.lang.Error"/>
+        </module>
+
     </module>
 
 </module>

http://git-wip-us.apache.org/repos/asf/reef/blob/cd89c536/lang/java/reef-common/src/main/resources/checkstyle.xml
----------------------------------------------------------------------
diff --git a/lang/java/reef-common/src/main/resources/checkstyle.xml 
b/lang/java/reef-common/src/main/resources/checkstyle.xml
index 4c7b2f2..af0b527 100644
--- a/lang/java/reef-common/src/main/resources/checkstyle.xml
+++ b/lang/java/reef-common/src/main/resources/checkstyle.xml
@@ -244,6 +244,10 @@
             <property name="illegalClassNames" value="Throwable, 
RuntimeException, Error" />
         </module>
 
+        <module name="IllegalInstantiation">
+            <property name="classes" value="java.lang.Throwable, 
java.lang.Error"/>
+        </module>
+
     </module>
 
 </module>

http://git-wip-us.apache.org/repos/asf/reef/blob/cd89c536/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/implementation/StackBindLocation.java
----------------------------------------------------------------------
diff --git 
a/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/implementation/StackBindLocation.java
 
b/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/implementation/StackBindLocation.java
index 8a6c662..7aa3320 100644
--- 
a/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/implementation/StackBindLocation.java
+++ 
b/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/implementation/StackBindLocation.java
@@ -22,6 +22,7 @@ import org.apache.reef.tang.BindLocation;
 
 import java.util.Arrays;
 
+@SuppressWarnings("checkstyle:illegalinstantiation")
 public class StackBindLocation implements BindLocation {
   private final StackTraceElement[] stack;
 

Reply via email to