ICU-12748 Add @Overrides and fix whitespace, thanks to Eclipse

X-SVN-Rev: 39313
This commit is contained in:
Craig Cornelius 2016-09-21 19:55:37 +00:00
parent 96df443f84
commit c1425af28f
186 changed files with 4949 additions and 4118 deletions

View File

@ -27,6 +27,7 @@ class Charset88591 extends CharsetASCII {
super(cs);
}
@Override
protected CoderResult decodeLoopCoreOptimized(ByteBuffer source, CharBuffer target,
byte[] sourceArray, char[] targetArray, int oldSource, int offset, int limit) {
@ -40,6 +41,7 @@ class Charset88591 extends CharsetASCII {
return null;
}
@Override
protected CoderResult decodeLoopCoreUnoptimized(ByteBuffer source, CharBuffer target) {
byte ch;
/*
@ -64,6 +66,7 @@ class Charset88591 extends CharsetASCII {
super(cs);
}
@Override
protected final CoderResult encodeLoopCoreOptimized(CharBuffer source, ByteBuffer target,
char[] sourceArray, byte[] targetArray, int oldSource, int offset, int limit,
boolean flush) {
@ -74,7 +77,7 @@ class Charset88591 extends CharsetASCII {
* char in the source is within the correct range
*/
for (i = oldSource; i < limit; i++) {
ch = (int) sourceArray[i];
ch = sourceArray[i];
if ((ch & 0xff00) == 0) {
targetArray[i + offset] = (byte) ch;
} else {
@ -95,6 +98,7 @@ class Charset88591 extends CharsetASCII {
return null;
}
@Override
protected final CoderResult encodeLoopCoreUnoptimized(CharBuffer source, ByteBuffer target, boolean flush) {
int ch;
@ -104,7 +108,7 @@ class Charset88591 extends CharsetASCII {
*/
while (source.hasRemaining()) {
ch = (int) source.get();
ch = source.get();
if ((ch & 0xff00) == 0) {
if (target.hasRemaining()) {
target.put((byte) ch);
@ -125,14 +129,17 @@ class Charset88591 extends CharsetASCII {
}
@Override
public CharsetDecoder newDecoder() {
return new CharsetDecoder88591(this);
}
@Override
public CharsetEncoder newEncoder() {
return new CharsetEncoder88591(this);
}
@Override
void getUnicodeSetImpl( UnicodeSet setFillIn, int which){
setFillIn.add(0,0xff);
}

View File

@ -36,6 +36,7 @@ class CharsetASCII extends CharsetICU {
super(cs);
}
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets,
boolean flush) {
if (!source.hasRemaining()) {
@ -179,11 +180,13 @@ class CharsetASCII extends CharsetICU {
private final static int NEED_TO_WRITE_BOM = 1;
@Override
protected void implReset() {
super.implReset();
fromUnicodeStatus = NEED_TO_WRITE_BOM;
}
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets,
boolean flush) {
if (!source.hasRemaining()) {
@ -274,7 +277,7 @@ class CharsetASCII extends CharsetICU {
* perform ascii conversion from the source array to the target array, making sure each
* char in the source is within the correct range
*/
for (i = oldSource; i < limit && (((ch = (int) sourceArray[i]) & 0xff80) == 0); i++)
for (i = oldSource; i < limit && (((ch = sourceArray[i]) & 0xff80) == 0); i++)
targetArray[i + offset] = (byte) ch;
/*
@ -298,7 +301,7 @@ class CharsetASCII extends CharsetICU {
* each char in the source is within the correct range
*/
while (source.hasRemaining()) {
ch = (int) source.get();
ch = source.get();
if ((ch & 0xff80) == 0) {
if (target.hasRemaining()) {
@ -344,14 +347,17 @@ class CharsetASCII extends CharsetICU {
}
@Override
public CharsetDecoder newDecoder() {
return new CharsetDecoderASCII(this);
}
@Override
public CharsetEncoder newEncoder() {
return new CharsetEncoderASCII(this);
}
@Override
void getUnicodeSetImpl( UnicodeSet setFillIn, int which){
setFillIn.add(0,0x7f);
}

View File

@ -386,6 +386,7 @@ class CharsetBOCU1 extends CharsetICU {
return result;
}
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush){
cr = CoderResult.UNDERFLOW;
@ -789,6 +790,7 @@ class CharsetBOCU1 extends CharsetICU {
}
}
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets,
boolean flush){
cr = CoderResult.UNDERFLOW;
@ -1049,14 +1051,17 @@ class CharsetBOCU1 extends CharsetICU {
}
@Override
public CharsetDecoder newDecoder() {
return new CharsetDecoderBOCU(this);
}
@Override
public CharsetEncoder newEncoder() {
return new CharsetEncoderBOCU(this);
}
@Override
void getUnicodeSetImpl( UnicodeSet setFillIn, int which){
CharsetICU.getCompleteUnicodeSet(setFillIn);
}

View File

@ -21,6 +21,7 @@ class CharsetCESU8 extends CharsetUTF8 {
}
@Override
void getUnicodeSetImpl( UnicodeSet setFillIn, int which){
getCompleteUnicodeSet(setFillIn);

View File

@ -163,6 +163,7 @@ public class CharsetCallback {
* @stable ICU 3.6
*/
public static final Encoder FROM_U_CALLBACK_SKIP = new Encoder() {
@Override
public CoderResult call(CharsetEncoderICU encoder, Object context,
CharBuffer source, ByteBuffer target, IntBuffer offsets,
char[] buffer, int length, int cp, CoderResult cr){
@ -183,6 +184,7 @@ public class CharsetCallback {
* @stable ICU 3.6
*/
public static final Decoder TO_U_CALLBACK_SKIP = new Decoder() {
@Override
public CoderResult call(CharsetDecoderICU decoder, Object context,
ByteBuffer source, CharBuffer target, IntBuffer offsets,
char[] buffer, int length, CoderResult cr){
@ -203,6 +205,7 @@ public class CharsetCallback {
* @stable ICU 3.6
*/
public static final Encoder FROM_U_CALLBACK_SUBSTITUTE = new Encoder(){
@Override
public CoderResult call(CharsetEncoderICU encoder, Object context,
CharBuffer source, ByteBuffer target, IntBuffer offsets,
char[] buffer, int length, int cp, CoderResult cr){
@ -227,6 +230,7 @@ public class CharsetCallback {
* @stable ICU 3.6
*/
public static final Decoder TO_U_CALLBACK_SUBSTITUTE = new Decoder() {
@Override
public CoderResult call(CharsetDecoderICU decoder, Object context,
ByteBuffer source, CharBuffer target, IntBuffer offsets,
char[] buffer, int length, CoderResult cr){
@ -252,6 +256,7 @@ public class CharsetCallback {
* @stable ICU 3.6
*/
public static final Encoder FROM_U_CALLBACK_STOP = new Encoder() {
@Override
public CoderResult call(CharsetEncoderICU encoder, Object context,
CharBuffer source, ByteBuffer target, IntBuffer offsets,
char[] buffer, int length, int cp, CoderResult cr){
@ -266,6 +271,7 @@ public class CharsetCallback {
* @stable ICU 3.6
*/
public static final Decoder TO_U_CALLBACK_STOP = new Decoder() {
@Override
public CoderResult call(CharsetDecoderICU decoder, Object context,
ByteBuffer source, CharBuffer target, IntBuffer offsets,
char[] buffer, int length, CoderResult cr){
@ -291,6 +297,7 @@ public class CharsetCallback {
* @stable ICU 4.0
*/
public static final Encoder FROM_U_CALLBACK_ESCAPE = new Encoder() {
@Override
public CoderResult call(CharsetEncoderICU encoder, Object context,
CharBuffer source, ByteBuffer target, IntBuffer offsets,
char[] buffer, int length, int cp, CoderResult cr){
@ -376,6 +383,7 @@ public class CharsetCallback {
* @stable ICU 4.0
*/
public static final Decoder TO_U_CALLBACK_ESCAPE = new Decoder() {
@Override
public CoderResult call(CharsetDecoderICU decoder, Object context,
ByteBuffer source, CharBuffer target, IntBuffer offsets,
char[] buffer, int length, CoderResult cr){

View File

@ -330,6 +330,7 @@ class CharsetCompoundText extends CharsetICU {
}
}
@Override
protected void implReset() {
super.implReset();
for (int i = 0; i < NUM_OF_CONVERTERS; i++) {
@ -339,6 +340,7 @@ class CharsetCompoundText extends CharsetICU {
}
}
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW;
int sourceChar;
@ -497,6 +499,7 @@ class CharsetCompoundText extends CharsetICU {
}
}
@Override
protected void implReset() {
super.implReset();
for (int i = 0; i < NUM_OF_CONVERTERS; i++) {
@ -506,6 +509,7 @@ class CharsetCompoundText extends CharsetICU {
}
}
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW;
byte[] sourceChar = { 0x00 };
@ -603,14 +607,17 @@ class CharsetCompoundText extends CharsetICU {
}
}
@Override
public CharsetDecoder newDecoder() {
return new CharsetDecoderCompoundText(this);
}
@Override
public CharsetEncoder newEncoder() {
return new CharsetEncoderCompoundText(this);
}
@Override
void getUnicodeSetImpl( UnicodeSet setFillIn, int which){
for (int i = 1; i < NUM_OF_CONVERTERS; i++) {
myConverterArray[i].MBCSGetFilteredUnicodeSetForUnicode(myConverterArray[i].sharedData, setFillIn, which, CharsetMBCS.UCNV_SET_FILTER_NONE);

View File

@ -57,6 +57,7 @@ public abstract class CharsetDecoderICU extends CharsetDecoder{
private CharsetCallback.Decoder onUnmappableCharacter = CharsetCallback.TO_U_CALLBACK_STOP;
private CharsetCallback.Decoder onMalformedInput = CharsetCallback.TO_U_CALLBACK_STOP;
CharsetCallback.Decoder toCharErrorBehaviour = new CharsetCallback.Decoder() {
@Override
public CoderResult call(CharsetDecoderICU decoder, Object context, ByteBuffer source,
CharBuffer target, IntBuffer offsets, char[] buffer, int length, CoderResult cr) {
if (cr.isUnmappable()) {
@ -115,6 +116,7 @@ public abstract class CharsetDecoderICU extends CharsetDecoder{
* @exception IllegalArgumentException
* @stable ICU 3.6
*/
@Override
protected final void implOnMalformedInput(CodingErrorAction newAction) {
// don't run infinitely
if (malformedInputCalled)
@ -137,6 +139,7 @@ public abstract class CharsetDecoderICU extends CharsetDecoder{
* @exception IllegalArgumentException
* @stable ICU 3.6
*/
@Override
protected final void implOnUnmappableCharacter(CodingErrorAction newAction) {
// dont run infinitely
if (unmappableCharacterCalled)
@ -194,6 +197,7 @@ public abstract class CharsetDecoderICU extends CharsetDecoder{
* Returns CoderResult.UNDERFLOW if the action succeeds.
* @stable ICU 3.6
*/
@Override
protected final CoderResult implFlush(CharBuffer out) {
return decode(EMPTY, out, null, true);
}
@ -202,6 +206,7 @@ public abstract class CharsetDecoderICU extends CharsetDecoder{
* Resets the to Unicode mode of converter
* @stable ICU 3.6
*/
@Override
protected void implReset() {
toUnicodeStatus = 0 ;
toULength = 0;
@ -233,6 +238,7 @@ public abstract class CharsetDecoderICU extends CharsetDecoder{
* action succeeds or more input is needed for completing the decoding action.
* @stable ICU 3.6
*/
@Override
protected CoderResult decodeLoop(ByteBuffer in,CharBuffer out){
if(in.remaining() < toUCountPending()){
return CoderResult.UNDERFLOW;

View File

@ -70,6 +70,7 @@ public abstract class CharsetEncoderICU extends CharsetEncoder {
private CharsetCallback.Encoder onMalformedInput = CharsetCallback.FROM_U_CALLBACK_STOP;
CharsetCallback.Encoder fromCharErrorBehaviour = new CharsetCallback.Encoder() {
@Override
public CoderResult call(CharsetEncoderICU encoder, Object context,
CharBuffer source, ByteBuffer target, IntBuffer offsets,
char[] buffer, int length, int cp, CoderResult cr) {
@ -150,6 +151,7 @@ public abstract class CharsetEncoderICU extends CharsetEncoder {
* @exception IllegalArgumentException
* @stable ICU 3.6
*/
@Override
protected void implOnMalformedInput(CodingErrorAction newAction) {
onMalformedInput = getCallback(newAction);
}
@ -162,6 +164,7 @@ public abstract class CharsetEncoderICU extends CharsetEncoder {
* @exception IllegalArgumentException
* @stable ICU 3.6
*/
@Override
protected void implOnUnmappableCharacter(CodingErrorAction newAction) {
onUnmappableInput = getCallback(newAction);
}
@ -221,6 +224,7 @@ public abstract class CharsetEncoderICU extends CharsetEncoder {
* Returns CoderResult.UNDERFLOW if the action succeeds.
* @stable ICU 3.6
*/
@Override
protected CoderResult implFlush(ByteBuffer out) {
return encode(EMPTY, out, null, true);
}
@ -229,6 +233,7 @@ public abstract class CharsetEncoderICU extends CharsetEncoder {
* Resets the from Unicode mode of converter
* @stable ICU 3.6
*/
@Override
protected void implReset() {
errorBufferLength = 0;
fromUnicodeStatus = 0;
@ -252,6 +257,7 @@ public abstract class CharsetEncoderICU extends CharsetEncoder {
* action succeeds or more input is needed for completing the decoding action.
* @stable ICU 3.6
*/
@Override
protected CoderResult encodeLoop(CharBuffer in, ByteBuffer out) {
if (!in.hasRemaining() && this.errorBufferLength == 0) { // make sure the errorBuffer is empty
// The Java framework should have already substituted what was left.
@ -673,6 +679,7 @@ public abstract class CharsetEncoderICU extends CharsetEncoder {
* Overrides super class method
* @stable ICU 3.6
*/
@Override
public boolean isLegalReplacement(byte[] repl) {
return true;
}

View File

@ -55,6 +55,7 @@ class CharsetHZ extends CharsetICU {
gbDecoder = (CharsetMBCS.CharsetDecoderMBCS) gbCharset.newDecoder();
}
@Override
protected void implReset() {
super.implReset();
gbDecoder.implReset();
@ -63,6 +64,7 @@ class CharsetHZ extends CharsetICU {
isEmptySegment = false;
}
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW;
byte[] tempBuf = new byte[2];
@ -230,6 +232,7 @@ class CharsetHZ extends CharsetICU {
gbEncoder = (CharsetMBCS.CharsetEncoderMBCS) gbCharset.newEncoder();
}
@Override
protected void implReset() {
super.implReset();
gbEncoder.implReset();
@ -238,6 +241,7 @@ class CharsetHZ extends CharsetICU {
isTargetUCharDBCS = false;
}
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
int length = 0;
int[] targetUniChar = new int[] { 0 };
@ -375,14 +379,17 @@ class CharsetHZ extends CharsetICU {
}
}
@Override
public CharsetDecoder newDecoder() {
return new CharsetDecoderHZ(this);
}
@Override
public CharsetEncoder newEncoder() {
return new CharsetEncoderHZ(this);
}
@Override
void getUnicodeSetImpl( UnicodeSet setFillIn, int which){
setFillIn.add(0,0x7f);
// CharsetMBCS mbcshz = (CharsetMBCS)CharsetICU.forNameICU("icu-internal-25546");

View File

@ -129,6 +129,7 @@ public abstract class CharsetICU extends Charset{
* @return true if the given charset is a subset of this charset
* @stable ICU 3.6
*/
@Override
public boolean contains(Charset cs){
if (null == cs) {
return false;

View File

@ -725,7 +725,7 @@ class CharsetISO2022 extends CharsetICU {
int hi = MAX_STATES_2022;
int oldmid = 0;
togo = normalize_esq_chars_2022[(short)c&UConverterConstants.UNSIGNED_BYTE_MASK];
togo = normalize_esq_chars_2022[c&UConverterConstants.UNSIGNED_BYTE_MASK];
if (togo == 0) {
/* not a valid character anywhere in an escape sequence */
@ -785,6 +785,7 @@ class CharsetISO2022 extends CharsetICU {
super(cs);
}
@Override
protected void implReset() {
super.implReset();
myConverterData.reset();
@ -840,6 +841,7 @@ class CharsetISO2022 extends CharsetICU {
bytes[1] = (byte)(UConverterConstants.UNSIGNED_BYTE_MASK & c2);
}
@Override
@SuppressWarnings("fallthrough")
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) {
boolean gotoGetTrail = false;
@ -1096,11 +1098,13 @@ class CharsetISO2022 extends CharsetICU {
super(cs);
}
@Override
protected void implReset() {
super.implReset();
myConverterData.reset();
}
@Override
@SuppressWarnings("fallthrough")
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW;
@ -1304,12 +1308,14 @@ class CharsetISO2022 extends CharsetICU {
super(cs);
}
@Override
protected void implReset() {
super.implReset();
setInitialStateToUnicodeKR();
myConverterData.reset();
}
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW;
int mySourceChar = 0x0000;
@ -1637,6 +1643,7 @@ class CharsetISO2022 extends CharsetICU {
super(cs, fromUSubstitutionChar[0]);
}
@Override
protected void implReset() {
super.implReset();
myConverterData.reset();
@ -1692,6 +1699,7 @@ class CharsetISO2022 extends CharsetICU {
return value;
}
/* This overrides the cbFromUWriteSub method in CharsetEncoderICU */
@Override
CoderResult cbFromUWriteSub (CharsetEncoderICU encoder,
CharBuffer source, ByteBuffer target, IntBuffer offsets){
CoderResult err = CoderResult.UNDERFLOW;
@ -1723,6 +1731,7 @@ class CharsetISO2022 extends CharsetICU {
return err;
}
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW;
int sourceChar;
@ -2202,12 +2211,14 @@ class CharsetISO2022 extends CharsetICU {
super(cs, fromUSubstitutionChar[0]);
}
@Override
protected void implReset() {
super.implReset();
myConverterData.reset();
}
/* This overrides the cbFromUWriteSub method in CharsetEncoderICU */
@Override
CoderResult cbFromUWriteSub (CharsetEncoderICU encoder,
CharBuffer source, ByteBuffer target, IntBuffer offsets){
CoderResult err = CoderResult.UNDERFLOW;
@ -2228,6 +2239,7 @@ class CharsetISO2022 extends CharsetICU {
return err;
}
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW;
int sourceChar;
@ -2564,6 +2576,7 @@ class CharsetISO2022 extends CharsetICU {
super(cs, fromUSubstitutionChar[myConverterData.version]);
}
@Override
protected void implReset() {
super.implReset();
myConverterData.reset();
@ -2571,6 +2584,7 @@ class CharsetISO2022 extends CharsetICU {
}
/* This overrides the cbFromUWriteSub method in CharsetEncoderICU */
@Override
CoderResult cbFromUWriteSub (CharsetEncoderICU encoder,
CharBuffer source, ByteBuffer target, IntBuffer offsets){
CoderResult err = CoderResult.UNDERFLOW;
@ -2644,6 +2658,7 @@ class CharsetISO2022 extends CharsetICU {
return err;
}
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW;
int[] targetByteUnit = { 0x0000 };
@ -2832,6 +2847,7 @@ class CharsetISO2022 extends CharsetICU {
}
}
@Override
public CharsetDecoder newDecoder() {
switch (variant) {
case ISO_2022_JP:
@ -2849,6 +2865,7 @@ class CharsetISO2022 extends CharsetICU {
}
}
@Override
public CharsetEncoder newEncoder() {
CharsetEncoderICU cnv;
@ -2894,6 +2911,7 @@ class CharsetISO2022 extends CharsetICU {
}
}
@Override
void getUnicodeSetImpl(UnicodeSet setFillIn, int which) {
int i;
/*open a set and initialize it with code points that are algorithmically round-tripped */

View File

@ -569,6 +569,7 @@ class CharsetLMBCS extends CharsetICU {
implReset();
}
@Override
protected void implReset() {
super.implReset();
}
@ -750,6 +751,7 @@ class CharsetLMBCS extends CharsetICU {
return uniChar;
}
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) {
CoderResult[] err = new CoderResult[1];
err[0] = CoderResult.UNDERFLOW;
@ -841,6 +843,7 @@ class CharsetLMBCS extends CharsetICU {
implReset();
}
@Override
protected void implReset() {
super.implReset();
}
@ -929,6 +932,7 @@ class CharsetLMBCS extends CharsetICU {
return ULMBCS_UNICODE_SIZE;
}
/* The main Unicode to LMBCS conversion function */
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW;
short[] lastConverterIndex = new short[1];
@ -1096,14 +1100,17 @@ class CharsetLMBCS extends CharsetICU {
return err;
}
}
@Override
public CharsetDecoder newDecoder() {
return new CharsetDecoderLMBCS(this);
}
@Override
public CharsetEncoder newEncoder() {
return new CharsetEncoderLMBCS(this);
}
@Override
void getUnicodeSetImpl(UnicodeSet setFillIn, int which){
getCompleteUnicodeSet(setFillIn);
}

View File

@ -48,6 +48,7 @@ public final class CharsetProviderICU extends CharsetProvider{
* @return Charset object for the given charset name, null if unsupported
* @stable ICU 3.6
*/
@Override
public final Charset charsetForName(String charsetName){
try{
// extract the options from the charset name
@ -290,6 +291,7 @@ public final class CharsetProviderICU extends CharsetProvider{
* @return the Charset iterator
* @stable ICU 3.6
*/
@Override
public final Iterator<Charset> charsets() {
loadAvailableICUCharsets();
return icuCharsets.iterator();

View File

@ -207,6 +207,7 @@ class CharsetSCSU extends CharsetICU{
}
//private SCSUData data ;
@Override
protected void implReset(){
super.implReset();
toULength = 0;
@ -231,6 +232,7 @@ class CharsetSCSU extends CharsetICU{
SCSUData data ;
private boolean LabelLoop;// used to break the while loop
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets,
boolean flush){
data = extraInfo;
@ -599,6 +601,7 @@ class CharsetSCSU extends CharsetICU{
}
//private SCSUData data;
@Override
protected void implReset() {
super.implReset();
extraInfo.initialize();
@ -638,6 +641,7 @@ class CharsetSCSU extends CharsetICU{
CoderResult cr;
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
data = extraInfo;
cr = CoderResult.UNDERFLOW;
@ -1252,14 +1256,17 @@ class CharsetSCSU extends CharsetICU{
}
@Override
public CharsetDecoder newDecoder() {
return new CharsetDecoderSCSU(this);
}
@Override
public CharsetEncoder newEncoder() {
return new CharsetEncoderSCSU(this);
}
@Override
void getUnicodeSetImpl( UnicodeSet setFillIn, int which){
CharsetICU.getCompleteUnicodeSet(setFillIn);
}

View File

@ -87,12 +87,14 @@ class CharsetUTF16 extends CharsetICU {
super(cs);
}
@Override
protected void implReset() {
super.implReset();
isBOMReadYet = false;
actualBOM = null;
}
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) {
/*
* If we detect a BOM in this buffer, then we must add the BOM size to the offsets because the actual
@ -246,11 +248,13 @@ class CharsetUTF16 extends CharsetICU {
fromUnicodeStatus = (isEndianSpecified && version != 1) ? 0 : NEED_TO_WRITE_BOM;
}
@Override
protected void implReset() {
super.implReset();
fromUnicodeStatus = (isEndianSpecified && version != 1) ? 0 : NEED_TO_WRITE_BOM;
}
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
CoderResult cr;
@ -315,14 +319,17 @@ class CharsetUTF16 extends CharsetICU {
}
}
@Override
public CharsetDecoder newDecoder() {
return new CharsetDecoderUTF16(this);
}
@Override
public CharsetEncoder newEncoder() {
return new CharsetEncoderUTF16(this);
}
@Override
void getUnicodeSetImpl( UnicodeSet setFillIn, int which){
getNonSurrogateUnicodeSet(setFillIn);
}

View File

@ -69,12 +69,14 @@ class CharsetUTF32 extends CharsetICU {
super(cs);
}
@Override
protected void implReset() {
super.implReset();
isBOMReadYet = false;
actualBOM = null;
}
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) {
/*
* If we detect a BOM in this buffer, then we must add the BOM size to the offsets because the actual
@ -171,11 +173,13 @@ class CharsetUTF32 extends CharsetICU {
fromUnicodeStatus = isEndianSpecified ? 0 : NEED_TO_WRITE_BOM;
}
@Override
protected void implReset() {
super.implReset();
fromUnicodeStatus = isEndianSpecified ? 0 : NEED_TO_WRITE_BOM;
}
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
CoderResult cr;
@ -238,15 +242,18 @@ class CharsetUTF32 extends CharsetICU {
}
}
@Override
public CharsetDecoder newDecoder() {
return new CharsetDecoderUTF32(this);
}
@Override
public CharsetEncoder newEncoder() {
return new CharsetEncoderUTF32(this);
}
@Override
void getUnicodeSetImpl( UnicodeSet setFillIn, int which){
getNonSurrogateUnicodeSet(setFillIn);
}

View File

@ -178,11 +178,13 @@ class CharsetUTF7 extends CharsetICU {
implReset();
}
@Override
protected void implReset() {
super.implReset();
toUnicodeStatus=(toUnicodeStatus & 0xf0000000) | 0x1000000;
}
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) {
CoderResult cr=CoderResult.UNDERFLOW;
byte base64Value;
@ -470,7 +472,7 @@ class CharsetUTF7 extends CharsetICU {
}
}
/* set the converter state */
toUnicodeStatus=(inDirectMode<<24 | (((short)base64Counter & UConverterConstants.UNSIGNED_BYTE_MASK)<<16) | (int)bits);
toUnicodeStatus=(inDirectMode<<24 | ((base64Counter & UConverterConstants.UNSIGNED_BYTE_MASK)<<16) | bits);
toULength=byteIndex;
return cr;
@ -483,11 +485,13 @@ class CharsetUTF7 extends CharsetICU {
implReset();
}
@Override
protected void implReset() {
super.implReset();
fromUnicodeStatus=(fromUnicodeStatus & 0xf0000000) | 0x1000000;
}
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
CoderResult cr=CoderResult.UNDERFLOW;
byte inDirectMode;
@ -756,21 +760,24 @@ class CharsetUTF7 extends CharsetICU {
fromUnicodeStatus=((status&0xf0000000) | 0x1000000); /* keep version, inDirectMode=TRUE */
} else {
/* set the converter state back */
fromUnicodeStatus=((status&0xf0000000) | (inDirectMode<<24) | (((short)base64Counter & UConverterConstants.UNSIGNED_BYTE_MASK)<<16) | ((int)bits));
fromUnicodeStatus=((status&0xf0000000) | (inDirectMode<<24) | ((base64Counter & UConverterConstants.UNSIGNED_BYTE_MASK)<<16) | (bits));
}
return cr;
}
}
@Override
public CharsetDecoder newDecoder() {
return new CharsetDecoderUTF7(this);
}
@Override
public CharsetEncoder newEncoder() {
return new CharsetEncoderUTF7(this);
}
@Override
void getUnicodeSetImpl( UnicodeSet setFillIn, int which){
getCompleteUnicodeSet(setFillIn);
}

View File

@ -65,6 +65,7 @@ class CharsetUTF8 extends CharsetICU {
super(cs);
}
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets,
boolean flush) {
if (!source.hasRemaining()) {
@ -346,10 +347,12 @@ class CharsetUTF8 extends CharsetICU {
implReset();
}
@Override
protected void implReset() {
super.implReset();
}
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets,
boolean flush) {
if (!source.hasRemaining()) {
@ -681,15 +684,18 @@ class CharsetUTF8 extends CharsetICU {
return (((c) & 0xc0) == 0x80);
}*/
@Override
public CharsetDecoder newDecoder() {
return new CharsetDecoderUTF8(this);
}
@Override
public CharsetEncoder newEncoder() {
return new CharsetEncoderUTF8(this);
}
@Override
void getUnicodeSetImpl( UnicodeSet setFillIn, int which){
getNonSurrogateUnicodeSet(setFillIn);
}

View File

@ -150,6 +150,7 @@ final class UConverterAliasDataReader implements ICUBinary.Authenticate {
return ICUBinary.getInts(byteBuffer, n, 0);
}
@Override
public boolean isDataVersionAcceptable(byte version[])
{
return version.length >= DATA_FORMAT_VERSION.length

View File

@ -408,6 +408,7 @@ final class UConverterDataReader {
private static final class IsAcceptable implements ICUBinary.Authenticate {
// @Override when we switch to Java 6
@Override
public boolean isDataVersionAcceptable(byte formatVersion[]) {
return formatVersion[0] == 6;
}

View File

@ -30,6 +30,7 @@ public final class CollationBuilder extends CollationRuleParser.Sink {
private static final boolean DEBUG = false;
private static final class BundleImporter implements CollationRuleParser.Importer {
BundleImporter() {}
@Override
public String getRules(String localeID, String collationType) {
return CollationLoader.loadRules(new ULocale(localeID), collationType);
}
@ -433,7 +434,7 @@ public final class CollationBuilder extends CollationRuleParser.Sink {
}
/** Implements CollationRuleParser.Sink. */
// Java 6: @Override
@Override
void addRelation(int strength, CharSequence prefix, CharSequence str, CharSequence extension) {
String nfdPrefix;
if(prefix.length() == 0) {
@ -1322,6 +1323,7 @@ public final class CollationBuilder extends CollationRuleParser.Sink {
CEFinalizer(long[] ces) {
finalCEs = ces;
}
@Override
public long modifyCE32(int ce32) {
assert(!Collation.isSpecialCE32(ce32));
if(CollationBuilder.isTempCE32(ce32)) {
@ -1331,6 +1333,7 @@ public final class CollationBuilder extends CollationRuleParser.Sink {
return Collation.NO_CE;
}
}
@Override
public long modifyCE(long ce) {
if(CollationBuilder.isTempCE(ce)) {
// retain case bits

View File

@ -491,7 +491,7 @@ final class CollationDataReader /* all static */ {
}
private static final class IsAcceptable implements ICUBinary.Authenticate {
// @Override when we switch to Java 6
@Override
public boolean isDataVersionAcceptable(byte version[]) {
return version[0] == 5;
}

View File

@ -160,7 +160,7 @@ public final class CollationWeights {
long start, end;
int length, count;
// Java 6: @Override
@Override
public int compareTo(WeightRange other) {
long l=start;
long r=other.start;

View File

@ -140,6 +140,7 @@ public final class AlphabeticIndex<V> implements Iterable<Bucket<V>> {
// Comparator for records, so that the Record class can be static.
private final Comparator<Record<V>> recordComparator = new Comparator<Record<V>>() {
@Override
public int compare(Record<V> o1, Record<V> o2) {
return collatorOriginal.compare(o1.name, o2.name);
}
@ -218,6 +219,7 @@ public final class AlphabeticIndex<V> implements Iterable<Bucket<V>> {
* {@inheritDoc}
* @stable ICU 51
*/
@Override
public Iterator<Bucket<V>> iterator() {
return buckets.iterator();
}
@ -750,6 +752,7 @@ public final class AlphabeticIndex<V> implements Iterable<Bucket<V>> {
* @return iterator over buckets.
* @stable ICU 4.8
*/
@Override
public Iterator<Bucket<V>> iterator() {
initBuckets();
return buckets.iterator();
@ -875,6 +878,7 @@ public final class AlphabeticIndex<V> implements Iterable<Bucket<V>> {
* Standard toString()
* @stable ICU 4.8
*/
@Override
public String toString() {
return name + "=" + data;
}
@ -977,6 +981,7 @@ public final class AlphabeticIndex<V> implements Iterable<Bucket<V>> {
* Iterator over the records in the bucket
* @stable ICU 4.8
*/
@Override
public Iterator<Record<V>> iterator() {
if (records == null) {
return Collections.<Record<V>>emptyList().iterator();
@ -1188,6 +1193,7 @@ public final class AlphabeticIndex<V> implements Iterable<Bucket<V>> {
/**
* Iterator over just the visible buckets.
*/
@Override
public Iterator<Bucket<V>> iterator() {
return immutableVisibleList.iterator(); // use immutable list to prevent remove().
}

View File

@ -28,6 +28,7 @@ import com.ibm.icu.util.ULocale;
final class CollatorServiceShim extends Collator.ServiceShim {
@Override
Collator getInstance(ULocale locale) {
// use service cache, it's faster than instantiation
// if (service.isDefault()) {
@ -51,6 +52,7 @@ final class CollatorServiceShim extends Collator.ServiceShim {
}
}
@Override
Object registerInstance(Collator collator, ULocale locale) {
// Set the collator locales while registering so that getInstance()
// need not guess whether the collator's locales are already set properly
@ -59,6 +61,7 @@ final class CollatorServiceShim extends Collator.ServiceShim {
return service.registerObject(collator, locale);
}
@Override
Object registerFactory(CollatorFactory f) {
class CFactory extends LocaleKeyFactory {
CollatorFactory delegate;
@ -68,16 +71,19 @@ final class CollatorServiceShim extends Collator.ServiceShim {
this.delegate = fctry;
}
@Override
public Object handleCreate(ULocale loc, int kind, ICUService srvc) {
Object coll = delegate.createCollator(loc);
return coll;
}
@Override
public String getDisplayName(String id, ULocale displayLocale) {
ULocale objectLocale = new ULocale(id);
return delegate.getDisplayName(objectLocale, displayLocale);
}
@Override
public Set<String> getSupportedIDs() {
return delegate.getSupportedLocaleIDs();
}
@ -86,10 +92,12 @@ final class CollatorServiceShim extends Collator.ServiceShim {
return service.registerFactory(new CFactory(f));
}
@Override
boolean unregister(Object registryKey) {
return service.unregisterFactory((Factory)registryKey);
}
@Override
Locale[] getAvailableLocales() {
// TODO rewrite this to just wrap getAvailableULocales later
Locale[] result;
@ -102,6 +110,7 @@ final class CollatorServiceShim extends Collator.ServiceShim {
return result;
}
@Override
ULocale[] getAvailableULocales() {
ULocale[] result;
if (service.isDefault()) {
@ -113,6 +122,7 @@ final class CollatorServiceShim extends Collator.ServiceShim {
return result;
}
@Override
String getDisplayName(ULocale objectLocale, ULocale displayLocale) {
String id = objectLocale.getName();
return service.getDisplayName(id, displayLocale);
@ -152,6 +162,7 @@ final class CollatorServiceShim extends Collator.ServiceShim {
///CLOVER:OFF
// The following method can not be reached by testing
@Override
protected Object handleDefault(Key key, String[] actualIDReturn) {
if (actualIDReturn != null) {
actualIDReturn[0] = "root";

View File

@ -1483,6 +1483,7 @@ public class GlobalizationPreferences implements Freezable<GlobalizationPreferen
* @draft ICU 3.6
* @provisional This API might change or be removed in a future release.
*/
@Override
public boolean isFrozen() {
return frozen;
}
@ -1491,6 +1492,7 @@ public class GlobalizationPreferences implements Freezable<GlobalizationPreferen
* @draft ICU 4.4
* @provisional This API might change or be removed in a future release.
*/
@Override
public GlobalizationPreferences freeze() {
frozen = true;
return this;
@ -1500,6 +1502,7 @@ public class GlobalizationPreferences implements Freezable<GlobalizationPreferen
* @draft ICU 4.4
* @provisional This API might change or be removed in a future release.
*/
@Override
public GlobalizationPreferences cloneAsThawed() {
try {
GlobalizationPreferences result = (GlobalizationPreferences) clone();

View File

@ -659,7 +659,8 @@ public class CalendarAstronomer {
*/
public long getSunTime(double desired, boolean next)
{
return timeOfAngle( new AngleFunc() { public double eval() { return getSunLongitude(); } },
return timeOfAngle( new AngleFunc() { @Override
public double eval() { return getSunLongitude(); } },
desired,
TROPICAL_YEAR,
MINUTE_MS,
@ -687,8 +688,7 @@ public class CalendarAstronomer {
*
* @internal
*/
public long getSunRiseSet(boolean rise)
{
public long getSunRiseSet(boolean rise) {
long t0 = time;
// Make a rough guess: 6am or 6pm local time on the current day
@ -697,16 +697,17 @@ public class CalendarAstronomer {
setTime(noon + (rise ? -6L : 6L) * HOUR_MS);
long t = riseOrSet(new CoordFunc() {
public Equatorial eval() { return getSunPosition(); }
},
rise,
.533 * DEG_RAD, // Angular Diameter
34 /60.0 * DEG_RAD, // Refraction correction
MINUTE_MS / 12); // Desired accuracy
@Override
public Equatorial eval() { return getSunPosition(); }
},
rise,
.533 * DEG_RAD, // Angular Diameter
34 /60.0 * DEG_RAD, // Refraction correction
MINUTE_MS / 12); // Desired accuracy
setTime(t0);
return t;
}
setTime(t0);
return t;
}
// Commented out - currently unused. ICU 2.6, Alan
// //-------------------------------------------------------------------------
@ -1166,6 +1167,7 @@ public class CalendarAstronomer {
public long getMoonTime(double desired, boolean next)
{
return timeOfAngle( new AngleFunc() {
@Override
public double eval() { return getMoonAge(); } },
desired,
SYNODIC_MONTH,
@ -1194,6 +1196,7 @@ public class CalendarAstronomer {
public long getMoonRiseSet(boolean rise)
{
return riseOrSet(new CoordFunc() {
@Override
public Equatorial eval() { return getMoonPosition(); }
},
rise,
@ -1507,6 +1510,7 @@ public class CalendarAstronomer {
* Return a string representation of this object
* @internal
*/
@Override
public String toString() {
return Double.toString(longitude*RAD_DEG) + "," + (latitude*RAD_DEG);
}
@ -1567,6 +1571,7 @@ public class CalendarAstronomer {
* angles measured in degrees.
* @internal
*/
@Override
public String toString() {
return Double.toString(ascension*RAD_DEG) + "," + (declination*RAD_DEG);
}
@ -1633,6 +1638,7 @@ public class CalendarAstronomer {
* angles measured in degrees.
* @internal
*/
@Override
public String toString() {
return Double.toString(altitude*RAD_DEG) + "," + (azimuth*RAD_DEG);
}

View File

@ -213,6 +213,7 @@ public class CharTrie extends Trie
* otherwise
*/
///CLOVER:OFF
@Override
public boolean equals(Object other)
{
boolean result = super.equals(other);
@ -223,6 +224,7 @@ public class CharTrie extends Trie
return false;
}
@Override
public int hashCode() {
assert false : "hashCode not designed";
return 42;
@ -236,6 +238,7 @@ public class CharTrie extends Trie
* data array</p>
* @param bytes buffer containing trie data
*/
@Override
protected final void unserialize(ByteBuffer bytes)
{
int indexDataLength = m_dataOffset_ + m_dataLength_;
@ -250,6 +253,7 @@ public class CharTrie extends Trie
* @param trail trailing surrogate
* @return offset to data
*/
@Override
protected final int getSurrogateOffset(char lead, char trail)
{
if (m_dataManipulate_ == null) {
@ -277,6 +281,7 @@ public class CharTrie extends Trie
* @return 32 bit value
* @see com.ibm.icu.impl.TrieIterator
*/
@Override
protected final int getValue(int index)
{
return m_data_[index];
@ -286,6 +291,7 @@ public class CharTrie extends Trie
* Gets the default initial value
* @return 32 bit value
*/
@Override
protected final int getInitialValue()
{
return m_initialValue_;

View File

@ -33,6 +33,7 @@ public class CharacterIteratorWrapper extends UCharacterIterator {
/**
* @see UCharacterIterator#current()
*/
@Override
public int current() {
int c = iterator.current();
if(c==CharacterIterator.DONE){
@ -44,6 +45,7 @@ public class CharacterIteratorWrapper extends UCharacterIterator {
/**
* @see UCharacterIterator#getLength()
*/
@Override
public int getLength() {
return (iterator.getEndIndex() - iterator.getBeginIndex());
}
@ -51,6 +53,7 @@ public class CharacterIteratorWrapper extends UCharacterIterator {
/**
* @see UCharacterIterator#getIndex()
*/
@Override
public int getIndex() {
return iterator.getIndex();
}
@ -58,6 +61,7 @@ public class CharacterIteratorWrapper extends UCharacterIterator {
/**
* @see UCharacterIterator#next()
*/
@Override
public int next() {
int i = iterator.current();
iterator.next();
@ -70,6 +74,7 @@ public class CharacterIteratorWrapper extends UCharacterIterator {
/**
* @see UCharacterIterator#previous()
*/
@Override
public int previous() {
int i = iterator.previous();
if(i==CharacterIterator.DONE){
@ -81,6 +86,7 @@ public class CharacterIteratorWrapper extends UCharacterIterator {
/**
* @see UCharacterIterator#setIndex(int)
*/
@Override
public void setIndex(int index) {
try{
iterator.setIndex(index);
@ -92,6 +98,7 @@ public class CharacterIteratorWrapper extends UCharacterIterator {
/**
* @see UCharacterIterator#setToLimit()
*/
@Override
public void setToLimit() {
iterator.setIndex(iterator.getEndIndex());
}
@ -99,6 +106,7 @@ public class CharacterIteratorWrapper extends UCharacterIterator {
/**
* @see UCharacterIterator#getText(char[])
*/
@Override
public int getText(char[] fillIn, int offset){
int length =iterator.getEndIndex() - iterator.getBeginIndex();
int currentIndex = iterator.getIndex();
@ -118,6 +126,7 @@ public class CharacterIteratorWrapper extends UCharacterIterator {
* Creates a clone of this iterator. Clones the underlying character iterator.
* @see UCharacterIterator#clone()
*/
@Override
public Object clone(){
try {
CharacterIteratorWrapper result = (CharacterIteratorWrapper) super.clone();
@ -129,6 +138,7 @@ public class CharacterIteratorWrapper extends UCharacterIterator {
}
@Override
public int moveIndex(int delta){
int length = iterator.getEndIndex() - iterator.getBeginIndex();
int idx = iterator.getIndex()+delta;
@ -144,6 +154,7 @@ public class CharacterIteratorWrapper extends UCharacterIterator {
/**
* @see UCharacterIterator#getCharacterIterator()
*/
@Override
public CharacterIterator getCharacterIterator(){
return (CharacterIterator)iterator.clone();
}

View File

@ -54,10 +54,11 @@ public class ClassLoaderUtil {
ClassLoader cl = null;
if (System.getSecurityManager() != null) {
cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
public BootstrapClassLoader run() {
return new BootstrapClassLoader();
}
});
@Override
public BootstrapClassLoader run() {
return new BootstrapClassLoader();
}
});
} else {
cl = new BootstrapClassLoader();
}

View File

@ -90,18 +90,22 @@ public final class DateNumberFormat extends NumberFormat {
minusSign = elems[10];
}
@Override
public void setMaximumIntegerDigits(int newValue) {
maxIntDigits = newValue;
}
@Override
public int getMaximumIntegerDigits() {
return maxIntDigits;
}
@Override
public void setMinimumIntegerDigits(int newValue) {
minIntDigits = newValue;
}
@Override
public int getMinimumIntegerDigits() {
return minIntDigits;
}
@ -130,11 +134,13 @@ public final class DateNumberFormat extends NumberFormat {
return digits.clone();
}
@Override
public StringBuffer format(double number, StringBuffer toAppendTo,
FieldPosition pos) {
throw new UnsupportedOperationException("StringBuffer format(double, StringBuffer, FieldPostion) is not implemented");
}
@Override
public StringBuffer format(long numberL, StringBuffer toAppendTo,
FieldPosition pos) {
@ -174,16 +180,19 @@ public final class DateNumberFormat extends NumberFormat {
return toAppendTo;
}
@Override
public StringBuffer format(BigInteger number, StringBuffer toAppendTo,
FieldPosition pos) {
throw new UnsupportedOperationException("StringBuffer format(BigInteger, StringBuffer, FieldPostion) is not implemented");
}
@Override
public StringBuffer format(java.math.BigDecimal number, StringBuffer toAppendTo,
FieldPosition pos) {
throw new UnsupportedOperationException("StringBuffer format(BigDecimal, StringBuffer, FieldPostion) is not implemented");
}
@Override
public StringBuffer format(BigDecimal number,
StringBuffer toAppendTo, FieldPosition pos) {
throw new UnsupportedOperationException("StringBuffer format(BigDecimal, StringBuffer, FieldPostion) is not implemented");
@ -194,6 +203,7 @@ public final class DateNumberFormat extends NumberFormat {
*/
private static final long PARSE_THRESHOLD = 922337203685477579L; // (Long.MAX_VALUE / 10) - 1
@Override
public Number parse(String text, ParsePosition parsePosition) {
long num = 0;
boolean sawNumber = false;
@ -236,6 +246,7 @@ public final class DateNumberFormat extends NumberFormat {
return result;
}
@Override
public boolean equals(Object obj) {
if (obj == null || !super.equals(obj) || !(obj instanceof DateNumberFormat)) {
return false;
@ -248,6 +259,7 @@ public final class DateNumberFormat extends NumberFormat {
&& Arrays.equals(this.digits, other.digits));
}
@Override
public int hashCode() {
return super.hashCode();
}

View File

@ -39,7 +39,7 @@ public final class ICUBinary {
private static final int DATA_FORMAT = 0x436d6e44;
private static final class IsAcceptable implements Authenticate {
// @Override when we switch to Java 6
@Override
public boolean isDataVersionAcceptable(byte version[]) {
return version[0] == 1;
}
@ -367,7 +367,7 @@ public final class ICUBinary {
} else if (i == key.length()) {
return -1; // key < table key because key is shorter.
}
int diff = (int)key.charAt(i) - c2;
int diff = key.charAt(i) - c2;
if (diff != 0) {
return diff;
}
@ -386,7 +386,7 @@ public final class ICUBinary {
} else if (i == key.length()) {
return -1; // key < table key because key is shorter.
}
int diff = (int)key.charAt(i) - c2;
int diff = key.charAt(i) - c2;
if (diff != 0) {
return diff;
}
@ -610,7 +610,7 @@ public final class ICUBinary {
bytes.position(headerSize);
return // dataVersion
((int)bytes.get(20) << 24) |
(bytes.get(20) << 24) |
((bytes.get(21) & 0xff) << 16) |
((bytes.get(22) & 0xff) << 8) |
(bytes.get(23) & 0xff);

View File

@ -63,6 +63,7 @@ public class ICUConfig {
if (System.getSecurityManager() != null) {
try {
val = AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() {
return System.getProperty(fname);
}

View File

@ -93,6 +93,7 @@ public final class ICUData {
URL i = null;
if (System.getSecurityManager() != null) {
i = AccessController.doPrivileged(new PrivilegedAction<URL>() {
@Override
public URL run() {
return ICUData.class.getResource(resourceName);
}
@ -107,6 +108,7 @@ public final class ICUData {
InputStream i = null;
if (System.getSecurityManager() != null) {
i = AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
@Override
public InputStream run() {
return root.getResourceAsStream(resourceName);
}
@ -129,6 +131,7 @@ public final class ICUData {
InputStream i = null;
if (System.getSecurityManager() != null) {
i = AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
@Override
public InputStream run() {
return loader.getResourceAsStream(resourceName);
}

View File

@ -248,6 +248,7 @@ public class ICULocaleService extends ICUService {
/**
* Return the (canonical) original ID.
*/
@Override
public String canonicalID() {
return primaryID;
}
@ -255,6 +256,7 @@ public class ICULocaleService extends ICUService {
/**
* Return the (canonical) current ID, or null if no current id.
*/
@Override
public String currentID() {
return currentID;
}
@ -263,6 +265,7 @@ public class ICULocaleService extends ICUService {
* Return the (canonical) current descriptor, or null if no current id.
* Includes the keywords, whereas the ID does not include keywords.
*/
@Override
public String currentDescriptor() {
String result = currentID();
if (result != null) {
@ -307,6 +310,7 @@ public class ICULocaleService extends ICUService {
* unless the primary id was "" (root), in which case
* there is no fallback.
*/
@Override
public boolean fallback() {
int x = currentID.lastIndexOf('_');
if (x != -1) {
@ -332,6 +336,7 @@ public class ICULocaleService extends ICUService {
* If a key created from id would eventually fallback to match the
* canonical ID of this key, return true.
*/
@Override
public boolean isFallbackOf(String id) {
return LocaleUtility.isFallbackOf(canonicalID(), id);
}
@ -369,6 +374,7 @@ public class ICULocaleService extends ICUService {
* the key against the supported IDs, and passes the canonicalLocale and
* kind off to handleCreate (which subclasses must implement).
*/
@Override
public Object create(Key key, ICUService service) {
if (handlesKey(key)) {
LocaleKey lkey = (LocaleKey)key;
@ -395,6 +401,7 @@ public class ICULocaleService extends ICUService {
/**
* Override of superclass method.
*/
@Override
public void updateVisibleIDs(Map<String, Factory> result) {
Set<String> cache = getSupportedIDs();
for (String id : cache) {
@ -409,6 +416,7 @@ public class ICULocaleService extends ICUService {
/**
* Return a localized name for the locale represented by id.
*/
@Override
public String getDisplayName(String id, ULocale locale) {
// assume if the user called this on us, we must have handled some fallback of this id
// if (isSupportedID(id)) {
@ -451,6 +459,7 @@ public class ICULocaleService extends ICUService {
/**
* For debugging.
*/
@Override
public String toString() {
StringBuilder buf = new StringBuilder(super.toString());
if (name != null) {
@ -487,6 +496,7 @@ public class ICULocaleService extends ICUService {
/**
* Returns the service object if kind/locale match. Service is not used.
*/
@Override
public Object create(Key key, ICUService service) {
if (!(key instanceof LocaleKey)) {
return null;
@ -503,10 +513,12 @@ public class ICULocaleService extends ICUService {
return obj;
}
@Override
protected boolean isSupportedID(String idToCheck) {
return this.id.equals(idToCheck);
}
@Override
public void updateVisibleIDs(Map<String, Factory> result) {
if (visible) {
result.put(id, this);
@ -515,6 +527,7 @@ public class ICULocaleService extends ICUService {
}
}
@Override
public String toString() {
StringBuilder buf = new StringBuilder(super.toString());
buf.append(", id: ");
@ -555,6 +568,7 @@ public class ICULocaleService extends ICUService {
/**
* Return the supported IDs. This is the set of all locale names for the bundleName.
*/
@Override
protected Set<String> getSupportedIDs() {
return ICUResourceBundle.getFullLocaleNameSet(bundleName, loader());
}
@ -562,6 +576,7 @@ public class ICULocaleService extends ICUService {
/**
* Override of superclass method.
*/
@Override
public void updateVisibleIDs(Map<String, Factory> result) {
Set<String> visibleIDs = ICUResourceBundle.getAvailableLocaleNameSet(bundleName, loader()); // only visible ids
for (String id : visibleIDs) {
@ -573,6 +588,7 @@ public class ICULocaleService extends ICUService {
* Create the service. The default implementation returns the resource bundle
* for the locale, ignoring kind, and service.
*/
@Override
protected Object handleCreate(ULocale loc, int kind, ICUService service) {
return ICUResourceBundle.getBundleInstance(bundleName, loc, loader());
}
@ -581,6 +597,7 @@ public class ICULocaleService extends ICUService {
return ClassLoaderUtil.getClassLoader(getClass());
}
@Override
public String toString() {
return super.toString() + ", bundle: " + bundleName;
}
@ -604,6 +621,7 @@ public class ICULocaleService extends ICUService {
return fallbackLocaleName;
}
@Override
public Key createKey(String id) {
return LocaleKey.createWithCanonicalFallback(id, validateFallbackLocale());
}

View File

@ -137,6 +137,7 @@ public abstract class ICUNotifier {
* Wait for a notification to be queued, then notify all
* listeners listed in the notification.
*/
@Override
public void run() {
EventListener[] list;
while (true) {

View File

@ -88,6 +88,7 @@ public class ICURWLock {
/**
* Return a string listing all the stats.
*/
@Override
public String toString() {
return " rc: " + _rc +
" mrc: " + _mrc +

View File

@ -297,6 +297,7 @@ public class ICUService extends ICUNotifier {
* Return the service instance if the factory's id is equal to
* the key's currentID. Service is ignored.
*/
@Override
public Object create(Key key, ICUService service) {
if (id.equals(key.currentID())) {
return instance;
@ -308,6 +309,7 @@ public class ICUService extends ICUNotifier {
* If visible, adds a mapping from id -> this to the result,
* otherwise removes id from result.
*/
@Override
public void updateVisibleIDs(Map<String, Factory> result) {
if (visible) {
result.put(id, this);
@ -321,6 +323,7 @@ public class ICUService extends ICUNotifier {
* otherwise returns null. (This default implementation has
* no localized id information.)
*/
@Override
public String getDisplayName(String identifier, ULocale locale) {
return (visible && id.equals(identifier)) ? identifier : null;
}
@ -328,6 +331,7 @@ public class ICUService extends ICUNotifier {
/**
* For debugging.
*/
@Override
public String toString() {
StringBuilder buf = new StringBuilder(super.toString());
buf.append(", id: ");
@ -923,6 +927,7 @@ public class ICUService extends ICUNotifier {
* requires a ServiceListener. Subclasses can override to accept
* different listeners.
*/
@Override
protected boolean acceptsListener(EventListener l) {
return l instanceof ServiceListener;
}
@ -931,6 +936,7 @@ public class ICUService extends ICUNotifier {
* Notify the listener, which by default is a ServiceListener.
* Subclasses can override to use a different listener.
*/
@Override
protected void notifyListener(EventListener l) {
((ServiceListener)l).serviceChanged(this);
}
@ -959,6 +965,7 @@ public class ICUService extends ICUNotifier {
/**
* Returns the result of super.toString, appending the name in curly braces.
*/
@Override
public String toString() {
return super.toString() + "{" + name + "}";
}

View File

@ -27,6 +27,7 @@ public class IllegalIcuArgumentException extends IllegalArgumentException {
super(errorMessage, cause);
}
@Override
public synchronized IllegalIcuArgumentException initCause(Throwable cause) {
return (IllegalIcuArgumentException) super.initCause(cause);
}

View File

@ -222,6 +222,7 @@ public class IntTrie extends Trie
* otherwise
*/
///CLOVER:OFF
@Override
public boolean equals(Object other)
{
boolean result = super.equals(other);
@ -236,6 +237,7 @@ public class IntTrie extends Trie
return false;
}
@Override
public int hashCode() {
assert false : "hashCode not designed";
return 42;
@ -249,6 +251,7 @@ public class IntTrie extends Trie
* data array</p>
* @param bytes data buffer containing trie data
*/
@Override
protected final void unserialize(ByteBuffer bytes)
{
super.unserialize(bytes);
@ -263,6 +266,7 @@ public class IntTrie extends Trie
* @param trail trailing surrogate
* @return offset to data
*/
@Override
protected final int getSurrogateOffset(char lead, char trail)
{
if (m_dataManipulate_ == null) {
@ -289,6 +293,7 @@ public class IntTrie extends Trie
* @return 32 bit value
* @see com.ibm.icu.impl.TrieIterator
*/
@Override
protected final int getValue(int index)
{
return m_data_[index];
@ -298,6 +303,7 @@ public class IntTrie extends Trie
* Gets the default initial value
* @return 32 bit value
*/
@Override
protected final int getInitialValue()
{
return m_initialValue_;

View File

@ -32,6 +32,7 @@ public class IterableComparator<T> implements Comparator<Iterable<T>> {
this.shorterFirst = shorterFirst ? 1 : -1;
}
@Override
public int compare(Iterable<T> a, Iterable<T> b) {
if (a == null) {
return b == null ? 0 : -shorterFirst;

View File

@ -637,10 +637,12 @@ public class LocaleDisplayNamesImpl extends LocaleDisplayNames {
path, locale.getBaseName());
}
@Override
public ULocale getLocale() {
return bundle.getULocale();
}
@Override
public String get(String tableName, String subTableName, String code) {
return ICUResourceTableAccess.getTableString(bundle, tableName, subTableName,
code, nullIfNotFound ? null : code);
@ -654,6 +656,7 @@ public class LocaleDisplayNamesImpl extends LocaleDisplayNames {
return (DataTables) Class.forName(className).newInstance();
} catch (Throwable t) {
return new DataTables() {
@Override
public DataTable get(ULocale locale, boolean nullIfNotFound) {
return new DataTable(nullIfNotFound);
}

View File

@ -591,6 +591,7 @@ public final class LocaleIDParser {
private Comparator<String> getKeyComparator() {
final Comparator<String> comp = new Comparator<String>() {
@Override
public int compare(String lhs, String rhs) {
return lhs.compareTo(rhs);
}

View File

@ -342,6 +342,7 @@ public final class Norm2AllModes {
}
private static CacheBase<String, Norm2AllModes, ByteBuffer> cache =
new SoftCache<String, Norm2AllModes, ByteBuffer>() {
@Override
protected Norm2AllModes createInstance(String key, ByteBuffer bytes) {
Normalizer2Impl impl;
if(bytes==null) {

View File

@ -206,6 +206,7 @@ public final class Normalizer2Impl {
// They assume that the cc or trailCC of their input is 0.
// Most of them implement Appendable interface methods.
// @Override when we switch to Java 6
@Override
public ReorderingBuffer append(char c) {
str.append(c);
lastCC=0;
@ -218,6 +219,7 @@ public final class Normalizer2Impl {
reorderStart=str.length();
}
// @Override when we switch to Java 6
@Override
public ReorderingBuffer append(CharSequence s) {
if(s.length()!=0) {
str.append(s);
@ -227,6 +229,7 @@ public final class Normalizer2Impl {
return this;
}
// @Override when we switch to Java 6
@Override
public ReorderingBuffer append(CharSequence s, int start, int limit) {
if(start!=limit) {
str.append(s, start, limit);
@ -413,6 +416,7 @@ public final class Normalizer2Impl {
private static final class IsAcceptable implements ICUBinary.Authenticate {
// @Override when we switch to Java 6
@Override
public boolean isDataVersionAcceptable(byte version[]) {
return version[0]==2;
}
@ -560,6 +564,7 @@ public final class Normalizer2Impl {
}
}
private static final Trie2.ValueMapper segmentStarterMapper=new Trie2.ValueMapper() {
@Override
public int map(int in) {
return in&CANON_NOT_SEGMENT_STARTER;
}
@ -1829,7 +1834,7 @@ public final class Normalizer2Impl {
}
if(key1==(firstUnit&COMP_1_TRAIL_MASK)) {
if((firstUnit&COMP_1_TRIPLE)!=0) {
return ((int)compositions.charAt(list+1)<<16)|compositions.charAt(list+2);
return (compositions.charAt(list+1)<<16)|compositions.charAt(list+2);
} else {
return compositions.charAt(list+1);
}
@ -1874,7 +1879,7 @@ public final class Normalizer2Impl {
compositeAndFwd=maybeYesCompositions.charAt(list+1);
list+=2;
} else {
compositeAndFwd=(((int)maybeYesCompositions.charAt(list+1)&~COMP_2_TRAIL_MASK)<<16)|
compositeAndFwd=((maybeYesCompositions.charAt(list+1)&~COMP_2_TRAIL_MASK)<<16)|
maybeYesCompositions.charAt(list+2);
list+=3;
}

View File

@ -538,20 +538,20 @@ public class OlsonTimeZone extends BasicTimeZone {
if (transPre32 != null) {
for (int i = 0; i < transPre32.length / 2; i++, idx++) {
transitionTimes64[idx] =
(((long)transPre32[i * 2]) & 0x00000000FFFFFFFFL) << 32
| (((long)transPre32[i * 2 + 1]) & 0x00000000FFFFFFFFL);
((transPre32[i * 2]) & 0x00000000FFFFFFFFL) << 32
| ((transPre32[i * 2 + 1]) & 0x00000000FFFFFFFFL);
}
}
if (trans32 != null) {
for (int i = 0; i < trans32.length; i++, idx++) {
transitionTimes64[idx] = (long)trans32[i];
transitionTimes64[idx] = trans32[i];
}
}
if (transPost32 != null) {
for (int i = 0; i < transPost32.length / 2; i++, idx++) {
transitionTimes64[idx] =
(((long)transPost32[i * 2]) & 0x00000000FFFFFFFFL) << 32
| (((long)transPost32[i * 2 + 1]) & 0x00000000FFFFFFFFL);
((transPost32[i * 2]) & 0x00000000FFFFFFFFL) << 32
| ((transPost32[i * 2 + 1]) & 0x00000000FFFFFFFFL);
}
}
} else {
@ -1268,6 +1268,7 @@ public class OlsonTimeZone extends BasicTimeZone {
/* (non-Javadoc)
* @see com.ibm.icu.util.TimeZone#isFrozen()
*/
@Override
public boolean isFrozen() {
return isFrozen;
}
@ -1275,6 +1276,7 @@ public class OlsonTimeZone extends BasicTimeZone {
/* (non-Javadoc)
* @see com.ibm.icu.util.TimeZone#freeze()
*/
@Override
public TimeZone freeze() {
isFrozen = true;
return this;
@ -1283,6 +1285,7 @@ public class OlsonTimeZone extends BasicTimeZone {
/* (non-Javadoc)
* @see com.ibm.icu.util.TimeZone#cloneAsThawed()
*/
@Override
public TimeZone cloneAsThawed() {
OlsonTimeZone tz = (OlsonTimeZone)super.cloneAsThawed();
if (finalZone != null) {

View File

@ -19,17 +19,21 @@ public class PVecToTrieCompactHandler implements CompactHandler {
public IntTrieBuilder builder;
public int initialValue;
@Override
public void setRowIndexForErrorValue(int rowIndex) {
}
@Override
public void setRowIndexForInitialValue(int rowIndex) {
initialValue = rowIndex;
}
@Override
public void setRowIndexForRange(int start, int end, int rowIndex) {
builder.setRange(start, end + 1, rowIndex, true);
}
@Override
public void startRealValues(int rowIndex) {
if (rowIndex > 0xffff) {
// too many rows for a 16-bit trie

View File

@ -382,6 +382,7 @@ public class PropsVectors {
}
Arrays.sort(indexArray, new Comparator<Integer>() {
@Override
public int compare(Integer o1, Integer o2) {
int indexOfRow1 = o1.intValue();
int indexOfRow2 = o2.intValue();
@ -520,6 +521,7 @@ public class PropsVectors {
// inner class implementation of Trie.DataManipulate
private static class DefaultGetFoldingOffset implements Trie.DataManipulate {
@Override
public int getFoldingOffset(int value) {
return value;
}
@ -534,6 +536,7 @@ public class PropsVectors {
builder = inBuilder;
}
@Override
public int getFoldedValue(int start, int offset) {
int initialValue = builder.m_initialValue_;
int limit = start + 0x400;

View File

@ -100,6 +100,7 @@ public class Relation<K, V> implements Freezable<Relation<K,V>> { // TODO: add ,
return result;
}
@Override
public boolean equals(Object o) {
if (o == null)
return false;
@ -123,6 +124,7 @@ public class Relation<K, V> implements Freezable<Relation<K,V>> { // TODO: add ,
return data.get(key);
}
@Override
public int hashCode() {
return data.hashCode();
}
@ -163,7 +165,7 @@ public class Relation<K, V> implements Freezable<Relation<K,V>> { // TODO: add ,
private Set<V> newSet() {
try {
return (Set<V>) setCreator.newInstance(setComparatorParam);
return setCreator.newInstance(setComparatorParam);
} catch (Exception e) {
throw (RuntimeException) new IllegalArgumentException("Can't create new set").initCause(e);
}
@ -222,6 +224,7 @@ public class Relation<K, V> implements Freezable<Relation<K,V>> { // TODO: add ,
return result;
}
@Override
public String toString() {
return data.toString();
}
@ -241,14 +244,17 @@ public class Relation<K, V> implements Freezable<Relation<K,V>> { // TODO: add ,
this.value = e.getValue();
}
@Override
public K getKey() {
return key;
}
@Override
public V getValue() {
return value;
}
@Override
public V setValue(V value) {
V oldValue = this.value;
this.value = value;
@ -274,10 +280,12 @@ public class Relation<K, V> implements Freezable<Relation<K,V>> { // TODO: add ,
volatile boolean frozen = false;
@Override
public boolean isFrozen() {
return frozen;
}
@Override
public Relation<K, V> freeze() {
if (!frozen) {
// does not handle one level down, so we do that on a case-by-case basis
@ -291,6 +299,7 @@ public class Relation<K, V> implements Freezable<Relation<K,V>> { // TODO: add ,
return this;
}
@Override
public Relation<K, V> cloneAsThawed() {
// TODO do later
throw new UnsupportedOperationException();

View File

@ -70,6 +70,7 @@ public class ReplaceableUCharacterIterator extends UCharacterIterator {
* <code>Replaceable</code>object
* @return copy of this iterator
*/
@Override
public Object clone(){
try {
return super.clone();
@ -82,6 +83,7 @@ public class ReplaceableUCharacterIterator extends UCharacterIterator {
* Returns the current UTF16 character.
* @return current UTF16 character
*/
@Override
public int current(){
if (currentIndex < replaceable.length()) {
return replaceable.charAt(currentIndex);
@ -93,6 +95,7 @@ public class ReplaceableUCharacterIterator extends UCharacterIterator {
* Returns the current codepoint
* @return current codepoint
*/
@Override
public int currentCodePoint(){
// cannot use charAt due to it different
// behaviour when index is pointing at a
@ -120,6 +123,7 @@ public class ReplaceableUCharacterIterator extends UCharacterIterator {
* Returns the length of the text
* @return length of the text
*/
@Override
public int getLength(){
return replaceable.length();
}
@ -128,6 +132,7 @@ public class ReplaceableUCharacterIterator extends UCharacterIterator {
* Gets the current currentIndex in text.
* @return current currentIndex in text.
*/
@Override
public int getIndex(){
return currentIndex;
}
@ -140,6 +145,7 @@ public class ReplaceableUCharacterIterator extends UCharacterIterator {
* @return next UTF16 character in text or DONE if the new currentIndex is off the
* end of the text range.
*/
@Override
public int next(){
if (currentIndex < replaceable.length()) {
return replaceable.charAt(currentIndex++);
@ -156,6 +162,7 @@ public class ReplaceableUCharacterIterator extends UCharacterIterator {
* @return next UTF16 character in text or DONE if the new currentIndex is off the
* start of the text range.
*/
@Override
public int previous(){
if (currentIndex > 0) {
return replaceable.charAt(--currentIndex);
@ -173,6 +180,7 @@ public class ReplaceableUCharacterIterator extends UCharacterIterator {
* @returns the character at the specified currentIndex or DONE if the specified
* currentIndex is equal to the end of the text.
*/
@Override
public void setIndex(int currentIndex) throws IndexOutOfBoundsException{
if (currentIndex < 0 || currentIndex > replaceable.length()) {
throw new IndexOutOfBoundsException();
@ -180,6 +188,7 @@ public class ReplaceableUCharacterIterator extends UCharacterIterator {
this.currentIndex = currentIndex;
}
@Override
public int getText(char[] fillIn, int offset){
int length = replaceable.length();
if(offset < 0 || offset + length > fillIn.length){

View File

@ -49,6 +49,7 @@ public final class ResourceBundleWrapper extends UResourceBundle {
this.bundle=bundle;
}
@Override
protected Object handleGetObject(String aKey){
ResourceBundleWrapper current = this;
Object obj = null;
@ -70,6 +71,7 @@ public final class ResourceBundleWrapper extends UResourceBundle {
return obj;
}
@Override
public Enumeration<String> getKeys(){
return Collections.enumeration(keys);
}
@ -88,18 +90,22 @@ public final class ResourceBundleWrapper extends UResourceBundle {
current = (ResourceBundleWrapper)current.getParent();
}
}
@Override
protected String getLocaleID(){
return localeID;
}
@Override
protected String getBaseName(){
return bundle.getClass().getName().replace('.','/');
}
@Override
public ULocale getULocale(){
return new ULocale(localeID);
}
@Override
public UResourceBundle getParent(){
return (UResourceBundle)parent;
}
@ -182,6 +188,7 @@ public final class ResourceBundleWrapper extends UResourceBundle {
final String resName = name.replace('.', '/') + ".properties";
InputStream stream = java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<InputStream>() {
@Override
public InputStream run() {
return root.getResourceAsStream(resName);
}

View File

@ -95,6 +95,7 @@ public class Row<C0, C1, C2, C3, C4> implements java.lang.Comparable, Cloneable,
return this;
}
@Override
public int hashCode() {
int sum = items.length;
for (Object item : items) {
@ -103,6 +104,7 @@ public class Row<C0, C1, C2, C3, C4> implements java.lang.Comparable, Cloneable,
return sum;
}
@Override
public boolean equals(Object other) {
if (other == null) {
return false;
@ -127,6 +129,7 @@ public class Row<C0, C1, C2, C3, C4> implements java.lang.Comparable, Cloneable,
}
}
@Override
public int compareTo(Object other) {
int result;
Row<C0, C1, C2, C3, C4> that = (Row<C0, C1, C2, C3, C4>)other;
@ -144,6 +147,7 @@ public class Row<C0, C1, C2, C3, C4> implements java.lang.Comparable, Cloneable,
return 0;
}
@Override
public String toString() {
StringBuilder result = new StringBuilder("[");
boolean first = true;
@ -158,15 +162,18 @@ public class Row<C0, C1, C2, C3, C4> implements java.lang.Comparable, Cloneable,
return result.append("]").toString();
}
@Override
public boolean isFrozen() {
return frozen;
}
@Override
public Row<C0, C1, C2, C3, C4> freeze() {
frozen = true;
return this;
}
@Override
public Object clone() {
if (frozen) return this;
try {
@ -178,6 +185,7 @@ public class Row<C0, C1, C2, C3, C4> implements java.lang.Comparable, Cloneable,
}
}
@Override
public Row<C0, C1, C2, C3, C4> cloneAsThawed() {
try {
Row<C0, C1, C2, C3, C4> result = (Row<C0, C1, C2, C3, C4>) super.clone();

View File

@ -308,6 +308,7 @@ public class RuleCharacterIterator {
* Position within an expanded variable is <em>not</em> indicated.
* @return a string representation of this object
*/
@Override
public String toString() {
int b = pos.getIndex();
return text.substring(0, b) + '|' + text.substring(b);

View File

@ -39,6 +39,7 @@ public class SimpleCache<K, V> implements ICUCache<K, V> {
}
}
@Override
public V get(Object key) {
Reference<Map<K, V>> ref = cacheRef;
if (ref != null) {
@ -50,6 +51,7 @@ public class SimpleCache<K, V> implements ICUCache<K, V> {
return null;
}
@Override
public void put(K key, V value) {
Reference<Map<K, V>> ref = cacheRef;
Map<K, V> map = null;
@ -68,6 +70,7 @@ public class SimpleCache<K, V> implements ICUCache<K, V> {
map.put(key, value);
}
@Override
public void clear() {
cacheRef = null;
}

View File

@ -47,6 +47,7 @@ public final class StringPrepDataReader implements ICUBinary.Authenticate {
return ICUBinary.getChars(byteBuffer, length, 0);
}
@Override
public boolean isDataVersionAcceptable(byte version[]){
return version[0] == DATA_FORMAT_VERSION[0]
&& version[2] == DATA_FORMAT_VERSION[2]

View File

@ -33,6 +33,7 @@ public class StringRange {
}
public static final Comparator<int[]> COMPARE_INT_ARRAYS = new Comparator<int[]>() {
@Override
public int compare(int[] o1, int[] o2) {
int minIndex = Math.min(o1.length, o2.length);
for (int i = 0; i < minIndex; ++i) {
@ -140,6 +141,7 @@ public class StringRange {
public boolean equals(Object obj) {
return this == obj || (obj != null && obj instanceof Range && compareTo((Range)obj) == 0);
}
@Override
public int compareTo(Range that) {
int diff = min - that.min;
if (diff != 0) {
@ -215,6 +217,7 @@ public class StringRange {
public Integer size() {
return ranges.length;
}
@Override
public int compareTo(Ranges other) {
int diff = ranges.length - other.ranges.length;
if (diff != 0) {

View File

@ -242,6 +242,7 @@ public class TZDBTimeZoneNames extends TimeZoneNames {
* @see com.ibm.icu.impl.TextTrieMap.ResultHandler#handlePrefixMatch(int,
* java.util.Iterator)
*/
@Override
public boolean handlePrefixMatch(int matchLength, Iterator<TZDBNameInfo> values) {
TZDBNameInfo match = null;
TZDBNameInfo defaultRegionMatch = null;

View File

@ -122,6 +122,7 @@ public class TextTrieMap<V> {
/* (non-Javadoc)
* @see java.util.Iterator#hasNext()
*/
@Override
public boolean hasNext() {
if (_nextIdx == _text.length() && _remainingChar == null) {
return false;
@ -132,6 +133,7 @@ public class TextTrieMap<V> {
/* (non-Javadoc)
* @see java.util.Iterator#next()
*/
@Override
public Character next() {
if (_nextIdx == _text.length() && _remainingChar == null) {
return null;
@ -161,6 +163,7 @@ public class TextTrieMap<V> {
/* (non-Javadoc)
* @see java.util.Iterator#remove()
*/
@Override
public void remove() {
throw new UnsupportedOperationException("remove() not supproted");
}
@ -196,6 +199,7 @@ public class TextTrieMap<V> {
private Iterator<V> matches = null;
private int length = 0;
@Override
public boolean handlePrefixMatch(int matchLength, Iterator<V> values) {
if (matchLength > length) {
length = matchLength;

View File

@ -66,6 +66,7 @@ public class TimeZoneAdapter extends java.util.TimeZone {
/**
* TimeZone API; calls through to wrapped time zone.
*/
@Override
public void setID(String ID) {
super.setID(ID);
zone.setID(ID);
@ -74,6 +75,7 @@ public class TimeZoneAdapter extends java.util.TimeZone {
/**
* TimeZone API; calls through to wrapped time zone.
*/
@Override
public boolean hasSameRules(java.util.TimeZone other) {
return other instanceof TimeZoneAdapter &&
zone.hasSameRules(((TimeZoneAdapter)other).zone);
@ -82,6 +84,7 @@ public class TimeZoneAdapter extends java.util.TimeZone {
/**
* TimeZone API; calls through to wrapped time zone.
*/
@Override
public int getOffset(int era, int year, int month, int day, int dayOfWeek,
int millis) {
return zone.getOffset(era, year, month, day, dayOfWeek, millis);
@ -90,6 +93,7 @@ public class TimeZoneAdapter extends java.util.TimeZone {
/**
* TimeZone API; calls through to wrapped time zone.
*/
@Override
public int getRawOffset() {
return zone.getRawOffset();
}
@ -97,6 +101,7 @@ public class TimeZoneAdapter extends java.util.TimeZone {
/**
* TimeZone API; calls through to wrapped time zone.
*/
@Override
public void setRawOffset(int offsetMillis) {
zone.setRawOffset(offsetMillis);
}
@ -104,6 +109,7 @@ public class TimeZoneAdapter extends java.util.TimeZone {
/**
* TimeZone API; calls through to wrapped time zone.
*/
@Override
public boolean useDaylightTime() {
return zone.useDaylightTime();
}
@ -111,6 +117,7 @@ public class TimeZoneAdapter extends java.util.TimeZone {
/**
* TimeZone API; calls through to wrapped time zone.
*/
@Override
public boolean inDaylightTime(Date date) {
return zone.inDaylightTime(date);
}
@ -118,6 +125,7 @@ public class TimeZoneAdapter extends java.util.TimeZone {
/**
* Boilerplate API; calls through to wrapped object.
*/
@Override
public Object clone() {
return new TimeZoneAdapter((TimeZone)zone.clone());
}
@ -125,6 +133,7 @@ public class TimeZoneAdapter extends java.util.TimeZone {
/**
* Boilerplate API; calls through to wrapped object.
*/
@Override
public synchronized int hashCode() {
return zone.hashCode();
}
@ -132,6 +141,7 @@ public class TimeZoneAdapter extends java.util.TimeZone {
/**
* Boilerplate API; calls through to wrapped object.
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof TimeZoneAdapter) {
obj = ((TimeZoneAdapter) obj).zone;
@ -143,6 +153,7 @@ public class TimeZoneAdapter extends java.util.TimeZone {
* Returns a string representation of this object.
* @return a string representation of this object.
*/
@Override
public String toString() {
return "TimeZoneAdapter: " + zone.toString();
}

View File

@ -647,6 +647,7 @@ public class TimeZoneGenericNames implements Serializable, Freezable<TimeZoneGen
/* (non-Javadoc)
* @see com.ibm.icu.impl.TextTrieMap.ResultHandler#handlePrefixMatch(int, java.util.Iterator)
*/
@Override
public boolean handlePrefixMatch(int matchLength, Iterator<NameInfo> values) {
while (values.hasNext()) {
NameInfo info = values.next();
@ -915,6 +916,7 @@ public class TimeZoneGenericNames implements Serializable, Freezable<TimeZoneGen
/**
* {@inheritDoc}
*/
@Override
public boolean isFrozen() {
return _frozen;
}
@ -922,6 +924,7 @@ public class TimeZoneGenericNames implements Serializable, Freezable<TimeZoneGen
/**
* {@inheritDoc}
*/
@Override
public TimeZoneGenericNames freeze() {
_frozen = true;
return this;
@ -930,6 +933,7 @@ public class TimeZoneGenericNames implements Serializable, Freezable<TimeZoneGen
/**
* {@inheritDoc}
*/
@Override
public TimeZoneGenericNames cloneAsThawed() {
TimeZoneGenericNames copy = null;
try {

View File

@ -70,6 +70,7 @@ public abstract class Trie
// default implementation
private static class DefaultGetFoldingOffset implements DataManipulate {
@Override
public int getFoldingOffset(int value) {
return value;
}
@ -94,6 +95,7 @@ public abstract class Trie
* otherwise
*/
///CLOVER:OFF
@Override
public boolean equals(Object other)
{
if (other == this) {
@ -109,6 +111,7 @@ public abstract class Trie
&& Arrays.equals(m_index_, othertrie.m_index_);
}
@Override
public int hashCode() {
assert false : "hashCode not designed";
return 42;

View File

@ -283,6 +283,7 @@ public abstract class Trie2 implements Iterable<Trie2.Range> {
* (read-only) Trie2_16 or Trie2_32 so long as they are storing the same values.
*
*/
@Override
public final boolean equals(Object other) {
if(!(other instanceof Trie2)) {
return false;
@ -313,6 +314,7 @@ public abstract class Trie2 implements Iterable<Trie2.Range> {
}
@Override
public int hashCode() {
if (fHash == 0) {
int hash = initHash();
@ -341,6 +343,7 @@ public abstract class Trie2 implements Iterable<Trie2.Range> {
public int value;
public boolean leadSurrogate;
@Override
public boolean equals(Object other) {
if (other == null || !(other.getClass().equals(getClass()))) {
return false;
@ -353,6 +356,7 @@ public abstract class Trie2 implements Iterable<Trie2.Range> {
}
@Override
public int hashCode() {
int h = initHash();
h = hashUChar32(h, startCodePoint);
@ -371,11 +375,13 @@ public abstract class Trie2 implements Iterable<Trie2.Range> {
*
* @return an Iterator
*/
@Override
public Iterator<Range> iterator() {
return iterator(defaultValueMapper);
}
private static ValueMapper defaultValueMapper = new ValueMapper() {
@Override
public int map(int in) {
return in;
}
@ -548,6 +554,7 @@ public abstract class Trie2 implements Iterable<Trie2.Range> {
}
@Override
public final boolean hasNext() {
return index<textLength;
}
@ -558,6 +565,7 @@ public abstract class Trie2 implements Iterable<Trie2.Range> {
}
@Override
public Trie2.CharSequenceValues next() {
int c = Character.codePointAt(text, index);
int val = get(c);
@ -591,6 +599,7 @@ public abstract class Trie2 implements Iterable<Trie2.Range> {
* @throws UnsupportedOperationException Always thrown because this operation is not supported
* @see java.util.Iterator#remove()
*/
@Override
public void remove() {
throw new UnsupportedOperationException("Trie2.CharSequenceIterator does not support remove().");
}
@ -868,6 +877,7 @@ public abstract class Trie2 implements Iterable<Trie2.Range> {
* The main next() function for Trie2 iterators
*
*/
@Override
public Range next() {
if (!hasNext()) {
throw new NoSuchElementException();
@ -928,10 +938,12 @@ public abstract class Trie2 implements Iterable<Trie2.Range> {
/**
*
*/
@Override
public boolean hasNext() {
return doingCodePoints && (doLeadSurrogates || nextStart < limitCP) || nextStart < 0xdc00;
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}

View File

@ -120,6 +120,7 @@ public class TrieIterator implements RangeValueIterator
* @exception NoSuchElementException - if no more elements exist.
* @see com.ibm.icu.util.RangeValueIterator.Element
*/
@Override
public final boolean next(Element element)
{
if (m_nextCodepoint_ > UCharacter.MAX_VALUE) {
@ -136,6 +137,7 @@ public class TrieIterator implements RangeValueIterator
/**
* Resets the iterator to the beginning of the iteration
*/
@Override
public final void reset()
{
m_currentCodepoint_ = 0;

View File

@ -85,6 +85,7 @@ public final class UBiDiProps {
// implement ICUBinary.Authenticate
private final static class IsAcceptable implements ICUBinary.Authenticate {
@Override
public boolean isDataVersionAcceptable(byte version[]) {
return version[0]==2;
}
@ -226,12 +227,12 @@ public final class UBiDiProps {
start=indexes[IX_JG_START];
limit=indexes[IX_JG_LIMIT];
if(start<=c && c<limit) {
return (int)jgArray[c-start]&0xff;
return jgArray[c-start]&0xff;
}
start=indexes[IX_JG_START2];
limit=indexes[IX_JG_LIMIT2];
if(start<=c && c<limit) {
return (int)jgArray2[c-start]&0xff;
return jgArray2[c-start]&0xff;
}
return UCharacter.JoiningGroup.NO_JOINING_GROUP;
}

View File

@ -36,26 +36,32 @@ public final class UCharArrayIterator extends UCharacterIterator {
this.pos = start;
}
@Override
public int current() {
return pos < limit ? text[pos] : DONE;
}
@Override
public int getLength() {
return limit - start;
}
@Override
public int getIndex() {
return pos - start;
}
@Override
public int next() {
return pos < limit ? text[pos++] : DONE;
}
@Override
public int previous() {
return pos > start ? text[--pos] : DONE;
}
@Override
public void setIndex(int index) {
if (index < 0 || index > limit - start) {
throw new IndexOutOfBoundsException("index: " + index +
@ -65,6 +71,7 @@ public final class UCharArrayIterator extends UCharacterIterator {
pos = start + index;
}
@Override
public int getText(char[] fillIn, int offset) {
int len = limit - start;
System.arraycopy(text, start, fillIn, offset, len);
@ -76,6 +83,7 @@ public final class UCharArrayIterator extends UCharacterIterator {
* <code>Replaceable</code>object
* @return copy of this iterator
*/
@Override
public Object clone(){
try {
return super.clone();

View File

@ -33,6 +33,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* @return the first character in the text, or DONE if the text is empty
* @see #getBeginIndex()
*/
@Override
public char first(){
//UCharacterIterator always iterates from 0 to length
iterator.setToStart();
@ -45,6 +46,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* @return the last character in the text, or DONE if the text is empty
* @see #getEndIndex()
*/
@Override
public char last(){
iterator.setToLimit();
return (char)iterator.previous();
@ -56,6 +58,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* position is off the end of the text.
* @see #getIndex()
*/
@Override
public char current(){
return (char) iterator.current();
}
@ -68,6 +71,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* @return the character at the new position or DONE if the new
* position is off the end of the text range.
*/
@Override
public char next(){
//pre-increment
iterator.next();
@ -81,6 +85,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* @return the character at the new position or DONE if the current
* position is equal to getBeginIndex().
*/
@Override
public char previous(){
//pre-decrement
return (char) iterator.previous();
@ -94,6 +99,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* if an invalid value is supplied.
* @return the character at the specified position or DONE if the specified position is equal to getEndIndex()
*/
@Override
public char setIndex(int position){
iterator.setIndex(position);
return (char) iterator.current();
@ -103,6 +109,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* Returns the start index of the text.
* @return the index at which the text begins.
*/
@Override
public int getBeginIndex(){
//UCharacterIterator always starts from 0
return 0;
@ -113,6 +120,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* character following the end of the text.
* @return the index after the last character in the text
*/
@Override
public int getEndIndex(){
return iterator.getLength();
}
@ -121,6 +129,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* Returns the current index.
* @return the current index.
*/
@Override
public int getIndex(){
return iterator.getIndex();
}
@ -129,6 +138,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* Create a copy of this iterator
* @return A copy of this
*/
@Override
public Object clone(){
try {
UCharacterIteratorWrapper result = (UCharacterIteratorWrapper) super.clone();

View File

@ -30,6 +30,7 @@ final class UCharacterNameReader implements ICUBinary.Authenticate
{
// public methods ----------------------------------------------------
@Override
public boolean isDataVersionAcceptable(byte version[])
{
return version[0] == 1;

View File

@ -212,6 +212,7 @@ public final class UCharacterProperty
super(SRC_CASE);
this.which=which;
}
@Override
boolean contains(int c) {
return UCaseProps.INSTANCE.hasBinaryProperty(c, which);
}
@ -223,6 +224,7 @@ public final class UCharacterProperty
super(source);
this.which=which;
}
@Override
boolean contains(int c) {
return Norm2AllModes.getN2WithImpl(which-UProperty.NFD_INERT).isInert(c);
}
@ -236,11 +238,13 @@ public final class UCharacterProperty
new BinaryProperty(1, (1<<ALPHABETIC_PROPERTY_)),
new BinaryProperty(1, (1<<ASCII_HEX_DIGIT_PROPERTY_)),
new BinaryProperty(SRC_BIDI) { // UCHAR_BIDI_CONTROL
@Override
boolean contains(int c) {
return UBiDiProps.INSTANCE.isBidiControl(c);
}
},
new BinaryProperty(SRC_BIDI) { // UCHAR_BIDI_MIRRORED
@Override
boolean contains(int c) {
return UBiDiProps.INSTANCE.isMirrored(c);
}
@ -251,6 +255,7 @@ public final class UCharacterProperty
new BinaryProperty(1, (1<<DIACRITIC_PROPERTY_)),
new BinaryProperty(1, (1<<EXTENDER_PROPERTY_)),
new BinaryProperty(SRC_NFC) { // UCHAR_FULL_COMPOSITION_EXCLUSION
@Override
boolean contains(int c) {
// By definition, Full_Composition_Exclusion is the same as NFC_QC=No.
Normalizer2Impl impl=Norm2AllModes.getNFCInstance().impl;
@ -268,6 +273,7 @@ public final class UCharacterProperty
new BinaryProperty(1, (1<<IDS_BINARY_OPERATOR_PROPERTY_)),
new BinaryProperty(1, (1<<IDS_TRINARY_OPERATOR_PROPERTY_)),
new BinaryProperty(SRC_BIDI) { // UCHAR_JOIN_CONTROL
@Override
boolean contains(int c) {
return UBiDiProps.INSTANCE.isJoinControl(c);
}
@ -293,6 +299,7 @@ public final class UCharacterProperty
new NormInertBinaryProperty(SRC_NFC, UProperty.NFC_INERT),
new NormInertBinaryProperty(SRC_NFKC, UProperty.NFKC_INERT),
new BinaryProperty(SRC_NFC_CANON_ITER) { // UCHAR_SEGMENT_STARTER
@Override
boolean contains(int c) {
return Norm2AllModes.getNFCInstance().impl.
ensureCanonIterData().isCanonSegmentStarter(c);
@ -301,11 +308,13 @@ public final class UCharacterProperty
new BinaryProperty(1, (1<<PATTERN_SYNTAX)),
new BinaryProperty(1, (1<<PATTERN_WHITE_SPACE)),
new BinaryProperty(SRC_CHAR_AND_PROPSVEC) { // UCHAR_POSIX_ALNUM
@Override
boolean contains(int c) {
return UCharacter.isUAlphabetic(c) || UCharacter.isDigit(c);
}
},
new BinaryProperty(SRC_CHAR) { // UCHAR_POSIX_BLANK
@Override
boolean contains(int c) {
// "horizontal space"
if(c<=0x9f) {
@ -317,11 +326,13 @@ public final class UCharacterProperty
}
},
new BinaryProperty(SRC_CHAR) { // UCHAR_POSIX_GRAPH
@Override
boolean contains(int c) {
return isgraphPOSIX(c);
}
},
new BinaryProperty(SRC_CHAR) { // UCHAR_POSIX_PRINT
@Override
boolean contains(int c) {
/*
* Checks if codepoint is in \p{graph}\p{blank} - \p{cntrl}.
@ -333,6 +344,7 @@ public final class UCharacterProperty
}
},
new BinaryProperty(SRC_CHAR) { // UCHAR_POSIX_XDIGIT
@Override
boolean contains(int c) {
/* check ASCII and Fullwidth ASCII a-fA-F */
if(
@ -350,6 +362,7 @@ public final class UCharacterProperty
new CaseBinaryProperty(UProperty.CHANGES_WHEN_UPPERCASED),
new CaseBinaryProperty(UProperty.CHANGES_WHEN_TITLECASED),
new BinaryProperty(SRC_CASE_AND_NORM) { // UCHAR_CHANGES_WHEN_CASEFOLDED
@Override
boolean contains(int c) {
String nfd=Norm2AllModes.getNFCInstance().impl.getDecomposition(c);
if(nfd!=null) {
@ -376,6 +389,7 @@ public final class UCharacterProperty
},
new CaseBinaryProperty(UProperty.CHANGES_WHEN_CASEMAPPED),
new BinaryProperty(SRC_NFKC_CF) { // UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED
@Override
boolean contains(int c) {
Normalizer2Impl kcf=Norm2AllModes.getNFKC_CFInstance().impl;
String src=UTF16.valueOf(c);
@ -457,6 +471,7 @@ public final class UCharacterProperty
BiDiIntProperty() {
super(SRC_BIDI);
}
@Override
int getMaxValue(int which) {
return UBiDiProps.INSTANCE.getMaxValue(which);
}
@ -466,6 +481,7 @@ public final class UCharacterProperty
CombiningClassIntProperty(int source) {
super(source);
}
@Override
int getMaxValue(int which) {
return 0xff;
}
@ -479,9 +495,11 @@ public final class UCharacterProperty
this.which=which;
this.max=max;
}
@Override
int getValue(int c) {
return Norm2AllModes.getN2WithImpl(which-UProperty.NFD_QUICK_CHECK).getQuickCheck(c);
}
@Override
int getMaxValue(int which) {
return max;
}
@ -489,12 +507,14 @@ public final class UCharacterProperty
IntProperty intProps[]={
new BiDiIntProperty() { // BIDI_CLASS
@Override
int getValue(int c) {
return UBiDiProps.INSTANCE.getClass(c);
}
},
new IntProperty(0, BLOCK_MASK_, BLOCK_SHIFT_),
new CombiningClassIntProperty(SRC_NFC) { // CANONICAL_COMBINING_CLASS
@Override
int getValue(int c) {
return Normalizer2.getNFDInstance().getCombiningClass(c);
}
@ -502,38 +522,46 @@ public final class UCharacterProperty
new IntProperty(2, DECOMPOSITION_TYPE_MASK_, 0),
new IntProperty(0, EAST_ASIAN_MASK_, EAST_ASIAN_SHIFT_),
new IntProperty(SRC_CHAR) { // GENERAL_CATEGORY
@Override
int getValue(int c) {
return getType(c);
}
@Override
int getMaxValue(int which) {
return UCharacterCategory.CHAR_CATEGORY_COUNT-1;
}
},
new BiDiIntProperty() { // JOINING_GROUP
@Override
int getValue(int c) {
return UBiDiProps.INSTANCE.getJoiningGroup(c);
}
},
new BiDiIntProperty() { // JOINING_TYPE
@Override
int getValue(int c) {
return UBiDiProps.INSTANCE.getJoiningType(c);
}
},
new IntProperty(2, LB_MASK, LB_SHIFT), // LINE_BREAK
new IntProperty(SRC_CHAR) { // NUMERIC_TYPE
@Override
int getValue(int c) {
return ntvGetType(getNumericTypeValue(getProperty(c)));
}
@Override
int getMaxValue(int which) {
return NumericType.COUNT-1;
}
},
new IntProperty(0, SCRIPT_MASK_, 0) {
@Override
int getValue(int c) {
return UScript.getScript(c);
}
},
new IntProperty(SRC_PROPSVEC) { // HANGUL_SYLLABLE_TYPE
@Override
int getValue(int c) {
/* see comments on gcbToHst[] above */
int gcb=(getAdditional(c, 2)&GCB_MASK)>>>GCB_SHIFT;
@ -543,6 +571,7 @@ public final class UCharacterProperty
return HangulSyllableType.NOT_APPLICABLE;
}
}
@Override
int getMaxValue(int which) {
return HangulSyllableType.COUNT-1;
}
@ -554,11 +583,13 @@ public final class UCharacterProperty
new NormQuickCheckIntProperty(SRC_NFC, UProperty.NFC_QUICK_CHECK, 2),
new NormQuickCheckIntProperty(SRC_NFKC, UProperty.NFKC_QUICK_CHECK, 2),
new CombiningClassIntProperty(SRC_NFC) { // LEAD_CANONICAL_COMBINING_CLASS
@Override
int getValue(int c) {
return Norm2AllModes.getNFCInstance().impl.getFCD16(c)>>8;
}
},
new CombiningClassIntProperty(SRC_NFC) { // TRAIL_CANONICAL_COMBINING_CLASS
@Override
int getValue(int c) {
return Norm2AllModes.getNFCInstance().impl.getFCD16(c)&0xff;
}
@ -567,6 +598,7 @@ public final class UCharacterProperty
new IntProperty(2, SB_MASK, SB_SHIFT), // SENTENCE_BREAK
new IntProperty(2, WB_MASK, WB_SHIFT), // WORD_BREAK
new BiDiIntProperty() { // BIDI_PAIRED_BRACKET_TYPE
@Override
int getValue(int c) {
return UBiDiProps.INSTANCE.getPairedBracketType(c);
}
@ -1240,6 +1272,7 @@ public final class UCharacterProperty
private static final class IsAcceptable implements ICUBinary.Authenticate {
// @Override when we switch to Java 6
@Override
public boolean isDataVersionAcceptable(byte version[]) {
return version[0] == 7;
}

View File

@ -69,6 +69,7 @@ public final class UPropertyAliases {
private static final class IsAcceptable implements ICUBinary.Authenticate {
// @Override when we switch to Java 6
@Override
public boolean isDataVersionAcceptable(byte version[]) {
return version[0]==2;
}

View File

@ -162,6 +162,7 @@ public abstract class URLHandler {
}
}
@Override
public void guide(URLVisitor v, boolean recurse, boolean strip) {
if (file.isDirectory()) {
process(v, recurse, strip, "/", file.listFiles());
@ -221,6 +222,7 @@ public abstract class URLHandler {
}
}
@Override
public void guide(URLVisitor v, boolean recurse, boolean strip) {
try {
Enumeration<JarEntry> entries = jarFile.entries();

View File

@ -82,6 +82,7 @@ public class UnicodeRegex implements Cloneable, Freezable<UnicodeRegex>, StringT
* @return A processed Java regex pattern, suitable for input to
* Pattern.compile().
*/
@Override
public String transform(String regex) {
StringBuilder result = new StringBuilder();
UnicodeSet temp = new UnicodeSet();
@ -306,6 +307,7 @@ public class UnicodeRegex implements Cloneable, Freezable<UnicodeRegex>, StringT
/* (non-Javadoc)
* @see com.ibm.icu.util.Freezable#cloneAsThawed()
*/
@Override
public UnicodeRegex cloneAsThawed() {
// TODO Auto-generated method stub
try {
@ -318,6 +320,7 @@ public class UnicodeRegex implements Cloneable, Freezable<UnicodeRegex>, StringT
/* (non-Javadoc)
* @see com.ibm.icu.util.Freezable#freeze()
*/
@Override
public UnicodeRegex freeze() {
// no action needed now.
return this;
@ -326,6 +329,7 @@ public class UnicodeRegex implements Cloneable, Freezable<UnicodeRegex>, StringT
/* (non-Javadoc)
* @see com.ibm.icu.util.Freezable#isFrozen()
*/
@Override
public boolean isFrozen() {
// at this point, always true
return true;
@ -353,6 +357,7 @@ public class UnicodeRegex implements Cloneable, Freezable<UnicodeRegex>, StringT
// private Appendable log = null;
private Comparator<Object> LongestFirst = new Comparator<Object>() {
@Override
public int compare(Object obj0, Object obj1) {
String arg0 = obj0.toString();
String arg1 = obj1.toString();

View File

@ -14,17 +14,19 @@ import java.util.ListResourceBundle;
public class HolidayBundle extends ListResourceBundle {
// Normally, each HolidayBundle uses the holiday's US English name
// as the string key for looking up the localized name. This means
// as the string key for looking up the localized name. This means
// that the key itself can be used if no name is found for the requested
// locale.
//
// For holidays where the key is _not_ the English name, e.g. in the
// case of conflicts, the English name must be given here.
//
static private final Object[][] fContents = {
{ "", "" }, // Can't be empty!
static private final Object[][] fContents = { { "", "" }, // Can't be empty!
};
public synchronized Object[][] getContents() { return fContents; }
@Override
public synchronized Object[][] getContents() {
return fContents;
}
}

View File

@ -28,5 +28,6 @@ public class HolidayBundle_da extends ListResourceBundle
{ "Pentecost", "pinse" },
{ "Shrove Tuesday", "hvidetirsdag" },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -16,28 +16,20 @@ import com.ibm.icu.util.EasterHoliday;
import com.ibm.icu.util.Holiday;
import com.ibm.icu.util.SimpleHoliday;
public class HolidayBundle_da_DK extends ListResourceBundle
{
static private final Holiday[] fHolidays = {
SimpleHoliday.NEW_YEARS_DAY,
new SimpleHoliday(Calendar.APRIL, 30, -Calendar.FRIDAY, "General Prayer Day"),
new SimpleHoliday(Calendar.JUNE, 5, "Constitution Day"),
SimpleHoliday.CHRISTMAS_EVE,
SimpleHoliday.CHRISTMAS,
SimpleHoliday.BOXING_DAY,
SimpleHoliday.NEW_YEARS_EVE,
public class HolidayBundle_da_DK extends ListResourceBundle {
static private final Holiday[] fHolidays = { SimpleHoliday.NEW_YEARS_DAY,
new SimpleHoliday(Calendar.APRIL, 30, -Calendar.FRIDAY, "General Prayer Day"),
new SimpleHoliday(Calendar.JUNE, 5, "Constitution Day"), SimpleHoliday.CHRISTMAS_EVE,
SimpleHoliday.CHRISTMAS, SimpleHoliday.BOXING_DAY, SimpleHoliday.NEW_YEARS_EVE,
// Easter and related holidays
EasterHoliday.MAUNDY_THURSDAY,
EasterHoliday.GOOD_FRIDAY,
EasterHoliday.EASTER_SUNDAY,
EasterHoliday.EASTER_MONDAY,
EasterHoliday.ASCENSION,
EasterHoliday.WHIT_MONDAY,
};
// Easter and related holidays
EasterHoliday.MAUNDY_THURSDAY, EasterHoliday.GOOD_FRIDAY, EasterHoliday.EASTER_SUNDAY,
EasterHoliday.EASTER_MONDAY, EasterHoliday.ASCENSION, EasterHoliday.WHIT_MONDAY, };
static private final Object[][] fContents = {
{ "holidays", fHolidays },
};
public synchronized Object[][] getContents() { return fContents; }
static private final Object[][] fContents = { { "holidays", fHolidays }, };
@Override
public synchronized Object[][] getContents() {
return fContents;
}
}

View File

@ -65,5 +65,6 @@ public class HolidayBundle_de extends ListResourceBundle {
{ "Whit Sunday", "Pfingstsonntag" },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -44,5 +44,6 @@ public class HolidayBundle_de_AT extends ListResourceBundle {
{ "Christmas", "Christtag" },
{ "New Year's Day", "Neujahrstag" },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -39,5 +39,6 @@ public class HolidayBundle_de_DE extends ListResourceBundle {
static private final Object[][] fContents = {
{ "holidays", fHolidays },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -27,5 +27,6 @@ public class HolidayBundle_el extends ListResourceBundle {
{ "Whit Monday", "\u0394\u03b5\u03cd\u03c4\u03b5\u03c1\u03b7 \u03bc\u03ad\u03c1\u03b1 \u03c4\u03bf\u03cd \u03a0\u03b5\u03bd\u03c4\u03b7\u03ba\u03bf\u03c3\u03c4\u03ae" },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -40,5 +40,6 @@ public class HolidayBundle_el_GR extends ListResourceBundle {
static private final Object[][] fContents = {
{ "holidays", fHolidays },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -25,6 +25,7 @@ public class HolidayBundle_en extends ListResourceBundle {
{ "", "" }, // Can't be empty!
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -40,5 +40,6 @@ public class HolidayBundle_en_CA extends ListResourceBundle {
{ "Labor Day", "Labour Day" },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -37,5 +37,6 @@ public class HolidayBundle_en_GB extends ListResourceBundle
{ "Labor Day", "Labour Day" },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -47,5 +47,6 @@ public class HolidayBundle_en_US extends ListResourceBundle
static private final Object[][] fContents = {
{ "holidays", fHolidays },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -48,5 +48,6 @@ public class HolidayBundle_es extends ListResourceBundle {
{ "Whit Sunday", "Pentecost\u00e9s" },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -34,5 +34,6 @@ public class HolidayBundle_es_MX extends ListResourceBundle {
static private final Object[][] fContents = {
{ "holidays", fHolidays },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -41,5 +41,6 @@ public class HolidayBundle_fr extends ListResourceBundle {
{ "Victory Day", "F\u00EAte de la Victoire" },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -38,5 +38,6 @@ public class HolidayBundle_fr_CA extends ListResourceBundle {
static private final Object[][] fContents = {
{ "holidays", fHolidays },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -37,5 +37,6 @@ public class HolidayBundle_fr_FR extends ListResourceBundle {
static private final Object[][] fContents = {
{ "holidays", fHolidays },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -33,5 +33,6 @@ public class HolidayBundle_it extends ListResourceBundle {
{ "Thanksgiving", "Giorno del Ringraziamento" },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -36,5 +36,6 @@ public class HolidayBundle_it_IT extends ListResourceBundle {
static private final Object[][] fContents = {
{ "holidays", fHolidays },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -17,6 +17,7 @@ public class HolidayBundle_iw extends ListResourceBundle {
{ "", "" }, // Can't be empty!
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -28,5 +28,6 @@ public class HolidayBundle_iw_IL extends ListResourceBundle {
static private final Object[][] fContents = {
{ "holidays", fHolidays },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -22,5 +22,6 @@ public class HolidayBundle_ja_JP extends ListResourceBundle {
static private final Object[][] fContents = {
{ "holidays", fHolidays },
};
@Override
public synchronized Object[][] getContents() { return fContents; }
}

View File

@ -257,6 +257,7 @@ public class ResourceReader implements Closeable {
* associated with it. If the stream is already closed then invoking
* this method has no effect.
*/
@Override
public void close() throws IOException {
if (reader != null) {
reader.close();

View File

@ -52,17 +52,20 @@ class BasicDurationFormatter implements DurationFormatter {
this.timeZone = timeZone;
}
@Override
public String formatDurationFromNowTo(Date targetDate) {
long now = System.currentTimeMillis();
long duration = targetDate.getTime() - now;
return formatDurationFrom(duration, now);
}
public String formatDurationFromNow(long duration) {
@Override
public String formatDurationFromNow(long duration) {
return formatDurationFrom(duration, System.currentTimeMillis());
}
public String formatDurationFrom(long duration, long referenceDate) {
@Override
public String formatDurationFrom(long duration, long referenceDate) {
String s = doFallback(duration, referenceDate);
if (s == null) {
Period p = doBuild(duration, referenceDate);
@ -71,7 +74,8 @@ class BasicDurationFormatter implements DurationFormatter {
return s;
}
public DurationFormatter withLocale(String locName) {
@Override
public DurationFormatter withLocale(String locName) {
if (!locName.equals(localeName)) {
PeriodFormatter newFormatter = formatter.withLocale(locName);
PeriodBuilder newBuilder = builder.withLocale(locName);
@ -85,7 +89,8 @@ class BasicDurationFormatter implements DurationFormatter {
return this;
}
public DurationFormatter withTimeZone(TimeZone tz) {
@Override
public DurationFormatter withTimeZone(TimeZone tz) {
if (!tz.equals(timeZone)) {
PeriodBuilder newBuilder = builder.withTimeZone(tz);
DateFormatter newFallback = fallback == null

View File

@ -47,6 +47,7 @@ class BasicDurationFormatterFactory implements DurationFormatterFactory {
*
* @return this BasicDurationFormatterFactory
*/
@Override
public DurationFormatterFactory setPeriodFormatter(
PeriodFormatter formatter) {
if (formatter != this.formatter) {
@ -63,6 +64,7 @@ class BasicDurationFormatterFactory implements DurationFormatterFactory {
* @param builder the builder to use
* @return this BasicDurationFormatterFactory
*/
@Override
public DurationFormatterFactory setPeriodBuilder(PeriodBuilder builder) {
if (builder != this.builder) {
this.builder = builder;
@ -77,6 +79,7 @@ class BasicDurationFormatterFactory implements DurationFormatterFactory {
* @param fallback the fallback formatter to use, or null
* @return this BasicDurationFormatterFactory
*/
@Override
public DurationFormatterFactory setFallback(DateFormatter fallback) {
boolean doReset = fallback == null
? this.fallback != null
@ -94,6 +97,7 @@ class BasicDurationFormatterFactory implements DurationFormatterFactory {
* @param fallbackLimit the fallback limit to use, or 0 if none is desired.
* @return this BasicDurationFormatterFactory
*/
@Override
public DurationFormatterFactory setFallbackLimit(long fallbackLimit) {
if (fallbackLimit < 0) {
fallbackLimit = 0;
@ -112,6 +116,7 @@ class BasicDurationFormatterFactory implements DurationFormatterFactory {
* @param localeName the name of the Locale
* @return this BasicDurationFormatterFactory
*/
@Override
public DurationFormatterFactory setLocale(String localeName) {
if (!localeName.equals(this.localeName)) {
this.localeName = localeName;
@ -133,6 +138,7 @@ class BasicDurationFormatterFactory implements DurationFormatterFactory {
* @param timeZone The time zone to use.
* @return this BasicDurationFormatterFactory
*/
@Override
public DurationFormatterFactory setTimeZone(TimeZone timeZone) {
if (!timeZone.equals(this.timeZone)) {
this.timeZone = timeZone;
@ -149,6 +155,7 @@ class BasicDurationFormatterFactory implements DurationFormatterFactory {
*
* @return a BasicDurationFormatter
*/
@Override
public DurationFormatter getFormatter() {
if (f == null) {
if (fallback != null) {

View File

@ -193,6 +193,7 @@ class BasicPeriodBuilderFactory implements PeriodBuilderFactory {
}
}
@Override
public PeriodBuilderFactory setAvailableUnitRange(TimeUnit minUnit,
TimeUnit maxUnit) {
int uset = 0;
@ -206,6 +207,7 @@ class BasicPeriodBuilderFactory implements PeriodBuilderFactory {
return this;
}
@Override
public PeriodBuilderFactory setUnitIsAvailable(TimeUnit unit,
boolean available) {
int uset = settings.uset;
@ -218,36 +220,43 @@ class BasicPeriodBuilderFactory implements PeriodBuilderFactory {
return this;
}
@Override
public PeriodBuilderFactory setMaxLimit(float maxLimit) {
settings = settings.setMaxLimit(maxLimit);
return this;
}
@Override
public PeriodBuilderFactory setMinLimit(float minLimit) {
settings = settings.setMinLimit(minLimit);
return this;
}
@Override
public PeriodBuilderFactory setAllowZero(boolean allow) {
settings = settings.setAllowZero(allow);
return this;
}
@Override
public PeriodBuilderFactory setWeeksAloneOnly(boolean aloneOnly) {
settings = settings.setWeeksAloneOnly(aloneOnly);
return this;
}
@Override
public PeriodBuilderFactory setAllowMilliseconds(boolean allow) {
settings = settings.setAllowMilliseconds(allow);
return this;
}
@Override
public PeriodBuilderFactory setLocale(String localeName) {
settings = settings.setLocale(localeName);
return this;
}
@Override
public PeriodBuilderFactory setTimeZone(TimeZone timeZone) {
// ignore this
return this;
@ -267,6 +276,7 @@ class BasicPeriodBuilderFactory implements PeriodBuilderFactory {
* @param unit the single TimeUnit with which to represent times
* @return a builder
*/
@Override
public PeriodBuilder getFixedUnitBuilder(TimeUnit unit) {
return FixedUnitBuilder.get(unit, getSettings());
}
@ -277,6 +287,7 @@ class BasicPeriodBuilderFactory implements PeriodBuilderFactory {
*
* @return a builder
*/
@Override
public PeriodBuilder getSingleUnitBuilder() {
return SingleUnitBuilder.get(getSettings());
}
@ -289,6 +300,7 @@ class BasicPeriodBuilderFactory implements PeriodBuilderFactory {
*
* @return a builder
*/
@Override
public PeriodBuilder getOneOrTwoUnitBuilder() {
return OneOrTwoUnitBuilder.get(getSettings());
}
@ -300,6 +312,7 @@ class BasicPeriodBuilderFactory implements PeriodBuilderFactory {
*
* @return a builder
*/
@Override
public PeriodBuilder getMultiUnitBuilder(int periodCount) {
return MultiUnitBuilder.get(periodCount, getSettings());
}
@ -309,6 +322,7 @@ abstract class PeriodBuilderImpl implements PeriodBuilder {
protected BasicPeriodBuilderFactory.Settings settings;
@Override
public Period create(long duration) {
return createWithReferenceDate(duration, System.currentTimeMillis());
}
@ -317,6 +331,7 @@ abstract class PeriodBuilderImpl implements PeriodBuilder {
return BasicPeriodBuilderFactory.approximateDurationOf(unit);
}
@Override
public Period createWithReferenceDate(long duration, long referenceDate) {
boolean inPast = duration < 0;
if (inPast) {
@ -332,11 +347,13 @@ abstract class PeriodBuilderImpl implements PeriodBuilder {
return ts;
}
@Override
public PeriodBuilder withTimeZone(TimeZone timeZone) {
// ignore the time zone
return this;
}
@Override
public PeriodBuilder withLocale(String localeName) {
BasicPeriodBuilderFactory.Settings newSettings = settings.setLocale(localeName);
if (newSettings != settings) {
@ -370,10 +387,12 @@ class FixedUnitBuilder extends PeriodBuilderImpl {
this.unit = unit;
}
@Override
protected PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse) {
return get(unit, settingsToUse);
}
@Override
protected Period handleCreate(long duration, long referenceDate,
boolean inPast) {
if (unit == null) {
@ -397,10 +416,12 @@ class SingleUnitBuilder extends PeriodBuilderImpl {
return new SingleUnitBuilder(settings);
}
@Override
protected PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse) {
return SingleUnitBuilder.get(settingsToUse);
}
@Override
protected Period handleCreate(long duration, long referenceDate,
boolean inPast) {
short uset = settings.effectiveSet();
@ -430,10 +451,12 @@ class OneOrTwoUnitBuilder extends PeriodBuilderImpl {
return new OneOrTwoUnitBuilder(settings);
}
@Override
protected PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse) {
return OneOrTwoUnitBuilder.get(settingsToUse);
}
@Override
protected Period handleCreate(long duration, long referenceDate,
boolean inPast) {
Period period = null;
@ -479,10 +502,12 @@ class MultiUnitBuilder extends PeriodBuilderImpl {
return null;
}
@Override
protected PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse) {
return MultiUnitBuilder.get(nPeriods, settingsToUse);
}
@Override
protected Period handleCreate(long duration, long referenceDate,
boolean inPast) {
Period period = null;

View File

@ -36,13 +36,15 @@ class BasicPeriodFormatter implements PeriodFormatter {
this.customs = customs;
}
public String format(Period period) {
@Override
public String format(Period period) {
if (!period.isSet()) {
throw new IllegalArgumentException("period is not set");
}
return format(period.timeLimit, period.inFuture, period.counts);
}
@Override
public PeriodFormatter withLocale(String locName) {
if (!this.localeName.equals(locName)) {
PeriodFormatterData newData = factory.getData(locName);

View File

@ -81,6 +81,7 @@ public class BasicPeriodFormatterFactory implements PeriodFormatterFactory {
/**
* Set the locale for this factory.
*/
@Override
public PeriodFormatterFactory setLocale(String localeName) {
data = null;
this.localeName = localeName;
@ -93,6 +94,7 @@ public class BasicPeriodFormatterFactory implements PeriodFormatterFactory {
* @param display true if limits will be displayed
* @return this PeriodFormatterFactory
*/
@Override
public PeriodFormatterFactory setDisplayLimit(boolean display) {
updateCustomizations().displayLimit = display;
return this;
@ -113,6 +115,7 @@ public class BasicPeriodFormatterFactory implements PeriodFormatterFactory {
* @param display true if past and future will be displayed
* @return this PeriodFormatterFactory
*/
@Override
public PeriodFormatterFactory setDisplayPastFuture(boolean display) {
updateCustomizations().displayDirection = display;
return this;
@ -133,6 +136,7 @@ public class BasicPeriodFormatterFactory implements PeriodFormatterFactory {
* @param variant the variant indicating separators will be displayed
* @return this PeriodFormatterFactory
*/
@Override
public PeriodFormatterFactory setSeparatorVariant(int variant) {
updateCustomizations().separatorVariant = (byte) variant;
return this;
@ -153,6 +157,7 @@ public class BasicPeriodFormatterFactory implements PeriodFormatterFactory {
* @param variant the variant to use
* @return this PeriodFormatterFactory
*/
@Override
public PeriodFormatterFactory setUnitVariant(int variant) {
updateCustomizations().unitVariant = (byte) variant;
return this;
@ -173,6 +178,7 @@ public class BasicPeriodFormatterFactory implements PeriodFormatterFactory {
* @param variant the variant to use
* @return this PeriodFormatterFactory
*/
@Override
public PeriodFormatterFactory setCountVariant(int variant) {
updateCustomizations().countVariant = (byte) variant;
return this;
@ -187,6 +193,7 @@ public class BasicPeriodFormatterFactory implements PeriodFormatterFactory {
return customizations.countVariant;
}
@Override
public PeriodFormatter getFormatter() {
customizationsInUse = true;
return new BasicPeriodFormatter(this, localeName, getData(),

View File

@ -46,18 +46,22 @@ public class BasicPeriodFormatterService implements PeriodFormatterService {
this.ds = ds;
}
@Override
public DurationFormatterFactory newDurationFormatterFactory() {
return new BasicDurationFormatterFactory(this);
}
@Override
public PeriodFormatterFactory newPeriodFormatterFactory() {
return new BasicPeriodFormatterFactory(ds);
}
@Override
public PeriodBuilderFactory newPeriodBuilderFactory() {
return new BasicPeriodBuilderFactory(ds);
}
@Override
public Collection<String> getAvailableLocaleNames() {
return ds.getAvailableLocales();
}

Some files were not shown because too many files have changed in this diff Show More