Commit faf38e27 authored by Anett Jakab's avatar Anett Jakab
Browse files

javafx.util.Pair replaced with Map


Signed-off-by: Anett Jakab's avatarAnett Jakab <jakabanett13@gmail.com>
parent 963616f1
......@@ -9,6 +9,8 @@ package org.eclipse.titan.runtime.core;
import java.math.BigInteger;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.titan.runtime.core.BER.ASN_BER_TLV;
import org.eclipse.titan.runtime.core.BER.ASN_BERdescriptor;
......@@ -693,16 +695,19 @@ public abstract class Base_Type {
}
public Pair<Boolean, TitanInteger> BER_decode_TLV_Integer(ASN_BER_TLV p_tlv, int p_unsigned, TitanInteger p_int_val) {
public Map<Boolean, TitanInteger> BER_decode_TLV_Integer(ASN_BER_TLV p_tlv, int p_unsigned, TitanInteger p_int_val) {
p_tlv.chk_constructedFlag(false);
Map<Boolean, TitanInteger> result = new HashMap<Boolean, TitanInteger>();
if(!p_tlv.isComplete) {
return new Pair<Boolean, TitanInteger> (false, p_int_val);
result.put(false, p_int_val);
return result;
}
if(p_tlv.Vlen == 0) {
TTCN_EncDec_ErrorContext.error(error_type.ET_INVAL_MSG, "Length of V-part is 0.");
return new Pair<Boolean, TitanInteger> (false, p_int_val);
result.put(false, p_int_val);
return result;
}
int Vlen = p_tlv.Vlen;
......@@ -711,8 +716,8 @@ public abstract class Base_Type {
if(Vlen >= Integer.BYTES) {
BigInteger D = new BigInteger(p_tlv.Vstr);
return new Pair<Boolean, TitanInteger> (true, new TitanInteger(D));
result.put(true, new TitanInteger(D));
return result;
}
......@@ -737,7 +742,9 @@ public abstract class Base_Type {
p_int_val = new TitanInteger(intVal);
return new Pair<Boolean, TitanInteger> (true, p_int_val);
result.put(true, p_int_val);
return result;
}
public ASN_BER_TLV BER_encode_chk_bound(boolean p_isbound) {
......
......@@ -9,6 +9,7 @@ package org.eclipse.titan.runtime.core;
import java.math.BigInteger;
import java.text.MessageFormat;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
......@@ -2378,30 +2379,33 @@ public class TitanInteger extends Base_Type {
strippedTlv = BER_decode_strip_tags(p_td.ber, p_tlv, L_form, strippedTlv);
TitanInteger tmp = new TitanInteger();
Pair <Boolean, TitanInteger> p = BER_decode_TLV_Integer(strippedTlv, L_form, tmp);
Map <Boolean, TitanInteger> p = BER_decode_TLV_Integer(strippedTlv, L_form, tmp);
boolean returnVal = p.getKey();
tmp = p.getValue();
if (tmp.is_native()) {
nativeFlag = true;
if(strippedTlv.getVstr()[0] >= 0 && tmp.nativeInt < 0) {
nativeInt = -tmp.nativeInt;
for (Map.Entry<Boolean, TitanInteger> me: p.entrySet()) {
boolean returnVal = me.getKey();
tmp = me.getValue();
if (tmp.is_native()) {
nativeFlag = true;
if(strippedTlv.getVstr()[0] >= 0 && tmp.nativeInt < 0) {
nativeInt = -tmp.nativeInt;
} else {
nativeInt = tmp.nativeInt;
}
} else {
nativeInt = tmp.nativeInt;
nativeFlag = false;
if(strippedTlv.getVstr()[0] < 0 && tmp.openSSL.compareTo(BigInteger.ZERO) < 0) {
openSSL = tmp.openSSL.negate();
}
openSSL = tmp.openSSL;
}
} else {
nativeFlag = false;
if(strippedTlv.getVstr()[0] < 0 && tmp.openSSL.compareTo(BigInteger.ZERO) < 0) {
openSSL = tmp.openSSL.negate();
if (returnVal) {
boundFlag = true;
}
openSSL = tmp.openSSL;
return returnVal;
}
if (returnVal) {
boundFlag = true;
}
return returnVal;
return false;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment