|
|
f6c950 |
From: Peter Lemenkov <lemenkov@gmail.com>
|
|
|
f6c950 |
Date: Sun, 21 Nov 2010 00:17:49 +0300
|
|
|
ebf67f |
Subject: [PATCH] Ugly workaround for java-1.5.0-gcj which doesn't support
|
|
|
ebf67f |
UNICODE fully
|
|
|
f6c950 |
|
|
|
f6c950 |
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
|
|
Hans Ulrich Niedermann |
ebfa23 |
Fedora-Spec-Comment: Required only for el5, el6 on PowerPC
|
|
Hans Ulrich Niedermann |
ebfa23 |
Fedora-Spec-Before: %if 0%{?el4}%{?el5}%{?el6}
|
|
Hans Ulrich Niedermann |
ebfa23 |
Fedora-Spec-Before: %ifnarch %{ix86} x86_64
|
|
Hans Ulrich Niedermann |
ebfa23 |
Fedora-Spec-After: %endif
|
|
Hans Ulrich Niedermann |
ebfa23 |
Fedora-Spec-After: %endif
|
|
|
f6c950 |
---
|
|
|
61833a |
.../java_src/com/ericsson/otp/erlang/OtpErlangList.java | 14 +-------------
|
|
|
61833a |
.../java_src/com/ericsson/otp/erlang/OtpInputStream.java | 13 ++-----------
|
|
|
f6c950 |
2 files changed, 3 insertions(+), 24 deletions(-)
|
|
|
f6c950 |
|
|
|
f6c950 |
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java
|
|
|
f6c950 |
index 3456fd7..86cd411 100644
|
|
|
f6c950 |
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java
|
|
|
f6c950 |
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java
|
|
|
f6c950 |
@@ -389,19 +389,7 @@ public class OtpErlangList extends OtpErlangObject implements
|
|
|
f6c950 |
*/
|
|
|
f6c950 |
|
|
|
f6c950 |
public String stringValue() throws OtpErlangException {
|
|
|
f6c950 |
- if (! isProper()) {
|
|
|
f6c950 |
- throw new OtpErlangException("Non-proper list: " + this);
|
|
|
f6c950 |
- }
|
|
|
f6c950 |
- final int[] values = new int[arity()];
|
|
|
f6c950 |
- for (int i = 0; i < values.length; ++i) {
|
|
|
f6c950 |
- final OtpErlangObject o = elementAt(i);
|
|
|
f6c950 |
- if (! (o instanceof OtpErlangLong)) {
|
|
|
f6c950 |
- throw new OtpErlangException("Non-integer term: " + o);
|
|
|
f6c950 |
- }
|
|
|
f6c950 |
- final OtpErlangLong l = (OtpErlangLong) o;
|
|
|
f6c950 |
- values[i] = l.intValue();
|
|
|
f6c950 |
- }
|
|
|
f6c950 |
- return new String(values, 0, values.length);
|
|
|
f6c950 |
+ throw new OtpErlangException("No UNICODE support in java-1.5.0-gcj");
|
|
|
f6c950 |
}
|
|
|
f6c950 |
|
|
|
f6c950 |
|
|
|
f6c950 |
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java
|
|
|
a6c182 |
index 9dc1728..76e380d 100644
|
|
|
f6c950 |
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java
|
|
|
f6c950 |
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java
|
|
|
a6c182 |
@@ -1112,17 +1112,8 @@ public class OtpInputStream extends ByteArrayInputStream {
|
|
|
f6c950 |
case OtpExternal.nilTag:
|
|
|
f6c950 |
return "";
|
|
|
f6c950 |
case OtpExternal.listTag: // List when unicode +
|
|
|
f6c950 |
- len = read4BE();
|
|
|
f6c950 |
- intbuf = new int[len];
|
|
|
f6c950 |
- for (int i = 0; i < len; i++) {
|
|
|
f6c950 |
- intbuf[i] = read_int();
|
|
|
f6c950 |
- if (! OtpErlangString.isValidCodePoint(intbuf[i])) {
|
|
|
f6c950 |
- throw new OtpErlangDecodeException
|
|
|
f6c950 |
- ("Invalid CodePoint: " + intbuf[i]);
|
|
|
f6c950 |
- }
|
|
|
f6c950 |
- }
|
|
|
f6c950 |
- read_nil();
|
|
|
f6c950 |
- return new String(intbuf, 0, intbuf.length);
|
|
|
f6c950 |
+ throw new OtpErlangDecodeException(
|
|
|
f6c950 |
+ "No UNICODE support in java-1.5.0-gcj");
|
|
|
f6c950 |
default:
|
|
|
f6c950 |
throw new OtpErlangDecodeException(
|
|
|
f6c950 |
"Wrong tag encountered, expected " + OtpExternal.stringTag
|