11 ,Clazz_decorateAsClass
14 ,Clazz_makeConstructor
15 ,Clazz_defineEnumConstant
22 ,Clazz_superConstructor
24 ,Clazz_declareInterface
28 ,Clazz_innerTypeInstance
30 ,Clazz_prepareCallback
36 ,Clazz_newBooleanArray
40 ,Clazz_overrideConstructor
43 ,Clazz_getInheritedLevel
54 ,Clazz_tryToSearchAndExecute
60 ,Clazz_declareAnonymous
61 ,Clazz_checkPrivateMethod
69 // This library will be wrapped by an additional anonymous function using ANT in
70 // build_03_tojs.xml. This task will also modify variable names. References
71 // to Clazz._ will not be changed, but other Clazz_xxx will be changed to
72 // (local scope) Clazz_xxx, allowing them to be further compressed using
73 // Google Closure Compiler in that same ANT task.
75 // BH 7/24/2015 7:21:51 AM renamed from JSmolJavaExt.js
76 // BH 5/31/2015 5:53:04 PM Number.compareTo added
77 // BH 5/21/2015 5:46:30 PM Number("0xFFFFFFFF") is not -1
78 // BH 4/23/2015 9:08:59 AM xx.getComponentType() is nonfunctional. Array.newInstance now defines a wrapper for .getClass().getComponentType() that works
79 // BH 4/12/2015 1:37:44 PM adding Math.rint = Math.round
80 // BH 1/16/2015 10:09:38 AM Chrome failure jqGrig due to new String("x").toString() not being a simple string
81 // BH 8/14/2014 6:49:22 PM Character class efficiencies
82 // BH 7/24/2014 9:02:18 AM most browsers do not support String.codePointAt()
83 // BH 7/11/2014 4:17:22 PM fix for Boolean.valueOf("false") not being false
84 // BH 5/27/2014 6:29:59 AM ensure floats and doubles have decimal point in toString
85 // BH 4/1/2014 12:23:41 PM Encoding moved to Clazz._Encoding;
86 // BH 4/1/2014 7:51:46 AM removing java.lang.B00lean
87 // BH 3/7/2014 9:17:10 AM removing Array.toString; moving that code here from j2sJmol.js
88 // BH 1/30/2014 9:04:25 AM adding Throwable.getStackTrace() as a STRING
89 // BH 12/4/2013 9:20:44 PM fix for reassigning Date.prototype.toString()
90 // BH 12/3/2013 11:43:10 AM bizarre Safari bug in reassigning Boolean (OK, I admit, we shouldn't have done that...)
91 // BH 12/1/2013 6:50:16 AM evit Number.prototype.toString assignment removed!
92 // BH 11/30/2013 1:46:31 PM fixing Byte, Short, Long, Integer, Float, Double to reflect proper bounds and error conditions
93 // BH 11/29/2013 8:58:49 PM removing Boolean.toString(boolean)
94 // BH 11/4/2013 7:34:26 AM changing "var nativeClazz" to "var nativeClass" to avoid ANT replacement of "nativeClazz_" to "nativeClazz_"
95 // BH 10/19/2013 1:29:27 PM fixed String.$replace()
96 // BH 10/18/2013 6:09:23 PM fixed (Double|Float).valueOf(NaN).valueOf(), which should return NaN, not throw an error
97 // BH 10/12/2013 11:18:44 AM fixed bug in Double(String) and Float(String) that was returning typeof "string"
98 // BH 10/10/2013 2:40:20 PM added Math.log10
99 // BH 7/23/2013 7:24:01 AM fixing Number.shortValue() and Number.byteValue() for negative values
100 // BH 6/16/2013 1:31:30 PM adding /| in String.replace -- thank you David Koes
101 // BH 3/13/2013 12:49:23 PM setting Boolean.valueOf() "@"
102 // BH 3/2/2013 10:46:45 PM removed Double.valueOf(String)
103 // BH 11/6/2012 8:26:33 PM added instanceof Int32Array in String.instantialize
104 // BH 10/13/2012 11:38:07 PM corrected Integer.parseInt to allow only +-0123456789; created Integer.parseIntRadix
105 // BH 11/1/2012 added Short
106 // BH 9/10/2012 6:27:21 AM added java.net.URL... classes
107 // BH 1/7/2013 7:40:06 AM added Clazz_dateToString
111 // moved here from package.js
112 // these classes will be created as objects prior to any others
113 // and are then available immediately
115 Clazz._Loader.registerPackages("java", [ "io", "lang", "lang.reflect", "util" ]);
117 var sJU = "java.util";
120 //Clazz._Loader.registerPackages (sJU, ["regex", "zip"]);
123 var javautil = java.util;
125 Clazz._Loader.ignore([
126 "net.sf.j2s.ajax.HttpRequest",
127 sJU + ".MapEntry.Type",
128 //"java.net.UnknownServiceException",
130 "java.security.AccessController",
131 "java.security.PrivilegedExceptionAction",
133 "java.io.FileInputStream",
134 "java.io.FileWriter",
135 "java.io.OutputStreamWriter",
136 // sJU + ".Calendar", // bypassed in ModelCollection
137 // "java.text.SimpleDateFormat", // not used
138 // "java.text.DateFormat", // not used
139 sJU + ".concurrent.Executors"
142 Math.rint = Math.round;
144 Math.log10||(Math.log10=function(a){return Math.log(a)/2.302585092994046});
146 if(Clazz._supportsNativeObject){
147 // Number and Array are special -- do not override prototype.toString -- "length - 2" here
148 for(var i=0;i<Clazz._extendedObjectMethods.length - 2;i++){
149 var p=Clazz._extendedObjectMethods[i];
150 Array.prototype[p] = Clazz._O.prototype[p];
151 Number.prototype[p] = Clazz._O.prototype[p];
155 java.lang.Number=Number;
156 Number.__CLASS_NAME__="Number";
157 Clazz_implementOf(Number,java.io.Serializable);
158 Number.equals=Clazz._innerFunctions.equals;
159 Number.getName=Clazz._innerFunctions.getName;
160 Number.prototype.compareTo = function(x) { var a = this.value, b = x.value; return (a < b ? -1 : a == b ? 0 : 1) };
162 Clazz_defineMethod(Number,"shortValue",
164 var x = Math.round(this)&0xffff;
165 return (this < 0 && x > 0 ? x - 0x10000 : x);
168 Clazz_defineMethod(Number,"byteValue",
170 var x = Math.round(this)&0xff;
171 return (this < 0 && x > 0 ? x - 0x100 : x);
174 Clazz_defineMethod(Number,"intValue",
176 return Math.round(this)&0xffffffff;
179 Clazz_defineMethod(Number,"longValue",
181 return Math.round(this);
184 Clazz_defineMethod(Number,"floatValue",
186 return this.valueOf();
188 Clazz_defineMethod(Number,"doubleValue",
190 return parseFloat(this.valueOf());
193 Clazz_overrideMethod(Number,"hashCode",
195 return this.valueOf();
198 java.lang.Integer=Integer=function(){
199 Clazz_instantialize(this,arguments);
201 Clazz_decorateAsType(Integer,"Integer",Number,Comparable,null,true);
202 Integer.prototype.valueOf=function(){return 0;};
203 Integer.toString=Integer.prototype.toString=function(){
204 if(arguments.length!=0){
205 return""+arguments[0];
206 } else if(this===Integer){
207 return"class java.lang.Integer";
209 return""+this.valueOf();
214 Clazz_makeConstructor(Integer,
216 this.valueOf=function(){
223 Clazz_overrideConstructor(Integer, function(v){
224 v == null && (v = 0);
225 if (typeof v != "number")
226 v = Integer.parseIntRadix(v, 10);
227 this.valueOf=function(){return v;};
230 Clazz_makeConstructor(Integer,
232 var value=Integer.parseInt(s,10);
233 this.valueOf=function(){
238 Integer.MIN_VALUE=Integer.prototype.MIN_VALUE=-0x80000000;
239 Integer.MAX_VALUE=Integer.prototype.MAX_VALUE=0x7fffffff;
240 Integer.TYPE=Integer.prototype.TYPE=Integer;
243 Clazz_defineMethod(Integer,"bitCount",
245 i = i - ((i >>> 1) & 0x55555555);
246 i = (i & 0x33333333) + ((i >>> 2) & 0x33333333);
247 i = (i + (i >>> 4)) & 0x0f0f0f0f;
252 Integer.bitCount=Integer.prototype.bitCount;
254 Clazz_defineMethod(Integer,"numberOfLeadingZeros",
256 if (i == 0) return 32;
258 if (i >>> 16 == 0) { n += 16; i <<= 16; }
259 if (i >>> 24 == 0) { n += 8; i <<= 8; }
260 if (i >>> 28 == 0) { n += 4; i <<= 4; }
261 if (i >>> 30 == 0) { n += 2; i <<= 2; }
265 Integer.numberOfLeadingZeros=Integer.prototype.numberOfLeadingZeros;
267 Clazz_defineMethod(Integer,"numberOfTrailingZeros",
269 if (i == 0) return 32;
271 var y = i <<16; if (y != 0) { n = n -16; i = y; }
272 y = i << 8; if (y != 0) { n = n - 8; i = y; }
273 y = i << 4; if (y != 0) { n = n - 4; i = y; }
274 y = i << 2; if (y != 0) { n = n - 2; i = y; }
275 return n - ((i << 1) >>> 31);
277 Integer.numberOfTrailingZeros=Integer.prototype.numberOfTrailingZeros;
279 Clazz_defineMethod(Integer,"parseIntRadix",
282 throw new NumberFormatException("null");
284 throw new NumberFormatException("radix "+radix+" less than Character.MIN_RADIX");
286 throw new NumberFormatException("radix "+radix+" greater than Character.MAX_RADIX");
289 for (var i = s.length; --i >= 0;) {
290 var c = s.charCodeAt(i);
291 if (c >= 48 && c <= 57) continue;
292 if (i > 0 || c != 43 && c != 45)
293 throw new NumberFormatException("Not a Number : "+s);
297 var i=parseInt(s,radix);
299 throw new NumberFormatException("Not a Number : "+s);
303 Integer.parseIntRadix=Integer.prototype.parseIntRadix;
305 Clazz_defineMethod(Integer,"parseInt",
307 return Integer.parseIntRadix(s,10);
309 Integer.parseInt=Integer.prototype.parseInt;
312 Clazz_defineMethod(Integer,"$valueOf",
314 return new Integer(Integer.parseIntRadix(s,10));
318 Clazz_overrideMethod(Integer,"$valueOf",
320 return new Integer(s);
324 Clazz_defineMethod(Integer,"$valueOf",
326 return new Integer(Integer.parseIntRadix(s,r));
330 Integer.$valueOf=Integer.prototype.$valueOf;
333 Clazz_overrideMethod(Integer,"equals",
335 if(s==null||!Clazz_instanceOf(s,Integer)){
338 return s.valueOf()==this.valueOf();
340 Integer.toHexString=Integer.prototype.toHexString=function(d){
341 if(d.valueOf)d=d.valueOf();
343 var b = d & 0xFFFFFF;
344 var c = ((d>>24)&0xFF);
345 return c._numberToString(16) + (b = "000000" + b._numberToString(16)).substring(b.length - 6);
347 return d._numberToString(16);};
348 Integer.toOctalString=Integer.prototype.toOctalString=function(d){if(d.valueOf)d=d.valueOf();return d._numberToString(8);};
349 Integer.toBinaryString=Integer.prototype.toBinaryString=function(d){if(d.valueOf)d=d.valueOf();return d._numberToString(2);};
351 Integer.decodeRaw=Clazz_defineMethod(Integer,"decodeRaw", function(n){
352 if (n.indexOf(".") >= 0)n = "";
353 var i = (n.startsWith("-") ? 1 : 0);
354 n = n.replace(/\#/, "0x").toLowerCase();
355 var radix=(n.startsWith("0x", i) ? 16 : n.startsWith("0", i) ? 8 : 10);
356 // The general problem with parseInt is that is not strict -- ParseInt("10whatever") == 10.
357 // Number is strict, but Number("055") does not work, though ParseInt("055", 8) does.
358 // need to make sure negative numbers are negative
359 n = Number(n) & 0xFFFFFFFF;
360 return (radix == 8 ? parseInt(n, 8) : n);
363 Integer.decode=Clazz_defineMethod(Integer,"decode", function(n){
364 n = Integer.decodeRaw(n);
365 if (isNaN(n) || n < Integer.MIN_VALUE|| n > Integer.MAX_VALUE)
366 throw new NumberFormatException("Invalid Integer");
367 return new Integer(n);
370 Clazz_overrideMethod(Integer,"hashCode",
372 return this.valueOf();
375 // Note that Long is problematic in JavaScript
377 java.lang.Long=Long=function(){
378 Clazz_instantialize(this,arguments);
380 Clazz_decorateAsType(Long,"Long",Number,Comparable,null,true);
381 Long.prototype.valueOf=function(){return 0;};
382 Long.toString=Long.prototype.toString=function(){
383 if(arguments.length!=0){
384 return""+arguments[0];
385 }else if(this===Long){
386 return"class java.lang.Long";
388 return""+this.valueOf();
391 Clazz_overrideConstructor(Long, function(v){
392 v == null && (v = 0);
393 v = (typeof v == "number" ? Math.round(v) : Integer.parseIntRadix(v, 10));
394 this.valueOf=function(){return v;};
397 //Long.MIN_VALUE=Long.prototype.MIN_VALUE=-0x8000000000000000;
398 //Long.MAX_VALUE=Long.prototype.MAX_VALUE=0x7fffffffffffffff;
399 Long.TYPE=Long.prototype.TYPE=Long;
401 Clazz_defineMethod(Long,"parseLong",
403 return Integer.parseInt(s, radix || 10);
406 Long.parseLong=Long.prototype.parseLong;
408 Clazz_overrideMethod(Long,"$valueOf",
413 Clazz_defineMethod(Long,"$valueOf",
418 Clazz_defineMethod(Long,"$valueOf",
420 return new Long(Long.parseLong(s,r));
423 Long.$valueOf=Long.prototype.$valueOf;
424 Clazz_overrideMethod(Long,"equals",
426 if(s==null||!Clazz_instanceOf(s,Long)){
429 return s.valueOf()==this.valueOf();
431 Long.toHexString=Long.prototype.toHexString=function(i){
432 return i.toString(16);
434 Long.toOctalString=Long.prototype.toOctalString=function(i){
435 return i.toString(8);
437 Long.toBinaryString=Long.prototype.toBinaryString=function(i){
438 return i.toString(2);
442 Long.decode=Clazz_defineMethod(Long,"decode",
444 n = Integer.decodeRaw(n);
446 throw new NumberFormatException("Invalid Long");
450 java.lang.Short = Short = function () {
451 Clazz_instantialize (this, arguments);
453 Clazz_decorateAsType (Short, "Short", Number, Comparable, null, true);
454 Short.prototype.valueOf = function () { return 0; };
455 Short.toString = Short.prototype.toString = function () {
456 if (arguments.length != 0) {
457 return "" + arguments[0];
458 } else if (this === Short) {
459 return "class java.lang.Short"; // Short.class.toString
461 return "" + this.valueOf ();
464 Clazz_overrideConstructor(Short,
466 v == null && (v = 0);
467 if (typeof v != "number")
468 v = Integer.parseIntRadix(v, 10);
470 this.valueOf = function () {return v;};
474 Short.MIN_VALUE = Short.prototype.MIN_VALUE = -32768;
475 Short.MAX_VALUE = Short.prototype.MAX_VALUE = 32767;
476 Short.TYPE = Short.prototype.TYPE = Short;
478 Clazz_defineMethod(Short, "parseShortRadix",
479 function (s, radix) {
480 return Integer.parseIntRadix(s, radix).shortValue();
481 }, "String, Number");
482 Short.parseShortRadix = Short.prototype.parseShortRadix;
484 Clazz_defineMethod(Short, "parseShort",
486 return Short.parseShortRadix (s, 10);
489 Short.parseShort = Short.prototype.parseShort;
492 Clazz_defineMethod(Short, "$valueOf",
494 return new Short(Short.parseShort (s, 10));
498 Clazz_overrideMethod(Short, "$valueOf",
504 Clazz_defineMethod(Short, "$valueOf",
506 return new Short(Short.parseShort (s, r));
507 }, "String, Number");
510 Short.$valueOf = Short.prototype.$valueOf;
511 Clazz_overrideMethod(Short, "equals",
513 if(s == null || !Clazz_instanceOf(s, Short) ){
516 return s.valueOf() == this.valueOf();
518 Short.toHexString = Short.prototype.toHexString = function (i) {
519 return i.toString (16);
521 Short.toOctalString = Short.prototype.toOctalString = function (i) {
522 return i.toString (8);
524 Short.toBinaryString = Short.prototype.toBinaryString = function (i) {
525 return i.toString (2);
527 Short.decode = Clazz_defineMethod(Short, "decode",
529 n = Integer.decodeRaw(n);
530 if (isNaN(n) || n < -32768|| n > 32767)
531 throw new NumberFormatException("Invalid Short");
535 java.lang.Byte=Byte=function(){
536 Clazz_instantialize(this,arguments);
538 Clazz_decorateAsType(Byte,"Byte",Number,Comparable,null,true);
539 Byte.prototype.valueOf=function(){return 0;};
540 Byte.toString=Byte.prototype.toString=function(){
541 if(arguments.length!=0){
542 return""+arguments[0];
543 }else if(this===Byte){
544 return"class java.lang.Byte";
546 return""+this.valueOf();
548 Clazz_makeConstructor(Byte,
550 if (typeof v != "number")
551 v = Integer.parseIntRadix(v, 10);
553 this.valueOf=function(){
558 Byte.serialVersionUID=Byte.prototype.serialVersionUID=-7183698231559129828;
559 Byte.MIN_VALUE=Byte.prototype.MIN_VALUE=-128;
560 Byte.MAX_VALUE=Byte.prototype.MAX_VALUE=127;
561 Byte.SIZE=Byte.prototype.SIZE=8;
562 Byte.TYPE=Byte.prototype.TYPE=Byte;
564 Clazz_defineMethod(Byte,"parseByteRadix",
566 return Integer.parseIntRadix(s, radix).byteValue();
568 Byte.parseByteRadix=Byte.prototype.parseByteRadix;
570 Clazz_defineMethod(Byte,"parseByte",
572 return Byte.parseByte(s,10);
575 Byte.parseByte=Byte.prototype.parseByte;
577 Clazz_overrideMethod(Byte, "$valueOf",
582 Byte.$valueOf=Byte.prototype.$valueOf;
583 Clazz_overrideMethod(Byte,"equals",
585 if(s==null||!Clazz_instanceOf(s,Byte)){
588 return s.valueOf()==this.valueOf();
590 Byte.toHexString=Byte.prototype.toHexString=function(i){
591 return i.toString(16);
593 Byte.toOctalString=Byte.prototype.toOctalString=function(i){
594 return i.toString(8);
596 Byte.toBinaryString=Byte.prototype.toBinaryString=function(i){
597 return i.toString(2);
599 Byte.decode=Clazz_defineMethod(Byte,"decode",
601 n = Integer.decodeRaw(n);
602 if (isNaN(n) || n < -128|| n > 127)
603 throw new NumberFormatException("Invalid Byte");
607 Clazz._floatToString = function(f) {
609 if (s.indexOf(".") < 0 && s.indexOf("e") < 0)
614 java.lang.Float=Float=function(){
615 Clazz_instantialize(this,arguments);
617 Clazz_decorateAsType(Float,"Float",Number,Comparable,null,true);
618 Float.prototype.valueOf=function(){return 0;};
619 Float.toString=Float.prototype.toString=function(){
620 if(arguments.length!=0){
621 return Clazz._floatToString(arguments[0]);
622 }else if(this===Float){
623 return"class java.lang.Float";
625 return Clazz._floatToString(this.valueOf());
628 Clazz_overrideConstructor(Float, function(v){
629 v == null && (v = 0);
630 if (typeof v != "number")
632 this.valueOf=function(){return v;}
635 Float.serialVersionUID=Float.prototype.serialVersionUID=-2671257302660747028;
636 Float.MIN_VALUE=Float.prototype.MIN_VALUE=3.4028235e+38;
637 Float.MAX_VALUE=Float.prototype.MAX_VALUE=1.4e-45;
638 Float.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY;
639 Float.POSITIVE_INFINITY=Number.POSITIVE_INFINITY;
640 Float.NaN=Number.NaN;
641 Float.TYPE=Float.prototype.TYPE=Float;
643 Clazz_defineMethod(Float,"parseFloat",
646 throw new NumberFormatException("null");
648 if (typeof s == "number")return s; // important -- typeof NaN is "number" and is OK here
649 var floatVal=Number(s);
651 throw new NumberFormatException("Not a Number : "+s);
655 Float.parseFloat=Float.prototype.parseFloat;
657 Clazz_overrideMethod(Float,"$valueOf",
662 Float.$valueOf=Float.prototype.$valueOf;
664 Clazz_defineMethod(Float,"isNaN",
668 Float.isNaN=Float.prototype.isNaN;
669 Clazz_defineMethod(Float,"isInfinite",
671 return!isFinite(num);
673 Float.isInfinite=Float.prototype.isInfinite;
675 Clazz_overrideMethod(Float,"equals",
677 if(s==null||!Clazz_instanceOf(s,Float)){
680 return s.valueOf()==this.valueOf();
683 java.lang.Double=Double=function(){
684 Clazz_instantialize(this,arguments);
686 Clazz_decorateAsType(Double,"Double",Number,Comparable,null,true);
687 Double.prototype.valueOf=function(){return 0;};
688 Double.toString=Double.prototype.toString=function(){
689 if(arguments.length!=0){
690 return Clazz._floatToString(arguments[0]);
691 }else if(this===Double){
692 return"class java.lang.Double";
694 return Clazz._floatToString(this.valueOf());
697 Clazz_overrideConstructor(Double, function(v){
698 v == null && (v = 0);
699 if (typeof v != "number")
700 v = Double.parseDouble(v);
701 this.valueOf=function(){return v;};
704 Double.serialVersionUID=Double.prototype.serialVersionUID=-9172774392245257468;
705 Double.MIN_VALUE=Double.prototype.MIN_VALUE=4.9e-324;
706 Double.MAX_VALUE=Double.prototype.MAX_VALUE=1.7976931348623157e+308;
707 Double.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY;
708 Double.POSITIVE_INFINITY=Number.POSITIVE_INFINITY;
709 Double.NaN=Number.NaN;
710 Double.TYPE=Double.prototype.TYPE=Double;
712 Clazz_defineMethod(Double,"isNaN",
716 Double.isNaN=Double.prototype.isNaN;
717 Clazz_defineMethod(Double,"isInfinite",
719 return!isFinite(num);
721 Double.isInfinite=Double.prototype.isInfinite;
723 Clazz_defineMethod(Double,"parseDouble",
726 throw new NumberFormatException("null");
728 if (typeof s == "number")return s; // important -- typeof NaN is "number" and is OK here
729 var doubleVal=Number(s);
730 if(isNaN(doubleVal)){
731 throw new NumberFormatException("Not a Number : "+s);
735 Double.parseDouble=Double.prototype.parseDouble;
738 Clazz_defineMethod(Double,"$valueOf",
740 return new Double(this.parseDouble(s));
744 Clazz_defineMethod(Double,"$valueOf",
746 return new Double(v);
749 Double.$valueOf=Double.prototype.$valueOf;
751 Clazz_overrideMethod(Double,"equals",
753 if(s==null||!Clazz_instanceOf(s,Double)){
756 return s.valueOf()==this.valueOf();
760 //java.lang.B00lean = Boolean; ?? BH why this?
761 Boolean = java.lang.Boolean = Boolean || function () {Clazz_instantialize (this, arguments);};
762 if (Clazz._supportsNativeObject) {
763 for (var i = 0; i < Clazz._extendedObjectMethods.length; i++) {
764 var p = Clazz._extendedObjectMethods[i];
765 Boolean.prototype[p] = Clazz._O.prototype[p];
768 Boolean.__CLASS_NAME__="Boolean";
769 Clazz_implementOf(Boolean,[java.io.Serializable,java.lang.Comparable]);
770 Boolean.equals=Clazz._innerFunctions.equals;
771 Boolean.getName=Clazz._innerFunctions.getName;
772 Boolean.serialVersionUID=Boolean.prototype.serialVersionUID=-3665804199014368530;
774 //Clazz_makeConstructor(Boolean,
776 //this.valueOf=function(){
781 Clazz_overrideConstructor(Boolean,
783 var b = ((typeof s == "string" ? Boolean.toBoolean(s) : s) ? true : false);
784 this.valueOf=function(){return b;};
787 Boolean.parseBoolean=Clazz_defineMethod(Boolean,"parseBoolean",
789 return Boolean.toBoolean(s);
791 Clazz_defineMethod(Boolean,"booleanValue",
793 return this.valueOf();
795 Boolean.$valueOf=Clazz_overrideMethod(Boolean,"$valueOf",
797 return((typeof b == "string"? "true".equalsIgnoreCase(b) : b)?Boolean.TRUE:Boolean.FALSE);
801 Boolean.toString=Clazz_defineMethod(Boolean,"toString",
803 return b?"true":"false";
807 Clazz_overrideMethod(Boolean,"toString",
809 return this.valueOf()?"true":"false";
811 Clazz_overrideMethod(Boolean,"hashCode",
813 return this.valueOf()?1231:1237;
815 Clazz_overrideMethod(Boolean,"equals",
817 if(Clazz_instanceOf(obj,Boolean)){
818 return this.booleanValue()==obj.booleanValue();
821 Boolean.getBoolean=Clazz_defineMethod(Boolean,"getBoolean",
825 result=Boolean.toBoolean(System.getProperty(name));
827 if(Clazz_instanceOf(e,IllegalArgumentException)){
828 }else if(Clazz_instanceOf(e,NullPointerException)){
835 Clazz_overrideMethod(Boolean,"compareTo",
837 return(b.value==this.value?0:(this.value?1:-1));
839 Boolean.toBoolean=Clazz_defineMethod(Boolean,"toBoolean",
841 return((name!=null)&&name.equalsIgnoreCase("true"));
842 },$fz.isPrivate=true,$fz),"~S");
843 Boolean.TRUE=Boolean.prototype.TRUE=new Boolean(true);
844 Boolean.FALSE=Boolean.prototype.FALSE=new Boolean(false);
845 Boolean.TYPE=Boolean.prototype.TYPE=Boolean;
848 Clazz._Encoding=new Object();
850 (function(Encoding) {
852 Encoding.UTF8="utf-8";
853 Encoding.UTF16="utf-16";
854 Encoding.ASCII="ascii";
857 Encoding.guessEncoding=function(str){
858 if(str.charCodeAt(0)==0xEF&&str.charCodeAt(1)==0xBB&&str.charCodeAt(2)==0xBF){
859 return Encoding.UTF8;
860 }else if(str.charCodeAt(0)==0xFF&&str.charCodeAt(1)==0xFE){
861 return Encoding.UTF16;
863 return Encoding.ASCII;
867 Encoding.readUTF8=function(str){
868 var encoding=this.guessEncoding(str);
870 if(encoding==Encoding.UTF8){
872 }else if(encoding==Encoding.UTF16){
875 var arrs=new Array();
876 for(var i=startIdx;i<str.length;i++){
877 var charCode=str.charCodeAt(i);
879 arrs[arrs.length]=str.charAt(i);
880 }else if(charCode>0xc0&&charCode<0xe0){
881 var c1=charCode&0x1f;
883 var c2=str.charCodeAt(i)&0x3f;
885 arrs[arrs.length]=String.fromCharCode(c);
886 }else if(charCode>=0xe0){
887 var c1=charCode&0x0f;
889 var c2=str.charCodeAt(i)&0x3f;
891 var c3=str.charCodeAt(i)&0x3f;
892 var c=(c1<<12)+(c2<<6)+c3;
893 arrs[arrs.length]=String.fromCharCode(c);
896 return arrs.join('');
899 Encoding.convert2UTF8=function(str){
900 var encoding=this.guessEncoding(str);
902 if(encoding==Encoding.UTF8){
904 }else if(encoding==Encoding.UTF16){
909 var arrs=new Array(offset+str.length-startIdx);
911 for(var i=startIdx;i<str.length;i++){
912 var charCode=str.charCodeAt(i);
914 arrs[offset+i-startIdx]=str.charAt(i);
915 }else if(charCode<=0x07ff){
916 var c1=0xc0+((charCode&0x07c0)>>6);
917 var c2=0x80+(charCode&0x003f);
918 arrs[offset+i-startIdx]=String.fromCharCode(c1)+String.fromCharCode(c2);
920 var c1=0xe0+((charCode&0xf000)>>12);
921 var c2=0x80+((charCode&0x0fc0)>>6);
922 var c3=0x80+(charCode&0x003f);
923 arrs[offset+i-startIdx]=String.fromCharCode(c1)+String.fromCharCode(c2)+String.fromCharCode(c3);
926 return arrs.join('');
928 Encoding.base64Chars=new Array(
929 'A','B','C','D','E','F','G','H',
930 'I','J','K','L','M','N','O','P',
931 'Q','R','S','T','U','V','W','X',
932 'Y','Z','a','b','c','d','e','f',
933 'g','h','i','j','k','l','m','n',
934 'o','p','q','r','s','t','u','v',
935 'w','x','y','z','0','1','2','3',
936 '4','5','6','7','8','9','+','/'
938 Encoding.encodeBase64=function(str){
939 if(str==null||str.length==0)return str;
940 var b64=Encoding.base64Chars;
941 var length=str.length;
946 c0=str.charCodeAt(index++);
947 buf[buf.length]=b64[c0>>2];
949 c1=str.charCodeAt(index++);
950 buf[buf.length]=b64[((c0<<4)&0x30)|(c1>>4)];
952 c2=str.charCodeAt(index++);
953 buf[buf.length]=b64[((c1<<2)&0x3c)|(c2>>6)];
954 buf[buf.length]=b64[c2&0x3F];
956 buf[buf.length]=b64[((c1<<2)&0x3c)];
960 buf[buf.length]=b64[(c0<<4)&0x30];
967 Encoding.decodeBase64=function(str){
968 if(str==null||str.length==0)return str;
969 var b64=Encoding.base64Chars;
970 var xb64=Encoding.xBase64Chars;
971 if(Encoding.xBase64Chars==null){
973 for(var i=0;i<b64.length;i++){
976 Encoding.xBase64Chars=xb64;
978 var length=str.length;
983 while(index<length&&c++<60000){
984 c0=xb64[str.charAt(index++)];
985 c1=xb64[str.charAt(index++)];
986 c2=xb64[str.charAt(index++)];
987 c3=xb64[str.charAt(index++)];
988 buf[buf.length]=String.fromCharCode(((c0<<2)&0xff)|c1>>4);
990 buf[buf.length]=String.fromCharCode(((c1<<4)&0xff)|c2>>2);
992 buf[buf.length]=String.fromCharCode(((c2<<6)&0xff)|c3);
999 if(String.prototype.$replace==null){
1000 java.lang.String=String;
1001 if(Clazz._supportsNativeObject){
1002 for(var i=0;i<Clazz._extendedObjectMethods.length;i++){
1003 var p=Clazz._extendedObjectMethods[i];
1004 if("to$tring"==p||"toString"==p||"equals"==p||"hashCode"==p){
1007 String.prototype[p]=Clazz._O.prototype[p];
1011 Clazz_implementOf(String,[java.io.Serializable,CharSequence,Comparable]);
1013 String.getName=Clazz._innerFunctions.getName;
1015 String.serialVersionUID=String.prototype.serialVersionUID=-6849794470754667710;
1020 sp.$replace=function(c1,c2){
1021 if (c1 == c2 || this.indexOf (c1) < 0) return "" + this;
1022 if (c1.length == 1) {
1023 if ("\\$.*+|?^{}()[]".indexOf(c1) >= 0) c1 = "\\" + c1;
1025 c1=c1.replace(/([\\\$\.\*\+\|\?\^\{\}\(\)\[\]])/g,function($0,$1){return"\\"+$1;});
1027 return this.replace(new RegExp(c1,"gm"),c2);
1029 sp.$generateExpFunction=function(str){
1035 for(;i<str.length;i++){
1036 var ch=str.charAt(i);
1037 if(i!=str.length-1&&ch=='\\'){
1039 var c=str.charAt(i);
1044 }else if(i!=str.length-1&&ch=='$'){
1046 orders[idx]=parseInt(str.charAt(i));
1061 var funStr="f = function (";
1062 var max=Math.max.apply({},orders);
1063 for(i=0;i<=max;i++){
1069 funStr+=") { return ";
1070 for(i=0;i<arr.length-1;i++){
1071 funStr+="\""+arr[i]+"\" + $"+orders[i]+" + ";
1073 funStr+="\""+arr[i]+"\"; }";
1079 sp.replaceAll=function(exp,str){
1080 var regExp=new RegExp(exp,"gm");
1081 return this.replace(regExp,this.$generateExpFunction(str));
1083 sp.replaceFirst=function(exp,str){
1084 var regExp=new RegExp(exp,"m");
1085 return this.replace(regExp,this.$generateExpFunction(str));
1087 sp.matches=function(exp){
1091 var regExp=new RegExp(exp,"gm");
1092 var m=this.match(regExp);
1093 return m!=null&&m.length!=0;
1095 sp.regionMatches=function(ignoreCase,toffset,
1098 if(typeof ignoreCase=="number"
1099 ||(ignoreCase!=true&&ignoreCase!=false)){
1109 if((ooffset<0)||(toffset<0)||(toffset>this.length-len)||
1110 (ooffset>other.length-len)){
1113 var s1=this.substring(toffset,toffset+len);
1114 var s2=other.substring(ooffset,ooffset+len);
1116 s1=s1.toLowerCase();
1117 s2=s2.toLowerCase();
1124 sp.$plit=function(regex,limit){
1125 if (!limit && regex == " ")
1126 return this.split(regex);
1128 if(limit!=null&&limit>0){
1132 var regExp=new RegExp("("+regex+")","gm");
1134 var s=this.replace(regExp,function($0,$1){
1138 }else if(count>limit){
1144 regExp=new RegExp(regex,"gm");
1145 var arr=this.split(regExp);
1146 if(arr.length>limit){
1147 arr[limit-1]=s.substring(s.indexOf("@@_@@")+5);
1152 var regExp=new RegExp(regex,"gm");
1153 return this.split(regExp);
1158 var len=this.length;
1161 while((st<len)&&(this.charAt(st)<=' ')){
1164 while((st<len)&&(this.charAt(len-1)<=' ')){
1167 return((st>0)||(len<len))?this.substring(st,len):this;
1175 return this.replace(/^\s+/g,'').replace(/\s+$/g,'');
1178 if (!sp.startsWith || !sp.endsWith) {
1179 var sn=function(s, prefix,toffset){
1182 var pc=prefix.length;
1184 if((toffset<0)||(toffset>s.length-pc)){
1188 if(s.charAt(to++)!=prefix.charAt(po++)){
1195 sp.startsWith=function(prefix){
1196 if(arguments.length==1){
1197 return sn(this,arguments[0],0);
1198 }else if(arguments.length==2){
1199 return sn(this,arguments[0],arguments[1]);
1205 sp.endsWith=function(suffix){
1206 return sn(this, suffix,this.length-suffix.length);
1211 sp.equals=function(anObject){
1212 return this.valueOf()==anObject;
1215 sp.equalsIgnoreCase=function(anotherString){
1216 return(anotherString==null)?false:(this==anotherString
1217 ||this.toLowerCase()==anotherString.toLowerCase());
1223 sp.hashCode=function(){
1227 var len=this.length;
1228 for(var i=0;i<len;i++){
1229 h=31*h+this.charCodeAt(off++);
1237 sp.getBytes=function(){
1238 if(arguments.length==4){
1239 return this.getChars(arguments[0],arguments[1],arguments[2],arguments[3]);
1242 if(arguments.length==1){
1243 var cs=arguments[0].toString().toLowerCase();
1245 "utf-8","UTF8","us-ascii","iso-8859-1","8859_1","gb2312","gb18030","gbk"
1248 for(var i=0;i<charset.length;i++){
1255 throw new java.io.UnsupportedEncodingException();
1257 if(cs=="utf-8"||cs=="utf8"){
1258 s=Encoding.convert2UTF8(this);
1261 var arrs=new Array(s.length);
1263 for(var i=0;i<s.length;i++){
1268 arrs[ii+2]=(c&0xff00)>>8;
1279 sp.compareTo=function(anotherString){
1280 if(anotherString==null){
1281 throw new java.lang.NullPointerException();
1283 var len1=this.length;
1284 var len2=anotherString.length;
1285 var n=Math.min(len1,len2);
1288 var c1=this.charCodeAt(k);
1289 var c2=anotherString.charCodeAt(k);
1300 sp.contains = function(a) {return this.indexOf(a) >= 0} // bh added
1301 sp.compareTo = function(a){return this > a ? 1 : this < a ? -1 : 0} // bh added
1305 sp.toCharArray=function(){
1306 var result=new Array(this.length);
1307 for(var i=0;i<this.length;i++){
1308 result[i]=this.charAt(i);
1312 String.value0f=String.valueOf;
1313 String.valueOf=function(o){
1315 return String.value0f();
1317 if(o instanceof Array){
1318 if(arguments.length==1){
1321 var off=arguments[1];
1322 var len=arguments[2];
1323 var oo=new Array(len);
1324 for(var i=0;i<len;i++){
1333 sp.subSequence=function(beginIndex,endIndex){
1334 return this.substring(beginIndex,endIndex);
1337 sp.compareToIgnoreCase=function(str){
1339 throw new NullPointerException();
1341 var s1=this.toUpperCase();
1342 var s2=str.toUpperCase();
1346 var s1=this.toLowerCase();
1347 var s2=str.toLowerCase();
1358 sp.contentEquals=function(sb){
1359 if(this.length!=sb.length()){
1362 var v=sb.getValue();
1367 if(this.charCodeAt(i++)!=v[j++]){
1374 sp.getChars=function(srcBegin,srcEnd,dst,dstBegin){
1376 throw new StringIndexOutOfBoundsException(srcBegin);
1378 if(srcEnd>this.length){
1379 throw new StringIndexOutOfBoundsException(srcEnd);
1381 if(srcBegin>srcEnd){
1382 throw new StringIndexOutOfBoundsException(srcEnd-srcBegin);
1385 throw new NullPointerException();
1387 for(var i=0;i<srcEnd-srcBegin;i++){
1388 dst[dstBegin+i]=this.charAt(srcBegin+i);
1391 sp.$concat=sp.concat;
1392 sp.concat=function(s){
1394 throw new NullPointerException();
1396 return this.$concat(s);
1399 sp.$lastIndexOf=sp.lastIndexOf;
1400 sp.lastIndexOf=function(s,last){
1401 if(last!=null&&last+this.length<=0){
1405 return this.$lastIndexOf(s,last);
1407 return this.$lastIndexOf(s);
1411 sp.intern=function(){
1412 return this.valueOf();
1414 String.copyValueOf=sp.copyValueOf=function(){
1415 if(arguments.length==1){
1416 return String.instantialize(arguments[0]);
1418 return String.instantialize(arguments[0],arguments[1],arguments[2]);
1422 sp.codePointAt || (sp.codePointAt = sp.charCodeAt); // Firefox only
1425 })(String.prototype);
1429 String.indexOf=function(source,sourceOffset,sourceCount,
1430 target,targetOffset,targetCount,fromIndex){
1431 if(fromIndex>=sourceCount){
1432 return(targetCount==0?sourceCount:-1);
1441 var first=target[targetOffset];
1442 var i=sourceOffset+fromIndex;
1443 var max=sourceOffset+(sourceCount-targetCount);
1445 startSearchForFirstChar:
1448 while(i<=max&&source[i]!=first){
1457 var end=j+targetCount-1;
1458 var k=targetOffset+1;
1460 if(source[j++]!=target[k++]){
1463 continue startSearchForFirstChar;
1466 return i-sourceOffset;
1472 String.instantialize=function(){
1473 if(arguments.length==0){
1474 return new String();
1475 }else if(arguments.length==1){
1477 if(typeof x=="string"||x instanceof String){
1478 return new String(x);
1479 }else if(x instanceof Array){
1480 if(x.length>0&&typeof x[0]=="number"){
1481 var arr=new Array(x.length);
1482 for(var i=0;i<x.length;i++){
1483 arr[i]=String.fromCharCode(x[i]&0xff);
1485 return Encoding.readUTF8(arr.join(''));
1488 }else if(x.__CLASS_NAME__=="StringBuffer"
1489 ||x.__CLASS_NAME__=="java.lang.StringBuffer"){
1490 var value=x.shareValue();
1491 var length=x.length();
1492 var valueCopy=new Array(length);
1493 for(var i=0;i<length;i++){
1494 valueCopy[i]=value[i];
1496 return valueCopy.join('')
1501 }else if(arguments.length==2){
1503 var hibyte=arguments[1];
1504 if(typeof hibyte=="string"){
1505 return String.instantialize(x,0,x.length,hibyte);
1507 return String.instantialize(x,hibyte,0,x.length);
1509 }else if(arguments.length==3){
1510 var bytes=arguments[0];
1511 var offset=arguments[1];
1512 var length=arguments[2];
1513 if(arguments[2]instanceof Array){
1515 offset=arguments[0];
1516 length=arguments[1];
1518 var arr=new Array(length);
1519 if(offset<0||length+offset>bytes.length){
1520 throw new IndexOutOfBoundsException();
1523 var isChar=(bytes[offset].length!=null);
1525 for(var i=0;i<length;i++){
1526 arr[i]=bytes[offset+i];
1529 for(var i=0;i<length;i++){
1530 arr[i]=String.fromCharCode(bytes[offset+i]);
1534 return arr.join('');
1535 }else if(arguments.length==4){
1536 var bytes=arguments[0];
1538 if(typeof y=="string"||y instanceof String){
1539 var offset=arguments[1];
1540 var length=arguments[2];
1541 var arr=new Array(length);
1542 for(var i=0;i<length;i++){
1543 arr[i]=bytes[offset+i];
1544 if(typeof arr[i]=="number"){
1545 arr[i]=String.fromCharCode(arr[i]&0xff);
1548 var cs=y.toLowerCase();
1549 if(cs=="utf-8"||cs=="utf8"){
1550 return Encoding.readUTF8(arr.join(''));
1552 return arr.join('');
1555 var count=arguments[3];
1556 var offset=arguments[2];
1557 var hibyte=arguments[1];
1558 var value=new Array(count);
1560 for(var i=count;i-->0;){
1561 value[i]=String.fromCharCode(bytes[i+offset]&0xff);
1565 for(var i=count;i-->0;){
1566 value[i]=String.fromCharCode(hibyte|(bytes[i+offset]&0xff));
1569 return value.join('');
1573 for(var i=0;i<arguments.length;i++){
1584 String.instantialize=function(){
1585 switch (arguments.length) {
1587 return new String();
1590 if(typeof x=="string"||x instanceof String){
1591 return new String(x);
1593 if(x instanceof Array || x instanceof Int32Array){
1596 if(typeof x[0]!="number")
1598 var arr=new Array(x.length);
1599 for(var i=0;i<x.length;i++)
1600 arr[i]=String.fromCharCode(x[i]&0xff);
1601 return Encoding.readUTF8(arr.join(''));
1603 if(x.__CLASS_NAME__=="StringBuffer"||x.__CLASS_NAME__=="java.lang.StringBuffer"){
1604 var value=x.shareValue();
1605 var length=x.length();
1606 var valueCopy=new Array(length);
1607 for(var i=0;i<length;i++){
1608 valueCopy[i]=value[i];
1610 return valueCopy.join('')
1615 var hibyte=arguments[1];
1616 if(typeof hibyte=="string"){
1617 return String.instantialize(x,0,x.length,hibyte);
1619 return String.instantialize(x,hibyte,0,x.length);
1621 var bytes=arguments[0];
1622 var offset=arguments[1];
1623 var length=arguments[2];
1624 if(arguments[2]instanceof Array){
1626 offset=arguments[0];
1627 length=arguments[1];
1629 var arr=new Array(length);
1630 if(offset<0||length+offset>bytes.length){
1631 throw new IndexOutOfBoundsException();
1634 var isChar=(bytes[offset].length!=null);
1636 for(var i=0;i<length;i++){
1637 arr[i]=bytes[offset+i];
1640 for(var i=0;i<length;i++){
1641 arr[i]=String.fromCharCode(bytes[offset+i]);
1645 return arr.join('');
1647 var bytes=arguments[0];
1649 if(typeof y=="string"||y instanceof String){
1650 var offset=arguments[1];
1651 var length=arguments[2];
1652 var arr=new Array(length);
1653 for(var i=0;i<length;i++){
1654 arr[i]=bytes[offset+i];
1655 if(typeof arr[i]=="number"){
1656 arr[i]=String.fromCharCode(arr[i]&0xff);
1659 var cs=y.toLowerCase();
1660 if(cs=="utf-8"||cs=="utf8"){
1661 return Encoding.readUTF8(arr.join(''));
1663 return arr.join('');
1665 var count=arguments[3];
1666 var offset=arguments[2];
1667 var hibyte=arguments[1];
1668 var value=new Array(count);
1670 for(var i=count;i-->0;){
1671 value[i]=String.fromCharCode(bytes[i+offset]&0xff);
1675 for(var i=count;i-->0;){
1676 value[i]=String.fromCharCode(hibyte|(bytes[i+offset]&0xff));
1679 return value.join('');
1682 for(var i=0;i<arguments.length;i++){
1689 if(navigator.userAgent.toLowerCase().indexOf("chrome")!=-1){
1690 String.prototype.toString=function(){return this.valueOf();};
1695 })(Clazz._Encoding);
1699 c$=Clazz_decorateAsClass(function(){
1701 Clazz_instantialize(this,arguments);
1702 },java.lang,"Character",null,[java.io.Serializable,Comparable]);
1703 Clazz_makeConstructor(c$,
1707 Clazz_defineMethod(c$,"charValue",
1711 Clazz_overrideMethod(c$,"hashCode",
1713 return(this.value).charCodeAt(0);
1715 Clazz_overrideMethod(c$,"equals",
1717 if(Clazz_instanceOf(obj,Character)){
1718 return(this.value).charCodeAt(0)==((obj).charValue()).charCodeAt(0);
1721 Clazz_overrideMethod(c$,"compareTo",
1723 return(this.value).charCodeAt(0)-(c.value).charCodeAt(0);
1725 c$.toLowerCase=Clazz_defineMethod(c$,"toLowerCase",
1727 return(""+c).toLowerCase().charAt(0);
1729 c$.toUpperCase=Clazz_defineMethod(c$,"toUpperCase",
1731 return(""+c).toUpperCase().charAt(0);
1733 c$.isDigit=Clazz_defineMethod(c$,"isDigit",
1735 c = c.charCodeAt(0);
1736 return (48 <= c && c <= 57);
1738 c$.isUpperCase=Clazz_defineMethod(c$,"isUpperCase",
1740 c = c.charCodeAt(0);
1741 return (65 <= c && c <= 90);
1743 c$.isLowerCase=Clazz_defineMethod(c$,"isLowerCase",
1745 c = c.charCodeAt(0);
1746 return (97 <= c && c <= 122);
1748 c$.isWhitespace=Clazz_defineMethod(c$,"isWhitespace",
1750 c = (c).charCodeAt(0);
1751 return (c >= 0x1c && c <= 0x20 || c >= 0x9 && c <= 0xd || c == 0x1680
1752 || c >= 0x2000 && c != 0x2007 && (c <= 0x200b || c == 0x2028 || c == 0x2029 || c == 0x3000));
1754 c$.isLetter=Clazz_defineMethod(c$,"isLetter",
1756 c = c.charCodeAt(0);
1757 return (65 <= c && c <= 90 || 97 <= c && c <= 122);
1759 c$.isLetterOrDigit=Clazz_defineMethod(c$,"isLetterOrDigit",
1761 c = c.charCodeAt(0);
1762 return (65 <= c && c <= 90 || 97 <= c && c <= 122 || 48 <= c && c <= 57);
1764 c$.isSpaceChar=Clazz_defineMethod(c$,"isSpaceChar",
1766 var i = c.charCodeAt(0);
1767 if(i==0x20||i==0xa0||i==0x1680)return true;
1768 if(i<0x2000)return false;
1769 return i<=0x200b||i==0x2028||i==0x2029||i==0x202f||i==0x3000;
1771 c$.digit=Clazz_defineMethod(c$,"digit",
1773 var i = c.charCodeAt(0);
1774 if(radix >= 2 && radix <= 36){
1777 if(48 <= i && i <= 57){
1779 }else if(97 <= i && i <= 122){
1781 }else if(65 <= i && i <= 90){
1784 return (result < radix ? result : -1);
1789 Clazz_overrideMethod(c$,"toString",
1791 var buf=[this.value];
1792 return String.valueOf(buf);
1794 c$.toString=Clazz_overrideMethod(c$,"toString",
1797 if(this===Character){
1798 return"class java.lang.Character";
1800 }return String.valueOf(c);
1802 Clazz_defineStatics(c$,
1803 "MIN_VALUE",'\u0000',
1804 "MAX_VALUE",'\uffff',
1809 java.lang.Character.TYPE=java.lang.Character.prototype.TYPE=java.lang.Character;
1813 Clazz._ArrayWrapper = function(a, type) {
1816 __CLASS_NAME__:"Array",
1818 getComponentType: function() {return type},
1819 instanceOf: function(o) { return Clazz_instanceOf(type, o) },
1820 getName: function() { return this.__CLASS_NAME__ }
1823 c$=Clazz_declareType(java.lang.reflect,"Array");
1824 c$.newInstance=Clazz_defineMethod(c$,"newInstance",
1825 function(componentType,size){
1826 var a = Clazz_newArray(size);
1827 a.getClass = function() { return new Clazz._ArrayWrapper(this, componentType);};
1832 Date.TYPE="javautil.Date";
1833 Date.__CLASS_NAME__="Date";
1834 Clazz_implementOf(Date,[java.io.Serializable,java.lang.Comparable]);
1836 Clazz_defineMethod(javautil.Date,"clone",
1838 return new Date(this.getTime());
1841 Clazz_defineMethod(javautil.Date,"before",
1843 return this.getTime()<when.getTime();
1845 Clazz_defineMethod(javautil.Date,"after",
1847 return this.getTime()>when.getTime();
1849 Clazz_defineMethod(javautil.Date,"equals",
1851 return Clazz_instanceOf(obj,javautil.Date)&&this.getTime()==(obj).getTime();
1853 Clazz_defineMethod(javautil.Date,"compareTo",
1854 function(anotherDate){
1855 var thisTime=this.getTime();
1856 var anotherTime=anotherDate.getTime();
1857 return(thisTime<anotherTime?-1:(thisTime==anotherTime?0:1));
1859 Clazz_defineMethod(javautil.Date,"compareTo",
1861 return this.compareTo(o);
1863 Clazz_overrideMethod(javautil.Date,"hashCode",
1865 var ht=this.getTime();
1866 return parseInt(ht)^parseInt((ht>>32));
1869 c$=Clazz_decorateAsClass(function(){
1871 Clazz_instantialize(this,arguments);
1872 },javautil,"EventObject",null,java.io.Serializable);
1873 Clazz_makeConstructor(c$,
1875 if(source!=null)this.source=source;
1876 else throw new IllegalArgumentException();
1878 Clazz_defineMethod(c$,"getSource",
1882 Clazz_overrideMethod(c$,"toString",
1884 return this.getClass().getName()+"[source="+String.valueOf(this.source)+']';
1886 Clazz_declareInterface(javautil,"EventListener");
1888 c$=Clazz_decorateAsClass(function(){
1890 Clazz_instantialize(this,arguments);
1891 },javautil,"EventListenerProxy",null,javautil.EventListener);
1892 Clazz_makeConstructor(c$,
1894 this.listener=listener;
1895 },"javautil.EventListener");
1896 Clazz_defineMethod(c$,"getListener",
1898 return this.listener;
1900 Clazz_declareInterface(javautil,"Iterator");
1902 Clazz_declareInterface(javautil,"ListIterator",javautil.Iterator);
1903 Clazz_declareInterface(javautil,"Enumeration");
1904 Clazz_declareInterface(javautil,"Collection",Iterable);
1906 Clazz_declareInterface(javautil,"Set",javautil.Collection);
1907 Clazz_declareInterface(javautil,"Map");
1908 Clazz_declareInterface(javautil.Map,"Entry");
1910 Clazz_declareInterface(javautil,"List",javautil.Collection);
1912 Clazz_declareInterface(javautil,"Queue",javautil.Collection);
1913 Clazz_declareInterface(javautil,"RandomAccess");
1914 c$=Clazz_decorateAsClass(function(){
1915 this.detailMessage=null;
1917 this.stackTrace=null;
1918 Clazz_instantialize(this,arguments);
1919 },java.lang,"Throwable",null,java.io.Serializable);
1920 Clazz_prepareFields(c$,function(){
1922 //alert("e0 "+ arguments.callee.caller.caller.caller.caller.caller)
1924 Clazz_makeConstructor(c$,
1926 this.fillInStackTrace();
1928 Clazz_makeConstructor(c$,
1930 this.fillInStackTrace();
1931 this.detailMessage=message;
1933 Clazz_makeConstructor(c$,
1934 function(message,cause){
1935 this.fillInStackTrace();
1936 this.detailMessage=message;
1939 Clazz_makeConstructor(c$,
1941 this.fillInStackTrace();
1942 this.detailMessage=(cause==null?null:cause.toString());
1945 Clazz_defineMethod(c$,"getMessage",
1947 return (this.message || this.detailMessage || this.toString());
1949 Clazz_defineMethod(c$,"getLocalizedMessage",
1951 return this.getMessage();
1953 Clazz_defineMethod(c$,"getCause",
1955 return(this.cause===this?null:this.cause);
1957 Clazz_defineMethod(c$,"initCause",
1959 if(this.cause!==this)throw new IllegalStateException("Can't overwrite cause");
1960 if(cause===this)throw new IllegalArgumentException("Self-causation not permitted");
1964 Clazz_overrideMethod(c$,"toString",
1966 var s=this.getClass().getName();
1967 var message=this.message || this.detailMessage;
1968 return(message ? s+": "+message : s);
1970 Clazz_defineMethod(c$,"printStackTrace",
1972 System.err.println(this.getStackTrace ? this.getStackTrace() : this.message + " " + Clazz_getStackTrace());
1975 Clazz_defineMethod(c$,"getStackTrace",
1977 var s = "" + this + "\n";
1978 for(var i=0;i<this.stackTrace.length;i++){
1979 var t=this.stackTrace[i];
1980 var x=t.methodName.indexOf("(");
1981 var n=t.methodName.substring(0,x).replace(/\s+/g,"");
1982 if(n!="construct"||t.nativeClazz==null
1983 ||Clazz_getInheritedLevel(t.nativeClazz,Throwable)<0){
1991 Clazz_defineMethod(c$,"printStackTrace",
1993 this.printStackTrace();
1994 },"java.io.PrintStream");
1995 Clazz_defineMethod(c$,"printStackTrace",
1997 this.printStackTrace();
1998 },"java.io.PrintWriter");
1999 Clazz_defineMethod(c$,"fillInStackTrace",
2001 this.stackTrace=new Array();
2002 var caller=arguments.callee.caller;
2003 var superCaller=null;
2004 var callerList=new Array();
2005 var index=Clazz._callingStackTraces.length-1;
2007 while(index>-1||caller!=null){
2009 var nativeClass=null;
2010 if(!noLooping||caller==Clazz_tryToSearchAndExecute||caller==Clazz_superCall||caller==null){
2015 superCaller=Clazz._callingStackTraces[index].caller;
2016 nativeClass=Clazz._callingStackTraces[index].owner;
2020 if(superCaller.claxxOwner!=null){
2021 nativeClass=superCaller.claxxOwner;
2022 }else if(superCaller.exClazz!=null){
2023 nativeClass=superCaller.exClazz;
2026 var st=new StackTraceElement(
2027 ((nativeClass!=null&&nativeClass.__CLASS_NAME__.length!=0)?
2028 nativeClass.__CLASS_NAME__:"anonymous"),
2029 ((superCaller.exName==null)?"anonymous":superCaller.exName)
2030 +" ("+Clazz_getParamsType(superCaller.arguments)+")",
2032 st.nativeClazz=nativeClass;
2033 this.stackTrace[this.stackTrace.length]=st;
2034 for(var i=0;i<callerList.length;i++){
2035 if(callerList[i]==superCaller){
2037 var st=new StackTraceElement("lost","missing",null,-3);
2038 st.nativeClazz=null;
2039 this.stackTrace[this.stackTrace.length]=st;
2044 if(superCaller!=null){
2045 callerList[callerList.length]=superCaller;
2047 caller=superCaller.arguments.callee.caller;
2049 Clazz._initializingException=false;
2052 Clazz_defineMethod(c$,"setStackTrace",
2053 function(stackTrace){
2054 var defensiveCopy=stackTrace.clone();
2055 for(var i=0;i<defensiveCopy.length;i++)if(defensiveCopy[i]==null)throw new NullPointerException("stackTrace["+i+"]");
2057 this.stackTrace=defensiveCopy;
2060 c$=Clazz_decorateAsClass(function(){
2061 this.declaringClass=null;
2062 this.methodName=null;
2065 Clazz_instantialize(this,arguments);
2066 },java.lang,"StackTraceElement",null,java.io.Serializable);
2067 Clazz_makeConstructor(c$,
2068 function(cls,method,file,line){
2069 if(cls==null||method==null){
2070 throw new NullPointerException();
2071 }this.declaringClass=cls;
2072 this.methodName=method;
2074 this.lineNumber=line;
2076 Clazz_overrideMethod(c$,"equals",
2078 if(!(Clazz_instanceOf(obj,StackTraceElement))){
2081 if((this.methodName==null)||(castObj.methodName==null)){
2083 }if(!this.getMethodName().equals(castObj.getMethodName())){
2085 }if(!this.getClassName().equals(castObj.getClassName())){
2087 }var localFileName=this.getFileName();
2088 if(localFileName==null){
2089 if(castObj.getFileName()!=null){
2092 if(!localFileName.equals(castObj.getFileName())){
2094 }}if(this.getLineNumber()!=castObj.getLineNumber()){
2098 Clazz_defineMethod(c$,"getClassName",
2100 return(this.declaringClass==null)?"<unknown class>":this.declaringClass;
2102 Clazz_defineMethod(c$,"getFileName",
2104 return this.fileName;
2106 Clazz_defineMethod(c$,"getLineNumber",
2108 return this.lineNumber;
2110 Clazz_defineMethod(c$,"getMethodName",
2112 return(this.methodName==null)?"<unknown method>":this.methodName;
2114 Clazz_overrideMethod(c$,"hashCode",
2116 if(this.methodName==null){
2118 }return this.methodName.hashCode()^this.declaringClass.hashCode();
2120 Clazz_defineMethod(c$,"isNativeMethod",
2122 return this.lineNumber==-2;
2124 Clazz_overrideMethod(c$,"toString",
2126 var buf=new StringBuilder(80);
2127 buf.append(this.getClassName());
2129 buf.append(this.getMethodName());
2130 if(this.isNativeMethod()){
2131 buf.append("(Native Method)");
2133 var fName=this.getFileName();
2135 buf.append("(Unknown Source)");
2137 var lineNum=this.getLineNumber();
2142 buf.append(lineNum);
2144 }}return buf.toString();
2146 TypeError.prototype.getMessage || (TypeError.prototype.getMessage = function(){ return (this.message || this.toString()) + (this.getStackTrace ? this.getStackTrace() : Clazz_getStackTrace())});
2147 c$=Clazz_declareType(java.lang,"Error",Throwable);
2149 c$=Clazz_declareType(java.lang,"LinkageError",Error);
2151 c$=Clazz_declareType(java.lang,"IncompatibleClassChangeError",LinkageError);
2153 c$=Clazz_declareType(java.lang,"AbstractMethodError",IncompatibleClassChangeError);
2155 c$=Clazz_declareType(java.lang,"AssertionError",Error);
2156 Clazz_makeConstructor(c$,
2157 function(detailMessage){
2158 Clazz_superConstructor(this,AssertionError,[String.valueOf(detailMessage),(Clazz_instanceOf(detailMessage,Throwable)?detailMessage:null)]);
2160 Clazz_makeConstructor(c$,
2161 function(detailMessage){
2162 this.construct("" + detailMessage);
2164 Clazz_makeConstructor(c$,
2165 function(detailMessage){
2166 this.construct("" + detailMessage);
2169 c$=Clazz_declareType(java.lang,"ClassCircularityError",LinkageError);
2171 c$=Clazz_declareType(java.lang,"ClassFormatError",LinkageError);
2173 c$=Clazz_decorateAsClass(function(){
2174 this.exception=null;
2175 Clazz_instantialize(this,arguments);
2176 },java.lang,"ExceptionInInitializerError",LinkageError);
2177 Clazz_makeConstructor(c$,
2179 Clazz_superConstructor(this,ExceptionInInitializerError);
2180 this.initCause(null);
2182 Clazz_makeConstructor(c$,
2183 function(detailMessage){
2184 Clazz_superConstructor(this,ExceptionInInitializerError,[detailMessage]);
2185 this.initCause(null);
2187 Clazz_makeConstructor(c$,
2188 function(exception){
2189 Clazz_superConstructor(this,ExceptionInInitializerError);
2190 this.exception=exception;
2191 this.initCause(exception);
2193 Clazz_defineMethod(c$,"getException",
2195 return this.exception;
2197 Clazz_overrideMethod(c$,"getCause",
2199 return this.exception;
2202 c$=Clazz_declareType(java.lang,"IllegalAccessError",IncompatibleClassChangeError);
2204 c$=Clazz_declareType(java.lang,"InstantiationError",IncompatibleClassChangeError);
2206 c$=Clazz_declareType(java.lang,"VirtualMachineError",Error);
2208 c$=Clazz_declareType(java.lang,"InternalError",VirtualMachineError);
2210 c$=Clazz_declareType(java.lang,"NoClassDefFoundError",LinkageError);
2212 c$=Clazz_declareType(java.lang,"NoSuchFieldError",IncompatibleClassChangeError);
2214 c$=Clazz_declareType(java.lang,"NoSuchMethodError",IncompatibleClassChangeError);
2216 c$=Clazz_declareType(java.lang,"OutOfMemoryError",VirtualMachineError);
2218 c$=Clazz_declareType(java.lang,"StackOverflowError",VirtualMachineError);
2220 c$=Clazz_declareType(java.lang,"UnknownError",VirtualMachineError);
2222 c$=Clazz_declareType(java.lang,"UnsatisfiedLinkError",LinkageError);
2224 c$=Clazz_declareType(java.lang,"UnsupportedClassVersionError",ClassFormatError);
2226 c$=Clazz_declareType(java.lang,"VerifyError",LinkageError);
2228 c$=Clazz_declareType(java.lang,"ThreadDeath",Error);
2229 Clazz_makeConstructor(c$,
2231 Clazz_superConstructor(this,ThreadDeath,[]);
2234 c$=Clazz_declareType(java.lang,"Exception",Throwable);
2236 c$=Clazz_declareType(java.lang,"RuntimeException",Exception);
2238 c$=Clazz_declareType(java.lang,"ArithmeticException",RuntimeException);
2240 c$=Clazz_declareType(java.lang,"IndexOutOfBoundsException",RuntimeException);
2242 c$=Clazz_declareType(java.lang,"ArrayIndexOutOfBoundsException",IndexOutOfBoundsException);
2243 Clazz_makeConstructor(c$,
2245 Clazz_superConstructor(this,ArrayIndexOutOfBoundsException,["Array index out of range: "+index]);
2248 c$=Clazz_declareType(java.lang,"ArrayStoreException",RuntimeException);
2250 c$=Clazz_declareType(java.lang,"ClassCastException",RuntimeException);
2252 c$=Clazz_decorateAsClass(function(){
2254 Clazz_instantialize(this,arguments);
2255 },java.lang,"ClassNotFoundException",Exception);
2256 Clazz_makeConstructor(c$,
2258 Clazz_superConstructor(this,ClassNotFoundException,[Clazz_castNullAs("Throwable")]);
2260 Clazz_makeConstructor(c$,
2261 function(detailMessage){
2262 Clazz_superConstructor(this,ClassNotFoundException,[detailMessage,null]);
2264 Clazz_makeConstructor(c$,
2265 function(detailMessage,exception){
2266 Clazz_superConstructor(this,ClassNotFoundException,[detailMessage]);
2269 Clazz_defineMethod(c$,"getException",
2273 Clazz_overrideMethod(c$,"getCause",
2278 c$=Clazz_declareType(java.lang,"CloneNotSupportedException",Exception);
2280 c$=Clazz_declareType(java.lang,"IllegalAccessException",Exception);
2282 c$=Clazz_declareType(java.lang,"IllegalArgumentException",RuntimeException);
2283 Clazz_makeConstructor(c$,
2285 Clazz_superConstructor(this,IllegalArgumentException,[(cause==null?null:cause.toString()),cause]);
2288 c$=Clazz_declareType(java.lang,"IllegalMonitorStateException",RuntimeException);
2290 c$=Clazz_declareType(java.lang,"IllegalStateException",RuntimeException);
2291 Clazz_makeConstructor(c$,
2293 Clazz_superConstructor(this,IllegalStateException,[(cause==null?null:cause.toString()),cause]);
2296 c$=Clazz_declareType(java.lang,"IllegalThreadStateException",IllegalArgumentException);
2298 c$=Clazz_declareType(java.lang,"InstantiationException",Exception);
2300 c$=Clazz_declareType(java.lang,"InterruptedException",Exception);
2302 c$=Clazz_declareType(java.lang,"NegativeArraySizeException",RuntimeException);
2304 c$=Clazz_declareType(java.lang,"NoSuchFieldException",Exception);
2306 c$=Clazz_declareType(java.lang,"NoSuchMethodException",Exception);
2308 c$=Clazz_declareType(java.lang,"NullPointerException",RuntimeException);
2310 c$=Clazz_declareType(java.lang,"NumberFormatException",IllegalArgumentException);
2312 c$=Clazz_declareType(java.lang,"SecurityException",RuntimeException);
2313 Clazz_makeConstructor(c$,
2315 Clazz_superConstructor(this,SecurityException,[(cause==null?null:cause.toString()),cause]);
2318 c$=Clazz_declareType(java.lang,"StringIndexOutOfBoundsException",IndexOutOfBoundsException);
2319 Clazz_makeConstructor(c$,
2321 Clazz_superConstructor(this,StringIndexOutOfBoundsException,["String index out of range: "+index]);
2324 c$=Clazz_declareType(java.lang,"UnsupportedOperationException",RuntimeException);
2325 Clazz_makeConstructor(c$,
2327 Clazz_superConstructor(this,UnsupportedOperationException,[]);
2329 Clazz_makeConstructor(c$,
2331 Clazz_superConstructor(this,UnsupportedOperationException,[(cause==null?null:cause.toString()),cause]);
2334 c$=Clazz_decorateAsClass(function(){
2336 Clazz_instantialize(this,arguments);
2337 },java.lang.reflect,"InvocationTargetException",Exception);
2338 Clazz_makeConstructor(c$,
2340 Clazz_superConstructor(this,java.lang.reflect.InvocationTargetException,[Clazz_castNullAs("Throwable")]);
2342 Clazz_makeConstructor(c$,
2343 function(exception){
2344 Clazz_superConstructor(this,java.lang.reflect.InvocationTargetException,[null,exception]);
2345 this.target=exception;
2347 Clazz_makeConstructor(c$,
2348 function(exception,detailMessage){
2349 Clazz_superConstructor(this,java.lang.reflect.InvocationTargetException,[detailMessage,exception]);
2350 this.target=exception;
2352 Clazz_defineMethod(c$,"getTargetException",
2356 Clazz_overrideMethod(c$,"getCause",
2361 c$=Clazz_decorateAsClass(function(){
2362 this.undeclaredThrowable=null;
2363 Clazz_instantialize(this,arguments);
2364 },java.lang.reflect,"UndeclaredThrowableException",RuntimeException);
2365 Clazz_makeConstructor(c$,
2366 function(exception){
2367 Clazz_superConstructor(this,java.lang.reflect.UndeclaredThrowableException);
2368 this.undeclaredThrowable=exception;
2369 this.initCause(exception);
2371 Clazz_makeConstructor(c$,
2372 function(exception,detailMessage){
2373 Clazz_superConstructor(this,java.lang.reflect.UndeclaredThrowableException,[detailMessage]);
2374 this.undeclaredThrowable=exception;
2375 this.initCause(exception);
2377 Clazz_defineMethod(c$,"getUndeclaredThrowable",
2379 return this.undeclaredThrowable;
2381 Clazz_overrideMethod(c$,"getCause",
2383 return this.undeclaredThrowable;
2386 c$=Clazz_declareType(java.io,"IOException",Exception);
2389 c$=Clazz_declareType(java.io,"CharConversionException",java.io.IOException);
2391 c$=Clazz_declareType(java.io,"EOFException",java.io.IOException);
2393 c$=Clazz_declareType(java.io,"FileNotFoundException",java.io.IOException);
2395 c$=Clazz_decorateAsClass(function(){
2396 this.bytesTransferred=0;
2397 Clazz_instantialize(this,arguments);
2398 },java.io,"InterruptedIOException",java.io.IOException);
2400 c$=Clazz_declareType(java.io,"ObjectStreamException",java.io.IOException);
2402 c$=Clazz_decorateAsClass(function(){
2403 this.classname=null;
2404 Clazz_instantialize(this,arguments);
2405 },java.io,"InvalidClassException",java.io.ObjectStreamException);
2406 Clazz_makeConstructor(c$,
2407 function(className,detailMessage){
2408 Clazz_superConstructor(this,java.io.InvalidClassException,[detailMessage]);
2409 this.classname=className;
2411 Clazz_defineMethod(c$,"getMessage",
2413 var msg=Clazz_superCall(this,java.io.InvalidClassException,"getMessage",[]);
2414 if(this.classname!=null){
2415 msg=this.classname+';' + ' '+msg;
2419 c$=Clazz_declareType(java.io,"InvalidObjectException",java.io.ObjectStreamException);
2421 c$=Clazz_declareType(java.io,"NotActiveException",java.io.ObjectStreamException);
2423 c$=Clazz_declareType(java.io,"NotSerializableException",java.io.ObjectStreamException);
2425 c$=Clazz_decorateAsClass(function(){
2428 Clazz_instantialize(this,arguments);
2429 },java.io,"OptionalDataException",java.io.ObjectStreamException);
2431 c$=Clazz_declareType(java.io,"StreamCorruptedException",java.io.ObjectStreamException);
2433 c$=Clazz_declareType(java.io,"SyncFailedException",java.io.IOException);
2435 c$=Clazz_declareType(java.io,"UnsupportedEncodingException",java.io.IOException);
2437 c$=Clazz_declareType(java.io,"UTFDataFormatException",java.io.IOException);
2439 c$=Clazz_decorateAsClass(function(){
2441 Clazz_instantialize(this,arguments);
2442 },java.io,"WriteAbortedException",java.io.ObjectStreamException);
2443 Clazz_makeConstructor(c$,
2444 function(detailMessage,rootCause){
2445 Clazz_superConstructor(this,java.io.WriteAbortedException,[detailMessage]);
2446 this.detail=rootCause;
2447 this.initCause(rootCause);
2449 Clazz_defineMethod(c$,"getMessage",
2451 var msg=Clazz_superCall(this,java.io.WriteAbortedException,"getMessage",[]);
2452 return (this.detail ? msg + "; "+this.detail.toString() : msg);
2454 Clazz_overrideMethod(c$,"getCause",
2459 c$=Clazz_declareType(javautil,"ConcurrentModificationException",RuntimeException);
2460 Clazz_makeConstructor(c$,
2462 Clazz_superConstructor(this,javautil.ConcurrentModificationException,[]);
2465 c$=Clazz_declareType(javautil,"EmptyStackException",RuntimeException);
2467 c$=Clazz_decorateAsClass(function(){
2468 this.className=null;
2470 Clazz_instantialize(this,arguments);
2471 },javautil,"MissingResourceException",RuntimeException);
2472 Clazz_makeConstructor(c$,
2473 function(detailMessage,className,resourceName){
2474 Clazz_superConstructor(this,javautil.MissingResourceException,[detailMessage]);
2475 this.className=className;
2476 this.key=resourceName;
2478 Clazz_defineMethod(c$,"getClassName",
2480 return this.className;
2482 Clazz_defineMethod(c$,"getKey",
2487 c$=Clazz_declareType(javautil,"NoSuchElementException",RuntimeException);
2489 c$=Clazz_declareType(javautil,"TooManyListenersException",Exception);
2491 c$=Clazz_declareType(java.lang,"Void");
2492 Clazz_defineStatics(c$,
2495 java.lang.Void.TYPE=java.lang.Void;
2496 }Clazz_declareInterface(java.lang.reflect,"GenericDeclaration");
2497 Clazz_declareInterface(java.lang.reflect,"AnnotatedElement");
2499 c$=Clazz_declareType(java.lang.reflect,"AccessibleObject",null,java.lang.reflect.AnnotatedElement);
2500 Clazz_makeConstructor(c$,
2503 Clazz_defineMethod(c$,"isAccessible",
2507 c$.setAccessible=Clazz_defineMethod(c$,"setAccessible",
2508 function(objects,flag){
2511 Clazz_defineMethod(c$,"setAccessible",
2515 Clazz_overrideMethod(c$,"isAnnotationPresent",
2516 function(annotationType){
2519 Clazz_overrideMethod(c$,"getDeclaredAnnotations",
2521 return new Array(0);
2523 Clazz_overrideMethod(c$,"getAnnotations",
2525 return new Array(0);
2527 Clazz_overrideMethod(c$,"getAnnotation",
2528 function(annotationType){
2531 c$.marshallArguments=Clazz_defineMethod(c$,"marshallArguments",
2532 function(parameterTypes,args){
2535 Clazz_defineMethod(c$,"invokeV",
2536 function(receiver,args){
2539 Clazz_defineMethod(c$,"invokeL",
2540 function(receiver,args){
2543 Clazz_defineMethod(c$,"invokeI",
2544 function(receiver,args){
2547 Clazz_defineMethod(c$,"invokeJ",
2548 function(receiver,args){
2551 Clazz_defineMethod(c$,"invokeF",
2552 function(receiver,args){
2555 Clazz_defineMethod(c$,"invokeD",
2556 function(receiver,args){
2559 c$.emptyArgs=c$.prototype.emptyArgs=new Array(0);
2560 Clazz_declareInterface(java.lang.reflect,"InvocationHandler");
2561 c$=Clazz_declareInterface(java.lang.reflect,"Member");
2562 Clazz_defineStatics(c$,
2566 c$=Clazz_declareType(java.lang.reflect,"Modifier");
2567 Clazz_makeConstructor(c$,
2570 c$.isAbstract=Clazz_defineMethod(c$,"isAbstract",
2571 function(modifiers){
2572 return((modifiers&1024)!=0);
2574 c$.isFinal=Clazz_defineMethod(c$,"isFinal",
2575 function(modifiers){
2576 return((modifiers&16)!=0);
2578 c$.isInterface=Clazz_defineMethod(c$,"isInterface",
2579 function(modifiers){
2580 return((modifiers&512)!=0);
2582 c$.isNative=Clazz_defineMethod(c$,"isNative",
2583 function(modifiers){
2584 return((modifiers&256)!=0);
2586 c$.isPrivate=Clazz_defineMethod(c$,"isPrivate",
2587 function(modifiers){
2588 return((modifiers&2)!=0);
2590 c$.isProtected=Clazz_defineMethod(c$,"isProtected",
2591 function(modifiers){
2592 return((modifiers&4)!=0);
2594 c$.isPublic=Clazz_defineMethod(c$,"isPublic",
2595 function(modifiers){
2596 return((modifiers&1)!=0);
2598 c$.isStatic=Clazz_defineMethod(c$,"isStatic",
2599 function(modifiers){
2600 return((modifiers&8)!=0);
2602 c$.isStrict=Clazz_defineMethod(c$,"isStrict",
2603 function(modifiers){
2604 return((modifiers&2048)!=0);
2606 c$.isSynchronized=Clazz_defineMethod(c$,"isSynchronized",
2607 function(modifiers){
2608 return((modifiers&32)!=0);
2610 c$.isTransient=Clazz_defineMethod(c$,"isTransient",
2611 function(modifiers){
2612 return((modifiers&128)!=0);
2614 c$.isVolatile=Clazz_defineMethod(c$,"isVolatile",
2615 function(modifiers){
2616 return((modifiers&64)!=0);
2618 c$.toString=Clazz_defineMethod(c$,"toString",
2619 function(modifiers){
2620 var sb=new Array(0);
2621 if(java.lang.reflect.Modifier.isPublic(modifiers))sb[sb.length]="public";
2622 if(java.lang.reflect.Modifier.isProtected(modifiers))sb[sb.length]="protected";
2623 if(java.lang.reflect.Modifier.isPrivate(modifiers))sb[sb.length]="private";
2624 if(java.lang.reflect.Modifier.isAbstract(modifiers))sb[sb.length]="abstract";
2625 if(java.lang.reflect.Modifier.isStatic(modifiers))sb[sb.length]="static";
2626 if(java.lang.reflect.Modifier.isFinal(modifiers))sb[sb.length]="final";
2627 if(java.lang.reflect.Modifier.isTransient(modifiers))sb[sb.length]="transient";
2628 if(java.lang.reflect.Modifier.isVolatile(modifiers))sb[sb.length]="volatile";
2629 if(java.lang.reflect.Modifier.isSynchronized(modifiers))sb[sb.length]="synchronized";
2630 if(java.lang.reflect.Modifier.isNative(modifiers))sb[sb.length]="native";
2631 if(java.lang.reflect.Modifier.isStrict(modifiers))sb[sb.length]="strictfp";
2632 if(java.lang.reflect.Modifier.isInterface(modifiers))sb[sb.length]="interface";
2634 return sb.join(" ");
2637 Clazz_defineStatics(c$,
2643 "SYNCHRONIZED",0x20,
2653 "ANNOTATION",0x2000,
2656 c$=Clazz_decorateAsClass(function(){
2658 this.parameterTypes=null;
2659 this.exceptionTypes=null;
2661 Clazz_instantialize(this,arguments);
2662 },java.lang.reflect,"Constructor",java.lang.reflect.AccessibleObject,[java.lang.reflect.GenericDeclaration,java.lang.reflect.Member]);
2663 Clazz_makeConstructor(c$,
2664 function(declaringClass,parameterTypes,checkedExceptions,modifiers){
2665 Clazz_superConstructor(this,java.lang.reflect.Constructor,[]);
2666 this.clazz=declaringClass;
2667 this.parameterTypes=parameterTypes;
2668 this.exceptionTypes=checkedExceptions;
2669 this.modifiers=modifiers;
2670 },"Class,~A,~A,~N");
2671 Clazz_overrideMethod(c$,"getTypeParameters",
2675 Clazz_defineMethod(c$,"toGenericString",
2679 Clazz_defineMethod(c$,"getGenericParameterTypes",
2683 Clazz_defineMethod(c$,"getGenericExceptionTypes",
2687 Clazz_defineMethod(c$,"getParameterAnnotations",
2691 Clazz_defineMethod(c$,"isVarArgs",
2695 Clazz_overrideMethod(c$,"isSynthetic",
2699 Clazz_overrideMethod(c$,"equals",
2701 if(object!=null&&Clazz_instanceOf(object,java.lang.reflect.Constructor)){
2703 if(this.getDeclaringClass()===other.getDeclaringClass()){
2704 var params1=this.parameterTypes;
2705 var params2=other.parameterTypes;
2706 if(params1.length==params2.length){
2707 for(var i=0;i<params1.length;i++){
2708 if(params1[i]!==params2[i])return false;
2713 Clazz_overrideMethod(c$,"getDeclaringClass",
2717 Clazz_defineMethod(c$,"getExceptionTypes",
2719 return this.exceptionTypes;
2721 Clazz_overrideMethod(c$,"getModifiers",
2723 return this.modifiers;
2725 Clazz_overrideMethod(c$,"getName",
2727 return this.getDeclaringClass().getName();
2729 Clazz_defineMethod(c$,"getParameterTypes",
2731 return this.parameterTypes;
2733 Clazz_overrideMethod(c$,"hashCode",
2735 return this.getDeclaringClass().getName().hashCode();
2737 Clazz_defineMethod(c$,"newInstance",
2739 var instance=new this.clazz(Clazz_inheritArgs);
2740 Clazz_instantialize(instance,args);
2743 Clazz_overrideMethod(c$,"toString",
2748 c$=Clazz_declareType(java.lang.reflect,"Field",java.lang.reflect.AccessibleObject,java.lang.reflect.Member);
2749 Clazz_overrideMethod(c$,"isSynthetic",
2753 Clazz_defineMethod(c$,"toGenericString",
2757 Clazz_defineMethod(c$,"isEnumConstant",
2761 Clazz_defineMethod(c$,"getGenericType",
2765 Clazz_overrideMethod(c$,"equals",
2769 Clazz_overrideMethod(c$,"getDeclaringClass",
2773 Clazz_overrideMethod(c$,"getName",
2777 Clazz_defineMethod(c$,"getType",
2781 Clazz_overrideMethod(c$,"hashCode",
2785 Clazz_overrideMethod(c$,"toString",
2790 c$=Clazz_decorateAsClass(function(){
2793 this.returnType=null;
2794 this.parameterTypes=null;
2795 this.exceptionTypes=null;
2797 Clazz_instantialize(this,arguments);
2798 },java.lang.reflect,"Method",java.lang.reflect.AccessibleObject,[java.lang.reflect.GenericDeclaration,java.lang.reflect.Member]);
2799 Clazz_makeConstructor(c$,
2800 function(declaringClass,name,parameterTypes,returnType,checkedExceptions,modifiers){
2801 Clazz_superConstructor(this,java.lang.reflect.Method,[]);
2802 this.clazz=declaringClass;
2804 this.parameterTypes=parameterTypes;
2805 this.returnType=returnType;
2806 this.exceptionTypes=checkedExceptions;
2807 this.modifiers=modifiers;
2808 },"Class,~S,~A,Class,~A,~N");
2809 Clazz_overrideMethod(c$,"getTypeParameters",
2813 Clazz_defineMethod(c$,"toGenericString",
2817 Clazz_defineMethod(c$,"getGenericParameterTypes",
2821 Clazz_defineMethod(c$,"getGenericExceptionTypes",
2825 Clazz_defineMethod(c$,"getGenericReturnType",
2829 Clazz_defineMethod(c$,"getParameterAnnotations",
2833 Clazz_defineMethod(c$,"isVarArgs",
2837 Clazz_defineMethod(c$,"isBridge",
2841 Clazz_overrideMethod(c$,"isSynthetic",
2845 Clazz_defineMethod(c$,"getDefaultValue",
2849 Clazz_overrideMethod(c$,"equals",
2851 if(object!=null&&Clazz_instanceOf(object,java.lang.reflect.Method)){
2853 if((this.getDeclaringClass()===other.getDeclaringClass())&&(this.getName()===other.getName())){
2854 var params1=this.parameterTypes;
2855 var params2=other.parameterTypes;
2856 if(params1.length==params2.length){
2857 for(var i=0;i<params1.length;i++){
2858 if(params1[i]!==params2[i])return false;
2863 Clazz_overrideMethod(c$,"getDeclaringClass",
2867 Clazz_defineMethod(c$,"getExceptionTypes",
2869 return this.exceptionTypes;
2871 Clazz_overrideMethod(c$,"getModifiers",
2873 return this.modifiers;
2875 Clazz_overrideMethod(c$,"getName",
2879 Clazz_defineMethod(c$,"getParameterTypes",
2881 return this.parameterTypes;
2883 Clazz_defineMethod(c$,"getReturnType",
2885 return this.returnType;
2887 Clazz_overrideMethod(c$,"hashCode",
2889 return this.getDeclaringClass().getName().hashCode()^this.getName().hashCode();
2891 Clazz_defineMethod(c$,"invoke",
2892 function(receiver,args){
2893 var m=this.clazz.prototype[this.getName()];
2895 m=this.clazz[this.getName()];
2898 m.apply(receiver,args);
2903 Clazz_overrideMethod(c$,"toString",
2909 Clazz_declarePackage ("JU");
2910 c$ = Clazz_declareType (JU, "DebugJS");
2911 c$._ = Clazz_defineMethod (c$, "_",
2914 if (Clazz._debugging) {
2918 Clazz_declarePackage ("java.awt");
2919 Clazz_load (["java.awt.Stroke"], "java.awt.BasicStroke", ["java.lang.Float", "$.IllegalArgumentException", "java.util.Arrays"], function () {
2920 c$ = Clazz_decorateAsClass (function () {
2924 this.miterlimit = 0;
2926 this.dash_phase = 0;
2927 Clazz_instantialize (this, arguments);
2928 }, java.awt, "BasicStroke", null, java.awt.Stroke);
2929 Clazz_makeConstructor (c$,
2930 function (width, cap, join, miterlimit, dash, dash_phase) {
2932 throw new IllegalArgumentException ("negative width");
2933 }if (cap != 0 && cap != 1 && cap != 2) {
2934 throw new IllegalArgumentException ("illegal end cap value");
2936 if (miterlimit < 1.0) {
2937 throw new IllegalArgumentException ("miter limit < 1");
2938 }} else if (join != 1 && join != 2) {
2939 throw new IllegalArgumentException ("illegal line join value");
2940 }if (dash != null) {
2941 if (dash_phase < 0.0) {
2942 throw new IllegalArgumentException ("negative dash phase");
2943 }var allzero = true;
2944 for (var i = 0; i < dash.length; i++) {
2948 } else if (d < 0.0) {
2949 throw new IllegalArgumentException ("negative dash length");
2952 throw new IllegalArgumentException ("dash lengths all zero");
2953 }}this.width = width;
2956 this.miterlimit = miterlimit;
2958 this.dash = dash.clone ();
2959 }this.dash_phase = dash_phase;
2960 }, "~N,~N,~N,~N,~A,~N");
2961 Clazz_makeConstructor (c$,
2962 function (width, cap, join, miterlimit) {
2963 this.construct (width, cap, join, miterlimit, null, 0.0);
2965 Clazz_makeConstructor (c$,
2966 function (width, cap, join) {
2967 this.construct (width, cap, join, 10.0, null, 0.0);
2969 Clazz_makeConstructor (c$,
2971 this.construct (width, 2, 0, 10.0, null, 0.0);
2973 Clazz_makeConstructor (c$,
2975 this.construct (1.0, 2, 0, 10.0, null, 0.0);
2977 Clazz_overrideMethod (c$, "createStrokedShape",
2980 }, "java.awt.Shape");
2981 Clazz_defineMethod (c$, "getLineWidth",
2985 Clazz_defineMethod (c$, "getEndCap",
2989 Clazz_defineMethod (c$, "getLineJoin",
2993 Clazz_defineMethod (c$, "getMiterLimit",
2995 return this.miterlimit;
2997 Clazz_defineMethod (c$, "getDashArray",
2999 if (this.dash == null) {
3001 }return this.dash.clone ();
3003 Clazz_defineMethod (c$, "getDashPhase",
3005 return this.dash_phase;
3007 Clazz_overrideMethod (c$, "hashCode",
3009 var hash = Float.floatToIntBits (this.width);
3010 hash = hash * 31 + this.join;
3011 hash = hash * 31 + this.cap;
3012 hash = hash * 31 + Float.floatToIntBits (this.miterlimit);
3013 if (this.dash != null) {
3014 hash = hash * 31 + Float.floatToIntBits (this.dash_phase);
3015 for (var i = 0; i < this.dash.length; i++) {
3016 hash = hash * 31 + Float.floatToIntBits (this.dash[i]);
3020 Clazz_overrideMethod (c$, "equals",
3022 if (!(Clazz_instanceOf (obj, java.awt.BasicStroke))) {
3025 if (this.width != bs.width) {
3027 }if (this.join != bs.join) {
3029 }if (this.cap != bs.cap) {
3031 }if (this.miterlimit != bs.miterlimit) {
3033 }if (this.dash != null) {
3034 if (this.dash_phase != bs.dash_phase) {
3036 }if (!java.util.Arrays.equals (this.dash, bs.dash)) {
3038 }} else if (bs.dash != null) {
3042 Clazz_defineStatics (c$,
3050 Clazz_declarePackage ("java.awt");
3051 Clazz_declareInterface (java.awt, "Stroke");
3052 Clazz_declarePackage ("java.util");
3053 Clazz_load (["java.util.HashMap"], "java.util.Locale", ["java.lang.InternalError", "$.NullPointerException", "$.StringBuilder"], function () {
3054 c$ = Clazz_decorateAsClass (function () {
3055 this.language = null;
3056 this.country = null;
3057 this.variant = null;
3058 this.hashCodeValue = 0;
3059 Clazz_instantialize (this, arguments);
3060 }, java.util, "Locale", null, [Cloneable, java.io.Serializable]);
3061 Clazz_makeConstructor (c$,
3062 function (language, country, variant) {
3063 this.language = language.intern ();
3064 this.country = country.intern ();
3065 this.variant = variant.intern ();
3067 Clazz_makeConstructor (c$,
3068 function (language, country) {
3069 this.construct (language, country, "");
3071 Clazz_makeConstructor (c$,
3072 function (language) {
3073 this.construct (language, "", "");
3075 Clazz_makeConstructor (c$,
3076 function (language, country, flag) {
3077 this.language = language;
3078 this.country = country;
3081 c$.createSingleton = Clazz_defineMethod (c$, "createSingleton",
3082 function (key, language, country) {
3083 var locale = new java.util.Locale (language, country, false);
3084 java.util.Locale.cache.put (key, locale);
3087 c$.getInstance = Clazz_defineMethod (c$, "getInstance",
3088 function (language, country, variant) {
3089 if (language == null || country == null || variant == null) {
3090 throw new NullPointerException ();
3091 }var sb = new StringBuilder ();
3092 sb.append (language).append ('_').append (country).append ('_').append (variant);
3093 var key = sb.toString ();
3094 var locale = java.util.Locale.cache.get (key);
3095 if (locale == null) {
3096 locale = new java.util.Locale (language, country, variant);
3097 var l = java.util.Locale.cache.put (key, locale);
3102 c$.getDefault = Clazz_defineMethod (c$, "getDefault",
3104 if (java.util.Locale.defaultLocale == null) {
3111 java.util.Locale.defaultLocale = java.util.Locale.getInstance (language, country, variant);
3112 }return java.util.Locale.defaultLocale;
3114 c$.setDefault = Clazz_defineMethod (c$, "setDefault",
3115 function (newLocale) {
3116 if (newLocale == null) throw new NullPointerException ("Can't set default locale to NULL");
3117 java.util.Locale.defaultLocale = newLocale;
3118 }, "java.util.Locale");
3119 Clazz_defineMethod (c$, "getLanguage",
3121 return this.language;
3123 Clazz_defineMethod (c$, "getCountry",
3125 return this.country;
3127 Clazz_defineMethod (c$, "getVariant",
3129 return this.variant;
3131 Clazz_overrideMethod (c$, "toString",
3133 var l = this.language.length != 0;
3134 var c = this.country.length != 0;
3135 var v = this.variant.length != 0;
3136 var result = new StringBuilder (this.language);
3137 if (c || (l && v)) {
3138 result.append ('_').append (this.country);
3139 }if (v && (l || c)) {
3140 result.append ('_').append (this.variant);
3141 }return result.toString ();
3143 Clazz_defineMethod (c$, "getDisplayLanguage",
3145 return this.getDisplayLanguage (java.util.Locale.getDefault ());
3147 Clazz_defineMethod (c$, "getDisplayLanguage",
3148 function (inLocale) {
3149 return this.getDisplayString (this.language, inLocale, 0);
3150 }, "java.util.Locale");
3151 Clazz_defineMethod (c$, "getDisplayCountry",
3153 return this.getDisplayCountry (java.util.Locale.getDefault ());
3155 Clazz_defineMethod (c$, "getDisplayCountry",
3156 function (inLocale) {
3157 return this.getDisplayString (this.country, inLocale, 1);
3158 }, "java.util.Locale");
3159 Clazz_defineMethod (c$, "getDisplayString",
3160 function (code, inLocale, type) {
3161 if (code.length == 0) {
3163 }if (inLocale == null) {
3164 throw new NullPointerException ();
3165 }return inLocale.toString ();
3166 }, "~S,java.util.Locale,~N");
3167 Clazz_defineMethod (c$, "getDisplayVariant",
3169 return this.getDisplayVariant (java.util.Locale.getDefault ());
3171 Clazz_defineMethod (c$, "getDisplayVariant",
3172 function (inLocale) {
3173 if (this.variant.length == 0) return "";
3174 return this.variant;
3175 }, "java.util.Locale");
3176 Clazz_defineMethod (c$, "getDisplayName",
3178 return this.getDisplayName (java.util.Locale.getDefault ());
3180 Clazz_defineMethod (c$, "getDisplayName",
3181 function (inLocale) {
3182 return inLocale.toString ();
3183 }, "java.util.Locale");
3184 Clazz_defineMethod (c$, "clone",
3187 var that = Clazz_superCall (this, java.util.Locale, "clone", []);
3190 if (Clazz_exceptionOf (e, CloneNotSupportedException)) {
3191 throw new InternalError ();
3197 Clazz_overrideMethod (c$, "hashCode",
3199 var hc = this.hashCodeValue;
3201 hc = (this.language.hashCode () << 8) ^ this.country.hashCode () ^ (this.variant.hashCode () << 4);
3202 this.hashCodeValue = hc;
3205 Clazz_overrideMethod (c$, "equals",
3207 if (this === obj) return true;
3208 if (!(Clazz_instanceOf (obj, java.util.Locale))) return false;
3210 return this.language === other.language && this.country === other.country && this.variant === other.variant;
3212 c$.cache = c$.prototype.cache = new java.util.HashMap (32);
3213 c$.ENGLISH = c$.prototype.ENGLISH = java.util.Locale.createSingleton ("en__", "en", "");
3214 c$.ROOT = c$.prototype.ROOT = java.util.Locale.createSingleton ("__", "", "");
3215 Clazz_defineStatics (c$,
3216 "DISPLAY_LANGUAGE", 0,
3217 "DISPLAY_COUNTRY", 1,
3218 "defaultLocale", null);
3220 Clazz_declarePackage ("java.util");
3221 Clazz_load (["java.util.Arrays", "$.Collections", "$.HashMap"], "java.util.ResourceBundle", ["java.io.BufferedInputStream", "$.ByteArrayInputStream", "java.lang.ClassNotFoundException", "$.IllegalArgumentException", "$.InternalError", "$.InterruptedException", "$.NullPointerException", "$.StringBuilder", "$.Thread", "java.util.ArrayList", "$.HashSet", "java.util.Locale", "$.MissingResourceException", "swingjs.JSToolkit", "swingjs.api.Interface"], function () {
3222 c$ = Clazz_decorateAsClass (function () {
3225 this.expired = false;
3226 this.$keySet = null;
3227 Clazz_instantialize (this, arguments);
3228 }, java.util, "ResourceBundle");
3229 Clazz_makeConstructor (c$,
3232 Clazz_defineMethod (c$, "getString",
3234 return this.getObject (key);
3236 Clazz_defineMethod (c$, "getStringArray",
3238 return this.getObject (key);
3240 Clazz_defineMethod (c$, "getObject",
3242 var obj = this.handleGetObject (key);
3244 if (this.parent != null) {
3245 obj = this.parent.getObject (key);
3246 }if (obj == null) throw new java.util.MissingResourceException ("Can't find resource for bundle " + this.getClass ().getName () + ", key " + key, this.getClass ().getName (), key);
3249 Clazz_defineMethod (c$, "getLocale",
3253 Clazz_defineMethod (c$, "setParent",
3255 this.parent = parent;
3256 }, "java.util.ResourceBundle");
3257 c$.getBundle = Clazz_defineMethod (c$, "getBundle",
3258 function (baseName, targetLocale, loader, control) {
3261 n = arguments.length;
3264 if ((Clazz_instanceOf (targetLocale, java.util.ResourceBundle.Control))) {
3265 control = targetLocale;
3266 targetLocale = null;
3269 if ((Clazz_instanceOf (loader, java.util.ResourceBundle.Control))) {
3274 if (targetLocale == null) targetLocale = java.util.Locale.getDefault ();
3275 if (control == null) control = java.util.ResourceBundle.Control.getControl (java.util.ResourceBundle.Control.FORMAT_PROPERTIES);
3276 return java.util.ResourceBundle.getBundleImpl (baseName, targetLocale, loader, control);
3277 }, "~S,~O,~O,java.util.ResourceBundle.Control");
3278 c$.getBundleImpl = Clazz_defineMethod (c$, "getBundleImpl",
3279 function (baseName, locale, loader, control) {
3280 if (control == null) {
3281 throw new NullPointerException ("ResourceBundle locale or control is null");
3282 }var cacheKey = new java.util.ResourceBundle.CacheKey (baseName, locale, loader);
3284 var bundleRef = java.util.ResourceBundle.cacheList.get (cacheKey);
3285 if (bundleRef != null) {
3288 }if (java.util.ResourceBundle.isValidBundle (bundle)) {
3290 }var formats = control.getFormats (baseName);
3291 var baseBundle = null;
3292 for (var targetLocale = locale; targetLocale != null; targetLocale = control.getFallbackLocale (baseName, targetLocale)) {
3293 var candidateLocales = control.getCandidateLocales (baseName, targetLocale);
3294 bundle = java.util.ResourceBundle.findBundle (cacheKey, candidateLocales, formats, 0, control, baseBundle);
3295 if (java.util.ResourceBundle.isValidBundle (bundle)) {
3296 var isBaseBundle = java.util.Locale.ROOT.equals (bundle.locale);
3297 if (!isBaseBundle || bundle.locale.equals (locale) || (candidateLocales.size () == 1 && bundle.locale.equals (candidateLocales.get (0)))) {
3299 }if (isBaseBundle && baseBundle == null) {
3300 baseBundle = bundle;
3302 if (bundle == null) {
3303 if (baseBundle == null) {
3304 java.util.ResourceBundle.throwMissingResourceException (baseName, locale, cacheKey.getCause ());
3305 }bundle = baseBundle;
3307 }, "~S,java.util.Locale,~O,java.util.ResourceBundle.Control");
3308 c$.findBundle = Clazz_defineMethod (c$, "findBundle",
3309 function (cacheKey, candidateLocales, formats, index, control, baseBundle) {
3310 var targetLocale = candidateLocales.get (index);
3312 if (index != candidateLocales.size () - 1) {
3313 parent = java.util.ResourceBundle.findBundle (cacheKey, candidateLocales, formats, index + 1, control, baseBundle);
3314 } else if (baseBundle != null && java.util.Locale.ROOT.equals (targetLocale)) {
3316 }var expiredBundle = false;
3317 cacheKey.setLocale (targetLocale);
3318 var bundle = java.util.ResourceBundle.findBundleInCache (cacheKey, control);
3319 if (java.util.ResourceBundle.isValidBundle (bundle)) {
3320 expiredBundle = bundle.expired;
3321 if (!expiredBundle) {
3322 if (bundle.parent === parent) {
3324 }var bundleRef = java.util.ResourceBundle.cacheList.get (cacheKey);
3325 if (bundleRef != null && bundleRef === bundle) {
3326 java.util.ResourceBundle.cacheList.remove (cacheKey);
3327 }}}if (bundle !== java.util.ResourceBundle.NONEXISTENT_BUNDLE) {
3328 var constKey = cacheKey.clone ();
3331 bundle = java.util.ResourceBundle.loadBundle (cacheKey, formats, control, expiredBundle);
3332 if (bundle != null) {
3333 if (bundle.parent == null) {
3334 bundle.setParent (parent);
3335 }bundle.locale = targetLocale;
3336 bundle = java.util.ResourceBundle.putBundleInCache (cacheKey, bundle, control);
3338 }java.util.ResourceBundle.putBundleInCache (cacheKey, java.util.ResourceBundle.NONEXISTENT_BUNDLE, control);
3342 if (Clazz_instanceOf (constKey.getCause (), InterruptedException)) {
3343 Thread.currentThread ().interrupt ();
3346 }, "java.util.ResourceBundle.CacheKey,java.util.List,java.util.List,~N,java.util.ResourceBundle.Control,java.util.ResourceBundle");
3347 c$.loadBundle = Clazz_defineMethod (c$, "loadBundle",
3348 function (cacheKey, formats, control, reload) {
3349 var targetLocale = cacheKey.getLocale ();
3351 var size = formats.size ();
3352 for (var i = 0; i < size; i++) {
3353 var format = formats.get (i);
3355 bundle = control.newBundle (cacheKey.getName (), targetLocale, format, null, reload);
3357 if (Clazz_exceptionOf (e$$, LinkageError)) {
3360 cacheKey.setCause (error);
3362 } else if (Clazz_exceptionOf (e$$, Exception)) {
3365 cacheKey.setCause (cause);
3371 if (bundle != null) {
3372 cacheKey.setFormat (format);
3373 bundle.locale = targetLocale;
3374 bundle.expired = false;
3378 }, "java.util.ResourceBundle.CacheKey,java.util.List,java.util.ResourceBundle.Control,~B");
3379 c$.isValidBundle = Clazz_defineMethod (c$, "isValidBundle",
3381 return bundle != null && bundle !== java.util.ResourceBundle.NONEXISTENT_BUNDLE;
3382 }, "java.util.ResourceBundle");
3383 c$.throwMissingResourceException = Clazz_defineMethod (c$, "throwMissingResourceException",
3384 function (baseName, locale, cause) {
3385 if (Clazz_instanceOf (cause, java.util.MissingResourceException)) {
3387 }throw new java.util.MissingResourceException ("Can't find bundle for base name " + baseName + ", locale " + locale, baseName + "_" + locale, "", cause);
3388 }, "~S,java.util.Locale,Throwable");
3389 c$.findBundleInCache = Clazz_defineMethod (c$, "findBundleInCache",
3390 function (cacheKey, control) {
3391 var bundleRef = java.util.ResourceBundle.cacheList.get (cacheKey);
3392 if (bundleRef == null) {
3394 }var bundle = bundleRef;
3396 }, "java.util.ResourceBundle.CacheKey,java.util.ResourceBundle.Control");
3397 c$.putBundleInCache = Clazz_defineMethod (c$, "putBundleInCache",
3398 function (cacheKey, bundle, control) {
3399 var key = cacheKey.clone ();
3400 java.util.ResourceBundle.cacheList.put (key, bundle);
3402 }, "java.util.ResourceBundle.CacheKey,java.util.ResourceBundle,java.util.ResourceBundle.Control");
3403 c$.clearCache = Clazz_defineMethod (c$, "clearCache",
3405 java.util.ResourceBundle.cacheList.clear ();
3407 Clazz_defineMethod (c$, "containsKey",
3410 throw new NullPointerException ();
3411 }for (var rb = this; rb != null; rb = rb.parent) {
3412 if (rb.handleKeySet ().contains (key)) {
3417 Clazz_defineMethod (c$, "keySet",
3419 var keys = new java.util.HashSet ();
3420 for (var rb = this; rb != null; rb = rb.parent) {
3421 keys.addAll (rb.handleKeySet ());
3425 Clazz_defineMethod (c$, "handleKeySet",
3427 if (this.$keySet == null) {
3429 if (this.$keySet == null) {
3430 var keys = new java.util.HashSet ();
3431 var enumKeys = this.getKeys ();
3432 while (enumKeys.hasMoreElements ()) {
3433 var key = enumKeys.nextElement ();
3434 if (this.handleGetObject (key) != null) {
3437 this.$keySet = keys;
3438 }}}return this.$keySet;
3440 c$.$ResourceBundle$1$ = function () {
3441 Clazz_pu$h(self.c$);
3442 c$ = Clazz_declareAnonymous (java.util, "ResourceBundle$1", java.util.ResourceBundle);
3443 Clazz_defineMethod (c$, "getKeys",
3447 Clazz_defineMethod (c$, "handleGetObject",
3451 Clazz_overrideMethod (c$, "toString",
3453 return "NONEXISTENT_BUNDLE";
3457 Clazz_pu$h(self.c$);
3458 c$ = Clazz_decorateAsClass (function () {
3463 this.hashCodeCache = 0;
3464 Clazz_instantialize (this, arguments);
3465 }, java.util.ResourceBundle, "CacheKey", null, Cloneable);
3466 Clazz_makeConstructor (c$,
3467 function (a, b, c) {
3470 if (this.name != null) this.calculateHashCode ();
3471 }, "~S,java.util.Locale,~O");
3472 Clazz_defineMethod (c$, "getName",
3476 Clazz_defineMethod (c$, "getLocale",
3480 Clazz_defineMethod (c$, "setLocale",
3482 if (!this.locale.equals (a)) {
3484 this.calculateHashCode ();
3486 }, "java.util.Locale");
3487 Clazz_overrideMethod (c$, "equals",
3493 if (this.hashCodeCache != b.hashCodeCache) {
3495 }if (!this.name.equals (b.name)) {
3497 }if (!this.locale.equals (b.locale)) {
3501 if (Clazz_exceptionOf (e$$, NullPointerException)) {
3505 } else if (Clazz_exceptionOf (e$$, ClassCastException)) {
3515 Clazz_overrideMethod (c$, "hashCode",
3517 return this.hashCodeCache;
3519 Clazz_defineMethod (c$, "calculateHashCode",
3521 this.hashCodeCache = this.name.hashCode () << 3;
3522 this.hashCodeCache ^= this.locale.hashCode ();
3524 Clazz_defineMethod (c$, "clone",
3527 var a = Clazz_superCall (this, java.util.ResourceBundle.CacheKey, "clone", []);
3531 if (Clazz_exceptionOf (e, CloneNotSupportedException)) {
3532 throw new InternalError ();
3538 Clazz_defineMethod (c$, "setFormat",
3542 Clazz_defineMethod (c$, "setCause",
3544 if (this.cause == null) {
3547 if (Clazz_instanceOf (this.cause, ClassNotFoundException)) {
3550 Clazz_defineMethod (c$, "getCause",
3554 Clazz_overrideMethod (c$, "toString",
3556 var a = this.locale.toString ();
3557 if (a.length == 0) {
3558 if (this.locale.getVariant ().length != 0) {
3559 a = "__" + this.locale.getVariant ();
3562 }}return "CacheKey[" + this.name + ", lc=" + a + "(format=" + this.format + ")]";
3565 Clazz_pu$h(self.c$);
3566 c$ = Clazz_declareType (java.util.ResourceBundle, "Control");
3567 Clazz_makeConstructor (c$,
3570 c$.getControl = Clazz_defineMethod (c$, "getControl",
3572 if (a.equals (java.util.ResourceBundle.Control.FORMAT_PROPERTIES)) {
3573 return java.util.ResourceBundle.SingleFormatControl.PROPERTIES_ONLY;
3574 }if (a.equals (java.util.ResourceBundle.Control.FORMAT_CLASS)) {
3575 return java.util.ResourceBundle.SingleFormatControl.CLASS_ONLY;
3576 }if (a.equals (java.util.ResourceBundle.Control.FORMAT_DEFAULT)) {
3577 return java.util.ResourceBundle.Control.INSTANCE;
3578 }throw new IllegalArgumentException ();
3579 }, "java.util.List");
3580 c$.getNoFallbackControl = Clazz_defineMethod (c$, "getNoFallbackControl",
3582 if (a.equals (java.util.ResourceBundle.Control.FORMAT_DEFAULT)) {
3583 return java.util.ResourceBundle.NoFallbackControl.NO_FALLBACK;
3584 }if (a.equals (java.util.ResourceBundle.Control.FORMAT_PROPERTIES)) {
3585 return java.util.ResourceBundle.NoFallbackControl.PROPERTIES_ONLY_NO_FALLBACK;
3586 }if (a.equals (java.util.ResourceBundle.Control.FORMAT_CLASS)) {
3587 return java.util.ResourceBundle.NoFallbackControl.CLASS_ONLY_NO_FALLBACK;
3588 }throw new IllegalArgumentException ();
3589 }, "java.util.List");
3590 Clazz_defineMethod (c$, "getFormats",
3593 throw new NullPointerException ();
3594 }return java.util.ResourceBundle.Control.FORMAT_DEFAULT;
3596 Clazz_defineMethod (c$, "getCandidateLocales",
3599 throw new NullPointerException ();
3600 }var c = b.getLanguage ();
3601 var d = b.getCountry ();
3602 var e = b.getVariant ();
3603 var f = new java.util.ArrayList (4);
3606 }if (d.length > 0) {
3607 f.add ((f.size () == 0) ? b : java.util.Locale.getInstance (c, d, ""));
3608 }if (c.length > 0) {
3609 f.add ((f.size () == 0) ? b : java.util.Locale.getInstance (c, "", ""));
3610 }f.add (java.util.Locale.ROOT);
3612 }, "~S,java.util.Locale");
3613 Clazz_defineMethod (c$, "getFallbackLocale",
3616 throw new NullPointerException ();
3617 }var c = java.util.Locale.getDefault ();
3618 return b.equals (c) ? null : c;
3619 }, "~S,java.util.Locale");
3620 Clazz_defineMethod (c$, "newBundle",
3621 function (a, b, c, d, e) {
3622 var f = this.toBundleName (a, b);
3624 if (c.equals ("java.class")) {
3625 g = swingjs.api.Interface.getInstance (f, false);
3626 } else if (c.equals ("java.properties")) {
3627 var h = this.toResourceName0 (f, "properties");
3630 }var i = swingjs.JSToolkit.getJavaResource (h, false);
3632 j = (i == null ? null : new java.io.BufferedInputStream ( new java.io.ByteArrayInputStream (i.getBytes ())));
3635 g = this.newPropertyBundle (j);
3640 throw new IllegalArgumentException ("unknown format: " + c);
3642 }, "~S,java.util.Locale,~S,~O,~B");
3643 Clazz_defineMethod (c$, "newPropertyBundle",
3645 return (swingjs.api.Interface.getInstance ("java.util.PropertyResourceBundle", false)).setStream (a);
3646 }, "java.io.InputStream");
3647 Clazz_defineMethod (c$, "getTimeToLive",
3649 if (a == null || b == null) {
3650 throw new NullPointerException ();
3652 }, "~S,java.util.Locale");
3653 Clazz_defineMethod (c$, "toBundleName",
3655 if (b === java.util.Locale.ROOT) {
3657 }var c = b.getLanguage ();
3658 var d = b.getCountry ();
3659 var e = b.getVariant ();
3660 if (c === "" && d === "" && e === "") {
3662 }var f = new StringBuilder (a);
3665 f.append (c).append ('_').append (d).append ('_').append (e);
3666 } else if (d !== "") {
3667 f.append (c).append ('_').append (d);
3670 }return f.toString ();
3671 }, "~S,java.util.Locale");
3672 Clazz_defineMethod (c$, "toResourceName",
3674 var c = new StringBuilder (a.length + 1 + b.length);
3675 c.append (a.$replace ('.', '/')).append ('.').append (b);
3676 return c.toString ();
3678 Clazz_defineMethod (c$, "toResourceName0",
3680 if (a.contains ("://")) {
3683 return this.toResourceName (a, b);
3685 c$.FORMAT_DEFAULT = c$.prototype.FORMAT_DEFAULT = java.util.Collections.unmodifiableList (java.util.Arrays.asList (["java.class", "java.properties"]));
3686 c$.FORMAT_CLASS = c$.prototype.FORMAT_CLASS = java.util.Collections.unmodifiableList (java.util.Arrays.asList (["java.class"]));
3687 c$.FORMAT_PROPERTIES = c$.prototype.FORMAT_PROPERTIES = java.util.Collections.unmodifiableList (java.util.Arrays.asList (["java.properties"]));
3688 Clazz_defineStatics (c$,
3689 "TTL_DONT_CACHE", -1,
3690 "TTL_NO_EXPIRATION_CONTROL", -2);
3691 c$.INSTANCE = c$.prototype.INSTANCE = new java.util.ResourceBundle.Control ();
3693 Clazz_pu$h(self.c$);
3694 c$ = Clazz_decorateAsClass (function () {
3695 this.formats = null;
3696 Clazz_instantialize (this, arguments);
3697 }, java.util.ResourceBundle, "SingleFormatControl", java.util.ResourceBundle.Control);
3698 Clazz_makeConstructor (c$,
3700 Clazz_superConstructor (this, java.util.ResourceBundle.SingleFormatControl, []);
3702 }, "java.util.List");
3703 Clazz_overrideMethod (c$, "getFormats",
3706 throw new NullPointerException ();
3707 }return this.formats;
3709 c$.PROPERTIES_ONLY = c$.prototype.PROPERTIES_ONLY = new java.util.ResourceBundle.SingleFormatControl (java.util.ResourceBundle.Control.FORMAT_PROPERTIES);
3710 c$.CLASS_ONLY = c$.prototype.CLASS_ONLY = new java.util.ResourceBundle.SingleFormatControl (java.util.ResourceBundle.Control.FORMAT_CLASS);
3712 Clazz_pu$h(self.c$);
3713 c$ = Clazz_declareType (java.util.ResourceBundle, "NoFallbackControl", java.util.ResourceBundle.SingleFormatControl);
3714 Clazz_overrideMethod (c$, "getFallbackLocale",
3716 if (a == null || b == null) {
3717 throw new NullPointerException ();
3719 }, "~S,java.util.Locale");
3720 c$.NO_FALLBACK = c$.prototype.NO_FALLBACK = new java.util.ResourceBundle.NoFallbackControl (java.util.ResourceBundle.Control.FORMAT_DEFAULT);
3721 c$.PROPERTIES_ONLY_NO_FALLBACK = c$.prototype.PROPERTIES_ONLY_NO_FALLBACK = new java.util.ResourceBundle.NoFallbackControl (java.util.ResourceBundle.Control.FORMAT_PROPERTIES);
3722 c$.CLASS_ONLY_NO_FALLBACK = c$.prototype.CLASS_ONLY_NO_FALLBACK = new java.util.ResourceBundle.NoFallbackControl (java.util.ResourceBundle.Control.FORMAT_CLASS);
3724 Clazz_defineStatics (c$,
3725 "INITIAL_CACHE_SIZE", 32);
3726 c$.NONEXISTENT_BUNDLE = c$.prototype.NONEXISTENT_BUNDLE = ((Clazz_isClassDefined ("java.util.ResourceBundle$1") ? 0 : java.util.ResourceBundle.$ResourceBundle$1$ ()), Clazz_innerTypeInstance (java.util.ResourceBundle$1, this, null));
3727 c$.cacheList = c$.prototype.cacheList = new java.util.HashMap (32);
3729 Clazz_declarePackage ("JU");
3730 Clazz_load (["javajs.api.GenericLineReader"], "JU.Rdr", ["java.io.BufferedInputStream", "$.BufferedReader", "$.ByteArrayInputStream", "$.InputStreamReader", "$.StringReader", "JU.AU", "$.Base64", "$.Encoding", "$.SB"], function () {
3731 c$ = Clazz_decorateAsClass (function () {
3733 Clazz_instantialize (this, arguments);
3734 }, JU, "Rdr", null, javajs.api.GenericLineReader);
3735 Clazz_makeConstructor (c$,
3737 this.reader = reader;
3738 }, "java.io.BufferedReader");
3739 Clazz_overrideMethod (c$, "readNextLine",
3741 return this.reader.readLine ();
3743 c$.readCifData = Clazz_defineMethod (c$, "readCifData",
3744 function (parser, br) {
3745 return parser.set (null, br).getAllCifData ();
3746 }, "javajs.api.GenericCifDataParser,java.io.BufferedReader");
3747 c$.fixUTF = Clazz_defineMethod (c$, "fixUTF",
3749 var encoding = JU.Rdr.getUTFEncoding (bytes);
3750 if (encoding !== JU.Encoding.NONE) try {
3751 var s = String.instantialize (bytes, encoding.name ().$replace ('_', '-'));
3753 case JU.Encoding.UTF8:
3754 case JU.Encoding.UTF_16BE:
3755 case JU.Encoding.UTF_16LE:
3756 s = s.substring (1);
3763 if (Clazz_exceptionOf (e, java.io.UnsupportedEncodingException)) {
3764 System.out.println (e);
3769 return String.instantialize (bytes);
3771 c$.getUTFEncoding = Clazz_defineMethod (c$, "getUTFEncoding",
3773 if (bytes.length >= 3 && bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) return JU.Encoding.UTF8;
3774 if (bytes.length >= 4 && bytes[0] == 0 && bytes[1] == 0 && bytes[2] == 0xFE && bytes[3] == 0xFF) return JU.Encoding.UTF_32BE;
3775 if (bytes.length >= 4 && bytes[0] == 0xFF && bytes[1] == 0xFE && bytes[2] == 0 && bytes[3] == 0) return JU.Encoding.UTF_32LE;
3776 if (bytes.length >= 2 && bytes[0] == 0xFF && bytes[1] == 0xFE) return JU.Encoding.UTF_16LE;
3777 if (bytes.length >= 2 && bytes[0] == 0xFE && bytes[1] == 0xFF) return JU.Encoding.UTF_16BE;
3778 return JU.Encoding.NONE;
3780 c$.getUTFEncodingForStream = Clazz_defineMethod (c$, "getUTFEncodingForStream",
3784 }var abMagic = Clazz_newByteArray (4, 0);
3789 if (Clazz_exceptionOf (e, Exception)) {
3790 return JU.Encoding.NONE;
3795 is.read (abMagic, 0, 4);
3797 return JU.Rdr.getUTFEncoding (abMagic);
3798 }, "java.io.BufferedInputStream");
3799 c$.isBase64 = Clazz_defineMethod (c$, "isBase64",
3801 return (sb.indexOf (";base64,") == 0);
3803 c$.isCompoundDocumentS = Clazz_defineMethod (c$, "isCompoundDocumentS",
3805 return JU.Rdr.isCompoundDocumentB (JU.Rdr.getMagic (is, 8));
3806 }, "java.io.InputStream");
3807 c$.isCompoundDocumentB = Clazz_defineMethod (c$, "isCompoundDocumentB",
3809 return (bytes.length >= 8 && bytes[0] == 0xD0 && bytes[1] == 0xCF && bytes[2] == 0x11 && bytes[3] == 0xE0 && bytes[4] == 0xA1 && bytes[5] == 0xB1 && bytes[6] == 0x1A && bytes[7] == 0xE1);
3811 c$.isGzipS = Clazz_defineMethod (c$, "isGzipS",
3813 return JU.Rdr.isGzipB (JU.Rdr.getMagic (is, 2));
3814 }, "java.io.InputStream");
3815 c$.isGzipB = Clazz_defineMethod (c$, "isGzipB",
3817 return (bytes != null && bytes.length >= 2 && bytes[0] == 0x1F && bytes[1] == 0x8B);
3819 c$.isPickleS = Clazz_defineMethod (c$, "isPickleS",
3821 return JU.Rdr.isPickleB (JU.Rdr.getMagic (is, 2));
3822 }, "java.io.InputStream");
3823 c$.isPickleB = Clazz_defineMethod (c$, "isPickleB",
3825 return (bytes != null && bytes.length >= 2 && bytes[0] == 0x7D && bytes[1] == 0x71);
3827 c$.isPngZipStream = Clazz_defineMethod (c$, "isPngZipStream",
3829 return JU.Rdr.isPngZipB (JU.Rdr.getMagic (is, 55));
3830 }, "java.io.InputStream");
3831 c$.isPngZipB = Clazz_defineMethod (c$, "isPngZipB",
3833 return (bytes[50] == 0 && bytes[51] == 0x50 && bytes[52] == 0x4E && bytes[53] == 0x47 && bytes[54] == 0x4A);
3835 c$.isZipS = Clazz_defineMethod (c$, "isZipS",
3837 return JU.Rdr.isZipB (JU.Rdr.getMagic (is, 4));
3838 }, "java.io.InputStream");
3839 c$.isZipB = Clazz_defineMethod (c$, "isZipB",
3841 return (bytes.length >= 4 && bytes[0] == 0x50 && bytes[1] == 0x4B && bytes[2] == 0x03 && bytes[3] == 0x04);
3843 c$.getMagic = Clazz_defineMethod (c$, "getMagic",
3845 var abMagic = Clazz_newByteArray (n, 0);
3850 is.read (abMagic, 0, n);
3852 if (Clazz_exceptionOf (e, java.io.IOException)) {
3860 if (Clazz_exceptionOf (e, java.io.IOException)) {
3866 }, "java.io.InputStream,~N");
3867 c$.getBIS = Clazz_defineMethod (c$, "getBIS",
3869 return new java.io.BufferedInputStream ( new java.io.ByteArrayInputStream (bytes));
3871 c$.getBR = Clazz_defineMethod (c$, "getBR",
3873 return new java.io.BufferedReader ( new java.io.StringReader (string));
3875 c$.getUnzippedInputStream = Clazz_defineMethod (c$, "getUnzippedInputStream",
3876 function (jzt, bis) {
3877 while (JU.Rdr.isGzipS (bis)) bis = new java.io.BufferedInputStream (JU.Rdr.newGZIPInputStream (jzt, bis));
3880 }, "javajs.api.GenericZipTools,java.io.BufferedInputStream");
3881 c$.getBytesFromSB = Clazz_defineMethod (c$, "getBytesFromSB",
3883 return (JU.Rdr.isBase64 (sb) ? JU.Base64.decodeBase64 (sb.substring (8)) : sb.toBytes (0, -1));
3885 c$.getStreamAsBytes = Clazz_defineMethod (c$, "getStreamAsBytes",
3886 function (bis, out) {
3887 var buf = Clazz_newByteArray (1024, 0);
3888 var bytes = (out == null ? Clazz_newByteArray (4096, 0) : null);
3891 while ((len = bis.read (buf, 0, 1024)) > 0) {
3894 if (totalLen >= bytes.length) bytes = JU.AU.ensureLengthByte (bytes, totalLen * 2);
3895 System.arraycopy (buf, 0, bytes, totalLen - len, len);
3897 out.write (buf, 0, len);
3901 return JU.AU.arrayCopyByte (bytes, totalLen);
3902 }return totalLen + " bytes";
3903 }, "java.io.BufferedInputStream,JU.OC");
3904 c$.getBufferedReader = Clazz_defineMethod (c$, "getBufferedReader",
3905 function (bis, charSet) {
3906 if (JU.Rdr.getUTFEncodingForStream (bis) === JU.Encoding.NONE) return new java.io.BufferedReader ( new java.io.InputStreamReader (bis, (charSet == null ? "UTF-8" : charSet)));
3907 var bytes = JU.Rdr.getLimitedStreamBytes (bis, -1);
3909 return JU.Rdr.getBR (charSet == null ? JU.Rdr.fixUTF (bytes) : String.instantialize (bytes, charSet));
3910 }, "java.io.BufferedInputStream,~S");
3911 c$.getLimitedStreamBytes = Clazz_defineMethod (c$, "getLimitedStreamBytes",
3913 var buflen = (n > 0 && n < 1024 ? n : 1024);
3914 var buf = Clazz_newByteArray (buflen, 0);
3915 var bytes = Clazz_newByteArray (n < 0 ? 4096 : n, 0);
3918 if (n < 0) n = 2147483647;
3919 while (totalLen < n && (len = is.read (buf, 0, buflen)) > 0) {
3921 if (totalLen > bytes.length) bytes = JU.AU.ensureLengthByte (bytes, totalLen * 2);
3922 System.arraycopy (buf, 0, bytes, totalLen - len, len);
3923 if (n != 2147483647 && totalLen + buflen > bytes.length) buflen = bytes.length - totalLen;
3925 if (totalLen == bytes.length) return bytes;
3926 buf = Clazz_newByteArray (totalLen, 0);
3927 System.arraycopy (bytes, 0, buf, 0, totalLen);
3929 }, "java.io.InputStream,~N");
3930 c$.StreamToUTF8String = Clazz_defineMethod (c$, "StreamToUTF8String",
3932 var data = new Array (1);
3934 JU.Rdr.readAllAsString (JU.Rdr.getBufferedReader (bis, "UTF-8"), -1, true, data, 0);
3936 if (Clazz_exceptionOf (e, java.io.IOException)) {