diff --git a/src/java.base/share/classes/java/lang/Character.java b/src/java.base/share/classes/java/lang/Character.java index ab487c8fcf9..bb995d7e75e 100644 --- a/src/java.base/share/classes/java/lang/Character.java +++ b/src/java.base/share/classes/java/lang/Character.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -9687,7 +9687,7 @@ class Character implements java.io.Serializable, Comparable, Constabl * @since 1.5 */ public static int codePointCount(char[] a, int offset, int count) { - Objects.checkFromIndexSize(count, offset, a.length); + Objects.checkFromIndexSize(offset, count, a.length); return codePointCountImpl(a, offset, count); } diff --git a/src/java.base/share/classes/java/util/Base64.java b/src/java.base/share/classes/java/util/Base64.java index d15b3842b3c..fb762aa33e5 100644 --- a/src/java.base/share/classes/java/util/Base64.java +++ b/src/java.base/share/classes/java/util/Base64.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -932,7 +932,7 @@ public class Base64 { public void write(byte[] b, int off, int len) throws IOException { if (closed) throw new IOException("Stream is closed"); - Preconditions.checkFromIndexSize(len, off, b.length, Preconditions.AIOOBE_FORMATTER); + Preconditions.checkFromIndexSize(off, len, b.length, Preconditions.AIOOBE_FORMATTER); if (len == 0) return; if (leftover != 0) { diff --git a/src/java.base/share/classes/java/util/zip/Adler32.java b/src/java.base/share/classes/java/util/zip/Adler32.java index b8e0bc190c1..807c08ced8a 100644 --- a/src/java.base/share/classes/java/util/zip/Adler32.java +++ b/src/java.base/share/classes/java/util/zip/Adler32.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -76,7 +76,7 @@ public class Adler32 implements Checksum { if (b == null) { throw new NullPointerException(); } - Preconditions.checkFromIndexSize(len, off, b.length, Preconditions.AIOOBE_FORMATTER); + Preconditions.checkFromIndexSize(off, len, b.length, Preconditions.AIOOBE_FORMATTER); adler = updateBytes(adler, b, off, len); } diff --git a/src/java.base/share/classes/java/util/zip/CRC32.java b/src/java.base/share/classes/java/util/zip/CRC32.java index 84e6f26e45e..944ccaa7e21 100644 --- a/src/java.base/share/classes/java/util/zip/CRC32.java +++ b/src/java.base/share/classes/java/util/zip/CRC32.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -75,7 +75,7 @@ public class CRC32 implements Checksum { if (b == null) { throw new NullPointerException(); } - Preconditions.checkFromIndexSize(len, off, b.length, Preconditions.AIOOBE_FORMATTER); + Preconditions.checkFromIndexSize(off, len, b.length, Preconditions.AIOOBE_FORMATTER); crc = updateBytes(crc, b, off, len); } diff --git a/src/java.base/share/classes/java/util/zip/CRC32C.java b/src/java.base/share/classes/java/util/zip/CRC32C.java index a813e910009..8c20d5e0c2b 100644 --- a/src/java.base/share/classes/java/util/zip/CRC32C.java +++ b/src/java.base/share/classes/java/util/zip/CRC32C.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -150,7 +150,7 @@ public final class CRC32C implements Checksum { if (b == null) { throw new NullPointerException(); } - Preconditions.checkFromIndexSize(len, off, b.length, Preconditions.AIOOBE_FORMATTER); + Preconditions.checkFromIndexSize(off, len, b.length, Preconditions.AIOOBE_FORMATTER); crc = updateBytes(crc, b, off, (off + len)); } diff --git a/src/java.base/share/classes/java/util/zip/Deflater.java b/src/java.base/share/classes/java/util/zip/Deflater.java index 3e550d14178..5b57112bf8a 100644 --- a/src/java.base/share/classes/java/util/zip/Deflater.java +++ b/src/java.base/share/classes/java/util/zip/Deflater.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -232,7 +232,7 @@ public class Deflater { * @see Deflater#needsInput */ public void setInput(byte[] input, int off, int len) { - Preconditions.checkFromIndexSize(len, off, input.length, Preconditions.AIOOBE_FORMATTER); + Preconditions.checkFromIndexSize(off, len, input.length, Preconditions.AIOOBE_FORMATTER); synchronized (zsRef) { this.input = null; this.inputArray = input; @@ -297,7 +297,7 @@ public class Deflater { * @see Inflater#getAdler() */ public void setDictionary(byte[] dictionary, int off, int len) { - Preconditions.checkFromIndexSize(len, off, dictionary.length, Preconditions.AIOOBE_FORMATTER); + Preconditions.checkFromIndexSize(off, len, dictionary.length, Preconditions.AIOOBE_FORMATTER); synchronized (zsRef) { ensureOpen(); setDictionary(zsRef.address(), dictionary, off, len); @@ -556,7 +556,7 @@ public class Deflater { * @since 1.7 */ public int deflate(byte[] output, int off, int len, int flush) { - Preconditions.checkFromIndexSize(len, off, output.length, Preconditions.AIOOBE_FORMATTER); + Preconditions.checkFromIndexSize(off, len, output.length, Preconditions.AIOOBE_FORMATTER); if (flush != NO_FLUSH && flush != SYNC_FLUSH && flush != FULL_FLUSH) { throw new IllegalArgumentException(); } diff --git a/src/java.base/share/classes/java/util/zip/Inflater.java b/src/java.base/share/classes/java/util/zip/Inflater.java index a3cbdd1d1bf..1b915253161 100644 --- a/src/java.base/share/classes/java/util/zip/Inflater.java +++ b/src/java.base/share/classes/java/util/zip/Inflater.java @@ -154,7 +154,7 @@ public class Inflater { * @see Inflater#needsInput */ public void setInput(byte[] input, int off, int len) { - Preconditions.checkFromIndexSize(len, off, input.length, Preconditions.AIOOBE_FORMATTER); + Preconditions.checkFromIndexSize(off, len, input.length, Preconditions.AIOOBE_FORMATTER); synchronized (zsRef) { this.input = null; this.inputArray = input; @@ -219,7 +219,7 @@ public class Inflater { * @see Inflater#getAdler */ public void setDictionary(byte[] dictionary, int off, int len) { - Preconditions.checkFromIndexSize(len, off, dictionary.length, Preconditions.AIOOBE_FORMATTER); + Preconditions.checkFromIndexSize(off, len, dictionary.length, Preconditions.AIOOBE_FORMATTER); synchronized (zsRef) { ensureOpen(); setDictionary(zsRef.address(), dictionary, off, len); @@ -363,7 +363,7 @@ public class Inflater { public int inflate(byte[] output, int off, int len) throws DataFormatException { - Preconditions.checkFromIndexSize(len, off, output.length, Preconditions.AIOOBE_FORMATTER); + Preconditions.checkFromIndexSize(off, len, output.length, Preconditions.AIOOBE_FORMATTER); synchronized (zsRef) { ensureOpen(); ByteBuffer input = this.input; diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/Request.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/Request.java index 8a8e1bb5338..99dac0547ce 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/Request.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/Request.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -266,7 +266,7 @@ class Request { assert channel.isBlocking(); - Objects.checkFromIndexSize(srclen, off, b.length); + Objects.checkFromIndexSize(off, srclen, b.length); if (reset) { /* satisfy from markBuf */ canreturn = markBuf.remaining ();