Bug 67189 - [PATCH] CharsetEncoder changes to support Armed Bear Common Lisp (ABCL)
Summary: [PATCH] CharsetEncoder changes to support Armed Bear Common Lisp (ABCL)
Alias: None
Product: classpath
Classification: Unclassified
Component: classpath (show other bugs)
Version: 0.99
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2015-08-12 11:41 UTC by wispym.gcc
Modified: 2015-08-12 11:41 UTC (History)
0 users

See Also:
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description wispym.gcc 2015-08-12 11:41:03 UTC
To get Armed Bear Common Lisp (ABCL) running with GNU classpath, I needed to patch CharsetEncoder.java as follows. I don't know whether the proper solution is to change ABCL or to change GNU classpath. I changed GNU classpath.

diff -Naur classpath-0.99/java/nio/charset/CharsetEncoder.java classpath-0.99.abcl/java/nio/charset/CharsetEncoder.java
--- classpath-0.99/java/nio/charset/CharsetEncoder.java 2010-06-03 20:13:04.000000000 +0100
+++ classpath-0.99.abcl/java/nio/charset/CharsetEncoder.java  2015-08-12 12:16:13.000000000 +0100
@@ -159,8 +159,6 @@
     // in progress" and also that "it resets this Encoder".
     // Should we check to see that the state is reset, or should we
     // call reset()?
-    if (state != STATE_RESET)
-      throw new IllegalStateException ();

     // REVIEW: Using max instead of average may allocate a very large
     // buffer.  Maybe we should do something more efficient?
@@ -199,9 +197,6 @@
     // a return value indicating an incomplete decoding operation"
     // XXX: We will not check the previous return value, just
     // that the previous call passed true for endOfInput
-    if (state != STATE_RESET && state != STATE_CODING
-        && !(endOfInput && state == STATE_END))
-      throw new IllegalStateException ();
     state = newState;

     for (;;)