From 087ac18813c4d10aea5c7467896ac8181d56589546db0c793a6fd7a0084ddcce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 3 May 2024 13:41:03 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main icu4j revision dcf2b9116e1b2c9e71b8edc62ab5777f --- .gitattributes | 23 + icu4j-70.1-java8compat.patch | 4392 ++++++++++++++++++++++++++++++++++ icu4j-73_1.tgz | 3 + icu4j-detectjava21.patch | 26 + icu4j-javadoc.patch | 31 + icu4j-jdk10plus.patch | 79 + icu4j.changes | 359 +++ icu4j.spec | 168 ++ improve-osgi-manifest.patch | 47 + 9 files changed, 5128 insertions(+) create mode 100644 .gitattributes create mode 100644 icu4j-70.1-java8compat.patch create mode 100644 icu4j-73_1.tgz create mode 100644 icu4j-detectjava21.patch create mode 100644 icu4j-javadoc.patch create mode 100644 icu4j-jdk10plus.patch create mode 100644 icu4j.changes create mode 100644 icu4j.spec create mode 100644 improve-osgi-manifest.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/icu4j-70.1-java8compat.patch b/icu4j-70.1-java8compat.patch new file mode 100644 index 0000000..c150303 --- /dev/null +++ b/icu4j-70.1-java8compat.patch @@ -0,0 +1,4392 @@ +--- a/main/classes/charset/src/com/ibm/icu/charset/Charset88591.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/charset/src/com/ibm/icu/charset/Charset88591.java 2021-10-29 08:08:50.772614012 -0600 +@@ -9,6 +9,7 @@ + + package com.ibm.icu.charset; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.charset.CharsetDecoder; +@@ -91,8 +92,8 @@ class Charset88591 extends CharsetASCII + * early termination of the loop + */ + if ((ch & 0xff00) != 0) { +- source.position((i + 1) - source.arrayOffset()); +- target.position(i + offset); ++ ((Buffer)source).position((i + 1) - source.arrayOffset()); ++ ((Buffer)target).position(i + offset); + return encodeMalformedOrUnmappable(source, ch, flush); + } else + return null; +--- a/main/classes/charset/src/com/ibm/icu/charset/CharsetASCII.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/charset/src/com/ibm/icu/charset/CharsetASCII.java 2021-10-29 08:08:50.772614012 -0600 +@@ -10,6 +10,7 @@ + */ + package com.ibm.icu.charset; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.IntBuffer; +@@ -80,12 +81,12 @@ class CharsetASCII extends CharsetICU { + cr = decodeLoopCoreOptimized(source, target, sourceArray, targetArray, sourceIndex, offset, limit); + if (cr == null) { + if (sourceLength <= targetLength) { +- source.position(oldSource + sourceLength); +- target.position(oldTarget + sourceLength); ++ ((Buffer)source).position(oldSource + sourceLength); ++ ((Buffer)target).position(oldTarget + sourceLength); + cr = CoderResult.UNDERFLOW; + } else { +- source.position(oldSource + targetLength); +- target.position(oldTarget + targetLength); ++ ((Buffer)source).position(oldSource + targetLength); ++ ((Buffer)target).position(oldTarget + targetLength); + cr = CoderResult.OVERFLOW; + } + } +@@ -125,8 +126,8 @@ class CharsetASCII extends CharsetICU { + * early termination of the loop + */ + if ((ch & 0x80) != 0) { +- source.position(i + 1); +- target.position(i + offset); ++ ((Buffer)source).position(i + 1); ++ ((Buffer)target).position(i + offset); + return decodeMalformedOrUnmappable(ch); + } else + return null; +@@ -238,12 +239,12 @@ class CharsetASCII extends CharsetICU { + cr = encodeLoopCoreOptimized(source, target, sourceArray, targetArray, sourceIndex, offset, limit, flush); + if (cr == null) { + if (sourceLength <= targetLength) { +- source.position(oldSource + sourceLength); +- target.position(oldTarget + sourceLength); ++ ((Buffer)source).position(oldSource + sourceLength); ++ ((Buffer)target).position(oldTarget + sourceLength); + cr = CoderResult.UNDERFLOW; + } else { +- source.position(oldSource + targetLength); +- target.position(oldTarget + targetLength); ++ ((Buffer)source).position(oldSource + targetLength); ++ ((Buffer)target).position(oldTarget + targetLength); + cr = CoderResult.OVERFLOW; + } + } +@@ -286,8 +287,8 @@ class CharsetASCII extends CharsetICU { + * early termination of the loop + */ + if ((ch & 0xff80) != 0) { +- source.position((i + 1) - source.arrayOffset()); +- target.position(i + offset); ++ ((Buffer)source).position((i + 1) - source.arrayOffset()); ++ ((Buffer)target).position(i + offset); + return encodeMalformedOrUnmappable(source, ch, flush); + } else + return null; +--- a/main/classes/charset/src/com/ibm/icu/charset/CharsetBOCU1.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/charset/src/com/ibm/icu/charset/CharsetBOCU1.java 2021-10-29 08:08:50.773614012 -0600 +@@ -8,6 +8,7 @@ + */ + package com.ibm.icu.charset; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.IntBuffer; +@@ -446,7 +447,7 @@ class CharsetBOCU1 extends CharsetICU { + if(offsets!=null){ + offsets.put(nextSourceIndex++); + } +- source.position(source.position()+1); ++ ((Buffer)source).position(source.position()+1); + --targetCapacity; + }else { + diff = c-prev; +@@ -456,7 +457,7 @@ class CharsetBOCU1 extends CharsetICU { + if(offsets!=null){ + offsets.put(nextSourceIndex++); + } +- source.position(source.position()+1); ++ ((Buffer)source).position(source.position()+1); + --targetCapacity; + }else { + break; +@@ -471,7 +472,7 @@ class CharsetBOCU1 extends CharsetICU { + /*test the following code unit*/ + char trail = source.get(source.position()); + if(UTF16.isTrailSurrogate(trail)){ +- source.position(source.position()+1); ++ ((Buffer)source).position(source.position()+1); + ++nextSourceIndex; + c=UCharacter.getCodePoint(c, trail); + } +@@ -873,7 +874,7 @@ class CharsetBOCU1 extends CharsetICU { + } else { + break; + } +- source.position(source.position()+1); ++ ((Buffer)source).position(source.position()+1); + --count; + } + sourceIndex=nextSourceIndex; /* wrong if offsets==NULL but does not matter */ +--- a/main/classes/charset/src/com/ibm/icu/charset/CharsetCompoundText.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/charset/src/com/ibm/icu/charset/CharsetCompoundText.java 2021-10-29 08:08:50.774614012 -0600 +@@ -8,6 +8,7 @@ + */ + package com.ibm.icu.charset; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.IntBuffer; +@@ -269,7 +270,7 @@ class CharsetCompoundText extends Charse + + if (matchFound) { + state = i; +- source.position(sourceIndex + (escSeqCompoundText[i].length - offset)); ++ ((Buffer)source).position(sourceIndex + (escSeqCompoundText[i].length - offset)); + } + + return state; +@@ -371,8 +372,8 @@ class CharsetCompoundText extends Charse + } + + targetLength = 0; +- tmpTargetBuffer.position(0); +- tmpTargetBuffer.limit(3); ++ ((Buffer)tmpTargetBuffer).position(0); ++ ((Buffer)tmpTargetBuffer).limit(3); + + /* check if the char is a First surrogate */ + if (UTF16.isSurrogate(sourceChar) || gotoGetTrail) { +@@ -385,7 +386,7 @@ class CharsetCompoundText extends Charse + if (source.hasRemaining()) { + /* test the following code unit */ + char trail = source.get(); +- source.position(source.position()-1); ++ ((Buffer)source).position(source.position()-1); + if (UTF16.isTrailSurrogate(trail)) { + source.get(); + sourceChar = UCharacter.getCodePoint(sourceChar, trail); +@@ -423,18 +424,18 @@ class CharsetCompoundText extends Charse + err = gbEncoder[i].cnvMBCSFromUnicodeWithOffsets(CharBuffer.wrap(sourceCharArray), tmpTargetBuffer, offsets, true); + if (!err.isError()) { + tmpState = (byte)i; +- tmpTargetBuffer.limit(tmpTargetBuffer.position()); ++ ((Buffer)tmpTargetBuffer).limit(tmpTargetBuffer.position()); + implReset(); + break; + } + } + } else if (tmpState == COMPOUND_TEXT_SINGLE_0) { + tmpTargetBuffer.put(0, (byte)sourceChar); +- tmpTargetBuffer.limit(1); ++ ((Buffer)tmpTargetBuffer).limit(1); + } else { + err = gbEncoder[tmpState].cnvMBCSFromUnicodeWithOffsets(CharBuffer.wrap(sourceCharArray), tmpTargetBuffer, offsets, true); + if (!err.isError()) { +- tmpTargetBuffer.limit(tmpTargetBuffer.position()); ++ ((Buffer)tmpTargetBuffer).limit(tmpTargetBuffer.position()); + } + } + if (err.isError()) { +@@ -568,7 +569,7 @@ class CharsetCompoundText extends Charse + } + } + } else if (source.hasRemaining()) { +- source.limit(findNextEsc(source)); ++ ((Buffer)source).limit(findNextEsc(source)); + + decoder = gbDecoder[currentState]; + +@@ -591,7 +592,7 @@ class CharsetCompoundText extends Charse + } + } + +- source.limit(sourceLimit); ++ ((Buffer)source).limit(sourceLimit); + } + + if (err.isError()) { +--- a/main/classes/charset/src/com/ibm/icu/charset/CharsetDecoderICU.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/charset/src/com/ibm/icu/charset/CharsetDecoderICU.java 2021-10-29 08:08:50.775614013 -0600 +@@ -11,6 +11,7 @@ + + package com.ibm.icu.charset; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.IntBuffer; +@@ -248,14 +249,14 @@ public abstract class CharsetDecoderICU + // return CoderResult.UNDERFLOW; + // } + +- in.position(in.position() + toUCountPending()); ++ ((Buffer)in).position(in.position() + toUCountPending()); + + /* do the conversion */ + CoderResult ret = decode(in, out, null, false); + + // ok was there input held in the previous invocation of decodeLoop + // that resulted in output in this invocation? +- in.position(in.position() - toUCountPending()); ++ ((Buffer)in).position(in.position() - toUCountPending()); + + return ret; + } +@@ -428,8 +429,8 @@ public abstract class CharsetDecoderICU + //UConverterUtility.uprv_memcpy(replayArray, replayBegin, preToUArray, preToUBegin, -preToULength); + replayArray.put(preToUArray,0, -preToULength); + source=replayArray; +- source.position(0); +- source.limit(replayArrayIndex-preToULength); ++ ((Buffer)source).position(0); ++ ((Buffer)source).limit(replayArrayIndex-preToULength); + flush=false; + sourceIndex=-1; + preToULength=0; +@@ -515,10 +516,10 @@ public abstract class CharsetDecoderICU + //UConverterUtility.uprv_memcpy(replayArray, replayBegin, preToUArray, preToUBegin, -preToULength); + replayArray.put(preToUArray,0, -preToULength); + // reset position +- replayArray.position(0); ++ ((Buffer)replayArray).position(0); + + source=replayArray; +- source.limit(replayArrayIndex-preToULength); ++ ((Buffer)source).limit(replayArrayIndex-preToULength); + flush=false; + if((sourceIndex+=preToULength)<0) { + sourceIndex=-1; +--- a/main/classes/charset/src/com/ibm/icu/charset/CharsetEncoderICU.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/charset/src/com/ibm/icu/charset/CharsetEncoderICU.java 2021-10-29 08:08:50.776614013 -0600 +@@ -11,6 +11,7 @@ + + package com.ibm.icu.charset; + ++import java.nio.Buffer; + import java.nio.BufferOverflowException; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; +@@ -265,7 +266,7 @@ public abstract class CharsetEncoderICU + //fromUnicodeReset(); + return CoderResult.UNDERFLOW; + } +- in.position(in.position() + fromUCountPending()); ++ ((Buffer)in).position(in.position() + fromUCountPending()); + /* do the conversion */ + CoderResult ret = encode(in, out, null, false); + setSourcePosition(in); +@@ -421,8 +422,8 @@ public abstract class CharsetEncoderICU + //UConverterUtility.uprv_memcpy(replayArray, replayArrayIndex, preFromUArray, 0, -preFromULength*UMachine.U_SIZEOF_UCHAR); + replayArray.put(preFromUArray, 0, -preFromULength); + source = replayArray; +- source.position(replayArrayIndex); +- source.limit(replayArrayIndex - preFromULength); //preFromULength is negative, see declaration ++ ((Buffer)source).position(replayArrayIndex); ++ ((Buffer)source).limit(replayArrayIndex - preFromULength); //preFromULength is negative, see declaration + flush = false; + + preFromULength = 0; +@@ -502,8 +503,8 @@ public abstract class CharsetEncoderICU + replayArray.put(preFromUArray, 0, -preFromULength); + + source = replayArray; +- source.position(replayArrayIndex); +- source.limit(replayArrayIndex - preFromULength); ++ ((Buffer)source).position(replayArrayIndex); ++ ((Buffer)source).limit(replayArrayIndex - preFromULength); + flush = false; + if ((sourceIndex += preFromULength) < 0) { + sourceIndex = -1; +@@ -760,7 +761,7 @@ public abstract class CharsetEncoderICU + + // ok was there input held in the previous invocation of encodeLoop + // that resulted in output in this invocation? +- source.position(source.position() - fromUCountPending()); ++ ((Buffer)source).position(source.position() - fromUCountPending()); + } + + /* +@@ -829,7 +830,7 @@ public abstract class CharsetEncoderICU + /* start the new target at the first free slot in the error buffer */ + int errBuffLen = encoder.errorBufferLength; + ByteBuffer newTarget = ByteBuffer.wrap(encoder.errorBuffer); +- newTarget.position(errBuffLen); /* set the position at the end of the error buffer */ ++ ((Buffer)newTarget).position(errBuffLen); /* set the position at the end of the error buffer */ + encoder.errorBufferLength = 0; + + encoder.encode(source, newTarget, null, false); +@@ -879,7 +880,7 @@ public abstract class CharsetEncoderICU + + if (!UTF16.isTrailSurrogate(trail)) { + fromUChar32 = lead; +- source.position(source.position() - 1); ++ ((Buffer)source).position(source.position() - 1); + return CoderResult.malformedForLength(1); + } + +--- a/main/classes/charset/src/com/ibm/icu/charset/CharsetHZ.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/charset/src/com/ibm/icu/charset/CharsetHZ.java 2021-10-29 08:08:50.777614013 -0600 +@@ -8,6 +8,7 @@ + */ + package com.ibm.icu.charset; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.IntBuffer; +@@ -125,7 +126,7 @@ class CharsetHZ extends CharsetICU { + if (isStateDBCS ? (0x21 <= mySourceChar && mySourceChar <= 0x7e) : mySourceChar <= 0x7f) { + /* The current byte could be the start of a character: Back it out. */ + toULength = 1; +- source.position(source.position() - 1); ++ ((Buffer)source).position(source.position() - 1); + } else { + /* Include the current byte in the illegal sequence. */ + toUBytesArray[1] = (byte)mySourceChar; +@@ -170,7 +171,7 @@ class CharsetHZ extends CharsetICU { + mySourceChar = (leadByte << 8) | mySourceChar; + } else if (trailIsOk) { + /* report a single illegal byte and continue with the following DBCS starter byte */ +- source.position(source.position() - 1); ++ ((Buffer)source).position(source.position() - 1); + mySourceChar = leadByte; + } else { + /* report a pair of illegal bytes if the second byte is not a DBCS starter */ +--- a/main/classes/charset/src/com/ibm/icu/charset/CharsetISO2022.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/charset/src/com/ibm/icu/charset/CharsetISO2022.java 2021-10-29 08:08:50.779614013 -0600 +@@ -8,6 +8,7 @@ + */ + package com.ibm.icu.charset; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.IntBuffer; +@@ -701,7 +702,7 @@ class CharsetISO2022 extends CharsetICU + int bytesFromThisBuffer = decoder.toULength - initialToULength; + if (backOutDistance <= bytesFromThisBuffer) { + /* same as initialToULength<=1 */ +- source.position(source.position() - backOutDistance); ++ ((Buffer)source).position(source.position() - backOutDistance); + } else { + /* Back out bytes from the previous buffer: Need to replay them. */ + decoder.preToULength = (byte)(bytesFromThisBuffer - backOutDistance); +@@ -710,7 +711,7 @@ class CharsetISO2022 extends CharsetICU + for (int i = 0; i < -(decoder.preToULength); i++) { + decoder.preToUArray[i] = decoder.toUBytesArray[i+1]; + } +- source.position(source.position() - bytesFromThisBuffer); ++ ((Buffer)source).position(source.position() - bytesFromThisBuffer); + } + decoder.toULength = 1; + } +@@ -907,7 +908,7 @@ class CharsetISO2022 extends CharsetICU + + case ESC_2022: + if (!gotoEscape) { +- source.position(source.position() - 1); ++ ((Buffer)source).position(source.position() - 1); + } else { + gotoEscape = false; + } +@@ -1061,14 +1062,14 @@ class CharsetISO2022 extends CharsetICU + /* disassemble the surrogate pair and write to output */ + targetUniChar -= 0x0010000; + target.put((char)(0xd800 + (char)(targetUniChar>>10))); +- target.position(target.position()-1); ++ ((Buffer)target).position(target.position()-1); + if (offsets != null) { + offsets.put(target.remaining(), source.remaining() - (mySourceChar <= 0xff ? 1 : 2)); + } + target.get(); + if (target.hasRemaining()) { + target.put((char)(0xdc00+(char)(targetUniChar&0x3ff))); +- target.position(target.position()-1); ++ ((Buffer)target).position(target.position()-1); + if (offsets != null) { + offsets.put(target.remaining(), source.remaining() - (mySourceChar <= 0xff ? 1 : 2)); + } +@@ -1167,7 +1168,7 @@ class CharsetISO2022 extends CharsetICU + + case ESC_2022: + if (!gotoEscape) { +- source.position(source.position()-1); ++ ((Buffer)source).position(source.position()-1); + } + // escape label + gotoEscape = false; +@@ -1239,7 +1240,7 @@ class CharsetISO2022 extends CharsetICU + tempBufLen = 2; + } + ByteBuffer tempBuffer = ByteBuffer.wrap(tempBuf); +- tempBuffer.limit(tempBufLen); ++ ((Buffer)tempBuffer).limit(tempBufLen); + targetUniChar = MBCSSimpleGetNextUChar(cnv, tempBuffer, false); + mySourceChar = (mySourceChar << 8) | trailByte; + +@@ -1366,7 +1367,7 @@ class CharsetISO2022 extends CharsetICU + continue; + } else if (!gotoGetTrailByte && (gotoEscape || mySourceChar == ESC_2022)) { + if (!gotoEscape) { +- source.position(source.position()-1); ++ ((Buffer)source).position(source.position()-1); + } + // escape label + gotoEscape = false; // reset gotoEscape flag +@@ -1419,11 +1420,11 @@ class CharsetISO2022 extends CharsetICU + } else if (mySourceChar <= 0x7f) { + int savedSourceLimit = source.limit(); + int savedSourcePosition = source.position(); +- source.limit(source.position()); +- source.position(source.position()-1); ++ ((Buffer)source).limit(source.position()); ++ ((Buffer)source).position(source.position()-1); + targetUniChar = MBCSSimpleGetNextUChar(myConverterData.currentConverter.sharedData, source, usingFallback); +- source.limit(savedSourceLimit); +- source.position(savedSourcePosition); ++ ((Buffer)source).limit(savedSourceLimit); ++ ((Buffer)source).position(savedSourcePosition); + } else { + targetUniChar = 0xffff; + } +@@ -1468,7 +1469,7 @@ class CharsetISO2022 extends CharsetICU + /* Find the end of the buffer e.g : Next Escape Seq | end of Buffer */ + int oldSourcePos = source.position(); + sourceLimit = getEndOfBuffer_2022(source); +- source.position(oldSourcePos); ++ ((Buffer)source).position(oldSourcePos); + if (source.position() != sourceLimit) { + /* + * get the current partial byte sequence +@@ -1489,9 +1490,9 @@ class CharsetISO2022 extends CharsetICU + */ + argTarget = target.position(); + oldSourceLimit = source.limit(); // save the old source limit change to new one +- source.limit(sourceLimit); ++ ((Buffer)source).limit(sourceLimit); + err = myConverterData.currentDecoder.cnvMBCSToUnicodeWithOffsets(source, target, offsets, flush); +- source.limit(oldSourceLimit); // restore source limit; ++ ((Buffer)source).limit(oldSourceLimit); // restore source limit; + if (offsets != null && sourceStart != argSource) { + /* update offsets to base them on the actual start of the input */ + int delta = argSource - sourceStart; +@@ -1770,7 +1771,7 @@ class CharsetISO2022 extends CharsetICU + /* test the following code unit */ + char trail = source.get(); + /* go back to the previous position */ +- source.position(source.position()-1); ++ ((Buffer)source).position(source.position()-1); + if (UTF16.isTrailSurrogate(trail)) { + source.get(); + sourceChar = UCharacter.getCodePoint(sourceChar, trail); +@@ -2277,7 +2278,7 @@ class CharsetISO2022 extends CharsetICU + if (source.hasRemaining()) { + /* test the following code unit */ + char trail = source.get(); +- source.position(source.position()-1); ++ ((Buffer)source).position(source.position()-1); + if (UTF16.isTrailSurrogate(trail)) { + source.get(); + sourceChar = UCharacter.getCodePoint(sourceChar, trail); +@@ -2777,7 +2778,7 @@ class CharsetISO2022 extends CharsetICU + if (source.hasRemaining()) { + /* test the following code unit */ + char trail = source.get(); +- source.position(source.position()-1); ++ ((Buffer)source).position(source.position()-1); + if (UTF16.isTrailSurrogate(trail)) { + source.get(); + sourceChar = UCharacter.getCodePoint(sourceChar, trail); +--- a/main/classes/charset/src/com/ibm/icu/charset/CharsetLMBCS.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/charset/src/com/ibm/icu/charset/CharsetLMBCS.java 2021-10-29 08:08:50.780614013 -0600 +@@ -8,6 +8,7 @@ + */ + package com.ibm.icu.charset; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.IntBuffer; +@@ -597,13 +598,13 @@ class CharsetLMBCS extends CharsetICU { + oldSourceLimit = source.limit(); + oldSourcePos = source.position(); + +- source.position(oldSourcePos + positionOffset); +- source.limit(source.position() + length); ++ ((Buffer)source).position(oldSourcePos + positionOffset); ++ ((Buffer)source).limit(source.position() + length); + + uniChar = extraInfo.decoder.simpleGetNextUChar(source, false); + +- source.limit(oldSourceLimit); +- source.position(oldSourcePos); ++ ((Buffer)source).limit(oldSourceLimit); ++ ((Buffer)source).position(oldSourcePos); + + return uniChar; + } +@@ -649,7 +650,7 @@ class CharsetLMBCS extends CharsetICU { + /* CHECK_SOURCE_LIMIT(1) */ + if (source.position() + 1 > source.limit()) { + err[0] = CoderResult.OVERFLOW; +- source.position(source.limit()); ++ ((Buffer)source).position(source.limit()); + return 0xFFFF; + } + C0C1byte = (short)(source.get() & UConverterConstants.UNSIGNED_BYTE_MASK); +@@ -658,7 +659,7 @@ class CharsetLMBCS extends CharsetICU { + /* CHECK_SOURCE_LIMIT(2) */ + if (source.position() + 2 > source.limit()) { + err[0] = CoderResult.OVERFLOW; +- source.position(source.limit()); ++ ((Buffer)source).position(source.limit()); + return 0xFFFF; + } + +@@ -673,7 +674,7 @@ class CharsetLMBCS extends CharsetICU { + /* CHECK_SOURCE_LIMIT(2) */ + if (source.position() + 2 > source.limit()) { + err[0] = CoderResult.OVERFLOW; +- source.position(source.limit()); ++ ((Buffer)source).position(source.limit()); + return 0xFFFF; + } + +@@ -693,7 +694,7 @@ class CharsetLMBCS extends CharsetICU { + /* CHECK_SOURCE_LIMIT(1) */ + if (source.position() + 1 > source.limit()) { + err[0] = CoderResult.OVERFLOW; +- source.position(source.limit()); ++ ((Buffer)source).position(source.limit()); + return 0xFFFF; + } + CurByte = (short)(source.get() & UConverterConstants.UNSIGNED_BYTE_MASK); +@@ -724,7 +725,7 @@ class CharsetLMBCS extends CharsetICU { + /* CHECK_SOURCE_LIMIT(0) */ + if (source.position() + 0 > source.limit()) { + err[0] = CoderResult.OVERFLOW; +- source.position(source.limit()); ++ ((Buffer)source).position(source.limit()); + return 0xFFFF; + } + +@@ -734,7 +735,7 @@ class CharsetLMBCS extends CharsetICU { + /* CHECK_SOURCE_LIMIT(1) */ + if (source.position() + 1 > source.limit()) { + err[0] = CoderResult.OVERFLOW; +- source.position(source.limit()); ++ ((Buffer)source).position(source.limit()); + return 0xFFFF; + } + +@@ -781,9 +782,9 @@ class CharsetLMBCS extends CharsetICU { + } + } + tmpSourceBuffer = ByteBuffer.wrap(LMBCS); +- tmpSourceBuffer.limit(savebytes); ++ ((Buffer)tmpSourceBuffer).limit(savebytes); + uniChar = (char)LMBCSGetNextUCharWorker(tmpSourceBuffer, err); +- source.position(saveSource + tmpSourceBuffer.position() - size_old); ++ ((Buffer)source).position(saveSource + tmpSourceBuffer.position() - size_old); + errSource = saveSource - size_old; + + if (err[0].isOverflow()) { /* err == U_TRUNCATED_CHAR_FOUND */ +@@ -792,7 +793,7 @@ class CharsetLMBCS extends CharsetICU { + for (int i = 0; i < savebytes; i++) { + toUBytesArray[i] = LMBCS[i]; + } +- source.position(source.limit()); ++ ((Buffer)source).position(source.limit()); + err[0] = CoderResult.UNDERFLOW; + return err[0]; + } else { +--- a/main/classes/charset/src/com/ibm/icu/charset/CharsetMBCS.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/charset/src/com/ibm/icu/charset/CharsetMBCS.java 2021-10-29 08:08:50.783614013 -0600 +@@ -1458,7 +1458,7 @@ class CharsetMBCS extends CharsetICU { + // TODO: It is very inefficient to create Buffer objects for each array access. + // We should create an inner class Extensions (or sibling class CharsetMBCSExtensions) + // which has buffers for the arrays, together with the code that works with them. +- indexes.position(indexes.getInt(index << 2)); ++ ((Buffer)indexes).position(indexes.getInt(index << 2)); + if (itemType == int.class) + b = indexes.asIntBuffer(); + else if (itemType == char.class) +@@ -1468,12 +1468,12 @@ class CharsetMBCS extends CharsetICU { + else + // default or (itemType == byte.class) + b = indexes.slice(); +- indexes.position(oldpos); ++ ((Buffer)indexes).position(oldpos); + return b; + } + + private static int GET_MAX_BYTES_PER_UCHAR(ByteBuffer indexes) { +- indexes.position(0); ++ ((Buffer)indexes).position(0); + return indexes.getInt(EXT_COUNT_BYTES) & 0xff; + } + +@@ -1649,7 +1649,7 @@ class CharsetMBCS extends CharsetICU { + if (match > 0) { + if (match >= preToULength) { + /* advance src pointer for the consumed input */ +- source.position(source.position() + match - preToULength); ++ ((Buffer)source).position(source.position() + match - preToULength); + preToULength = 0; + } else { + /* the match did not use all of preToU[] - keep the rest for replay */ +@@ -1670,7 +1670,7 @@ class CharsetMBCS extends CharsetICU { + for (j = preToULength; j < match; ++j) { + preToUArray[j] = source.get(sArrayIndex++); + } +- source.position(sArrayIndex); /* same as *src=srcLimit; because we reached the end of input */ ++ ((Buffer)source).position(sArrayIndex); /* same as *src=srcLimit; because we reached the end of input */ + preToULength = (byte) match; + } else /* match==0 */{ + /* +@@ -1753,7 +1753,7 @@ class CharsetMBCS extends CharsetICU { + for (;;) { + /* go to the next section */ + int oldpos = toUTable.position(); +- toUSection = ((IntBuffer) toUTable.position(index)).slice(); ++ toUSection = toUTable.position(index).slice(); + toUTable.position(oldpos); + + /* read first pair of the section */ +@@ -1829,7 +1829,7 @@ class CharsetMBCS extends CharsetICU { + + char[] a = new char[TO_U_GET_LENGTH(value)]; + CharBuffer cb = ((CharBuffer) ARRAY(cx, EXT_TO_U_UCHARS_INDEX, char.class)); +- cb.position(TO_U_GET_INDEX(value)); ++ ((Buffer)cb).position(TO_U_GET_INDEX(value)); + cb.get(a, 0, a.length); + return toUWriteUChars(this, a, 0, a.length, target, offsets, srcIndex); + } +@@ -1925,7 +1925,7 @@ class CharsetMBCS extends CharsetICU { + value, isToUUseFallback(), flush); + if (match > 0) { + /* advance src pointer for the consumed input */ +- source.position(source.position() + match - firstLength); ++ ((Buffer)source).position(source.position() + match - firstLength); + + /* write result to target */ + cr[0] = writeToU(value[0], target, offsets, srcIndex); +@@ -1950,7 +1950,7 @@ class CharsetMBCS extends CharsetICU { + for (; j < match; ++j) { + preToUArray[j] = source.get(sArrayIndex++); + } +- source.position(sArrayIndex); ++ ((Buffer)source).position(sArrayIndex); + preToULength = (byte) match; + return true; + } else /* match==0 no match */{ +@@ -2330,7 +2330,7 @@ class CharsetMBCS extends CharsetICU { + } else /* unassigned sequences indicated with byteIndex>0 */{ + /* try an extension mapping */ + int sourceBeginIndex = sourceArrayIndex; +- source.position(sourceArrayIndex); ++ ((Buffer)source).position(sourceArrayIndex); + byteIndex = toU(byteIndex, source, target, offsets, sourceIndex, flush, cr); + sourceArrayIndex = source.position(); + sourceIndex = nextSourceIndex += (sourceArrayIndex - sourceBeginIndex); +@@ -2348,7 +2348,7 @@ class CharsetMBCS extends CharsetICU { + toULength = byteIndex; + + /* write back the updated pointers */ +- source.position(sourceArrayIndex); ++ ((Buffer)source).position(sourceArrayIndex); + + return cr[0]; + } +@@ -2446,7 +2446,7 @@ class CharsetMBCS extends CharsetICU { + /* try an extension mapping */ + lastSource = sourceArrayIndex; + toUBytesArray[0] = source.get(sourceArrayIndex - 1); +- source.position(sourceArrayIndex); ++ ((Buffer)source).position(sourceArrayIndex); + toULength = toU((byte) 1, source, target, offsets, sourceIndex, flush, cr); + sourceArrayIndex = source.position(); + sourceIndex += 1 + (sourceArrayIndex - lastSource); +@@ -2480,7 +2480,7 @@ class CharsetMBCS extends CharsetICU { + } + + /* write back the updated pointers */ +- source.position(sourceArrayIndex); ++ ((Buffer)source).position(sourceArrayIndex); + + return cr[0]; + } +@@ -2600,7 +2600,7 @@ class CharsetMBCS extends CharsetICU { + /* try an extension mapping */ + int sourceBeginIndex = sourceArrayIndex; + toUBytesArray[0] = source.get(sourceArrayIndex - 1); +- source.position(sourceArrayIndex); ++ ((Buffer)source).position(sourceArrayIndex); + toULength = toU((byte) 1, source, target, offsets, sourceIndex, flush, cr); + sourceArrayIndex = source.position(); + sourceIndex += 1 + (sourceArrayIndex - sourceBeginIndex); +@@ -2613,7 +2613,7 @@ class CharsetMBCS extends CharsetICU { + } + + /* write back the updated pointers */ +- source.position(sourceArrayIndex); ++ ((Buffer)source).position(sourceArrayIndex); + + return cr[0]; + } +@@ -2772,7 +2772,7 @@ class CharsetMBCS extends CharsetICU { + if (sharedData.mbcs.extIndexes != null) { + /* Increase the limit for proper handling. Used in LMBCS. */ + if (source.limit() > i + length) { +- source.limit(i + length); ++ ((Buffer)source).limit(i + length); + } + return simpleMatchToU(source, useFallback); + } +@@ -3358,7 +3358,7 @@ class CharsetMBCS extends CharsetICU { + fromUChar32 = c; + fromUnicodeStatus = prevLength; + +- source.position(sourceArrayIndex); ++ ((Buffer)source).position(sourceArrayIndex); + } catch (BufferOverflowException ex) { + cr[0] = CoderResult.OVERFLOW; + } +@@ -3533,7 +3533,7 @@ class CharsetMBCS extends CharsetICU { + + if (match >= preFromULength) { + /* advance src pointer for the consumed input */ +- source.position(source.position() + match - preFromULength); ++ ((Buffer)source).position(source.position() + match - preFromULength); + preFromULength = 0; + } else { + /* the match did not use all of preFromU[] - keep the rest for replay */ +@@ -3558,7 +3558,7 @@ class CharsetMBCS extends CharsetICU { + for (j = preFromULength; j < match; ++j) { + preFromUArray[j] = source.get(sArrayIndex++); + } +- source.position(sArrayIndex); /* same as *src=srcLimit; because we reached the end of input */ ++ ((Buffer)source).position(sArrayIndex); /* same as *src=srcLimit; because we reached the end of input */ + preFromULength = (byte) match; + } else { /* match==0 or 1 */ + /* +@@ -3672,10 +3672,10 @@ class CharsetMBCS extends CharsetICU { + for (;;) { + /* go to the next section */ + int oldpos = fromUTableUChars.position(); +- fromUSectionUChars = ((CharBuffer) fromUTableUChars.position(index)).slice(); +- fromUTableUChars.position(oldpos); ++ fromUSectionUChars = ((CharBuffer) ((Buffer)fromUTableUChars).position(index)).slice(); ++ ((Buffer)fromUTableUChars).position(oldpos); + oldpos = fromUTableValues.position(); +- fromUSectionValues = ((IntBuffer) fromUTableValues.position(index)).slice(); ++ fromUSectionValues = fromUTableValues.position(index).slice(); + fromUTableValues.position(oldpos); + + /* read first pair of the section */ +@@ -3835,7 +3835,7 @@ class CharsetMBCS extends CharsetICU { + byte[] slice = new byte[length]; + + ByteBuffer bb = ((ByteBuffer) ARRAY(cx, EXT_FROM_U_BYTES_INDEX, byte.class)); +- bb.position(value); ++ ((Buffer)bb).position(value); + bb.get(slice, 0, slice.length); + + resultArray = slice; +@@ -3943,7 +3943,7 @@ class CharsetMBCS extends CharsetICU { + if (match >= 2 + && !(FROM_U_GET_LENGTH(value[0]) == 1 && sharedData.mbcs.outputType == MBCS_OUTPUT_DBCS_ONLY)) { + /* advance src pointer for the consumed input */ +- source.position(source.position() + match - 2); /* remove 2 for the initial code point */ ++ ((Buffer)source).position(source.position() + match - 2); /* remove 2 for the initial code point */ + + /* write result to target */ + cr[0] = writeFromU(value[0], target, offsets, srcIndex); +@@ -3962,7 +3962,7 @@ class CharsetMBCS extends CharsetICU { + for (j = 0; j < match; ++j) { + preFromUArray[j] = source.get(sArrayIndex++); + } +- source.position(sArrayIndex); /* same as *src=srcLimit; because we reached the end of input */ ++ ((Buffer)source).position(sArrayIndex); /* same as *src=srcLimit; because we reached the end of input */ + preFromULength = (byte) match; + return true; + } else if (match == 1) { +@@ -4102,7 +4102,7 @@ class CharsetMBCS extends CharsetICU { + + /* try an extension mapping */ + lastSource = sourceArrayIndex; +- source.position(sourceArrayIndex); ++ ((Buffer)source).position(sourceArrayIndex); + c = fromU(c, source, target, offsets, sourceIndex, length, flush, cr); + sourceArrayIndex = source.position(); + sourceIndex += length + (sourceArrayIndex - lastSource); +@@ -4142,7 +4142,7 @@ class CharsetMBCS extends CharsetICU { + fromUChar32 = c; + + /* write back the updated pointers */ +- source.position(sourceArrayIndex); ++ ((Buffer)source).position(sourceArrayIndex); + + return cr[0]; + } +@@ -4292,7 +4292,7 @@ class CharsetMBCS extends CharsetICU { + fromUChar32 = c; + + /* write back the updated pointers */ +- source.position(sourceArrayIndex); ++ ((Buffer)source).position(sourceArrayIndex); + + return cr[0]; + } +@@ -4482,7 +4482,7 @@ class CharsetMBCS extends CharsetICU { + fromUChar32 = c; + + /* write back the updated pointers */ +- source.position(sourceArrayIndex); ++ ((Buffer)source).position(sourceArrayIndex); + + return cr[0]; + } +@@ -4576,7 +4576,7 @@ class CharsetMBCS extends CharsetICU { + boolean flush, CoderResult[] cr) { + /* try an extension mapping */ + int sourceBegin = x.sourceArrayIndex; +- source.position(x.sourceArrayIndex); ++ ((Buffer)source).position(x.sourceArrayIndex); + x.c = fromU(x.c, source, target, null, x.sourceIndex, x.nextSourceIndex, flush, cr); + x.sourceArrayIndex = source.position(); + x.nextSourceIndex += x.sourceArrayIndex - sourceBegin; +@@ -4649,7 +4649,7 @@ class CharsetMBCS extends CharsetICU { + boolean flush, CoderResult[] cr) { + /* try an extension mapping */ + int sourceBegin = x.sourceArrayIndex; +- source.position(x.sourceArrayIndex); ++ ((Buffer)source).position(x.sourceArrayIndex); + x.c = fromU(x.c, source, target, null, x.sourceIndex, x.nextSourceIndex, flush, cr); + x.sourceArrayIndex = source.position(); + x.nextSourceIndex += x.sourceArrayIndex - sourceBegin; +--- a/main/classes/charset/src/com/ibm/icu/charset/CharsetSCSU.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/charset/src/com/ibm/icu/charset/CharsetSCSU.java 2021-10-29 08:08:50.784614013 -0600 +@@ -8,6 +8,7 @@ + */ + package com.ibm.icu.charset; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.IntBuffer; +@@ -293,7 +294,7 @@ class CharsetSCSU extends CharsetICU{ + + if(state==readCommand){ + while(source.hasRemaining() && target.hasRemaining() && (b=(short)(source.get(source.position()) & UConverterConstants.UNSIGNED_BYTE_MASK)) >= 0x20){ +- source.position(source.position()+1); ++ ((Buffer)source).position(source.position()+1); + ++nextSourceIndex; + if(b <= 0x7f){ + /*Write US graphic character or DEL*/ +--- a/main/classes/charset/src/com/ibm/icu/charset/CharsetUTF16.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/charset/src/com/ibm/icu/charset/CharsetUTF16.java 2021-10-29 08:08:50.785614013 -0600 +@@ -8,6 +8,7 @@ + */ + package com.ibm.icu.charset; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.IntBuffer; +@@ -212,7 +213,7 @@ class CharsetUTF16 extends CharsetICU { + if (!UTF16.isTrailSurrogate(trail)) { + // pretend like we didn't read the last 2 bytes + toULength = 2; +- source.position(source.position() - 2); ++ ((Buffer)source).position(source.position() - 2); + + // 2 bytes, lead malformed + toUnicodeStatus = 0; +--- a/main/classes/charset/src/com/ibm/icu/charset/CharsetUTF7.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/charset/src/com/ibm/icu/charset/CharsetUTF7.java 2021-10-29 08:08:50.785614013 -0600 +@@ -8,6 +8,7 @@ + */ + package com.ibm.icu.charset; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.IntBuffer; +@@ -302,7 +303,7 @@ class CharsetUTF7 extends CharsetICU { + if(base64Counter==-1) { + /* illegal: + immediately followed by something other than base64 or minus sign */ + /* include the plus sign in the reported sequence, but not the subsequent char */ +- source.position(source.position() -1); ++ ((Buffer)source).position(source.position() -1); + toUBytesArray[0]=PLUS; + byteIndex=1; + cr=CoderResult.malformedForLength(sourceArrayIndex); +@@ -310,7 +311,7 @@ class CharsetUTF7 extends CharsetICU { + } else if(bits!=0) { + /* bits are illegally left over, a UChar is incomplete */ + /* don't include current char (legal or illegal) in error seq */ +- source.position(source.position() -1); ++ ((Buffer)source).position(source.position() -1); + --byteIndex; + cr=CoderResult.malformedForLength(sourceArrayIndex); + break directMode; +@@ -322,7 +323,7 @@ class CharsetUTF7 extends CharsetICU { + break directMode; + } else { + /* un-read the current character in case it is a plus sign */ +- source.position(source.position() -1); ++ ((Buffer)source).position(source.position() -1); + sourceIndex=nextSourceIndex-1; + continue directMode; + } +@@ -555,7 +556,7 @@ class CharsetUTF7 extends CharsetICU { + } + } else { + /* un-read this character and switch to unicode mode */ +- source.position(source.position() - 1); ++ ((Buffer)source).position(source.position() - 1); + target.put(useIMAP ? AMPERSAND : PLUS); + if (offsets != null) { + offsets.put(sourceIndex); +@@ -581,7 +582,7 @@ class CharsetUTF7 extends CharsetICU { + inDirectMode=1; + + /* trick: back out this character to make this easier */ +- source.position(source.position() - 1); ++ ((Buffer)source).position(source.position() - 1); + + /* terminate the base64 sequence */ + if (base64Counter!=0) { +--- a/main/classes/charset/src/com/ibm/icu/charset/CharsetUTF8.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/charset/src/com/ibm/icu/charset/CharsetUTF8.java 2021-10-29 08:08:50.786614013 -0600 +@@ -11,6 +11,7 @@ + + package com.ibm.icu.charset; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.IntBuffer; +@@ -359,8 +360,8 @@ class CharsetUTF8 extends CharsetICU { + srcIdx = sourceIndex; + tgtIdx = targetIndex; + if (cr != null) { +- source.position(srcIdx - source.arrayOffset()); +- target.position(tgtIdx - target.arrayOffset()); ++ ((Buffer)source).position(srcIdx - source.arrayOffset()); ++ ((Buffer)target).position(tgtIdx - target.arrayOffset()); + return cr; + } + } +@@ -432,8 +433,8 @@ class CharsetUTF8 extends CharsetICU { + } + + /* set the new source and target positions and return the CoderResult stored in cr */ +- source.position(srcIdx - source.arrayOffset()); +- target.position(tgtIdx - target.arrayOffset()); ++ ((Buffer)source).position(srcIdx - source.arrayOffset()); ++ ((Buffer)target).position(tgtIdx - target.arrayOffset()); + return cr; + + } else { +--- a/main/classes/charset/src/com/ibm/icu/charset/UConverterDataReader.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/charset/src/com/ibm/icu/charset/UConverterDataReader.java 2021-10-29 08:08:50.787614013 -0600 +@@ -10,6 +10,7 @@ + package com.ibm.icu.charset; + + import java.io.IOException; ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.IntBuffer; +@@ -595,7 +596,7 @@ final class UConverterDataReader { + throw new InvalidFormatException(); + } + int numBytesExtensionStructure = b.getInt(31 * 4); +- b.limit(numBytesExtensionStructure); ++ ((Buffer)b).limit(numBytesExtensionStructure); + ICUBinary.skipBytes(byteBuffer, numBytesExtensionStructure); + return b; + } +--- a/main/classes/core/src/com/ibm/icu/impl/ICUBinary.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/core/src/com/ibm/icu/impl/ICUBinary.java 2021-10-29 08:08:50.788614013 -0600 +@@ -15,6 +15,7 @@ import java.io.FileInputStream; + import java.io.FileNotFoundException; + import java.io.IOException; + import java.io.InputStream; ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.ByteOrder; + import java.nio.channels.FileChannel; +@@ -94,8 +95,8 @@ public final class ICUBinary { + int index = binarySearch(bytes, key); + if (index >= 0) { + ByteBuffer data = bytes.duplicate(); +- data.position(getDataOffset(bytes, index)); +- data.limit(getDataOffset(bytes, index + 1)); ++ ((Buffer)data).position(getDataOffset(bytes, index)); ++ ((Buffer)data).limit(getDataOffset(bytes, index + 1)); + return ICUBinary.sliceWithOrder(data); + } else { + return null; +@@ -609,7 +610,7 @@ public final class ICUBinary { + formatVersion[2] & 0xff, formatVersion[3] & 0xff)); + } + +- bytes.position(headerSize); ++ ((Buffer)bytes).position(headerSize); + return // dataVersion + (bytes.get(20) << 24) | + ((bytes.get(21) & 0xff) << 16) | +@@ -648,7 +649,7 @@ public final class ICUBinary { + + public static void skipBytes(ByteBuffer bytes, int skipLength) { + if (skipLength > 0) { +- bytes.position(bytes.position() + skipLength); ++ ((Buffer)bytes).position(bytes.position() + skipLength); + } + } + +--- a/main/classes/core/src/com/ibm/icu/impl/ICUResourceBundleReader.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/core/src/com/ibm/icu/impl/ICUResourceBundleReader.java 2021-10-29 08:08:50.789614013 -0600 +@@ -11,6 +11,7 @@ package com.ibm.icu.impl; + import java.io.IOException; + import java.io.InputStream; + import java.lang.ref.SoftReference; ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.IntBuffer; +@@ -294,7 +295,7 @@ public final class ICUResourceBundleRead + // unlike regular bundles' key strings for which indexes + // are based on the start of the bundle data. + keyBytes = new byte[(keysTop - keysBottom) << 2]; +- bytes.position(keysBottom << 2); ++ ((Buffer)bytes).position(keysBottom << 2); + } else { + localKeyLimit = keysTop << 2; + keyBytes = new byte[localKeyLimit]; +@@ -307,9 +308,9 @@ public final class ICUResourceBundleRead + int _16BitTop = getIndexesInt(URES_INDEX_16BIT_TOP); + if(_16BitTop > keysTop) { + int num16BitUnits = (_16BitTop - keysTop) * 2; +- bytes.position(keysTop << 2); ++ ((Buffer)bytes).position(keysTop << 2); + b16BitUnits = bytes.asCharBuffer(); +- b16BitUnits.limit(num16BitUnits); ++ ((Buffer)b16BitUnits).limit(num16BitUnits); + maxOffset |= num16BitUnits - 1; + } else { + b16BitUnits = EMPTY_16_BIT_UNITS; +@@ -327,7 +328,7 @@ public final class ICUResourceBundleRead + } + + // Reset the position for future .asCharBuffer() etc. +- bytes.position(0); ++ ((Buffer)bytes).position(0); + } + + private int getIndexesInt(int i) { +@@ -387,7 +388,7 @@ public final class ICUResourceBundleRead + } + } else { + CharBuffer temp = bytes.asCharBuffer(); +- temp.position(offset / 2); ++ ((Buffer)temp).position(offset / 2); + temp.get(chars); + } + return chars; +@@ -403,7 +404,7 @@ public final class ICUResourceBundleRead + } + } else { + IntBuffer temp = bytes.asIntBuffer(); +- temp.position(offset / 4); ++ ((Buffer)temp).position(offset / 4); + temp.get(ints); + } + return ints; +@@ -418,7 +419,7 @@ public final class ICUResourceBundleRead + } + } else { + CharBuffer temp = b16BitUnits.duplicate(); +- temp.position(offset); ++ ((Buffer)temp).position(offset); + temp.get(result); + } + return result; +@@ -665,7 +666,7 @@ public final class ICUResourceBundleRead + } + } else { + ByteBuffer temp = bytes.duplicate(); +- temp.position(offset); ++ ((Buffer)temp).position(offset); + temp.get(ba); + } + return ba; +@@ -696,7 +697,7 @@ public final class ICUResourceBundleRead + } + offset += 4; + ByteBuffer result = bytes.duplicate(); +- result.position(offset).limit(offset + length); ++ ((Buffer)result).position(offset).limit(offset + length); + result = ICUBinary.sliceWithOrder(result); + if(!result.isReadOnly()) { + result = result.asReadOnlyBuffer(); +--- a/main/classes/core/src/com/ibm/icu/impl/RBBIDataWrapper.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/core/src/com/ibm/icu/impl/RBBIDataWrapper.java 2021-10-29 08:08:50.790614013 -0600 +@@ -11,6 +11,7 @@ package com.ibm.icu.impl; + + import java.io.DataOutputStream; + import java.io.IOException; ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.charset.StandardCharsets; + import java.util.Arrays; +@@ -361,7 +362,7 @@ public final class RBBIDataWrapper { + ICUBinary.skipBytes(bytes, This.fHeader.fTrie - pos); // seek buffer from end of + pos = This.fHeader.fTrie; // previous section to the start of the trie + +- bytes.mark(); // Mark position of start of TRIE in the input ++ ((Buffer)bytes).mark(); // Mark position of start of TRIE in the input + // and tell Java to keep the mark valid so long + // as we don't go more than 100 bytes past the + // past the end of the TRIE. +@@ -373,7 +374,7 @@ public final class RBBIDataWrapper { + // at an unknown position, preceding the + // padding between TRIE and following section. + +- bytes.reset(); // Move buffer back to marked position at ++ ((Buffer)bytes).reset(); // Move buffer back to marked position at + // the start of the serialized TRIE. Now our + // "pos" variable and the buffer are in + // agreement. +--- a/main/classes/core/src/com/ibm/icu/text/SpoofChecker.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/classes/core/src/com/ibm/icu/text/SpoofChecker.java 2021-10-29 08:08:50.791614013 -0600 +@@ -14,6 +14,7 @@ package com.ibm.icu.text; + import java.io.IOException; + import java.io.LineNumberReader; + import java.io.Reader; ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.text.ParseException; + import java.util.ArrayList; +@@ -1877,7 +1878,7 @@ public class SpoofChecker { + // A ByteBuffer is what the ICU internal data loading functions provide. + private SpoofData(ByteBuffer bytes) throws java.io.IOException { + ICUBinary.readHeader(bytes, DATA_FORMAT, IS_ACCEPTABLE); +- bytes.mark(); ++ ((Buffer)bytes).mark(); + readData(bytes); + } + +@@ -1930,15 +1931,15 @@ public class SpoofChecker { + // of the data items. Now read each in turn, first seeking the + // input stream to the position of the data item. + +- bytes.reset(); ++ ((Buffer)bytes).reset(); + ICUBinary.skipBytes(bytes, CFUKeysOffset); + fCFUKeys = ICUBinary.getInts(bytes, CFUKeysSize, 0); + +- bytes.reset(); ++ ((Buffer)bytes).reset(); + ICUBinary.skipBytes(bytes, CFUValuesOffset); + fCFUValues = ICUBinary.getShorts(bytes, CFUValuesSize, 0); + +- bytes.reset(); ++ ((Buffer)bytes).reset(); + ICUBinary.skipBytes(bytes, CFUStringTableOffset); + fCFUStrings = ICUBinary.getString(bytes, CFUStringTableSize, 0); + } +--- a/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestCharset.java 2021-10-28 00:02:09.000000000 -0600 ++++ b/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestCharset.java 2021-10-29 08:10:04.130616650 -0600 +@@ -9,6 +9,7 @@ + + package com.ibm.icu.dev.test.charset; + ++import java.nio.Buffer; + import java.nio.BufferOverflowException; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; +@@ -107,30 +108,30 @@ public class TestCharset extends TestFmw + } + + +- us.limit(us.position()); +- us.position(0); ++ ((Buffer)us).limit(us.position()); ++ ((Buffer)us).position(0); + if(us.length()==0){ + continue; + } + + +- bs1.limit(bs1.position()); +- bs1.position(0); ++ ((Buffer)bs1).limit(bs1.position()); ++ ((Buffer)bs1).position(0); + ByteBuffer newBS = ByteBuffer.allocate(bs1.capacity()); + //newBS.put((byte)0xFE); + //newBS.put((byte)0xFF); + newBS.put(bs1); +- bs1.position(0); ++ ((Buffer)bs1).position(0); + smBufDecode(d1, "UTF-16", bs1, us); + smBufEncode(e1, "UTF-16", us, newBS); + +- bs2.limit(bs2.position()); +- bs2.position(0); +- newBS.clear(); ++ ((Buffer)bs2).limit(bs2.position()); ++ ((Buffer)bs2).position(0); ++ ((Buffer)newBS).clear(); + //newBS.put((byte)0xFF); + //newBS.put((byte)0xFE); + newBS.put(bs2); +- bs2.position(0); ++ ((Buffer)bs2).position(0); + smBufDecode(d2, "UTF16-LE", bs2, us); + smBufEncode(e2, "UTF-16LE", us, newBS); + +@@ -178,12 +179,12 @@ public class TestCharset extends TestFmw + bs2.put((byte) (c >>> 16)); + bs2.put((byte) (c >>> 24)); + } +- bs1.limit(bs1.position()); +- bs1.position(0); +- bs2.limit(bs2.position()); +- bs2.position(0); +- us.limit(us.position()); +- us.position(0); ++ ((Buffer)bs1).limit(bs1.position()); ++ ((Buffer)bs1).position(0); ++ ((Buffer)bs2).limit(bs2.position()); ++ ((Buffer)bs2).position(0); ++ ((Buffer)us).limit(us.position()); ++ ((Buffer)us).position(0); + if(us.length()==0){ + continue; + } +@@ -197,12 +198,12 @@ public class TestCharset extends TestFmw + newBS.put((byte)0xFF); + + newBS.put(bs1); +- bs1.position(0); ++ ((Buffer)bs1).position(0); + smBufDecode(d1, "UTF-32", bs1, us); + smBufEncode(e1, "UTF-32", us, newBS); + + +- newBS.clear(); ++ ((Buffer)newBS).clear(); + + newBS.put((byte)0xFF); + newBS.put((byte)0xFE); +@@ -210,7 +211,7 @@ public class TestCharset extends TestFmw + newBS.put((byte)0x00); + + newBS.put(bs2); +- bs2.position(0); ++ ((Buffer)bs2).position(0); + smBufDecode(d2, "UTF-32LE", bs2, us); + smBufEncode(e2, "UTF-32LE", us, newBS); + +@@ -449,7 +450,7 @@ public class TestCharset extends TestFmw + for (int index = 0; index < input.length; index++) { + CharBuffer source = CharBuffer.wrap(input[index]); + cr = encoder.encode(source, bs, true); +- bs.rewind(); ++ ((Buffer)bs).rewind(); + encoder.reset(); + + // if cr != results[x] +@@ -464,7 +465,7 @@ public class TestCharset extends TestFmw + + source = CharBuffer.wrap(input[index].toCharArray()); + cr = encoder.encode(source, bs, true); +- bs.rewind(); ++ ((Buffer)bs).rewind(); + encoder.reset(); + + // if cr != results[x] +@@ -563,8 +564,8 @@ public class TestCharset extends TestFmw + + decoder.reset(); + cr = decoder.decode(bs, us, true); +- bs.rewind(); +- us.rewind(); ++ ((Buffer)bs).rewind(); ++ ((Buffer)us).rewind(); + if (!cr.isMalformed() || cr.length() != 1) { + errln("Incorrect result in " + converter + " decoder for 0x" + + Integer.toHexString(i) + " received " + cr); +@@ -572,8 +573,8 @@ public class TestCharset extends TestFmw + } + encoder.reset(); + cr = encoder.encode(us, bs, true); +- bs.rewind(); +- us.rewind(); ++ ((Buffer)bs).rewind(); ++ ((Buffer)us).rewind(); + if (!cr.isMalformed() || cr.length() != 1) { + errln("Incorrect result in " + converter + " encoder for 0x" + + Integer.toHexString(i) + " received " + cr); +@@ -585,8 +586,8 @@ public class TestCharset extends TestFmw + + decoder.reset(); + cr = decoder.decode(bs, us, true); +- bs.rewind(); +- us.rewind(); ++ ((Buffer)bs).rewind(); ++ ((Buffer)us).rewind(); + if (!cr.isMalformed() || cr.length() != 1) { + errln("Incorrect result in " + converter + " decoder for 0x" + + Integer.toHexString(i) + " received " + cr); +@@ -594,8 +595,8 @@ public class TestCharset extends TestFmw + } + encoder.reset(); + cr = encoder.encode(us, bs, true); +- bs.rewind(); +- us.rewind(); ++ ((Buffer)bs).rewind(); ++ ((Buffer)us).rewind(); + if (!cr.isMalformed() || cr.length() != 1) { + errln("Incorrect result in " + converter + " encoder for 0x" + + Integer.toHexString(i) + " received " + cr); +@@ -669,9 +670,9 @@ public class TestCharset extends TestFmw + int ccPositions[] = { 0, 0, 0, 2, 2 }; + for (int i = 0; i < testLoopSize; i++) { + encoder.reset(); +- bb.limit(bbLimits[i]); +- bb.position(bbPositions[i]); +- cb.position(ccPositions[i]); ++ ((Buffer)bb).limit(bbLimits[i]); ++ ((Buffer)bb).position(bbPositions[i]); ++ ((Buffer)cb).position(ccPositions[i]); + result = encoder.encode(cb, bb, true); + + if (i < 3) { +@@ -838,7 +839,7 @@ public class TestCharset extends TestFmw + encoder.onUnmappableCharacter(CodingErrorAction.REPORT); + encoder.onMalformedInput(CodingErrorAction.REPORT); + for (int i=0; i target.capacity()) { + //target has reached its limit, an error occurred or test case has an error code +@@ -736,7 +737,7 @@ public class TestConversion extends Test + //due to limitation of the API we need to check for target limit for expected + if (target.position() != cc.unicode.length()) { + if (target.limit() != cc.unicode.length()) { +- target.limit(cc.unicode.length()); ++ ((Buffer)target).limit(cc.unicode.length()); + } + cr = decoder.flush(target); + if (cr.isError()) { +@@ -765,14 +766,14 @@ public class TestConversion extends Test + // convert + if ((step & 1) != 0 /* odd: -1, -3, -5, ... */) { + +- target.limit(target.position() < target.capacity() ? target ++ ((Buffer)target).limit(target.position() < target.capacity() ? target + .position() + 1 : target.capacity()); + + // decode behavior is return to output target 1 character + CoderResult cr = null; + + //similar to getNextUChar() , input is the whole string, while outputs only 1 character +- source.limit(sourceLen); ++ ((Buffer)source).limit(sourceLen); + while (target.position() != target.limit() + && source.hasRemaining()) { + cr = decoder.decode(source, target, +@@ -786,7 +787,7 @@ public class TestConversion extends Test + break; + } else { + //1 character has been consumed +- target.limit(target.position() + 1); ++ ((Buffer)target).limit(target.position() + 1); + break; + } + } else if (cr.isError()) { +@@ -801,7 +802,7 @@ public class TestConversion extends Test + else { + // one character has been consumed + if (target.limit() == target.position()) { +- target.limit(target.position() + 1); ++ ((Buffer)target).limit(target.position() + 1); + break; + } + } +@@ -814,7 +815,7 @@ public class TestConversion extends Test + cr = decoder.decode(source, target, true); + if (target.position() != cc.unicode.length()) { + +- target.limit(cc.unicode.length()); ++ ((Buffer)target).limit(cc.unicode.length()); + cr = decoder.flush(target); + if (cr.isError()) { + errln("Flush operation failed"); +@@ -829,14 +830,14 @@ public class TestConversion extends Test + } else {/* step is even */ + // allow only one UChar output + +- target.limit(target.position() < target.capacity() ? target ++ ((Buffer)target).limit(target.position() < target.capacity() ? target + .position() + 1 : target.capacity()); + if (step == -2) { +- source.limit(sourceLen); ++ ((Buffer)source).limit(sourceLen); + } else { +- source.limit(source.position() + (-step - 2) / 2); ++ ((Buffer)source).limit(source.position() + (-step - 2) / 2); + if (source.limit() > sourceLen) { +- source.limit(sourceLen); ++ ((Buffer)source).limit(sourceLen); + } + } + CoderResult cr = decoder.decode(source, target, source +@@ -1003,43 +1004,43 @@ public class TestConversion extends Test + if (start[0] == (byte) 0xFE && start[1] == (byte) 0xFF) { + signatureLength = 2; + sigUniCharset = "UTF-16BE"; +- source.position(signatureLength); ++ ((Buffer)source).position(signatureLength); + return sigUniCharset; + } else if (start[0] == (byte) 0xFF && start[1] == (byte) 0xFE) { + if (start[2] == (byte) 0x00 && start[3] == (byte) 0x00) { + signatureLength = 4; + sigUniCharset = "UTF-32LE"; +- source.position(signatureLength); ++ ((Buffer)source).position(signatureLength); + return sigUniCharset; + } else { + signatureLength = 2; + sigUniCharset = "UTF-16LE"; +- source.position(signatureLength); ++ ((Buffer)source).position(signatureLength); + return sigUniCharset; + } + } else if (start[0] == (byte) 0xEF && start[1] == (byte) 0xBB + && start[2] == (byte) 0xBF) { + signatureLength = 3; + sigUniCharset = "UTF-8"; +- source.position(signatureLength); ++ ((Buffer)source).position(signatureLength); + return sigUniCharset; + } else if (start[0] == (byte) 0x00 && start[1] == (byte) 0x00 + && start[2] == (byte) 0xFE && start[3] == (byte) 0xFF) { + signatureLength = 4; + sigUniCharset = "UTF-32BE"; +- source.position(signatureLength); ++ ((Buffer)source).position(signatureLength); + return sigUniCharset; + } else if (start[0] == (byte) 0x0E && start[1] == (byte) 0xFE + && start[2] == (byte) 0xFF) { + signatureLength = 3; + sigUniCharset = "SCSU"; +- source.position(signatureLength); ++ ((Buffer)source).position(signatureLength); + return sigUniCharset; + } else if (start[0] == (byte) 0xFB && start[1] == (byte) 0xEE + && start[2] == (byte) 0x28) { + signatureLength = 3; + sigUniCharset = "BOCU-1"; +- source.position(signatureLength); ++ ((Buffer)source).position(signatureLength); + return sigUniCharset; + } else if (start[0] == (byte) 0x2B && start[1] == (byte) 0x2F + && start[2] == (byte) 0x76) { +@@ -1047,20 +1048,20 @@ public class TestConversion extends Test + if (start[3] == (byte) 0x38 && start[4] == (byte) 0x2D) { + signatureLength = 5; + sigUniCharset = "UTF-7"; +- source.position(signatureLength); ++ ((Buffer)source).position(signatureLength); + return sigUniCharset; + } else if (start[3] == (byte) 0x38 || start[3] == (byte) 0x39 + || start[3] == (byte) 0x2B || start[3] == (byte) 0x2F) { + signatureLength = 4; + sigUniCharset = "UTF-7"; +- source.position(signatureLength); ++ ((Buffer)source).position(signatureLength); + return sigUniCharset; + } + } else if (start[0] == (byte) 0xDD && start[2] == (byte) 0x73 + && start[2] == (byte) 0x66 && start[3] == (byte) 0x73) { + signatureLength = 4; + sigUniCharset = "UTF-EBCDIC"; +- source.position(signatureLength); ++ ((Buffer)source).position(signatureLength); + return sigUniCharset; + } + +@@ -1074,7 +1075,7 @@ public class TestConversion extends Test + for (int i = 0; i < pos; i++) { + res += "(" + i + ")" + hex(buf.get(i) & 0xff).substring(2) + " "; + } +- buf.position(cur); ++ ((Buffer)buf).position(cur); + return res + "]"; + } + +@@ -1084,7 +1085,7 @@ public class TestConversion extends Test + for (int i = 0; i < pos; i++) { + res += "(" + i + ")" + hex(buf.get(i)) + " "; + } +- buf.position(cur); ++ ((Buffer)buf).position(cur); + return res + "]"; + } + +@@ -1092,9 +1093,9 @@ public class TestConversion extends Test + ByteBuffer output) { + + boolean res = true; +- expected.rewind(); +- output.limit(output.position()); +- output.rewind(); ++ ((Buffer)expected).rewind(); ++ ((Buffer)output).limit(output.position()); ++ ((Buffer)output).rewind(); + + // remove any BOM signature before checking + if (!cc.charset.contains("UnicodeLittle") && !cc.charset.contains("UnicodeBig")) { +@@ -1137,8 +1138,8 @@ public class TestConversion extends Test + private boolean checkResultsToUnicode(ConversionCase cc, String expected, CharBuffer output) { + + boolean res = true; +- output.limit(output.position()); +- output.rewind(); ++ ((Buffer)output).limit(output.position()); ++ ((Buffer)output).rewind(); + + // test to see if the conversion matches actual results + if (output.limit() != expected.length()) { +--- a/main/tests/core/src/com/ibm/icu/dev/test/util/ICUBinaryTest.java 2021-10-28 00:02:10.000000000 -0600 ++++ b/main/tests/core/src/com/ibm/icu/dev/test/util/ICUBinaryTest.java 2021-10-29 08:08:50.800614014 -0600 +@@ -10,6 +10,7 @@ + package com.ibm.icu.dev.test.util; + + import java.io.IOException; ++import java.nio.Buffer; + import java.nio.ByteBuffer; + + import org.junit.Test; +@@ -88,7 +89,7 @@ public final class ICUBinaryTest extends + } + // no restriction to the data version + try { +- bytes.rewind(); ++ ((Buffer)bytes).rewind(); + ICUBinary.readHeader(bytes, formatid, null); + } catch (IOException e) { + errln("Failed: Null authenticate object should pass ICUBinary.readHeader"); +@@ -96,7 +97,7 @@ public final class ICUBinaryTest extends + // lenient data version + array[17] = 9; + try { +- bytes.rewind(); ++ ((Buffer)bytes).rewind(); + ICUBinary.readHeader(bytes, formatid, authenticate); + } catch (IOException e) { + errln("Failed: Lenient authenticate object should pass ICUBinary.readHeader"); +@@ -104,7 +105,7 @@ public final class ICUBinaryTest extends + // changing the version to an incorrect one, expecting failure + array[16] = 2; + try { +- bytes.rewind(); ++ ((Buffer)bytes).rewind(); + ICUBinary.readHeader(bytes, formatid, authenticate); + errln("Failed: Invalid version number should not pass authenticate object"); + } catch (IOException e) { +--- a/perf-tests/src/com/ibm/icu/dev/test/perf/ConverterPerformanceTest.java 2021-10-28 00:02:10.000000000 -0600 ++++ b/perf-tests/src/com/ibm/icu/dev/test/perf/ConverterPerformanceTest.java 2021-10-29 08:08:50.801614013 -0600 +@@ -13,6 +13,7 @@ import java.io.ByteArrayOutputStream; + import java.io.FileInputStream; + import java.io.InputStreamReader; + import java.io.OutputStreamWriter; ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.charset.Charset; +@@ -214,8 +215,8 @@ public class ConverterPerformanceTest ex + try{ + decoder.decode(srcBuf,outBuf,false); + decoder.reset(); +- srcBuf.rewind(); +- outBuf.rewind(); ++ ((Buffer)srcBuf).rewind(); ++ ((Buffer)outBuf).rewind(); + }catch(Exception e){ + e.printStackTrace(); + throw new RuntimeException(e.getMessage()); +@@ -243,8 +244,8 @@ public class ConverterPerformanceTest ex + try{ + encoder.encode(srcBuf,outBuf,false); + encoder.reset(); +- srcBuf.rewind(); +- outBuf.rewind(); ++ ((Buffer)srcBuf).rewind(); ++ ((Buffer)outBuf).rewind(); + }catch(Exception e){ + e.printStackTrace(); + throw new RuntimeException(e.getMessage()); +@@ -272,8 +273,8 @@ public class ConverterPerformanceTest ex + try{ + decoder.decode(srcBuf,outBuf,false); + decoder.reset(); +- srcBuf.rewind(); +- outBuf.rewind(); ++ ((Buffer)srcBuf).rewind(); ++ ((Buffer)outBuf).rewind(); + }catch(Exception e){ + e.printStackTrace(); + throw new RuntimeException(e.getMessage()); +@@ -301,8 +302,8 @@ public class ConverterPerformanceTest ex + try{ + encoder.encode(srcBuf,outBuf,false); + encoder.reset(); +- srcBuf.rewind(); +- outBuf.rewind(); ++ ((Buffer)srcBuf).rewind(); ++ ((Buffer)outBuf).rewind(); + }catch(Exception e){ + e.printStackTrace(); + throw new RuntimeException(e.getMessage()); diff --git a/icu4j-73_1.tgz b/icu4j-73_1.tgz new file mode 100644 index 0000000..439682d --- /dev/null +++ b/icu4j-73_1.tgz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37e076a7d0ab0c67e1f13ab79dc4404cb7012db3c9c91e9b34e3e73171122847 +size 29382801 diff --git a/icu4j-detectjava21.patch b/icu4j-detectjava21.patch new file mode 100644 index 0000000..bc3d6db --- /dev/null +++ b/icu4j-detectjava21.patch @@ -0,0 +1,26 @@ +--- a/build.xml 2023-04-13 18:15:08.000000000 +0200 ++++ b/build.xml 2023-09-21 08:36:23.783902985 +0200 +@@ -134,6 +134,14 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ + + + +@@ -147,6 +155,8 @@ + + + ++ ++ + + + diff --git a/icu4j-javadoc.patch b/icu4j-javadoc.patch new file mode 100644 index 0000000..b517626 --- /dev/null +++ b/icu4j-javadoc.patch @@ -0,0 +1,31 @@ +--- a/main/classes/core/src/com/ibm/icu/number/NumberRangeFormatter.java 2021-04-07 16:50:27.000000000 -0600 ++++ b/main/classes/core/src/com/ibm/icu/number/NumberRangeFormatter.java 2021-08-24 09:51:20.411499180 -0600 +@@ -20,7 +20,7 @@ import com.ibm.icu.util.ULocale; + * .locale(ULocale.UK) + * .formatRange(750, 1.2) + * .toString(); +- * // => "750 m - 1.2 km" ++ * // → "750 m - 1.2 km" + * + *

+ * Like NumberFormatter, NumberRangeFormatter instances (i.e., LocalizedNumberRangeFormatter +--- a/main/classes/core/src/com/ibm/icu/text/SpoofChecker.java 2021-08-24 09:24:05.359581150 -0600 ++++ b/main/classes/core/src/com/ibm/icu/text/SpoofChecker.java 2021-08-24 09:54:31.851818377 -0600 +@@ -129,7 +129,7 @@ import com.ibm.icu.util.ULocale; + * SpoofChecker sc = new SpoofChecker.Builder() + * .setAllowedChars(SpoofChecker.RECOMMENDED.cloneAsThawed().addAll(SpoofChecker.INCLUSION)) + * .setRestrictionLevel(SpoofChecker.RestrictionLevel.MODERATELY_RESTRICTIVE) +- * .setChecks(SpoofChecker.ALL_CHECKS &~ SpoofChecker.CONFUSABLE) ++ * .setChecks(SpoofChecker.ALL_CHECKS &~ SpoofChecker.CONFUSABLE) + * .build(); + * boolean result = sc.failsChecks("pаypаl"); // with Cyrillic 'а' characters + * System.out.println(result); // true +@@ -150,7 +150,7 @@ import com.ibm.icu.util.ULocale; + * SpoofChecker sc = new SpoofChecker.Builder() + * .setAllowedChars(SpoofChecker.RECOMMENDED.cloneAsThawed().addAll(SpoofChecker.INCLUSION)) + * .setRestrictionLevel(SpoofChecker.RestrictionLevel.MODERATELY_RESTRICTIVE) +- * .setChecks(SpoofChecker.ALL_CHECKS &~ SpoofChecker.CONFUSABLE) ++ * .setChecks(SpoofChecker.ALL_CHECKS &~ SpoofChecker.CONFUSABLE) + * .build(); + * SpoofChecker.CheckResult checkResult = new SpoofChecker.CheckResult(); + * boolean result = sc.failsChecks("pаypаl", checkResult); diff --git a/icu4j-jdk10plus.patch b/icu4j-jdk10plus.patch new file mode 100644 index 0000000..3ddd4ca --- /dev/null +++ b/icu4j-jdk10plus.patch @@ -0,0 +1,79 @@ +diff -up SRC/build.xml.p00 SRC/build.xml +--- SRC/build.xml.p00 2023-04-20 11:16:32.762221158 +0300 ++++ SRC/build.xml 2023-04-20 11:24:00.668073471 +0300 +@@ -462,7 +462,7 @@ + + + +- ++ + + + +@@ -1312,7 +1312,7 @@ + + + +- ++ + + + +@@ -1356,7 +1356,7 @@ + docencoding="UTF-8" + charset="UTF-8" + bottom="${icu4j.api.doc.copyright.footer}" +- additionalparam="${doclint.option} -breakiterator -use -tagletpath ${icu4j.build-tools.jar}${path.separator}${jcite.libs} -taglet com.ibm.icu.dev.tool.docs.ICUTaglet -taglet ch.arrenbrecht.jcite.JCiteTaglet -J-Djcitesourcepath=${jcite.addl.src} -J-Dfile.encoding=UTF-8" ++ additionalparam="${doclint.option} -breakiterator -use -J-Djcitesourcepath=${jcite.addl.src} -J-Dfile.encoding=UTF-8" + link="${icu4j.api.doc.jdk.link}" + source="${javac.source}" + stylesheetfile="${docs.style.sheet}" +@@ -1393,7 +1393,7 @@ + docencoding="UTF-8" + charset="UTF-8" + bottom="${icu4j.api.doc.copyright.footer}" +- additionalparam="${doclint.option} -breakiterator -use -tagletpath ${icu4j.build-tools.jar} -taglet com.ibm.icu.dev.tool.docs.ICUTaglet" ++ additionalparam="${doclint.option} -breakiterator -use" + link="${icu4j.api.doc.jdk.link}" + source="${javac.source}" + failonerror="true"> +@@ -1439,7 +1439,7 @@ + docencoding="UTF-8" + charset="UTF-8" + bottom="${icu4j.api.doc.copyright.footer}" +- additionalparam="${doclint.option} -breakiterator -use -tagletpath ${icu4j.build-tools.jar}${path.separator}${jcite.libs} -taglet com.ibm.icu.dev.tool.docs.ICUTaglet -taglet ch.arrenbrecht.jcite.JCiteTaglet -J-Djcitesourcepath=${jcite.addl.src} -J-Dfile.encoding=UTF-8" ++ additionalparam="${doclint.option} -breakiterator -use -J-Djcitesourcepath=${jcite.addl.src} -J-Dfile.encoding=UTF-8" + link="${icu4j.api.doc.jdk.link}" + source="${javac.source}" + stylesheetfile="${docs.style.sheet}" +@@ -1479,7 +1479,7 @@ + docencoding="UTF-8" + charset="UTF-8" + bottom="${icu4j.api.doc.copyright.footer}" +- additionalparam="${doclint.option} -breakiterator -use -tagletpath ${icu4j.build-tools.jar}${path.separator}${jcite.libs} -taglet com.ibm.icu.dev.tool.docs.ICUTaglet -taglet ch.arrenbrecht.jcite.JCiteTaglet -J-Djcitesourcepath=${jcite.addl.src} -J-Dfile.encoding=UTF-8" ++ additionalparam="${doclint.option} -breakiterator -use -J-Djcitesourcepath=${jcite.addl.src} -J-Dfile.encoding=UTF-8" + link="${icu4j.api.doc.jdk.link}" + source="${javac.source}" + stylesheetfile="${docs.style.sheet}" +@@ -1664,7 +1664,6 @@ + + + +- + + + +@@ -1690,13 +1689,6 @@ + + + +- +- +- +- +- +- +- + + + diff --git a/icu4j.changes b/icu4j.changes new file mode 100644 index 0000000..f0d091e --- /dev/null +++ b/icu4j.changes @@ -0,0 +1,359 @@ +------------------------------------------------------------------- +Thu Sep 21 06:30:35 UTC 2023 - Fridrich Strba + +- Added patch: + * icu4j-detectjava21.patch + + detect java 20 and 21 when running ant + +------------------------------------------------------------------- +Thu Apr 20 08:33:20 UTC 2023 - Anton Shvetz + +- Upgrade to version 73.1 + * Updates to CLDR 43 locale data with various additions and + corrections. + * Improves Japanese and Korean short-text line breaking, reduces + C++ memory use in date formatting, and promotes the Java person + name formatter from tech preview to draft. + * ICU 73 and CLDR 43 are minor releases, mostly focused on bug + fixes and small enhancements. (The fall CLDR/ICU releases will + update to Unicode 15.1 which is planned for September.) + * Updates to the time zone data version 2023c (2023-mar). Note + that pre-1970 data for a number of time zones has been removed, + as has been the case in the upstream tzdata release since + 2021b. + * For details, please see https://icu.unicode.org/download/73. +- Upgrade to version 72.1 + * Updates to Unicode 15, and to CLDR 42 locale data with various + additions and corrections. + * ICU 72 and CLDR 42 are major releases, including a new version + of Unicode and major locale data improvements. + * Adds two technology preview implementations based on draft + Unicode specifications: + + Formatting of people’s names in multiple languages (CLDR + background on why this feature is being added and what it does) + + An enhanced version of message formatting + * This release also updates to the time zone data version 2022e + (2022-oct). Note that pre-1970 data for a number of time zones + has been removed, as has been the case in the upstream tzdata + release since 2021b. + * For details, please see https://icu.unicode.org/download/72. +- Update patch: + * icu4j-jdk10plus.patch + +------------------------------------------------------------------- +Fri Apr 29 11:55:45 UTC 2022 - Anton Shvetz + +- Upgrade to version 71.1 + * Updates to CLDR 41 locale data with various additions and + corrections. + * Adds phrase-based line breaking for Japanese. Existing line + breaking methods follow standards and conventions for body text + but do not work well for short Japanese text, such as in titles + and headings. This new feature is optimized for these use + cases. + * Adds support for Hindi written in Latin letters (hi_Latn). The + CLDR data for this increasingly popular locale has been + significantly revised and expanded. Note that based on user + expectations, hi_Latn incorporates a large amount of English, + and can also be referred to as “Hinglish”. + * ICU 71 and CLDR 41 are minor releases, mostly focused on bug + fixes and small enhancements. + * Updates to the time zone data version 2022a. Note that pre-1970 + data for a number of time zones has been removed, as has been + the case in the upstream tzdata release since 2021b. +- Remove obsolete stuff from spec file +- Reformat the changes file to fit to 67 chars width + +------------------------------------------------------------------- +Thu Mar 24 14:17:28 UTC 2022 - Fridrich Strba + +- Upgrade to verison 70.1 +- Modified patches: + * icu4j-66.1-java8compat.patch -> icu4j-70.1-java8compat.patch + * icu4j-jdk10plus.patch + + rediff to changed context + * improve-osgi-manifest.patch + + replace also DATAVERSION token during the build +- Added patch: + * icu4j-javadoc.patch + + fix invalid html entities + +------------------------------------------------------------------- +Thu Apr 23 08:32:58 UTC 2020 - Ismail Dönmez + +- Update to version 67.1 + * Unicode 13 (ICU-20893, same as in ICU 66) + + Total of 5930 new characters + + 4 new scripts + + 55 new emoji characters, plus additional new sequences + + New CJK extension, first characters in plane 3: U+30000..U+3134A + * CLDR 37 + + New language at Modern coverage: Nigerian Pidgin + + New languages at Basic coverage: Fulah (Adlam), Maithili, + Manipuri, Santali, Sindhi (Devanagari), Sundanese + + Region containment: EU no longer includes GB + + Unicode 13 root collation data and Chinese data for collation + and transliteration + * DateTimePatternGenerator now obeys the "hc" preference in the + locale identifier (ICU-20442) + * Various other improvements for ECMA-402 conformance + * Number skeletons have a new "concise" form that can be used in + MessageFormat strings (ICU-20418) + * Currency formatting options for formal and other currency + display name variants (ICU-20854) + * ListFormatter: new public API to select the style & type + (ICU-12863) + * ListFormatter now selects the proper “and”/“or” form for + Spanish & Hebrew (ICU-21016) + * Locale ID canonicalization upgraded to implement the complete + CLDR spec (ICU-20834, ICU-20272) + * LocaleMatcher: New option to ignore one-way matches + (ICU-20936), and other tweaks to the code (ICU-20916, + ICU-20917) and data (from CLDR) + * acceptLanguage() reimplemented via LocaleMatcher (ICU-20700) + * Data build tool: tzdbNames.res moved from the "zone_tree" + category to the "zone_supplemental" category (ICU-21073) + +------------------------------------------------------------------- +Thu Apr 2 08:32:08 UTC 2020 - Fridrich Strba + +- Version update to 66.1 +- Changed patches: + * icu4j-jdk10plus.patch + * improve-osgi-manifest.patch + * icu4j-63.1-java8compat.patch -> icu4j-66.1-java8compat.patch + + rediff to changed context + +------------------------------------------------------------------- +Fri Jan 24 10:56:12 UTC 2020 - Fridrich Strba + +- Remove build-dependency on java-javadoc, since it is not + necessary with this version. + +------------------------------------------------------------------- +Wed Feb 13 12:42:12 UTC 2019 - Fridrich Strba + +- Added patch: + * icu4j-63.1-java8compat.patch + + Prevent use of Jdk >= 9 functions +- Clean up the file and sanitize osgi bundle versions + +------------------------------------------------------------------- +Tue Nov 27 12:56:30 UTC 2018 - Fridrich Strba + +- Distribute also the charset and localespi jars along with their + pom files. +- Install the jars also to %{_javadir}%{name} directory for + compatibility reasons. + +------------------------------------------------------------------- +Fri Nov 23 16:03:18 UTC 2018 - Fridrich Strba + +- Added patch: + * improve-osgi-manifest.patch + +------------------------------------------------------------------- +Thu Nov 22 12:23:04 UTC 2018 - Fridrich Strba + +- Version update to 63.1 + * updates to CLDR 34 locale data with many additions and + corrections, and some new languages. + * adds API for number and currency range formatting, and API for + additional Unicode properties and for constructing custom + properties. + * includex data for testing readiness for the upcoming Japanese + calendar era. + +------------------------------------------------------------------- +Fri Dec 22 13:11:47 UTC 2017 - fstrba@suse.com + +- Version update to 60.2 + * jdk9 upstream fixes +- Obsoleted patches: + * icu4j-jdk9.patch + - Obsoleted by upstream fixes + * icu4j-taglet.patch + - Obsoleted by removal of the old style taglet removal +- Added patch: + * icu4j-jdk10plus.patch + - Fix build with jdk10 and possibly later jdks +- Don't build the ICUTaglet, since it depends on removed APIs + +------------------------------------------------------------------- +Fri Sep 29 06:29:50 UTC 2017 - fstrba@suse.com + +- Don't condition the maven defines on release version, but on + _maven_repository being defined + +------------------------------------------------------------------- +Mon Sep 18 10:17:38 UTC 2017 - fstrba@suse.com + +- Added patches: + * icu4j-taglet.patch + + implement com.sun.tools.doclets.Taglet interface instead of + the deprecated + com.sun.tools.doclets.internal.toolkit.taglets.Taglet + + Fixes java.lang.ClassCastException with jdk9 + * icu4j-jdk9.patch + + Extend the jdk9 test, so that it accepts versions that start + with 9 + + Make source, target and encoding consistent all over the + build +- Specify source and target level 1.6 in order to allow building + with jdk9 + +------------------------------------------------------------------- +Fri May 19 10:40:23 UTC 2017 - tchvatal@suse.com + +- Version update to 58.1: + * Changes to keep in line with regular icu release +- Obsoleted patch: + * java8-compatibility.patch + +------------------------------------------------------------------- +Mon Mar 20 15:13:38 UTC 2017 - sknorr@suse.com + +- Needed as a dependency for FOP 2.1 (fate#322405) +- Switch between maven-metadata/maven-fragments as appropriate + for SLE/openSUSE (fate#322405) + +------------------------------------------------------------------- +Tue Jul 28 10:56:40 UTC 2015 - tchvatal@suse.com + +- Version bump to 55.1: + * various bugfixes to match up regular icu-c +- Add patch to build with jdk8: + * java8-compatibility.patch + +------------------------------------------------------------------- +Wed Mar 18 09:46:08 UTC 2015 - tchvatal@suse.com + +- Fix build with new javapackages-tools + +------------------------------------------------------------------- +Tue Jan 20 16:00:47 UTC 2015 - p.drouand@gmail.com + +- Update to version 54.1.1 + * CLDR 26 + * Unicode 7.0 + * many more units + * Unihan in root collation + * new RBNF PluralFormat syntax + * dictionary-based break iterator for Burmese + * tech preview of FilteredBreakIterator using ULI break data + +------------------------------------------------------------------- +Fri Jul 18 07:41:29 UTC 2014 - tchvatal@suse.com + +- Version bump to 52.1: + * Match the 52.1 icu release. + +------------------------------------------------------------------- +Fri Jun 27 13:55:19 UTC 2014 - tchvatal@suse.com + +- No need to depend on java-javadoc solves build for SLE11. +- Tidy a bit with spec-cleaner + +------------------------------------------------------------------- +Mon Sep 9 11:05:44 UTC 2013 - tchvatal@suse.com + +- Move from jpackage-utils to javapackage-tools + +------------------------------------------------------------------- +Sat Feb 2 15:42:06 UTC 2013 - p.drouand@gmail.com + +- Update to version 50.1: + * Common Changes + - Unicode 6.2: Turkish Lira Sign, improved word & line + segmentation + (BreakIterator) for symbols + - CLDR 22.1: Data coverage & quality improved across all major + languages; new short width type for weekday names; new zhuyin + (Bopomofo) collation for Chinese; improved data for + CompactDecimalFormat & RBNF + - Time zone data: 2012h + - Ordinal-number support in MessageFormat & PluralRules (#9132) + - Deprecate setLocale(locale) in PluralFormat (#9249) + - Dictionary-based break iterators (word segmentation): + * Support Chinese & Japanese, use more compact dictionary + format, port all but Khmer support to Java (#9353) + * Update Khmer dictionary (#9311) + - Change Java util.ListFormat to text.ListFormatter and other + updates, use CLDR data (#9369, #9420), port to C++ (#7168) + - Add updated IBM-eucJP and IBM-5233 converter (#9262, #9259) + * ICU4C Specific Changes + - Improve number formatting performance (#9258) + - C++ GenderInfo: Effective combined gender of a list of + people's genders (#9598) (ported from Java) + - Thread safety support cannot be removed (see the Readme) + - Default compilers: Clang is now used if available (see the + Readme) + - C++ Collator API cleanup (#9346, #9406, #9460), + subclassing-API-breaking changes (see the Readme) + - Add option to genrb tool for writing java resource bundle + files (#9271) + - Time zone format APIs (#9338) + * ICU4J Specific Changes + - class DictionaryBasedBreakIterator was removed as part of the + improvements for dictionary-based break iteration; see the + note in the readme + - Dangi (Korean Lunisolar) calendar (#9255) +- Remove external manifest file: icu4j has moved to the IBM api +- Add with_ecplise macros; working on it + +------------------------------------------------------------------- +Wed Nov 28 08:50:17 UTC 2012 - p.drouand@gmail.com + +- Update to 4.8.1.1 : + * CLDR 2.0: The CLDR 2.0 release contains numerous improvements + and bug fixes approved by the CLDR committee, including much + additional data for many languages. + * Explicit parent locale support in data imported from CLDR + (#8031) + * MessageFormat and related classes (choice/plural/select) have + been reimplemented, with several improvements and some + incompatible changes. See the detail section below. + * Extended PluralFormat pattern syntax supports explicit-value + forms and offsets. (#7858) + * Utility APIs in PluralRules (get some/all/unique keyword + values) + * Time zone API to return a list of available canonical system + time zone IDs (#8278) + * Time zone API to return a region (#8279) + * Collation: Full implementation & public API for script + reordering + * Dictionary-type trie (#8167) + * GB18030-2005 update (#8274) + * Alphabetic Index support ported from ICU4J (#7538) + * X11 Compound Text encoding support ported from ICU4J (#7959) + * Appendable interface (#8314) + * Technology Preview: APIs for region information. The new class + com.ibm.icu.util.Region provides mapping across different + region/territory codes and containment relationship. (#8347) + * JDK Locale conversion to support JDK 7 new Locale fields + (#8078) + * Technology Preview: TimeZoneFormat and TimeZoneNames. New + classes designed for supporting CLDR time zone display name + algorithm and data through public APIs. (#8342) + * Known Issues + + #8535 & #8537 (C only) Prebuilt binaries are usable on MinGW + but the MinGW build is broken + + #8571 (C only) U_HIDE_DRAFT_API does not operate on the + correct set of APIs; might also affect U_HIDE_DEPRECATED_API, + U_HIDE_INTERNAL_API and U_HIDE_SYSTEM_API +- Deleted files : + * icu4j-4.4.2.pom : Now icu4j is enterly based on IBM Api +------------------------------------------------------------------- +Tue Jun 12 13:48:26 UTC 2012 - mvyskocil@suse.cz + +- update to 4.4.2.2 (sync with Fedora) + * CLDR 1.8 + * Unicode 5.2 + * compact resource bundle + * Java 5 syntax + +------------------------------------------------------------------- +Tue Jun 2 15:17:28 CEST 2009 - mvyskocil@suse.cz + +- Initial SUSE packaging of icu4j (from jpackage5.0) + diff --git a/icu4j.spec b/icu4j.spec new file mode 100644 index 0000000..8e76d1b --- /dev/null +++ b/icu4j.spec @@ -0,0 +1,168 @@ +# +# spec file for package icu4j +# +# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2000-2007, JPackage Project +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global majorver 73 +%global minorver 1 +Name: icu4j +Version: %{majorver}.%{minorver} +Release: 0 +Summary: International Components for Unicode for Java +# ICU itself is now covered by Unicode license, but still has contributed +# components covered by MIT and BSD licenses +# Data from the Timezone Database is Public Domain +License: BSD-3-Clause AND MIT AND Unicode AND SUSE-Public-Domain +Group: Development/Libraries/Java +URL: http://site.icu-project.org/ +Source0: https://github.com/unicode-org/icu/releases/download/release-%{majorver}-%{minorver}/%{name}-%{majorver}_%{minorver}.tgz +Patch0: icu4j-jdk10plus.patch +# Add better OSGi metadata to core jar +Patch1: improve-osgi-manifest.patch +Patch2: icu4j-70.1-java8compat.patch +Patch3: icu4j-javadoc.patch +Patch4: icu4j-detectjava21.patch +BuildRequires: ant +BuildRequires: fdupes +BuildRequires: java-devel +BuildRequires: javapackages-local +BuildArch: noarch + +%description +The International Components for Unicode (ICU) library provides robust and +full-featured Unicode services on a wide variety of platforms. ICU supports +the most current version of the Unicode standard, and provides support for +supplementary characters (needed for GB 18030 repertoire support). + +Java provides a very strong foundation for global programs, and IBM and the +ICU team played a key role in providing globalization technology into Sun's +Java. But because of its long release schedule, Java cannot always keep +up-to-date with evolving standards. The ICU team continues to extend Java's +Unicode and internationalization support, focusing on improving +performance, keeping current with the Unicode standard, and providing +richer APIs, while remaining as compatible as possible with the original +Java text and internationalization API design. + +%package charset +Summary: Charset converter library of %{name} +Group: Development/Libraries/Java +Requires: %{name} = %{version}-%{release} + +%description charset +Charset converter library of %{name}. + +%package localespi +Summary: Locale SPI library of %{name} +Group: Development/Libraries/Java +Requires: %{name} = %{version}-%{release} + +%description localespi +Locale SPI library of %{name}. + +%package javadoc +Summary: Javadoc for %{name} +Group: Documentation/HTML + +%description javadoc +API documentation for %{name}. + +%prep +%setup -q -c +%patch0 -p1 +%patch1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 + +sed -i 's/\r//' APIChangeReport.html +sed -i 's/\r//' readme.html + +sed -i "s/ .*bootclasspath=.*//g" build.xml +sed -i "s:%{_prefix}/lib:%{_libdir}:g" build.xml + +rm tools/build/src/com/ibm/icu/dev/tool/docs/ICUTaglet* + +# The versions in build.properties were not updated since some time +rm build.properties +#echo "api.doc.version=%%{version}" >> build.properties +echo "maven.pom.ver=%{version}" >> build.properties +#echo "release.file.ver=%%{majorver}_%%{minorver}" >> build.properties +#echo "api.report.version=%%{majorver}" >> build.properties +#echo "api.report.prev.version=%%{oldmajorver}" >> build.properties +echo "jar.spec.version=%{majorver}" >> build.properties +echo "jar.impl.version=%{version}" >> build.properties +echo "jar.impl.version.string=%{version}.0" >> build.properties + +# Missing dep on pl.pragmatists:JUnitParams for tests, so delete tests that +# requires it for now +sed -i -e '/pl.pragmatists/d' ivy.xml +rm main/tests/core/src/com/ibm/icu/dev/test/format/DataDrivenFormatTest.java +rm main/tests/core/src/com/ibm/icu/dev/test/calendar/DataDrivenCalendarTest.java +rm main/tests/core/src/com/ibm/icu/dev/test/serializable/CompatibilityTest.java +rm main/tests/core/src/com/ibm/icu/dev/test/serializable/CoverageTest.java +rm main/tests/core/src/com/ibm/icu/dev/test/util/LocaleMatcherTest.java +rm main/tests/charset/src/com/ibm/icu/dev/test/charset/TestConversion.java +rm main/tests/translit/src/com/ibm/icu/dev/test/translit/TransliteratorDisorderedMarksTest.java + +%build +%ant \ + -Djavac.source=1.8 -Djavac.target=1.8 \ + -Ddoclint.option='-Xdoclint:none' \ + -Dicu4j.api.doc.jdk.link= \ + jar docs + +for jar in icu4j icu4j-charset icu4j-localespi ; do + sed -i -e 's/@POMVERSION@/%{version}/' maven/$jar/pom.xml +done + +%install +# jars +mkdir -p %{buildroot}%{_javadir}/%{name} +cp -ap %{name}*.jar %{buildroot}%{_javadir}/ +for jar in icu4j icu4j-charset icu4j-localespi ; do + ln -sf %{_javadir}/${jar}.jar %{buildroot}%{_javadir}/%{name}/${jar}.jar +done +# javadoc +mkdir -p %{buildroot}%{_javadocdir}/%{name} +cp -pr doc/* %{buildroot}%{_javadocdir}/%{name} +%fdupes -s %{buildroot}%{_javadocdir}/%{name} + +# maven stuff +install -d -m 755 %{buildroot}%{_mavenpomdir} +for jar in icu4j icu4j-charset icu4j-localespi ; do + sed -i -e 's/@POMVERSION@/%{version}/' maven/$jar/pom.xml + cp maven/$jar/pom.xml %{buildroot}%{_mavenpomdir}/JPP-$jar.pom +done +%add_maven_depmap JPP-icu4j.pom icu4j.jar +%add_maven_depmap JPP-icu4j-charset.pom icu4j-charset.jar -f charset +%add_maven_depmap JPP-icu4j-localespi.pom icu4j-localespi.jar -f localespi + +%files -f .mfiles +%dir %{_javadir}/%{name} +%doc readme.html APIChangeReport.html +%{_javadir}/%{name}/%{name}.jar + +%files charset -f .mfiles-charset +%{_javadir}/%{name}/%{name}-charset.jar + +%files localespi -f .mfiles-localespi +%{_javadir}/%{name}/%{name}-localespi.jar + +%files javadoc +%{_javadocdir}/%{name} + +%changelog diff --git a/improve-osgi-manifest.patch b/improve-osgi-manifest.patch new file mode 100644 index 0000000..d627959 --- /dev/null +++ b/improve-osgi-manifest.patch @@ -0,0 +1,47 @@ +--- build.xml 2022-03-20 01:20:17.315792163 +0100 ++++ build.xml 2022-03-20 01:20:55.698993273 +0100 +@@ -745,6 +745,7 @@ + + + ++ + + + +--- main/shared/build/common-targets.xml 2021-10-28 08:02:09.000000000 +0200 ++++ main/shared/build/common-targets.xml 2022-03-20 01:20:55.698993273 +0100 +@@ -75,6 +75,7 @@ + + + ++ + + + +--- manifest.stub 2021-10-28 08:02:10.000000000 +0200 ++++ manifest.stub 2022-03-20 01:20:55.698993273 +0100 +@@ -15,5 +15,23 @@ + Bundle-Copyright: @COPYRIGHT@ + Bundle-RequiredExecutionEnvironment: @EXECENV@ + Main-Class: com.ibm.icu.util.VersionInfo +-Export-Package: com.ibm.icu.lang,com.ibm.icu.math,com.ibm.icu.number,com.ibm.icu.text,com.ibm.icu.util ++Export-Package: com.ibm.icu.lang;base=true;full=true;version="@IMPLVERSION@", ++ com.ibm.icu.math;base=true;full=true;version="@IMPLVERSION@", ++ com.ibm.icu.number;base=true;full=true;version="@IMPLVERSION@", ++ com.ibm.icu.text;base=true;full=true;version="@IMPLVERSION@", ++ com.ibm.icu.util;base=true;full=true;version="@IMPLVERSION@", ++ com.ibm.icu.impl;x-internal:=true, ++ com.ibm.icu.impl.data;x-internal:=true, ++ com.ibm.icu.impl.data.icudt@DATAVERSION@b;x-internal:=true, ++ com.ibm.icu.impl.data.icudt@DATAVERSION@b.brkitr;x-internal:=true, ++ com.ibm.icu.impl.data.icudt@DATAVERSION@b.coll;x-internal:=true, ++ com.ibm.icu.impl.data.icudt@DATAVERSION@b.curr;x-internal:=true, ++ com.ibm.icu.impl.data.icudt@DATAVERSION@b.lang;x-internal:=true, ++ com.ibm.icu.impl.data.icudt@DATAVERSION@b.rbnf;x-internal:=true, ++ com.ibm.icu.impl.data.icudt@DATAVERSION@b.region;x-internal:=true, ++ com.ibm.icu.impl.data.icudt@DATAVERSION@b.translit;x-internal:=true, ++ com.ibm.icu.impl.data.icudt@DATAVERSION@b.zone;x-internal:=true, ++ com.ibm.icu.impl.duration;x-internal:=true, ++ com.ibm.icu.impl.locale;x-internal:=true ++Bundle-ActivationPolicy: lazy + Automatic-Module-Name: com.ibm.icu