This commit is contained in:
prrace 2026-01-27 11:02:18 -08:00
parent eb6e74b1fa
commit 120f161ddd
2 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -452,6 +452,9 @@ public class Raster {
throw new IllegalArgumentException("Dimensions (width="+w+ throw new IllegalArgumentException("Dimensions (width="+w+
" height="+h+") are too large"); " height="+h+") are too large");
} }
if (scanlineStride < 0) {
throw new IllegalArgumentException("Scanline stride must be >= 0");
}
if (bankIndices == null) { if (bankIndices == null) {
throw new throw new
ArrayIndexOutOfBoundsException("Bank indices array is null"); ArrayIndexOutOfBoundsException("Bank indices array is null");

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/* /*
* @test * @test
* @bug 8255800 8369129 * @bug 8255800 8369129 8376297
* @summary verify Raster + SampleModel creation vs spec. * @summary verify Raster + SampleModel creation vs spec.
*/ */
@ -739,7 +739,7 @@ public class CreateRasterExceptionTest {
/* @throws IllegalArgumentException if /* @throws IllegalArgumentException if
* {@code scanlineStride} is less than 0 * {@code scanlineStride} is less than 0
*/ */
Raster.createBandedRaster(DataBuffer.TYPE_INT, 1, 1, -3, Raster.createBandedRaster(DataBuffer.TYPE_INT, 10, 10, -1000,
bankIndices, bandOffsets, null); bankIndices, bandOffsets, null);
noException(); noException();
} catch (IllegalArgumentException t) { } catch (IllegalArgumentException t) {