Throw an exception if the programmer tries to access a column that doesn't exist.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5902 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
kiran 2011-05-27 22:08:48 +00:00
parent f3b38c0d3e
commit 2a9c75c5ba
1 changed files with 4 additions and 0 deletions

View File

@ -195,6 +195,10 @@ public class GATKReportTable {
* @param columnName the name of the column
*/
private void verifyEntry(Object primaryKey, String columnName) {
if (!columns.containsKey(columnName)) {
throw new ReviewedStingException("Attempted to access column '" + columnName + "' that does not exist in table '" + tableName + "'.");
}
primaryKeyColumn.add(primaryKey);
if (!columns.get(columnName).containsKey(primaryKey)) {