summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/Allocation.java
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2016-03-28 12:00:00 -0700
committerPirama Arumuga Nainar <pirama@google.com>2016-03-28 12:01:48 -0700
commit3934dadd58576cd269df4447ceadd27925174c1d (patch)
tree11ce32a3c10395918616e7c018934cf8ee38a2ab /rs/java/android/renderscript/Allocation.java
parent83b9db029b6fe02761e1c8e50eb8dce6f4d37d0f (diff)
[RenderScript] Fail with Exception from validateObjectIsPrimitiveArray
Bug: http://b/25982676 Instead of returning null from validateObjectIsPrimitiveArray, fail with an exception. The callers of this function do not check for null. Change-Id: Idd2b50a7b137e8d2db7a334bb9a48c1b19ee2403
Diffstat (limited to 'rs/java/android/renderscript/Allocation.java')
-rw-r--r--rs/java/android/renderscript/Allocation.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java
index fc9296674d89..f2ef06520b92 100644
--- a/rs/java/android/renderscript/Allocation.java
+++ b/rs/java/android/renderscript/Allocation.java
@@ -142,7 +142,10 @@ public class Allocation extends BaseObj {
}
return Element.DataType.FLOAT_64;
}
- return null;
+
+ throw new RSIllegalArgumentException("Parameter of type " + cmp.getSimpleName() +
+ "[] is not compatible with data type " + mType.mElement.mType.name() +
+ " of allocation");
}