< prev index next >

src/java.desktop/share/classes/java/awt/Polygon.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1995, 2014, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1995, 2018, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 80,90 **** * * @serial * @see #addPoint(int, int) * @since 1.0 */ ! public int xpoints[]; /** * The array of Y coordinates. The number of elements in * this array might be more than the number of Y coordinates * in this {@code Polygon}. The extra elements allow new points --- 80,90 ---- * * @serial * @see #addPoint(int, int) * @since 1.0 */ ! public int[] xpoints; /** * The array of Y coordinates. The number of elements in * this array might be more than the number of Y coordinates * in this {@code Polygon}. The extra elements allow new points
*** 94,104 **** * * @serial * @see #addPoint(int, int) * @since 1.0 */ ! public int ypoints[]; /** * The bounds of this {@code Polygon}. * This value can be null. * --- 94,104 ---- * * @serial * @see #addPoint(int, int) * @since 1.0 */ ! public int[] ypoints; /** * The bounds of this {@code Polygon}. * This value can be null. *
*** 142,152 **** * or the length of {@code ypoints}. * @exception NullPointerException if {@code xpoints} or * {@code ypoints} is {@code null}. * @since 1.0 */ ! public Polygon(int xpoints[], int ypoints[], int npoints) { // Fix 4489009: should throw IndexOutOfBoundsException instead // of OutOfMemoryError if npoints is huge and > {x,y}points.length if (npoints > xpoints.length || npoints > ypoints.length) { throw new IndexOutOfBoundsException("npoints > xpoints.length || "+ "npoints > ypoints.length"); --- 142,152 ---- * or the length of {@code ypoints}. * @exception NullPointerException if {@code xpoints} or * {@code ypoints} is {@code null}. * @since 1.0 */ ! public Polygon(int[] xpoints, int[] ypoints, int npoints) { // Fix 4489009: should throw IndexOutOfBoundsException instead // of OutOfMemoryError if npoints is huge and > {x,y}points.length if (npoints > xpoints.length || npoints > ypoints.length) { throw new IndexOutOfBoundsException("npoints > xpoints.length || "+ "npoints > ypoints.length");
*** 224,234 **** * Sets {@code bounds} to the result. * @param xpoints[] array of <i>x</i> coordinates * @param ypoints[] array of <i>y</i> coordinates * @param npoints the total number of points */ ! void calculateBounds(int xpoints[], int ypoints[], int npoints) { int boundsMinX = Integer.MAX_VALUE; int boundsMinY = Integer.MAX_VALUE; int boundsMaxX = Integer.MIN_VALUE; int boundsMaxY = Integer.MIN_VALUE; --- 224,234 ---- * Sets {@code bounds} to the result. * @param xpoints[] array of <i>x</i> coordinates * @param ypoints[] array of <i>y</i> coordinates * @param npoints the total number of points */ ! void calculateBounds(int[] xpoints, int[] ypoints, int npoints) { int boundsMinX = Integer.MAX_VALUE; int boundsMinY = Integer.MAX_VALUE; int boundsMaxX = Integer.MIN_VALUE; int boundsMaxY = Integer.MIN_VALUE;
< prev index next >