appcelerator/hyperloop-java — pull request #7 by infosia (2014-06-13 05:59:40+00:00)
Title: Implement constructor overloading

Use Hyperloop.method to define overloaded constructor, instead of dynamic instance type detection.

Before:
```javascript
var s = new java.lang.String('hello');
var s2 = new java.lang.String(['h','e','l','l','o']);
var b = new java.lang.Boolean(true);
var d = new java.lang.Double(123);
var l = new java.lang.Long(456);
var s = new java.lang.Short(1);
var i = new java.lang.Integer(9);
```

After:
```javascript
"use hyperloop"
var s = Hyperloop.method('java.lang.String', '(java.lang.String)').call('hello');
var s2 = Hyperloop.method('java.lang.String', '(char[])').call(['h','e','l','l','o']);
var b = Hyperloop.method('java.lang.Boolean', '(boolean)').call(true);
var d = Hyperloop.method('java.lang.Double', '(double)').call(123);
var l = Hyperloop.method('java.lang.Long', '(long)').call(456);
var s = Hyperloop.method('java.lang.Short', '(short)').call(1);
var i = Hyperloop.method('java.lang.Integer', '(int)').call(9);
```

You can still use "new" to call default constructor like below:

```javascript
var obj = new java.lang.Object();
```