From 5d19c11df7ca4a969fbfe7583ca934174fb348bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 18 Apr 2012 23:40:26 +0200 Subject: [PATCH] Declare context in the try-catch block. --- src/main/java/net/pterodactylus/demoscenemusic/core/Core.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/demoscenemusic/core/Core.java b/src/main/java/net/pterodactylus/demoscenemusic/core/Core.java index d135924..eaba985 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/core/Core.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/core/Core.java @@ -45,9 +45,8 @@ public class Core implements ServletContextListener { * {@inheritDoc} */ public void contextInitialized(ServletContextEvent servletContextEvent) { - Context context; try { - context = new InitialContext(); + Context context = new InitialContext(); DataSource dataSource = (DataSource) context.lookup("java:/comp/env/jdbc/demosceneMusic"); Database database = AbstractDatabase.fromDataSource(dataSource); dataManager = new DataManager(database); -- 2.7.4