Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Cannot Reproduce
-
2.4.0
-
None
-
None
Description
On Android, the following code crashes with exception:
Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'boom!' with class 'java.lang.String' to class 'int'
@CompileStatic public final class HomeActivity extends ActionBarActivity { private String result @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState) this.result = "boom!" } }
The reason is a base class declares `setResult` method: http://developer.android.com/reference/android/app/Activity.html#setResult%28int%29
Crash only happens when using
this.result = "boom!"
and not when
result = "boom!"