From 13002d2025319075eadf690e5548b3bbc506401c Mon Sep 17 00:00:00 2001 From: Donald Woods Date: Wed, 16 Jun 2010 21:17:57 +0000 Subject: [PATCH] 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 --- .../java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java index a3cd93941..73918ca8d 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java @@ -383,8 +383,8 @@ public class PostgresDictionary // filter out generated sequences used for bigserial cols, which are // of the form __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"); }