projects
/
hibernate-maven-plugin
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b9ab24b
)
Bugfix: connection was closed, even when it was never created
author
Kai Moritz
<kai@coolibri.de>
Wed, 9 Jan 2013 19:57:22 +0000
(20:57 +0100)
committer
Kai Moritz
<kai@coolibri.de>
Tue, 15 Jan 2013 20:41:04 +0000
(21:41 +0100)
Bugreport from: Adriano Machado <adriano.m.machado@hotmail.com>
When only the script is generated and no export is executed, no database-
connection is opend. Nevertheless, the code tried to close it in the
finally-block, which lead to a NPE.
src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java
patch
|
blob
|
history
diff --git
a/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java
b/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java
index
81cef93
..
78793bb
100644
(file)
--- a/
src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java
+++ b/
src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java
@@
-601,7
+601,8
@@
public class Hbm2DdlMojo extends AbstractMojo
/** Close the connection */
try
{
- connection.close();
+ if (connection != null)
+ connection.close();
}
catch (SQLException e)
{