@@ -81,7 +81,7 @@ Clazz.prepareCallback = function (objThis, args) {
81
81
*/
82
82
obs [ className . replace ( / o r g \. e c l i p s e \. s w t \. / , "$wt." ) ] = classThisObj ;
83
83
var clazz = Clazz . getClass ( classThisObj ) ;
84
- while ( clazz . superClazz != null ) {
84
+ while ( clazz != null && clazz . superClazz != null ) {
85
85
clazz = clazz . superClazz ;
86
86
//obs[Clazz.getClassName (clazz)] = classThisObj;
87
87
/*
@@ -124,65 +124,77 @@ Clazz.innerTypeInstance = function (clazzInner, objThis, finalVars) {
124
124
clazzInner = arguments . callee . caller ;
125
125
}
126
126
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 ] ) ;
135
157
} 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 ) ;
137
172
}
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 ] ) ;
156
173
} 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 ;
164
189
}
190
+
165
191
var args = new Array ( ) ;
166
192
for ( var i = 3 ; i < arguments . length ; i ++ ) {
167
193
args [ i - 3 ] = arguments [ i ] ;
168
194
}
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 ) ;
185
196
}
197
+
186
198
/*
187
199
if (finalVars != null && objThis.$finals == null) {
188
200
obj.$finals = finalVars;
@@ -685,6 +697,20 @@ System = {
685
697
dest [ destPos + i ] = swap [ i ] ;
686
698
}
687
699
}
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
+ }
688
714
}
689
715
} ;
690
716
System . out = new JavaObject ( ) ;
@@ -828,6 +854,19 @@ Clazz.int0RightShift = function (n, o) { // 64bit
828
854
return n >>> o ; // no needs for this shifting wrapper
829
855
} ;
830
856
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
+
831
870
// Compress the common public API method in shorter name
832
871
$_L = Clazz . load ;
833
872
$_W = Clazz . declareAnonymous ;
@@ -842,6 +881,7 @@ $_P=Clazz.p0p;
842
881
$_B = Clazz . prepareCallback ;
843
882
$_N = Clazz . innerTypeInstance ;
844
883
$_K = Clazz . makeConstructor ;
884
+ $_k = Clazz . overrideConstructor ;
845
885
$_U = Clazz . superCall ;
846
886
$_R = Clazz . superConstructor ;
847
887
$_M = Clazz . defineMethod ;
@@ -860,6 +900,16 @@ $_AB=Clazz.newByteArray;
860
900
$_AC = Clazz . newCharArray ;
861
901
$_Ab = Clazz . newBooleanArray ;
862
902
//$_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 ;
863
913
$_O = Clazz . instanceOf ;
864
914
$_G = Clazz . inheritArgs ;
865
915
$_X = Clazz . checkPrivateMethod ;
@@ -976,6 +1026,12 @@ Clazz.cleanDelegateMethod = function (m) {
976
1026
m . lastParams = null ;
977
1027
m . lastClaxxRef = null ;
978
1028
}
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
+ }
979
1035
} ;
980
1036
981
1037
/* public */
0 commit comments