Mercurial > hg > icedtea7-forest > jdk
changeset 8946:8420e3cbcebd
8062198, PR3162: Add RowSetMetaDataImpl Tests and add column range validation to isdefinitlyWritable
Reviewed-by: joehw, lancea
Contributed-by: maxim.soloviev@oracle.com
author | kshefov |
---|---|
date | Thu, 27 Oct 2016 01:37:56 +0100 |
parents | 25dc08f3724e |
children | 54b549e917cc |
files | src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java |
diffstat | 1 files changed, 11 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java Fri Jun 05 19:14:49 2015 +0300 +++ b/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java Thu Oct 27 01:37:56 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -48,6 +48,8 @@ * Therefore, any <code>RowSetMetaDataImpl</code> method that retrieves information * is defined as having unspecified behavior when it is called * before the <code>RowSet</code> object contains data. + * + * @since 1.5 */ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable { @@ -579,7 +581,7 @@ * * @param columnIndex the first column is 1, the second is 2, and so on; * must be between <code>1</code> and the number of columns, inclusive - * @return <code>true</code> if if a value in the designated column is a signed + * @return <code>true</code> if a value in the designated column is a signed * number; <code>false</code> otherwise * @throws SQLException if a database access error occurs * or the given column number is out of bounds @@ -605,7 +607,7 @@ } /** - * Retrieves the the suggested column title for the designated + * Retrieves the suggested column title for the designated * column for use in printouts and displays. * * @param columnIndex the first column is 1, the second is 2, and so on; @@ -801,8 +803,10 @@ * @throws SQLException if a database access error occurs * or the given column number is out of bounds */ - public boolean isDefinitelyWritable(int columnIndex) - throws SQLException { return true;} + public boolean isDefinitelyWritable(int columnIndex) throws SQLException { + checkColRange(columnIndex); + return true; + } /** * Retrieves the fully-qualified name of the class in the Java @@ -1071,7 +1075,7 @@ public int colType; /** - * The field that holds the the type name used by this particular data source + * The field that holds the type name used by this particular data source * for the value stored in this column. * * @serial @@ -1079,7 +1083,7 @@ public String colTypeName; /** - * The field that holds the updatablity boolean per column of a RowSet + * The field that holds the updatability boolean per column of a RowSet * * @serial */