Skip to content

Commit f30ea2e

Browse files
authored
Merge pull request #21898 from JasonFengJ9/accessmethods
Update JDK25 java.lang.Access to jdk.internal.access.JavaLangAccess
2 parents e3780b7 + 4451500 commit f30ea2e

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

jcl/src/java.base/share/classes/java/lang/Access.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,14 +411,24 @@ public void blockedOn(Interruptible interruptible) {
411411
Thread.blockedOn(interruptible);
412412
/*[ENDIF] JAVA_SPEC_VERSION >= 23 */
413413
}
414+
415+
/*[IF (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES]*/
416+
public byte[] uncheckedGetBytesNoRepl(String str, Charset charset) throws CharacterCodingException {
417+
/*[ELSE] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
414418
public byte[] getBytesNoRepl(String str, Charset charset) throws CharacterCodingException {
419+
/*[ENDIF] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
415420
/*[IF JAVA_SPEC_VERSION < 17]*/
416421
return StringCoding.getBytesNoRepl(str, charset);
417422
/*[ELSE] JAVA_SPEC_VERSION < 17 */
418423
return String.getBytesNoRepl(str, charset);
419424
/*[ENDIF] JAVA_SPEC_VERSION < 17 */
420425
}
426+
427+
/*[IF (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES]*/
428+
public String uncheckedNewStringNoRepl(byte[] bytes, Charset charset) throws CharacterCodingException {
429+
/*[ELSE] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
421430
public String newStringNoRepl(byte[] bytes, Charset charset) throws CharacterCodingException {
431+
/*[ENDIF] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
422432
/*[IF JAVA_SPEC_VERSION < 17]*/
423433
return StringCoding.newStringNoRepl(bytes, charset);
424434
/*[ELSE] JAVA_SPEC_VERSION < 17 */
@@ -484,11 +494,19 @@ public void addExports(Module fromModule, String pkg) {
484494
/*[ENDIF] JAVA_SPEC_VERSION >= 16 */
485495

486496
/*[IF JAVA_SPEC_VERSION >= 17]*/
497+
/*[IF (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES]*/
498+
public int uncheckedDecodeASCII(byte[] srcBytes, int srcPos, char[] dstChars, int dstPos, int length) {
499+
/*[ELSE] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
487500
public int decodeASCII(byte[] srcBytes, int srcPos, char[] dstChars, int dstPos, int length) {
501+
/*[ENDIF] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
488502
return String.decodeASCII(srcBytes, srcPos, dstChars, dstPos, length);
489503
}
490504

505+
/*[IF (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES]*/
506+
public void uncheckedInflateBytesToChars(byte[] srcBytes, int srcOffset, char[] dstChars, int dstOffset, int length) {
507+
/*[ELSE] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
491508
public void inflateBytesToChars(byte[] srcBytes, int srcOffset, char[] dstChars, int dstOffset, int length) {
509+
/*[ENDIF] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
492510
StringLatin1.inflate(srcBytes, srcOffset, dstChars, dstOffset, length);
493511
}
494512

@@ -563,7 +581,11 @@ public int getCharsUTF16(long i, int index, byte[] buf) {
563581
/*[ENDIF] JAVA_SPEC_VERSION < 25 */
564582

565583
@Override
584+
/*[IF (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES]*/
585+
public void uncheckedPutCharUTF16(byte[] val, int index, int c) {
586+
/*[ELSE] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
566587
public void putCharUTF16(byte[] val, int index, int c) {
588+
/*[ENDIF] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
567589
StringUTF16.putChar(val, index, c);
568590
}
569591

@@ -601,7 +623,11 @@ public void exit(int status) {
601623
}
602624
/*[ENDIF] (JAVA_SPEC_VERSION < 25) | INLINE-TYPES */
603625

626+
/*[IF (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES]*/
627+
public int uncheckedEncodeASCII(char[] sa, int sp, byte[] da, int dp, int len) {
628+
/*[ELSE] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
604629
public int encodeASCII(char[] sa, int sp, byte[] da, int dp, int len) {
630+
/*[ENDIF] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
605631
return StringCoding.implEncodeAsciiArray(sa, sp, da, dp, len);
606632
}
607633
/*[ENDIF] JAVA_SPEC_VERSION >= 17 */
@@ -668,11 +694,19 @@ public InputStream initialSystemIn() {
668694
}
669695

670696
/*[IF JAVA_SPEC_VERSION >= 21]*/
697+
/*[IF (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES]*/
698+
public char uncheckedGetUTF16Char(byte[] val, int index) {
699+
/*[ELSE] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
671700
public char getUTF16Char(byte[] val, int index) {
701+
/*[ENDIF] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
672702
return StringUTF16.getChar(val, index);
673703
}
674704

705+
/*[IF (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES]*/
706+
public int uncheckedCountPositives(byte[] ba, int off, int len) {
707+
/*[ELSE] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
675708
public int countPositives(byte[] ba, int off, int len) {
709+
/*[ENDIF] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
676710
return StringCoding.countPositives(ba, off, len);
677711
}
678712

@@ -835,7 +869,11 @@ public int classFileFormatVersion(Class<?> c) {
835869

836870
/*[IF JAVA_SPEC_VERSION >= 24]*/
837871
@Override
872+
/*[IF (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES]*/
873+
public Object uncheckedStringConcat1(String[] constants) {
874+
/*[ELSE] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
838875
public Object stringConcat1(String[] constants) {
876+
/*[ENDIF] (JAVA_SPEC_VERSION >= 25) & !INLINE-TYPES */
839877
return new StringConcatHelper.Concat1(constants);
840878
}
841879

0 commit comments

Comments
 (0)