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

View File

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

View File

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

View File

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

View File

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

View File

@ -330,6 +330,7 @@ class CharsetCompoundText extends CharsetICU {
} }
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
for (int i = 0; i < NUM_OF_CONVERTERS; i++) { 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) { protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW; CoderResult err = CoderResult.UNDERFLOW;
int sourceChar; int sourceChar;
@ -497,6 +499,7 @@ class CharsetCompoundText extends CharsetICU {
} }
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
for (int i = 0; i < NUM_OF_CONVERTERS; i++) { 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) { protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW; CoderResult err = CoderResult.UNDERFLOW;
byte[] sourceChar = { 0x00 }; byte[] sourceChar = { 0x00 };
@ -603,14 +607,17 @@ class CharsetCompoundText extends CharsetICU {
} }
} }
@Override
public CharsetDecoder newDecoder() { public CharsetDecoder newDecoder() {
return new CharsetDecoderCompoundText(this); return new CharsetDecoderCompoundText(this);
} }
@Override
public CharsetEncoder newEncoder() { public CharsetEncoder newEncoder() {
return new CharsetEncoderCompoundText(this); return new CharsetEncoderCompoundText(this);
} }
@Override
void getUnicodeSetImpl( UnicodeSet setFillIn, int which){ void getUnicodeSetImpl( UnicodeSet setFillIn, int which){
for (int i = 1; i < NUM_OF_CONVERTERS; i++) { for (int i = 1; i < NUM_OF_CONVERTERS; i++) {
myConverterArray[i].MBCSGetFilteredUnicodeSetForUnicode(myConverterArray[i].sharedData, setFillIn, which, CharsetMBCS.UCNV_SET_FILTER_NONE); 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 onUnmappableCharacter = CharsetCallback.TO_U_CALLBACK_STOP;
private CharsetCallback.Decoder onMalformedInput = CharsetCallback.TO_U_CALLBACK_STOP; private CharsetCallback.Decoder onMalformedInput = CharsetCallback.TO_U_CALLBACK_STOP;
CharsetCallback.Decoder toCharErrorBehaviour = new CharsetCallback.Decoder() { CharsetCallback.Decoder toCharErrorBehaviour = new CharsetCallback.Decoder() {
@Override
public CoderResult call(CharsetDecoderICU decoder, Object context, ByteBuffer source, public CoderResult call(CharsetDecoderICU decoder, Object context, ByteBuffer source,
CharBuffer target, IntBuffer offsets, char[] buffer, int length, CoderResult cr) { CharBuffer target, IntBuffer offsets, char[] buffer, int length, CoderResult cr) {
if (cr.isUnmappable()) { if (cr.isUnmappable()) {
@ -115,6 +116,7 @@ public abstract class CharsetDecoderICU extends CharsetDecoder{
* @exception IllegalArgumentException * @exception IllegalArgumentException
* @stable ICU 3.6 * @stable ICU 3.6
*/ */
@Override
protected final void implOnMalformedInput(CodingErrorAction newAction) { protected final void implOnMalformedInput(CodingErrorAction newAction) {
// don't run infinitely // don't run infinitely
if (malformedInputCalled) if (malformedInputCalled)
@ -137,6 +139,7 @@ public abstract class CharsetDecoderICU extends CharsetDecoder{
* @exception IllegalArgumentException * @exception IllegalArgumentException
* @stable ICU 3.6 * @stable ICU 3.6
*/ */
@Override
protected final void implOnUnmappableCharacter(CodingErrorAction newAction) { protected final void implOnUnmappableCharacter(CodingErrorAction newAction) {
// dont run infinitely // dont run infinitely
if (unmappableCharacterCalled) if (unmappableCharacterCalled)
@ -194,6 +197,7 @@ public abstract class CharsetDecoderICU extends CharsetDecoder{
* Returns CoderResult.UNDERFLOW if the action succeeds. * Returns CoderResult.UNDERFLOW if the action succeeds.
* @stable ICU 3.6 * @stable ICU 3.6
*/ */
@Override
protected final CoderResult implFlush(CharBuffer out) { protected final CoderResult implFlush(CharBuffer out) {
return decode(EMPTY, out, null, true); return decode(EMPTY, out, null, true);
} }
@ -202,6 +206,7 @@ public abstract class CharsetDecoderICU extends CharsetDecoder{
* Resets the to Unicode mode of converter * Resets the to Unicode mode of converter
* @stable ICU 3.6 * @stable ICU 3.6
*/ */
@Override
protected void implReset() { protected void implReset() {
toUnicodeStatus = 0 ; toUnicodeStatus = 0 ;
toULength = 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. * action succeeds or more input is needed for completing the decoding action.
* @stable ICU 3.6 * @stable ICU 3.6
*/ */
@Override
protected CoderResult decodeLoop(ByteBuffer in,CharBuffer out){ protected CoderResult decodeLoop(ByteBuffer in,CharBuffer out){
if(in.remaining() < toUCountPending()){ if(in.remaining() < toUCountPending()){
return CoderResult.UNDERFLOW; return CoderResult.UNDERFLOW;

View File

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

View File

@ -55,6 +55,7 @@ class CharsetHZ extends CharsetICU {
gbDecoder = (CharsetMBCS.CharsetDecoderMBCS) gbCharset.newDecoder(); gbDecoder = (CharsetMBCS.CharsetDecoderMBCS) gbCharset.newDecoder();
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
gbDecoder.implReset(); gbDecoder.implReset();
@ -63,6 +64,7 @@ class CharsetHZ extends CharsetICU {
isEmptySegment = false; isEmptySegment = false;
} }
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) { protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW; CoderResult err = CoderResult.UNDERFLOW;
byte[] tempBuf = new byte[2]; byte[] tempBuf = new byte[2];
@ -230,6 +232,7 @@ class CharsetHZ extends CharsetICU {
gbEncoder = (CharsetMBCS.CharsetEncoderMBCS) gbCharset.newEncoder(); gbEncoder = (CharsetMBCS.CharsetEncoderMBCS) gbCharset.newEncoder();
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
gbEncoder.implReset(); gbEncoder.implReset();
@ -238,6 +241,7 @@ class CharsetHZ extends CharsetICU {
isTargetUCharDBCS = false; isTargetUCharDBCS = false;
} }
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) { protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
int length = 0; int length = 0;
int[] targetUniChar = new int[] { 0 }; int[] targetUniChar = new int[] { 0 };
@ -375,14 +379,17 @@ class CharsetHZ extends CharsetICU {
} }
} }
@Override
public CharsetDecoder newDecoder() { public CharsetDecoder newDecoder() {
return new CharsetDecoderHZ(this); return new CharsetDecoderHZ(this);
} }
@Override
public CharsetEncoder newEncoder() { public CharsetEncoder newEncoder() {
return new CharsetEncoderHZ(this); return new CharsetEncoderHZ(this);
} }
@Override
void getUnicodeSetImpl( UnicodeSet setFillIn, int which){ void getUnicodeSetImpl( UnicodeSet setFillIn, int which){
setFillIn.add(0,0x7f); setFillIn.add(0,0x7f);
// CharsetMBCS mbcshz = (CharsetMBCS)CharsetICU.forNameICU("icu-internal-25546"); // 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 * @return true if the given charset is a subset of this charset
* @stable ICU 3.6 * @stable ICU 3.6
*/ */
@Override
public boolean contains(Charset cs){ public boolean contains(Charset cs){
if (null == cs) { if (null == cs) {
return false; return false;

View File

@ -725,7 +725,7 @@ class CharsetISO2022 extends CharsetICU {
int hi = MAX_STATES_2022; int hi = MAX_STATES_2022;
int oldmid = 0; 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) { if (togo == 0) {
/* not a valid character anywhere in an escape sequence */ /* not a valid character anywhere in an escape sequence */
@ -785,6 +785,7 @@ class CharsetISO2022 extends CharsetICU {
super(cs); super(cs);
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
myConverterData.reset(); myConverterData.reset();
@ -840,6 +841,7 @@ class CharsetISO2022 extends CharsetICU {
bytes[1] = (byte)(UConverterConstants.UNSIGNED_BYTE_MASK & c2); bytes[1] = (byte)(UConverterConstants.UNSIGNED_BYTE_MASK & c2);
} }
@Override
@SuppressWarnings("fallthrough") @SuppressWarnings("fallthrough")
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) { protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) {
boolean gotoGetTrail = false; boolean gotoGetTrail = false;
@ -1096,11 +1098,13 @@ class CharsetISO2022 extends CharsetICU {
super(cs); super(cs);
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
myConverterData.reset(); myConverterData.reset();
} }
@Override
@SuppressWarnings("fallthrough") @SuppressWarnings("fallthrough")
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) { protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW; CoderResult err = CoderResult.UNDERFLOW;
@ -1304,12 +1308,14 @@ class CharsetISO2022 extends CharsetICU {
super(cs); super(cs);
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
setInitialStateToUnicodeKR(); setInitialStateToUnicodeKR();
myConverterData.reset(); myConverterData.reset();
} }
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) { protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW; CoderResult err = CoderResult.UNDERFLOW;
int mySourceChar = 0x0000; int mySourceChar = 0x0000;
@ -1637,6 +1643,7 @@ class CharsetISO2022 extends CharsetICU {
super(cs, fromUSubstitutionChar[0]); super(cs, fromUSubstitutionChar[0]);
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
myConverterData.reset(); myConverterData.reset();
@ -1692,6 +1699,7 @@ class CharsetISO2022 extends CharsetICU {
return value; return value;
} }
/* This overrides the cbFromUWriteSub method in CharsetEncoderICU */ /* This overrides the cbFromUWriteSub method in CharsetEncoderICU */
@Override
CoderResult cbFromUWriteSub (CharsetEncoderICU encoder, CoderResult cbFromUWriteSub (CharsetEncoderICU encoder,
CharBuffer source, ByteBuffer target, IntBuffer offsets){ CharBuffer source, ByteBuffer target, IntBuffer offsets){
CoderResult err = CoderResult.UNDERFLOW; CoderResult err = CoderResult.UNDERFLOW;
@ -1723,6 +1731,7 @@ class CharsetISO2022 extends CharsetICU {
return err; return err;
} }
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) { protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW; CoderResult err = CoderResult.UNDERFLOW;
int sourceChar; int sourceChar;
@ -2202,12 +2211,14 @@ class CharsetISO2022 extends CharsetICU {
super(cs, fromUSubstitutionChar[0]); super(cs, fromUSubstitutionChar[0]);
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
myConverterData.reset(); myConverterData.reset();
} }
/* This overrides the cbFromUWriteSub method in CharsetEncoderICU */ /* This overrides the cbFromUWriteSub method in CharsetEncoderICU */
@Override
CoderResult cbFromUWriteSub (CharsetEncoderICU encoder, CoderResult cbFromUWriteSub (CharsetEncoderICU encoder,
CharBuffer source, ByteBuffer target, IntBuffer offsets){ CharBuffer source, ByteBuffer target, IntBuffer offsets){
CoderResult err = CoderResult.UNDERFLOW; CoderResult err = CoderResult.UNDERFLOW;
@ -2228,6 +2239,7 @@ class CharsetISO2022 extends CharsetICU {
return err; return err;
} }
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) { protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW; CoderResult err = CoderResult.UNDERFLOW;
int sourceChar; int sourceChar;
@ -2564,6 +2576,7 @@ class CharsetISO2022 extends CharsetICU {
super(cs, fromUSubstitutionChar[myConverterData.version]); super(cs, fromUSubstitutionChar[myConverterData.version]);
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
myConverterData.reset(); myConverterData.reset();
@ -2571,6 +2584,7 @@ class CharsetISO2022 extends CharsetICU {
} }
/* This overrides the cbFromUWriteSub method in CharsetEncoderICU */ /* This overrides the cbFromUWriteSub method in CharsetEncoderICU */
@Override
CoderResult cbFromUWriteSub (CharsetEncoderICU encoder, CoderResult cbFromUWriteSub (CharsetEncoderICU encoder,
CharBuffer source, ByteBuffer target, IntBuffer offsets){ CharBuffer source, ByteBuffer target, IntBuffer offsets){
CoderResult err = CoderResult.UNDERFLOW; CoderResult err = CoderResult.UNDERFLOW;
@ -2644,6 +2658,7 @@ class CharsetISO2022 extends CharsetICU {
return err; return err;
} }
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) { protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW; CoderResult err = CoderResult.UNDERFLOW;
int[] targetByteUnit = { 0x0000 }; int[] targetByteUnit = { 0x0000 };
@ -2832,6 +2847,7 @@ class CharsetISO2022 extends CharsetICU {
} }
} }
@Override
public CharsetDecoder newDecoder() { public CharsetDecoder newDecoder() {
switch (variant) { switch (variant) {
case ISO_2022_JP: case ISO_2022_JP:
@ -2849,6 +2865,7 @@ class CharsetISO2022 extends CharsetICU {
} }
} }
@Override
public CharsetEncoder newEncoder() { public CharsetEncoder newEncoder() {
CharsetEncoderICU cnv; CharsetEncoderICU cnv;
@ -2894,6 +2911,7 @@ class CharsetISO2022 extends CharsetICU {
} }
} }
@Override
void getUnicodeSetImpl(UnicodeSet setFillIn, int which) { void getUnicodeSetImpl(UnicodeSet setFillIn, int which) {
int i; int i;
/*open a set and initialize it with code points that are algorithmically round-tripped */ /*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(); implReset();
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
} }
@ -750,6 +751,7 @@ class CharsetLMBCS extends CharsetICU {
return uniChar; return uniChar;
} }
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) { protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) {
CoderResult[] err = new CoderResult[1]; CoderResult[] err = new CoderResult[1];
err[0] = CoderResult.UNDERFLOW; err[0] = CoderResult.UNDERFLOW;
@ -841,6 +843,7 @@ class CharsetLMBCS extends CharsetICU {
implReset(); implReset();
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
} }
@ -929,6 +932,7 @@ class CharsetLMBCS extends CharsetICU {
return ULMBCS_UNICODE_SIZE; return ULMBCS_UNICODE_SIZE;
} }
/* The main Unicode to LMBCS conversion function */ /* The main Unicode to LMBCS conversion function */
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) { protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
CoderResult err = CoderResult.UNDERFLOW; CoderResult err = CoderResult.UNDERFLOW;
short[] lastConverterIndex = new short[1]; short[] lastConverterIndex = new short[1];
@ -1096,14 +1100,17 @@ class CharsetLMBCS extends CharsetICU {
return err; return err;
} }
} }
@Override
public CharsetDecoder newDecoder() { public CharsetDecoder newDecoder() {
return new CharsetDecoderLMBCS(this); return new CharsetDecoderLMBCS(this);
} }
@Override
public CharsetEncoder newEncoder() { public CharsetEncoder newEncoder() {
return new CharsetEncoderLMBCS(this); return new CharsetEncoderLMBCS(this);
} }
@Override
void getUnicodeSetImpl(UnicodeSet setFillIn, int which){ void getUnicodeSetImpl(UnicodeSet setFillIn, int which){
getCompleteUnicodeSet(setFillIn); 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 * @return Charset object for the given charset name, null if unsupported
* @stable ICU 3.6 * @stable ICU 3.6
*/ */
@Override
public final Charset charsetForName(String charsetName){ public final Charset charsetForName(String charsetName){
try{ try{
// extract the options from the charset name // extract the options from the charset name
@ -290,6 +291,7 @@ public final class CharsetProviderICU extends CharsetProvider{
* @return the Charset iterator * @return the Charset iterator
* @stable ICU 3.6 * @stable ICU 3.6
*/ */
@Override
public final Iterator<Charset> charsets() { public final Iterator<Charset> charsets() {
loadAvailableICUCharsets(); loadAvailableICUCharsets();
return icuCharsets.iterator(); return icuCharsets.iterator();

View File

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

View File

@ -87,12 +87,14 @@ class CharsetUTF16 extends CharsetICU {
super(cs); super(cs);
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
isBOMReadYet = false; isBOMReadYet = false;
actualBOM = null; actualBOM = null;
} }
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) { 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 * 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; fromUnicodeStatus = (isEndianSpecified && version != 1) ? 0 : NEED_TO_WRITE_BOM;
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
fromUnicodeStatus = (isEndianSpecified && version != 1) ? 0 : NEED_TO_WRITE_BOM; fromUnicodeStatus = (isEndianSpecified && version != 1) ? 0 : NEED_TO_WRITE_BOM;
} }
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) { protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
CoderResult cr; CoderResult cr;
@ -315,14 +319,17 @@ class CharsetUTF16 extends CharsetICU {
} }
} }
@Override
public CharsetDecoder newDecoder() { public CharsetDecoder newDecoder() {
return new CharsetDecoderUTF16(this); return new CharsetDecoderUTF16(this);
} }
@Override
public CharsetEncoder newEncoder() { public CharsetEncoder newEncoder() {
return new CharsetEncoderUTF16(this); return new CharsetEncoderUTF16(this);
} }
@Override
void getUnicodeSetImpl( UnicodeSet setFillIn, int which){ void getUnicodeSetImpl( UnicodeSet setFillIn, int which){
getNonSurrogateUnicodeSet(setFillIn); getNonSurrogateUnicodeSet(setFillIn);
} }

View File

@ -69,12 +69,14 @@ class CharsetUTF32 extends CharsetICU {
super(cs); super(cs);
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
isBOMReadYet = false; isBOMReadYet = false;
actualBOM = null; actualBOM = null;
} }
@Override
protected CoderResult decodeLoop(ByteBuffer source, CharBuffer target, IntBuffer offsets, boolean flush) { 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 * 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; fromUnicodeStatus = isEndianSpecified ? 0 : NEED_TO_WRITE_BOM;
} }
@Override
protected void implReset() { protected void implReset() {
super.implReset(); super.implReset();
fromUnicodeStatus = isEndianSpecified ? 0 : NEED_TO_WRITE_BOM; fromUnicodeStatus = isEndianSpecified ? 0 : NEED_TO_WRITE_BOM;
} }
@Override
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) { protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) {
CoderResult cr; CoderResult cr;
@ -238,15 +242,18 @@ class CharsetUTF32 extends CharsetICU {
} }
} }
@Override
public CharsetDecoder newDecoder() { public CharsetDecoder newDecoder() {
return new CharsetDecoderUTF32(this); return new CharsetDecoderUTF32(this);
} }
@Override
public CharsetEncoder newEncoder() { public CharsetEncoder newEncoder() {
return new CharsetEncoderUTF32(this); return new CharsetEncoderUTF32(this);
} }
@Override
void getUnicodeSetImpl( UnicodeSet setFillIn, int which){ void getUnicodeSetImpl( UnicodeSet setFillIn, int which){
getNonSurrogateUnicodeSet(setFillIn); getNonSurrogateUnicodeSet(setFillIn);
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -160,7 +160,7 @@ public final class CollationWeights {
long start, end; long start, end;
int length, count; int length, count;
// Java 6: @Override @Override
public int compareTo(WeightRange other) { public int compareTo(WeightRange other) {
long l=start; long l=start;
long r=other.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. // Comparator for records, so that the Record class can be static.
private final Comparator<Record<V>> recordComparator = new Comparator<Record<V>>() { private final Comparator<Record<V>> recordComparator = new Comparator<Record<V>>() {
@Override
public int compare(Record<V> o1, Record<V> o2) { public int compare(Record<V> o1, Record<V> o2) {
return collatorOriginal.compare(o1.name, o2.name); return collatorOriginal.compare(o1.name, o2.name);
} }
@ -218,6 +219,7 @@ public final class AlphabeticIndex<V> implements Iterable<Bucket<V>> {
* {@inheritDoc} * {@inheritDoc}
* @stable ICU 51 * @stable ICU 51
*/ */
@Override
public Iterator<Bucket<V>> iterator() { public Iterator<Bucket<V>> iterator() {
return buckets.iterator(); return buckets.iterator();
} }
@ -750,6 +752,7 @@ public final class AlphabeticIndex<V> implements Iterable<Bucket<V>> {
* @return iterator over buckets. * @return iterator over buckets.
* @stable ICU 4.8 * @stable ICU 4.8
*/ */
@Override
public Iterator<Bucket<V>> iterator() { public Iterator<Bucket<V>> iterator() {
initBuckets(); initBuckets();
return buckets.iterator(); return buckets.iterator();
@ -875,6 +878,7 @@ public final class AlphabeticIndex<V> implements Iterable<Bucket<V>> {
* Standard toString() * Standard toString()
* @stable ICU 4.8 * @stable ICU 4.8
*/ */
@Override
public String toString() { public String toString() {
return name + "=" + data; return name + "=" + data;
} }
@ -977,6 +981,7 @@ public final class AlphabeticIndex<V> implements Iterable<Bucket<V>> {
* Iterator over the records in the bucket * Iterator over the records in the bucket
* @stable ICU 4.8 * @stable ICU 4.8
*/ */
@Override
public Iterator<Record<V>> iterator() { public Iterator<Record<V>> iterator() {
if (records == null) { if (records == null) {
return Collections.<Record<V>>emptyList().iterator(); 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. * Iterator over just the visible buckets.
*/ */
@Override
public Iterator<Bucket<V>> iterator() { public Iterator<Bucket<V>> iterator() {
return immutableVisibleList.iterator(); // use immutable list to prevent remove(). 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 { final class CollatorServiceShim extends Collator.ServiceShim {
@Override
Collator getInstance(ULocale locale) { Collator getInstance(ULocale locale) {
// use service cache, it's faster than instantiation // use service cache, it's faster than instantiation
// if (service.isDefault()) { // if (service.isDefault()) {
@ -51,6 +52,7 @@ final class CollatorServiceShim extends Collator.ServiceShim {
} }
} }
@Override
Object registerInstance(Collator collator, ULocale locale) { Object registerInstance(Collator collator, ULocale locale) {
// Set the collator locales while registering so that getInstance() // Set the collator locales while registering so that getInstance()
// need not guess whether the collator's locales are already set properly // 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); return service.registerObject(collator, locale);
} }
@Override
Object registerFactory(CollatorFactory f) { Object registerFactory(CollatorFactory f) {
class CFactory extends LocaleKeyFactory { class CFactory extends LocaleKeyFactory {
CollatorFactory delegate; CollatorFactory delegate;
@ -68,16 +71,19 @@ final class CollatorServiceShim extends Collator.ServiceShim {
this.delegate = fctry; this.delegate = fctry;
} }
@Override
public Object handleCreate(ULocale loc, int kind, ICUService srvc) { public Object handleCreate(ULocale loc, int kind, ICUService srvc) {
Object coll = delegate.createCollator(loc); Object coll = delegate.createCollator(loc);
return coll; return coll;
} }
@Override
public String getDisplayName(String id, ULocale displayLocale) { public String getDisplayName(String id, ULocale displayLocale) {
ULocale objectLocale = new ULocale(id); ULocale objectLocale = new ULocale(id);
return delegate.getDisplayName(objectLocale, displayLocale); return delegate.getDisplayName(objectLocale, displayLocale);
} }
@Override
public Set<String> getSupportedIDs() { public Set<String> getSupportedIDs() {
return delegate.getSupportedLocaleIDs(); return delegate.getSupportedLocaleIDs();
} }
@ -86,10 +92,12 @@ final class CollatorServiceShim extends Collator.ServiceShim {
return service.registerFactory(new CFactory(f)); return service.registerFactory(new CFactory(f));
} }
@Override
boolean unregister(Object registryKey) { boolean unregister(Object registryKey) {
return service.unregisterFactory((Factory)registryKey); return service.unregisterFactory((Factory)registryKey);
} }
@Override
Locale[] getAvailableLocales() { Locale[] getAvailableLocales() {
// TODO rewrite this to just wrap getAvailableULocales later // TODO rewrite this to just wrap getAvailableULocales later
Locale[] result; Locale[] result;
@ -102,6 +110,7 @@ final class CollatorServiceShim extends Collator.ServiceShim {
return result; return result;
} }
@Override
ULocale[] getAvailableULocales() { ULocale[] getAvailableULocales() {
ULocale[] result; ULocale[] result;
if (service.isDefault()) { if (service.isDefault()) {
@ -113,6 +122,7 @@ final class CollatorServiceShim extends Collator.ServiceShim {
return result; return result;
} }
@Override
String getDisplayName(ULocale objectLocale, ULocale displayLocale) { String getDisplayName(ULocale objectLocale, ULocale displayLocale) {
String id = objectLocale.getName(); String id = objectLocale.getName();
return service.getDisplayName(id, displayLocale); return service.getDisplayName(id, displayLocale);
@ -152,6 +162,7 @@ final class CollatorServiceShim extends Collator.ServiceShim {
///CLOVER:OFF ///CLOVER:OFF
// The following method can not be reached by testing // The following method can not be reached by testing
@Override
protected Object handleDefault(Key key, String[] actualIDReturn) { protected Object handleDefault(Key key, String[] actualIDReturn) {
if (actualIDReturn != null) { if (actualIDReturn != null) {
actualIDReturn[0] = "root"; actualIDReturn[0] = "root";

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -49,6 +49,7 @@ public final class ResourceBundleWrapper extends UResourceBundle {
this.bundle=bundle; this.bundle=bundle;
} }
@Override
protected Object handleGetObject(String aKey){ protected Object handleGetObject(String aKey){
ResourceBundleWrapper current = this; ResourceBundleWrapper current = this;
Object obj = null; Object obj = null;
@ -70,6 +71,7 @@ public final class ResourceBundleWrapper extends UResourceBundle {
return obj; return obj;
} }
@Override
public Enumeration<String> getKeys(){ public Enumeration<String> getKeys(){
return Collections.enumeration(keys); return Collections.enumeration(keys);
} }
@ -88,18 +90,22 @@ public final class ResourceBundleWrapper extends UResourceBundle {
current = (ResourceBundleWrapper)current.getParent(); current = (ResourceBundleWrapper)current.getParent();
} }
} }
@Override
protected String getLocaleID(){ protected String getLocaleID(){
return localeID; return localeID;
} }
@Override
protected String getBaseName(){ protected String getBaseName(){
return bundle.getClass().getName().replace('.','/'); return bundle.getClass().getName().replace('.','/');
} }
@Override
public ULocale getULocale(){ public ULocale getULocale(){
return new ULocale(localeID); return new ULocale(localeID);
} }
@Override
public UResourceBundle getParent(){ public UResourceBundle getParent(){
return (UResourceBundle)parent; return (UResourceBundle)parent;
} }
@ -182,6 +188,7 @@ public final class ResourceBundleWrapper extends UResourceBundle {
final String resName = name.replace('.', '/') + ".properties"; final String resName = name.replace('.', '/') + ".properties";
InputStream stream = java.security.AccessController.doPrivileged( InputStream stream = java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<InputStream>() { new java.security.PrivilegedAction<InputStream>() {
@Override
public InputStream run() { public InputStream run() {
return root.getResourceAsStream(resName); 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; return this;
} }
@Override
public int hashCode() { public int hashCode() {
int sum = items.length; int sum = items.length;
for (Object item : items) { for (Object item : items) {
@ -103,6 +104,7 @@ public class Row<C0, C1, C2, C3, C4> implements java.lang.Comparable, Cloneable,
return sum; return sum;
} }
@Override
public boolean equals(Object other) { public boolean equals(Object other) {
if (other == null) { if (other == null) {
return false; 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) { public int compareTo(Object other) {
int result; int result;
Row<C0, C1, C2, C3, C4> that = (Row<C0, C1, C2, C3, C4>)other; 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; return 0;
} }
@Override
public String toString() { public String toString() {
StringBuilder result = new StringBuilder("["); StringBuilder result = new StringBuilder("[");
boolean first = true; boolean first = true;
@ -158,15 +162,18 @@ public class Row<C0, C1, C2, C3, C4> implements java.lang.Comparable, Cloneable,
return result.append("]").toString(); return result.append("]").toString();
} }
@Override
public boolean isFrozen() { public boolean isFrozen() {
return frozen; return frozen;
} }
@Override
public Row<C0, C1, C2, C3, C4> freeze() { public Row<C0, C1, C2, C3, C4> freeze() {
frozen = true; frozen = true;
return this; return this;
} }
@Override
public Object clone() { public Object clone() {
if (frozen) return this; if (frozen) return this;
try { 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() { public Row<C0, C1, C2, C3, C4> cloneAsThawed() {
try { try {
Row<C0, C1, C2, C3, C4> result = (Row<C0, C1, C2, C3, C4>) super.clone(); 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. * Position within an expanded variable is <em>not</em> indicated.
* @return a string representation of this object * @return a string representation of this object
*/ */
@Override
public String toString() { public String toString() {
int b = pos.getIndex(); int b = pos.getIndex();
return text.substring(0, b) + '|' + text.substring(b); 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) { public V get(Object key) {
Reference<Map<K, V>> ref = cacheRef; Reference<Map<K, V>> ref = cacheRef;
if (ref != null) { if (ref != null) {
@ -50,6 +51,7 @@ public class SimpleCache<K, V> implements ICUCache<K, V> {
return null; return null;
} }
@Override
public void put(K key, V value) { public void put(K key, V value) {
Reference<Map<K, V>> ref = cacheRef; Reference<Map<K, V>> ref = cacheRef;
Map<K, V> map = null; Map<K, V> map = null;
@ -68,6 +70,7 @@ public class SimpleCache<K, V> implements ICUCache<K, V> {
map.put(key, value); map.put(key, value);
} }
@Override
public void clear() { public void clear() {
cacheRef = null; cacheRef = null;
} }

View File

@ -47,6 +47,7 @@ public final class StringPrepDataReader implements ICUBinary.Authenticate {
return ICUBinary.getChars(byteBuffer, length, 0); return ICUBinary.getChars(byteBuffer, length, 0);
} }
@Override
public boolean isDataVersionAcceptable(byte version[]){ public boolean isDataVersionAcceptable(byte version[]){
return version[0] == DATA_FORMAT_VERSION[0] return version[0] == DATA_FORMAT_VERSION[0]
&& version[2] == DATA_FORMAT_VERSION[2] && 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[]>() { public static final Comparator<int[]> COMPARE_INT_ARRAYS = new Comparator<int[]>() {
@Override
public int compare(int[] o1, int[] o2) { public int compare(int[] o1, int[] o2) {
int minIndex = Math.min(o1.length, o2.length); int minIndex = Math.min(o1.length, o2.length);
for (int i = 0; i < minIndex; ++i) { for (int i = 0; i < minIndex; ++i) {
@ -140,6 +141,7 @@ public class StringRange {
public boolean equals(Object obj) { public boolean equals(Object obj) {
return this == obj || (obj != null && obj instanceof Range && compareTo((Range)obj) == 0); return this == obj || (obj != null && obj instanceof Range && compareTo((Range)obj) == 0);
} }
@Override
public int compareTo(Range that) { public int compareTo(Range that) {
int diff = min - that.min; int diff = min - that.min;
if (diff != 0) { if (diff != 0) {
@ -215,6 +217,7 @@ public class StringRange {
public Integer size() { public Integer size() {
return ranges.length; return ranges.length;
} }
@Override
public int compareTo(Ranges other) { public int compareTo(Ranges other) {
int diff = ranges.length - other.ranges.length; int diff = ranges.length - other.ranges.length;
if (diff != 0) { if (diff != 0) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,26 +36,32 @@ public final class UCharArrayIterator extends UCharacterIterator {
this.pos = start; this.pos = start;
} }
@Override
public int current() { public int current() {
return pos < limit ? text[pos] : DONE; return pos < limit ? text[pos] : DONE;
} }
@Override
public int getLength() { public int getLength() {
return limit - start; return limit - start;
} }
@Override
public int getIndex() { public int getIndex() {
return pos - start; return pos - start;
} }
@Override
public int next() { public int next() {
return pos < limit ? text[pos++] : DONE; return pos < limit ? text[pos++] : DONE;
} }
@Override
public int previous() { public int previous() {
return pos > start ? text[--pos] : DONE; return pos > start ? text[--pos] : DONE;
} }
@Override
public void setIndex(int index) { public void setIndex(int index) {
if (index < 0 || index > limit - start) { if (index < 0 || index > limit - start) {
throw new IndexOutOfBoundsException("index: " + index + throw new IndexOutOfBoundsException("index: " + index +
@ -65,6 +71,7 @@ public final class UCharArrayIterator extends UCharacterIterator {
pos = start + index; pos = start + index;
} }
@Override
public int getText(char[] fillIn, int offset) { public int getText(char[] fillIn, int offset) {
int len = limit - start; int len = limit - start;
System.arraycopy(text, start, fillIn, offset, len); System.arraycopy(text, start, fillIn, offset, len);
@ -76,6 +83,7 @@ public final class UCharArrayIterator extends UCharacterIterator {
* <code>Replaceable</code>object * <code>Replaceable</code>object
* @return copy of this iterator * @return copy of this iterator
*/ */
@Override
public Object clone(){ public Object clone(){
try { try {
return super.clone(); 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 * @return the first character in the text, or DONE if the text is empty
* @see #getBeginIndex() * @see #getBeginIndex()
*/ */
@Override
public char first(){ public char first(){
//UCharacterIterator always iterates from 0 to length //UCharacterIterator always iterates from 0 to length
iterator.setToStart(); 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 * @return the last character in the text, or DONE if the text is empty
* @see #getEndIndex() * @see #getEndIndex()
*/ */
@Override
public char last(){ public char last(){
iterator.setToLimit(); iterator.setToLimit();
return (char)iterator.previous(); return (char)iterator.previous();
@ -56,6 +58,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* position is off the end of the text. * position is off the end of the text.
* @see #getIndex() * @see #getIndex()
*/ */
@Override
public char current(){ public char current(){
return (char) iterator.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 * @return the character at the new position or DONE if the new
* position is off the end of the text range. * position is off the end of the text range.
*/ */
@Override
public char next(){ public char next(){
//pre-increment //pre-increment
iterator.next(); iterator.next();
@ -81,6 +85,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* @return the character at the new position or DONE if the current * @return the character at the new position or DONE if the current
* position is equal to getBeginIndex(). * position is equal to getBeginIndex().
*/ */
@Override
public char previous(){ public char previous(){
//pre-decrement //pre-decrement
return (char) iterator.previous(); return (char) iterator.previous();
@ -94,6 +99,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* if an invalid value is supplied. * if an invalid value is supplied.
* @return the character at the specified position or DONE if the specified position is equal to getEndIndex() * @return the character at the specified position or DONE if the specified position is equal to getEndIndex()
*/ */
@Override
public char setIndex(int position){ public char setIndex(int position){
iterator.setIndex(position); iterator.setIndex(position);
return (char) iterator.current(); return (char) iterator.current();
@ -103,6 +109,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* Returns the start index of the text. * Returns the start index of the text.
* @return the index at which the text begins. * @return the index at which the text begins.
*/ */
@Override
public int getBeginIndex(){ public int getBeginIndex(){
//UCharacterIterator always starts from 0 //UCharacterIterator always starts from 0
return 0; return 0;
@ -113,6 +120,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* character following the end of the text. * character following the end of the text.
* @return the index after the last character in the text * @return the index after the last character in the text
*/ */
@Override
public int getEndIndex(){ public int getEndIndex(){
return iterator.getLength(); return iterator.getLength();
} }
@ -121,6 +129,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* Returns the current index. * Returns the current index.
* @return the current index. * @return the current index.
*/ */
@Override
public int getIndex(){ public int getIndex(){
return iterator.getIndex(); return iterator.getIndex();
} }
@ -129,6 +138,7 @@ public class UCharacterIteratorWrapper implements CharacterIterator{
* Create a copy of this iterator * Create a copy of this iterator
* @return A copy of this * @return A copy of this
*/ */
@Override
public Object clone(){ public Object clone(){
try { try {
UCharacterIteratorWrapper result = (UCharacterIteratorWrapper) super.clone(); UCharacterIteratorWrapper result = (UCharacterIteratorWrapper) super.clone();

View File

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

View File

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

View File

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

View File

@ -162,6 +162,7 @@ public abstract class URLHandler {
} }
} }
@Override
public void guide(URLVisitor v, boolean recurse, boolean strip) { public void guide(URLVisitor v, boolean recurse, boolean strip) {
if (file.isDirectory()) { if (file.isDirectory()) {
process(v, recurse, strip, "/", file.listFiles()); process(v, recurse, strip, "/", file.listFiles());
@ -221,6 +222,7 @@ public abstract class URLHandler {
} }
} }
@Override
public void guide(URLVisitor v, boolean recurse, boolean strip) { public void guide(URLVisitor v, boolean recurse, boolean strip) {
try { try {
Enumeration<JarEntry> entries = jarFile.entries(); 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 * @return A processed Java regex pattern, suitable for input to
* Pattern.compile(). * Pattern.compile().
*/ */
@Override
public String transform(String regex) { public String transform(String regex) {
StringBuilder result = new StringBuilder(); StringBuilder result = new StringBuilder();
UnicodeSet temp = new UnicodeSet(); UnicodeSet temp = new UnicodeSet();
@ -306,6 +307,7 @@ public class UnicodeRegex implements Cloneable, Freezable<UnicodeRegex>, StringT
/* (non-Javadoc) /* (non-Javadoc)
* @see com.ibm.icu.util.Freezable#cloneAsThawed() * @see com.ibm.icu.util.Freezable#cloneAsThawed()
*/ */
@Override
public UnicodeRegex cloneAsThawed() { public UnicodeRegex cloneAsThawed() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
try { try {
@ -318,6 +320,7 @@ public class UnicodeRegex implements Cloneable, Freezable<UnicodeRegex>, StringT
/* (non-Javadoc) /* (non-Javadoc)
* @see com.ibm.icu.util.Freezable#freeze() * @see com.ibm.icu.util.Freezable#freeze()
*/ */
@Override
public UnicodeRegex freeze() { public UnicodeRegex freeze() {
// no action needed now. // no action needed now.
return this; return this;
@ -326,6 +329,7 @@ public class UnicodeRegex implements Cloneable, Freezable<UnicodeRegex>, StringT
/* (non-Javadoc) /* (non-Javadoc)
* @see com.ibm.icu.util.Freezable#isFrozen() * @see com.ibm.icu.util.Freezable#isFrozen()
*/ */
@Override
public boolean isFrozen() { public boolean isFrozen() {
// at this point, always true // at this point, always true
return true; return true;
@ -353,6 +357,7 @@ public class UnicodeRegex implements Cloneable, Freezable<UnicodeRegex>, StringT
// private Appendable log = null; // private Appendable log = null;
private Comparator<Object> LongestFirst = new Comparator<Object>() { private Comparator<Object> LongestFirst = new Comparator<Object>() {
@Override
public int compare(Object obj0, Object obj1) { public int compare(Object obj0, Object obj1) {
String arg0 = obj0.toString(); String arg0 = obj0.toString();
String arg1 = obj1.toString(); String arg1 = obj1.toString();

View File

@ -14,17 +14,19 @@ import java.util.ListResourceBundle;
public class HolidayBundle extends ListResourceBundle { public class HolidayBundle extends ListResourceBundle {
// Normally, each HolidayBundle uses the holiday's US English name // 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 // that the key itself can be used if no name is found for the requested
// locale. // locale.
// //
// For holidays where the key is _not_ the English name, e.g. in the // For holidays where the key is _not_ the English name, e.g. in the
// case of conflicts, the English name must be given here. // case of conflicts, the English name must be given here.
// //
static private final Object[][] fContents = { static private final Object[][] fContents = { { "", "" }, // Can't be empty!
{ "", "" }, // 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" }, { "Pentecost", "pinse" },
{ "Shrove Tuesday", "hvidetirsdag" }, { "Shrove Tuesday", "hvidetirsdag" },
}; };
@Override
public synchronized Object[][] getContents() { return fContents; } 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.Holiday;
import com.ibm.icu.util.SimpleHoliday; import com.ibm.icu.util.SimpleHoliday;
public class HolidayBundle_da_DK extends ListResourceBundle public class HolidayBundle_da_DK extends ListResourceBundle {
{ static private final Holiday[] fHolidays = { SimpleHoliday.NEW_YEARS_DAY,
static private final Holiday[] fHolidays = { new SimpleHoliday(Calendar.APRIL, 30, -Calendar.FRIDAY, "General Prayer Day"),
SimpleHoliday.NEW_YEARS_DAY, new SimpleHoliday(Calendar.JUNE, 5, "Constitution Day"), SimpleHoliday.CHRISTMAS_EVE,
new SimpleHoliday(Calendar.APRIL, 30, -Calendar.FRIDAY, "General Prayer Day"), SimpleHoliday.CHRISTMAS, SimpleHoliday.BOXING_DAY, SimpleHoliday.NEW_YEARS_EVE,
new SimpleHoliday(Calendar.JUNE, 5, "Constitution Day"),
SimpleHoliday.CHRISTMAS_EVE,
SimpleHoliday.CHRISTMAS,
SimpleHoliday.BOXING_DAY,
SimpleHoliday.NEW_YEARS_EVE,
// Easter and related holidays // Easter and related holidays
EasterHoliday.MAUNDY_THURSDAY, EasterHoliday.MAUNDY_THURSDAY, EasterHoliday.GOOD_FRIDAY, EasterHoliday.EASTER_SUNDAY,
EasterHoliday.GOOD_FRIDAY, EasterHoliday.EASTER_MONDAY, EasterHoliday.ASCENSION, EasterHoliday.WHIT_MONDAY, };
EasterHoliday.EASTER_SUNDAY,
EasterHoliday.EASTER_MONDAY,
EasterHoliday.ASCENSION,
EasterHoliday.WHIT_MONDAY,
};
static private final Object[][] fContents = { static private final Object[][] fContents = { { "holidays", fHolidays }, };
{ "holidays", fHolidays },
}; @Override
public synchronized Object[][] getContents() { return fContents; } public synchronized Object[][] getContents() {
return fContents;
}
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -34,5 +34,6 @@ public class HolidayBundle_es_MX extends ListResourceBundle {
static private final Object[][] fContents = { static private final Object[][] fContents = {
{ "holidays", fHolidays }, { "holidays", fHolidays },
}; };
@Override
public synchronized Object[][] getContents() { return fContents; } 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" }, { "Victory Day", "F\u00EAte de la Victoire" },
}; };
@Override
public synchronized Object[][] getContents() { return fContents; } public synchronized Object[][] getContents() { return fContents; }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -22,5 +22,6 @@ public class HolidayBundle_ja_JP extends ListResourceBundle {
static private final Object[][] fContents = { static private final Object[][] fContents = {
{ "holidays", fHolidays }, { "holidays", fHolidays },
}; };
@Override
public synchronized Object[][] getContents() { return fContents; } 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 * associated with it. If the stream is already closed then invoking
* this method has no effect. * this method has no effect.
*/ */
@Override
public void close() throws IOException { public void close() throws IOException {
if (reader != null) { if (reader != null) {
reader.close(); reader.close();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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