Browse Source

Ban dangerous methods of java.lang.Thread (#19677)

Ban dangerous methods of java.lang.Thread

With this commit we disallow usage of the method Thread.stop().
Daniel Mitterdorfer 9 years ago
parent
commit
88cbfbaabd
1 changed files with 4 additions and 0 deletions
  1. 4 0
      buildSrc/src/main/resources/forbidden/jdk-signatures.txt

+ 4 - 0
buildSrc/src/main/resources/forbidden/jdk-signatures.txt

@@ -86,6 +86,10 @@ java.lang.reflect.AccessibleObject#setAccessible(java.lang.reflect.AccessibleObj
 @defaultMessage this method needs special permission
 java.lang.Thread#getAllStackTraces()
 
+@defaultMessage Stopping threads explicitly leads to inconsistent states. Use interrupt() instead.
+java.lang.Thread#stop()
+java.lang.Thread#stop(java.lang.Throwable)
+
 @defaultMessage Please do not terminate the application
 java.lang.System#exit(int)
 java.lang.Runtime#exit(int)