@@ -81,7 +81,7 @@ Clazz.prepareCallback = function (objThis, args) {
8181 */
8282 obs [ className . replace ( / o r g \. e c l i p s e \. s w t \. / , "$wt." ) ] = classThisObj ;
8383 var clazz = Clazz . getClass ( classThisObj ) ;
84- while ( clazz . superClazz != null ) {
84+ while ( clazz != null && clazz . superClazz != null ) {
8585 clazz = clazz . superClazz ;
8686 //obs[Clazz.getClassName (clazz)] = classThisObj;
8787 /*
@@ -124,65 +124,77 @@ Clazz.innerTypeInstance = function (clazzInner, objThis, finalVars) {
124124 clazzInner = arguments . callee . caller ;
125125 }
126126 var obj = null ;
127- /*if (arguments.length == 2) {
128- obj = new clazzInner (objThis);
129- } else */ if ( arguments . length == 3 ) {
130- obj = new clazzInner ( objThis ) ;
131- } else if ( arguments . length == 4 ) {
132- if ( objThis . __CLASS_NAME__ == clazzInner . __CLASS_NAME__
133- && arguments [ 3 ] === Clazz . inheritArgs ) {
134- obj = objThis ;
127+ if ( finalVars == null && objThis . $finals == null ) {
128+ /*if (arguments.length == 2) {
129+ obj = new clazzInner (objThis);
130+ } else */ if ( arguments . length == 3 ) {
131+ obj = new clazzInner ( objThis ) ;
132+ } else if ( arguments . length == 4 ) {
133+ if ( objThis . __CLASS_NAME__ == clazzInner . __CLASS_NAME__
134+ && arguments [ 3 ] === Clazz . inheritArgs ) {
135+ obj = objThis ;
136+ } else {
137+ obj = new clazzInner ( objThis , arguments [ 3 ] ) ;
138+ }
139+ } else if ( arguments . length == 5 ) {
140+ obj = new clazzInner ( objThis , arguments [ 3 ] , arguments [ 4 ] ) ;
141+ } else if ( arguments . length == 6 ) {
142+ obj = new clazzInner ( objThis , arguments [ 3 ] , arguments [ 4 ] ,
143+ arguments [ 5 ] ) ;
144+ } else if ( arguments . length == 7 ) {
145+ obj = new clazzInner ( objThis , arguments [ 3 ] , arguments [ 4 ] ,
146+ arguments [ 5 ] , arguments [ 6 ] ) ;
147+ } else if ( arguments . length == 8 ) {
148+ obj = new clazzInner ( objThis , arguments [ 3 ] , arguments [ 4 ] ,
149+ arguments [ 5 ] , arguments [ 6 ] , arguments [ 7 ] ) ;
150+ } else if ( arguments . length == 9 ) {
151+ obj = new clazzInner ( objThis , arguments [ 3 ] , arguments [ 4 ] ,
152+ arguments [ 5 ] , arguments [ 6 ] , arguments [ 7 ] , arguments [ 8 ] ) ;
153+ } else if ( arguments . length == 10 ) {
154+ obj = new clazzInner ( objThis , arguments [ 3 ] , arguments [ 4 ] ,
155+ arguments [ 5 ] , arguments [ 6 ] , arguments [ 7 ] , arguments [ 8 ] ,
156+ arguments [ 9 ] ) ;
135157 } else {
136- obj = new clazzInner ( objThis , arguments [ 3 ] ) ;
158+ /*
159+ * Should construct instance manually.
160+ */
161+ obj = new clazzInner ( objThis , Clazz . inheritArgs ) ;
162+ //if (obj.construct == null) {
163+ // throw new String ("No support anonymous class constructor with "
164+ // + "more than 7 parameters.");
165+ //}
166+ var args = new Array ( ) ;
167+ for ( var i = 3 ; i < arguments . length ; i ++ ) {
168+ args [ i - 3 ] = arguments [ i ] ;
169+ }
170+ //obj.construct.apply (obj, args);
171+ Clazz . instantialize ( obj , args ) ;
137172 }
138- } else if ( arguments . length == 5 ) {
139- obj = new clazzInner ( objThis , arguments [ 3 ] , arguments [ 4 ] ) ;
140- } else if ( arguments . length == 6 ) {
141- obj = new clazzInner ( objThis , arguments [ 3 ] , arguments [ 4 ] ,
142- arguments [ 5 ] ) ;
143- } else if ( arguments . length == 7 ) {
144- obj = new clazzInner ( objThis , arguments [ 3 ] , arguments [ 4 ] ,
145- arguments [ 5 ] , arguments [ 6 ] ) ;
146- } else if ( arguments . length == 8 ) {
147- obj = new clazzInner ( objThis , arguments [ 3 ] , arguments [ 4 ] ,
148- arguments [ 5 ] , arguments [ 6 ] , arguments [ 7 ] ) ;
149- } else if ( arguments . length == 9 ) {
150- obj = new clazzInner ( objThis , arguments [ 3 ] , arguments [ 4 ] ,
151- arguments [ 5 ] , arguments [ 6 ] , arguments [ 7 ] , arguments [ 8 ] ) ;
152- } else if ( arguments . length == 10 ) {
153- obj = new clazzInner ( objThis , arguments [ 3 ] , arguments [ 4 ] ,
154- arguments [ 5 ] , arguments [ 6 ] , arguments [ 7 ] , arguments [ 8 ] ,
155- arguments [ 9 ] ) ;
156173 } else {
157- /*
158- * Should construct instance manually.
159- */
160- obj = new clazzInner ( ) ;
161- if ( obj . construct == null ) {
162- throw new String ( "No support anonymous class constructor with "
163- + "more than 7 parameters." ) ;
174+ obj = new clazzInner ( objThis , Clazz . inheritArgs ) ;
175+ // f$ is short for the once choosen "$finals"
176+ if ( finalVars != null && objThis . f$ == null ) {
177+ obj . f$ = finalVars ;
178+ } else if ( finalVars == null && objThis . f$ != null ) {
179+ obj . f$ = objThis . f$ ;
180+ } else if ( finalVars != null && objThis . f$ != null ) {
181+ var o = new Object ( ) ;
182+ for ( var attr in objThis . f$ ) {
183+ o [ attr ] = objThis . f$ [ attr ] ;
184+ }
185+ for ( var attr in finalVars ) {
186+ o [ attr ] = finalVars [ attr ] ;
187+ }
188+ obj . f$ = o ;
164189 }
190+
165191 var args = new Array ( ) ;
166192 for ( var i = 3 ; i < arguments . length ; i ++ ) {
167193 args [ i - 3 ] = arguments [ i ] ;
168194 }
169- obj . construct . apply ( obj , args ) ;
170- }
171- // f$ is short for the once choosen "$finals"
172- if ( finalVars != null && objThis . f$ == null ) {
173- obj . f$ = finalVars ;
174- } else if ( finalVars == null && objThis . f$ != null ) {
175- obj . f$ = objThis . f$ ;
176- } else if ( finalVars != null && objThis . f$ != null ) {
177- var o = new Object ( ) ;
178- for ( var attr in objThis . f$ ) {
179- o [ attr ] = objThis . f$ [ attr ] ;
180- }
181- for ( var attr in finalVars ) {
182- o [ attr ] = finalVars [ attr ] ;
183- }
184- obj . f$ = o ;
195+ Clazz . instantialize ( obj , args ) ;
185196 }
197+
186198 /*
187199 if (finalVars != null && objThis.$finals == null) {
188200 obj.$finals = finalVars;
@@ -685,6 +697,20 @@ System = {
685697 dest [ destPos + i ] = swap [ i ] ;
686698 }
687699 }
700+ } ,
701+ identityHashCode : function ( obj ) {
702+ if ( obj == null ) {
703+ return 0 ;
704+ }
705+ try {
706+ return obj . toString ( ) . hashCode ( ) ;
707+ } catch ( e ) {
708+ var str = ":" ;
709+ for ( var s in obj ) {
710+ str += s + ":"
711+ }
712+ return str . hashCode ( ) ;
713+ }
688714 }
689715} ;
690716System . out = new JavaObject ( ) ;
@@ -828,6 +854,19 @@ Clazz.int0RightShift = function (n, o) { // 64bit
828854 return n >>> o ; // no needs for this shifting wrapper
829855} ;
830856
857+ Clazz . floatToInt = function ( x ) {
858+ return x < 0 ? Math . ceil ( x ) : Math . floor ( x ) ;
859+ } ;
860+
861+ Clazz . floatToByte = Clazz . floatToShort = Clazz . floatToLong = Clazz . floatToInt ;
862+ Clazz . doubleToByte = Clazz . doubleToShort = Clazz . doubleToLong = Clazz . doubleToInt = Clazz . floatToInt ;
863+
864+ Clazz . floatToChar = function ( x ) {
865+ return String . fromCharCode ( x < 0 ? Math . ceil ( x ) : Math . floor ( x ) ) ;
866+ } ;
867+
868+ Clazz . doubleToChar = Clazz . floatToChar ;
869+
831870// Compress the common public API method in shorter name
832871$_L = Clazz . load ;
833872$_W = Clazz . declareAnonymous ;
@@ -842,6 +881,7 @@ $_P=Clazz.p0p;
842881$_B = Clazz . prepareCallback ;
843882$_N = Clazz . innerTypeInstance ;
844883$_K = Clazz . makeConstructor ;
884+ $_k = Clazz . overrideConstructor ;
845885$_U = Clazz . superCall ;
846886$_R = Clazz . superConstructor ;
847887$_M = Clazz . defineMethod ;
@@ -860,6 +900,16 @@ $_AB=Clazz.newByteArray;
860900$_AC = Clazz . newCharArray ;
861901$_Ab = Clazz . newBooleanArray ;
862902//$_AX=Clazz.newStringArray;
903+ $_fI = Clazz . floatToInt ;
904+ $_fS = Clazz . floatToShort ;
905+ $_fB = Clazz . floatToByte ;
906+ $_fL = Clazz . floatToLong ;
907+ $_fC = Clazz . floatToChar ;
908+ $_dI = Clazz . doubleToInt ;
909+ $_dS = Clazz . doubleToShort ;
910+ $_dB = Clazz . doubleToByte ;
911+ $_dL = Clazz . doubleToLong ;
912+ $_dC = Clazz . doubleToChar ;
863913$_O = Clazz . instanceOf ;
864914$_G = Clazz . inheritArgs ;
865915$_X = Clazz . checkPrivateMethod ;
@@ -976,6 +1026,12 @@ Clazz.cleanDelegateMethod = function (m) {
9761026 m . lastParams = null ;
9771027 m . lastClaxxRef = null ;
9781028 }
1029+ if ( typeof m == "function" && m . prevMethod != null
1030+ && m . prevParams != null && m . prevClaxxRef != null ) {
1031+ m . prevMethod = null ;
1032+ m . prevParams = null ;
1033+ m . prevClaxxRef = null ;
1034+ }
9791035} ;
9801036
9811037/* public */
0 commit comments