New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static init #135

Closed
SergeyLabutin opened this Issue May 25, 2017 · 18 comments

Comments

Projects
None yet
2 participants
@SergeyLabutin
Member

SergeyLabutin commented May 25, 2017

After revert this https://github.com/jtransc/jtransc/blob/master/jtransc-core/src/com/jtransc/ast/dependency/genStaticInitOrder.kt#L96

get error again

Called from hxcpp::__hxcpp_main
...
Called from java_.io.PrintWriter_::java_io_PrintWriter_init__Ljava_io_OutputStream__V java_/io/PrintWriter_.hx line 16
Called from java_.io.OutputStreamWriter_::java_io_OutputStreamWriter_init__Ljava_io_OutputStream__V java_/io/OutputStreamWriter_.hx line 12
Called from java_.nio.charset.Charset_::defaultCharset__Ljava_nio_charset_Charset_ java_/nio/charset/Charset_.hx line 74
Called from com.jtransc.charset.JTranscCharset_::defaultCharset__Lcom_jtransc_charset_JTranscCharset_ com/jtransc/charset/JTranscCharset_.hx line 164
Called from com.jtransc.charset.JTranscCharset_::forName_Ljava_lang_String__Lcom_jtransc_charset_JTranscCharset_ com/jtransc/charset/JTranscCharset_.hx line 174
Called from com.jtransc.charset.JTranscCharset_::ensureRegister__V com/jtransc/charset/JTranscCharset_.hx line 92
Called from java_.util.ServiceLoader_::load_Ljava_lang_Class__Ljava_util_ServiceLoader_ java_/util/ServiceLoader_.hx line 63
Called from java_.util.ServiceLoader_::load_Ljava_lang_Class_Ljava_lang_ClassLoader__Ljava_util_ServiceLoader_ java_/util/ServiceLoader_.hx line 77
Called from java_.util.ServiceLoader_::java_util_ServiceLoader_init__Ljava_lang_Class__V java_/util/ServiceLoader_.hx line 17
Called from java_.util.ServiceLoader_::getInstances_Ljava_lang_String___Ljava_lang_Object_ java_/util/ServiceLoader_.hx line 30
Called from com.jtransc.charset.charsets.JTranscCharsetIBM866_::com_jtransc_charset_charsets_JTranscCharsetIBM866_init___V com/jtransc/charset/charsets/JTranscCharsetIBM866_.hx line 18
Called from com.jtransc.charset.JTranscCharsetSingleByte_::com_jtransc_charset_JTranscCharsetSingleByte_init___Ljava_lang_String_Ljava_lang_String__V com/jtransc/charset/JTranscCharsetSingleByte_.hx line 27
Error : Null Object Reference

Can i manipulate from my app, not from jtransc-core?

@soywiz

This comment has been minimized.

Show comment
Hide comment
@soywiz

soywiz May 25, 2017

Member

We have to find a proper solution. The problem is that there wasn't enough tests and it was breaking a lot of code. Even if it fixed yours it was just by chance. So probably still something wrong. I added a test that failed. So now we can add another test that fails with this and we can check if both works with a new fix.
In the worst case I can evaluate the static initialization. That should always work even when ifs/switches. But it is not usual to have static initialization that relies in if/switch to properly work. So probably there is another way to solve this without including j.ProgramReflection (that uses conditional code).

Also if your problem is just with charsets, we can do lazy static initialization for now.

I think that in this case the problem is ServiceLoader that has a switch for instantiate classes.

Maybe we can try to allow plugins to hook static initialization to proper instruct which methods/classes to add.

Member

soywiz commented May 25, 2017

We have to find a proper solution. The problem is that there wasn't enough tests and it was breaking a lot of code. Even if it fixed yours it was just by chance. So probably still something wrong. I added a test that failed. So now we can add another test that fails with this and we can check if both works with a new fix.
In the worst case I can evaluate the static initialization. That should always work even when ifs/switches. But it is not usual to have static initialization that relies in if/switch to properly work. So probably there is another way to solve this without including j.ProgramReflection (that uses conditional code).

Also if your problem is just with charsets, we can do lazy static initialization for now.

I think that in this case the problem is ServiceLoader that has a switch for instantiate classes.

Maybe we can try to allow plugins to hook static initialization to proper instruct which methods/classes to add.

@soywiz

This comment has been minimized.

Show comment
Hide comment
@soywiz

soywiz May 25, 2017

Member

Can you add a test that fails? That way I can fix it while avoiding regressions. If no, maybe I fix it now and break it again later. So it is important to add it.

Member

soywiz commented May 25, 2017

Can you add a test that fails? That way I can fix it while avoiding regressions. If no, maybe I fix it now and break it again later. So it is important to add it.

@SergeyLabutin

This comment has been minimized.

Show comment
Hide comment
@SergeyLabutin

SergeyLabutin May 25, 2017

Member

I try write test, this fail on big project. On small examples all good.

For my project need add next lines before add main class, but it broken for examples because examples do not use this classes.

obj.visitClass(program[com.jtransc.charset.JTranscCharset::class.java.fqname])
obj.visitClass(program[java.nio.charset.CoderResult::class.java.fqname])
obj.visitClass(program[java.text.SimpleDateFormat::class.java.fqname])

Best value: make for each class boolean for static init, and init in first constructor call, this emulated java process, and not need ordering before start application. Now in static call before are really other class init static. Now logs in java and in cpp very different and need many work before we can run our app, because java programmers working in our small world =)

Member

SergeyLabutin commented May 25, 2017

I try write test, this fail on big project. On small examples all good.

For my project need add next lines before add main class, but it broken for examples because examples do not use this classes.

obj.visitClass(program[com.jtransc.charset.JTranscCharset::class.java.fqname])
obj.visitClass(program[java.nio.charset.CoderResult::class.java.fqname])
obj.visitClass(program[java.text.SimpleDateFormat::class.java.fqname])

Best value: make for each class boolean for static init, and init in first constructor call, this emulated java process, and not need ordering before start application. Now in static call before are really other class init static. Now logs in java and in cpp very different and need many work before we can run our app, because java programmers working in our small world =)

@SergeyLabutin

This comment has been minimized.

Show comment
Hide comment
@SergeyLabutin

SergeyLabutin May 25, 2017

Member

We have to find a proper solution.

It's true, but make lazy ordering very hard to me =(

Member

SergeyLabutin commented May 25, 2017

We have to find a proper solution.

It's true, but make lazy ordering very hard to me =(

@SergeyLabutin

This comment has been minimized.

Show comment
Hide comment
@SergeyLabutin

SergeyLabutin May 25, 2017

Member

Not need break jtransc, i make it local, on my computer only, and wait until fix it.

Member

SergeyLabutin commented May 25, 2017

Not need break jtransc, i make it local, on my computer only, and wait until fix it.

@soywiz

This comment has been minimized.

Show comment
Hide comment
@soywiz

soywiz May 25, 2017

Member

Yeah. It took sometime for me to do a small failing test. Because it failed for me in a big project. But without it, we will have this problem always.

At any rate I'm going to try to fix it ASAP. I want to first fix master (I'm on it), and I will try to reproduce the bug and fix it.

Member

soywiz commented May 25, 2017

Yeah. It took sometime for me to do a small failing test. Because it failed for me in a big project. But without it, we will have this problem always.

At any rate I'm going to try to fix it ASAP. I want to first fix master (I'm on it), and I will try to reproduce the bug and fix it.

@soywiz

This comment has been minimized.

Show comment
Hide comment
@soywiz

soywiz May 25, 2017

Member

BTW. Can you put here JTranscCharsetIBM866_.hx and JTranscCharsetSingleByte_.hx. They shouldn't contain any sensitive information. I don't know what's null and why.

Called from com.jtransc.charset.charsets.JTranscCharsetIBM866_::com_jtransc_charset_charsets_JTranscCharsetIBM866_init___V com/jtransc/charset/charsets/JTranscCharsetIBM866_.hx line 18
Called from com.jtransc.charset.JTranscCharsetSingleByte_::com_jtransc_charset_JTranscCharsetSingleByte_init___Ljava_lang_String_Ljava_lang_String__V com/jtransc/charset/JTranscCharsetSingleByte_.hx line 27
Member

soywiz commented May 25, 2017

BTW. Can you put here JTranscCharsetIBM866_.hx and JTranscCharsetSingleByte_.hx. They shouldn't contain any sensitive information. I don't know what's null and why.

Called from com.jtransc.charset.charsets.JTranscCharsetIBM866_::com_jtransc_charset_charsets_JTranscCharsetIBM866_init___V com/jtransc/charset/charsets/JTranscCharsetIBM866_.hx line 18
Called from com.jtransc.charset.JTranscCharsetSingleByte_::com_jtransc_charset_JTranscCharsetSingleByte_init___Ljava_lang_String_Ljava_lang_String__V com/jtransc/charset/JTranscCharsetSingleByte_.hx line 27
@SergeyLabutin

This comment has been minimized.

Show comment
Hide comment
@SergeyLabutin

SergeyLabutin May 25, 2017

Member

JTranscCharsetSingleByte_.hx

package com.jtransc.charset;
class JTranscCharsetSingleByte_ extends com.jtransc.charset.JTranscCharset_ {
	 @:unreflective public function new() {
		super();
		this._CLASS_ID__HX = 4498;
	}
	public var _jt_invalidChar:Int = 63;
	public var _jt_decode:java_.lang.String_ = null;
	public var _jt_encode:java_.util.Map_ = null;
	@:unreflective  public   function com_jtransc_charset_JTranscCharsetSingleByte_init___Ljava_lang_String_Ljava_lang_String__V/*<init>*/(p0:JA_L, p1:java_.lang.String_):com.jtransc.charset.JTranscCharsetSingleByte_ {
		var G: Int = 0;
		var lI3: Int = 0;
		var fA1: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		while (true) {
			switch (G) {
				case 0:
					// 15
					N.c(this, com.jtransc.charset.JTranscCharset_).com_jtransc_charset_JTranscCharset_init___Ljava_lang_String_IFI_V(p0, 1, 1.0, 1);
					// 12
					this._jt_invalidChar = 63;
					// 16
					this._jt_decode = p1;
					// 17
					tA0 = N.c((new java_.util.HashMap_()), java_.lang.Object_);
					fA1 = tA0;
					N.c(tA0, java_.util.HashMap_).java_util_HashMap_init__I_V(p1.length__I());
					this._jt_encode = N.c(fA1, java_.util.Map_);
					// 18
					lI3 = 0;
					G = 1;
					continue;
				case 1:
					if (((lI3 >= p1.length__I()))) {
						G = 2;
						continue;
					}
					// 19
					this._jt_encode.put_Ljava_lang_Object_Ljava_lang_Object__Ljava_lang_Object_(N.c(java_.lang.Character_.valueOf_C_Ljava_lang_Character_(p1.charAt_I_C(lI3)), java_.lang.Object_), N.c(java_.lang.Byte_.valueOf_B_Ljava_lang_Byte_(NE.i2b(lI3)), java_.lang.Object_));
					// 18
					lI3 = (((lI3 + 1))|0);
					G = 1;
					continue;
				case 2:
					// 21
					return this;
				default:
			}
		}
		return this;
		return this;
	}
	@:unreflective  public  override  function decode_Ljava_nio_ByteBuffer_Ljava_nio_CharBuffer__V/*decode*/(p0:java_.nio.ByteBuffer_, p1:java_.nio.CharBuffer_):Void {
		var G: Int = 0;
		var lI3: Int = 0;
		while (true) {
			switch (G) {
				case 0:
					G = 1;
					continue;
				case 1:
					// 46
					if (!(p0.hasRemaining__Z())) {
						G = 2;
						continue;
					}
					if (!(p1.hasRemaining__Z())) {
						G = 2;
						continue;
					}
					// 47
					lI3 = (((p0.get__B() & 255))|0);
					// 48
					p1.append_C_Ljava_nio_CharBuffer_(this._jt_decode.charAt_I_C(lI3));
					// 49
					G = 1;
					continue;
				case 2:
					// 50
					return;
				default:
			}
		}
		return;
	}
	@:unreflective  public  override  function decode__BIILjava_lang_StringBuilder__V/*decode*/(p0:JA_B, p1:Int, p2:Int, p3:java_.lang.StringBuilder_):Void {
		var G: Int = 0;
		var lI5: Int = 0;
		var lI6: Int = 0;
		while (true) {
			switch (G) {
				case 0:
					// 38
					lI5 = 0;
					G = 1;
					continue;
				case 1:
					if (((lI5 >= p2))) {
						G = 2;
						continue;
					}
					// 39
					lI6 = (((p0.get((((p1 + lI5))|0)) & 255))|0);
					// 40
					p3.append_C_Ljava_lang_StringBuilder_(this._jt_decode.charAt_I_C(lI6));
					// 38
					lI5 = (((lI5 + 1))|0);
					G = 1;
					continue;
				case 2:
					// 42
					return;
				default:
			}
		}
		return;
	}
	@:unreflective  public  override  function encode__CIILjava_io_ByteArrayOutputStream__V/*encode*/(p0:JA_C, p1:Int, p2:Int, p3:java_.io.ByteArrayOutputStream_):Void {
		var G: Int = 0;
		var lA7: java_.lang.Object_ = null;
		var lI5: Int = 0;
		var lI6: Int = 0;
		while (true) {
			switch (G) {
				case 0:
					// 25
					lI5 = 0;
					G = 1;
					continue;
				case 1:
					if (((lI5 >= p2))) {
						G = 2;
						continue;
					}
					// 26
					lI6 = ((p0.get((((p1 + lI5))|0)))|0);
					// 27
					lA7 = N.c(N.CHECK_CAST(this._jt_encode.get_Ljava_lang_Object__Ljava_lang_Object_(N.c(java_.lang.Character_.valueOf_C_Ljava_lang_Character_(NE.i2c(lI6)), java_.lang.Object_)), java_.lang.Byte_), java_.lang.Object_);
					// 28
					if ((N.eq(lA7, null))) {
						G = 3;
						continue;
					}
					// 29
					p3.write_I_V(((N.c(lA7, java_.lang.Byte_).byteValue__B())|0));
					G = 4;
					continue;
				case 3:
					// 31
					p3.write_I_V(63);
					G = 4;
					continue;
				case 4:
					// 25
					lI5 = (((lI5 + 1))|0);
					G = 1;
					continue;
				case 2:
					// 34
					return;
				default:
			}
		}
		return;
	}
	 @:unreflective static public function SI() {
	}
}

Member

SergeyLabutin commented May 25, 2017

JTranscCharsetSingleByte_.hx

package com.jtransc.charset;
class JTranscCharsetSingleByte_ extends com.jtransc.charset.JTranscCharset_ {
	 @:unreflective public function new() {
		super();
		this._CLASS_ID__HX = 4498;
	}
	public var _jt_invalidChar:Int = 63;
	public var _jt_decode:java_.lang.String_ = null;
	public var _jt_encode:java_.util.Map_ = null;
	@:unreflective  public   function com_jtransc_charset_JTranscCharsetSingleByte_init___Ljava_lang_String_Ljava_lang_String__V/*<init>*/(p0:JA_L, p1:java_.lang.String_):com.jtransc.charset.JTranscCharsetSingleByte_ {
		var G: Int = 0;
		var lI3: Int = 0;
		var fA1: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		while (true) {
			switch (G) {
				case 0:
					// 15
					N.c(this, com.jtransc.charset.JTranscCharset_).com_jtransc_charset_JTranscCharset_init___Ljava_lang_String_IFI_V(p0, 1, 1.0, 1);
					// 12
					this._jt_invalidChar = 63;
					// 16
					this._jt_decode = p1;
					// 17
					tA0 = N.c((new java_.util.HashMap_()), java_.lang.Object_);
					fA1 = tA0;
					N.c(tA0, java_.util.HashMap_).java_util_HashMap_init__I_V(p1.length__I());
					this._jt_encode = N.c(fA1, java_.util.Map_);
					// 18
					lI3 = 0;
					G = 1;
					continue;
				case 1:
					if (((lI3 >= p1.length__I()))) {
						G = 2;
						continue;
					}
					// 19
					this._jt_encode.put_Ljava_lang_Object_Ljava_lang_Object__Ljava_lang_Object_(N.c(java_.lang.Character_.valueOf_C_Ljava_lang_Character_(p1.charAt_I_C(lI3)), java_.lang.Object_), N.c(java_.lang.Byte_.valueOf_B_Ljava_lang_Byte_(NE.i2b(lI3)), java_.lang.Object_));
					// 18
					lI3 = (((lI3 + 1))|0);
					G = 1;
					continue;
				case 2:
					// 21
					return this;
				default:
			}
		}
		return this;
		return this;
	}
	@:unreflective  public  override  function decode_Ljava_nio_ByteBuffer_Ljava_nio_CharBuffer__V/*decode*/(p0:java_.nio.ByteBuffer_, p1:java_.nio.CharBuffer_):Void {
		var G: Int = 0;
		var lI3: Int = 0;
		while (true) {
			switch (G) {
				case 0:
					G = 1;
					continue;
				case 1:
					// 46
					if (!(p0.hasRemaining__Z())) {
						G = 2;
						continue;
					}
					if (!(p1.hasRemaining__Z())) {
						G = 2;
						continue;
					}
					// 47
					lI3 = (((p0.get__B() & 255))|0);
					// 48
					p1.append_C_Ljava_nio_CharBuffer_(this._jt_decode.charAt_I_C(lI3));
					// 49
					G = 1;
					continue;
				case 2:
					// 50
					return;
				default:
			}
		}
		return;
	}
	@:unreflective  public  override  function decode__BIILjava_lang_StringBuilder__V/*decode*/(p0:JA_B, p1:Int, p2:Int, p3:java_.lang.StringBuilder_):Void {
		var G: Int = 0;
		var lI5: Int = 0;
		var lI6: Int = 0;
		while (true) {
			switch (G) {
				case 0:
					// 38
					lI5 = 0;
					G = 1;
					continue;
				case 1:
					if (((lI5 >= p2))) {
						G = 2;
						continue;
					}
					// 39
					lI6 = (((p0.get((((p1 + lI5))|0)) & 255))|0);
					// 40
					p3.append_C_Ljava_lang_StringBuilder_(this._jt_decode.charAt_I_C(lI6));
					// 38
					lI5 = (((lI5 + 1))|0);
					G = 1;
					continue;
				case 2:
					// 42
					return;
				default:
			}
		}
		return;
	}
	@:unreflective  public  override  function encode__CIILjava_io_ByteArrayOutputStream__V/*encode*/(p0:JA_C, p1:Int, p2:Int, p3:java_.io.ByteArrayOutputStream_):Void {
		var G: Int = 0;
		var lA7: java_.lang.Object_ = null;
		var lI5: Int = 0;
		var lI6: Int = 0;
		while (true) {
			switch (G) {
				case 0:
					// 25
					lI5 = 0;
					G = 1;
					continue;
				case 1:
					if (((lI5 >= p2))) {
						G = 2;
						continue;
					}
					// 26
					lI6 = ((p0.get((((p1 + lI5))|0)))|0);
					// 27
					lA7 = N.c(N.CHECK_CAST(this._jt_encode.get_Ljava_lang_Object__Ljava_lang_Object_(N.c(java_.lang.Character_.valueOf_C_Ljava_lang_Character_(NE.i2c(lI6)), java_.lang.Object_)), java_.lang.Byte_), java_.lang.Object_);
					// 28
					if ((N.eq(lA7, null))) {
						G = 3;
						continue;
					}
					// 29
					p3.write_I_V(((N.c(lA7, java_.lang.Byte_).byteValue__B())|0));
					G = 4;
					continue;
				case 3:
					// 31
					p3.write_I_V(63);
					G = 4;
					continue;
				case 4:
					// 25
					lI5 = (((lI5 + 1))|0);
					G = 1;
					continue;
				case 2:
					// 34
					return;
				default:
			}
		}
		return;
	}
	 @:unreflective static public function SI() {
	}
}

@SergeyLabutin

This comment has been minimized.

Show comment
Hide comment
@SergeyLabutin

SergeyLabutin May 25, 2017

Member

JTranscCharsetIBM866_.hx

package com.jtransc.charset.charsets;
class JTranscCharsetIBM866_ extends com.jtransc.charset.JTranscCharsetSingleByte_ {
	 @:unreflective public function new() {
		super();
		this._CLASS_ID__HX = 4497;
	}
	@:unreflective  public   function com_jtransc_charset_charsets_JTranscCharsetIBM866_init___V/*<init>*/():com.jtransc.charset.charsets.JTranscCharsetIBM866_ {
		var fA1: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		// 7
		tA0 = N.c(new JA_L(5, "[Ljava.lang.String;"), java_.lang.Object_);
		fA1 = tA0;
		N.c(tA0, JA_L).set(0, N.c(__str0, java_.lang.Object_));
		N.c(fA1, JA_L).set(1, N.c(__str1, java_.lang.Object_));
		N.c(fA1, JA_L).set(2, N.c(__str2, java_.lang.Object_));
		N.c(fA1, JA_L).set(3, N.c(__str3, java_.lang.Object_));
		N.c(fA1, JA_L).set(4, N.c(__str4, java_.lang.Object_));
		N.c(this, com.jtransc.charset.JTranscCharsetSingleByte_).com_jtransc_charset_JTranscCharsetSingleByte_init___Ljava_lang_String_Ljava_lang_String__V(N.c(fA1, JA_L), __str5);
		// 11
		return this;
		return this;
	}
	@:unreflective static private var __str0:java_.lang.String_;
	@:unreflective static private var __str1:java_.lang.String_;
	@:unreflective static private var __str2:java_.lang.String_;
	@:unreflective static private var __str3:java_.lang.String_;
	@:unreflective static private var __str4:java_.lang.String_;
	@:unreflective static private var __str5:java_.lang.String_;
	 @:unreflective static public function SI() {
		__str0 = N.strLit("IBM866");
		__str1 = N.strLit("866");
		__str2 = N.strLit("IBM-866");
		__str3 = N.strLit("CSIBM866");
		__str4 = N.strLit("CP866");
		__str5 = N.strLit("\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~�АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ ");
	}
}

Member

SergeyLabutin commented May 25, 2017

JTranscCharsetIBM866_.hx

package com.jtransc.charset.charsets;
class JTranscCharsetIBM866_ extends com.jtransc.charset.JTranscCharsetSingleByte_ {
	 @:unreflective public function new() {
		super();
		this._CLASS_ID__HX = 4497;
	}
	@:unreflective  public   function com_jtransc_charset_charsets_JTranscCharsetIBM866_init___V/*<init>*/():com.jtransc.charset.charsets.JTranscCharsetIBM866_ {
		var fA1: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		// 7
		tA0 = N.c(new JA_L(5, "[Ljava.lang.String;"), java_.lang.Object_);
		fA1 = tA0;
		N.c(tA0, JA_L).set(0, N.c(__str0, java_.lang.Object_));
		N.c(fA1, JA_L).set(1, N.c(__str1, java_.lang.Object_));
		N.c(fA1, JA_L).set(2, N.c(__str2, java_.lang.Object_));
		N.c(fA1, JA_L).set(3, N.c(__str3, java_.lang.Object_));
		N.c(fA1, JA_L).set(4, N.c(__str4, java_.lang.Object_));
		N.c(this, com.jtransc.charset.JTranscCharsetSingleByte_).com_jtransc_charset_JTranscCharsetSingleByte_init___Ljava_lang_String_Ljava_lang_String__V(N.c(fA1, JA_L), __str5);
		// 11
		return this;
		return this;
	}
	@:unreflective static private var __str0:java_.lang.String_;
	@:unreflective static private var __str1:java_.lang.String_;
	@:unreflective static private var __str2:java_.lang.String_;
	@:unreflective static private var __str3:java_.lang.String_;
	@:unreflective static private var __str4:java_.lang.String_;
	@:unreflective static private var __str5:java_.lang.String_;
	 @:unreflective static public function SI() {
		__str0 = N.strLit("IBM866");
		__str1 = N.strLit("866");
		__str2 = N.strLit("IBM-866");
		__str3 = N.strLit("CSIBM866");
		__str4 = N.strLit("CP866");
		__str5 = N.strLit("\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~�АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ ");
	}
}

@soywiz

This comment has been minimized.

Show comment
Hide comment
@soywiz

soywiz May 25, 2017

Member

I now see the issue. Using strings from a class in haxe requires SI to execute! Which isn't the case for other targets. I'm going to try to fix that.

Member

soywiz commented May 25, 2017

I now see the issue. Using strings from a class in haxe requires SI to execute! Which isn't the case for other targets. I'm going to try to fix that.

@soywiz soywiz closed this in e874480 May 25, 2017

@soywiz

This comment has been minimized.

Show comment
Hide comment
@soywiz

soywiz May 25, 2017

Member

Check this fix. If it doesn't work, please reopen the issue.

Member

soywiz commented May 25, 2017

Check this fix. If it doesn't work, please reopen the issue.

@SergeyLabutin

This comment has been minimized.

Show comment
Hide comment
@SergeyLabutin

SergeyLabutin May 25, 2017

Member

I can not reopen issue

Error little change:

Called from java_.io.PrintWriter_::java_io_PrintWriter_init__Ljava_io_OutputStream__V java_/io/PrintWriter_.hx line 16
Called from java_.io.OutputStreamWriter_::java_io_OutputStreamWriter_init__Ljava_io_OutputStream__V java_/io/OutputStreamWriter_.hx line 12
Called from java_.io.OutputStreamWriter_::java_io_OutputStreamWriter_init__Ljava_io_OutputStream_Ljava_nio_charset_Charset__V java_/io/OutputStreamWriter_.hx line 25
Called from java_.nio.charset.Charset_1_::newEncoder__Ljava_nio_charset_CharsetEncoder_ java_/nio/charset/Charset_1_.hx line 21
Called from java_.nio.charset.Charset_1_2_::java_nio_charset_Charset_1_2_init__Ljava_nio_charset_Charset_1_Ljava_nio_charset_Charset_FF_V java_/nio/charset/Charset_1_2_.hx line 11
Called from java_.nio.charset.CharsetEncoder_::java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_V java_/nio/charset/CharsetEncoder_.hx line 23
Called from java_.nio.charset.CharsetEncoder_::java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_B_V java_/nio/charset/CharsetEncoder_.hx line 30
Called from java_.nio.charset.CharsetEncoder_::java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_BZ_V java_/nio/charset/CharsetEncoder_.hx line 101
Called from java_.nio.charset.CharsetEncoder_::replaceWith__B_Ljava_nio_charset_CharsetEncoder_ java_/nio/charset/CharsetEncoder_.hx line 173
Called from java_.nio.charset.CharsetEncoder_::isLegalReplacement__B_Z java_/nio/charset/CharsetEncoder_.hx line 221

CharsetEncoder_ .hx

package java_.nio.charset;
// ABSTRACT
class CharsetEncoder_ extends java_.lang.Object_ {
	 @:unreflective public function new() {
		super();
		this._CLASS_ID__HX = 4516;
	}
	public var _jt_malformedInputAction:java_.nio.charset.CodingErrorAction_ = null;
	public var _jt_charset:java_.nio.charset.Charset_ = null;
	public var _jt_replacementBytes:JA_B = null;
	public var _jt_state:Int = 0;
	public var _jt_averageBytesPerChar:Float32 = 0.0;
	public var _jt_maxBytesPerChar:Float32 = 0.0;
	public var _jt_unmappableCharacterAction:java_.nio.charset.CodingErrorAction_ = null;
	public var _jt_decoder:java_.nio.charset.CharsetDecoder_ = null;
	@:unreflective  public   function java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_V/*<init>*/(p0:java_.nio.charset.Charset_, p1:Float32, p2:Float32):java_.nio.charset.CharsetEncoder_ {
		var fA4: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		// 104
		tA0 = N.c(new JA_B(1), java_.lang.Object_);
		fA4 = tA0;
		N.c(tA0, JA_B).set(0, 63);
		this.java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_B_V(p0, p1, p2, N.c(fA4, JA_B));
		// 105
		return this;
		return this;
	}
	@:unreflective  public   function java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_B_V/*<init>*/(p0:java_.nio.charset.Charset_, p1:Float32, p2:Float32, p3:JA_B):java_.nio.charset.CharsetEncoder_ {
		// 129
		this.java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_BZ_V(p0, p1, p2, p3, false);
		// 130
		return this;
		return this;
	}
	@:unreflective  public   function java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_BZ_V/*<init>*/(p0:java_.nio.charset.Charset_, p1:Float32, p2:Float32, p3:JA_B, p4:Bool):java_.nio.charset.CharsetEncoder_ {
		var G: Int = 0;
		var fA0: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		var tA1: java_.lang.Object_ = null;
		while (true) {
			switch (G) {
				case 0:
					// 132
					N.c(this, java_.lang.Object_).java_lang_Object_init___V();
					// 91
					this._jt_state = 0;
					// 93
					this._jt_malformedInputAction = java_.nio.charset.CodingErrorAction_._jt_REPORT;
					// 94
					this._jt_unmappableCharacterAction = java_.nio.charset.CodingErrorAction_._jt_REPORT;
					// 133
					if (!(((p1 > 0.0)))) {
						G = 1;
						continue;
					}
					if (!(((p2 <= 0.0)))) {
						G = 2;
						continue;
					}
					G = 1;
					continue;
				case 1:
					// 134
					tA0 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
					fA0 = tA0;
					N.c(tA0, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(__str0);
					throw fA0;
					G = 2;
					continue;
				case 2:
					// 136
					if (!(((p1 > p2)))) {
						G = 3;
						continue;
					}
					// 137
					tA1 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
					fA0 = tA1;
					N.c(tA1, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(__str1);
					throw fA0;
					G = 3;
					continue;
				case 3:
					// 139
					this._jt_charset = p0;
					// 140
					this._jt_averageBytesPerChar = p1;
					// 141
					this._jt_maxBytesPerChar = p2;
					// 142
					if (!(p4)) {
						G = 4;
						continue;
					}
					// 145
					this._jt_replacementBytes = p3;
					G = 5;
					continue;
				case 4:
					// 147
					this.replaceWith__B_Ljava_nio_charset_CharsetEncoder_(p3);
					G = 5;
					continue;
				case 5:
					// 149
					return this;
				default:
			}
		}
		return this;
		return this;
	}
	@:unreflective  public   function replaceWith__B_Ljava_nio_charset_CharsetEncoder_/*replaceWith*/(p0:JA_B):java_.nio.charset.CharsetEncoder_ {
		var G: Int = 0;
		var fA0: java_.lang.Object_ = null;
		var fA1: java_.lang.Object_ = null;
		var fA2: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		var tA1: java_.lang.Object_ = null;
		var tA2: java_.lang.Object_ = null;
		var tA3: java_.lang.Object_ = null;
		var tA4: java_.lang.Object_ = null;
		var tA5: java_.lang.Object_ = null;
		while (true) {
			switch (G) {
				case 0:
					// 631
					if ((N.ne(N.c(p0, java_.lang.Object_), null))) {
						G = 1;
						continue;
					}
					// 632
					tA0 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
					fA0 = tA0;
					N.c(tA0, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(__str2);
					throw fA0;
					G = 1;
					continue;
				case 1:
					// 634
					if (((cast(N.c(p0, java_.lang.Object_), JA_0).length != 0))) {
						G = 2;
						continue;
					}
					// 635
					tA1 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
					fA0 = tA1;
					N.c(tA1, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(__str3);
					throw fA0;
					G = 2;
					continue;
				case 2:
					// 637
					if (!((((cast(N.c(p0, java_.lang.Object_), JA_0).length) > this.maxBytesPerChar__F())))) {
						G = 3;
						continue;
					}
					// 638
					tA2 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
					fA0 = tA2;
					fA1 = tA2;
					tA3 = N.c((new java_.lang.StringBuilder_()), java_.lang.Object_);
					fA2 = tA3;
					N.c(tA3, java_.lang.StringBuilder_).java_lang_StringBuilder_init___V();
					fA2 = N.c(N.c(fA2, java_.lang.StringBuilder_).append_Ljava_lang_String__Ljava_lang_StringBuilder_(__str5).append_I_Ljava_lang_StringBuilder_(cast(N.c(p0, java_.lang.Object_), JA_0).length).append_Ljava_lang_String__Ljava_lang_StringBuilder_(__str4), java_.lang.Object_);
					// 639
					N.c(fA1, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(N.c(fA2, java_.lang.StringBuilder_).append_F_Ljava_lang_StringBuilder_(this.maxBytesPerChar__F()).toString__Ljava_lang_String_());
					throw fA0;
					G = 3;
					continue;
				case 3:
					// 641
					if (this.isLegalReplacement__B_Z(p0)) {
						G = 4;
						continue;
					}
					// 642
					tA4 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
					fA0 = tA4;
					fA1 = tA4;
					tA5 = N.c((new java_.lang.StringBuilder_()), java_.lang.Object_);
					fA2 = tA5;
					N.c(tA5, java_.lang.StringBuilder_).java_lang_StringBuilder_init___V();
					N.c(fA1, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(N.c(fA2, java_.lang.StringBuilder_).append_Ljava_lang_String__Ljava_lang_StringBuilder_(__str6).append_Ljava_lang_String__Ljava_lang_StringBuilder_(java_.util.Arrays_.toString__B_Ljava_lang_String_(p0)).toString__Ljava_lang_String_());
					throw fA0;
					G = 4;
					continue;
				case 4:
					// 645
					this._jt_replacementBytes = p0;
					// 646
					this.implReplaceWith__B_V(this._jt_replacementBytes);
					// 647
					return this;
				default:
			}
		}
		return null;
	}
	@:unreflective  public   function isLegalReplacement__B_Z/*isLegalReplacement*/(p0:JA_B):Bool {
		var lA2: java_.nio.ByteBuffer_ = null;
		var fI0: Int = 0;
		var lA4: java_.nio.charset.CoderResult_ = null;
		var lA3: java_.nio.CharBuffer_ = null;
		// 534
		if ((N.eq(this._jt_decoder, null))) {
			// 535
			this._jt_decoder = this._jt_charset.newDecoder__Ljava_nio_charset_CharsetDecoder_();
			// 536
			this._jt_decoder.onMalformedInput_Ljava_nio_charset_CodingErrorAction__Ljava_nio_charset_CharsetDecoder_(java_.nio.charset.CodingErrorAction_._jt_REPORT);
			// 537
			this._jt_decoder.onUnmappableCharacter_Ljava_nio_charset_CodingErrorAction__Ljava_nio_charset_CharsetDecoder_(java_.nio.charset.CodingErrorAction_._jt_REPORT);
		}
		// 539
		lA2 = java_.nio.ByteBuffer_.wrap__B_Ljava_nio_ByteBuffer_(p0);
		// 540
		lA3 = java_.nio.CharBuffer_.allocate_I_Ljava_nio_CharBuffer_(((Std.int((((cast(N.c(p0, java_.lang.Object_), JA_0).length) * this._jt_decoder.maxCharsPerByte__F()))))|0));
		// 541
		lA4 = this._jt_decoder.decode_Ljava_nio_ByteBuffer_Ljava_nio_CharBuffer_Z_Ljava_nio_charset_CoderResult_(lA2, lA3, true);
		// 542
		fI0 = ((!(lA4.isError__Z())) ? (1) : (0));
		return ((fI0)!=0);
	}
	@:unreflective  public   function implReplaceWith__B_V/*implReplaceWith*/(p0:JA_B):Void {
		// 518
		return;
	}
	@:unreflective  public   function maxBytesPerChar__F/*maxBytesPerChar*/():Float32 {
		// 558
		return this._jt_maxBytesPerChar;
	}
	@:unreflective  public   function onUnmappableCharacter_Ljava_nio_charset_CodingErrorAction__Ljava_nio_charset_CharsetEncoder_/*onUnmappableCharacter*/(p0:java_.nio.charset.CodingErrorAction_):java_.nio.charset.CharsetEncoder_ {
		var fA0: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		// 597
		if ((N.eq(N.c(p0, java_.lang.Object_), null))) {
			// 598
			tA0 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
			fA0 = tA0;
			N.c(tA0, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(__str7);
			throw fA0;
		}
		else {
			// 600
			this._jt_unmappableCharacterAction = p0;
			// 601
			this.implOnUnmappableCharacter_Ljava_nio_charset_CodingErrorAction__V(p0);
			// 602
			return this;
		}
	}
	@:unreflective  public   function implOnUnmappableCharacter_Ljava_nio_charset_CodingErrorAction__V/*implOnUnmappableCharacter*/(p0:java_.nio.charset.CodingErrorAction_):Void {
		// 507
		return;
	}
	@:unreflective  public   function onMalformedInput_Ljava_nio_charset_CodingErrorAction__Ljava_nio_charset_CharsetEncoder_/*onMalformedInput*/(p0:java_.nio.charset.CodingErrorAction_):java_.nio.charset.CharsetEncoder_ {
		var fA0: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		// 575
		if ((N.eq(N.c(p0, java_.lang.Object_), null))) {
			// 576
			tA0 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
			fA0 = tA0;
			N.c(tA0, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(__str7);
			throw fA0;
		}
		else {
			// 578
			this._jt_malformedInputAction = p0;
			// 579
			this.implOnMalformedInput_Ljava_nio_charset_CodingErrorAction__V(p0);
			// 580
			return this;
		}
	}
	@:unreflective  public   function implOnMalformedInput_Ljava_nio_charset_CodingErrorAction__V/*implOnMalformedInput*/(p0:java_.nio.charset.CodingErrorAction_):Void {
		// 495
		return;
	}
	@:unreflective  public   function encode_Ljava_nio_CharBuffer_Ljava_nio_ByteBuffer_Z_Ljava_nio_charset_CoderResult_/*encode*/(p0:java_.nio.CharBuffer_, p1:java_.nio.ByteBuffer_, p2:Bool):java_.nio.charset.CoderResult_ {
		var G: Int = 0;
		var fI1: Int = 0;
		var lA4: java_.lang.Object_ = null;
		var lA5: java_.lang.Object_ = null;
		var fA0: java_.lang.Object_ = null;
		var tA2: java_.lang.Object_ = null;
		var tA3: java_.lang.Object_ = null;
		var J__exception__:Dynamic = null;
		while (true) {
			try {
				while (true) {
					switch (G) {
						case 0:
							// 359
							if (((this._jt_state == 0))) {
								G = 1;
								continue;
							}
							if (((this._jt_state == 1))) {
								G = 1;
								continue;
							}
							if (!(p2)) {
								G = 2;
								continue;
							}
							if (((this._jt_state == 2))) {
								G = 1;
								continue;
							}
							G = 2;
							continue;
						case 2:
							// 360
							throw this.illegalStateException__Ljava_lang_IllegalStateException_();
							G = 1;
							continue;
						case 1:
							// 363
							fA0 = N.c(this, java_.lang.Object_);
							if (!(p2)) {
								G = 3;
								continue;
							}
							fI1 = 2;
							G = 4;
							continue;
						case 3:
							fI1 = 1;
							G = 4;
							continue;
						case 4:
							N.c(fA0, java_.nio.charset.CharsetEncoder_)._jt_state = fI1;
							G = 5;
							continue;
						case 5:
							// 368
							lA4 = N.c(this.encodeLoop_Ljava_nio_CharBuffer_Ljava_nio_ByteBuffer__Ljava_nio_charset_CoderResult_(p0, p1), java_.lang.Object_);
							G = 6;
							continue;
						case 6:
							// 373
							G = 7;
							continue;
						case 8:
							fA0 = N.c(J__exception__, java_.lang.Object_);
							// 369
							lA5 = fA0;
							// 370
							tA2 = N.c((new java_.nio.charset.CoderMalfunctionError_()), java_.lang.Object_);
							fA0 = tA2;
							N.c(tA2, java_.nio.charset.CoderMalfunctionError_).java_nio_charset_CoderMalfunctionError_init__Ljava_lang_Exception__V(N.c(lA5, java_.lang.Exception_));
							throw fA0;
							G = 9;
							continue;
						case 9:
							fA0 = N.c(J__exception__, java_.lang.Object_);
							// 371
							lA5 = fA0;
							// 372
							tA3 = N.c((new java_.nio.charset.CoderMalfunctionError_()), java_.lang.Object_);
							fA0 = tA3;
							N.c(tA3, java_.nio.charset.CoderMalfunctionError_).java_nio_charset_CoderMalfunctionError_init__Ljava_lang_Exception__V(N.c(lA5, java_.lang.Exception_));
							throw fA0;
							G = 7;
							continue;
						case 7:
							// 375
							if ((N.ne(lA4, java_.nio.charset.CoderResult_._jt__UNDERFLOW))) {
								G = 10;
								continue;
							}
							// 376
							if (!(p2)) {
								G = 11;
								continue;
							}
							if (!(p0.hasRemaining__Z())) {
								G = 11;
								continue;
							}
							// 377
							lA4 = N.c(java_.nio.charset.CoderResult_.malformedForLength_I_Ljava_nio_charset_CoderResult_(p0.remaining__I()), java_.lang.Object_);
							G = 12;
							continue;
						case 11:
							// 379
							return N.c(lA4, java_.nio.charset.CoderResult_);
						case 10:
							// 381
							if ((N.ne(lA4, java_.nio.charset.CoderResult_._jt__OVERFLOW))) {
								G = 12;
								continue;
							}
							// 382
							return N.c(lA4, java_.nio.charset.CoderResult_);
						case 12:
							// 386
							fA0 = lA4;
							// 387
							if (!(N.c(fA0, java_.nio.charset.CoderResult_).isUnmappable__Z())) {
								G = 13;
								continue;
							}
							fA0 = N.c(this._jt_unmappableCharacterAction, java_.lang.Object_);
							G = 14;
							continue;
						case 13:
							fA0 = N.c(this._jt_malformedInputAction, java_.lang.Object_);
							G = 14;
							continue;
						case 14:
							lA5 = fA0;
							// 388
							if ((N.ne(lA5, java_.nio.charset.CodingErrorAction_._jt_REPORT))) {
								G = 15;
								continue;
							}
							// 389
							return N.c(lA4, java_.nio.charset.CoderResult_);
						case 15:
							// 390
							if ((N.ne(lA5, java_.nio.charset.CodingErrorAction_._jt_REPLACE))) {
								G = 16;
								continue;
							}
							// 391
							if (((p1.remaining__I() >= (this._jt_replacementBytes).length))) {
								G = 17;
								continue;
							}
							// 392
							return java_.nio.charset.CoderResult_._jt__OVERFLOW;
						case 17:
							// 394
							p1.put__B_Ljava_nio_ByteBuffer_(this._jt_replacementBytes);
							G = 16;
							continue;
						case 16:
							// 396
							p0.position_I_Ljava_nio_Buffer_((((p0.position__I() + N.c(lA4, java_.nio.charset.CoderResult_).length__I()))|0));
							// 397
							G = 5;
							continue;
						default:
					}
				}
				return null;
			}
			catch (J__i__exception__: Dynamic) {
				J__exception__ = J__i__exception__;
				if (((((((G >= 5)) && ((G < 6)))) && Std.is(J__exception__, java_.nio.BufferOverflowException_)))) {
					G = 8;
					continue;
				}
				if (((((((G >= 5)) && ((G < 6)))) && Std.is(J__exception__, java_.nio.BufferUnderflowException_)))) {
					G = 9;
					continue;
				}
				throw J__i__exception__;
			}
		}
		return null;
	}
	@:unreflective  public   function illegalStateException__Ljava_lang_IllegalStateException_/*illegalStateException*/():java_.lang.IllegalStateException_ {
		var fA0: java_.lang.Object_ = null;
		var fA1: java_.lang.Object_ = null;
		var fA2: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		var tA1: java_.lang.Object_ = null;
		// 670
		tA0 = N.c((new java_.lang.IllegalStateException_()), java_.lang.Object_);
		fA0 = tA0;
		fA1 = tA0;
		tA1 = N.c((new java_.lang.StringBuilder_()), java_.lang.Object_);
		fA2 = tA1;
		N.c(tA1, java_.lang.StringBuilder_).java_lang_StringBuilder_init___V();
		N.c(fA1, java_.lang.IllegalStateException_).java_lang_IllegalStateException_init__Ljava_lang_String__V(N.c(fA2, java_.lang.StringBuilder_).append_Ljava_lang_String__Ljava_lang_StringBuilder_(__str8).append_I_Ljava_lang_StringBuilder_(this._jt_state).toString__Ljava_lang_String_());
		throw fA0;
	}
	@:unreflective  public   function encodeLoop_Ljava_nio_CharBuffer_Ljava_nio_ByteBuffer__Ljava_nio_charset_CoderResult_/*encodeLoop*/(p0:java_.nio.CharBuffer_, p1:java_.nio.ByteBuffer_):java_.nio.charset.CoderResult_ {
		throw 'java.nio.charset.CharsetEncoder.encodeLoop :: (Ljava/nio/CharBuffer;Ljava/nio/ByteBuffer;)Ljava/nio/charset/CoderResult;: No method body';
	}
	@:unreflective  public   function flush_Ljava_nio_ByteBuffer__Ljava_nio_charset_CoderResult_/*flush*/(p0:java_.nio.ByteBuffer_):java_.nio.charset.CoderResult_ {
		var G: Int = 0;
		var lA2: java_.lang.Object_ = null;
		while (true) {
			switch (G) {
				case 0:
					// 461
					if (((this._jt_state == 3))) {
						G = 1;
						continue;
					}
					if (((this._jt_state == 2))) {
						G = 1;
						continue;
					}
					// 462
					throw this.illegalStateException__Ljava_lang_IllegalStateException_();
					G = 1;
					continue;
				case 1:
					// 464
					lA2 = N.c(this.implFlush_Ljava_nio_ByteBuffer__Ljava_nio_charset_CoderResult_(p0), java_.lang.Object_);
					// 465
					if ((N.ne(lA2, java_.nio.charset.CoderResult_._jt__UNDERFLOW))) {
						G = 2;
						continue;
					}
					// 466
					this._jt_state = 3;
					G = 2;
					continue;
				case 2:
					// 468
					return N.c(lA2, java_.nio.charset.CoderResult_);
				default:
			}
		}
		return null;
	}
	@:unreflective  public   function implFlush_Ljava_nio_ByteBuffer__Ljava_nio_charset_CoderResult_/*implFlush*/(p0:java_.nio.ByteBuffer_):java_.nio.charset.CoderResult_ {
		// 482
		return java_.nio.charset.CoderResult_._jt__UNDERFLOW;
	}
	@:unreflective static private var __str0:java_.lang.String_;
	@:unreflective static private var __str1:java_.lang.String_;
	@:unreflective static private var __str2:java_.lang.String_;
	@:unreflective static private var __str3:java_.lang.String_;
	@:unreflective static private var __str4:java_.lang.String_;
	@:unreflective static private var __str5:java_.lang.String_;
	@:unreflective static private var __str6:java_.lang.String_;
	@:unreflective static private var __str7:java_.lang.String_;
	@:unreflective static private var __str8:java_.lang.String_;
	 @:unreflective static public function STRS() {
		__str0 = N.strLit("averageBytesPerChar and maxBytesPerChar must both be positive");
		__str1 = N.strLit("averageBytesPerChar is greater than maxBytesPerChar");
		__str2 = N.strLit("replacement == null");
		__str3 = N.strLit("replacement.length == 0");
		__str4 = N.strLit(" > ");
		__str5 = N.strLit("replacement.length > maxBytesPerChar: ");
		__str6 = N.strLit("Bad replacement: ");
		__str7 = N.strLit("newAction == null");
		__str8 = N.strLit("State: ");
	}
	 @:unreflective static public function SI() {
	}
}

Member

SergeyLabutin commented May 25, 2017

I can not reopen issue

Error little change:

Called from java_.io.PrintWriter_::java_io_PrintWriter_init__Ljava_io_OutputStream__V java_/io/PrintWriter_.hx line 16
Called from java_.io.OutputStreamWriter_::java_io_OutputStreamWriter_init__Ljava_io_OutputStream__V java_/io/OutputStreamWriter_.hx line 12
Called from java_.io.OutputStreamWriter_::java_io_OutputStreamWriter_init__Ljava_io_OutputStream_Ljava_nio_charset_Charset__V java_/io/OutputStreamWriter_.hx line 25
Called from java_.nio.charset.Charset_1_::newEncoder__Ljava_nio_charset_CharsetEncoder_ java_/nio/charset/Charset_1_.hx line 21
Called from java_.nio.charset.Charset_1_2_::java_nio_charset_Charset_1_2_init__Ljava_nio_charset_Charset_1_Ljava_nio_charset_Charset_FF_V java_/nio/charset/Charset_1_2_.hx line 11
Called from java_.nio.charset.CharsetEncoder_::java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_V java_/nio/charset/CharsetEncoder_.hx line 23
Called from java_.nio.charset.CharsetEncoder_::java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_B_V java_/nio/charset/CharsetEncoder_.hx line 30
Called from java_.nio.charset.CharsetEncoder_::java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_BZ_V java_/nio/charset/CharsetEncoder_.hx line 101
Called from java_.nio.charset.CharsetEncoder_::replaceWith__B_Ljava_nio_charset_CharsetEncoder_ java_/nio/charset/CharsetEncoder_.hx line 173
Called from java_.nio.charset.CharsetEncoder_::isLegalReplacement__B_Z java_/nio/charset/CharsetEncoder_.hx line 221

CharsetEncoder_ .hx

package java_.nio.charset;
// ABSTRACT
class CharsetEncoder_ extends java_.lang.Object_ {
	 @:unreflective public function new() {
		super();
		this._CLASS_ID__HX = 4516;
	}
	public var _jt_malformedInputAction:java_.nio.charset.CodingErrorAction_ = null;
	public var _jt_charset:java_.nio.charset.Charset_ = null;
	public var _jt_replacementBytes:JA_B = null;
	public var _jt_state:Int = 0;
	public var _jt_averageBytesPerChar:Float32 = 0.0;
	public var _jt_maxBytesPerChar:Float32 = 0.0;
	public var _jt_unmappableCharacterAction:java_.nio.charset.CodingErrorAction_ = null;
	public var _jt_decoder:java_.nio.charset.CharsetDecoder_ = null;
	@:unreflective  public   function java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_V/*<init>*/(p0:java_.nio.charset.Charset_, p1:Float32, p2:Float32):java_.nio.charset.CharsetEncoder_ {
		var fA4: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		// 104
		tA0 = N.c(new JA_B(1), java_.lang.Object_);
		fA4 = tA0;
		N.c(tA0, JA_B).set(0, 63);
		this.java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_B_V(p0, p1, p2, N.c(fA4, JA_B));
		// 105
		return this;
		return this;
	}
	@:unreflective  public   function java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_B_V/*<init>*/(p0:java_.nio.charset.Charset_, p1:Float32, p2:Float32, p3:JA_B):java_.nio.charset.CharsetEncoder_ {
		// 129
		this.java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_BZ_V(p0, p1, p2, p3, false);
		// 130
		return this;
		return this;
	}
	@:unreflective  public   function java_nio_charset_CharsetEncoder_init__Ljava_nio_charset_Charset_FF_BZ_V/*<init>*/(p0:java_.nio.charset.Charset_, p1:Float32, p2:Float32, p3:JA_B, p4:Bool):java_.nio.charset.CharsetEncoder_ {
		var G: Int = 0;
		var fA0: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		var tA1: java_.lang.Object_ = null;
		while (true) {
			switch (G) {
				case 0:
					// 132
					N.c(this, java_.lang.Object_).java_lang_Object_init___V();
					// 91
					this._jt_state = 0;
					// 93
					this._jt_malformedInputAction = java_.nio.charset.CodingErrorAction_._jt_REPORT;
					// 94
					this._jt_unmappableCharacterAction = java_.nio.charset.CodingErrorAction_._jt_REPORT;
					// 133
					if (!(((p1 > 0.0)))) {
						G = 1;
						continue;
					}
					if (!(((p2 <= 0.0)))) {
						G = 2;
						continue;
					}
					G = 1;
					continue;
				case 1:
					// 134
					tA0 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
					fA0 = tA0;
					N.c(tA0, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(__str0);
					throw fA0;
					G = 2;
					continue;
				case 2:
					// 136
					if (!(((p1 > p2)))) {
						G = 3;
						continue;
					}
					// 137
					tA1 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
					fA0 = tA1;
					N.c(tA1, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(__str1);
					throw fA0;
					G = 3;
					continue;
				case 3:
					// 139
					this._jt_charset = p0;
					// 140
					this._jt_averageBytesPerChar = p1;
					// 141
					this._jt_maxBytesPerChar = p2;
					// 142
					if (!(p4)) {
						G = 4;
						continue;
					}
					// 145
					this._jt_replacementBytes = p3;
					G = 5;
					continue;
				case 4:
					// 147
					this.replaceWith__B_Ljava_nio_charset_CharsetEncoder_(p3);
					G = 5;
					continue;
				case 5:
					// 149
					return this;
				default:
			}
		}
		return this;
		return this;
	}
	@:unreflective  public   function replaceWith__B_Ljava_nio_charset_CharsetEncoder_/*replaceWith*/(p0:JA_B):java_.nio.charset.CharsetEncoder_ {
		var G: Int = 0;
		var fA0: java_.lang.Object_ = null;
		var fA1: java_.lang.Object_ = null;
		var fA2: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		var tA1: java_.lang.Object_ = null;
		var tA2: java_.lang.Object_ = null;
		var tA3: java_.lang.Object_ = null;
		var tA4: java_.lang.Object_ = null;
		var tA5: java_.lang.Object_ = null;
		while (true) {
			switch (G) {
				case 0:
					// 631
					if ((N.ne(N.c(p0, java_.lang.Object_), null))) {
						G = 1;
						continue;
					}
					// 632
					tA0 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
					fA0 = tA0;
					N.c(tA0, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(__str2);
					throw fA0;
					G = 1;
					continue;
				case 1:
					// 634
					if (((cast(N.c(p0, java_.lang.Object_), JA_0).length != 0))) {
						G = 2;
						continue;
					}
					// 635
					tA1 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
					fA0 = tA1;
					N.c(tA1, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(__str3);
					throw fA0;
					G = 2;
					continue;
				case 2:
					// 637
					if (!((((cast(N.c(p0, java_.lang.Object_), JA_0).length) > this.maxBytesPerChar__F())))) {
						G = 3;
						continue;
					}
					// 638
					tA2 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
					fA0 = tA2;
					fA1 = tA2;
					tA3 = N.c((new java_.lang.StringBuilder_()), java_.lang.Object_);
					fA2 = tA3;
					N.c(tA3, java_.lang.StringBuilder_).java_lang_StringBuilder_init___V();
					fA2 = N.c(N.c(fA2, java_.lang.StringBuilder_).append_Ljava_lang_String__Ljava_lang_StringBuilder_(__str5).append_I_Ljava_lang_StringBuilder_(cast(N.c(p0, java_.lang.Object_), JA_0).length).append_Ljava_lang_String__Ljava_lang_StringBuilder_(__str4), java_.lang.Object_);
					// 639
					N.c(fA1, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(N.c(fA2, java_.lang.StringBuilder_).append_F_Ljava_lang_StringBuilder_(this.maxBytesPerChar__F()).toString__Ljava_lang_String_());
					throw fA0;
					G = 3;
					continue;
				case 3:
					// 641
					if (this.isLegalReplacement__B_Z(p0)) {
						G = 4;
						continue;
					}
					// 642
					tA4 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
					fA0 = tA4;
					fA1 = tA4;
					tA5 = N.c((new java_.lang.StringBuilder_()), java_.lang.Object_);
					fA2 = tA5;
					N.c(tA5, java_.lang.StringBuilder_).java_lang_StringBuilder_init___V();
					N.c(fA1, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(N.c(fA2, java_.lang.StringBuilder_).append_Ljava_lang_String__Ljava_lang_StringBuilder_(__str6).append_Ljava_lang_String__Ljava_lang_StringBuilder_(java_.util.Arrays_.toString__B_Ljava_lang_String_(p0)).toString__Ljava_lang_String_());
					throw fA0;
					G = 4;
					continue;
				case 4:
					// 645
					this._jt_replacementBytes = p0;
					// 646
					this.implReplaceWith__B_V(this._jt_replacementBytes);
					// 647
					return this;
				default:
			}
		}
		return null;
	}
	@:unreflective  public   function isLegalReplacement__B_Z/*isLegalReplacement*/(p0:JA_B):Bool {
		var lA2: java_.nio.ByteBuffer_ = null;
		var fI0: Int = 0;
		var lA4: java_.nio.charset.CoderResult_ = null;
		var lA3: java_.nio.CharBuffer_ = null;
		// 534
		if ((N.eq(this._jt_decoder, null))) {
			// 535
			this._jt_decoder = this._jt_charset.newDecoder__Ljava_nio_charset_CharsetDecoder_();
			// 536
			this._jt_decoder.onMalformedInput_Ljava_nio_charset_CodingErrorAction__Ljava_nio_charset_CharsetDecoder_(java_.nio.charset.CodingErrorAction_._jt_REPORT);
			// 537
			this._jt_decoder.onUnmappableCharacter_Ljava_nio_charset_CodingErrorAction__Ljava_nio_charset_CharsetDecoder_(java_.nio.charset.CodingErrorAction_._jt_REPORT);
		}
		// 539
		lA2 = java_.nio.ByteBuffer_.wrap__B_Ljava_nio_ByteBuffer_(p0);
		// 540
		lA3 = java_.nio.CharBuffer_.allocate_I_Ljava_nio_CharBuffer_(((Std.int((((cast(N.c(p0, java_.lang.Object_), JA_0).length) * this._jt_decoder.maxCharsPerByte__F()))))|0));
		// 541
		lA4 = this._jt_decoder.decode_Ljava_nio_ByteBuffer_Ljava_nio_CharBuffer_Z_Ljava_nio_charset_CoderResult_(lA2, lA3, true);
		// 542
		fI0 = ((!(lA4.isError__Z())) ? (1) : (0));
		return ((fI0)!=0);
	}
	@:unreflective  public   function implReplaceWith__B_V/*implReplaceWith*/(p0:JA_B):Void {
		// 518
		return;
	}
	@:unreflective  public   function maxBytesPerChar__F/*maxBytesPerChar*/():Float32 {
		// 558
		return this._jt_maxBytesPerChar;
	}
	@:unreflective  public   function onUnmappableCharacter_Ljava_nio_charset_CodingErrorAction__Ljava_nio_charset_CharsetEncoder_/*onUnmappableCharacter*/(p0:java_.nio.charset.CodingErrorAction_):java_.nio.charset.CharsetEncoder_ {
		var fA0: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		// 597
		if ((N.eq(N.c(p0, java_.lang.Object_), null))) {
			// 598
			tA0 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
			fA0 = tA0;
			N.c(tA0, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(__str7);
			throw fA0;
		}
		else {
			// 600
			this._jt_unmappableCharacterAction = p0;
			// 601
			this.implOnUnmappableCharacter_Ljava_nio_charset_CodingErrorAction__V(p0);
			// 602
			return this;
		}
	}
	@:unreflective  public   function implOnUnmappableCharacter_Ljava_nio_charset_CodingErrorAction__V/*implOnUnmappableCharacter*/(p0:java_.nio.charset.CodingErrorAction_):Void {
		// 507
		return;
	}
	@:unreflective  public   function onMalformedInput_Ljava_nio_charset_CodingErrorAction__Ljava_nio_charset_CharsetEncoder_/*onMalformedInput*/(p0:java_.nio.charset.CodingErrorAction_):java_.nio.charset.CharsetEncoder_ {
		var fA0: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		// 575
		if ((N.eq(N.c(p0, java_.lang.Object_), null))) {
			// 576
			tA0 = N.c((new java_.lang.IllegalArgumentException_()), java_.lang.Object_);
			fA0 = tA0;
			N.c(tA0, java_.lang.IllegalArgumentException_).java_lang_IllegalArgumentException_init__Ljava_lang_String__V(__str7);
			throw fA0;
		}
		else {
			// 578
			this._jt_malformedInputAction = p0;
			// 579
			this.implOnMalformedInput_Ljava_nio_charset_CodingErrorAction__V(p0);
			// 580
			return this;
		}
	}
	@:unreflective  public   function implOnMalformedInput_Ljava_nio_charset_CodingErrorAction__V/*implOnMalformedInput*/(p0:java_.nio.charset.CodingErrorAction_):Void {
		// 495
		return;
	}
	@:unreflective  public   function encode_Ljava_nio_CharBuffer_Ljava_nio_ByteBuffer_Z_Ljava_nio_charset_CoderResult_/*encode*/(p0:java_.nio.CharBuffer_, p1:java_.nio.ByteBuffer_, p2:Bool):java_.nio.charset.CoderResult_ {
		var G: Int = 0;
		var fI1: Int = 0;
		var lA4: java_.lang.Object_ = null;
		var lA5: java_.lang.Object_ = null;
		var fA0: java_.lang.Object_ = null;
		var tA2: java_.lang.Object_ = null;
		var tA3: java_.lang.Object_ = null;
		var J__exception__:Dynamic = null;
		while (true) {
			try {
				while (true) {
					switch (G) {
						case 0:
							// 359
							if (((this._jt_state == 0))) {
								G = 1;
								continue;
							}
							if (((this._jt_state == 1))) {
								G = 1;
								continue;
							}
							if (!(p2)) {
								G = 2;
								continue;
							}
							if (((this._jt_state == 2))) {
								G = 1;
								continue;
							}
							G = 2;
							continue;
						case 2:
							// 360
							throw this.illegalStateException__Ljava_lang_IllegalStateException_();
							G = 1;
							continue;
						case 1:
							// 363
							fA0 = N.c(this, java_.lang.Object_);
							if (!(p2)) {
								G = 3;
								continue;
							}
							fI1 = 2;
							G = 4;
							continue;
						case 3:
							fI1 = 1;
							G = 4;
							continue;
						case 4:
							N.c(fA0, java_.nio.charset.CharsetEncoder_)._jt_state = fI1;
							G = 5;
							continue;
						case 5:
							// 368
							lA4 = N.c(this.encodeLoop_Ljava_nio_CharBuffer_Ljava_nio_ByteBuffer__Ljava_nio_charset_CoderResult_(p0, p1), java_.lang.Object_);
							G = 6;
							continue;
						case 6:
							// 373
							G = 7;
							continue;
						case 8:
							fA0 = N.c(J__exception__, java_.lang.Object_);
							// 369
							lA5 = fA0;
							// 370
							tA2 = N.c((new java_.nio.charset.CoderMalfunctionError_()), java_.lang.Object_);
							fA0 = tA2;
							N.c(tA2, java_.nio.charset.CoderMalfunctionError_).java_nio_charset_CoderMalfunctionError_init__Ljava_lang_Exception__V(N.c(lA5, java_.lang.Exception_));
							throw fA0;
							G = 9;
							continue;
						case 9:
							fA0 = N.c(J__exception__, java_.lang.Object_);
							// 371
							lA5 = fA0;
							// 372
							tA3 = N.c((new java_.nio.charset.CoderMalfunctionError_()), java_.lang.Object_);
							fA0 = tA3;
							N.c(tA3, java_.nio.charset.CoderMalfunctionError_).java_nio_charset_CoderMalfunctionError_init__Ljava_lang_Exception__V(N.c(lA5, java_.lang.Exception_));
							throw fA0;
							G = 7;
							continue;
						case 7:
							// 375
							if ((N.ne(lA4, java_.nio.charset.CoderResult_._jt__UNDERFLOW))) {
								G = 10;
								continue;
							}
							// 376
							if (!(p2)) {
								G = 11;
								continue;
							}
							if (!(p0.hasRemaining__Z())) {
								G = 11;
								continue;
							}
							// 377
							lA4 = N.c(java_.nio.charset.CoderResult_.malformedForLength_I_Ljava_nio_charset_CoderResult_(p0.remaining__I()), java_.lang.Object_);
							G = 12;
							continue;
						case 11:
							// 379
							return N.c(lA4, java_.nio.charset.CoderResult_);
						case 10:
							// 381
							if ((N.ne(lA4, java_.nio.charset.CoderResult_._jt__OVERFLOW))) {
								G = 12;
								continue;
							}
							// 382
							return N.c(lA4, java_.nio.charset.CoderResult_);
						case 12:
							// 386
							fA0 = lA4;
							// 387
							if (!(N.c(fA0, java_.nio.charset.CoderResult_).isUnmappable__Z())) {
								G = 13;
								continue;
							}
							fA0 = N.c(this._jt_unmappableCharacterAction, java_.lang.Object_);
							G = 14;
							continue;
						case 13:
							fA0 = N.c(this._jt_malformedInputAction, java_.lang.Object_);
							G = 14;
							continue;
						case 14:
							lA5 = fA0;
							// 388
							if ((N.ne(lA5, java_.nio.charset.CodingErrorAction_._jt_REPORT))) {
								G = 15;
								continue;
							}
							// 389
							return N.c(lA4, java_.nio.charset.CoderResult_);
						case 15:
							// 390
							if ((N.ne(lA5, java_.nio.charset.CodingErrorAction_._jt_REPLACE))) {
								G = 16;
								continue;
							}
							// 391
							if (((p1.remaining__I() >= (this._jt_replacementBytes).length))) {
								G = 17;
								continue;
							}
							// 392
							return java_.nio.charset.CoderResult_._jt__OVERFLOW;
						case 17:
							// 394
							p1.put__B_Ljava_nio_ByteBuffer_(this._jt_replacementBytes);
							G = 16;
							continue;
						case 16:
							// 396
							p0.position_I_Ljava_nio_Buffer_((((p0.position__I() + N.c(lA4, java_.nio.charset.CoderResult_).length__I()))|0));
							// 397
							G = 5;
							continue;
						default:
					}
				}
				return null;
			}
			catch (J__i__exception__: Dynamic) {
				J__exception__ = J__i__exception__;
				if (((((((G >= 5)) && ((G < 6)))) && Std.is(J__exception__, java_.nio.BufferOverflowException_)))) {
					G = 8;
					continue;
				}
				if (((((((G >= 5)) && ((G < 6)))) && Std.is(J__exception__, java_.nio.BufferUnderflowException_)))) {
					G = 9;
					continue;
				}
				throw J__i__exception__;
			}
		}
		return null;
	}
	@:unreflective  public   function illegalStateException__Ljava_lang_IllegalStateException_/*illegalStateException*/():java_.lang.IllegalStateException_ {
		var fA0: java_.lang.Object_ = null;
		var fA1: java_.lang.Object_ = null;
		var fA2: java_.lang.Object_ = null;
		var tA0: java_.lang.Object_ = null;
		var tA1: java_.lang.Object_ = null;
		// 670
		tA0 = N.c((new java_.lang.IllegalStateException_()), java_.lang.Object_);
		fA0 = tA0;
		fA1 = tA0;
		tA1 = N.c((new java_.lang.StringBuilder_()), java_.lang.Object_);
		fA2 = tA1;
		N.c(tA1, java_.lang.StringBuilder_).java_lang_StringBuilder_init___V();
		N.c(fA1, java_.lang.IllegalStateException_).java_lang_IllegalStateException_init__Ljava_lang_String__V(N.c(fA2, java_.lang.StringBuilder_).append_Ljava_lang_String__Ljava_lang_StringBuilder_(__str8).append_I_Ljava_lang_StringBuilder_(this._jt_state).toString__Ljava_lang_String_());
		throw fA0;
	}
	@:unreflective  public   function encodeLoop_Ljava_nio_CharBuffer_Ljava_nio_ByteBuffer__Ljava_nio_charset_CoderResult_/*encodeLoop*/(p0:java_.nio.CharBuffer_, p1:java_.nio.ByteBuffer_):java_.nio.charset.CoderResult_ {
		throw 'java.nio.charset.CharsetEncoder.encodeLoop :: (Ljava/nio/CharBuffer;Ljava/nio/ByteBuffer;)Ljava/nio/charset/CoderResult;: No method body';
	}
	@:unreflective  public   function flush_Ljava_nio_ByteBuffer__Ljava_nio_charset_CoderResult_/*flush*/(p0:java_.nio.ByteBuffer_):java_.nio.charset.CoderResult_ {
		var G: Int = 0;
		var lA2: java_.lang.Object_ = null;
		while (true) {
			switch (G) {
				case 0:
					// 461
					if (((this._jt_state == 3))) {
						G = 1;
						continue;
					}
					if (((this._jt_state == 2))) {
						G = 1;
						continue;
					}
					// 462
					throw this.illegalStateException__Ljava_lang_IllegalStateException_();
					G = 1;
					continue;
				case 1:
					// 464
					lA2 = N.c(this.implFlush_Ljava_nio_ByteBuffer__Ljava_nio_charset_CoderResult_(p0), java_.lang.Object_);
					// 465
					if ((N.ne(lA2, java_.nio.charset.CoderResult_._jt__UNDERFLOW))) {
						G = 2;
						continue;
					}
					// 466
					this._jt_state = 3;
					G = 2;
					continue;
				case 2:
					// 468
					return N.c(lA2, java_.nio.charset.CoderResult_);
				default:
			}
		}
		return null;
	}
	@:unreflective  public   function implFlush_Ljava_nio_ByteBuffer__Ljava_nio_charset_CoderResult_/*implFlush*/(p0:java_.nio.ByteBuffer_):java_.nio.charset.CoderResult_ {
		// 482
		return java_.nio.charset.CoderResult_._jt__UNDERFLOW;
	}
	@:unreflective static private var __str0:java_.lang.String_;
	@:unreflective static private var __str1:java_.lang.String_;
	@:unreflective static private var __str2:java_.lang.String_;
	@:unreflective static private var __str3:java_.lang.String_;
	@:unreflective static private var __str4:java_.lang.String_;
	@:unreflective static private var __str5:java_.lang.String_;
	@:unreflective static private var __str6:java_.lang.String_;
	@:unreflective static private var __str7:java_.lang.String_;
	@:unreflective static private var __str8:java_.lang.String_;
	 @:unreflective static public function STRS() {
		__str0 = N.strLit("averageBytesPerChar and maxBytesPerChar must both be positive");
		__str1 = N.strLit("averageBytesPerChar is greater than maxBytesPerChar");
		__str2 = N.strLit("replacement == null");
		__str3 = N.strLit("replacement.length == 0");
		__str4 = N.strLit(" > ");
		__str5 = N.strLit("replacement.length > maxBytesPerChar: ");
		__str6 = N.strLit("Bad replacement: ");
		__str7 = N.strLit("newAction == null");
		__str8 = N.strLit("State: ");
	}
	 @:unreflective static public function SI() {
	}
}

@soywiz

This comment has been minimized.

Show comment
Hide comment
@soywiz

soywiz May 25, 2017

Member

I see. Then we will have to do it better. I will try to hook service loader. And in the future I will do a proper evaluation that will work with ifs/switches.

Member

soywiz commented May 25, 2017

I see. Then we will have to do it better. I will try to hook service loader. And in the future I will do a proper evaluation that will work with ifs/switches.

@soywiz soywiz reopened this May 25, 2017

@SergeyLabutin

This comment has been minimized.

Show comment
Hide comment
@SergeyLabutin

SergeyLabutin May 25, 2017

Member

I more testing
JTranscCharset dependency - fixed
This for my project only i add next lines before main class, and temporary fix it.

obj.visitClass(program[java.nio.charset.CoderResult::class.java.fqname])
obj.visitClass(program[java.text.SimpleDateFormat::class.java.fqname])
Member

SergeyLabutin commented May 25, 2017

I more testing
JTranscCharset dependency - fixed
This for my project only i add next lines before main class, and temporary fix it.

obj.visitClass(program[java.nio.charset.CoderResult::class.java.fqname])
obj.visitClass(program[java.text.SimpleDateFormat::class.java.fqname])
@soywiz

This comment has been minimized.

Show comment
Hide comment
@soywiz

soywiz May 25, 2017

Member

What about (as a temporal solution for your case; still not reproduced)

public class MyMainClass {
    static public void main(String[] args) {
        CoderResult.class;
        SimpleDateFormat.class;
        // ... your code here
    }
}

That way you won't have to modify jtransc. Right?

Member

soywiz commented May 25, 2017

What about (as a temporal solution for your case; still not reproduced)

public class MyMainClass {
    static public void main(String[] args) {
        CoderResult.class;
        SimpleDateFormat.class;
        // ... your code here
    }
}

That way you won't have to modify jtransc. Right?

@SergeyLabutin

This comment has been minimized.

Show comment
Hide comment
@SergeyLabutin

SergeyLabutin May 25, 2017

Member

Yes, i had go this way last time, but not worked for me. I tried find solution again. Next construction is working:

public class MyMainClass {
    private static final CoderResult coderResult = CoderResult.UNDERFLOW;
    private static final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("", Locale.US);
    static public void main(String[] args) {
        System.out.println(coderResult.toString());
        System.out.println(simpleDateFormat.getClass());
        // ... your code here
    }
}

Not beautiful, but it's temporary =)

Member

SergeyLabutin commented May 25, 2017

Yes, i had go this way last time, but not worked for me. I tried find solution again. Next construction is working:

public class MyMainClass {
    private static final CoderResult coderResult = CoderResult.UNDERFLOW;
    private static final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("", Locale.US);
    static public void main(String[] args) {
        System.out.println(coderResult.toString());
        System.out.println(simpleDateFormat.getClass());
        // ... your code here
    }
}

Not beautiful, but it's temporary =)

@soywiz

This comment has been minimized.

Show comment
Hide comment
@soywiz

soywiz May 25, 2017

Member

Ok. Did you tried this? Maybe it is not working either. But well, I will try to fix it asap at any rate as soon as I can get a failing test case.

public class MyMainClass {
    static {
        CoderResult.class;
        SimpleDateFormat.class;
    }
    static public void main(String[] args) {
        // ... your code here
    }
}
Member

soywiz commented May 25, 2017

Ok. Did you tried this? Maybe it is not working either. But well, I will try to fix it asap at any rate as soon as I can get a failing test case.

public class MyMainClass {
    static {
        CoderResult.class;
        SimpleDateFormat.class;
    }
    static public void main(String[] args) {
        // ... your code here
    }
}
@SergeyLabutin

This comment has been minimized.

Show comment
Hide comment
@SergeyLabutin

SergeyLabutin May 25, 2017

Member

Checked, yes it works for me. Test i provide tomorrow.

Member

SergeyLabutin commented May 25, 2017

Checked, yes it works for me. Test i provide tomorrow.

@soywiz soywiz closed this in d21aeac May 28, 2017

soywiz added a commit that referenced this issue May 28, 2017

intrigus added a commit to intrigus/jtransc that referenced this issue May 30, 2017

intrigus added a commit to intrigus/jtransc that referenced this issue May 30, 2017

intrigus added a commit to intrigus/jtransc that referenced this issue May 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment