diff options
author | Bill Napier <napier@google.com> | 2011-08-22 10:21:27 -0700 |
---|---|---|
committer | Bill Napier <napier@google.com> | 2011-08-22 10:21:27 -0700 |
commit | 53e1475368763cbfc3b8730c1b4d4e2c542c54a5 (patch) | |
tree | 8c9a0d34cf5c90e79d21dc1188f3783c2b04dee2 /monkeyrunner | |
parent | 15e9f6bbf0819aae5248337b313492b5cf6241ae (diff) | |
download | sdk-53e1475368763cbfc3b8730c1b4d4e2c542c54a5.zip sdk-53e1475368763cbfc3b8730c1b4d4e2c542c54a5.tar.gz sdk-53e1475368763cbfc3b8730c1b4d4e2c542c54a5.tar.bz2 |
Fix CastClassException by using the right class.
Change-Id: I691ded197cfb47acfa1da12f48f6d7e50254bbc9
Diffstat (limited to 'monkeyrunner')
-rw-r--r-- | monkeyrunner/src/com/android/monkeyrunner/MonkeyImage.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/monkeyrunner/src/com/android/monkeyrunner/MonkeyImage.java b/monkeyrunner/src/com/android/monkeyrunner/MonkeyImage.java index 4480c22..bae6dc8 100644 --- a/monkeyrunner/src/com/android/monkeyrunner/MonkeyImage.java +++ b/monkeyrunner/src/com/android/monkeyrunner/MonkeyImage.java @@ -26,7 +26,6 @@ import org.python.core.PyInteger; import org.python.core.PyObject; import org.python.core.PyTuple; -import java.awt.image.BufferedImage; import java.util.logging.Logger; /** @@ -40,7 +39,7 @@ public class MonkeyImage extends PyObject implements ClassDictInit { JythonUtils.convertDocAnnotationsForClass(MonkeyImage.class, dict); } - private IChimpImage impl; + private final IChimpImage impl; public MonkeyImage(IChimpImage impl) { this.impl = impl; @@ -134,9 +133,7 @@ public class MonkeyImage extends PyObject implements ClassDictInit { Preconditions.checkNotNull(ap); PyObject otherObject = ap.getPyObject(0); - // TODO: check if this conversion wortks - IChimpImage other = (IChimpImage) otherObject.__tojava__( - IChimpImage.class); + IChimpImage other = ((MonkeyImage) otherObject.__tojava__(MonkeyImage.class)).getImpl(); double percent = JythonUtils.getFloat(ap, 1, 1.0); |