Add new compiler warning patterns

* Mostly new Java and Kotlin warnings found in nightly builds.
* More clean up of Java and C++ warning patterns will follow.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Change-Id: I8776401d15c3a59535722d52a5eec03f954d3b15
diff --git a/tools/warn/other_warn_patterns.py b/tools/warn/other_warn_patterns.py
index 45d14dc..524673e 100644
--- a/tools/warn/other_warn_patterns.py
+++ b/tools/warn/other_warn_patterns.py
@@ -39,6 +39,10 @@
   return warn('asm', Severity.MEDIUM, description, pattern_list)
 
 
+def kotlin(description, pattern_list):
+  return warn('Kotlin', Severity.MEDIUM, description, pattern_list)
+
+
 patterns = [
     # pylint:disable=line-too-long,g-inconsistent-quotes
     # aapt warnings
@@ -96,16 +100,16 @@
      'description': 'Proto: Import not used',
      'patterns': [r".*: warning: Import .*/.*\.proto but not used.$"]},
     # Kotlin warnings
-    {'category': 'Kotlin', 'severity': Severity.MEDIUM,
-     'description': 'Kotlin: never used parameter or variable',
-     'patterns': [r".*: warning: (parameter|variable) '.*' is never used$"]},
-    {'category': 'Kotlin', 'severity': Severity.MEDIUM,
-     'description': 'Kotlin: Deprecated in Java',
-     'patterns': [r".*: warning: '.*' is deprecated. Deprecated in Java"]},
-    {'category': 'Kotlin', 'severity': Severity.MEDIUM,
-     'description': 'Kotlin: library has Kotlin runtime',
-     'patterns': [r".*: warning: library has Kotlin runtime bundled into it",
-                  r".*: warning: some JAR files .* have the Kotlin Runtime library"]},
+    kotlin('never used parameter or variable',
+           [r".*\.kt:.*: warning: (parameter|variable) '.*' is never used$",
+            r".*\.kt:.*: warning: (parameter|variable) '.*' is never used, could be renamed to _$"]),
+    kotlin('unchecked cast',
+           [r".*\.kt:.*: warning: unchecked cast: .* to .*$"]),
+    kotlin('Deprecated in Java',
+           [r".*\.kt:.*: warning: '.*' is deprecated. Deprecated in Java"]),
+    kotlin('library has Kotlin runtime',
+           [r".*: warning: library has Kotlin runtime bundled into it",
+            r".*: warning: some JAR files .* have the Kotlin Runtime library"]),
     # Rust warnings
     {'category': 'Rust', 'severity': Severity.HIGH,
      'description': 'Rust: Does not derive Copy',