Source:
<code>private void downloadDatabase() { try { String url; if (config.getBoolean("database.show-cities", false)) { url = config.getString("database.download-url-city"); } else { url = config.getString("database.download-url"); } if (url == null || url.isEmpty()) { logger.log(Level.SEVERE, tl("geoIpUrlEmpty")); return; } String licenseKey = config.getString("database.license-key", ""); if (licenseKey == null || licenseKey.isEmpty()) { logger.log(Level.SEVERE, tl("geoIpLicenseMissing")); return; <START> } else { url = url.replace("{LICENSEKEY}", licenseKey); } <END> logger.log(Level.INFO, tl("downloadingGeoIp")); URL downloadUrl = new URL(url); URLConnection conn = downloadUrl.openConnection(); conn.setConnectTimeout(10000); conn.connect(); InputStream input = conn.getInputStream(); OutputStream output = new FileOutputStream(databaseFile); byte[] buffer = new byte[2048]; if (url.contains("gz")) { input = new GZIPInputStream(input); if (url.contains("tar.gz")) { String filename; TarInputStream tarInputStream = new TarInputStream(input); TarEntry entry; while ((entry = tarInputStream.getNextEntry()) != null) { if (!entry.isDirectory()) { filename = entry.getName(); if (filename.substring(filename.length() - 5).equalsIgnoreCase(".mmdb")) { input = tarInputStream; break; } } } } } int length = input.read(buffer); while (length >= 0) { output.write(buffer, 0, length); length = input.read(buffer); } output.close(); input.close(); } catch (MalformedURLException ex) { logger.log(Level.SEVERE, tl("geoIpUrlInvalid"), ex); } catch (IOException ex) { logger.log(Level.SEVERE, tl("connectionFailed"), ex); } }</code><technical_language>need else branch, put "return" in line 181</technical_language>

Target:
private void downloadDatabase() { try { String url; if (config.getBoolean("database.show-cities", false)) { url = config.getString("database.download-url-city"); } else { url = config.getString("database.download-url"); } if (url == null || url.isEmpty()) { logger.log(Level.SEVERE, tl("geoIpUrlEmpty")); return; } String licenseKey = config.getString("database.license-key", ""); if (licenseKey == null || licenseKey.isEmpty()) { logger.log(Level.SEVERE, tl("geoIpLicenseMissing")); return; } url = url.replace("{LICENSEKEY}", licenseKey); logger.log(Level.INFO, tl("downloadingGeoIp")); URL downloadUrl = new URL(url); URLConnection conn = downloadUrl.openConnection(); conn.setConnectTimeout(10000); conn.connect(); InputStream input = conn.getInputStream(); OutputStream output = new FileOutputStream(databaseFile); byte[] buffer = new byte[2048]; if (url.contains("gz")) { input = new GZIPInputStream(input); if (url.contains("tar.gz")) { String filename; TarInputStream tarInputStream = new TarInputStream(input); TarEntry entry; while ((entry = tarInputStream.getNextEntry()) != null) { if (!entry.isDirectory()) { filename = entry.getName(); if (filename.substring(filename.length() - 5).equalsIgnoreCase(".mmdb")) { input = tarInputStream; break; } } } } } int length = input.read(buffer); while (length >= 0) { output.write(buffer, 0, length); length = input.read(buffer); } output.close(); input.close(); } catch (MalformedURLException ex) { logger.log(Level.SEVERE, tl("geoIpUrlInvalid"), ex); } catch (IOException ex) { logger.log(Level.SEVERE, tl("connectionFailed"), ex); } }