import com.ibm.icu.impl.USerializedSet;
import com.ibm.icu.text.Collator;
import com.ibm.icu.text.UnicodeSet;
+import com.ibm.icu.util.ICUException;
/**
* Collation binary data reader.
BufferedInputStream bis = new BufferedInputStream(inBytes);
tailoring.version = ICUBinary.readHeaderAndDataVersion(bis, DATA_FORMAT, IS_ACCEPTABLE);
if(base != null && base.getUCAVersion() != tailoring.getUCAVersion()) {
- throw new RuntimeException("Tailoring UCA version differs from base data UCA version");
+ throw new ICUException("Tailoring UCA version differs from base data UCA version");
}
DataInputStream ds = new DataInputStream(bis);
int indexesLength = ds.readInt(); // inIndexes[IX_INDEXES_LENGTH]
if(indexesLength < 2) {
- throw new RuntimeException("not enough indexes");
+ throw new ICUException("not enough indexes");
}
int[] inIndexes = new int[IX_TOTAL_SIZE + 1];
inIndexes[0] = indexesLength;
if(baseData == null) {
// We assume for collation settings that
// the base data does not have a reordering.
- throw new RuntimeException("Collation base data must not reorder scripts");
+ throw new ICUException("Collation base data must not reorder scripts");
}
reorderCodes = new int[length / 4];
for(int i = 0; i < length / 4; ++i) {
length = inIndexes[index + 1] - offset;
if(length >= 256) {
if(reorderCodes.length == 0) {
- throw new RuntimeException("Reordering table without reordering codes");
+ throw new ICUException("Reordering table without reordering codes");
}
reorderTable = new byte[256];
ds.readFully(reorderTable);
ds.skipBytes(length);
if(baseData != null && baseData.numericPrimary != (inIndexes[IX_OPTIONS] & 0xff000000L)) {
- throw new RuntimeException("Tailoring numeric primary weight differs from base data");
+ throw new ICUException("Tailoring numeric primary weight differs from base data");
}
CollationData data = null; // Remains null if there are no mappings.
data.trie = tailoring.trie = Trie2_32.createFromSerialized(ds);
int trieLength = data.trie.getSerializedLength();
if(trieLength > length) {
- throw new RuntimeException("Not enough bytes for the mappings trie"); // No mappings.
+ throw new ICUException("Not enough bytes for the mappings trie"); // No mappings.
}
length -= trieLength;
} else if(baseData != null) {
// Use the base data. Only the settings are tailored.
tailoring.data = baseData;
} else {
- throw new RuntimeException("Missing collation data mappings"); // No mappings.
+ throw new ICUException("Missing collation data mappings"); // No mappings.
}
ds.skipBytes(length);
length = inIndexes[index + 1] - offset;
if(length >= 8) {
if(data == null) {
- throw new RuntimeException("Tailored ces without tailored trie");
+ throw new ICUException("Tailored ces without tailored trie");
}
data.ces = new long[length / 8];
for(int i = 0; i < length / 8; ++i) {
length = inIndexes[index + 1] - offset;
if(length >= 4) {
if(data == null) {
- throw new RuntimeException("Tailored ce32s without tailored trie");
+ throw new ICUException("Tailored ce32s without tailored trie");
}
data.ce32s = new int[length / 4];
for(int i = 0; i < length / 4; ++i) {
int jamoCE32sStart = inIndexes[IX_JAMO_CE32S_START];
if(jamoCE32sStart >= 0) {
if(data == null || data.ce32s == null) {
- throw new RuntimeException("JamoCE32sStart index into non-existent ce32s[]");
+ throw new ICUException("JamoCE32sStart index into non-existent ce32s[]");
}
data.jamoCE32s = new int[CollationData.JAMO_CE32S_LENGTH];
System.arraycopy(data.ce32s, jamoCE32sStart, data.jamoCE32s, 0, CollationData.JAMO_CE32S_LENGTH);
} else if(baseData != null) {
data.jamoCE32s = baseData.jamoCE32s;
} else {
- throw new RuntimeException("Missing Jamo CE32s for Hangul processing");
+ throw new ICUException("Missing Jamo CE32s for Hangul processing");
}
index = IX_ROOT_ELEMENTS_OFFSET;
if(length >= 4) {
int rootElementsLength = length / 4;
if(data == null) {
- throw new RuntimeException("Root elements but no mappings");
+ throw new ICUException("Root elements but no mappings");
}
if(rootElementsLength <= CollationRootElements.IX_SEC_TER_BOUNDARIES) {
- throw new RuntimeException("Root elements array too short");
+ throw new ICUException("Root elements array too short");
}
data.rootElements = new long[rootElementsLength];
for(int i = 0; i < rootElementsLength; ++i) {
}
long commonSecTer = data.rootElements[CollationRootElements.IX_COMMON_SEC_AND_TER_CE];
if(commonSecTer != Collation.COMMON_SEC_AND_TER_CE) {
- throw new RuntimeException("Common sec/ter weights in base data differ from the hardcoded value");
+ throw new ICUException("Common sec/ter weights in base data differ from the hardcoded value");
}
long secTerBoundaries = data.rootElements[CollationRootElements.IX_SEC_TER_BOUNDARIES];
if((secTerBoundaries >>> 24) < CollationKeys.SEC_COMMON_HIGH) {
// [fixed last secondary common byte] is too low,
// and secondary weights would collide with compressed common secondaries.
- throw new RuntimeException("[fixed last secondary common byte] is too low");
+ throw new ICUException("[fixed last secondary common byte] is too low");
}
length &= 3;
}
length = inIndexes[index + 1] - offset;
if(length >= 2) {
if(data == null) {
- throw new RuntimeException("Tailored contexts without tailored trie");
+ throw new ICUException("Tailored contexts without tailored trie");
}
StringBuilder sb = new StringBuilder(length / 2);
for(int i = 0; i < length / 2; ++i) {
length = inIndexes[index + 1] - offset;
if(length >= 2) {
if(data == null) {
- throw new RuntimeException("Unsafe-backward-set but no mappings");
+ throw new ICUException("Unsafe-backward-set but no mappings");
}
if(baseData == null) {
// Create the unsafe-backward set for the root collator.
// No tailoring-specific data: Alias the root collator's set.
data.unsafeBackwardSet = baseData.unsafeBackwardSet;
} else {
- throw new RuntimeException("Missing unsafe-backward-set");
+ throw new ICUException("Missing unsafe-backward-set");
}
ds.skipBytes(length);
}
length &= 1;
if((header0 >> 8) != CollationFastLatin.VERSION) {
- throw new RuntimeException("Fast-Latin table version differs from version in data header");
+ throw new ICUException("Fast-Latin table version differs from version in data header");
}
} else if(baseData != null) {
data.fastLatinTable = baseData.fastLatinTable;
length = inIndexes[index + 1] - offset;
if(length >= 2) {
if(data == null) {
- throw new RuntimeException("Script order data but no mappings");
+ throw new ICUException("Script order data but no mappings");
}
data.scripts = new char[length / 2];
for(int i = 0; i < length / 2; ++i) {
length = inIndexes[index + 1] - offset;
if(length >= 256) {
if(data == null) {
- throw new RuntimeException("Data for compressible primary lead bytes but no mappings");
+ throw new ICUException("Data for compressible primary lead bytes but no mappings");
}
data.compressibleBytes = new boolean[256];
for(int i = 0; i < 256; ++i) {
} else if(baseData != null) {
data.compressibleBytes = baseData.compressibleBytes;
} else {
- throw new RuntimeException("Missing data for compressible primary lead bytes");
+ throw new ICUException("Missing data for compressible primary lead bytes");
}
ds.skipBytes(length);
settings.variableTop = tailoring.data.getLastPrimaryForGroup(
Collator.ReorderCodes.FIRST + settings.getMaxVariable());
if(settings.variableTop == 0) {
- throw new RuntimeException("The maxVariable could not be mapped to a variableTop");
+ throw new ICUException("The maxVariable could not be mapped to a variableTop");
}
if(reorderCodes.length == 0 || reorderTable != null) {
import com.ibm.icu.impl.Trie2_32;
import com.ibm.icu.util.BytesTrie;
import com.ibm.icu.util.CharsTrie;
+import com.ibm.icu.util.ICUException;
/**
* Collation element iterator and abstract character iterator.
}
protected int getCE32FromBuilderData(int ce32) {
- throw new RuntimeException("internal program error: should be unreachable");
+ throw new ICUException("internal program error: should be unreachable");
}
protected final void appendCEsFromCE32(CollationData d, int c, int ce32,
switch(Collation.tagFromCE32(ce32)) {
case Collation.FALLBACK_TAG:
case Collation.RESERVED_TAG_3:
- throw new RuntimeException("internal program error: should be unreachable");
+ throw new ICUException("internal program error: should be unreachable");
case Collation.LONG_PRIMARY_TAG:
ceBuffer.append(Collation.ceFromLongPrimaryCE32(ce32));
return;
import java.util.MissingResourceException;
import com.ibm.icu.impl.ICUResourceBundle;
+import com.ibm.icu.util.ICUUncheckedIOException;
import com.ibm.icu.util.Output;
import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.UResourceBundle;
try {
CollationDataReader.read(root, inStream, t);
} catch (IOException e) {
- throw new RuntimeException("Failed to load collation tailoring data for locale:"
+ throw new ICUUncheckedIOException("Failed to load collation tailoring data for locale:"
+ actualLocale + " type:" + type, e);
} // No need to close BAIS.
import java.util.concurrent.atomic.AtomicInteger;
+import com.ibm.icu.util.ICUCloneNotSupportedException;
+
/**
* Base class for shared, reference-counted, auto-deleted objects.
* Java subclasses are mutable and must implement clone().
c = (Reference<T>)super.clone();
} catch (CloneNotSupportedException e) {
// Should never happen.
- throw new RuntimeException(e);
+ throw new ICUCloneNotSupportedException(e);
}
if(ref != null) {
ref.addRef();
c = (SharedObject)super.clone();
} catch (CloneNotSupportedException e) {
// Should never happen.
- throw new RuntimeException(e);
+ throw new ICUCloneNotSupportedException(e);
}
c.refCount = new AtomicInteger();
return c;
import com.ibm.icu.impl.coll.CollationRoot;
import com.ibm.icu.lang.UScript;
import com.ibm.icu.util.Freezable;
+import com.ibm.icu.util.ICUException;
import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.ULocale.Category;
import com.ibm.icu.util.UResourceBundle;
if(DEBUG){
e.printStackTrace();
}
- throw new RuntimeException(e.getMessage());
+ throw new ICUException(e);
///CLOVER:ON
}
}
import com.ibm.icu.impl.coll.CollationLoader;
import com.ibm.icu.impl.coll.CollationTailoring;
import com.ibm.icu.text.Collator.CollatorFactory;
+import com.ibm.icu.util.ICUCloneNotSupportedException;
import com.ibm.icu.util.Output;
import com.ibm.icu.util.ULocale;
}
catch (CloneNotSupportedException e) {
///CLOVER:OFF
- throw new IllegalStateException(e.getMessage());
+ throw new ICUCloneNotSupportedException(e);
///CLOVER:ON
}
}
import java.text.StringCharacterIterator;
import java.util.Locale;
+import com.ibm.icu.util.ICUException;
import com.ibm.icu.util.ULocale;
// Java porting note:
// for this targetIx value, so if it is non-NULL then other ceb.get calls should be OK.
CEI firstCEI = ceb.get(targetIx);
if (firstCEI == null) {
- throw new RuntimeException("CEBuffer.get(" + targetIx + ") returned null.");
+ throw new ICUException("CEBuffer.get(" + targetIx + ") returned null.");
}
for (patIx = 0; patIx < pattern_.PCELength_; patIx++) {
// for this targetIx value, so if it is non-NULL then other ceb.getPrevious calls should be OK.
CEI lastCEI = ceb.getPrevious(targetIx);
if (lastCEI == null) {
- throw new RuntimeException("CEBuffer.getPrevious(" + targetIx + ") returned null.");
+ throw new ICUException("CEBuffer.getPrevious(" + targetIx + ") returned null.");
}
// Inner loop checks for a match beginning at each
// position from the outer loop.
/*
*******************************************************************************
- * Copyright (C) 2004-2011, International Business Machines Corporation and *
- * others. All Rights Reserved. *
+ * Copyright (C) 2004-2014, International Business Machines Corporation and
+ * others. All Rights Reserved.
*******************************************************************************
*/
package com.ibm.icu.util;
try {
return (Collator) collator.clone(); // clone for safety
} catch (CloneNotSupportedException e) {
- throw new IllegalStateException("Error in cloning collator");
+ throw new ICUCloneNotSupportedException("Error in cloning collator", e);
}
}
try {
this.collator = (Collator) collator.clone(); // clone for safety
} catch (CloneNotSupportedException e) {
- throw new IllegalStateException("Error in cloning collator");
+ throw new ICUCloneNotSupportedException("Error in cloning collator", e);
}
return this;
}
-#Wed Jun 17 11:09:27 EDT 2009
eclipse.preferences.version=1
formatter_profile=_ICU4J Standard
formatter_settings_version=11
org.eclipse.jdt.ui.javadoc=true
org.eclipse.jdt.ui.ondemandthreshold=99
org.eclipse.jdt.ui.staticondemandthreshold=99
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n *******************************************************************************\r\n * Copyright (C) ${year}, International Business Machines Corporation and *\r\n * others. All Rights Reserved. *\r\n *******************************************************************************\r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\n *******************************************************************************\n * Copyright (C) ${year}, International Business Machines Corporation and\n * others. All Rights Reserved.\n *******************************************************************************\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
/*
*******************************************************************************
- * Copyright (C) 2004-2011, International Business Machines Corporation and *
+ * Copyright (C) 2004-2014, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
import java.io.InputStream;
import java.nio.ByteBuffer;
+import com.ibm.icu.util.ICUUncheckedIOException;
import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.UResourceBundle;
import com.ibm.icu.util.VersionInfo;
} catch (IOException ex) {
String fullName = ICUResourceBundleReader.getFullName(baseName, localeID);
- throw new RuntimeException("Data file " + fullName + " is corrupt - " + ex.getMessage());
+ throw new ICUUncheckedIOException("Data file " + fullName + " is corrupt - " + ex.getMessage(), ex);
}
// set pool bundle keys if necessary
/*
*******************************************************************************
-* Copyright (C) 2009-2011, International Business Machines
+* Copyright (C) 2009-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/
import com.ibm.icu.text.Normalizer;
import com.ibm.icu.text.Normalizer2;
+import com.ibm.icu.util.ICUUncheckedIOException;
public final class Norm2AllModes {
// Public API dispatch via Normalizer2 subclasses -------------------------- ***
try {
return dest.append(src);
} catch(IOException e) {
- throw new RuntimeException(e); // Avoid declaring "throws IOException".
+ throw new ICUUncheckedIOException(e); // Avoid declaring "throws IOException".
}
} else {
throw new IllegalArgumentException();
import com.ibm.icu.text.UTF16;
import com.ibm.icu.text.UnicodeSet;
+import com.ibm.icu.util.ICUUncheckedIOException;
import com.ibm.icu.util.VersionInfo;
public final class Normalizer2Impl {
}
} catch(IOException e) {
// Will not occur because we do not write to I/O.
- throw new RuntimeException(e);
+ throw new ICUUncheckedIOException(e);
}
}
}
} catch(IOException e) {
// Will not occur because we do not write to I/O.
- throw new RuntimeException(e);
+ throw new ICUUncheckedIOException(e);
}
}
}
str.setLength(0);
reorderStart=0;
} catch(IOException e) {
- throw new RuntimeException(e); // Avoid declaring "throws IOException".
+ throw new ICUUncheckedIOException(e); // Avoid declaring "throws IOException".
}
}
lastCC=0;
str.setLength(0);
reorderStart=0;
} catch(IOException e) {
- throw new RuntimeException(e); // Avoid declaring "throws IOException".
+ throw new ICUUncheckedIOException(e); // Avoid declaring "throws IOException".
}
}
lastCC=0;
DataInputStream ds=new DataInputStream(bis);
int indexesLength=ds.readInt()/4; // inIndexes[IX_NORM_TRIE_OFFSET]/4
if(indexesLength<=IX_MIN_MAYBE_YES) {
- throw new IOException("Normalizer2 data: not enough indexes");
+ throw new ICUUncheckedIOException("Normalizer2 data: not enough indexes");
}
int[] inIndexes=new int[indexesLength];
inIndexes[0]=indexesLength*4;
normTrie=Trie2_16.createFromSerialized(ds);
int trieLength=normTrie.getSerializedLength();
if(trieLength>(nextOffset-offset)) {
- throw new IOException("Normalizer2 data: not enough bytes for normTrie");
+ throw new ICUUncheckedIOException("Normalizer2 data: not enough bytes for normTrie");
}
ds.skipBytes((nextOffset-offset)-trieLength); // skip padding after trie bytes
data.close();
return this;
} catch(IOException e) {
- throw new RuntimeException(e);
+ throw new ICUUncheckedIOException(e);
}
}
public Normalizer2Impl load(String name) {
/*
*******************************************************************************
*
-* Copyright (C) 2004-2013, International Business Machines
+* Copyright (C) 2004-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
import com.ibm.icu.lang.UCharacter;
import com.ibm.icu.lang.UProperty;
import com.ibm.icu.text.UnicodeSet;
+import com.ibm.icu.util.ICUUncheckedIOException;
public final class UBiDiProps {
// constructors etc. --------------------------------------------------- ***
try {
INSTANCE = new UBiDiProps();
} catch (IOException e) {
- throw new RuntimeException(e);
+ throw new ICUUncheckedIOException(e);
}
}
}
/*
*******************************************************************************
*
-* Copyright (C) 2004-2012, International Business Machines
+* Copyright (C) 2004-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
import com.ibm.icu.lang.UProperty;
import com.ibm.icu.text.UTF16;
import com.ibm.icu.text.UnicodeSet;
+import com.ibm.icu.util.ICUUncheckedIOException;
import com.ibm.icu.util.ULocale;
public final class UCaseProps {
try {
INSTANCE = new UCaseProps();
} catch (IOException e) {
- throw new RuntimeException(e);
+ throw new ICUUncheckedIOException(e);
}
}
}
/**
*******************************************************************************
-* Copyright (C) 1996-2013, International Business Machines Corporation and
+* Copyright (C) 1996-2014, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*/
import com.ibm.icu.lang.UScript;
import com.ibm.icu.text.UTF16;
import com.ibm.icu.text.UnicodeSet;
+import com.ibm.icu.util.ICUException;
import com.ibm.icu.util.VersionInfo;
/**
{
// consistency check
if(binProps.length!=UProperty.BINARY_LIMIT) {
- throw new RuntimeException("binProps.length!=UProperty.BINARY_LIMIT");
+ throw new ICUException("binProps.length!=UProperty.BINARY_LIMIT");
}
if(intProps.length!=(UProperty.INT_LIMIT-UProperty.INT_START)) {
- throw new RuntimeException("intProps.length!=(UProperty.INT_LIMIT-UProperty.INT_START)");
+ throw new ICUException("intProps.length!=(UProperty.INT_LIMIT-UProperty.INT_START)");
}
// jar access
import com.ibm.icu.text.IDNA;
import com.ibm.icu.text.Normalizer2;
import com.ibm.icu.text.StringPrepParseException;
+import com.ibm.icu.util.ICUException;
// Note about tests for IDNA.Error.DOMAIN_NAME_TOO_LONG:
//
try {
punycode=Punycode.encode(labelString.subSequence(labelStart, labelStart+labelLength), null);
} catch (StringPrepParseException e) {
- throw new RuntimeException(e); // unexpected
+ throw new ICUException(e); // unexpected
}
punycode.insert(0, "xn--");
if(punycode.length()>63) {
import java.util.MissingResourceException;
import com.ibm.icu.impl.ICUDebug;
+import com.ibm.icu.util.ICUCloneNotSupportedException;
import com.ibm.icu.util.ULocale;
/**
}
catch (CloneNotSupportedException e) {
///CLOVER:OFF
- throw new IllegalStateException();
+ throw new ICUCloneNotSupportedException(e);
///CLOVER:ON
}
}
import java.util.Map;
import com.ibm.icu.impl.CurrencyData;
+import com.ibm.icu.util.ICUCloneNotSupportedException;
import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.ULocale.Category;
}
return other;
} catch (CloneNotSupportedException e) {
- throw new IllegalStateException();
+ throw new ICUCloneNotSupportedException(e);
}
}
import com.ibm.icu.impl.Utility;
import com.ibm.icu.text.TimeZoneNames.NameType;
import com.ibm.icu.util.Calendar;
+import com.ibm.icu.util.ICUCloneNotSupportedException;
import com.ibm.icu.util.TimeZone;
import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.ULocale.Category;
return other;
} catch (CloneNotSupportedException e) {
///CLOVER:OFF
- throw new IllegalStateException();
+ throw new ICUCloneNotSupportedException(e);
///CLOVER:ON
}
}
import com.ibm.icu.impl.Utility;
import com.ibm.icu.util.Calendar;
import com.ibm.icu.util.Freezable;
+import com.ibm.icu.util.ICUCloneNotSupportedException;
import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.UResourceBundle;
return other;
} catch ( CloneNotSupportedException e ) {
///CLOVER:OFF
- throw new IllegalStateException("clone is not supported");
+ throw new ICUCloneNotSupportedException("clone is not supported", e);
///CLOVER:ON
}
}
import com.ibm.icu.impl.Utility;
import com.ibm.icu.util.Calendar;
import com.ibm.icu.util.Freezable;
+import com.ibm.icu.util.ICUCloneNotSupportedException;
import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.ULocale.Category;
import com.ibm.icu.util.UResourceBundle;
return result;
} catch (CloneNotSupportedException e) {
///CLOVER:OFF
- throw new IllegalArgumentException("Internal Error");
+ throw new ICUCloneNotSupportedException("Internal Error", e);
///CLOVER:ON
}
}
import com.ibm.icu.impl.ICUResourceBundle;
import com.ibm.icu.impl.SimpleCache;
import com.ibm.icu.util.Currency;
+import com.ibm.icu.util.ICUCloneNotSupportedException;
import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.ULocale.Category;
import com.ibm.icu.util.UResourceBundle;
// other fields are bit-copied
} catch (CloneNotSupportedException e) {
///CLOVER:OFF
- throw new IllegalStateException();
+ throw new ICUCloneNotSupportedException(e);
///CLOVER:ON
}
}
/*
*******************************************************************************
-* Copyright (C) 2009-2013, International Business Machines
+* Copyright (C) 2009-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/
import java.io.IOException;
+import com.ibm.icu.util.ICUUncheckedIOException;
+
/**
* Normalization filtered by a UnicodeSet.
* Normalizes portions of the text contained in the filter set and leaves
prevSpanLimit=spanLimit;
}
} catch(IOException e) {
- throw new RuntimeException(e);
+ throw new ICUUncheckedIOException(e);
}
return dest;
}
/*
**********************************************************************
-* Copyright (c) 2004-2013, International Business Machines
+* Copyright (c) 2004-2014, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Author: Alan Liu
import com.ibm.icu.text.MessagePattern.Part;
import com.ibm.icu.text.PluralRules.FixedDecimal;
import com.ibm.icu.text.PluralRules.PluralType;
+import com.ibm.icu.util.ICUUncheckedIOException;
import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.ULocale.Category;
app.append(s);
length += s.length();
} catch(IOException e) {
- throw new RuntimeException(e);
+ throw new ICUUncheckedIOException(e);
}
}
app.append(s, start, limit);
length += limit - start;
} catch(IOException e) {
- throw new RuntimeException(e);
+ throw new ICUUncheckedIOException(e);
}
}
}
return length;
} catch(IOException e) {
- throw new RuntimeException(e);
+ throw new ICUUncheckedIOException(e);
}
}
/*
*******************************************************************************
-* Copyright (C) 2010-2013, International Business Machines
+* Copyright (C) 2010-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* created on: 2010aug21
import com.ibm.icu.impl.ICUConfig;
import com.ibm.icu.impl.PatternProps;
import com.ibm.icu.util.Freezable;
+import com.ibm.icu.util.ICUCloneNotSupportedException;
//Note: Minimize ICU dependencies, only use a very small part of the ICU core.
//In particular, do not depend on *Format classes.
try {
newMsg=(MessagePattern)super.clone();
} catch (CloneNotSupportedException e) {
- throw new RuntimeException(e);
+ throw new ICUCloneNotSupportedException(e);
}
newMsg.parts=(ArrayList<Part>)parts.clone();
if(numericValues!=null) {
import com.ibm.icu.impl.Normalizer2Impl;
import com.ibm.icu.impl.UCaseProps;
import com.ibm.icu.lang.UCharacter;
+import com.ibm.icu.util.ICUCloneNotSupportedException;
/**
* Unicode Normalization
norm2 = mode.getNormalizer2(options);
buffer = new StringBuilder();
} catch (CloneNotSupportedException e) {
- throw new IllegalStateException(e.toString());
+ throw new ICUCloneNotSupportedException(e);
}
}
return copy;
}
catch (CloneNotSupportedException e) {
- throw new IllegalStateException(e);
+ throw new ICUCloneNotSupportedException(e);
}
}
text = newIter;
reset();
}catch(CloneNotSupportedException e) {
- throw new IllegalStateException("Could not clone the UCharacterIterator");
+ throw new ICUCloneNotSupportedException("Could not clone the UCharacterIterator", e);
}
}
* Writes the normalized form of the source string to the destination Appendable
* and returns the destination Appendable.
* The source and destination strings must be different objects.
+ *
+ * <p>Any {@link java.io.IOException} is wrapped into a {@link com.ibm.icu.util.ICUUncheckedIOException}.
+ *
* @param src source string
* @param dest destination Appendable; gets normalized src appended
* @return dest
package com.ibm.icu.text;
import java.text.CharacterIterator;
+import com.ibm.icu.util.ICUCloneNotSupportedException;
+
/**
* <code>StringCharacterIterator</code> implements the
* <code>CharacterIterater</code> protocol for a <code>String</code>.
return other;
}
catch (CloneNotSupportedException e) {
- throw new IllegalStateException();
+ throw new ICUCloneNotSupportedException(e);
}
}
/*
*******************************************************************************
- * Copyright (C) 2003-2012, International Business Machines Corporation and *
- * others. All Rights Reserved. *
+ * Copyright (C) 2003-2014, International Business Machines Corporation and
+ * others. All Rights Reserved.
*******************************************************************************
*/
package com.ibm.icu.text;
import com.ibm.icu.impl.UBiDiProps;
import com.ibm.icu.lang.UCharacter;
import com.ibm.icu.lang.UCharacterDirection;
+import com.ibm.icu.util.ICUUncheckedIOException;
import com.ibm.icu.util.VersionInfo;
/**
stream.close();
}
} catch (IOException e) {
- throw new RuntimeException(e.toString());
+ throw new ICUUncheckedIOException(e);
}
}
if (instance != null) {
/*
*******************************************************************************
-* Copyright (C) 2010-2012, International Business Machines
+* Copyright (C) 2010-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* created on: 2010nov23
try {
out.append((char)c);
} catch(IOException e) {
- throw new RuntimeException(e);
+ throw new ICUUncheckedIOException(e);
}
}
}
catch (CloneNotSupportedException e) {
// this shouldn't happen, since we are Cloneable
- throw new IllegalStateException();
+ throw new ICUCloneNotSupportedException(e);
}
}
/*
*******************************************************************************
-* Copyright (C) 2011-2012, International Business Machines
+* Copyright (C) 2011-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* created on: 2011jan06
try {
out.append((char)c);
} catch(IOException e) {
- throw new RuntimeException(e);
+ throw new ICUUncheckedIOException(e);
}
}
if (hashes != null) other.hashes = hashes.clone();
return other;
} catch (CloneNotSupportedException e) {
- throw new IllegalStateException();
+ throw new ICUCloneNotSupportedException(e);
}
}
if (hashes != null) other.hashes = hashes.clone();
return other;
} catch (CloneNotSupportedException e) {
- throw new IllegalStateException();
+ throw new ICUCloneNotSupportedException(e);
}
}
--- /dev/null
+/*
+ *******************************************************************************
+ * Copyright (C) 2014, International Business Machines Corporation and
+ * others. All Rights Reserved.
+ *******************************************************************************
+ */
+package com.ibm.icu.util;
+
+/**
+ * Unchecked version of {@link CloneNotSupportedException}.
+ * Some ICU APIs do not throw the standard exception but instead wrap it
+ * into this unchecked version.
+ *
+ * @draft ICU 53
+ * @provisional This API might change or be removed in a future release.
+ */
+public class ICUCloneNotSupportedException extends ICUException {
+ private static final long serialVersionUID = -4824446458488194964L;
+
+ /**
+ * Default constructor.
+ *
+ * @draft ICU 53
+ * @provisional This API might change or be removed in a future release.
+ */
+ public ICUCloneNotSupportedException() {
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message string
+ * @draft ICU 53
+ * @provisional This API might change or be removed in a future release.
+ */
+ public ICUCloneNotSupportedException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param cause original exception (normally a {@link CloneNotSupportedException})
+ * @draft ICU 53
+ * @provisional This API might change or be removed in a future release.
+ */
+ public ICUCloneNotSupportedException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message string
+ * @param cause original exception (normally a {@link CloneNotSupportedException})
+ * @draft ICU 53
+ * @provisional This API might change or be removed in a future release.
+ */
+ public ICUCloneNotSupportedException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
--- /dev/null
+/*
+ *******************************************************************************
+ * Copyright (C) 2014, International Business Machines Corporation and
+ * others. All Rights Reserved.
+ *******************************************************************************
+ */
+package com.ibm.icu.util;
+
+/**
+ * Base class for unchecked, ICU-specific exceptions.
+ *
+ * @draft ICU 53
+ * @provisional This API might change or be removed in a future release.
+ */
+public class ICUException extends RuntimeException {
+ private static final long serialVersionUID = -3067399656455755650L;
+
+ /**
+ * Default constructor.
+ *
+ * @draft ICU 53
+ * @provisional This API might change or be removed in a future release.
+ */
+ public ICUException() {
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message string
+ * @draft ICU 53
+ * @provisional This API might change or be removed in a future release.
+ */
+ public ICUException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param cause original exception
+ * @draft ICU 53
+ * @provisional This API might change or be removed in a future release.
+ */
+ public ICUException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message string
+ * @param cause original exception
+ * @draft ICU 53
+ * @provisional This API might change or be removed in a future release.
+ */
+ public ICUException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
--- /dev/null
+/*
+ *******************************************************************************
+ * Copyright (C) 2014, International Business Machines Corporation and
+ * others. All Rights Reserved.
+ *******************************************************************************
+ */
+package com.ibm.icu.util;
+
+/**
+ * Unchecked version of {@link java.io.IOException}.
+ * Some ICU APIs do not throw the standard exception but instead wrap it
+ * into this unchecked version.
+ *
+ * <p>This currently extends {@link RuntimeException},
+ * but when ICU can rely on Java 8 this class should be changed to extend
+ * java.io.UncheckedIOException instead.
+ *
+ * @draft ICU 53
+ * @provisional This API might change or be removed in a future release.
+ */
+public class ICUUncheckedIOException extends RuntimeException {
+ private static final long serialVersionUID = 1210263498513384449L;
+
+ /**
+ * Default constructor.
+ *
+ * @draft ICU 53
+ * @provisional This API might change or be removed in a future release.
+ */
+ public ICUUncheckedIOException() {
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message string
+ * @draft ICU 53
+ * @provisional This API might change or be removed in a future release.
+ */
+ public ICUUncheckedIOException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param cause original exception (normally a {@link java.io.IOException})
+ * @draft ICU 53
+ * @provisional This API might change or be removed in a future release.
+ */
+ public ICUUncheckedIOException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message string
+ * @param cause original exception (normally a {@link java.io.IOException})
+ * @draft ICU 53
+ * @provisional This API might change or be removed in a future release.
+ */
+ public ICUUncheckedIOException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
result.frozen = false;
return result;
} catch (CloneNotSupportedException e) {
- throw new IllegalArgumentException(e); // will never happen
+ throw new ICUCloneNotSupportedException(e); // will never happen
}
}
result.frozen = false;
return result;
} catch (CloneNotSupportedException e) {
- throw new IllegalArgumentException(e); // will never happen
+ throw new ICUCloneNotSupportedException(e); // will never happen
}
}
TimeZone other = (TimeZone) super.clone();
return other;
} catch (CloneNotSupportedException e) {
- throw new RuntimeException(e);
+ throw new ICUCloneNotSupportedException(e);
}
}
return super.clone();
} catch (CloneNotSupportedException e) {
//this should never happen
- throw new IllegalStateException();
+ throw new ICUCloneNotSupportedException(e);
}
}
/*
*******************************************************************************
- * Copyright (C) 1996-2010, International Business Machines Corporation and *
- * others. All Rights Reserved. *
+ * Copyright (C) 1996-2014, International Business Machines Corporation and
+ * others. All Rights Reserved.
*******************************************************************************
*/
package com.ibm.icu.text;
import java.text.CharacterIterator;
import com.ibm.icu.lang.UCharacter;
+import com.ibm.icu.util.ICUCloneNotSupportedException;
import com.ibm.icu.util.ULocale;
return other;
}
catch (CloneNotSupportedException e) {
- throw new IllegalStateException();
+ throw new ICUCloneNotSupportedException();
}
}
/*
*******************************************************************************
- * Copyright (C) 1996-2013, International Business Machines Corporation and *
- * others. All Rights Reserved. *
+ * Copyright (C) 1996-2014, International Business Machines Corporation and
+ * others. All Rights Reserved.
*******************************************************************************
*
*/
import com.ibm.icu.impl.JavaTimeZone;
import com.ibm.icu.impl.OlsonTimeZone;
import com.ibm.icu.impl.TimeZoneAdapter;
+import com.ibm.icu.impl.Utility;
import com.ibm.icu.math.BigDecimal;
import com.ibm.icu.math.MathContext;
import com.ibm.icu.util.AnnualTimeZoneRule;
import com.ibm.icu.util.DateInterval;
import com.ibm.icu.util.DateTimeRule;
import com.ibm.icu.util.GregorianCalendar;
+import com.ibm.icu.util.ICUCloneNotSupportedException;
+import com.ibm.icu.util.ICUException;
+import com.ibm.icu.util.ICUUncheckedIOException;
import com.ibm.icu.util.InitialTimeZoneRule;
import com.ibm.icu.util.RuleBasedTimeZone;
import com.ibm.icu.util.SimpleTimeZone;
}
}
+ private static abstract class ExceptionHandlerBase implements Handler {
+ public boolean hasSameBehavior(Object a, Object b) {
+ return sameThrowable((Exception) a, (Exception) b);
+ }
+
+ // Exception.equals() does not seem to work.
+ private static final boolean sameThrowable(Throwable a, Throwable b) {
+ return a == null ? b == null :
+ b == null ? false :
+ a.getClass().equals(b.getClass()) &&
+ Utility.objectEquals(a.getMessage(), b.getMessage()) &&
+ sameThrowable(a.getCause(), b.getCause());
+ }
+ }
+
+ private static class ICUExceptionHandler extends ExceptionHandlerBase {
+ public Object[] getTestObjects() {
+ return new ICUException[] {
+ new ICUException(),
+ new ICUException("msg1"),
+ new ICUException(new RuntimeException("rte1")),
+ new ICUException("msg2", new RuntimeException("rte2"))
+ };
+ }
+ }
+
+ private static class ICUUncheckedIOExceptionHandler extends ExceptionHandlerBase {
+ public Object[] getTestObjects() {
+ return new ICUUncheckedIOException[] {
+ new ICUUncheckedIOException(),
+ new ICUUncheckedIOException("msg1"),
+ new ICUUncheckedIOException(new RuntimeException("rte1")),
+ new ICUUncheckedIOException("msg2", new RuntimeException("rte2"))
+ };
+ }
+ }
+
+ private static class ICUCloneNotSupportedExceptionHandler extends ExceptionHandlerBase {
+ public Object[] getTestObjects() {
+ return new ICUCloneNotSupportedException[] {
+ new ICUCloneNotSupportedException(),
+ new ICUCloneNotSupportedException("msg1"),
+ new ICUCloneNotSupportedException(new RuntimeException("rte1")),
+ new ICUCloneNotSupportedException("msg2", new RuntimeException("rte2"))
+ };
+ }
+ }
+
private static HashMap map = new HashMap();
static {
map.put("com.ibm.icu.util.MeasureUnit", new MeasureUnitTest.MeasureUnitHandler());
map.put("com.ibm.icu.util.TimeUnit", new MeasureUnitTest.MeasureUnitHandler());
map.put("com.ibm.icu.text.MeasureFormat", new MeasureUnitTest.MeasureFormatHandler());
+
+ map.put("com.ibm.icu.util.ICUException", new ICUExceptionHandler());
+ map.put("com.ibm.icu.util.ICUUncheckedIOException", new ICUUncheckedIOExceptionHandler());
+ map.put("com.ibm.icu.util.ICUCloneNotSupportedException", new ICUCloneNotSupportedExceptionHandler());
}
public SerializableTest()