Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: mojo/public/tools/bindings/pylib/mojom/generate/module.py

Issue 514293002: Mojo: validate nullability in Java bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add example Foo.java. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/public/tools/bindings/pylib/mojom/generate/module.py
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/module.py b/mojo/public/tools/bindings/pylib/mojom/generate/module.py
index b73c93766d56469e2644df7b9c8fbe46f3832d12..dd5ece9c1d2978a913685f53594a2c862b55641e 100644
--- a/mojo/public/tools/bindings/pylib/mojom/generate/module.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/module.py
@@ -377,8 +377,12 @@ def IsEnumKind(kind):
return isinstance(kind, Enum)
+def IsReferenceKind(kind):
+ return isinstance(kind, ReferenceKind)
+
+
def IsNullableKind(kind):
- return isinstance(kind, ReferenceKind) and kind.is_nullable
+ return IsReferenceKind(kind) and kind.is_nullable
def IsAnyArrayKind(kind):

Powered by Google App Engine
This is Rietveld 408576698