Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6815] Android: Modules: Rhino: Base proxy created instead of derived proxy

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-02-10T00:15:02.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sSprint 2012-01, Release 2.0.0, Release 1.8.1
ComponentsAndroid
Labelsmodule_module, qe-testadded
ReporterJeff English
AssigneeOpie Cyrus
Created2011-12-21T10:17:30.000+0000
Updated2012-02-10T00:15:02.000+0000

Description

If you have a proxy class in your module and then you subclass that proxy class with another and both are marked as 'creatableInModule', when you create an instance of the derived proxy class in your JavaScript it will actually create an instance of the base class instead of the derived class. This works correctly on V8 but fails on Rhino. Base Class:
@Kroll.proxy(creatableInModule = HarnessModule.class)
public class LifeCycleProxy extends KrollProxy
{
	public LifeCycleProxy()
	{
		super();
		Log.e("BUGBUG", "LifeCycleProxy");
	}
}
Derived Class:
@Kroll.proxy(creatableInModule = HarnessModule.class)
public class KrollDemoProxy extends LifeCycleProxy
{
	public KrollDemoProxy()
	{
		super();
		Log.e("BUGBUG", "KrollDemoProxy");
	}
}
JavaScript code:
Ti.API.info("Creating Kroll Demo");
harness.createKrollDemo();

Ti.API.info("Creating LifeCycle");
harness.createLifeCycle();
This will output the following sequence on Rhino:
Creating Kroll Demo
LifeCycleProxy
Creating LifeCycle
LifeCycleProxy
But the correct output on V8:
Creating Kroll Demo
LifeCycleProxy
KrollDemoProxy
Creating LifeCycle
LifeCycleProxy

Attachments

FileDateSize
harness.zip2011-12-21T10:17:54.000+000023684
ti.harness-android-0.1.zip2012-01-04T10:47:52.000+000034417

Comments

  1. Jeff English 2011-12-21

    Sample module that demonstrates the issue
  2. Jeff English 2012-01-04

    Module built with TiSDK 1.8.0.1
  3. Wilson Luu 2012-01-12

    Closing bug. Verified fix on: SDK build: 1.9.0.v20120112104633 Runtime: V8, Rhino Titanium Studio, build: 1.0.8.201201111843 Device: Droid 3 (2.3.4) Note to QE: When testing, attached module or module from scratch are valid tests for this bug.

JSON Source