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