From: David ‘Bombe’ Roden Date: Wed, 18 Apr 2012 21:40:26 +0000 (+0200) Subject: Declare context in the try-catch block. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=5d19c11df7ca4a969fbfe7583ca934174fb348bf;p=demoscenemusic.git Declare context in the try-catch block. --- 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);