summaryrefslogtreecommitdiff
path: root/compiler/src/main
diff options
context:
space:
mode:
authorYigit Boyar <yboyar@google.com>2015-10-07 17:51:33 -0700
committerYigit Boyar <yboyar@google.com>2015-10-07 17:51:33 -0700
commitd3dc1b70aa71e8343dbf5e05a2feeb72bb29b6ec (patch)
treec69e8632792ee02a8cee79703d6353834ee19eba /compiler/src/main
parent8510dab6a17ccd59a2a9cbc07f900dfc2f11ff2b (diff)
downloaddata-binding-d3dc1b70aa71e8343dbf5e05a2feeb72bb29b6ec.tar.gz
Fix tag check in data binding mapper
This CL fixes a bug in data binding mapper where if the View's tag does not match one of the expected tags, it would fall through to the ext case statemet which would result in a meaningless error. This CL detects the case and throws an exception. This case should not happen since it is not a supported case but happened here due to another bug Bug: 24745000 Change-Id: Ic5c6d4ce2da6ad043fb6fe56cd0847c98ea2472d
Diffstat (limited to 'compiler/src/main')
-rw-r--r--compiler/src/main/kotlin/android/databinding/tool/writer/DataBinderWriter.kt1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/src/main/kotlin/android/databinding/tool/writer/DataBinderWriter.kt b/compiler/src/main/kotlin/android/databinding/tool/writer/DataBinderWriter.kt
index 9b26c51b..54d16af4 100644
--- a/compiler/src/main/kotlin/android/databinding/tool/writer/DataBinderWriter.kt
+++ b/compiler/src/main/kotlin/android/databinding/tool/writer/DataBinderWriter.kt
@@ -52,6 +52,7 @@ class DataBinderWriter(val pkg: String, val projectPackage: String, val classNam
}
} tab("}")
}
+ tab("throw new java.lang.IllegalArgumentException(\"The tag for ${firstVal.getLayoutname()} is invalid. Received: \" + tag);");
}tab("}")
}