konsoletyper / teavm

Compiles Java bytecode to JavaScript, WebAssembly and C
https://teavm.org
Apache License 2.0
2.55k stars 260 forks source link

Add missing implementation of java.lang.Appendable interface to TeaVM java.io.PrintStream class #911

Closed pcoperatr closed 2 months ago

pcoperatr commented 2 months ago

java.io.PrintStream is supposed to implement java.lang.Appendable (https://docs.oracle.com/javase/8/docs/api/java/io/PrintStream.html). But TeaVM's emulation is missing its implementation.

This fix solves the problem.

konsoletyper commented 2 months ago

Tests still failing. One reason is that append methods have wrong signature - they must return PrintStream instead of Appendable. Then tests go a little bit further but fail for some reason - I'll investigate

pcoperatr commented 2 months ago

I can reproduce the failure. Will work on the fix

pcoperatr commented 2 months ago

The last commit fixes all test case failures, but now the test hangs. It behaves similar to https://github.com/konsoletyper/teavm/issues/913 issue

Given it is a pass on GitHub, I assume it is some issue with the stuck test on my side.