link start!
This commit is contained in:
@@ -0,0 +1,271 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.nre.util.IFilter
|
||||
* javax.baja.nre.util.ILambda
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import javax.baja.util.IFilter;
|
||||
import javax.baja.util.ILambda;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class Array {
|
||||
private javax.baja.nre.util.Array array;
|
||||
static /* synthetic */ Class class$java$lang$Object;
|
||||
|
||||
public final void add(int n, Object object) {
|
||||
this.array.add(n, object);
|
||||
}
|
||||
|
||||
public final boolean add(Object object) {
|
||||
return this.array.add(object);
|
||||
}
|
||||
|
||||
public final void addAll(Array array) {
|
||||
this.array.addAll(array.array(), array.size());
|
||||
}
|
||||
|
||||
public final void addAll(Collection collection) {
|
||||
this.array.addAll(collection);
|
||||
}
|
||||
|
||||
public final void addAll(Object[] objectArray, int n) {
|
||||
this.array.addAll(objectArray, n);
|
||||
}
|
||||
|
||||
public final void addAll(Object[] objectArray) {
|
||||
this.array.addAll(objectArray);
|
||||
}
|
||||
|
||||
public Array apply(Class clazz, ILambda iLambda) {
|
||||
return Array.toArray(this.array.apply(clazz, (javax.baja.nre.util.ILambda)iLambda));
|
||||
}
|
||||
|
||||
public Array apply(ILambda iLambda) {
|
||||
return Array.toArray(this.array.apply((javax.baja.nre.util.ILambda)iLambda));
|
||||
}
|
||||
|
||||
public final Object[] array() {
|
||||
return this.array.array();
|
||||
}
|
||||
|
||||
public final void clear() {
|
||||
this.array.clear();
|
||||
}
|
||||
|
||||
public final boolean contains(Object object) {
|
||||
return this.array.contains(object);
|
||||
}
|
||||
|
||||
public Array copy() {
|
||||
return Array.toArray(this.array.copy());
|
||||
}
|
||||
|
||||
public Array copy(int n, int n2) {
|
||||
return Array.toArray(this.array.copy(n, n2));
|
||||
}
|
||||
|
||||
public Array copy(int n) {
|
||||
return Array.toArray(this.array.copy(n));
|
||||
}
|
||||
|
||||
public boolean equals(Object object) {
|
||||
return this.array.equals(object);
|
||||
}
|
||||
|
||||
public Array filter(IFilter iFilter) {
|
||||
return Array.toArray(this.array.filter((javax.baja.nre.util.IFilter)iFilter));
|
||||
}
|
||||
|
||||
public Array filterNull() {
|
||||
return Array.toArray(this.array.filterNull());
|
||||
}
|
||||
|
||||
public final Object first() {
|
||||
return this.array.first();
|
||||
}
|
||||
|
||||
public final Object get(int n) {
|
||||
return this.array.get(n);
|
||||
}
|
||||
|
||||
public final void grow(int n) {
|
||||
this.array.grow(n);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.array.hashCode();
|
||||
}
|
||||
|
||||
public final int indexOf(Object object, int n) {
|
||||
return this.array.indexOf(object, n);
|
||||
}
|
||||
|
||||
public final int indexOf(Object object) {
|
||||
return this.array.indexOf(object);
|
||||
}
|
||||
|
||||
public Array intersection(Object[] objectArray) {
|
||||
return Array.toArray(this.array.intersection(objectArray));
|
||||
}
|
||||
|
||||
public final boolean isEmpty() {
|
||||
return this.array.isEmpty();
|
||||
}
|
||||
|
||||
public final ListIterator iterator() {
|
||||
return this.array.iterator();
|
||||
}
|
||||
|
||||
public final Object last() {
|
||||
return this.array.last();
|
||||
}
|
||||
|
||||
public final int lastIndexOf(Object object, int n) {
|
||||
return this.array.lastIndexOf(object, n);
|
||||
}
|
||||
|
||||
public final int lastIndexOf(Object object) {
|
||||
return this.array.lastIndexOf(object);
|
||||
}
|
||||
|
||||
public final List list() {
|
||||
return this.array.list();
|
||||
}
|
||||
|
||||
public final Class ofClass() {
|
||||
return this.array.ofClass();
|
||||
}
|
||||
|
||||
public final Object peek() {
|
||||
return this.array.peek();
|
||||
}
|
||||
|
||||
public final Object pop() {
|
||||
return this.array.pop();
|
||||
}
|
||||
|
||||
public final void push(Object object) {
|
||||
this.array.push(object);
|
||||
}
|
||||
|
||||
public final Object remove(int n) {
|
||||
return this.array.remove(n);
|
||||
}
|
||||
|
||||
public final boolean remove(Object object) {
|
||||
return this.array.remove(object);
|
||||
}
|
||||
|
||||
public Array removeAll(Object[] objectArray) {
|
||||
return Array.toArray(this.array.removeAll(objectArray));
|
||||
}
|
||||
|
||||
public final void removeRange(int n, int n2) {
|
||||
this.array.removeRange(n, n2);
|
||||
}
|
||||
|
||||
public Array reverse() {
|
||||
return Array.toArray(this.array.reverse());
|
||||
}
|
||||
|
||||
public Array rsort() {
|
||||
return Array.toArray(this.array.rsort());
|
||||
}
|
||||
|
||||
public final Object set(int n, Object object) {
|
||||
return this.array.set(n, object);
|
||||
}
|
||||
|
||||
public final int size() {
|
||||
return this.array.size();
|
||||
}
|
||||
|
||||
public Array slice(int n, int n2) {
|
||||
return Array.toArray(this.array.slice(n, n2));
|
||||
}
|
||||
|
||||
public Array sort() {
|
||||
return Array.toArray(this.array.sort());
|
||||
}
|
||||
|
||||
public Array sort(Comparator comparator) {
|
||||
return Array.toArray(this.array.sort(comparator));
|
||||
}
|
||||
|
||||
public void swap(int n, int n2) {
|
||||
this.array.swap(n, n2);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.array.toString();
|
||||
}
|
||||
|
||||
public final Object[] trim() {
|
||||
return this.array.trim();
|
||||
}
|
||||
|
||||
private static final Array toArray(javax.baja.nre.util.Array array) {
|
||||
Array array2 = new Array(array.array(), array.size());
|
||||
return array2;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public Array() {
|
||||
Class clazz = class$java$lang$Object;
|
||||
if (clazz == null) {
|
||||
clazz = class$java$lang$Object = Array.class("[Ljava.lang.Object;", false);
|
||||
}
|
||||
this(clazz, 10);
|
||||
}
|
||||
|
||||
public Array(Class clazz) {
|
||||
this(clazz, 10);
|
||||
}
|
||||
|
||||
public Array(Class clazz, int n) {
|
||||
this.array = new javax.baja.nre.util.Array(clazz, n);
|
||||
}
|
||||
|
||||
public Array(Object[] objectArray) {
|
||||
this(objectArray, objectArray.length);
|
||||
}
|
||||
|
||||
public Array(Object[] objectArray, int n) {
|
||||
this.array = new javax.baja.nre.util.Array(objectArray, n);
|
||||
}
|
||||
|
||||
public Array(Class clazz, Collection collection) {
|
||||
this.array = new javax.baja.nre.util.Array(clazz, collection);
|
||||
}
|
||||
|
||||
public Array(Collection collection) {
|
||||
Class clazz = class$java$lang$Object;
|
||||
if (clazz == null) {
|
||||
clazz = class$java$lang$Object = Array.class("[Ljava.lang.Object;", false);
|
||||
}
|
||||
this(clazz, collection);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BAbsTime;
|
||||
import javax.baja.sys.BStruct;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BAbsTimeRange
|
||||
extends BStruct {
|
||||
public static final Property startTime = BAbsTimeRange.newProperty(0, BAbsTime.make(0L), null);
|
||||
public static final Property endTime = BAbsTimeRange.newProperty(0, BAbsTime.END_OF_TIME, null);
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$util$BAbsTimeRange;
|
||||
|
||||
public BAbsTime getStartTime() {
|
||||
return (BAbsTime)this.get(startTime);
|
||||
}
|
||||
|
||||
public void setStartTime(BAbsTime bAbsTime) {
|
||||
this.set(startTime, (BValue)bAbsTime, null);
|
||||
}
|
||||
|
||||
public BAbsTime getEndTime() {
|
||||
return (BAbsTime)this.get(endTime);
|
||||
}
|
||||
|
||||
public void setEndTime(BAbsTime bAbsTime) {
|
||||
this.set(endTime, (BValue)bAbsTime, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean includes(BAbsTime bAbsTime) {
|
||||
boolean bl = false;
|
||||
if (!bAbsTime.isBefore(this.getStartTime()) && !bAbsTime.isAfter(this.getEndTime())) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
return this.getStartTime().toString(context) + " - " + this.getEndTime().toString(context);
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public BAbsTimeRange() {
|
||||
}
|
||||
|
||||
public BAbsTimeRange(BAbsTime bAbsTime, BAbsTime bAbsTime2) {
|
||||
if (bAbsTime != null) {
|
||||
this.setStartTime(bAbsTime);
|
||||
}
|
||||
if (bAbsTime2 != null) {
|
||||
this.setEndTime(bAbsTime2);
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BAbsTimeRange;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BAbsTimeRange = BAbsTimeRange.class("[Ljavax.baja.util.BAbsTimeRange;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.TextUtil
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import javax.baja.nre.util.TextUtil;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BSimple;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BBitSet
|
||||
extends BSimple {
|
||||
private static char[] hexChars = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
|
||||
public static final BBitSet EMPTY;
|
||||
public static final BBitSet DEFAULT;
|
||||
public static final Type TYPE;
|
||||
private byte[] bits;
|
||||
private int hashCode;
|
||||
static /* synthetic */ Class class$javax$baja$util$BBitSet;
|
||||
|
||||
public static final BBitSet make(BBitSet bBitSet, int n, boolean bl) {
|
||||
if (bBitSet.getBit(n) == bl) {
|
||||
return bBitSet;
|
||||
}
|
||||
int n2 = n >> 3;
|
||||
int n3 = 1 << n % 8;
|
||||
int n4 = Math.max(bBitSet.bits.length, n2 + 1);
|
||||
byte[] byArray = new byte[n4];
|
||||
System.arraycopy(bBitSet.bits, 0, byArray, 0, bBitSet.bits.length);
|
||||
if (bl) {
|
||||
int n5 = n2;
|
||||
byArray[n5] = (byte)(byArray[n5] | n3);
|
||||
} else {
|
||||
int n6 = n2;
|
||||
byArray[n6] = (byte)(byArray[n6] & ~n3);
|
||||
}
|
||||
return (BBitSet)new BBitSet(byArray).intern();
|
||||
}
|
||||
|
||||
public final boolean getBit(int n) {
|
||||
int n2 = n >> 3;
|
||||
int n3 = 1 << n % 8;
|
||||
if (n2 >= this.bits.length) {
|
||||
return false;
|
||||
}
|
||||
boolean bl = false;
|
||||
if ((this.bits[n2] & n3) != 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
if (this.hashCode == 0) {
|
||||
int n = 31;
|
||||
byte[] byArray = this.bits;
|
||||
int n2 = 0;
|
||||
while (n2 < byArray.length) {
|
||||
n = 31 * n + byArray[n2];
|
||||
++n2;
|
||||
}
|
||||
this.hashCode = n;
|
||||
}
|
||||
return this.hashCode;
|
||||
}
|
||||
|
||||
public final boolean equals(Object object) {
|
||||
if (object instanceof BBitSet) {
|
||||
BBitSet bBitSet = (BBitSet)object;
|
||||
int n = Math.min(this.bits.length, bBitSet.bits.length);
|
||||
int n2 = 0;
|
||||
while (n2 < n) {
|
||||
if (this.bits[n2] != bBitSet.bits[n2]) {
|
||||
return false;
|
||||
}
|
||||
++n2;
|
||||
}
|
||||
BBitSet bBitSet2 = n == this.bits.length ? bBitSet : this;
|
||||
int n3 = n;
|
||||
while (n3 < bBitSet2.bits.length) {
|
||||
if (bBitSet2.bits[n3] != 0) {
|
||||
return false;
|
||||
}
|
||||
++n3;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final String toString(Context context) {
|
||||
return "0x" + this.encodeToString();
|
||||
}
|
||||
|
||||
public final void encode(DataOutput dataOutput) throws IOException {
|
||||
dataOutput.writeUTF(this.encodeToString());
|
||||
}
|
||||
|
||||
public final BObject decode(DataInput dataInput) throws IOException {
|
||||
return this.decodeFromString(dataInput.readUTF());
|
||||
}
|
||||
|
||||
public final String encodeToString() {
|
||||
StringBuffer stringBuffer = new StringBuffer(this.bits.length * 2 + 2);
|
||||
boolean bl = false;
|
||||
int n = this.bits.length - 1;
|
||||
while (n >= 0) {
|
||||
block8: {
|
||||
int n2;
|
||||
block7: {
|
||||
n2 = this.bits[n] & 0xFF;
|
||||
if (bl) break block7;
|
||||
if (n2 == 0) break block8;
|
||||
bl = true;
|
||||
}
|
||||
if (n2 < 16) {
|
||||
stringBuffer.append('0');
|
||||
} else {
|
||||
stringBuffer.append(hexChars[n2 >> 4 & 0xF]);
|
||||
}
|
||||
stringBuffer.append(hexChars[n2 & 0xF]);
|
||||
}
|
||||
--n;
|
||||
}
|
||||
if (!bl) {
|
||||
return "00";
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public final BObject decodeFromString(String string) throws IOException {
|
||||
try {
|
||||
byte[] byArray = new byte[string.length() / 2];
|
||||
int n = 0;
|
||||
while (n < string.length()) {
|
||||
int n2 = TextUtil.hexCharToInt((char)string.charAt(n));
|
||||
int n3 = TextUtil.hexCharToInt((char)string.charAt(n + 1));
|
||||
byArray[byArray.length - n / 2 - 1] = (byte)(n2 << 4 | n3);
|
||||
n += 2;
|
||||
}
|
||||
return (BBitSet)new BBitSet(byArray).intern();
|
||||
}
|
||||
catch (RuntimeException runtimeException) {
|
||||
throw new IOException("Invalid BBitSet: " + string);
|
||||
}
|
||||
}
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.hashCode = 0;
|
||||
}
|
||||
|
||||
private BBitSet(byte[] byArray) {
|
||||
this.this();
|
||||
this.bits = byArray;
|
||||
}
|
||||
|
||||
static {
|
||||
DEFAULT = EMPTY = (BBitSet)new BBitSet(new byte[0]).intern();
|
||||
Class clazz = class$javax$baja$util$BBitSet;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BBitSet = BBitSet.class("[Ljavax.baja.util.BBitSet;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import javax.baja.sys.BModule;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BSimple;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.ModuleException;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BClassSpec
|
||||
extends BSimple {
|
||||
public static final BClassSpec NULL = new BClassSpec();
|
||||
public static final BClassSpec DEFAULT;
|
||||
public static final Type TYPE;
|
||||
private String spec;
|
||||
private String moduleName;
|
||||
private String className;
|
||||
private Class cls;
|
||||
static /* synthetic */ Class class$javax$baja$util$BClassSpec;
|
||||
|
||||
public static final BClassSpec make(String string, String string2) {
|
||||
if (string == null || string2 == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
BClassSpec bClassSpec = new BClassSpec();
|
||||
bClassSpec.moduleName = string;
|
||||
bClassSpec.className = string2;
|
||||
bClassSpec.spec = string + ':' + string2;
|
||||
return (BClassSpec)bClassSpec.intern();
|
||||
}
|
||||
|
||||
public static final BClassSpec make(String string) {
|
||||
if (string.equals("null")) {
|
||||
return NULL;
|
||||
}
|
||||
try {
|
||||
BClassSpec bClassSpec = new BClassSpec();
|
||||
int n = string.indexOf(58);
|
||||
bClassSpec.moduleName = string.substring(0, n);
|
||||
bClassSpec.className = string.substring(n + 1);
|
||||
bClassSpec.spec = string;
|
||||
return (BClassSpec)bClassSpec.intern();
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new IllegalArgumentException(string);
|
||||
}
|
||||
}
|
||||
|
||||
public static final BClassSpec make(BModule bModule, Class clazz) {
|
||||
BClassSpec bClassSpec = new BClassSpec();
|
||||
bClassSpec.moduleName = bModule.getModuleName();
|
||||
bClassSpec.className = clazz.getName();
|
||||
bClassSpec.spec = bClassSpec.moduleName + ':' + bClassSpec.className;
|
||||
bClassSpec = (BClassSpec)bClassSpec.intern();
|
||||
bClassSpec.cls = clazz;
|
||||
return bClassSpec;
|
||||
}
|
||||
|
||||
public static final BClassSpec make(Class clazz) {
|
||||
BClassSpec bClassSpec = new BClassSpec();
|
||||
bClassSpec.moduleName = Sys.getModuleForClass(clazz).getModuleName();
|
||||
bClassSpec.className = clazz.getName();
|
||||
bClassSpec.spec = bClassSpec.moduleName + ':' + bClassSpec.className;
|
||||
bClassSpec = (BClassSpec)bClassSpec.intern();
|
||||
bClassSpec.cls = clazz;
|
||||
return bClassSpec;
|
||||
}
|
||||
|
||||
public final boolean isNull() {
|
||||
return this.spec.equals("null");
|
||||
}
|
||||
|
||||
public final String getModuleName() {
|
||||
return this.moduleName;
|
||||
}
|
||||
|
||||
public final String getClassName() {
|
||||
return this.className;
|
||||
}
|
||||
|
||||
public final Class getResolvedClass() throws IOException, ModuleException, ClassNotFoundException {
|
||||
if (this.cls == null) {
|
||||
BModule bModule = Sys.loadModule(this.moduleName);
|
||||
if (bModule == null) {
|
||||
throw new ModuleException("Should never happen");
|
||||
}
|
||||
this.cls = bModule.loadClass(this.className);
|
||||
return this.cls;
|
||||
}
|
||||
return this.cls;
|
||||
}
|
||||
|
||||
public final Object newInstance() throws IOException, ModuleException, IllegalAccessException, InstantiationException, ClassNotFoundException, ClassCastException {
|
||||
return this.getResolvedClass().newInstance();
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return this.spec.hashCode();
|
||||
}
|
||||
|
||||
public final boolean equals(Object object) {
|
||||
if (object instanceof BClassSpec) {
|
||||
return this.spec.equals(((BClassSpec)object).spec);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final String toString(Context context) {
|
||||
return this.spec;
|
||||
}
|
||||
|
||||
public final void encode(DataOutput dataOutput) throws IOException {
|
||||
dataOutput.writeUTF(this.spec);
|
||||
}
|
||||
|
||||
public final BObject decode(DataInput dataInput) throws IOException {
|
||||
return BClassSpec.make(dataInput.readUTF());
|
||||
}
|
||||
|
||||
public final String encodeToString() throws IOException {
|
||||
return this.spec;
|
||||
}
|
||||
|
||||
public final BObject decodeFromString(String string) throws IOException {
|
||||
try {
|
||||
return BClassSpec.make(string);
|
||||
}
|
||||
catch (RuntimeException runtimeException) {
|
||||
throw new IOException("Invalid type spec: " + string);
|
||||
}
|
||||
}
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private BClassSpec() {
|
||||
}
|
||||
|
||||
static {
|
||||
BClassSpec.NULL.spec = "null";
|
||||
DEFAULT = NULL;
|
||||
Class clazz = class$javax$baja$util$BClassSpec;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BClassSpec = BClassSpec.class("[Ljavax.baja.util.BClassSpec;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.naming.BOrd;
|
||||
import javax.baja.space.BComponentSpace;
|
||||
import javax.baja.sys.Action;
|
||||
import javax.baja.sys.BAction;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Knob;
|
||||
import javax.baja.sys.Slot;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BCompositeAction
|
||||
extends BAction {
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$util$BCompositeAction;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public Mirror getMirror() {
|
||||
try {
|
||||
BComponent bComponent = this.getParentComponent();
|
||||
if (bComponent == null) {
|
||||
return null;
|
||||
}
|
||||
BComponentSpace bComponentSpace = bComponent.getComponentSpace();
|
||||
if (bComponentSpace == null) {
|
||||
return null;
|
||||
}
|
||||
Knob[] knobArray = bComponent.getKnobs(this.getPropertyInParent());
|
||||
if (knobArray.length == 0) {
|
||||
return null;
|
||||
}
|
||||
Knob knob = knobArray[0];
|
||||
BOrd bOrd = knob.getTargetOrd();
|
||||
String string = knob.getTargetSlotName();
|
||||
BComponent bComponent2 = (BComponent)bOrd.get(bComponentSpace);
|
||||
Slot slot = bComponent2.getSlot(string);
|
||||
if (slot == this.getPropertyInParent()) {
|
||||
return null;
|
||||
}
|
||||
if (!(slot instanceof Action)) {
|
||||
return null;
|
||||
}
|
||||
return new Mirror(knob, bComponent2, (Action)slot);
|
||||
}
|
||||
catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Type getParameterType() {
|
||||
Mirror mirror = this.getMirror();
|
||||
if (mirror != null) {
|
||||
return mirror.action.getParameterType();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public BValue getParameterDefault() {
|
||||
Mirror mirror = this.getMirror();
|
||||
if (mirror != null) {
|
||||
mirror.component.lease();
|
||||
return mirror.component.getActionParameterDefault(mirror.action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public BFacets getFacets() {
|
||||
Mirror mirror = this.getMirror();
|
||||
if (mirror != null) {
|
||||
return mirror.component.getSlotFacets(mirror.action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public BValue invoke(BComponent bComponent, BValue bValue) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Type getReturnType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BCompositeAction;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BCompositeAction = BCompositeAction.class("[Ljavax.baja.util.BCompositeAction;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
|
||||
public static class Mirror {
|
||||
public Knob knob;
|
||||
public BComponent component;
|
||||
public Action action;
|
||||
|
||||
public String toString() {
|
||||
return this.component.toPathString() + '.' + this.action.getName();
|
||||
}
|
||||
|
||||
public Mirror(Knob knob, BComponent bComponent, Action action) {
|
||||
this.knob = knob;
|
||||
this.component = bComponent;
|
||||
this.action = action;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.naming.BOrd;
|
||||
import javax.baja.space.BComponentSpace;
|
||||
import javax.baja.sys.Action;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BLink;
|
||||
import javax.baja.sys.BTopic;
|
||||
import javax.baja.sys.Slot;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Topic;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BCompositeTopic
|
||||
extends BTopic {
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$util$BCompositeTopic;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public Mirror getMirror() {
|
||||
try {
|
||||
BComponent bComponent = this.getParentComponent();
|
||||
if (bComponent == null) {
|
||||
return null;
|
||||
}
|
||||
BComponentSpace bComponentSpace = bComponent.getComponentSpace();
|
||||
if (bComponentSpace == null) {
|
||||
return null;
|
||||
}
|
||||
BLink[] bLinkArray = bComponent.getLinks(this.getPropertyInParent());
|
||||
if (bLinkArray.length == 0) {
|
||||
return null;
|
||||
}
|
||||
BLink bLink = bLinkArray[0];
|
||||
BOrd bOrd = bLink.getSourceOrd();
|
||||
String string = bLink.getSourceSlotName();
|
||||
BComponent bComponent2 = (BComponent)bOrd.get(bComponentSpace);
|
||||
Slot slot = bComponent2.getSlot(string);
|
||||
if (slot == this.getPropertyInParent()) {
|
||||
return null;
|
||||
}
|
||||
if (slot instanceof Topic || slot instanceof Action) {
|
||||
return new Mirror(bLink, bComponent2, slot);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Type getEventType() {
|
||||
Mirror mirror = this.getMirror();
|
||||
if (mirror != null) {
|
||||
Slot slot = mirror.slot;
|
||||
if (slot.isAction()) {
|
||||
return slot.asAction().getParameterType();
|
||||
}
|
||||
return slot.asTopic().getEventType();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public BFacets getFacets() {
|
||||
Mirror mirror = this.getMirror();
|
||||
if (mirror != null) {
|
||||
return mirror.component.getSlotFacets(mirror.slot);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BCompositeTopic;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BCompositeTopic = BCompositeTopic.class("[Ljavax.baja.util.BCompositeTopic;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
|
||||
public static class Mirror {
|
||||
public BLink link;
|
||||
public BComponent component;
|
||||
public Slot slot;
|
||||
|
||||
public String toString() {
|
||||
return this.component.toPathString() + '.' + this.slot.getName();
|
||||
}
|
||||
|
||||
public Mirror(BLink bLink, BComponent bComponent, Slot slot) {
|
||||
this.link = bLink;
|
||||
this.component = bComponent;
|
||||
this.slot = slot;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BStruct;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public abstract class BConverter
|
||||
extends BStruct {
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$util$BConverter;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public void init(BObject bObject, BObject bObject2) {
|
||||
}
|
||||
|
||||
public final BObject convert(BObject bObject, BObject bObject2) {
|
||||
return this.convert(bObject, bObject2, null);
|
||||
}
|
||||
|
||||
public abstract BObject convert(BObject var1, BObject var2, Context var3);
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BConverter;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BConverter = BConverter.class("[Ljavax.baja.util.BConverter;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,253 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import javax.baja.sys.BAbsTime;
|
||||
import javax.baja.sys.BBitString;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BWeekday;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BDaysOfWeekBits
|
||||
extends BBitString {
|
||||
public static final int SUNDAY = 1;
|
||||
public static final int MONDAY = 2;
|
||||
public static final int TUESDAY = 4;
|
||||
public static final int WEDNESDAY = 8;
|
||||
public static final int THURSDAY = 16;
|
||||
public static final int FRIDAY = 32;
|
||||
public static final int SATURDAY = 64;
|
||||
public static final BDaysOfWeekBits sunday = (BDaysOfWeekBits)new BDaysOfWeekBits(1).intern();
|
||||
public static final BDaysOfWeekBits monday = (BDaysOfWeekBits)new BDaysOfWeekBits(2).intern();
|
||||
public static final BDaysOfWeekBits tuesday = (BDaysOfWeekBits)new BDaysOfWeekBits(4).intern();
|
||||
public static final BDaysOfWeekBits wednesday = (BDaysOfWeekBits)new BDaysOfWeekBits(8).intern();
|
||||
public static final BDaysOfWeekBits thursday = (BDaysOfWeekBits)new BDaysOfWeekBits(16).intern();
|
||||
public static final BDaysOfWeekBits friday = (BDaysOfWeekBits)new BDaysOfWeekBits(32).intern();
|
||||
public static final BDaysOfWeekBits saturday = (BDaysOfWeekBits)new BDaysOfWeekBits(64).intern();
|
||||
public static final BDaysOfWeekBits DEFAULT = new BDaysOfWeekBits(127);
|
||||
public static final BDaysOfWeekBits EMPTY = new BDaysOfWeekBits(0);
|
||||
public static final BDaysOfWeekBits ALL = DEFAULT;
|
||||
private static BBitString.Support support = new BBitString.Support(DEFAULT);
|
||||
public static final Type TYPE;
|
||||
private int bits;
|
||||
static /* synthetic */ Class class$javax$baja$util$BDaysOfWeekBits;
|
||||
|
||||
public static final BDaysOfWeekBits make(boolean bl) {
|
||||
if (bl) {
|
||||
return ALL;
|
||||
}
|
||||
return EMPTY;
|
||||
}
|
||||
|
||||
public static final BDaysOfWeekBits make(int n) {
|
||||
if (n == BDaysOfWeekBits.ALL.bits) {
|
||||
return ALL;
|
||||
}
|
||||
if (n == BDaysOfWeekBits.EMPTY.bits) {
|
||||
return EMPTY;
|
||||
}
|
||||
return (BDaysOfWeekBits)new BDaysOfWeekBits(n).intern();
|
||||
}
|
||||
|
||||
public final boolean includes(BAbsTime bAbsTime) {
|
||||
return this.includes(bAbsTime.getWeekday());
|
||||
}
|
||||
|
||||
public final int getBits() {
|
||||
return this.bits;
|
||||
}
|
||||
|
||||
public final boolean includes(BWeekday bWeekday) {
|
||||
boolean bl = false;
|
||||
if ((this.bits & 1 << bWeekday.getOrdinal()) != 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final boolean getBit(int n) {
|
||||
boolean bl = false;
|
||||
if ((this.bits & n) != 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final boolean getBit(String string) {
|
||||
return this.getBit(this.tagToOrdinal(string));
|
||||
}
|
||||
|
||||
public final int[] getOrdinals() {
|
||||
return support.getOrdinals();
|
||||
}
|
||||
|
||||
public final boolean isOrdinal(int n) {
|
||||
return support.isOrdinal(n);
|
||||
}
|
||||
|
||||
public final String getTag(int n) {
|
||||
return support.getTag(n);
|
||||
}
|
||||
|
||||
public final String getDisplayTag(int n, Context context) {
|
||||
return support.getDisplayTag(n, context);
|
||||
}
|
||||
|
||||
public final BBitString getInstance(int[] nArray) {
|
||||
int n = 0;
|
||||
int n2 = 0;
|
||||
while (n2 < nArray.length) {
|
||||
n |= nArray[n2];
|
||||
++n2;
|
||||
}
|
||||
return BDaysOfWeekBits.make(n);
|
||||
}
|
||||
|
||||
public final boolean isTag(String string) {
|
||||
return support.isTag(string);
|
||||
}
|
||||
|
||||
public final int tagToOrdinal(String string) {
|
||||
return support.tagToOrdinal(string);
|
||||
}
|
||||
|
||||
public final boolean isEmpty() {
|
||||
boolean bl = false;
|
||||
if (this.bits == 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final boolean isEveryDay() {
|
||||
boolean bl = false;
|
||||
if (this.bits == BDaysOfWeekBits.ALL.bits) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final String getEmptyTag() {
|
||||
return "none";
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return this.bits;
|
||||
}
|
||||
|
||||
public final boolean equals(Object object) {
|
||||
if (object instanceof BDaysOfWeekBits) {
|
||||
boolean bl = false;
|
||||
if (((BDaysOfWeekBits)object).bits == this.bits) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final void encode(DataOutput dataOutput) throws IOException {
|
||||
dataOutput.writeInt(this.bits);
|
||||
}
|
||||
|
||||
public final BObject decode(DataInput dataInput) throws IOException {
|
||||
return BDaysOfWeekBits.make(dataInput.readInt());
|
||||
}
|
||||
|
||||
public final String encodeToString() {
|
||||
return Integer.toHexString(this.bits);
|
||||
}
|
||||
|
||||
public final BObject decodeFromString(String string) throws IOException {
|
||||
try {
|
||||
return BDaysOfWeekBits.make(Integer.parseInt(string, 16));
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new IOException("Invalid bits: " + string);
|
||||
}
|
||||
}
|
||||
|
||||
public final String toString(Context context) {
|
||||
if (this.bits == 0) {
|
||||
return "{}";
|
||||
}
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append('{');
|
||||
if (this.includes(BWeekday.sunday)) {
|
||||
stringBuffer.append(BWeekday.sunday.getShortDisplayTag(context));
|
||||
stringBuffer.append(" ");
|
||||
}
|
||||
if (this.includes(BWeekday.monday)) {
|
||||
stringBuffer.append(BWeekday.monday.getShortDisplayTag(context));
|
||||
stringBuffer.append(" ");
|
||||
}
|
||||
if (this.includes(BWeekday.tuesday)) {
|
||||
stringBuffer.append(BWeekday.tuesday.getShortDisplayTag(context));
|
||||
stringBuffer.append(" ");
|
||||
}
|
||||
if (this.includes(BWeekday.wednesday)) {
|
||||
stringBuffer.append(BWeekday.wednesday.getShortDisplayTag(context));
|
||||
stringBuffer.append(" ");
|
||||
}
|
||||
if (this.includes(BWeekday.thursday)) {
|
||||
stringBuffer.append(BWeekday.thursday.getShortDisplayTag(context));
|
||||
stringBuffer.append(" ");
|
||||
}
|
||||
if (this.includes(BWeekday.friday)) {
|
||||
stringBuffer.append(BWeekday.friday.getShortDisplayTag(context));
|
||||
stringBuffer.append(" ");
|
||||
}
|
||||
if (this.includes(BWeekday.saturday)) {
|
||||
stringBuffer.append(BWeekday.saturday.getShortDisplayTag(context));
|
||||
stringBuffer.append(" ");
|
||||
}
|
||||
stringBuffer.append('}');
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private BDaysOfWeekBits(int n) {
|
||||
this.bits = n;
|
||||
}
|
||||
|
||||
static {
|
||||
support.add(1, "sunday");
|
||||
support.add(2, "monday");
|
||||
support.add(4, "tuesday");
|
||||
support.add(8, "wednesday");
|
||||
support.add(16, "thursday");
|
||||
support.add(32, "friday");
|
||||
support.add(64, "saturday");
|
||||
Class clazz = class$javax$baja$util$BDaysOfWeekBits;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BDaysOfWeekBits = BDaysOfWeekBits.class("[Ljavax.baja.util.BDaysOfWeekBits;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import com.tridium.util.ArrayUtil;
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import java.util.StringTokenizer;
|
||||
import javax.baja.sys.BEnumRange;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BSimple;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BEnumSet
|
||||
extends BSimple {
|
||||
public static final BEnumSet NULL;
|
||||
public static final BEnumSet DEFAULT;
|
||||
public static final Type TYPE;
|
||||
private int[] ordinals;
|
||||
private BEnumRange range;
|
||||
private int hashCode;
|
||||
static /* synthetic */ Class class$javax$baja$util$BEnumSet;
|
||||
|
||||
public static final BEnumSet make(int[] nArray, BEnumRange bEnumRange) {
|
||||
if (bEnumRange == null) {
|
||||
bEnumRange = BEnumRange.NULL;
|
||||
}
|
||||
return (BEnumSet)new BEnumSet(nArray, bEnumRange).intern();
|
||||
}
|
||||
|
||||
public static final BEnumSet make(int[] nArray) {
|
||||
return BEnumSet.make(nArray, BEnumRange.NULL);
|
||||
}
|
||||
|
||||
public final int[] getOrdinals() {
|
||||
return (int[])this.ordinals.clone();
|
||||
}
|
||||
|
||||
public final boolean contains(int n) {
|
||||
boolean bl = false;
|
||||
if (ArrayUtil.binarySearch(this.ordinals, n) != -1) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final BEnumRange getRange() {
|
||||
return this.range;
|
||||
}
|
||||
|
||||
public final boolean isNull() {
|
||||
boolean bl = false;
|
||||
if (this.ordinals.length == 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
try {
|
||||
if (this.hashCode == -1) {
|
||||
this.hashCode = this.encodeToString().hashCode();
|
||||
}
|
||||
return this.hashCode;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
return System.identityHashCode(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean equals(Object object) {
|
||||
if (object instanceof BEnumSet) {
|
||||
BEnumSet bEnumSet = (BEnumSet)object;
|
||||
if (this.ordinals.length != bEnumSet.ordinals.length) {
|
||||
return false;
|
||||
}
|
||||
int n = 0;
|
||||
while (n < this.ordinals.length) {
|
||||
if (this.ordinals[n] != bEnumSet.ordinals[n]) {
|
||||
return false;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return this.range.equals(bEnumSet.range);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final String toString(Context context) {
|
||||
Object object;
|
||||
Object object2 = this.range;
|
||||
if (context != null && (object = (BEnumRange)context.getFacet("range")) != null) {
|
||||
object2 = object;
|
||||
}
|
||||
object = new StringBuffer();
|
||||
int n = 0;
|
||||
while (n < this.ordinals.length) {
|
||||
if (n > 0) {
|
||||
((StringBuffer)object).append(',');
|
||||
}
|
||||
((StringBuffer)object).append(((BEnumRange)object2).getDisplayTag(this.ordinals[n], context));
|
||||
++n;
|
||||
}
|
||||
return ((StringBuffer)object).toString();
|
||||
}
|
||||
|
||||
public final void encode(DataOutput dataOutput) throws IOException {
|
||||
dataOutput.writeUTF(this.encodeToString());
|
||||
}
|
||||
|
||||
public final BObject decode(DataInput dataInput) throws IOException {
|
||||
return this.decodeFromString(dataInput.readUTF());
|
||||
}
|
||||
|
||||
public final String encodeToString() throws IOException {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
int n = 0;
|
||||
while (n < this.ordinals.length) {
|
||||
if (n > 0) {
|
||||
stringBuffer.append(',');
|
||||
}
|
||||
stringBuffer.append(this.ordinals[n]);
|
||||
++n;
|
||||
}
|
||||
if (!this.range.isNull()) {
|
||||
stringBuffer.append('@').append(this.range.encodeToString());
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public final BObject decodeFromString(String string) throws IOException {
|
||||
BEnumRange bEnumRange = null;
|
||||
int n = string.indexOf(64);
|
||||
if (n > 0) {
|
||||
bEnumRange = (BEnumRange)BEnumRange.DEFAULT.decodeFromString(string.substring(n + 1));
|
||||
string = string.substring(0, n);
|
||||
}
|
||||
int[] nArray = new int[string.length() / 2 + 1];
|
||||
int n2 = 0;
|
||||
StringTokenizer stringTokenizer = new StringTokenizer(string, ",");
|
||||
while (stringTokenizer.hasMoreTokens()) {
|
||||
nArray[n2++] = Integer.parseInt(stringTokenizer.nextToken());
|
||||
}
|
||||
int[] nArray2 = new int[n2];
|
||||
System.arraycopy(nArray, 0, nArray2, 0, n2);
|
||||
return BEnumSet.make(nArray2, bEnumRange);
|
||||
}
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.hashCode = -1;
|
||||
}
|
||||
|
||||
private BEnumSet(int[] nArray, BEnumRange bEnumRange) {
|
||||
this.this();
|
||||
nArray = (int[])nArray.clone();
|
||||
ArrayUtil.sort(nArray);
|
||||
this.ordinals = nArray;
|
||||
this.range = bEnumRange;
|
||||
}
|
||||
|
||||
static {
|
||||
DEFAULT = NULL = BEnumSet.make(new int[0], BEnumRange.NULL);
|
||||
Class clazz = class$javax$baja$util$BEnumSet;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BEnumSet = BEnumSet.class("[Ljavax.baja.util.BEnumSet;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,279 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.Array
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BSimple;
|
||||
import javax.baja.sys.BajaRuntimeException;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BFacetsMap
|
||||
extends BSimple {
|
||||
public static final BFacetsMap NULL;
|
||||
public static final BFacetsMap DEFAULT;
|
||||
public static final Type TYPE;
|
||||
private String string;
|
||||
private HashMap map;
|
||||
private int hashCode;
|
||||
static /* synthetic */ Class class$javax$baja$util$BFacetsMap;
|
||||
static /* synthetic */ Class class$java$lang$String;
|
||||
|
||||
public static final BFacetsMap make(HashMap hashMap) {
|
||||
if (hashMap.size() == 0) {
|
||||
return NULL;
|
||||
}
|
||||
String string = (String)hashMap.keySet().iterator().next();
|
||||
if (!(hashMap.get(string) instanceof BFacets)) {
|
||||
throw new IllegalStateException("map entry is not a BFacets");
|
||||
}
|
||||
return (BFacetsMap)new BFacetsMap((HashMap)hashMap.clone()).intern();
|
||||
}
|
||||
|
||||
public static final BFacetsMap make(BFacetsMap bFacetsMap, String string, String string2) throws IOException {
|
||||
return BFacetsMap.make(bFacetsMap, string, BFacets.make(string2));
|
||||
}
|
||||
|
||||
public static final BFacetsMap make(BFacetsMap bFacetsMap, String string, BFacets bFacets) {
|
||||
HashMap hashMap = (HashMap)bFacetsMap.map.clone();
|
||||
hashMap.put(string, bFacets);
|
||||
return (BFacetsMap)new BFacetsMap(hashMap).intern();
|
||||
}
|
||||
|
||||
public static final BFacetsMap make(BFacetsMap bFacetsMap, BFacetsMap bFacetsMap2) {
|
||||
HashMap hashMap = (HashMap)bFacetsMap.map.clone();
|
||||
String[] stringArray = bFacetsMap2.list();
|
||||
int n = 0;
|
||||
while (n < stringArray.length) {
|
||||
hashMap.put(stringArray[n], bFacetsMap2.get(stringArray[n]));
|
||||
++n;
|
||||
}
|
||||
return (BFacetsMap)new BFacetsMap(hashMap).intern();
|
||||
}
|
||||
|
||||
public static final BFacetsMap remove(BFacetsMap bFacetsMap, String string) {
|
||||
HashMap hashMap = (HashMap)bFacetsMap.map.clone();
|
||||
hashMap.remove(string);
|
||||
return (BFacetsMap)new BFacetsMap(hashMap).intern();
|
||||
}
|
||||
|
||||
public final String[] list() {
|
||||
return this.map.keySet().toArray(new String[this.map.size()]);
|
||||
}
|
||||
|
||||
public final BFacets get(String string) {
|
||||
BFacets bFacets = (BFacets)this.map.get(string);
|
||||
return bFacets == null ? BFacets.NULL : bFacets;
|
||||
}
|
||||
|
||||
public final boolean isNull() {
|
||||
boolean bl = false;
|
||||
if (this.map.size() == 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
try {
|
||||
if (this.hashCode == -1) {
|
||||
this.hashCode = this.encodeToString().hashCode();
|
||||
}
|
||||
return this.hashCode;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
return System.identityHashCode(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean equals(Object object) {
|
||||
if (object instanceof BFacetsMap) {
|
||||
BFacetsMap bFacetsMap = (BFacetsMap)object;
|
||||
if (this.map.size() != bFacetsMap.map.size()) {
|
||||
return false;
|
||||
}
|
||||
Iterator iterator = this.map.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
String string = (String)iterator.next();
|
||||
BFacets bFacets = (BFacets)this.map.get(string);
|
||||
if (bFacets.equals(bFacetsMap.map.get(string))) continue;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final String toString(Context context) {
|
||||
try {
|
||||
return this.encodeToString();
|
||||
}
|
||||
catch (IOException iOException) {
|
||||
throw new BajaRuntimeException(iOException);
|
||||
}
|
||||
}
|
||||
|
||||
public final void encode(DataOutput dataOutput) throws IOException {
|
||||
dataOutput.writeUTF(this.encodeToString());
|
||||
}
|
||||
|
||||
public final BObject decode(DataInput dataInput) throws IOException {
|
||||
return this.decodeFromString(dataInput.readUTF());
|
||||
}
|
||||
|
||||
public final String encodeToString() throws IOException {
|
||||
if (this.string == null) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append('{');
|
||||
Iterator iterator = this.map.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
String string = (String)iterator.next();
|
||||
BFacets bFacets = (BFacets)this.map.get(string);
|
||||
this.escape(stringBuffer, string);
|
||||
stringBuffer.append('=');
|
||||
this.escape(stringBuffer, bFacets.encodeToString());
|
||||
stringBuffer.append(';');
|
||||
}
|
||||
stringBuffer.append('}');
|
||||
this.string = stringBuffer.toString();
|
||||
}
|
||||
return this.string;
|
||||
}
|
||||
|
||||
public final BObject decodeFromString(String string) throws IOException {
|
||||
try {
|
||||
int n;
|
||||
int n2 = string.indexOf(123);
|
||||
int n3 = string.lastIndexOf(125);
|
||||
if (n2 + 1 == n3) {
|
||||
return NULL;
|
||||
}
|
||||
String string2 = string.substring(n2 + 1, n3);
|
||||
Class clazz = class$java$lang$String;
|
||||
if (clazz == null) {
|
||||
clazz = class$java$lang$String = BFacetsMap.class("[Ljava.lang.String;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
int n4 = string2.length();
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
int n5 = -1;
|
||||
int n6 = 0;
|
||||
while (n6 < n4) {
|
||||
n = string2.charAt(n6);
|
||||
if (n == 92) {
|
||||
stringBuffer.append(string2.charAt(++n6));
|
||||
} else if (n != 61 && n != 59) {
|
||||
stringBuffer.append((char)n);
|
||||
} else {
|
||||
if (n == n5) {
|
||||
throw new Exception();
|
||||
}
|
||||
n5 = n;
|
||||
array.add((Object)stringBuffer.toString());
|
||||
stringBuffer.setLength(0);
|
||||
}
|
||||
++n6;
|
||||
}
|
||||
HashMap<String, BFacets> hashMap = new HashMap<String, BFacets>();
|
||||
n = 0;
|
||||
while (n < array.size()) {
|
||||
String string3 = (String)array.get(n);
|
||||
BFacets bFacets = BFacets.make((String)array.get(n + '\u0001'));
|
||||
hashMap.put(string3, bFacets);
|
||||
n += 2;
|
||||
}
|
||||
BFacetsMap bFacetsMap = (BFacetsMap)new BFacetsMap(hashMap).intern();
|
||||
bFacetsMap.string = string;
|
||||
return bFacetsMap;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
throw new IOException("Invalid BFacetsMap: " + string);
|
||||
}
|
||||
}
|
||||
|
||||
private final void escape(StringBuffer stringBuffer, String string) {
|
||||
int n = string.length();
|
||||
int n2 = 0;
|
||||
while (n2 < n) {
|
||||
char c = string.charAt(n2);
|
||||
switch (c) {
|
||||
case '\\': {
|
||||
stringBuffer.append("\\\\");
|
||||
break;
|
||||
}
|
||||
case '{': {
|
||||
stringBuffer.append("\\{");
|
||||
break;
|
||||
}
|
||||
case '}': {
|
||||
stringBuffer.append("\\}");
|
||||
break;
|
||||
}
|
||||
case '=': {
|
||||
stringBuffer.append("\\=");
|
||||
break;
|
||||
}
|
||||
case ';': {
|
||||
stringBuffer.append("\\;");
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
stringBuffer.append(c);
|
||||
}
|
||||
}
|
||||
++n2;
|
||||
}
|
||||
}
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.hashCode = -1;
|
||||
}
|
||||
|
||||
private BFacetsMap(HashMap hashMap) {
|
||||
this.this();
|
||||
this.map = hashMap;
|
||||
}
|
||||
|
||||
static {
|
||||
DEFAULT = NULL = new BFacetsMap(new HashMap());
|
||||
Class clazz = class$javax$baja$util$BFacetsMap;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BFacetsMap = BFacetsMap.class("[Ljavax.baja.util.BFacetsMap;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BFolder
|
||||
extends BComponent {
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
static /* synthetic */ Class class$javax$baja$util$BFolder;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
BValue bValue = this.get("icon");
|
||||
if (bValue instanceof BIcon) {
|
||||
return (BIcon)bValue;
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BFolder;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BFolder = BFolder.class("[Ljavax.baja.util.BFolder;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
icon = BIcon.std("folder.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,745 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.TextUtil
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import com.tridium.util.EscUtil;
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import javax.baja.io.BIEncodable;
|
||||
import javax.baja.naming.SlotPath;
|
||||
import javax.baja.nre.util.TextUtil;
|
||||
import javax.baja.security.BIProtected;
|
||||
import javax.baja.security.BPassword;
|
||||
import javax.baja.security.BPermissions;
|
||||
import javax.baja.status.BStatus;
|
||||
import javax.baja.status.BStatusNumeric;
|
||||
import javax.baja.sys.BComplex;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BDouble;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BSimple;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.BajaRuntimeException;
|
||||
import javax.baja.sys.BasicContext;
|
||||
import javax.baja.sys.Clock;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Flags;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Slot;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BIFormatPropertyHandler;
|
||||
import javax.baja.util.Lexicon;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BFormat
|
||||
extends BSimple {
|
||||
public static final BFormat DEFAULT = new BFormat("");
|
||||
public static final Type TYPE;
|
||||
static final Class[] paramNone;
|
||||
static final Class[] paramContext;
|
||||
static final Class[] paramString;
|
||||
String format;
|
||||
Object[] segments;
|
||||
private int hashCode;
|
||||
static /* synthetic */ Class class$javax$baja$util$BFormat;
|
||||
static /* synthetic */ Class class$javax$baja$sys$Context;
|
||||
static /* synthetic */ Class class$java$lang$String;
|
||||
|
||||
public static final String format(String string, Object object) {
|
||||
return BFormat.make(string).format(object, null);
|
||||
}
|
||||
|
||||
public static final String format(String string, Object object, Context context) {
|
||||
return BFormat.make(string).format(object, context);
|
||||
}
|
||||
|
||||
public static final String getEncodedPattern(BIEncodable bIEncodable) throws IOException {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("%decodeFromString(");
|
||||
stringBuffer.append(bIEncodable.getType().getModule().getModuleName());
|
||||
stringBuffer.append(':');
|
||||
stringBuffer.append(bIEncodable.getType().getTypeName());
|
||||
stringBuffer.append(':');
|
||||
stringBuffer.append(SlotPath.escape(bIEncodable.encodeToString()));
|
||||
stringBuffer.append(")%");
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public static final String getLexiconPattern(String string, String string2, String[] stringArray) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("%lexicon(");
|
||||
stringBuffer.append(string);
|
||||
stringBuffer.append(':');
|
||||
stringBuffer.append(string2);
|
||||
if (stringArray != null) {
|
||||
int n = 0;
|
||||
while (n < stringArray.length) {
|
||||
stringBuffer.append(':');
|
||||
stringBuffer.append(SlotPath.escape(stringArray[n]));
|
||||
++n;
|
||||
}
|
||||
}
|
||||
stringBuffer.append(")%");
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public static final BFormat make(String string) {
|
||||
if (string.length() == 0) {
|
||||
return DEFAULT;
|
||||
}
|
||||
return (BFormat)new BFormat(string).intern();
|
||||
}
|
||||
|
||||
public final String getFormat() {
|
||||
return this.format;
|
||||
}
|
||||
|
||||
public final String format(Object object) {
|
||||
return this.format(object, null);
|
||||
}
|
||||
|
||||
public final String format(Object object, Context context) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
Object[] objectArray = this.parse();
|
||||
int n = 0;
|
||||
while (n < objectArray.length) {
|
||||
Object object2 = objectArray[n];
|
||||
if (object2 instanceof String) {
|
||||
stringBuffer.append(object2);
|
||||
} else {
|
||||
Call call = (Call)object2;
|
||||
try {
|
||||
stringBuffer.append(call.eval(object, object, context));
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
throwable.printStackTrace();
|
||||
stringBuffer.append(call.toErrorString(object, object, context));
|
||||
}
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
protected static final Object[] parse(String string) {
|
||||
try {
|
||||
ArrayList<Object> arrayList = new ArrayList<Object>();
|
||||
int n = string.length();
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
int n2 = 0;
|
||||
while (n2 < n) {
|
||||
char c = string.charAt(n2);
|
||||
if (c != '%') {
|
||||
stringBuffer.append(c);
|
||||
} else if ((c = string.charAt(++n2)) == '%') {
|
||||
stringBuffer.append('%');
|
||||
} else {
|
||||
String string2 = stringBuffer.toString();
|
||||
if (string2.length() > 0) {
|
||||
arrayList.add(string2);
|
||||
}
|
||||
stringBuffer.setLength(0);
|
||||
Call call = null;
|
||||
Call call2 = null;
|
||||
int n3 = -1;
|
||||
int n4 = 0;
|
||||
while (n4 > 0 || string.charAt(n2) != '%' && string.charAt(n2) != '?') {
|
||||
if ((c = string.charAt(n2++)) == '(') {
|
||||
if (n3 < 0) {
|
||||
n3 = stringBuffer.length();
|
||||
}
|
||||
++n4;
|
||||
}
|
||||
if (c == ')') {
|
||||
--n4;
|
||||
}
|
||||
if (c != '.' || n4 > 0) {
|
||||
stringBuffer.append(c);
|
||||
continue;
|
||||
}
|
||||
call2 = BFormat.parseCall(call2, stringBuffer.toString(), n3);
|
||||
if (call == null) {
|
||||
call = call2;
|
||||
}
|
||||
stringBuffer.setLength(0);
|
||||
n3 = -1;
|
||||
}
|
||||
call2 = BFormat.parseCall(call2, stringBuffer.toString(), n3);
|
||||
if (call == null) {
|
||||
call = call2;
|
||||
}
|
||||
stringBuffer.setLength(0);
|
||||
if (string.charAt(n2) == '?') {
|
||||
Call call3 = null;
|
||||
Call call4 = null;
|
||||
n3 = -1;
|
||||
n4 = 0;
|
||||
stringBuffer.setLength(0);
|
||||
++n2;
|
||||
while (n4 > 0 || string.charAt(n2) != '%') {
|
||||
if ((c = string.charAt(n2++)) == '(') {
|
||||
if (n3 < 0) {
|
||||
n3 = stringBuffer.length();
|
||||
}
|
||||
++n4;
|
||||
}
|
||||
if (c == ')') {
|
||||
--n4;
|
||||
}
|
||||
if (c != '.' || n4 > 0) {
|
||||
stringBuffer.append(c);
|
||||
continue;
|
||||
}
|
||||
call4 = BFormat.parseCall(call4, stringBuffer.toString(), n3);
|
||||
if (call3 == null) {
|
||||
call3 = call4;
|
||||
}
|
||||
stringBuffer.setLength(0);
|
||||
n3 = -1;
|
||||
}
|
||||
call4 = BFormat.parseCall(call4, stringBuffer.toString(), n3);
|
||||
if (call3 == null) {
|
||||
call3 = call4;
|
||||
}
|
||||
stringBuffer.setLength(0);
|
||||
call.error = call3;
|
||||
Call call5 = call;
|
||||
while (call5 != call2) {
|
||||
call5 = call5.next;
|
||||
call5.error = call.error;
|
||||
}
|
||||
}
|
||||
arrayList.add(call);
|
||||
}
|
||||
++n2;
|
||||
}
|
||||
String string3 = stringBuffer.toString();
|
||||
if (string3.length() > 0) {
|
||||
arrayList.add(string3);
|
||||
}
|
||||
return arrayList.toArray();
|
||||
}
|
||||
catch (Exception exception) {
|
||||
return new Object[]{"ERROR " + string};
|
||||
}
|
||||
}
|
||||
|
||||
final Object[] parse() {
|
||||
if (this.segments == null) {
|
||||
this.segments = BFormat.parse(this.format);
|
||||
}
|
||||
return this.segments;
|
||||
}
|
||||
|
||||
static final Call parseCall(Call call, String string, int n) throws IOException {
|
||||
if (string.length() == 0) {
|
||||
return new IdentityCall(call, string);
|
||||
}
|
||||
if (n > 0) {
|
||||
if (string.equals("time()")) {
|
||||
return new TimeCall(call, string);
|
||||
}
|
||||
if (string.equals("user()")) {
|
||||
return new UserCall(call, string);
|
||||
}
|
||||
if (string.equals("sys()")) {
|
||||
return new SysCall(call, string);
|
||||
}
|
||||
if (string.startsWith("escape(")) {
|
||||
return new EscapeCall(call, string);
|
||||
}
|
||||
if (string.startsWith("unescape(")) {
|
||||
return new UnescapeCall(call, string);
|
||||
}
|
||||
String string2 = string.substring(n + 1, string.length() - 1);
|
||||
if (string.startsWith("lexicon(")) {
|
||||
return new LexiconCall(call, string, string2);
|
||||
}
|
||||
if (string.startsWith("substring(")) {
|
||||
return new SubstringCall(call, string, string2);
|
||||
}
|
||||
if (string.startsWith("decodeFromString(")) {
|
||||
return new DecodeFromStringCall(call, string, string2);
|
||||
}
|
||||
}
|
||||
return new ReflectCall(call, string);
|
||||
}
|
||||
|
||||
public final void dump() {
|
||||
System.out.println("BFormat: " + this.format);
|
||||
int n = 0;
|
||||
while (n < this.parse().length) {
|
||||
Object object = this.segments[n];
|
||||
if (object instanceof String) {
|
||||
System.out.println(" [" + n + "] \"" + object + '\"');
|
||||
} else if (object instanceof Call) {
|
||||
System.out.println(" [" + n + "] " + object + ' ' + TextUtil.getClassName(object.getClass()));
|
||||
Call call = (Call)object;
|
||||
if (call.error != null) {
|
||||
System.out.println(" - err: " + object + ' ' + TextUtil.getClassName(object.getClass()));
|
||||
}
|
||||
} else {
|
||||
System.out.println(" [" + n + "] " + object + ' ' + TextUtil.getClassName(object.getClass()));
|
||||
}
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
public static final void main(String[] stringArray) throws Exception {
|
||||
new BFormat(stringArray[0]).dump();
|
||||
BStatusNumeric bStatusNumeric = new BStatusNumeric();
|
||||
bStatusNumeric.setStatus(BStatus.make(0, BFacets.make("min", BDouble.make(33.0))));
|
||||
System.out.println(BFormat.format(stringArray[0], bStatusNumeric));
|
||||
}
|
||||
|
||||
private static final boolean hasPermission(BComplex bComplex, Slot slot, Context context) {
|
||||
if (!bComplex.getType().is(BIProtected.TYPE)) {
|
||||
return true;
|
||||
}
|
||||
BPermissions bPermissions = ((BIProtected)((Object)bComplex)).getPermissions(context);
|
||||
if (slot == null) {
|
||||
return bPermissions.hasOperatorRead();
|
||||
}
|
||||
if (Flags.isOperator(bComplex, slot)) {
|
||||
if (slot.isAction()) {
|
||||
return bPermissions.hasOperatorInvoke();
|
||||
}
|
||||
boolean bl = false;
|
||||
if (bPermissions.hasOperatorRead() && BFormat.checkProtectedSlot(bComplex, slot, context)) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
if (slot.isAction()) {
|
||||
return bPermissions.hasAdminInvoke();
|
||||
}
|
||||
boolean bl = false;
|
||||
if (bPermissions.hasAdminRead() && BFormat.checkProtectedSlot(bComplex, slot, context)) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
private static final boolean checkProtectedSlot(BComplex bComplex, Slot slot, Context context) {
|
||||
BValue bValue;
|
||||
if (slot.isProperty() && (bValue = bComplex.get((Property)slot)).getType().is(BIProtected.TYPE)) {
|
||||
BPermissions bPermissions = ((BIProtected)((Object)bValue)).getPermissions(context);
|
||||
return bPermissions.hasOperatorRead();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static final Object reflect(Object object, String string, Class[] classArray, Object object2) throws Throwable {
|
||||
try {
|
||||
Object[] objectArray;
|
||||
Method method = object.getClass().getMethod(string, classArray);
|
||||
if (method.getReturnType().equals(Void.TYPE)) {
|
||||
return null;
|
||||
}
|
||||
if (classArray.length == 0) {
|
||||
objectArray = null;
|
||||
} else {
|
||||
Object[] objectArray2 = new Object[1];
|
||||
objectArray = objectArray2;
|
||||
objectArray2[0] = object2;
|
||||
}
|
||||
Object[] objectArray3 = objectArray;
|
||||
return method.invoke(object, objectArray3);
|
||||
}
|
||||
catch (NoSuchMethodException noSuchMethodException) {
|
||||
return null;
|
||||
}
|
||||
catch (InvocationTargetException invocationTargetException) {
|
||||
throw invocationTargetException.getTargetException();
|
||||
}
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
try {
|
||||
if (this.hashCode == -1) {
|
||||
this.hashCode = this.encodeToString().hashCode();
|
||||
}
|
||||
return this.hashCode;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
return System.identityHashCode(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean equals(Object object) {
|
||||
if (object instanceof BFormat) {
|
||||
BFormat bFormat = (BFormat)object;
|
||||
return this.format.equals(bFormat.format);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final void encode(DataOutput dataOutput) throws IOException {
|
||||
dataOutput.writeUTF(this.format);
|
||||
}
|
||||
|
||||
public final BObject decode(DataInput dataInput) throws IOException {
|
||||
return BFormat.make(dataInput.readUTF());
|
||||
}
|
||||
|
||||
public final String encodeToString() throws IOException {
|
||||
return this.format;
|
||||
}
|
||||
|
||||
public final BObject decodeFromString(String string) throws IOException {
|
||||
return BFormat.make(string);
|
||||
}
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.hashCode = -1;
|
||||
}
|
||||
|
||||
private BFormat(String string) {
|
||||
this.this();
|
||||
this.format = string;
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BFormat;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BFormat = BFormat.class("[Ljavax.baja.util.BFormat;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
paramNone = new Class[0];
|
||||
Class[] classArray = new Class[1];
|
||||
Class clazz2 = class$javax$baja$sys$Context;
|
||||
if (clazz2 == null) {
|
||||
clazz2 = class$javax$baja$sys$Context = BFormat.class("[Ljavax.baja.sys.Context;", false);
|
||||
}
|
||||
classArray[0] = clazz2;
|
||||
paramContext = classArray;
|
||||
Class[] classArray2 = new Class[1];
|
||||
Class clazz3 = class$java$lang$String;
|
||||
if (clazz3 == null) {
|
||||
clazz3 = class$java$lang$String = BFormat.class("[Ljava.lang.String;", false);
|
||||
}
|
||||
classArray2[0] = clazz3;
|
||||
paramString = classArray2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
static abstract class Call {
|
||||
String id;
|
||||
Call next;
|
||||
Call error;
|
||||
|
||||
public final String toString() {
|
||||
if (this.next == null) {
|
||||
return this.id;
|
||||
}
|
||||
return this.id + '.' + this.next;
|
||||
}
|
||||
|
||||
String toString(Object object, Context context) {
|
||||
if (object instanceof BObject) {
|
||||
return ((BObject)object).toString(context);
|
||||
}
|
||||
return String.valueOf(object);
|
||||
}
|
||||
|
||||
String toErrorString(Object object, Object object2, Context context) {
|
||||
if (this.error != null) {
|
||||
try {
|
||||
return this.error.eval(object2, object2, context).toString();
|
||||
}
|
||||
catch (Throwable throwable) {}
|
||||
}
|
||||
String string = object == null ? "null" : (object instanceof BObject ? ((BObject)object).getType().toString() : TextUtil.getClassName(object.getClass()));
|
||||
return "%err:" + string + ':' + this.id + '%';
|
||||
}
|
||||
|
||||
abstract Object eval(Object var1, Object var2, Context var3) throws Throwable;
|
||||
|
||||
final Object chain(Object object, Object object2, Context context) throws Throwable {
|
||||
if (this.next != null) {
|
||||
return this.next.eval(object, object2, context);
|
||||
}
|
||||
return this.toString(object, context);
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.error = null;
|
||||
}
|
||||
|
||||
Call(Call call, String string) {
|
||||
this.this();
|
||||
if (call != null) {
|
||||
call.next = this;
|
||||
}
|
||||
this.id = string;
|
||||
}
|
||||
}
|
||||
|
||||
static class IdentityCall
|
||||
extends Call {
|
||||
Object eval(Object object, Object object2, Context context) throws Throwable {
|
||||
if (object instanceof BObject) {
|
||||
return ((BObject)object).toString(context);
|
||||
}
|
||||
return object;
|
||||
}
|
||||
|
||||
IdentityCall(Call call, String string) {
|
||||
super(call, string);
|
||||
}
|
||||
}
|
||||
|
||||
static class TimeCall
|
||||
extends Call {
|
||||
Object eval(Object object, Object object2, Context context) throws Throwable {
|
||||
return this.chain(Clock.time(), object2, context);
|
||||
}
|
||||
|
||||
TimeCall(Call call, String string) {
|
||||
super(call, string);
|
||||
}
|
||||
}
|
||||
|
||||
static class UserCall
|
||||
extends Call {
|
||||
Object eval(Object object, Object object2, Context context) throws Throwable {
|
||||
if (object instanceof BComponent) {
|
||||
String string;
|
||||
BComponent bComponent = (BComponent)object;
|
||||
Context context2 = bComponent.getSession().getSessionContext();
|
||||
if (context2 != null) {
|
||||
string = ((BFacets)context2).gets("username", null);
|
||||
} else if (context.getUser() != null) {
|
||||
string = context.getUser().getUsername();
|
||||
} else {
|
||||
throw new BajaRuntimeException("Username unavailable");
|
||||
}
|
||||
if (string != null && string.length() > 0) {
|
||||
return this.chain(string, object2, context);
|
||||
}
|
||||
}
|
||||
return this.chain(null, object2, context);
|
||||
}
|
||||
|
||||
UserCall(Call call, String string) {
|
||||
super(call, string);
|
||||
}
|
||||
}
|
||||
|
||||
static class SysCall
|
||||
extends Call {
|
||||
Object eval(Object object, Object object2, Context context) throws Throwable {
|
||||
return this.chain(new Sys(), object2, context);
|
||||
}
|
||||
|
||||
SysCall(Call call, String string) {
|
||||
super(call, string);
|
||||
}
|
||||
}
|
||||
|
||||
static class EscapeCall
|
||||
extends Call {
|
||||
Object eval(Object object, Object object2, Context context) {
|
||||
return EscUtil.slot.escape(this.toString(object, context));
|
||||
}
|
||||
|
||||
EscapeCall(Call call, String string) throws IOException {
|
||||
super(call, string);
|
||||
}
|
||||
}
|
||||
|
||||
static class UnescapeCall
|
||||
extends Call {
|
||||
String str;
|
||||
|
||||
Object eval(Object object, Object object2, Context context) {
|
||||
return EscUtil.slot.unescape(this.toString(object, context));
|
||||
}
|
||||
|
||||
UnescapeCall(Call call, String string) throws IOException {
|
||||
super(call, string);
|
||||
}
|
||||
}
|
||||
|
||||
static class LexiconCall
|
||||
extends Call {
|
||||
String module;
|
||||
String key;
|
||||
String[] argFormats;
|
||||
|
||||
Object eval(Object object, Object object2, Context context) throws Throwable {
|
||||
if (this.argFormats == null) {
|
||||
return this.chain(Lexicon.make(this.module, context).getText(this.key, new Object[]{object}), object2, context);
|
||||
}
|
||||
Object[] objectArray = new String[this.argFormats.length];
|
||||
int n = 0;
|
||||
while (n < objectArray.length) {
|
||||
objectArray[n] = BFormat.format(SlotPath.unescape(this.argFormats[n]), object, context);
|
||||
++n;
|
||||
}
|
||||
return this.chain(Lexicon.make(this.module, context).getText(this.key, objectArray), object2, context);
|
||||
}
|
||||
|
||||
LexiconCall(Call call, String string, String string2) {
|
||||
super(call, string);
|
||||
int n = string2.indexOf(58);
|
||||
this.module = string2.substring(0, n);
|
||||
string2 = string2.substring(n + 1);
|
||||
n = string2.indexOf(58);
|
||||
if (n >= 0) {
|
||||
this.key = string2.substring(0, n);
|
||||
this.argFormats = TextUtil.split((String)string2.substring(n + 1), (char)':');
|
||||
} else {
|
||||
this.key = string2;
|
||||
this.argFormats = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static class SubstringCall
|
||||
extends Call {
|
||||
String[] args;
|
||||
|
||||
Object eval(Object object, Object object2, Context context) throws Throwable {
|
||||
int n;
|
||||
String string = this.toString(object, context);
|
||||
string = this.args.length == 1 ? ((n = Integer.parseInt(this.args[0])) >= 0 ? string.substring(n) : string.substring(string.length() + n, string.length())) : string.substring(Integer.parseInt(this.args[0]), Integer.parseInt(this.args[1]));
|
||||
return this.chain(string, object2, context);
|
||||
}
|
||||
|
||||
SubstringCall(Call call, String string, String string2) {
|
||||
super(call, string);
|
||||
this.args = TextUtil.splitAndTrim((String)string2, (char)',');
|
||||
}
|
||||
}
|
||||
|
||||
static class DecodeFromStringCall
|
||||
extends Call {
|
||||
BObject obj;
|
||||
|
||||
Object eval(Object object, Object object2, Context context) {
|
||||
return this.obj;
|
||||
}
|
||||
|
||||
DecodeFromStringCall(Call call, String string, String string2) throws IOException {
|
||||
super(call, string);
|
||||
int n = string2.indexOf(58);
|
||||
String string3 = string2.substring(0, n);
|
||||
string2 = string2.substring(n + 1);
|
||||
n = string2.indexOf(58);
|
||||
String string4 = string2.substring(0, n);
|
||||
BIEncodable bIEncodable = (BIEncodable)((Object)Sys.getType(string3 + ':' + string4).getInstance());
|
||||
this.obj = bIEncodable.decodeFromString(SlotPath.unescape(string2.substring(n + 1)));
|
||||
}
|
||||
}
|
||||
|
||||
static class ReflectCall
|
||||
extends Call {
|
||||
Object eval(Object object, Object object2, Context context) throws Throwable {
|
||||
Object object3;
|
||||
Object object4;
|
||||
if (object instanceof BComplex) {
|
||||
object4 = (BComplex)object;
|
||||
if (!BFormat.hasPermission((BComplex)object4, null, context)) {
|
||||
return this.toErrorString(object, object2, context);
|
||||
}
|
||||
object3 = null;
|
||||
if (object instanceof BIFormatPropertyHandler) {
|
||||
object3 = ((BIFormatPropertyHandler)object).getFormatPropertyByName(this.id);
|
||||
}
|
||||
if (object3 == null) {
|
||||
object3 = ((BComplex)object4).getProperty(this.id);
|
||||
}
|
||||
if (object3 == null) {
|
||||
Slot slot;
|
||||
String string = null;
|
||||
if (this.id.startsWith("get")) {
|
||||
string = TextUtil.decapitalize((String)this.id.substring(3));
|
||||
} else if (this.id.startsWith("do")) {
|
||||
string = TextUtil.decapitalize((String)this.id.substring(2));
|
||||
} else if (this.id.startsWith("fire")) {
|
||||
string = TextUtil.decapitalize((String)this.id.substring(4));
|
||||
}
|
||||
if (string != null && (slot = ((BComplex)object4).getSlot(string)) != null && slot.isFrozen() && !BFormat.hasPermission((BComplex)object4, slot, context)) {
|
||||
return this.toErrorString(object, object2, context);
|
||||
}
|
||||
}
|
||||
if (object3 != null) {
|
||||
if (!BFormat.hasPermission((BComplex)object4, (Slot)object3, context)) {
|
||||
return this.toErrorString(object, object2, context);
|
||||
}
|
||||
context = new BasicContext(context, ((BComplex)object4).getSlotFacets((Slot)object3));
|
||||
if (this.next == null) {
|
||||
return ((BComplex)object4).get((Property)object3).toString(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
object4 = "get" + TextUtil.capitalize((String)this.id);
|
||||
object3 = null;
|
||||
if (object instanceof BPassword) {
|
||||
return this.toErrorString(object, object2, context);
|
||||
}
|
||||
object3 = BFormat.reflect(object, (String)object4, paramContext, context);
|
||||
if (object3 != null) {
|
||||
return this.chain(object3, object2, context);
|
||||
}
|
||||
object3 = BFormat.reflect(object, (String)object4, paramNone, null);
|
||||
if (object3 != null) {
|
||||
return this.chain(object3, object2, context);
|
||||
}
|
||||
object3 = BFormat.reflect(object, this.id, paramContext, context);
|
||||
if (object3 != null) {
|
||||
return this.chain(object3, object2, context);
|
||||
}
|
||||
object3 = BFormat.reflect(object, this.id, paramNone, null);
|
||||
if (object3 != null) {
|
||||
return this.chain(object3, object2, context);
|
||||
}
|
||||
object3 = BFormat.reflect(object, "get", paramString, this.id);
|
||||
if (object3 != null) {
|
||||
return this.chain(object3, object2, context);
|
||||
}
|
||||
object3 = BFormat.reflect(object, "getFormatValue", paramString, this.id);
|
||||
if (object3 != null) {
|
||||
return this.chain(object3, object2, context);
|
||||
}
|
||||
return this.toErrorString(object, object2, context);
|
||||
}
|
||||
|
||||
ReflectCall(Call call, String string) {
|
||||
super(call, string);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BInterface;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
public interface BIFormatPropertyHandler
|
||||
extends BInterface {
|
||||
public static final Type TYPE;
|
||||
|
||||
public Property getFormatPropertyByName(String var1);
|
||||
|
||||
static {
|
||||
Class clazz = 1.class$javax$baja$util$BIFormatPropertyHandler;
|
||||
if (clazz == null) {
|
||||
clazz = 1.class$javax$baja$util$BIFormatPropertyHandler = 1.class("[Ljavax.baja.util.BIFormatPropertyHandler;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BInterface;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.CannotValidateException;
|
||||
|
||||
public interface BIValidator
|
||||
extends BInterface {
|
||||
public static final String VALIDATOR_FACET = "validator";
|
||||
public static final Type TYPE;
|
||||
|
||||
public void validate(BObject var1, Context var2) throws CannotValidateException;
|
||||
|
||||
static {
|
||||
Class clazz = 1.class$javax$baja$util$BIValidator;
|
||||
if (clazz == null) {
|
||||
clazz = 1.class$javax$baja$util$BIValidator = 1.class("[Ljavax.baja.util.BIValidator;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.StringTokenizer;
|
||||
import javax.baja.naming.SlotPath;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BSimple;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.IllegalNameException;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BNameList
|
||||
extends BSimple {
|
||||
public static final BNameList NULL;
|
||||
public static final BNameList DEFAULT;
|
||||
public static final Type TYPE;
|
||||
private String string;
|
||||
private String[] names;
|
||||
private int hashCode;
|
||||
static /* synthetic */ Class class$javax$baja$util$BNameList;
|
||||
|
||||
public static final BNameList make(String string) {
|
||||
return BNameList.make(new String[]{string});
|
||||
}
|
||||
|
||||
public static final BNameList make(String[] stringArray) {
|
||||
if (stringArray.length == 0) {
|
||||
return NULL;
|
||||
}
|
||||
String[] stringArray2 = new String[stringArray.length];
|
||||
int n = 0;
|
||||
while (n < stringArray.length) {
|
||||
String string = stringArray2[n] = stringArray[n];
|
||||
SlotPath.verifyValidName(string);
|
||||
++n;
|
||||
}
|
||||
return (BNameList)new BNameList(stringArray2).intern();
|
||||
}
|
||||
|
||||
public static final BNameList union(BNameList bNameList, BNameList bNameList2) {
|
||||
if (bNameList.isNull()) {
|
||||
return bNameList2;
|
||||
}
|
||||
if (bNameList2.isNull()) {
|
||||
return bNameList;
|
||||
}
|
||||
HashMap<String, String> hashMap = new HashMap<String, String>();
|
||||
String[] stringArray = bNameList.names;
|
||||
String[] stringArray2 = bNameList2.names;
|
||||
int n = 0;
|
||||
while (n < stringArray.length) {
|
||||
hashMap.put(stringArray[n], stringArray[n]);
|
||||
++n;
|
||||
}
|
||||
n = 0;
|
||||
while (n < stringArray2.length) {
|
||||
hashMap.put(stringArray2[n], stringArray2[n]);
|
||||
++n;
|
||||
}
|
||||
String[] stringArray3 = hashMap.values().toArray(new String[hashMap.size()]);
|
||||
return (BNameList)new BNameList(stringArray3).intern();
|
||||
}
|
||||
|
||||
public static final BNameList intersection(BNameList bNameList, BNameList bNameList2) {
|
||||
if (bNameList.isNull()) {
|
||||
return NULL;
|
||||
}
|
||||
if (bNameList2.isNull()) {
|
||||
return NULL;
|
||||
}
|
||||
ArrayList<String> arrayList = new ArrayList<String>();
|
||||
String[] stringArray = bNameList.names;
|
||||
int n = 0;
|
||||
while (n < stringArray.length) {
|
||||
if (bNameList2.contains(stringArray[n])) {
|
||||
arrayList.add(stringArray[n]);
|
||||
}
|
||||
++n;
|
||||
}
|
||||
String[] stringArray2 = arrayList.toArray(new String[arrayList.size()]);
|
||||
return (BNameList)new BNameList(stringArray2).intern();
|
||||
}
|
||||
|
||||
public static final BNameList difference(BNameList bNameList, BNameList bNameList2) {
|
||||
if (bNameList.isNull()) {
|
||||
return NULL;
|
||||
}
|
||||
if (bNameList2.isNull()) {
|
||||
return bNameList;
|
||||
}
|
||||
HashSet<String> hashSet = new HashSet<String>(bNameList2.names.length);
|
||||
int n = 0;
|
||||
while (n < bNameList2.names.length) {
|
||||
hashSet.add(bNameList2.names[n]);
|
||||
++n;
|
||||
}
|
||||
ArrayList<String> arrayList = new ArrayList<String>();
|
||||
int n2 = 0;
|
||||
while (n2 < bNameList.names.length) {
|
||||
if (!hashSet.contains(bNameList.names[n2])) {
|
||||
arrayList.add(bNameList.names[n2]);
|
||||
}
|
||||
++n2;
|
||||
}
|
||||
return (BNameList)new BNameList(arrayList.toArray(new String[arrayList.size()])).intern();
|
||||
}
|
||||
|
||||
public final String[] getNames() {
|
||||
String[] stringArray = new String[this.names.length];
|
||||
System.arraycopy(this.names, 0, stringArray, 0, stringArray.length);
|
||||
return stringArray;
|
||||
}
|
||||
|
||||
public final boolean contains(String string) {
|
||||
String[] stringArray = this.names;
|
||||
int n = 0;
|
||||
while (n < stringArray.length) {
|
||||
if (stringArray[n].equals(string)) {
|
||||
return true;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final boolean isNull() {
|
||||
boolean bl = false;
|
||||
if (this.names.length == 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
try {
|
||||
if (this.hashCode == -1) {
|
||||
this.hashCode = this.encodeToString().hashCode();
|
||||
}
|
||||
return this.hashCode;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
return System.identityHashCode(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean equals(Object object) {
|
||||
if (object instanceof BNameList) {
|
||||
BNameList bNameList = (BNameList)object;
|
||||
if (this.names.length != bNameList.names.length) {
|
||||
return false;
|
||||
}
|
||||
int n = 0;
|
||||
while (n < this.names.length) {
|
||||
if (!bNameList.contains(this.names[n])) {
|
||||
return false;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final String toString(Context context) {
|
||||
return this.encodeToString();
|
||||
}
|
||||
|
||||
public final void encode(DataOutput dataOutput) throws IOException {
|
||||
dataOutput.writeUTF(this.encodeToString());
|
||||
}
|
||||
|
||||
public final BObject decode(DataInput dataInput) throws IOException {
|
||||
return this.decodeFromString(dataInput.readUTF());
|
||||
}
|
||||
|
||||
public final String encodeToString() {
|
||||
if (this.string == null) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
int n = 0;
|
||||
while (n < this.names.length) {
|
||||
if (n > 0) {
|
||||
stringBuffer.append(';');
|
||||
}
|
||||
stringBuffer.append(this.names[n]);
|
||||
++n;
|
||||
}
|
||||
this.string = stringBuffer.toString();
|
||||
}
|
||||
return this.string;
|
||||
}
|
||||
|
||||
public final BObject decodeFromString(String string) throws IOException {
|
||||
try {
|
||||
Object object;
|
||||
ArrayList<String> arrayList = new ArrayList<String>();
|
||||
StringTokenizer stringTokenizer = new StringTokenizer(string, ";");
|
||||
while (stringTokenizer.hasMoreTokens()) {
|
||||
object = stringTokenizer.nextToken().trim();
|
||||
SlotPath.verifyValidName((String)object);
|
||||
arrayList.add((String)object);
|
||||
}
|
||||
object = (BNameList)new BNameList(arrayList.toArray(new String[arrayList.size()])).intern();
|
||||
((BNameList)object).string = string;
|
||||
return object;
|
||||
}
|
||||
catch (IllegalNameException illegalNameException) {
|
||||
throw illegalNameException;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new IOException("Invalid BNameList: " + string);
|
||||
}
|
||||
}
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.hashCode = -1;
|
||||
}
|
||||
|
||||
private BNameList(String[] stringArray) {
|
||||
this.this();
|
||||
this.names = stringArray;
|
||||
}
|
||||
|
||||
static {
|
||||
DEFAULT = NULL = new BNameList(new String[0]);
|
||||
Class clazz = class$javax$baja$util$BNameList;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BNameList = BNameList.class("[Ljavax.baja.util.BNameList;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,269 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.Array
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BSimple;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BFormat;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BNameMap
|
||||
extends BSimple {
|
||||
public static final BNameMap NULL;
|
||||
public static final BNameMap DEFAULT;
|
||||
public static final Type TYPE;
|
||||
private String string;
|
||||
private HashMap map;
|
||||
private int hashCode;
|
||||
static /* synthetic */ Class class$javax$baja$util$BNameMap;
|
||||
static /* synthetic */ Class class$java$lang$String;
|
||||
|
||||
public static final BNameMap make(HashMap hashMap) {
|
||||
if (hashMap.size() == 0) {
|
||||
return NULL;
|
||||
}
|
||||
String string = (String)hashMap.keySet().iterator().next();
|
||||
BFormat bFormat = (BFormat)hashMap.get(string);
|
||||
return (BNameMap)new BNameMap((HashMap)hashMap.clone()).intern();
|
||||
}
|
||||
|
||||
public static final BNameMap make(BNameMap bNameMap, String string, String string2) {
|
||||
return BNameMap.make(bNameMap, string, BFormat.make(string2));
|
||||
}
|
||||
|
||||
public static final BNameMap make(BNameMap bNameMap, String string, BFormat bFormat) {
|
||||
HashMap hashMap = (HashMap)bNameMap.map.clone();
|
||||
hashMap.put(string, bFormat);
|
||||
return (BNameMap)new BNameMap(hashMap).intern();
|
||||
}
|
||||
|
||||
public static final BNameMap make(BNameMap bNameMap, BNameMap bNameMap2) {
|
||||
HashMap hashMap = (HashMap)bNameMap.map.clone();
|
||||
String[] stringArray = bNameMap2.list();
|
||||
int n = 0;
|
||||
while (n < stringArray.length) {
|
||||
hashMap.put(stringArray[n], bNameMap2.get(stringArray[n]));
|
||||
++n;
|
||||
}
|
||||
return (BNameMap)new BNameMap(hashMap).intern();
|
||||
}
|
||||
|
||||
public static final BNameMap remove(BNameMap bNameMap, String string) {
|
||||
HashMap hashMap = (HashMap)bNameMap.map.clone();
|
||||
hashMap.remove(string);
|
||||
return (BNameMap)new BNameMap(hashMap).intern();
|
||||
}
|
||||
|
||||
public final String[] list() {
|
||||
return this.map.keySet().toArray(new String[this.map.size()]);
|
||||
}
|
||||
|
||||
public final BFormat get(String string) {
|
||||
return (BFormat)this.map.get(string);
|
||||
}
|
||||
|
||||
public final boolean isNull() {
|
||||
boolean bl = false;
|
||||
if (this.map.size() == 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
try {
|
||||
if (this.hashCode == -1) {
|
||||
this.hashCode = this.encodeToString().hashCode();
|
||||
}
|
||||
return this.hashCode;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
return System.identityHashCode(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean equals(Object object) {
|
||||
if (object instanceof BNameMap) {
|
||||
BNameMap bNameMap = (BNameMap)object;
|
||||
if (this.map.size() != bNameMap.map.size()) {
|
||||
return false;
|
||||
}
|
||||
Iterator iterator = this.map.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
String string = (String)iterator.next();
|
||||
BFormat bFormat = (BFormat)this.map.get(string);
|
||||
if (bFormat.equals(bNameMap.map.get(string))) continue;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final String toString(Context context) {
|
||||
return this.encodeToString();
|
||||
}
|
||||
|
||||
public final void encode(DataOutput dataOutput) throws IOException {
|
||||
dataOutput.writeUTF(this.encodeToString());
|
||||
}
|
||||
|
||||
public final BObject decode(DataInput dataInput) throws IOException {
|
||||
return this.decodeFromString(dataInput.readUTF());
|
||||
}
|
||||
|
||||
public final String encodeToString() {
|
||||
if (this.string == null) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append('{');
|
||||
Iterator iterator = this.map.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
String string = (String)iterator.next();
|
||||
BFormat bFormat = (BFormat)this.map.get(string);
|
||||
this.escape(stringBuffer, string);
|
||||
stringBuffer.append('=');
|
||||
this.escape(stringBuffer, bFormat.getFormat());
|
||||
stringBuffer.append(';');
|
||||
}
|
||||
stringBuffer.append('}');
|
||||
this.string = stringBuffer.toString();
|
||||
}
|
||||
return this.string;
|
||||
}
|
||||
|
||||
public final BObject decodeFromString(String string) throws IOException {
|
||||
try {
|
||||
int n;
|
||||
int n2 = string.indexOf(123);
|
||||
int n3 = string.lastIndexOf(125);
|
||||
if (n2 + 1 == n3) {
|
||||
return NULL;
|
||||
}
|
||||
String string2 = string.substring(n2 + 1, n3);
|
||||
Class clazz = class$java$lang$String;
|
||||
if (clazz == null) {
|
||||
clazz = class$java$lang$String = BNameMap.class("[Ljava.lang.String;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
int n4 = string2.length();
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
int n5 = 59;
|
||||
int n6 = 0;
|
||||
while (n6 < n4) {
|
||||
n = string2.charAt(n6);
|
||||
if (n == 92) {
|
||||
stringBuffer.append(string2.charAt(++n6));
|
||||
} else if (n != 61 && n != 59) {
|
||||
stringBuffer.append((char)n);
|
||||
} else {
|
||||
if (n == n5) {
|
||||
throw new Exception();
|
||||
}
|
||||
n5 = n;
|
||||
array.add((Object)stringBuffer.toString());
|
||||
stringBuffer.setLength(0);
|
||||
}
|
||||
++n6;
|
||||
}
|
||||
HashMap<String, BFormat> hashMap = new HashMap<String, BFormat>();
|
||||
n = 0;
|
||||
while (n < array.size()) {
|
||||
String string3 = (String)array.get(n);
|
||||
BFormat bFormat = BFormat.make((String)array.get(n + '\u0001'));
|
||||
hashMap.put(string3, bFormat);
|
||||
n += 2;
|
||||
}
|
||||
BNameMap bNameMap = (BNameMap)new BNameMap(hashMap).intern();
|
||||
bNameMap.string = string;
|
||||
return bNameMap;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new IOException("Invalid BNameMap: " + string);
|
||||
}
|
||||
}
|
||||
|
||||
private final void escape(StringBuffer stringBuffer, String string) {
|
||||
int n = string.length();
|
||||
int n2 = 0;
|
||||
while (n2 < n) {
|
||||
char c = string.charAt(n2);
|
||||
switch (c) {
|
||||
case '\\': {
|
||||
stringBuffer.append("\\\\");
|
||||
break;
|
||||
}
|
||||
case '{': {
|
||||
stringBuffer.append("\\{");
|
||||
break;
|
||||
}
|
||||
case '}': {
|
||||
stringBuffer.append("\\}");
|
||||
break;
|
||||
}
|
||||
case '=': {
|
||||
stringBuffer.append("\\=");
|
||||
break;
|
||||
}
|
||||
case ';': {
|
||||
stringBuffer.append("\\;");
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
stringBuffer.append(c);
|
||||
}
|
||||
}
|
||||
++n2;
|
||||
}
|
||||
}
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.hashCode = -1;
|
||||
}
|
||||
|
||||
private BNameMap(HashMap hashMap) {
|
||||
this.this();
|
||||
this.map = hashMap;
|
||||
}
|
||||
|
||||
static {
|
||||
DEFAULT = NULL = new BNameMap(new HashMap());
|
||||
Class clazz = class$javax$baja$util$BNameMap;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BNameMap = BNameMap.class("[Ljavax.baja.util.BNameMap;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import com.tridium.util.ContextThread;
|
||||
import javax.baja.job.BJobService;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BString;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.BajaRuntimeException;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BNotification
|
||||
extends BComponent {
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$util$BNotification;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public final void raise(boolean bl) {
|
||||
if (!bl) {
|
||||
try {
|
||||
Thread thread = Thread.currentThread();
|
||||
Context context = ((ContextThread)((Object)thread)).getContext();
|
||||
BString bString = (BString)context.getFacets().get("foxRemoteVmUuid");
|
||||
if (this.get("vmUuid") == null) {
|
||||
this.add("vmUuid", bString);
|
||||
} else {
|
||||
this.set("vmUuid", (BValue)bString);
|
||||
}
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new BajaRuntimeException("raise() failed. Cannot find vmUuid", exception);
|
||||
}
|
||||
}
|
||||
((BJobService)BJobService.getService()).fireNotification(this);
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BNotification;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BNotification = BNotification.class("[Ljavax.baja.util.BNotification;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BConverter;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BNullConverter
|
||||
extends BConverter {
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$util$BNullConverter;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean isNull() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public BObject convert(BObject bObject, BObject bObject2, Context context) {
|
||||
return bObject2;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BNullConverter;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BNullConverter = BNullConverter.class("[Ljavax.baja.util.BNullConverter;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Cursor;
|
||||
|
||||
public class BObjectArrayCursor
|
||||
implements Cursor {
|
||||
private Context cx;
|
||||
private BObject[] objs;
|
||||
private int index;
|
||||
|
||||
public Context getContext() {
|
||||
return this.cx;
|
||||
}
|
||||
|
||||
public BObject get() {
|
||||
return this.objs[this.index];
|
||||
}
|
||||
|
||||
public boolean next() {
|
||||
if (this.index != this.objs.length) {
|
||||
++this.index;
|
||||
}
|
||||
boolean bl = false;
|
||||
if (this.index < this.objs.length) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public boolean nextComponent() {
|
||||
while (this.next()) {
|
||||
if (!this.get().isComponent()) continue;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean next(Class clazz) {
|
||||
while (this.next()) {
|
||||
if (!clazz.isInstance(this.get())) continue;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public BObjectArrayCursor(BObject[] bObjectArray, Context context) {
|
||||
this.objs = bObjectArray;
|
||||
this.cx = context;
|
||||
this.index = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BIService;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BServiceContainer
|
||||
extends BComponent
|
||||
implements BIService {
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
static /* synthetic */ Class class$javax$baja$util$BServiceContainer;
|
||||
|
||||
public Type[] getServiceTypes() {
|
||||
return new Type[]{TYPE};
|
||||
}
|
||||
|
||||
public void serviceStarted() throws Exception {
|
||||
}
|
||||
|
||||
public void serviceStopped() throws Exception {
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BServiceContainer;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BServiceContainer = BServiceContainer.class("[Ljavax.baja.util.BServiceContainer;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
icon = BIcon.std("gears.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.naming.SlotPath;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BIValidator;
|
||||
import javax.baja.util.CannotValidateException;
|
||||
import javax.baja.util.Lexicon;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BStationNameValidator
|
||||
extends BObject
|
||||
implements BIValidator {
|
||||
public static final Type TYPE;
|
||||
public static final BStationNameValidator INSTANCE;
|
||||
private static final Lexicon lex;
|
||||
private static final int maxStationNameLength = 32;
|
||||
static /* synthetic */ Class class$javax$baja$util$BStationNameValidator;
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public final void validate(BObject bObject, Context context) throws CannotValidateException {
|
||||
String string = bObject.toString();
|
||||
if (!SlotPath.isValidName(string)) {
|
||||
throw new CannotValidateException(lex.getText("stationNameValidator.invalidName"));
|
||||
}
|
||||
if (string.length() > 32) {
|
||||
throw new CannotValidateException(lex.getText("stationNameValidator.nameTooLong"));
|
||||
}
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BStationNameValidator;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BStationNameValidator = BStationNameValidator.class("[Ljavax.baja.util.BStationNameValidator;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
INSTANCE = new BStationNameValidator();
|
||||
Class clazz2 = class$javax$baja$util$BStationNameValidator;
|
||||
if (clazz2 == null) {
|
||||
clazz2 = class$javax$baja$util$BStationNameValidator = BStationNameValidator.class("[Ljavax.baja.util.BStationNameValidator;", false);
|
||||
}
|
||||
lex = Lexicon.make(clazz2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BStruct;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BStreetAddress
|
||||
extends BStruct {
|
||||
public static final Property address1 = BStreetAddress.newProperty(0, "", null);
|
||||
public static final Property address2 = BStreetAddress.newProperty(0, "", null);
|
||||
public static final Property city = BStreetAddress.newProperty(0, "", null);
|
||||
public static final Property state = BStreetAddress.newProperty(0, "", null);
|
||||
public static final Property zip = BStreetAddress.newProperty(0, "", null);
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$util$BStreetAddress;
|
||||
|
||||
public String getAddress1() {
|
||||
return this.getString(address1);
|
||||
}
|
||||
|
||||
public void setAddress1(String string) {
|
||||
this.setString(address1, string, null);
|
||||
}
|
||||
|
||||
public String getAddress2() {
|
||||
return this.getString(address2);
|
||||
}
|
||||
|
||||
public void setAddress2(String string) {
|
||||
this.setString(address2, string, null);
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return this.getString(city);
|
||||
}
|
||||
|
||||
public void setCity(String string) {
|
||||
this.setString(city, string, null);
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return this.getString(state);
|
||||
}
|
||||
|
||||
public void setState(String string) {
|
||||
this.setString(state, string, null);
|
||||
}
|
||||
|
||||
public String getZip() {
|
||||
return this.getString(zip);
|
||||
}
|
||||
|
||||
public void setZip(String string) {
|
||||
this.setString(zip, string, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BStreetAddress;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BStreetAddress = BStreetAddress.class("[Ljavax.baja.util.BStreetAddress;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BInteger;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BWorker;
|
||||
import javax.baja.util.ThreadPoolWorker;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public abstract class BThreadPoolWorker
|
||||
extends BWorker {
|
||||
public static final Property maxThreads = BThreadPoolWorker.newProperty(0, 4, BFacets.make("min", BInteger.make(1)));
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$util$BThreadPoolWorker;
|
||||
|
||||
public int getMaxThreads() {
|
||||
return this.getInt(maxThreads);
|
||||
}
|
||||
|
||||
public void setMaxThreads(int n) {
|
||||
this.setInt(maxThreads, n, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public void started() throws Exception {
|
||||
super.started();
|
||||
this.updateMaxThreads();
|
||||
}
|
||||
|
||||
public void atSteadyState() throws Exception {
|
||||
super.atSteadyState();
|
||||
this.updateMaxThreads();
|
||||
}
|
||||
|
||||
public void changed(Property property, Context context) {
|
||||
if (this.isRunning() && property.equals(maxThreads)) {
|
||||
this.updateMaxThreads();
|
||||
return;
|
||||
}
|
||||
super.changed(property, context);
|
||||
}
|
||||
|
||||
void updateMaxThreads() {
|
||||
ThreadPoolWorker threadPoolWorker = (ThreadPoolWorker)this.getWorker();
|
||||
if (threadPoolWorker != null) {
|
||||
threadPoolWorker.setMaxThreads(this.getMaxThreads());
|
||||
}
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public BThreadPoolWorker() {
|
||||
}
|
||||
|
||||
public BThreadPoolWorker(int n) {
|
||||
this.setMaxThreads(n);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BThreadPoolWorker;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BThreadPoolWorker = BThreadPoolWorker.class("[Ljavax.baja.util.BThreadPoolWorker;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BAbsTime;
|
||||
import javax.baja.sys.BStruct;
|
||||
import javax.baja.sys.BTime;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BTimeRange
|
||||
extends BStruct {
|
||||
public static final Property startTime = BTimeRange.newProperty(0, BTime.make(0, 0, 0, 0), null);
|
||||
public static final Property endTime = BTimeRange.newProperty(0, BTime.make(0, 0, 0, 0), null);
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$util$BTimeRange;
|
||||
|
||||
public BTime getStartTime() {
|
||||
return (BTime)this.get(startTime);
|
||||
}
|
||||
|
||||
public void setStartTime(BTime bTime) {
|
||||
this.set(startTime, (BValue)bTime, null);
|
||||
}
|
||||
|
||||
public BTime getEndTime() {
|
||||
return (BTime)this.get(endTime);
|
||||
}
|
||||
|
||||
public void setEndTime(BTime bTime) {
|
||||
this.set(endTime, (BValue)bTime, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean includes(BAbsTime bAbsTime) {
|
||||
return this.test(bAbsTime.getTimeOfDayMillis());
|
||||
}
|
||||
|
||||
public boolean includes(BTime bTime) {
|
||||
return this.test(bTime.getTimeOfDayMillis());
|
||||
}
|
||||
|
||||
public boolean isAllDay() {
|
||||
return this.getStartTime().equals(this.getEndTime());
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
return this.getStartTime().toString(context) + " - " + this.getEndTime().toString(context);
|
||||
}
|
||||
|
||||
private final boolean test(long l) {
|
||||
long l2 = this.getStartTime().getTimeOfDayMillis();
|
||||
long l3 = this.getEndTime().getTimeOfDayMillis();
|
||||
if (l3 == 0L) {
|
||||
l3 = 86400000L;
|
||||
}
|
||||
if (l2 < l3) {
|
||||
boolean bl = false;
|
||||
if (l >= l2 && l <= l3) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
boolean bl = false;
|
||||
if (l >= l2 || l <= l3) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public BTimeRange() {
|
||||
}
|
||||
|
||||
public BTimeRange(BTime bTime, BTime bTime2) {
|
||||
this.setStartTime(bTime);
|
||||
this.setEndTime(bTime2);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BTimeRange;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BTimeRange = BTimeRange.class("[Ljavax.baja.util.BTimeRange;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.naming.SlotPath;
|
||||
import javax.baja.registry.TypeInfo;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.BVector;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BTypeSpec;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public abstract class BTypeConfig
|
||||
extends BVector {
|
||||
public static final Property typeSpec = BTypeConfig.newProperty(0, BTypeSpec.NULL, null);
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$util$BTypeConfig;
|
||||
|
||||
public BTypeSpec getTypeSpec() {
|
||||
return (BTypeSpec)this.get(typeSpec);
|
||||
}
|
||||
|
||||
public void setTypeSpec(BTypeSpec bTypeSpec) {
|
||||
this.set(typeSpec, (BValue)bTypeSpec, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public abstract TypeInfo getTargetType();
|
||||
|
||||
public BObject make() {
|
||||
BObject bObject = this.getTypeSpec().getInstance();
|
||||
this.syncTo(bObject);
|
||||
return bObject;
|
||||
}
|
||||
|
||||
public void syncTo(BObject bObject) {
|
||||
if (!(bObject instanceof IConfigurable)) {
|
||||
throw new UnsupportedOperationException("Must override syncTo() if not using IConfigurable");
|
||||
}
|
||||
IConfigurable iConfigurable = (IConfigurable)((Object)bObject);
|
||||
String[] stringArray = iConfigurable.listConfig();
|
||||
int n = 0;
|
||||
while (n < stringArray.length) {
|
||||
String string = stringArray[n];
|
||||
Property property = this.getProperty(string);
|
||||
if (property != null) {
|
||||
iConfigurable.setConfig(string, this.get(property));
|
||||
}
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
public void syncFrom(BObject bObject) {
|
||||
if (!(bObject instanceof IConfigurable)) {
|
||||
throw new UnsupportedOperationException("Must override syncFrom() if not using IConfigurable");
|
||||
}
|
||||
this.removeAll();
|
||||
IConfigurable iConfigurable = (IConfigurable)((Object)bObject);
|
||||
String[] stringArray = iConfigurable.listConfig();
|
||||
int n = 0;
|
||||
while (n < stringArray.length) {
|
||||
String string = stringArray[n];
|
||||
BValue bValue = iConfigurable.getConfig(string);
|
||||
BFacets bFacets = iConfigurable.getConfigFacets(string);
|
||||
this.add(SlotPath.escape(string), bValue, 1, bFacets, null);
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
public void changed(Property property, Context context) {
|
||||
super.changed(property, context);
|
||||
if (property.equals(typeSpec)) {
|
||||
this.configChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void configChanged() {
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BTypeConfig;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BTypeConfig = BTypeConfig.class("[Ljavax.baja.util.BTypeConfig;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
|
||||
public static interface IConfigurable {
|
||||
public String[] listConfig();
|
||||
|
||||
public BValue getConfig(String var1);
|
||||
|
||||
public BFacets getConfigFacets(String var1);
|
||||
|
||||
public void setConfig(String var1, BValue var2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import com.tridium.sys.Nre;
|
||||
import com.tridium.sys.module.NModule;
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import javax.baja.registry.TypeInfo;
|
||||
import javax.baja.sys.BIComparable;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BSimple;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.ModuleException;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.sys.TypeException;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BTypeSpec
|
||||
extends BSimple
|
||||
implements BIComparable {
|
||||
public static final BTypeSpec NULL = new BTypeSpec();
|
||||
public static final BTypeSpec DEFAULT;
|
||||
public static final Type TYPE;
|
||||
private String spec;
|
||||
private String moduleName;
|
||||
private String typeName;
|
||||
private Type type;
|
||||
static /* synthetic */ Class class$javax$baja$util$BTypeSpec;
|
||||
|
||||
public static final BTypeSpec make(String string, String string2) {
|
||||
if (string == null || string2 == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
BTypeSpec bTypeSpec = new BTypeSpec();
|
||||
bTypeSpec.moduleName = string;
|
||||
bTypeSpec.typeName = string2;
|
||||
bTypeSpec.spec = string + ':' + string2;
|
||||
return (BTypeSpec)bTypeSpec.intern();
|
||||
}
|
||||
|
||||
public static final BTypeSpec make(String string) {
|
||||
if (string.equals("null")) {
|
||||
return NULL;
|
||||
}
|
||||
try {
|
||||
BTypeSpec bTypeSpec = new BTypeSpec();
|
||||
int n = string.indexOf(58);
|
||||
bTypeSpec.moduleName = string.substring(0, n);
|
||||
bTypeSpec.typeName = string.substring(n + 1);
|
||||
bTypeSpec.spec = string;
|
||||
return (BTypeSpec)bTypeSpec.intern();
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new IllegalArgumentException(string);
|
||||
}
|
||||
}
|
||||
|
||||
public static final BTypeSpec make(Type type) {
|
||||
BTypeSpec bTypeSpec = new BTypeSpec();
|
||||
bTypeSpec.moduleName = type.getModule().getModuleName();
|
||||
bTypeSpec.typeName = type.getTypeName();
|
||||
bTypeSpec.spec = bTypeSpec.moduleName + ':' + bTypeSpec.typeName;
|
||||
bTypeSpec = (BTypeSpec)bTypeSpec.intern();
|
||||
bTypeSpec.type = type;
|
||||
return bTypeSpec;
|
||||
}
|
||||
|
||||
public final int compareTo(Object object) {
|
||||
return this.spec.compareTo(((BTypeSpec)object).spec);
|
||||
}
|
||||
|
||||
public final boolean isNull() {
|
||||
return this.spec.equals("null");
|
||||
}
|
||||
|
||||
public final String getModuleName() {
|
||||
return this.moduleName;
|
||||
}
|
||||
|
||||
public final String getTypeName() {
|
||||
return this.typeName;
|
||||
}
|
||||
|
||||
public final TypeInfo getTypeInfo() {
|
||||
return Sys.getRegistry().getType(this.spec);
|
||||
}
|
||||
|
||||
public final Type getResolvedType() throws ModuleException, TypeException {
|
||||
if (this.type == null) {
|
||||
NModule nModule = Nre.moduleManager.loadModule(this.moduleName);
|
||||
if (nModule == null) {
|
||||
throw new ModuleException("Should never happen");
|
||||
}
|
||||
return nModule.getType(this.typeName);
|
||||
}
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public final BObject getInstance() throws ModuleException, TypeException {
|
||||
return this.getResolvedType().getInstance();
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return this.spec.hashCode();
|
||||
}
|
||||
|
||||
public final boolean equals(Object object) {
|
||||
if (object instanceof BTypeSpec) {
|
||||
return this.spec.equals(((BTypeSpec)object).spec);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final String toString(Context context) {
|
||||
return this.spec;
|
||||
}
|
||||
|
||||
public final void encode(DataOutput dataOutput) throws IOException {
|
||||
dataOutput.writeUTF(this.spec);
|
||||
}
|
||||
|
||||
public final BObject decode(DataInput dataInput) throws IOException {
|
||||
return BTypeSpec.make(dataInput.readUTF());
|
||||
}
|
||||
|
||||
public final String encodeToString() throws IOException {
|
||||
return this.spec;
|
||||
}
|
||||
|
||||
public final BObject decodeFromString(String string) throws IOException {
|
||||
try {
|
||||
return BTypeSpec.make(string);
|
||||
}
|
||||
catch (RuntimeException runtimeException) {
|
||||
throw new IOException("Invalid type spec: " + string);
|
||||
}
|
||||
}
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private BTypeSpec() {
|
||||
}
|
||||
|
||||
static {
|
||||
BTypeSpec.NULL.spec = "null";
|
||||
DEFAULT = NULL;
|
||||
Class clazz = class$javax$baja$util$BTypeSpec;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BTypeSpec = BTypeSpec.class("[Ljavax.baja.util.BTypeSpec;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BFolder;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BUnrestrictedFolder
|
||||
extends BFolder {
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$util$BUnrestrictedFolder;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BUnrestrictedFolder;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BUnrestrictedFolder = BUnrestrictedFolder.class("[Ljavax.baja.util.BUnrestrictedFolder;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,333 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import com.tridium.sys.Nre;
|
||||
import com.tridium.sys.NreLib;
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Random;
|
||||
import javax.baja.sys.BIComparable;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BSimple;
|
||||
import javax.baja.sys.BajaRuntimeException;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BUuid
|
||||
extends BSimple
|
||||
implements BIComparable {
|
||||
static final char[] compactMap = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '$', '*'};
|
||||
public static final BUuid NULL = new BUuid(0L, 0L);
|
||||
public static final BUuid MIN = new BUuid(Long.MIN_VALUE, Long.MIN_VALUE);
|
||||
public static final BUuid MAX = new BUuid(Long.MAX_VALUE, Long.MAX_VALUE);
|
||||
public static final BUuid DEFAULT = NULL;
|
||||
public static final Type TYPE;
|
||||
private static Object nonNativeLock;
|
||||
private static boolean nonNativeInit;
|
||||
private static int ipAddress;
|
||||
private static int counter1;
|
||||
private static int counter2;
|
||||
private static Class JAVA_UUID_CLASS;
|
||||
private static Method JAVA_UUID_INIT_METHOD;
|
||||
private static Method JAVA_UUID_LEAST_SIG_METHOD;
|
||||
private static Method JAVA_UUID_MOST_SIG_METHOD;
|
||||
private long mostSig;
|
||||
private long leastSig;
|
||||
private String string;
|
||||
static /* synthetic */ Class class$javax$baja$util$BUuid;
|
||||
|
||||
public static final BUuid make(String string) {
|
||||
if (string.length() != 36 || string.charAt(8) != '-' || string.charAt(13) != '-' || string.charAt(18) != '-' || string.charAt(23) != '-') {
|
||||
throw new BajaRuntimeException("Invalid format for BUuid: " + string);
|
||||
}
|
||||
long l = BUuid.parse(string, 0, 8) << 32 | BUuid.parse(string, 9, 4) << 16 | BUuid.parse(string, 14, 4);
|
||||
long l2 = BUuid.parse(string, 19, 4) << 48 | BUuid.parse(string, 24, 12);
|
||||
return new BUuid(l, l2);
|
||||
}
|
||||
|
||||
public static final BUuid make(long l, long l2) {
|
||||
return new BUuid(l, l2);
|
||||
}
|
||||
|
||||
public static final BUuid make(byte[] byArray) {
|
||||
if (byArray.length != 16) {
|
||||
throw new IllegalArgumentException("Array length mismatch.");
|
||||
}
|
||||
long l = 0L;
|
||||
int n = 15;
|
||||
while (n >= 8) {
|
||||
l <<= 8;
|
||||
l |= (long)(byArray[n] & 0xFF);
|
||||
--n;
|
||||
}
|
||||
long l2 = 0L;
|
||||
int n2 = 7;
|
||||
while (n2 >= 0) {
|
||||
l2 <<= 8;
|
||||
l2 |= (long)(byArray[n2] & 0xFF);
|
||||
--n2;
|
||||
}
|
||||
return new BUuid(l, l2);
|
||||
}
|
||||
|
||||
public static final BUuid make() {
|
||||
BUuid bUuid = new BUuid(0L, 0L);
|
||||
if (!NreLib.getHostModel().equalsIgnoreCase("TITAN")) {
|
||||
if (NreLib.nativesLoaded) {
|
||||
bUuid.init0();
|
||||
} else {
|
||||
bUuid.initNonNative();
|
||||
}
|
||||
} else {
|
||||
bUuid.initN4();
|
||||
}
|
||||
return bUuid;
|
||||
}
|
||||
|
||||
private final native void init0();
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
private final void initNonNative() {
|
||||
Object object = nonNativeLock;
|
||||
synchronized (object) {
|
||||
if (!nonNativeInit) {
|
||||
nonNativeInit = true;
|
||||
Random random = new Random(System.currentTimeMillis() ^ Nre.bootTime);
|
||||
ipAddress = random.nextInt();
|
||||
counter1 = Math.abs(random.nextInt());
|
||||
counter2 = Math.abs(random.nextInt());
|
||||
try {
|
||||
byte[] byArray = Sys.getLocalHost().getAddress();
|
||||
ipAddress = ((byArray[0] & 0xFF) << 24) + ((byArray[1] & 0xFF) << 16) + ((byArray[2] & 0xFF) << 8) + (byArray[3] & 0xFF);
|
||||
}
|
||||
catch (Exception exception) {
|
||||
System.err.println("ERROR: BUuid.initNonNative: " + exception);
|
||||
}
|
||||
}
|
||||
this.mostSig = (long)counter1 | (long)ipAddress << 32;
|
||||
this.leastSig = (long)counter2 << 50 | System.currentTimeMillis();
|
||||
++counter1;
|
||||
++counter2;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private final void initN4() {
|
||||
try {
|
||||
Object object = JAVA_UUID_INIT_METHOD.invoke(null, null);
|
||||
this.mostSig = (Long)JAVA_UUID_MOST_SIG_METHOD.invoke(object, null);
|
||||
this.leastSig = (Long)JAVA_UUID_LEAST_SIG_METHOD.invoke(object, null);
|
||||
}
|
||||
catch (Exception exception) {
|
||||
System.err.println("ERROR: BUuid.initN4: " + exception);
|
||||
}
|
||||
}
|
||||
|
||||
public final long getMostSignificant() {
|
||||
return this.mostSig;
|
||||
}
|
||||
|
||||
public final long getLeastSignificant() {
|
||||
return this.leastSig;
|
||||
}
|
||||
|
||||
public final byte[] getBytes() {
|
||||
byte[] byArray = new byte[16];
|
||||
long l = this.mostSig;
|
||||
int n = 8;
|
||||
while (n < 16) {
|
||||
byArray[n] = (byte)(l & 0xFFL);
|
||||
l >>>= 8;
|
||||
++n;
|
||||
}
|
||||
long l2 = this.leastSig;
|
||||
int n2 = 0;
|
||||
while (n2 < 8) {
|
||||
byArray[n2] = (byte)(l2 & 0xFFL);
|
||||
l2 >>>= 8;
|
||||
++n2;
|
||||
}
|
||||
return byArray;
|
||||
}
|
||||
|
||||
public final boolean isNull() {
|
||||
boolean bl = false;
|
||||
if (this.mostSig == 0L && this.leastSig == 0L) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return (int)(this.mostSig >> 32 ^ this.mostSig ^ this.leastSig >> 32 ^ this.leastSig);
|
||||
}
|
||||
|
||||
public final int compareTo(Object object) {
|
||||
BUuid bUuid = (BUuid)object;
|
||||
if (this.mostSig == bUuid.mostSig) {
|
||||
if (this.leastSig == bUuid.leastSig) {
|
||||
return 0;
|
||||
}
|
||||
return this.leastSig < bUuid.leastSig ? -1 : 1;
|
||||
}
|
||||
return this.mostSig < bUuid.mostSig ? -1 : 1;
|
||||
}
|
||||
|
||||
public final boolean equals(Object object) {
|
||||
if (object instanceof BUuid) {
|
||||
BUuid bUuid = (BUuid)object;
|
||||
boolean bl = false;
|
||||
if (this.mostSig == bUuid.mostSig && this.leastSig == bUuid.leastSig) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final void encode(DataOutput dataOutput) throws IOException {
|
||||
dataOutput.writeLong(this.mostSig);
|
||||
dataOutput.writeLong(this.leastSig);
|
||||
}
|
||||
|
||||
public final BObject decode(DataInput dataInput) throws IOException {
|
||||
return new BUuid(dataInput.readLong(), dataInput.readLong());
|
||||
}
|
||||
|
||||
public final String encodeToString() throws IOException {
|
||||
if (this.string == null) {
|
||||
this.string = BUuid.digits(this.mostSig >> 32, 8) + '-' + BUuid.digits(this.mostSig >> 16, 4) + '-' + BUuid.digits(this.mostSig, 4) + '-' + BUuid.digits(this.leastSig >> 48, 4) + '-' + BUuid.digits(this.leastSig, 12);
|
||||
}
|
||||
return this.string;
|
||||
}
|
||||
|
||||
public final String toCompactString() {
|
||||
StringBuffer stringBuffer = new StringBuffer(28);
|
||||
stringBuffer.append(compactMap[(int)(this.mostSig >> 58) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.mostSig >> 52) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.mostSig >> 46) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.mostSig >> 40) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.mostSig >> 34) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.mostSig >> 38) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.mostSig >> 32) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.mostSig >> 36) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.mostSig >> 30) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.mostSig >> 24) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.mostSig >> 18) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.mostSig >> 12) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.mostSig >> 6) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)this.mostSig & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.leastSig >> 58) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.leastSig >> 52) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.leastSig >> 46) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.leastSig >> 40) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.leastSig >> 34) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.leastSig >> 38) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.leastSig >> 32) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.leastSig >> 36) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.leastSig >> 30) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.leastSig >> 24) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.leastSig >> 18) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.leastSig >> 12) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)(this.leastSig >> 6) & 0x3F]);
|
||||
stringBuffer.append(compactMap[(int)this.leastSig & 0x3F]);
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public final BObject decodeFromString(String string) throws IOException {
|
||||
return BUuid.make(string);
|
||||
}
|
||||
|
||||
private static final String digits(long l, int n) {
|
||||
long l2 = 1L << n * 4;
|
||||
return Long.toHexString(l2 | l & l2 - 1L).substring(1);
|
||||
}
|
||||
|
||||
private static final long parse(String string, int n, int n2) {
|
||||
long l = 0L;
|
||||
int n3 = 0;
|
||||
while (n3 < n2) {
|
||||
l <<= 4;
|
||||
l |= (long)BUuid.hexCharToInt(string, n + n3);
|
||||
++n3;
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
private static final int hexCharToInt(String string, int n) {
|
||||
char c = string.charAt(n);
|
||||
int n2 = c - 48;
|
||||
if (n2 >= 0 && n2 <= 9) {
|
||||
return n2;
|
||||
}
|
||||
n2 = c - 65 + 10;
|
||||
if (n2 >= 10 && n2 <= 15) {
|
||||
return n2;
|
||||
}
|
||||
n2 = c - 97 + 10;
|
||||
if (n2 >= 10 && n2 <= 15) {
|
||||
return n2;
|
||||
}
|
||||
throw new BajaRuntimeException("Invalid format for BUuid: " + string);
|
||||
}
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private BUuid(long l, long l2) {
|
||||
this.mostSig = l;
|
||||
this.leastSig = l2;
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BUuid;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BUuid = BUuid.class("[Ljavax.baja.util.BUuid;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
nonNativeLock = new Object();
|
||||
JAVA_UUID_CLASS = null;
|
||||
JAVA_UUID_INIT_METHOD = null;
|
||||
JAVA_UUID_LEAST_SIG_METHOD = null;
|
||||
JAVA_UUID_MOST_SIG_METHOD = null;
|
||||
if (NreLib.getHostModel().equalsIgnoreCase("TITAN")) {
|
||||
try {
|
||||
JAVA_UUID_CLASS = Class.forName("java.util.UUID");
|
||||
JAVA_UUID_INIT_METHOD = JAVA_UUID_CLASS.getMethod("randomUUID", null);
|
||||
JAVA_UUID_LEAST_SIG_METHOD = JAVA_UUID_CLASS.getMethod("getLeastSignificantBits", null);
|
||||
JAVA_UUID_MOST_SIG_METHOD = JAVA_UUID_CLASS.getMethod("getMostSignificantBits", null);
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
System.err.println("ERROR: BUuid failed to find Java UUID class");
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BString;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BIValidator;
|
||||
import javax.baja.util.CannotValidateException;
|
||||
import javax.baja.util.Lexicon;
|
||||
import javax.baja.util.Version;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BVersionValidator
|
||||
extends BObject
|
||||
implements BIValidator {
|
||||
public static final Type TYPE;
|
||||
private static final Lexicon lex;
|
||||
static /* synthetic */ Class class$javax$baja$util$BVersionValidator;
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public final void validate(BObject bObject, Context context) throws CannotValidateException {
|
||||
String string = null;
|
||||
try {
|
||||
string = ((BString)bObject).getString();
|
||||
Version version = new Version(string);
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new CannotValidateException(lex.getText("versionValidator.invalid", new Object[]{string}));
|
||||
}
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BVersionValidator;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BVersionValidator = BVersionValidator.class("[Ljavax.baja.util.BVersionValidator;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
Class clazz2 = class$javax$baja$util$BVersionValidator;
|
||||
if (clazz2 == null) {
|
||||
clazz2 = class$javax$baja$util$BVersionValidator = BVersionValidator.class("[Ljavax.baja.util.BVersionValidator;", false);
|
||||
}
|
||||
lex = Lexicon.make(clazz2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.spy.SpyWriter;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.Worker;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public abstract class BWorker
|
||||
extends BComponent {
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
static /* synthetic */ Class class$javax$baja$util$BWorker;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public void started() throws Exception {
|
||||
super.started();
|
||||
if (!this.isSteadyStateWorker()) {
|
||||
this.startWorker();
|
||||
}
|
||||
}
|
||||
|
||||
public void atSteadyState() throws Exception {
|
||||
super.atSteadyState();
|
||||
if (this.isSteadyStateWorker()) {
|
||||
this.startWorker();
|
||||
}
|
||||
}
|
||||
|
||||
public void stopped() throws Exception {
|
||||
super.stopped();
|
||||
this.stopWorker();
|
||||
}
|
||||
|
||||
public abstract Worker getWorker();
|
||||
|
||||
protected void startWorker() {
|
||||
this.getWorker().start(this.getWorkerThreadName());
|
||||
}
|
||||
|
||||
protected void stopWorker() {
|
||||
this.getWorker().stop();
|
||||
}
|
||||
|
||||
protected boolean isSteadyStateWorker() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected String getWorkerThreadName() {
|
||||
return this.toPathString();
|
||||
}
|
||||
|
||||
public void spy(SpyWriter spyWriter) throws Exception {
|
||||
Worker worker = this.getWorker();
|
||||
if (worker != null) {
|
||||
worker.spy(spyWriter);
|
||||
} else {
|
||||
spyWriter.startProps("No Worker");
|
||||
spyWriter.endProps();
|
||||
}
|
||||
super.spy(spyWriter);
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BWorker;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BWorker = BWorker.class("[Ljavax.baja.util.BWorker;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
icon = BIcon.std("gears.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import java.util.StringTokenizer;
|
||||
import javax.baja.io.BajaIOException;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BSimple;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BWsAnnotation
|
||||
extends BSimple {
|
||||
public static final BWsAnnotation DEFAULT = new BWsAnnotation(0, 0, 8, 0);
|
||||
public static final Type TYPE;
|
||||
public static final String PROPERTY_NAME = "wsAnnotation";
|
||||
public final int p;
|
||||
public final int q;
|
||||
public final int wixelWidth;
|
||||
public final int wixelHeight;
|
||||
private String string;
|
||||
static /* synthetic */ Class class$javax$baja$util$BWsAnnotation;
|
||||
|
||||
public static final BWsAnnotation make(int n, int n2) {
|
||||
return new BWsAnnotation(n, n2, BWsAnnotation.DEFAULT.wixelWidth, BWsAnnotation.DEFAULT.wixelHeight);
|
||||
}
|
||||
|
||||
public static final BWsAnnotation make(int n, int n2, int n3) {
|
||||
return new BWsAnnotation(n, n2, n3, BWsAnnotation.DEFAULT.wixelHeight);
|
||||
}
|
||||
|
||||
public static final BWsAnnotation make(int n, int n2, int n3, int n4) {
|
||||
return new BWsAnnotation(n, n2, n3, n4);
|
||||
}
|
||||
|
||||
public static final BWsAnnotation merge(BWsAnnotation bWsAnnotation, BWsAnnotation bWsAnnotation2) {
|
||||
if (bWsAnnotation == null && bWsAnnotation2 == null) {
|
||||
return DEFAULT;
|
||||
}
|
||||
if (bWsAnnotation == null) {
|
||||
return bWsAnnotation2;
|
||||
}
|
||||
if (bWsAnnotation2 == null) {
|
||||
return bWsAnnotation;
|
||||
}
|
||||
int n = Math.max(bWsAnnotation.wixelWidth, bWsAnnotation2.wixelWidth);
|
||||
int n2 = Math.max(bWsAnnotation.wixelHeight, bWsAnnotation2.wixelHeight);
|
||||
return new BWsAnnotation(bWsAnnotation2.p, bWsAnnotation2.q, n, n2);
|
||||
}
|
||||
|
||||
public final BWsAnnotation translate(int n, int n2) {
|
||||
return new BWsAnnotation(this.p + n, this.q + n2, this.wixelWidth, this.wixelHeight);
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return this.p ^ this.q ^ this.wixelWidth ^ this.wixelHeight;
|
||||
}
|
||||
|
||||
public final boolean equals(Object object) {
|
||||
if (object instanceof BWsAnnotation) {
|
||||
BWsAnnotation bWsAnnotation = (BWsAnnotation)object;
|
||||
if (this.p != bWsAnnotation.p) {
|
||||
return false;
|
||||
}
|
||||
if (this.q != bWsAnnotation.q) {
|
||||
return false;
|
||||
}
|
||||
if (this.wixelWidth != bWsAnnotation.wixelWidth) {
|
||||
return false;
|
||||
}
|
||||
return this.wixelHeight == bWsAnnotation.wixelHeight;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final void encode(DataOutput dataOutput) throws IOException {
|
||||
dataOutput.writeUTF(this.string);
|
||||
}
|
||||
|
||||
public final BObject decode(DataInput dataInput) throws IOException {
|
||||
return this.decodeFromString(dataInput.readUTF());
|
||||
}
|
||||
|
||||
public final String encodeToString() throws IOException {
|
||||
return this.string;
|
||||
}
|
||||
|
||||
public final BObject decodeFromString(String string) throws IOException {
|
||||
try {
|
||||
return new BWsAnnotation(string);
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new BajaIOException(string, exception);
|
||||
}
|
||||
}
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private BWsAnnotation(int n, int n2, int n3, int n4) {
|
||||
this.p = n;
|
||||
this.q = n2;
|
||||
this.wixelWidth = n3;
|
||||
this.wixelHeight = n4;
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(n).append(',').append(n2).append(',').append(n3);
|
||||
if (n4 != 0) {
|
||||
stringBuffer.append(',').append(n4);
|
||||
}
|
||||
this.string = stringBuffer.toString();
|
||||
}
|
||||
|
||||
private BWsAnnotation(String string) throws Exception {
|
||||
StringTokenizer stringTokenizer = new StringTokenizer(string, "|");
|
||||
StringTokenizer stringTokenizer2 = new StringTokenizer(stringTokenizer.nextToken(), ",");
|
||||
this.p = Integer.parseInt(stringTokenizer2.nextToken());
|
||||
this.q = Integer.parseInt(stringTokenizer2.nextToken());
|
||||
this.wixelWidth = Integer.parseInt(stringTokenizer2.nextToken());
|
||||
this.wixelHeight = stringTokenizer2.hasMoreTokens() ? Integer.parseInt(stringTokenizer2.nextToken()) : 0;
|
||||
this.string = string;
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BWsAnnotation;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BWsAnnotation = BWsAnnotation.class("[Ljavax.baja.util.BWsAnnotation;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BBoolean;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BWsAnnotation;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BWsTextBlock
|
||||
extends BComponent {
|
||||
public static final Property text = BWsTextBlock.newProperty(0, "", BFacets.make("multiLine", BBoolean.TRUE));
|
||||
public static final Property foreground = BWsTextBlock.newProperty(0, "#ff000000", BFacets.make("fieldEditor", "wbutil:ColorFE"));
|
||||
public static final Property background = BWsTextBlock.newProperty(0, "#00000000", BFacets.make("fieldEditor", "wbutil:ColorFE"));
|
||||
public static final Property font = BWsTextBlock.newProperty(0, "12pt Arial", BFacets.make("fieldEditor", "workbench:FontFE"));
|
||||
public static final Property border = BWsTextBlock.newProperty(0, false, null);
|
||||
public static final Property selectable = BWsTextBlock.newProperty(0, true, null);
|
||||
public static final Property wsAnnotation = BWsTextBlock.newProperty(1, BWsAnnotation.make(1, 1, 20, 2), null);
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
static /* synthetic */ Class class$javax$baja$util$BWsTextBlock;
|
||||
|
||||
public String getText() {
|
||||
return this.getString(text);
|
||||
}
|
||||
|
||||
public void setText(String string) {
|
||||
this.setString(text, string, null);
|
||||
}
|
||||
|
||||
public String getForeground() {
|
||||
return this.getString(foreground);
|
||||
}
|
||||
|
||||
public void setForeground(String string) {
|
||||
this.setString(foreground, string, null);
|
||||
}
|
||||
|
||||
public String getBackground() {
|
||||
return this.getString(background);
|
||||
}
|
||||
|
||||
public void setBackground(String string) {
|
||||
this.setString(background, string, null);
|
||||
}
|
||||
|
||||
public String getFont() {
|
||||
return this.getString(font);
|
||||
}
|
||||
|
||||
public void setFont(String string) {
|
||||
this.setString(font, string, null);
|
||||
}
|
||||
|
||||
public boolean getBorder() {
|
||||
return this.getBoolean(border);
|
||||
}
|
||||
|
||||
public void setBorder(boolean bl) {
|
||||
this.setBoolean(border, bl, null);
|
||||
}
|
||||
|
||||
public boolean getSelectable() {
|
||||
return this.getBoolean(selectable);
|
||||
}
|
||||
|
||||
public void setSelectable(boolean bl) {
|
||||
this.setBoolean(selectable, bl, null);
|
||||
}
|
||||
|
||||
public BWsAnnotation getWsAnnotation() {
|
||||
return (BWsAnnotation)this.get(wsAnnotation);
|
||||
}
|
||||
|
||||
public void setWsAnnotation(BWsAnnotation bWsAnnotation) {
|
||||
this.set(wsAnnotation, (BValue)bWsAnnotation, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$util$BWsTextBlock;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$BWsTextBlock = BWsTextBlock.class("[Ljavax.baja.util.BWsTextBlock;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
icon = BIcon.std("text.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.ByteArrayUtil
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
|
||||
public class ByteArrayUtil {
|
||||
public static byte[] clone(byte[] byArray) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.clone((byte[])byArray);
|
||||
}
|
||||
|
||||
public static void copy(byte[] byArray, byte[] byArray2) {
|
||||
javax.baja.nre.util.ByteArrayUtil.copy((byte[])byArray, (byte[])byArray2);
|
||||
}
|
||||
|
||||
public static boolean equals(byte[] byArray, byte[] byArray2) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.equals((byte[])byArray, (byte[])byArray2);
|
||||
}
|
||||
|
||||
public static void memset(byte[] byArray, byte by) {
|
||||
javax.baja.nre.util.ByteArrayUtil.memset((byte[])byArray, (byte)by);
|
||||
}
|
||||
|
||||
public static int readUnsignedByte(byte[] byArray, int n) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.readUnsignedByte((byte[])byArray, (int)n);
|
||||
}
|
||||
|
||||
public static short readShort(byte[] byArray, int n) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.readShort((byte[])byArray, (int)n);
|
||||
}
|
||||
|
||||
public static int readUnsignedShort(byte[] byArray, int n) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.readUnsignedShort((byte[])byArray, (int)n);
|
||||
}
|
||||
|
||||
public static int readInt(byte[] byArray, int n) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.readInt((byte[])byArray, (int)n);
|
||||
}
|
||||
|
||||
public static long readLong(byte[] byArray, int n) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.readLong((byte[])byArray, (int)n);
|
||||
}
|
||||
|
||||
public static int writeByte(byte[] byArray, int n, int n2) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.writeByte((byte[])byArray, (int)n, (int)n2);
|
||||
}
|
||||
|
||||
public static int writeShort(byte[] byArray, int n, int n2) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.writeShort((byte[])byArray, (int)n, (int)n2);
|
||||
}
|
||||
|
||||
public static int writeInt(byte[] byArray, int n, int n2) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.writeInt((byte[])byArray, (int)n, (int)n2);
|
||||
}
|
||||
|
||||
public static int writeLong(byte[] byArray, int n, long l) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.writeLong((byte[])byArray, (int)n, (long)l);
|
||||
}
|
||||
|
||||
public static String toHexString(byte[] byArray) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.toHexString((byte[])byArray);
|
||||
}
|
||||
|
||||
public static String toHexString(byte[] byArray, String string) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.toHexString((byte[])byArray, (String)string);
|
||||
}
|
||||
|
||||
public static String toHexString(byte[] byArray, int n, int n2) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.toHexString((byte[])byArray, (int)n, (int)n2);
|
||||
}
|
||||
|
||||
public static String toHexString(byte[] byArray, int n, int n2, String string) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.toHexString((byte[])byArray, (int)n, (int)n2, (String)string);
|
||||
}
|
||||
|
||||
public static byte[] hexStringToBytes(String string) {
|
||||
return javax.baja.nre.util.ByteArrayUtil.hexStringToBytes((String)string);
|
||||
}
|
||||
|
||||
public static void hexDump(byte[] byArray) {
|
||||
javax.baja.nre.util.ByteArrayUtil.hexDump((byte[])byArray);
|
||||
}
|
||||
|
||||
public static void hexDump(String string, byte[] byArray) {
|
||||
javax.baja.nre.util.ByteArrayUtil.hexDump((String)string, (byte[])byArray);
|
||||
}
|
||||
|
||||
public static void hexDump(byte[] byArray, int n, int n2) {
|
||||
javax.baja.nre.util.ByteArrayUtil.hexDump((byte[])byArray, (int)n, (int)n2);
|
||||
}
|
||||
|
||||
public static void hexDump(String string, byte[] byArray, int n, int n2) {
|
||||
javax.baja.nre.util.ByteArrayUtil.hexDump((String)string, (byte[])byArray, (int)n, (int)n2);
|
||||
}
|
||||
|
||||
public static void hexDump(PrintWriter printWriter, byte[] byArray, int n, int n2) {
|
||||
javax.baja.nre.util.ByteArrayUtil.hexDump((String)"", (PrintWriter)printWriter, (byte[])byArray, (int)n, (int)n2);
|
||||
}
|
||||
|
||||
public static void hexDump(String string, PrintWriter printWriter, byte[] byArray, int n, int n2) {
|
||||
javax.baja.nre.util.ByteArrayUtil.hexDump((String)string, (PrintWriter)printWriter, (byte[])byArray, (int)n, (int)n2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BajaException;
|
||||
|
||||
public class CannotValidateException
|
||||
extends BajaException {
|
||||
public CannotValidateException() {
|
||||
}
|
||||
|
||||
public CannotValidateException(String string, Throwable throwable) {
|
||||
super(string, throwable);
|
||||
}
|
||||
|
||||
public CannotValidateException(String string) {
|
||||
super(string);
|
||||
}
|
||||
|
||||
public CannotValidateException(Throwable throwable) {
|
||||
super(throwable);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.util.ICoalesceable;
|
||||
import javax.baja.util.Queue;
|
||||
import javax.baja.util.QueueFullException;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class CoalesceQueue
|
||||
extends Queue {
|
||||
HashEntry[] table;
|
||||
int hashSize;
|
||||
int threshold;
|
||||
float loadFactor;
|
||||
|
||||
public synchronized Object find(Object object) {
|
||||
HashEntry hashEntry;
|
||||
if (object instanceof ICoalesceable && (hashEntry = this.get((ICoalesceable)object)) != null) {
|
||||
return hashEntry.value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public synchronized Object dequeue() {
|
||||
Queue.Entry entry = this.head;
|
||||
if (entry == null) {
|
||||
return null;
|
||||
}
|
||||
super.dequeue();
|
||||
if (entry.value instanceof ICoalesceable) {
|
||||
this.remove((ICoalesceable)entry.value);
|
||||
}
|
||||
return entry.value;
|
||||
}
|
||||
|
||||
public synchronized boolean enqueue(Object object) throws QueueFullException {
|
||||
ICoalesceable iCoalesceable;
|
||||
HashEntry hashEntry;
|
||||
if (object instanceof ICoalesceable && (hashEntry = this.get(iCoalesceable = (ICoalesceable)object)) != null) {
|
||||
ICoalesceable iCoalesceable2 = (ICoalesceable)hashEntry.value;
|
||||
hashEntry.value = iCoalesceable2.coalesce(iCoalesceable);
|
||||
return false;
|
||||
}
|
||||
return super.enqueue(object);
|
||||
}
|
||||
|
||||
Queue.Entry newEntry(Object object) {
|
||||
if (object instanceof ICoalesceable) {
|
||||
return this.put((ICoalesceable)object);
|
||||
}
|
||||
return new Queue.Entry(object);
|
||||
}
|
||||
|
||||
public synchronized void clear() {
|
||||
super.clear();
|
||||
this.hashSize = 0;
|
||||
this.table = new HashEntry[this.table.length];
|
||||
}
|
||||
|
||||
HashEntry get(ICoalesceable iCoalesceable) {
|
||||
Object object = iCoalesceable.getCoalesceKey();
|
||||
int n = object.hashCode();
|
||||
HashEntry[] hashEntryArray = this.table;
|
||||
int n2 = (n & Integer.MAX_VALUE) % hashEntryArray.length;
|
||||
HashEntry hashEntry = hashEntryArray[n2];
|
||||
while (hashEntry != null) {
|
||||
if (hashEntry.hash == n && ((ICoalesceable)hashEntry.value).getCoalesceKey().equals(object)) {
|
||||
return hashEntry;
|
||||
}
|
||||
hashEntry = hashEntry.hashNext;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
void rehash() {
|
||||
int n = this.table.length;
|
||||
HashEntry[] hashEntryArray = this.table;
|
||||
int n2 = n * 2 + 1;
|
||||
HashEntry[] hashEntryArray2 = new HashEntry[n2];
|
||||
this.threshold = (int)((float)n2 * this.loadFactor);
|
||||
this.table = hashEntryArray2;
|
||||
int n3 = n;
|
||||
while (n3-- > 0) {
|
||||
HashEntry hashEntry = hashEntryArray[n3];
|
||||
while (hashEntry != null) {
|
||||
HashEntry hashEntry2 = hashEntry;
|
||||
hashEntry = hashEntry.hashNext;
|
||||
int n4 = (hashEntry2.hash & Integer.MAX_VALUE) % n2;
|
||||
hashEntry2.hashNext = hashEntryArray2[n4];
|
||||
hashEntryArray2[n4] = hashEntry2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HashEntry put(ICoalesceable iCoalesceable) {
|
||||
if (this.hashSize >= this.threshold) {
|
||||
this.rehash();
|
||||
return this.put(iCoalesceable);
|
||||
}
|
||||
Object object = iCoalesceable.getCoalesceKey();
|
||||
int n = object.hashCode();
|
||||
HashEntry[] hashEntryArray = this.table;
|
||||
int n2 = (n & Integer.MAX_VALUE) % hashEntryArray.length;
|
||||
HashEntry hashEntry = new HashEntry(iCoalesceable);
|
||||
hashEntry.hash = n;
|
||||
hashEntry.hashNext = hashEntryArray[n2];
|
||||
hashEntryArray[n2] = hashEntry;
|
||||
++this.hashSize;
|
||||
return hashEntry;
|
||||
}
|
||||
|
||||
Object remove(ICoalesceable iCoalesceable) {
|
||||
Object object = iCoalesceable.getCoalesceKey();
|
||||
int n = object.hashCode();
|
||||
HashEntry[] hashEntryArray = this.table;
|
||||
int n2 = (n & Integer.MAX_VALUE) % hashEntryArray.length;
|
||||
HashEntry hashEntry = hashEntryArray[n2];
|
||||
HashEntry hashEntry2 = null;
|
||||
while (hashEntry != null) {
|
||||
if (hashEntry.hash == n && ((ICoalesceable)hashEntry.value).getCoalesceKey().equals(object)) {
|
||||
if (hashEntry2 != null) {
|
||||
hashEntry2.hashNext = hashEntry.hashNext;
|
||||
} else {
|
||||
hashEntryArray[n2] = hashEntry.hashNext;
|
||||
}
|
||||
--this.hashSize;
|
||||
return hashEntry.value;
|
||||
}
|
||||
hashEntry2 = hashEntry;
|
||||
hashEntry = hashEntry.hashNext;
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.loadFactor = 0.75f;
|
||||
}
|
||||
|
||||
public CoalesceQueue(int n) {
|
||||
super(n);
|
||||
this.this();
|
||||
this.table = new HashEntry[Math.max(16, Math.min(n / 3, 101))];
|
||||
this.threshold = (int)((float)this.table.length * this.loadFactor);
|
||||
}
|
||||
|
||||
public CoalesceQueue() {
|
||||
this(Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
class HashEntry
|
||||
extends Queue.Entry {
|
||||
int hash;
|
||||
HashEntry hashNext;
|
||||
|
||||
HashEntry(Object object) {
|
||||
super(object);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
public interface ICoalesceable {
|
||||
public Object getCoalesceKey();
|
||||
|
||||
public ICoalesceable coalesce(ICoalesceable var1);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.util.IFilter;
|
||||
|
||||
public interface IContextFilter
|
||||
extends IFilter {
|
||||
public boolean accept(Object var1, Context var2);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.IFilter
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
public interface IFilter
|
||||
extends javax.baja.nre.util.IFilter {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BFacets;
|
||||
|
||||
public interface IFormat {
|
||||
public String format(Object var1, BFacets var2);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
public interface IFuture {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.ILambda
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
public interface ILambda
|
||||
extends javax.baja.nre.util.ILambda {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.IntHashMap
|
||||
* javax.baja.nre.util.IntHashMap$Iterator
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.nre.util.IntHashMap;
|
||||
|
||||
public class IntHashMap {
|
||||
private javax.baja.nre.util.IntHashMap intHashMap;
|
||||
|
||||
public void clear() {
|
||||
this.intHashMap.clear();
|
||||
}
|
||||
|
||||
public Object clone() {
|
||||
return this.intHashMap.clone();
|
||||
}
|
||||
|
||||
public boolean containsKey(int n) {
|
||||
return this.intHashMap.containsKey(n);
|
||||
}
|
||||
|
||||
public boolean equals(Object object) {
|
||||
return this.intHashMap.equals(object);
|
||||
}
|
||||
|
||||
public Object get(int n) {
|
||||
return this.intHashMap.get(n);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.intHashMap.hashCode();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return this.intHashMap.isEmpty();
|
||||
}
|
||||
|
||||
public Iterator iterator() {
|
||||
return new Iterator(this.intHashMap.iterator());
|
||||
}
|
||||
|
||||
public Object put(int n, Object object) {
|
||||
return this.intHashMap.put(n, object);
|
||||
}
|
||||
|
||||
public Object remove(int n) {
|
||||
return this.intHashMap.remove(n);
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return this.intHashMap.size();
|
||||
}
|
||||
|
||||
public Object[] toArray(Object[] objectArray) {
|
||||
return this.intHashMap.toArray(objectArray);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.intHashMap.toString();
|
||||
}
|
||||
|
||||
public IntHashMap() {
|
||||
this.intHashMap = new javax.baja.nre.util.IntHashMap();
|
||||
}
|
||||
|
||||
public IntHashMap(int n) {
|
||||
this.intHashMap = new javax.baja.nre.util.IntHashMap(n);
|
||||
}
|
||||
|
||||
public IntHashMap(int n, float f) {
|
||||
this.intHashMap = new javax.baja.nre.util.IntHashMap(n, f);
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class Iterator
|
||||
implements java.util.Iterator {
|
||||
private IntHashMap.Iterator iterator;
|
||||
|
||||
public boolean hasNext() {
|
||||
return this.iterator.hasNext();
|
||||
}
|
||||
|
||||
public int key() {
|
||||
return this.iterator.key();
|
||||
}
|
||||
|
||||
public Object next() {
|
||||
return this.iterator.next();
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
this.iterator.remove();
|
||||
}
|
||||
|
||||
private Iterator(IntHashMap.Iterator iterator) {
|
||||
this.iterator = iterator;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.Action;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.util.ICoalesceable;
|
||||
|
||||
public class Invocation
|
||||
implements Runnable,
|
||||
ICoalesceable {
|
||||
protected int hashCode;
|
||||
protected BComponent instance;
|
||||
protected Action action;
|
||||
protected BValue argument;
|
||||
protected Context context;
|
||||
|
||||
public void run() {
|
||||
this.instance.doInvoke(this.action, this.argument, this.context);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.hashCode;
|
||||
}
|
||||
|
||||
public boolean equals(Object object) {
|
||||
if (object instanceof Invocation) {
|
||||
Invocation invocation = (Invocation)object;
|
||||
boolean bl = false;
|
||||
if (this.instance == invocation.instance && this.action == invocation.action) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Object getCoalesceKey() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ICoalesceable coalesce(ICoalesceable iCoalesceable) {
|
||||
return iCoalesceable;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.instance.toPathString() + '.' + this.action.getName() + '(' + (this.argument == null ? "" : this.argument.toString()) + ')';
|
||||
}
|
||||
|
||||
public Invocation(BComponent bComponent, Action action, BValue bValue, Context context) {
|
||||
this.hashCode = bComponent.hashCode() ^ action.getName().hashCode();
|
||||
this.instance = bComponent;
|
||||
this.action = action;
|
||||
this.argument = bValue;
|
||||
this.context = context;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,574 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.TextUtil
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import com.tridium.sys.Nre;
|
||||
import com.tridium.sys.license.Brand;
|
||||
import java.io.InputStream;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
import java.util.Properties;
|
||||
import java.util.Vector;
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.file.FilePath;
|
||||
import javax.baja.file.zip.BZipSpace;
|
||||
import javax.baja.log.Log;
|
||||
import javax.baja.naming.BOrd;
|
||||
import javax.baja.naming.SlotPath;
|
||||
import javax.baja.nre.util.TextUtil;
|
||||
import javax.baja.registry.LexiconInfo;
|
||||
import javax.baja.registry.RegistryException;
|
||||
import javax.baja.sys.BModule;
|
||||
import javax.baja.sys.BajaRuntimeException;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.ModuleNotFoundException;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.util.PatternFilter;
|
||||
|
||||
public class Lexicon {
|
||||
private static Log log = Log.getLog("sys.lexicon");
|
||||
private static HashMap common = new HashMap();
|
||||
private static Properties empty = new Properties();
|
||||
private static ArrayList extendedPropsModules = new ArrayList();
|
||||
private static final LexiconProcessor[] PROCESSORS = new LexiconProcessor[]{new NestedLexiconTag(), new BrandLexiconTag()};
|
||||
public final BModule module;
|
||||
public final String language;
|
||||
public final String country;
|
||||
public final String variant;
|
||||
private Properties moduleProps;
|
||||
private Properties langProps;
|
||||
|
||||
public static Lexicon make(BModule bModule, String string, String string2, String string3) {
|
||||
return new Lexicon(bModule, string, string2, string3);
|
||||
}
|
||||
|
||||
public static Lexicon make(BModule bModule, String string) {
|
||||
Locale locale = Locale.getDefault();
|
||||
if (locale.getLanguage().equalsIgnoreCase(string)) {
|
||||
return Lexicon.make(bModule, locale.getLanguage(), locale.getCountry(), locale.getVariant());
|
||||
}
|
||||
return Lexicon.make(bModule, string, "", "");
|
||||
}
|
||||
|
||||
public static Lexicon make(String string, String string2, String string3, String string4) {
|
||||
return Lexicon.make(Lexicon.module(string), string2, string3, string4);
|
||||
}
|
||||
|
||||
public static Lexicon make(String string, String string2) {
|
||||
return Lexicon.make(Lexicon.module(string), string2);
|
||||
}
|
||||
|
||||
public static Lexicon make(BModule bModule, Locale locale) {
|
||||
return Lexicon.make(bModule, locale.getLanguage(), locale.getCountry(), locale.getVariant());
|
||||
}
|
||||
|
||||
public static Lexicon make(BModule bModule, Context context) {
|
||||
return Lexicon.make(bModule, Lexicon.lang(context));
|
||||
}
|
||||
|
||||
public static Lexicon make(String string, Locale locale) {
|
||||
return Lexicon.make(Lexicon.module(string), locale.getLanguage(), locale.getCountry(), locale.getVariant());
|
||||
}
|
||||
|
||||
public static Lexicon make(String string, Context context) {
|
||||
return Lexicon.make(Lexicon.module(string), Lexicon.lang(context));
|
||||
}
|
||||
|
||||
public static Lexicon make(String string) {
|
||||
return Lexicon.make(Lexicon.module(string), Locale.getDefault());
|
||||
}
|
||||
|
||||
public static Lexicon make(Class clazz) {
|
||||
return Lexicon.make(Sys.getModuleForClass(clazz), Locale.getDefault());
|
||||
}
|
||||
|
||||
static BModule module(String string) {
|
||||
try {
|
||||
return Sys.loadModule(string);
|
||||
}
|
||||
catch (ModuleNotFoundException moduleNotFoundException) {
|
||||
if (log.isTraceOn()) {
|
||||
log.warning("Lexicon.make module not found: " + string);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static String lang(Context context) {
|
||||
if (context != null) {
|
||||
return context.getLanguage();
|
||||
}
|
||||
return Sys.getLanguage();
|
||||
}
|
||||
|
||||
public static String removeUnderscore(String string) {
|
||||
StringBuffer stringBuffer = new StringBuffer(string.length());
|
||||
stringBuffer.setLength(string.length());
|
||||
int n = 0;
|
||||
int n2 = 0;
|
||||
while (n2 < string.length()) {
|
||||
char c = string.charAt(n2);
|
||||
if (c != '_') {
|
||||
stringBuffer.setCharAt(n++, c);
|
||||
}
|
||||
++n2;
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public Properties getModuleProperties() {
|
||||
return this.moduleProps;
|
||||
}
|
||||
|
||||
public Properties getLanguageProperties() {
|
||||
return this.langProps;
|
||||
}
|
||||
|
||||
public String get(String string, String string2) {
|
||||
String string3 = this.get(string);
|
||||
if (string3 == null) {
|
||||
return string2;
|
||||
}
|
||||
return string3;
|
||||
}
|
||||
|
||||
public String get(String string) {
|
||||
String string2 = null;
|
||||
if (this.langProps != null) {
|
||||
string2 = (String)this.langProps.get(string);
|
||||
}
|
||||
if (string2 == null && this.moduleProps != null) {
|
||||
string2 = (String)this.moduleProps.get(string);
|
||||
}
|
||||
if (string2 == null) {
|
||||
return null;
|
||||
}
|
||||
string2 = Lexicon.process(string2, this);
|
||||
return string2;
|
||||
}
|
||||
|
||||
public String getText(String string) {
|
||||
return this.get(string, string);
|
||||
}
|
||||
|
||||
public String getText(String string, Object[] objectArray) {
|
||||
String string2 = this.get(string, null);
|
||||
if (string2 == null) {
|
||||
return string;
|
||||
}
|
||||
return MessageFormat.format(string2, objectArray);
|
||||
}
|
||||
|
||||
public String getTextAsName(String string) {
|
||||
return SlotPath.escape(this.getText(string));
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
String string = "Lexicon:" + this.module + ':' + this.language;
|
||||
if (this.country != null && this.country.length() > 0) {
|
||||
string = string + '_' + this.country;
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
private static final String process(String string, Lexicon lexicon) {
|
||||
if (string == null) {
|
||||
return string;
|
||||
}
|
||||
int n = 0;
|
||||
while (n < PROCESSORS.length) {
|
||||
string = PROCESSORS[n].format(string, lexicon);
|
||||
++n;
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
private static final Properties load(BModule bModule, String string) {
|
||||
HashMap hashMap = common;
|
||||
synchronized (hashMap) {
|
||||
Properties properties;
|
||||
block8: {
|
||||
String string2;
|
||||
block10: {
|
||||
InputStream inputStream;
|
||||
block9: {
|
||||
string2 = Lexicon.getCommonKey(bModule, string);
|
||||
properties = (Properties)common.get(string2);
|
||||
if (properties != null) break block8;
|
||||
properties = new Properties();
|
||||
if (string == null) break block9;
|
||||
try {
|
||||
inputStream = Lexicon.getInputStreamFromModule(bModule, string, true);
|
||||
properties.load(inputStream);
|
||||
inputStream.close();
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
if (!"en".equals(string)) {
|
||||
log.trace("Cannot load niagara default \"" + string2 + '\"');
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
inputStream = Lexicon.getInputStream(bModule, string);
|
||||
properties.load(inputStream);
|
||||
inputStream.close();
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
if ("en".equals(string)) break block10;
|
||||
log.trace("Cannot load \"" + string2 + '\"');
|
||||
}
|
||||
}
|
||||
properties = Lexicon.trim(properties);
|
||||
common.put(string2, properties);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
private static final void loadFromModule(BModule bModule, String string) {
|
||||
HashMap hashMap = common;
|
||||
synchronized (hashMap) {
|
||||
String string2 = Lexicon.getCommonKey(bModule, string);
|
||||
Properties properties = (Properties)common.get(string2);
|
||||
if (properties == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
log.trace("Load extended \"" + string2 + "\" for module " + bModule.getModuleName());
|
||||
InputStream[] inputStreamArray = Lexicon.getInputStreamsFromModule(bModule, string);
|
||||
int n = 0;
|
||||
while (n < inputStreamArray.length) {
|
||||
properties.load(inputStreamArray[n]);
|
||||
inputStreamArray[n].close();
|
||||
++n;
|
||||
}
|
||||
}
|
||||
catch (Throwable throwable) {}
|
||||
properties = Lexicon.trim(properties);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private static final String getCommonKey(BModule bModule, String string) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(bModule.getModuleName());
|
||||
if (string != null) {
|
||||
stringBuffer.append('-').append(string);
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
private static final Properties trim(Properties properties) {
|
||||
Properties properties2 = new Properties();
|
||||
Iterator<Object> iterator = properties.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
String string = (String)iterator.next();
|
||||
String string2 = (String)properties.get(string);
|
||||
properties2.put(string, string2.trim());
|
||||
}
|
||||
return properties2;
|
||||
}
|
||||
|
||||
public static InputStream getInputStreamFromModule(BModule bModule, String string, boolean bl) throws Exception {
|
||||
String string2 = bModule.getModuleName();
|
||||
LexiconInfo[] lexiconInfoArray = Sys.getRegistry().getLexicons(string2, string);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
int n = 0;
|
||||
while (n < lexiconInfoArray.length) {
|
||||
InputStream inputStream;
|
||||
if (bl && lexiconInfoArray[n].isDefault() && (inputStream = Lexicon.getInputStreamFromModule(lexiconInfoArray[n])) != null) {
|
||||
return inputStream;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
if (arrayList.size() == 0) {
|
||||
throw new BajaRuntimeException("No default lexicons found for " + string2 + " for locale key " + string);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static InputStream[] getInputStreamsFromModule(BModule bModule, String string) throws Exception {
|
||||
String string2 = bModule.getModuleName();
|
||||
LexiconInfo[] lexiconInfoArray = Sys.getRegistry().getLexicons(string2, string);
|
||||
ArrayList<InputStream> arrayList = new ArrayList<InputStream>();
|
||||
int n = 0;
|
||||
while (n < lexiconInfoArray.length) {
|
||||
InputStream inputStream;
|
||||
if (!lexiconInfoArray[n].isDefault() && (inputStream = Lexicon.getInputStreamFromModule(lexiconInfoArray[n])) != null) {
|
||||
log.trace(" Adding module lexicon " + lexiconInfoArray[n].getContainerModuleName() + " to input stream list");
|
||||
arrayList.add(inputStream);
|
||||
}
|
||||
++n;
|
||||
}
|
||||
if (arrayList.size() == 0) {
|
||||
throw new BajaRuntimeException("No lexicons found for " + string2);
|
||||
}
|
||||
return arrayList.toArray(new InputStream[0]);
|
||||
}
|
||||
|
||||
public static InputStream getInputStreamFromModule(LexiconInfo lexiconInfo) throws Exception {
|
||||
Object object;
|
||||
String string = lexiconInfo.getModuleName();
|
||||
String string2 = lexiconInfo.getResourcePath();
|
||||
String string3 = lexiconInfo.getContainerModuleName();
|
||||
String string4 = lexiconInfo.getBrandPattern();
|
||||
String string5 = null;
|
||||
try {
|
||||
string5 = Brand.getBrandId();
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
if (string4.length() != 0 && string5 != null && !((PatternFilter)(object = new PatternFilter(string4))).accept(string5)) {
|
||||
log.warning("Lexicon loading: No brand match in module" + string);
|
||||
return null;
|
||||
}
|
||||
if (string == null || string.length() == 0 || string2 == null || string2.length() == 0 || string3 == null || string3.length() == 0) {
|
||||
throw new RegistryException("Unknown registry lexicon for " + string);
|
||||
}
|
||||
object = Lexicon.module(string3);
|
||||
BIFile bIFile = ((BZipSpace)object).findFile(new FilePath("zip", string2));
|
||||
if (bIFile != null) {
|
||||
lexiconInfo.setLastModified(bIFile.getLastModified());
|
||||
InputStream inputStream = bIFile.getInputStream();
|
||||
return inputStream;
|
||||
}
|
||||
StringBuffer stringBuffer = new StringBuffer("module://");
|
||||
stringBuffer.append(string3).append("/").append(string2);
|
||||
BOrd bOrd = BOrd.make(stringBuffer.toString());
|
||||
BIFile bIFile2 = (BIFile)((Object)bOrd.resolve().get());
|
||||
lexiconInfo.setLastModified(bIFile2.getLastModified());
|
||||
InputStream inputStream = bIFile2.getInputStream();
|
||||
return inputStream;
|
||||
}
|
||||
|
||||
public static InputStream getInputStream(BModule bModule, String string) throws Exception {
|
||||
String string2 = bModule.getModuleName();
|
||||
if (string != null) {
|
||||
return Nre.bootEnv.read("/lexicon/" + string + '/' + string2 + ".lexicon");
|
||||
}
|
||||
BOrd bOrd = BOrd.make("local:|module://" + string2 + '/' + string2 + ".lexicon");
|
||||
BIFile bIFile = (BIFile)((Object)bOrd.resolve().get());
|
||||
return bIFile.getInputStream();
|
||||
}
|
||||
|
||||
private static final InputStream getBrandInputStream(BModule bModule) throws Exception {
|
||||
String string = bModule.getModuleName();
|
||||
BOrd bOrd = BOrd.make("local:|module://brand/" + string + "_brand.lexicon");
|
||||
BIFile bIFile = (BIFile)((Object)bOrd.resolve().get());
|
||||
return bIFile.getInputStream();
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
public static void invalidateCache() {
|
||||
HashMap hashMap = common;
|
||||
synchronized (hashMap) {
|
||||
log.trace("Entire lexicon cache is being cleared");
|
||||
common.clear();
|
||||
extendedPropsModules.clear();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector searchLexiconCache(String string) {
|
||||
log.trace(" Searching for Lexicon entries containing " + string);
|
||||
Vector<String[]> vector = new Vector<String[]>();
|
||||
Iterator iterator = common.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
String string2 = (String)iterator.next();
|
||||
Properties properties = (Properties)common.get(string2);
|
||||
Iterator<Object> iterator2 = properties.keySet().iterator();
|
||||
while (iterator2.hasNext()) {
|
||||
String string3 = (String)iterator2.next();
|
||||
String string4 = (String)properties.get(string3);
|
||||
if (string4.indexOf(string) < 0) continue;
|
||||
String[] stringArray = new String[]{string2, string3, string4};
|
||||
vector.add(stringArray);
|
||||
}
|
||||
}
|
||||
return vector;
|
||||
}
|
||||
|
||||
protected Lexicon(BModule bModule, String string) {
|
||||
this(bModule, string, "", "");
|
||||
}
|
||||
|
||||
protected Lexicon(BModule bModule, String string, String string2, String string3) {
|
||||
if (string == null || string.equals("")) {
|
||||
string = Sys.getLanguage();
|
||||
}
|
||||
if (string == null) {
|
||||
throw new RuntimeException("Invalid Nre boot sequence, Sys.lang null");
|
||||
}
|
||||
String string4 = string;
|
||||
if (string2 == null) {
|
||||
string2 = "";
|
||||
}
|
||||
if (string2.length() > 0) {
|
||||
string4 = string4 + '_' + string2;
|
||||
}
|
||||
if (string3 == null) {
|
||||
string3 = "";
|
||||
}
|
||||
if (string3.length() > 0) {
|
||||
string4 = string4 + '_' + string3;
|
||||
}
|
||||
this.module = bModule;
|
||||
this.language = string;
|
||||
this.country = string2;
|
||||
this.variant = string3;
|
||||
if (bModule == null) {
|
||||
this.moduleProps = empty;
|
||||
this.langProps = empty;
|
||||
return;
|
||||
}
|
||||
this.moduleProps = Lexicon.load(bModule, null);
|
||||
this.langProps = Lexicon.load(bModule, string4);
|
||||
if (this.langProps.isEmpty()) {
|
||||
this.langProps = Lexicon.load(bModule, string);
|
||||
}
|
||||
String string5 = Lexicon.getCommonKey(bModule, string4);
|
||||
if (!extendedPropsModules.contains(bModule.getModuleName())) {
|
||||
Lexicon.loadFromModule(bModule, null);
|
||||
extendedPropsModules.add(bModule.getModuleName());
|
||||
}
|
||||
if (!extendedPropsModules.contains(string5)) {
|
||||
Lexicon.loadFromModule(bModule, string4);
|
||||
extendedPropsModules.add(string5);
|
||||
}
|
||||
}
|
||||
|
||||
private static abstract class LexiconProcessor {
|
||||
public abstract String format(String var1, Lexicon var2);
|
||||
|
||||
private LexiconProcessor() {
|
||||
}
|
||||
}
|
||||
|
||||
private static class NestedLexiconTag
|
||||
extends LexiconTag {
|
||||
private static final String TAG = "lexicon";
|
||||
|
||||
public String getTagName() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
public String getValue(String string, Lexicon lexicon) {
|
||||
String[] stringArray = TextUtil.split((String)string, (char)':');
|
||||
if (stringArray.length == 1) {
|
||||
return Lexicon.process(lexicon.get(stringArray[0].trim()), lexicon);
|
||||
}
|
||||
if (stringArray.length == 2) {
|
||||
Lexicon lexicon2 = Lexicon.make(stringArray[0].trim(), lexicon.language, lexicon.country, lexicon.variant);
|
||||
if (lexicon2.module == null) {
|
||||
return stringArray[1].trim();
|
||||
}
|
||||
return Lexicon.process(lexicon2.get(stringArray[1].trim()), lexicon2);
|
||||
}
|
||||
throw new BajaRuntimeException("Invalid parameters: " + string);
|
||||
}
|
||||
|
||||
private NestedLexiconTag() {
|
||||
}
|
||||
}
|
||||
|
||||
private static class BrandLexiconTag
|
||||
extends LexiconTag {
|
||||
protected static String TAG = "brand";
|
||||
|
||||
public String getTagName() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
public String getValue(String string, Lexicon lexicon) {
|
||||
String string2 = "";
|
||||
try {
|
||||
string2 = Brand.getBrandId();
|
||||
}
|
||||
catch (Exception exception) {
|
||||
return null;
|
||||
}
|
||||
String[] stringArray = TextUtil.split((String)string, (char)':');
|
||||
if (stringArray.length == 3) {
|
||||
if (string2.equalsIgnoreCase(stringArray[0].trim())) {
|
||||
if (stringArray[1].trim() != lexicon.module.getModuleName()) {
|
||||
Lexicon lexicon2 = Lexicon.make(stringArray[1].trim());
|
||||
return lexicon2.getText(stringArray[2].trim());
|
||||
}
|
||||
return lexicon.getText(stringArray[2].trim());
|
||||
}
|
||||
return stringArray[2].trim();
|
||||
}
|
||||
if (stringArray.length == 2) {
|
||||
if (string2.equalsIgnoreCase(stringArray[0].trim())) {
|
||||
return lexicon.getText(stringArray[1].trim());
|
||||
}
|
||||
return stringArray[1].trim();
|
||||
}
|
||||
throw new BajaRuntimeException("Invalid parameters: " + string);
|
||||
}
|
||||
|
||||
private BrandLexiconTag() {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private static abstract class LexiconTag
|
||||
extends LexiconProcessor {
|
||||
protected final String tagStart;
|
||||
|
||||
public abstract String getTagName();
|
||||
|
||||
public abstract String getValue(String var1, Lexicon var2);
|
||||
|
||||
public final String format(String string, Lexicon lexicon) {
|
||||
while (string.indexOf(this.tagStart) != -1) {
|
||||
int n = string.indexOf(this.tagStart);
|
||||
int n2 = string.indexOf("}", n);
|
||||
StringBuffer stringBuffer = new StringBuffer((int)((double)string.length() * 1.25));
|
||||
stringBuffer.append(string.substring(0, n));
|
||||
stringBuffer.append(this.getValue(string.substring(n + this.tagStart.length(), n2), lexicon));
|
||||
stringBuffer.append(string.substring(n2 + 1));
|
||||
string = stringBuffer.toString();
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.tagStart = "{" + this.getTagName() + ':';
|
||||
}
|
||||
|
||||
private LexiconTag() {
|
||||
this.this();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import javax.baja.sys.BModule;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.Lexicon;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class LexiconText {
|
||||
public final BModule module;
|
||||
public final String key;
|
||||
private String defaultLang;
|
||||
private String defaultContext;
|
||||
|
||||
public static LexiconText make(Type type, String string) {
|
||||
return LexiconText.make(type.getModule(), string);
|
||||
}
|
||||
|
||||
public static LexiconText make(BModule bModule, String string) {
|
||||
return new LexiconText(bModule, string);
|
||||
}
|
||||
|
||||
public static LexiconText make(String string, String string2) {
|
||||
return LexiconText.make(Lexicon.module(string), string2);
|
||||
}
|
||||
|
||||
public String get(Context context, String string) {
|
||||
if (context == null) {
|
||||
if (!this.defaultLang.equals(Sys.getLanguage())) {
|
||||
this.defaultLang = Sys.getLanguage();
|
||||
this.defaultContext = Lexicon.make(this.module, context).get(this.key);
|
||||
}
|
||||
if (this.defaultContext == null) {
|
||||
return string;
|
||||
}
|
||||
return this.defaultContext;
|
||||
}
|
||||
String string2 = Lexicon.make(this.module, context).get(this.key);
|
||||
if (string2 == null) {
|
||||
return string;
|
||||
}
|
||||
return string2;
|
||||
}
|
||||
|
||||
public String getText(Context context) {
|
||||
return this.get(context, this.key);
|
||||
}
|
||||
|
||||
public String getText(Context context, Object[] objectArray) {
|
||||
String string = this.get(context, null);
|
||||
if (string == null) {
|
||||
return this.key;
|
||||
}
|
||||
return MessageFormat.format(string, objectArray);
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.defaultLang = "???";
|
||||
}
|
||||
|
||||
protected LexiconText(BModule bModule, String string) {
|
||||
this.this();
|
||||
this.module = bModule;
|
||||
this.key = string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.LongHashMap
|
||||
* javax.baja.nre.util.LongHashMap$Iterator
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.nre.util.LongHashMap;
|
||||
|
||||
public class LongHashMap {
|
||||
private javax.baja.nre.util.LongHashMap longHashMap;
|
||||
|
||||
public void clear() {
|
||||
this.longHashMap.clear();
|
||||
}
|
||||
|
||||
public Object clone() {
|
||||
LongHashMap longHashMap = new LongHashMap();
|
||||
longHashMap.longHashMap = (javax.baja.nre.util.LongHashMap)this.longHashMap.clone();
|
||||
return longHashMap;
|
||||
}
|
||||
|
||||
public boolean equals(Object object) {
|
||||
return this.longHashMap.equals(object);
|
||||
}
|
||||
|
||||
public Object get(long l) {
|
||||
return this.longHashMap.get(l);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.longHashMap.hashCode();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return this.longHashMap.isEmpty();
|
||||
}
|
||||
|
||||
public Iterator iterator() {
|
||||
return new Iterator(this.longHashMap.iterator());
|
||||
}
|
||||
|
||||
public Object put(long l, Object object) {
|
||||
return this.longHashMap.put(l, object);
|
||||
}
|
||||
|
||||
public Object remove(long l) {
|
||||
return this.longHashMap.remove(l);
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return this.longHashMap.size();
|
||||
}
|
||||
|
||||
public Object[] toArray(Object[] objectArray) {
|
||||
return this.longHashMap.toArray(objectArray);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.longHashMap.toString();
|
||||
}
|
||||
|
||||
public LongHashMap() {
|
||||
this.longHashMap = new javax.baja.nre.util.LongHashMap();
|
||||
}
|
||||
|
||||
public LongHashMap(int n) {
|
||||
this.longHashMap = new javax.baja.nre.util.LongHashMap(n);
|
||||
}
|
||||
|
||||
public LongHashMap(int n, float f) {
|
||||
this.longHashMap = new javax.baja.nre.util.LongHashMap(n, f);
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class Iterator
|
||||
implements java.util.Iterator {
|
||||
private LongHashMap.Iterator iterator;
|
||||
|
||||
public boolean equals(Object object) {
|
||||
return this.iterator.equals(object);
|
||||
}
|
||||
|
||||
public boolean hasNext() {
|
||||
return this.iterator.hasNext();
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.iterator.hashCode();
|
||||
}
|
||||
|
||||
public long key() {
|
||||
return this.iterator.key();
|
||||
}
|
||||
|
||||
public Object next() {
|
||||
return this.iterator.next();
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
this.iterator.remove();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.iterator.toString();
|
||||
}
|
||||
|
||||
private Iterator(LongHashMap.Iterator iterator) {
|
||||
this.iterator = iterator;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.OrderedHashMap
|
||||
* javax.baja.nre.util.OrderedHashMap$Entry
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.baja.nre.util.OrderedHashMap;
|
||||
|
||||
public class OrderedHashMap
|
||||
implements Map {
|
||||
private javax.baja.nre.util.OrderedHashMap orderedHashMap;
|
||||
|
||||
public void clear() {
|
||||
this.orderedHashMap.clear();
|
||||
}
|
||||
|
||||
public boolean containsKey(Object object) {
|
||||
return this.orderedHashMap.containsKey(object);
|
||||
}
|
||||
|
||||
public boolean containsValue(Object object) {
|
||||
return this.orderedHashMap.containsValue(object);
|
||||
}
|
||||
|
||||
public Set entrySet() {
|
||||
return this.orderedHashMap.entrySet();
|
||||
}
|
||||
|
||||
public boolean equals(Object object) {
|
||||
return this.orderedHashMap.equals(object);
|
||||
}
|
||||
|
||||
public Object get(Object object) {
|
||||
return this.orderedHashMap.get(object);
|
||||
}
|
||||
|
||||
public OrderedHashMap.Entry getEldestEntry() {
|
||||
return this.orderedHashMap.getEldestEntry();
|
||||
}
|
||||
|
||||
public OrderedHashMap.Entry getNewestEntry() {
|
||||
return this.orderedHashMap.getNewestEntry();
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.orderedHashMap.hashCode();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return this.orderedHashMap.isEmpty();
|
||||
}
|
||||
|
||||
public Set keySet() {
|
||||
return this.orderedHashMap.keySet();
|
||||
}
|
||||
|
||||
public Object put(Object object, Object object2) {
|
||||
return this.orderedHashMap.put(object, object2);
|
||||
}
|
||||
|
||||
public void putAll(Map map) {
|
||||
this.orderedHashMap.putAll(map);
|
||||
}
|
||||
|
||||
public Object remove(Object object) {
|
||||
return this.orderedHashMap.remove(object);
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return this.orderedHashMap.size();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.orderedHashMap.toString();
|
||||
}
|
||||
|
||||
public Collection values() {
|
||||
return this.orderedHashMap.values();
|
||||
}
|
||||
|
||||
public OrderedHashMap() {
|
||||
this.orderedHashMap = new javax.baja.nre.util.OrderedHashMap();
|
||||
}
|
||||
|
||||
public OrderedHashMap(boolean bl) {
|
||||
this.orderedHashMap = new javax.baja.nre.util.OrderedHashMap(bl);
|
||||
}
|
||||
|
||||
public OrderedHashMap(int n, float f, boolean bl) {
|
||||
this.orderedHashMap = new javax.baja.nre.util.OrderedHashMap(n, f, bl);
|
||||
}
|
||||
|
||||
public OrderedHashMap(Map map) {
|
||||
this.orderedHashMap = new javax.baja.nre.util.OrderedHashMap(map);
|
||||
}
|
||||
|
||||
public static interface Entry
|
||||
extends OrderedHashMap.Entry {
|
||||
public Object getKey();
|
||||
|
||||
public Object getValue();
|
||||
|
||||
public void setValue(Object var1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.nre.util.IFilter
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.file.IFileFilter;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.nre.util.IFilter;
|
||||
import javax.baja.sys.Context;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class PatternFilter
|
||||
implements IFilter,
|
||||
IFileFilter {
|
||||
private State start;
|
||||
private State accept;
|
||||
private String pattern;
|
||||
static /* synthetic */ Class class$javax$baja$util$PatternFilter$State;
|
||||
|
||||
public static PatternFilter[] parseList(String string, String string2) {
|
||||
ArrayList<PatternFilter> arrayList = new ArrayList<PatternFilter>();
|
||||
StringTokenizer stringTokenizer = new StringTokenizer(string, string2);
|
||||
while (stringTokenizer.hasMoreTokens()) {
|
||||
arrayList.add(new PatternFilter(stringTokenizer.nextToken()));
|
||||
}
|
||||
return arrayList.toArray(new PatternFilter[arrayList.size()]);
|
||||
}
|
||||
|
||||
public static PatternFilter[] parseList(String string) {
|
||||
return PatternFilter.parseList(string, " \t,;");
|
||||
}
|
||||
|
||||
public String getPattern() {
|
||||
return this.pattern;
|
||||
}
|
||||
|
||||
public String getDescription(Context context) {
|
||||
return this.pattern;
|
||||
}
|
||||
|
||||
public boolean accept(BIFile bIFile) {
|
||||
return this.accept(bIFile.getFileName());
|
||||
}
|
||||
|
||||
public boolean accept(Object object) {
|
||||
return this.accept(object.toString());
|
||||
}
|
||||
|
||||
public boolean accept(String string) {
|
||||
Class clazz = class$javax$baja$util$PatternFilter$State;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$PatternFilter$State = PatternFilter.class("[Ljavax.baja.util.PatternFilter$State;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
array.push((Object)this.start);
|
||||
char[] cArray = string.toCharArray();
|
||||
int n = 0;
|
||||
while (n < cArray.length) {
|
||||
Class clazz2 = class$javax$baja$util$PatternFilter$State;
|
||||
if (clazz2 == null) {
|
||||
clazz2 = PatternFilter.class("[Ljavax.baja.util.PatternFilter$State;", false);
|
||||
}
|
||||
Array array2 = new Array(clazz2);
|
||||
while (!array.isEmpty()) {
|
||||
array2.addAll((Object[])((State)array.pop()).transition(cArray[n]));
|
||||
}
|
||||
if (array2.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
array = array2;
|
||||
++n;
|
||||
}
|
||||
return array.contains((Object)this.accept);
|
||||
}
|
||||
|
||||
public boolean hasWildChars() {
|
||||
boolean bl = false;
|
||||
if (this.pattern.indexOf(42) != -1 || this.pattern.indexOf(63) != -1) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
private final void parse() {
|
||||
State state = this.start = new State();
|
||||
char[] cArray = this.pattern.toCharArray();
|
||||
int n = 0;
|
||||
while (n < cArray.length) {
|
||||
char c = cArray[n];
|
||||
if (c == '*') {
|
||||
if (n <= 0 || cArray[n - 1] != '*') {
|
||||
state.addTransition(Condition.any(), state);
|
||||
}
|
||||
} else {
|
||||
state = c == '?' ? state.addTransition(Condition.any(), new State()) : state.addTransition(Condition.exact(c), new State());
|
||||
}
|
||||
++n;
|
||||
}
|
||||
this.accept = state;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public PatternFilter(String string) {
|
||||
this.pattern = string;
|
||||
this.parse();
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class State {
|
||||
private Map transitions;
|
||||
|
||||
public State addTransition(Condition condition, State state) {
|
||||
this.transitions.put(condition, state);
|
||||
return state;
|
||||
}
|
||||
|
||||
public State[] transition(char c) {
|
||||
Class clazz = class$javax$baja$util$PatternFilter$State;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$PatternFilter$State = PatternFilter.class("[Ljavax.baja.util.PatternFilter$State;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
Iterator iterator = this.transitions.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Condition condition = (Condition)iterator.next();
|
||||
if (!condition.match(c)) continue;
|
||||
array.add(this.transitions.get(condition));
|
||||
}
|
||||
return (State[])array.trim();
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.transitions = new HashMap();
|
||||
}
|
||||
|
||||
private State() {
|
||||
this.this();
|
||||
}
|
||||
}
|
||||
|
||||
private static abstract class Condition {
|
||||
public abstract boolean match(char var1);
|
||||
|
||||
public static Condition exact(final char c) {
|
||||
return new Condition(){
|
||||
|
||||
public final boolean match(char c2) {
|
||||
boolean bl = false;
|
||||
if (c == c2) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static Condition any() {
|
||||
return new Condition(){
|
||||
|
||||
public final boolean match(char c) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private Condition() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.util.QueueFullException;
|
||||
import javax.baja.util.Worker;
|
||||
|
||||
public class Queue
|
||||
implements Worker.ITodo {
|
||||
Entry head;
|
||||
Entry tail;
|
||||
int size;
|
||||
int maxSize;
|
||||
|
||||
public int size() {
|
||||
return this.size;
|
||||
}
|
||||
|
||||
public int maxSize() {
|
||||
return this.maxSize;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
boolean bl = false;
|
||||
if (this.size == 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public boolean isFull() {
|
||||
boolean bl = false;
|
||||
if (this.size == this.maxSize) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public synchronized Object tail() {
|
||||
if (this.tail == null) {
|
||||
return null;
|
||||
}
|
||||
return this.tail.value;
|
||||
}
|
||||
|
||||
public synchronized Object peek() {
|
||||
if (this.head == null) {
|
||||
return null;
|
||||
}
|
||||
return this.head.value;
|
||||
}
|
||||
|
||||
public synchronized Object peek(int n) throws InterruptedException {
|
||||
while (this.size == 0) {
|
||||
if (n == -1) {
|
||||
this.wait();
|
||||
continue;
|
||||
}
|
||||
this.wait(n);
|
||||
break;
|
||||
}
|
||||
return this.peek();
|
||||
}
|
||||
|
||||
public synchronized Object find(Object object) {
|
||||
Entry entry = this.head;
|
||||
while (entry != null) {
|
||||
if (entry.value.equals(object)) {
|
||||
return entry.value;
|
||||
}
|
||||
entry = entry.next;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public synchronized Object dequeue() {
|
||||
Entry entry = this.head;
|
||||
if (entry == null) {
|
||||
return null;
|
||||
}
|
||||
this.head = entry.next;
|
||||
if (this.head == null) {
|
||||
this.tail = null;
|
||||
}
|
||||
entry.next = null;
|
||||
--this.size;
|
||||
return entry.value;
|
||||
}
|
||||
|
||||
public synchronized Object dequeue(int n) throws InterruptedException {
|
||||
while (this.size == 0) {
|
||||
if (n == -1) {
|
||||
this.wait();
|
||||
continue;
|
||||
}
|
||||
this.wait(n);
|
||||
break;
|
||||
}
|
||||
return this.dequeue();
|
||||
}
|
||||
|
||||
public synchronized boolean enqueue(Object object) throws QueueFullException {
|
||||
if (this.size >= this.maxSize) {
|
||||
throw new QueueFullException();
|
||||
}
|
||||
if (object == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
Entry entry = this.newEntry(object);
|
||||
entry.next = null;
|
||||
if (this.tail == null) {
|
||||
this.head = this.tail = entry;
|
||||
} else {
|
||||
this.tail.next = entry;
|
||||
this.tail = entry;
|
||||
}
|
||||
++this.size;
|
||||
this.notifyAll();
|
||||
return true;
|
||||
}
|
||||
|
||||
public synchronized boolean push(Object object) throws QueueFullException {
|
||||
if (this.size >= this.maxSize) {
|
||||
throw new QueueFullException();
|
||||
}
|
||||
if (object == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
Entry entry = this.newEntry(object);
|
||||
entry.next = null;
|
||||
if (this.head == null) {
|
||||
this.head = this.tail = entry;
|
||||
} else {
|
||||
entry.next = this.head;
|
||||
this.head = entry;
|
||||
}
|
||||
++this.size;
|
||||
this.notifyAll();
|
||||
return true;
|
||||
}
|
||||
|
||||
Entry newEntry(Object object) {
|
||||
return new Entry(object);
|
||||
}
|
||||
|
||||
public synchronized Object[] toArray() {
|
||||
Object[] objectArray = new Object[this.size];
|
||||
Entry entry = this.head;
|
||||
int n = 0;
|
||||
while (entry != null) {
|
||||
objectArray[n] = entry.value;
|
||||
entry = entry.next;
|
||||
++n;
|
||||
}
|
||||
return objectArray;
|
||||
}
|
||||
|
||||
public synchronized void clear() {
|
||||
this.size = 0;
|
||||
this.head = null;
|
||||
this.tail = null;
|
||||
this.notifyAll();
|
||||
}
|
||||
|
||||
public Runnable todo(int n) throws InterruptedException {
|
||||
return (Runnable)this.dequeue(n);
|
||||
}
|
||||
|
||||
public Queue(int n) {
|
||||
this.maxSize = n;
|
||||
}
|
||||
|
||||
public Queue() {
|
||||
this(Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
static class Entry {
|
||||
Entry next;
|
||||
Object value;
|
||||
|
||||
Entry(Object object) {
|
||||
this.value = object;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.sys.BajaRuntimeException;
|
||||
|
||||
public class QueueFullException
|
||||
extends BajaRuntimeException {
|
||||
public QueueFullException(String string) {
|
||||
super(string);
|
||||
}
|
||||
|
||||
public QueueFullException() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.SortUtil
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
public class SortUtil {
|
||||
public static final Comparator ASCENDING = new Comparator(){
|
||||
|
||||
public final int compare(Object object, Object object2) {
|
||||
return javax.baja.nre.util.SortUtil.compare((Object)object, (Object)object2);
|
||||
}
|
||||
};
|
||||
public static final Comparator DESCENDING = new Comparator(){
|
||||
|
||||
public final int compare(Object object, Object object2) {
|
||||
return -1 * javax.baja.nre.util.SortUtil.compare((Object)object, (Object)object2);
|
||||
}
|
||||
};
|
||||
|
||||
public static void sort(Object[] objectArray) {
|
||||
javax.baja.nre.util.SortUtil.sort((Object[])objectArray);
|
||||
}
|
||||
|
||||
public static void rsort(Object[] objectArray) {
|
||||
javax.baja.nre.util.SortUtil.rsort((Object[])objectArray);
|
||||
}
|
||||
|
||||
public static void sort(Object[] objectArray, Object[] objectArray2) {
|
||||
javax.baja.nre.util.SortUtil.sort((Object[])objectArray, (Object[])objectArray2, (Comparator)ASCENDING);
|
||||
}
|
||||
|
||||
public static void rsort(Object[] objectArray, Object[] objectArray2) {
|
||||
javax.baja.nre.util.SortUtil.sort((Object[])objectArray, (Object[])objectArray2, (Comparator)DESCENDING);
|
||||
}
|
||||
|
||||
public static void sort(Object[] objectArray, Object[] objectArray2, boolean bl) {
|
||||
javax.baja.nre.util.SortUtil.sort((Object[])objectArray, (Object[])objectArray2, (Comparator)(bl ? ASCENDING : DESCENDING));
|
||||
}
|
||||
|
||||
public static void sort(Object[] objectArray, Object[] objectArray2, Comparator comparator) {
|
||||
javax.baja.nre.util.SortUtil.sort((Object[])objectArray, (Object[])objectArray2, (Comparator)comparator);
|
||||
}
|
||||
|
||||
public static int compare(Object object, Object object2) {
|
||||
return javax.baja.nre.util.SortUtil.compare((Object)object, (Object)object2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,248 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
public class StringToIntMap {
|
||||
private Entry[] table;
|
||||
private int count;
|
||||
private int threshold;
|
||||
private float loadFactor;
|
||||
|
||||
public int size() {
|
||||
return this.count;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
boolean bl = false;
|
||||
if (this.count == 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public Iterator keys() {
|
||||
return new StringToIntMapIterator();
|
||||
}
|
||||
|
||||
public int get(String string) {
|
||||
return this.get(string, -1);
|
||||
}
|
||||
|
||||
public synchronized int get(String string, int n) {
|
||||
Entry[] entryArray = this.table;
|
||||
int n2 = string.hashCode();
|
||||
int n3 = (n2 & Integer.MAX_VALUE) % entryArray.length;
|
||||
Entry entry = entryArray[n3];
|
||||
while (entry != null) {
|
||||
if (entry.hash == n2 && entry.key.equals(string)) {
|
||||
return entry.value;
|
||||
}
|
||||
entry = entry.next;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
private final void rehash() {
|
||||
int n = this.table.length;
|
||||
Entry[] entryArray = this.table;
|
||||
int n2 = n * 2 + 1;
|
||||
Entry[] entryArray2 = new Entry[n2];
|
||||
this.threshold = (int)((float)n2 * this.loadFactor);
|
||||
this.table = entryArray2;
|
||||
int n3 = n;
|
||||
while (n3-- > 0) {
|
||||
Entry entry = entryArray[n3];
|
||||
while (entry != null) {
|
||||
Entry entry2 = entry;
|
||||
entry = entry.next;
|
||||
int n4 = (entry2.hash & Integer.MAX_VALUE) % n2;
|
||||
entry2.next = entryArray2[n4];
|
||||
entryArray2[n4] = entry2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void put(String string, int n) {
|
||||
Entry[] entryArray = this.table;
|
||||
int n2 = string.hashCode();
|
||||
int n3 = (n2 & Integer.MAX_VALUE) % entryArray.length;
|
||||
Entry entry = entryArray[n3];
|
||||
while (entry != null) {
|
||||
if (entry.hash == n2 && entry.key.equals(string)) {
|
||||
entry.value = n;
|
||||
return;
|
||||
}
|
||||
entry = entry.next;
|
||||
}
|
||||
if (this.count >= this.threshold) {
|
||||
this.rehash();
|
||||
this.put(string, n);
|
||||
return;
|
||||
}
|
||||
entry = new Entry();
|
||||
entry.hash = n2;
|
||||
entry.key = string;
|
||||
entry.value = n;
|
||||
entry.next = entryArray[n3];
|
||||
entryArray[n3] = entry;
|
||||
++this.count;
|
||||
}
|
||||
|
||||
public synchronized void remove(String string) {
|
||||
Entry[] entryArray = this.table;
|
||||
int n = string.hashCode();
|
||||
int n2 = (n & Integer.MAX_VALUE) % entryArray.length;
|
||||
Entry entry = entryArray[n2];
|
||||
Entry entry2 = null;
|
||||
while (entry != null) {
|
||||
if (entry.hash == n && entry.key.equals(string)) {
|
||||
if (entry2 != null) {
|
||||
entry2.next = entry.next;
|
||||
} else {
|
||||
entryArray[n2] = entry.next;
|
||||
}
|
||||
--this.count;
|
||||
return;
|
||||
}
|
||||
entry2 = entry;
|
||||
entry = entry.next;
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void clear() {
|
||||
Entry[] entryArray = this.table;
|
||||
int n = entryArray.length;
|
||||
while (--n >= 0) {
|
||||
entryArray[n] = null;
|
||||
}
|
||||
this.count = 0;
|
||||
}
|
||||
|
||||
public boolean equals(Object object) {
|
||||
if (!(object instanceof StringToIntMap)) {
|
||||
return false;
|
||||
}
|
||||
if (this == object) {
|
||||
return true;
|
||||
}
|
||||
StringToIntMap stringToIntMap = (StringToIntMap)object;
|
||||
int n = 0;
|
||||
while (n < this.table.length) {
|
||||
Entry entry = this.table[n];
|
||||
while (entry != null) {
|
||||
int n2 = entry.value;
|
||||
int n3 = stringToIntMap.get(entry.key);
|
||||
if (n3 != n2) {
|
||||
return false;
|
||||
}
|
||||
entry = entry.next;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public synchronized Object clone() {
|
||||
StringToIntMap stringToIntMap = new StringToIntMap(this.size() * 3);
|
||||
int n = 0;
|
||||
while (n < this.table.length) {
|
||||
Entry entry = this.table[n];
|
||||
while (entry != null) {
|
||||
stringToIntMap.put(entry.key, entry.value);
|
||||
entry = entry.next;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return stringToIntMap;
|
||||
}
|
||||
|
||||
public StringToIntMap() {
|
||||
this(31, 0.75f);
|
||||
}
|
||||
|
||||
public StringToIntMap(int n) {
|
||||
this(n, 0.75f);
|
||||
}
|
||||
|
||||
public StringToIntMap(int n, float f) {
|
||||
if (n <= 0 || (double)f <= 0.0) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.loadFactor = f;
|
||||
this.table = new Entry[n];
|
||||
this.threshold = (int)((float)n * f);
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
class StringToIntMapIterator
|
||||
implements Iterator {
|
||||
private int index;
|
||||
private Entry entry;
|
||||
|
||||
/*
|
||||
* Unable to fully structure code
|
||||
*/
|
||||
public boolean hasNext() {
|
||||
if (this.entry == null) ** GOTO lbl6
|
||||
return true;
|
||||
lbl-1000:
|
||||
// 1 sources
|
||||
|
||||
{
|
||||
this.entry = StringToIntMap.access$0(StringToIntMap.this)[this.index];
|
||||
if (this.entry == null) continue;
|
||||
return true;
|
||||
lbl6:
|
||||
// 2 sources
|
||||
|
||||
** while (this.index-- > 0)
|
||||
}
|
||||
lbl7:
|
||||
// 1 sources
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public Object next() {
|
||||
if (this.entry == null) {
|
||||
while (this.index-- > 0 && (this.entry = StringToIntMap.this.table[this.index]) == null) {
|
||||
}
|
||||
}
|
||||
if (this.entry != null) {
|
||||
Entry entry = this.entry;
|
||||
this.entry = entry.next;
|
||||
return entry.key;
|
||||
}
|
||||
throw new NoSuchElementException("IntHashtable");
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.index = StringToIntMap.this.table.length;
|
||||
}
|
||||
|
||||
StringToIntMapIterator() {
|
||||
this.this();
|
||||
}
|
||||
}
|
||||
|
||||
static class Entry {
|
||||
int hash;
|
||||
String key;
|
||||
int value;
|
||||
Entry next;
|
||||
|
||||
Entry() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.TextUtil
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
public class TextUtil {
|
||||
public static String byteToString(int n) {
|
||||
return javax.baja.nre.util.TextUtil.byteToString((int)n);
|
||||
}
|
||||
|
||||
public static String bytesToHexString(byte[] byArray) {
|
||||
return javax.baja.nre.util.TextUtil.bytesToHexString((byte[])byArray);
|
||||
}
|
||||
|
||||
public static String byteToHexString(int n) {
|
||||
return javax.baja.nre.util.TextUtil.intToHexString((int)(n & 0xFF), (int)2);
|
||||
}
|
||||
|
||||
public static char byteToChar(int n, char c) {
|
||||
return javax.baja.nre.util.TextUtil.byteToChar((int)n, (char)c);
|
||||
}
|
||||
|
||||
public static String intToHexString(int n) {
|
||||
return javax.baja.nre.util.TextUtil.padZeros((String)Integer.toHexString(n), (int)8);
|
||||
}
|
||||
|
||||
public static String intToHexString(int n, int n2) {
|
||||
return javax.baja.nre.util.TextUtil.padZeros((String)Integer.toHexString(n), (int)n2);
|
||||
}
|
||||
|
||||
public static int charToInt(char c) {
|
||||
return javax.baja.nre.util.TextUtil.charToInt((char)c);
|
||||
}
|
||||
|
||||
public static int hexCharToInt(char c) {
|
||||
return javax.baja.nre.util.TextUtil.hexCharToInt((char)c);
|
||||
}
|
||||
|
||||
public static boolean isHex(String string) {
|
||||
return javax.baja.nre.util.TextUtil.isHex((String)string);
|
||||
}
|
||||
|
||||
public static String getSpaces(int n) {
|
||||
return javax.baja.nre.util.TextUtil.getSpaces((int)n);
|
||||
}
|
||||
|
||||
public static String pad(String string, int n) {
|
||||
return javax.baja.nre.util.TextUtil.padRight((String)string, (int)n);
|
||||
}
|
||||
|
||||
public static String padRight(String string, int n) {
|
||||
return javax.baja.nre.util.TextUtil.padRight((String)string, (int)n);
|
||||
}
|
||||
|
||||
public static String padLeft(String string, int n) {
|
||||
return javax.baja.nre.util.TextUtil.padLeft((String)string, (int)n);
|
||||
}
|
||||
|
||||
public static String truncate(String string, int n) {
|
||||
return javax.baja.nre.util.TextUtil.truncate((String)string, (int)n);
|
||||
}
|
||||
|
||||
public static String padZeros(String string, int n) {
|
||||
return javax.baja.nre.util.TextUtil.padZeros((String)string, (int)n);
|
||||
}
|
||||
|
||||
public static String getZeros(int n) {
|
||||
return javax.baja.nre.util.TextUtil.getZeros((int)n);
|
||||
}
|
||||
|
||||
public static char toUpperCase(char c) {
|
||||
return javax.baja.nre.util.TextUtil.toUpperCase((char)c);
|
||||
}
|
||||
|
||||
public static char toLowerCase(char c) {
|
||||
return javax.baja.nre.util.TextUtil.toLowerCase((char)c);
|
||||
}
|
||||
|
||||
public static String toUpperCase(String string) {
|
||||
return javax.baja.nre.util.TextUtil.toUpperCase((String)string);
|
||||
}
|
||||
|
||||
public static String toLowerCase(String string) {
|
||||
return javax.baja.nre.util.TextUtil.toLowerCase((String)string);
|
||||
}
|
||||
|
||||
public static String capitalize(String string) {
|
||||
return javax.baja.nre.util.TextUtil.capitalize((String)string);
|
||||
}
|
||||
|
||||
public static String decapitalize(String string) {
|
||||
return javax.baja.nre.util.TextUtil.decapitalize((String)string);
|
||||
}
|
||||
|
||||
public static String toFriendly(String string) {
|
||||
return javax.baja.nre.util.TextUtil.toFriendly((String)string);
|
||||
}
|
||||
|
||||
public static String fromFriendly(String string) {
|
||||
return javax.baja.nre.util.TextUtil.fromFriendly((String)string);
|
||||
}
|
||||
|
||||
public static String getClassName(Class clazz) {
|
||||
return javax.baja.nre.util.TextUtil.getClassName((Class)clazz);
|
||||
}
|
||||
|
||||
public static String getClassName(String string) {
|
||||
return javax.baja.nre.util.TextUtil.getClassName((String)string);
|
||||
}
|
||||
|
||||
public static String getPackageName(Class clazz) {
|
||||
return javax.baja.nre.util.TextUtil.getPackageName((Class)clazz);
|
||||
}
|
||||
|
||||
public static String getPackageName(String string) {
|
||||
return javax.baja.nre.util.TextUtil.getPackageName((String)string);
|
||||
}
|
||||
|
||||
public static String stripMarkup(String string) {
|
||||
return javax.baja.nre.util.TextUtil.stripMarkup((String)string);
|
||||
}
|
||||
|
||||
public static String[] split(String string, char c) {
|
||||
return javax.baja.nre.util.TextUtil.split((String)string, (char)c);
|
||||
}
|
||||
|
||||
public static String[] splitAndTrim(String string, char c) {
|
||||
return javax.baja.nre.util.TextUtil.trim((String[])TextUtil.split(string, c));
|
||||
}
|
||||
|
||||
public static String[] ensureCapacity(String[] stringArray, int n) {
|
||||
return javax.baja.nre.util.TextUtil.ensureCapacity((String[])stringArray, (int)n);
|
||||
}
|
||||
|
||||
public static String[] trim(String[] stringArray) {
|
||||
return javax.baja.nre.util.TextUtil.trim((String[])stringArray);
|
||||
}
|
||||
|
||||
public static String join(String[] stringArray, char c) {
|
||||
return javax.baja.nre.util.TextUtil.join((String[])stringArray, (char)c);
|
||||
}
|
||||
|
||||
public static String trimLeft(String string) {
|
||||
return javax.baja.nre.util.TextUtil.trimLeft((String)string);
|
||||
}
|
||||
|
||||
public static String trimRight(String string) {
|
||||
return javax.baja.nre.util.TextUtil.trimRight((String)string);
|
||||
}
|
||||
|
||||
public static String replace(String string, String string2, String string3) {
|
||||
return javax.baja.nre.util.TextUtil.replace((String)string, (String)string2, (String)string3);
|
||||
}
|
||||
|
||||
public static StringBuffer replace(StringBuffer stringBuffer, String string, String string2) {
|
||||
return javax.baja.nre.util.TextUtil.replace((StringBuffer)stringBuffer, (String)string, (String)string2);
|
||||
}
|
||||
|
||||
public static int indexOf(StringBuffer stringBuffer, String string) {
|
||||
return javax.baja.nre.util.TextUtil.indexOf((StringBuffer)stringBuffer, (String)string);
|
||||
}
|
||||
|
||||
public static int indexOf(StringBuffer stringBuffer, String string, int n) {
|
||||
return javax.baja.nre.util.TextUtil.indexOf((StringBuffer)stringBuffer, (String)string, (int)n);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,338 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.Array
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.spy.SpyWriter;
|
||||
import javax.baja.sys.Clock;
|
||||
import javax.baja.util.Worker;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class ThreadPoolWorker
|
||||
extends Worker {
|
||||
static final long IDLE_THREAD_EXPIRATION = Long.getLong("niagara.threadPoolWorker.idleExpiration", 10000L);
|
||||
int maxThreads;
|
||||
ThreadPool pool;
|
||||
volatile int expiredWorkers;
|
||||
static /* synthetic */ Class class$javax$baja$util$ThreadPoolWorker$WorkerThread;
|
||||
|
||||
public int getMaxThreads() {
|
||||
return this.maxThreads;
|
||||
}
|
||||
|
||||
public void setMaxThreads(int n) {
|
||||
if (n < 1) {
|
||||
throw new IllegalArgumentException(n + " < 1");
|
||||
}
|
||||
this.maxThreads = n;
|
||||
}
|
||||
|
||||
public void start(ThreadGroup threadGroup, String string) {
|
||||
if (this.isAlive) {
|
||||
return;
|
||||
}
|
||||
this.pool.start();
|
||||
super.start(threadGroup, string);
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
this.isAlive = false;
|
||||
this.pool.stop();
|
||||
super.stop();
|
||||
}
|
||||
|
||||
protected void process(Runnable runnable) throws Exception {
|
||||
this.pool.run(runnable);
|
||||
}
|
||||
|
||||
protected void threadStarted() {
|
||||
}
|
||||
|
||||
protected void threadStopped() {
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
void removeThread(WorkerThread workerThread) {
|
||||
try {
|
||||
Array array = this.pool.threads;
|
||||
synchronized (array) {
|
||||
this.pool.threads.remove((Object)workerThread);
|
||||
}
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
++this.expiredWorkers;
|
||||
}
|
||||
|
||||
void spyImpl(SpyWriter spyWriter) {
|
||||
super.spyImpl(spyWriter);
|
||||
spyWriter.prop((Object)"maxThreads", "" + this.maxThreads);
|
||||
Array array = this.pool.threads;
|
||||
spyWriter.prop((Object)"currentThreadCount", array != null ? "" + array.size() : "null");
|
||||
spyWriter.prop((Object)"busyThreadCount", "" + this.getBusyThreadCount());
|
||||
spyWriter.prop((Object)"expiredThreadCount", "" + this.expiredWorkers);
|
||||
if (array != null) {
|
||||
int n = 0;
|
||||
while (n < array.size()) {
|
||||
WorkerThread workerThread = (WorkerThread)array.get(n);
|
||||
spyWriter.trTitle("Worker[" + n + "] " + workerThread.getName(), 2);
|
||||
spyWriter.prop((Object)"work", String.valueOf(workerThread.work));
|
||||
ThreadPoolWorker.spy(spyWriter, workerThread.startTime, workerThread.startTicks, workerThread.processingTicks, workerThread.numProcessed);
|
||||
++n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final int getBusyThreadCount() {
|
||||
Array array = this.pool.threads;
|
||||
if (array == null) {
|
||||
return 0;
|
||||
}
|
||||
WorkerThread[] workerThreadArray = (WorkerThread[])array.array();
|
||||
int n = workerThreadArray.length;
|
||||
int n2 = 0;
|
||||
int n3 = 0;
|
||||
while (n3 < n) {
|
||||
try {
|
||||
if (workerThreadArray[n3].work != null) {
|
||||
++n2;
|
||||
}
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
++n3;
|
||||
}
|
||||
return n2;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.maxThreads = 4;
|
||||
this.pool = new ThreadPool();
|
||||
this.expiredWorkers = 0;
|
||||
}
|
||||
|
||||
public ThreadPoolWorker(Worker.ITodo iTodo) {
|
||||
super(iTodo);
|
||||
this.this();
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
class ThreadPool {
|
||||
Array threads;
|
||||
|
||||
void start() {
|
||||
if (this.threads != null) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
Class clazz = class$javax$baja$util$ThreadPoolWorker$WorkerThread;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$util$ThreadPoolWorker$WorkerThread = ThreadPoolWorker.class("[Ljavax.baja.util.ThreadPoolWorker$WorkerThread;", false);
|
||||
}
|
||||
this.threads = new Array(clazz);
|
||||
}
|
||||
|
||||
void stop() {
|
||||
if (this.threads == null) {
|
||||
return;
|
||||
}
|
||||
WorkerThread[] workerThreadArray = (WorkerThread[])this.threads.trim();
|
||||
if (workerThreadArray != null) {
|
||||
int n = 0;
|
||||
while (n < workerThreadArray.length) {
|
||||
try {
|
||||
workerThreadArray[n].interrupt();
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
++n;
|
||||
}
|
||||
}
|
||||
this.threads = null;
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
* Converted monitor instructions to comments
|
||||
* Lifted jumps to return sites
|
||||
*/
|
||||
void run(Runnable runnable) throws InterruptedException {
|
||||
while (ThreadPoolWorker.this.isAlive) {
|
||||
block8: {
|
||||
Array array = this.threads;
|
||||
// MONITORENTER : array
|
||||
{
|
||||
Object object;
|
||||
while (this.threads.size() > ThreadPoolWorker.this.maxThreads) {
|
||||
WorkerThread workerThread = (WorkerThread)this.threads.remove(this.threads.size() - 1);
|
||||
workerThread.reduce();
|
||||
}
|
||||
int n = 0;
|
||||
while (n < this.threads.size()) {
|
||||
object = (WorkerThread)this.threads.get(n);
|
||||
if (!((WorkerThread)object).isBusy()) {
|
||||
((WorkerThread)object).run(runnable);
|
||||
// MONITOREXIT : array
|
||||
return;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
if (this.threads.size() >= ThreadPoolWorker.this.maxThreads) break block8;
|
||||
ThreadGroup threadGroup = ThreadPoolWorker.this.thread.getThreadGroup();
|
||||
object = ThreadPoolWorker.this.thread.getName() + '-' + this.threads.size();
|
||||
WorkerThread workerThread = new WorkerThread(threadGroup, (String)object);
|
||||
this.threads.add((Object)workerThread);
|
||||
workerThread.start();
|
||||
workerThread.run(runnable);
|
||||
// MONITOREXIT : array
|
||||
return;
|
||||
}
|
||||
}
|
||||
Thread.sleep(250L);
|
||||
}
|
||||
}
|
||||
|
||||
ThreadPool() {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
class WorkerThread
|
||||
extends Thread {
|
||||
volatile Runnable work;
|
||||
volatile boolean reduced;
|
||||
long startTime = Clock.millis();
|
||||
long startTicks;
|
||||
int numProcessed;
|
||||
long processingTicks;
|
||||
long lastJobTicks = this.startTicks = Clock.ticks();
|
||||
|
||||
synchronized void run(Runnable runnable) {
|
||||
if (this.work != null) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
this.work = runnable;
|
||||
this.notifyAll();
|
||||
}
|
||||
|
||||
boolean isBusy() {
|
||||
boolean bl = false;
|
||||
if (this.work != null || this.reduced) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
synchronized void reduce() {
|
||||
System.out.println("ThreadPoolWorker reduce: " + this);
|
||||
this.reduced = true;
|
||||
this.notifyAll();
|
||||
}
|
||||
|
||||
boolean isActive() {
|
||||
boolean bl = false;
|
||||
if (ThreadPoolWorker.this.isAlive && !this.reduced) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
|
||||
* Unable to fully structure code
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
* Converted monitor instructions to comments
|
||||
* Lifted jumps to return sites
|
||||
*/
|
||||
public void run() {
|
||||
try {
|
||||
ThreadPoolWorker.this.threadStarted();
|
||||
** GOTO lbl35
|
||||
{
|
||||
var3_1 = this;
|
||||
// MONITORENTER : var3_1
|
||||
{
|
||||
try {
|
||||
this.wait(ThreadPoolWorker.IDLE_THREAD_EXPIRATION);
|
||||
}
|
||||
catch (Exception v0) {}
|
||||
if (ThreadPoolWorker.IDLE_THREAD_EXPIRATION > 0L && Clock.ticks() - this.lastJobTicks > ThreadPoolWorker.IDLE_THREAD_EXPIRATION && this.work == null) {
|
||||
this.reduced = true;
|
||||
}
|
||||
// MONITOREXIT : var3_1
|
||||
}
|
||||
do {
|
||||
if (this.isActive() && this.work == null) continue block13;
|
||||
if (this.isActive()) {
|
||||
try {
|
||||
var3_2 = Clock.ticks();
|
||||
this.work.run();
|
||||
this.lastJobTicks = var5_5 = Clock.ticks();
|
||||
++this.numProcessed;
|
||||
this.processingTicks += var5_5 - var3_2;
|
||||
}
|
||||
catch (Throwable var3_3) {
|
||||
var3_3.printStackTrace();
|
||||
}
|
||||
var3_1 = this;
|
||||
// MONITORENTER : var3_1
|
||||
this.work = null;
|
||||
// MONITOREXIT : var3_1
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
lbl35:
|
||||
// 2 sources
|
||||
|
||||
} while (this.isActive());
|
||||
}
|
||||
var2_8 = null;
|
||||
ThreadPoolWorker.this.removeThread(this);
|
||||
ThreadPoolWorker.this.threadStopped();
|
||||
return;
|
||||
}
|
||||
catch (Throwable var1_6) {
|
||||
var2_7 = null;
|
||||
ThreadPoolWorker.this.removeThread(this);
|
||||
ThreadPoolWorker.this.threadStopped();
|
||||
throw var1_6;
|
||||
}
|
||||
}
|
||||
|
||||
WorkerThread(ThreadGroup threadGroup, String string) {
|
||||
super(threadGroup, string);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class Version
|
||||
implements Comparable {
|
||||
public static Version ZERO;
|
||||
public static Version NULL;
|
||||
private int[] versions;
|
||||
|
||||
public int major() {
|
||||
if (this.versions.length < 1) {
|
||||
return -1;
|
||||
}
|
||||
return this.versions[0];
|
||||
}
|
||||
|
||||
public int minor() {
|
||||
if (this.versions.length < 2) {
|
||||
return -1;
|
||||
}
|
||||
return this.versions[1];
|
||||
}
|
||||
|
||||
public int build() {
|
||||
if (this.versions.length < 3) {
|
||||
return -1;
|
||||
}
|
||||
return this.versions[2];
|
||||
}
|
||||
|
||||
public int patch() {
|
||||
if (this.versions.length < 4) {
|
||||
return -1;
|
||||
}
|
||||
return this.versions[3];
|
||||
}
|
||||
|
||||
public int get(int n) {
|
||||
return this.versions[n];
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return this.versions.length;
|
||||
}
|
||||
|
||||
public boolean isNull() {
|
||||
if (this.versions.length == 1) {
|
||||
boolean bl = false;
|
||||
if (this.versions[0] == 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int compareTo(Object object) {
|
||||
Version version = (Version)object;
|
||||
int n = this.versions.length;
|
||||
int n2 = version.versions.length;
|
||||
int n3 = 0;
|
||||
while (n3 < n && n3 < n2) {
|
||||
if (this.versions[n3] > version.versions[n3]) {
|
||||
return 1;
|
||||
}
|
||||
if (this.versions[n3] < version.versions[n3]) {
|
||||
return -1;
|
||||
}
|
||||
++n3;
|
||||
}
|
||||
if (n == n2) {
|
||||
return 0;
|
||||
}
|
||||
if (n > n2) {
|
||||
return 1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public boolean equals(Object object) {
|
||||
if (object instanceof Version) {
|
||||
Version version = (Version)object;
|
||||
if (this.versions.length != version.versions.length) {
|
||||
return false;
|
||||
}
|
||||
int n = 0;
|
||||
while (n < this.versions.length) {
|
||||
if (this.versions[n] != version.versions[n]) {
|
||||
return false;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
int n = 0;
|
||||
int n2 = 0;
|
||||
while (n2 < this.versions.length) {
|
||||
n += this.versions[n2];
|
||||
n <<= 8;
|
||||
++n2;
|
||||
}
|
||||
return n += this.versions.length;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.toString(this.versions.length);
|
||||
}
|
||||
|
||||
public String toString(int n) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
int n2 = 0;
|
||||
while (n2 < n && n2 < this.versions.length) {
|
||||
if (n2 > 0) {
|
||||
stringBuffer.append('.');
|
||||
}
|
||||
stringBuffer.append(this.versions[n2]);
|
||||
++n2;
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] stringArray) {
|
||||
Version version = new Version(stringArray[0]);
|
||||
Version version2 = new Version(stringArray[1]);
|
||||
System.out.println("v1: " + version);
|
||||
System.out.println("v2: " + version2);
|
||||
System.out.println("v1.equals(v2): " + version.equals(version2));
|
||||
System.out.println("v1.compareTo(v2): " + version.compareTo(version2));
|
||||
System.out.println("str: " + version.toString().compareTo(version2.toString()));
|
||||
}
|
||||
|
||||
public Version(int[] nArray) {
|
||||
this.versions = new int[nArray.length];
|
||||
System.arraycopy(nArray, 0, this.versions, 0, nArray.length);
|
||||
}
|
||||
|
||||
public Version(String string) {
|
||||
try {
|
||||
int[] nArray = new int[16];
|
||||
int n = 0;
|
||||
StringTokenizer stringTokenizer = new StringTokenizer(string, ".");
|
||||
while (stringTokenizer.hasMoreTokens()) {
|
||||
int n2 = Integer.parseInt(stringTokenizer.nextToken());
|
||||
if (n2 < 0) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
nArray[n++] = n2;
|
||||
}
|
||||
this.versions = new int[n];
|
||||
System.arraycopy(nArray, 0, this.versions, 0, n);
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new IllegalArgumentException("Invalid version string \"" + string + '\"');
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
NULL = ZERO = new Version("0");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.TextUtil
|
||||
*/
|
||||
package javax.baja.util;
|
||||
|
||||
import javax.baja.nre.util.TextUtil;
|
||||
import javax.baja.spy.SpyWriter;
|
||||
import javax.baja.sys.BAbsTime;
|
||||
import javax.baja.sys.BFloat;
|
||||
import javax.baja.sys.BRelTime;
|
||||
import javax.baja.sys.Clock;
|
||||
import javax.baja.util.CoalesceQueue;
|
||||
import javax.baja.util.Queue;
|
||||
|
||||
public class Worker {
|
||||
boolean isAlive;
|
||||
Thread thread;
|
||||
ITodo todo;
|
||||
int timeout;
|
||||
int numProcessed;
|
||||
long startTime;
|
||||
long startTicks;
|
||||
long processingTicks;
|
||||
|
||||
public ITodo getTodo() {
|
||||
return this.todo;
|
||||
}
|
||||
|
||||
public int getTimeout() {
|
||||
return this.timeout;
|
||||
}
|
||||
|
||||
public void setTimeout(int n) {
|
||||
this.timeout = n;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return TextUtil.getClassName(this.getClass()) + " [" + (this.isAlive ? "Running" : "Stopped") + ']';
|
||||
}
|
||||
|
||||
public boolean isRunning() {
|
||||
boolean bl = false;
|
||||
if (this.thread != null && this.isAlive) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final void start(String string) {
|
||||
this.start(Thread.currentThread().getThreadGroup(), string);
|
||||
}
|
||||
|
||||
public void start(ThreadGroup threadGroup, String string) {
|
||||
if (this.isAlive) {
|
||||
return;
|
||||
}
|
||||
this.isAlive = true;
|
||||
this.startTime = Clock.millis();
|
||||
this.startTicks = Clock.ticks();
|
||||
this.numProcessed = 0;
|
||||
this.thread = new Thread(threadGroup, new Processor(), string);
|
||||
this.thread.start();
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
this.isAlive = false;
|
||||
if (this.thread != null) {
|
||||
this.thread.interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
protected void process(Runnable runnable) throws Exception {
|
||||
if (runnable != null) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
public void spy(SpyWriter spyWriter) throws Exception {
|
||||
spyWriter.startProps("Worker");
|
||||
this.spyImpl(spyWriter);
|
||||
spyWriter.endProps();
|
||||
}
|
||||
|
||||
void spyImpl(SpyWriter spyWriter) {
|
||||
Queue queue;
|
||||
spyWriter.prop((Object)"isAlive", "" + this.isAlive);
|
||||
if (this.isAlive) {
|
||||
Worker.spy(spyWriter, this.startTime, this.startTicks, this.processingTicks, this.numProcessed);
|
||||
}
|
||||
spyWriter.prop((Object)"todo", this.todo.getClass().getName());
|
||||
if (this.todo instanceof Queue) {
|
||||
queue = (Queue)this.todo;
|
||||
spyWriter.prop((Object)"queue.size", "" + queue.size());
|
||||
spyWriter.prop((Object)"queue.maxSize", "" + queue.maxSize());
|
||||
}
|
||||
if (this.todo instanceof CoalesceQueue) {
|
||||
queue = (CoalesceQueue)this.todo;
|
||||
spyWriter.prop((Object)"queue.hashTable", "" + ((CoalesceQueue)queue).table.length);
|
||||
spyWriter.prop((Object)"queue.hashSize", "" + ((CoalesceQueue)queue).hashSize);
|
||||
spyWriter.prop((Object)"queue.threshold", "" + ((CoalesceQueue)queue).threshold);
|
||||
}
|
||||
}
|
||||
|
||||
static void spy(SpyWriter spyWriter, long l, long l2, long l3, int n) {
|
||||
long l4 = Clock.ticks() - l2;
|
||||
float f = (float)l3 / (float)l4 * 100.0f;
|
||||
float f2 = (float)l3 / (float)n;
|
||||
spyWriter.prop((Object)"startTime", BAbsTime.make(l));
|
||||
spyWriter.prop((Object)"upTime", BRelTime.toString(l4));
|
||||
spyWriter.prop((Object)"processing", BRelTime.toString(l3));
|
||||
spyWriter.prop((Object)"numProcessed", "" + n);
|
||||
spyWriter.prop((Object)"average", BFloat.toString(f2, null) + "ms/work");
|
||||
spyWriter.prop((Object)"utilization", "" + (int)f + '%');
|
||||
}
|
||||
|
||||
public Worker(ITodo iTodo) {
|
||||
this.todo = iTodo;
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
class Processor
|
||||
implements Runnable {
|
||||
public void run() {
|
||||
Worker.this.isAlive = true;
|
||||
while (Worker.this.isAlive) {
|
||||
try {
|
||||
Runnable runnable = Worker.this.todo.todo(Worker.this.timeout);
|
||||
long l = Clock.ticks();
|
||||
Worker.this.process(runnable);
|
||||
long l2 = Clock.ticks();
|
||||
Worker.this.processingTicks += l2 - l;
|
||||
++Worker.this.numProcessed;
|
||||
}
|
||||
catch (InterruptedException interruptedException) {
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Processor() {
|
||||
}
|
||||
}
|
||||
|
||||
public static interface ITodo {
|
||||
public Runnable todo(int var1) throws InterruptedException;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user