OPENJPA-1700 FindBugs - Possible null pointer dereference; strName could be set to null.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@955394 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Donald Woods 2010-06-16 21:17:57 +00:00
parent 7028247229
commit 13002d2025
1 changed files with 2 additions and 2 deletions

View File

@ -383,8 +383,8 @@ public class PostgresDictionary
// filter out generated sequences used for bigserial cols, which are
// of the form <table>_<col>_seq
String strName = DBIdentifier.isNull(name) ? null : name.getName();
int idx = strName.indexOf('_');
String strName = DBIdentifier.isNull(name) ? "" : name.getName();
int idx = (strName == null) ? -1 : strName.indexOf('_');
return idx != -1 && idx != strName.length() - 4
&& strName.toUpperCase().endsWith("_SEQ");
}