Initial commit
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
package com.thoughtworks.xstream.converters.basic;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class LongConverter extends AbstractSingleValueConverter {
|
||||
static /* synthetic */ Class class$java$lang$Long;
|
||||
|
||||
static /* synthetic */ Class class$(String str) {
|
||||
try {
|
||||
return Class.forName(str);
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new NoClassDefFoundError().initCause(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter, com.thoughtworks.xstream.converters.ConverterMatcher
|
||||
public boolean canConvert(Class cls) {
|
||||
if (cls != Long.TYPE) {
|
||||
Class cls2 = class$java$lang$Long;
|
||||
if (cls2 == null) {
|
||||
cls2 = class$("java.lang.Long");
|
||||
class$java$lang$Long = cls2;
|
||||
}
|
||||
if (cls != cls2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter, com.thoughtworks.xstream.converters.SingleValueConverter
|
||||
public Object fromString(String str) {
|
||||
long parseLong;
|
||||
long j;
|
||||
int length = str.length();
|
||||
if (length == 0) {
|
||||
throw new NumberFormatException("For input string: \"\"");
|
||||
}
|
||||
if (length < 17) {
|
||||
return Long.decode(str);
|
||||
}
|
||||
char charAt = str.charAt(0);
|
||||
if (charAt != '0' && charAt != '#') {
|
||||
return Long.decode(str);
|
||||
}
|
||||
char charAt2 = str.charAt(1);
|
||||
if (charAt == '#' && length == 17) {
|
||||
j = Long.parseLong(str.substring(1, 9), 16) << 32;
|
||||
parseLong = Long.parseLong(str.substring(9, 17), 16);
|
||||
} else if ((charAt2 == 'x' || charAt2 == 'X') && length == 18) {
|
||||
long parseLong2 = Long.parseLong(str.substring(2, 10), 16) << 32;
|
||||
parseLong = Long.parseLong(str.substring(10, 18), 16);
|
||||
j = parseLong2;
|
||||
} else {
|
||||
if (length != 23 || charAt2 != '1') {
|
||||
return Long.decode(str);
|
||||
}
|
||||
long parseLong3 = Long.parseLong(str.substring(1, 12), 8) << 33;
|
||||
parseLong = Long.parseLong(str.substring(12, 23), 8);
|
||||
j = parseLong3;
|
||||
}
|
||||
return new Long(parseLong | j);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user