From 7dc4713c97ad0dcc2644e2009ee316be3cee613c Mon Sep 17 00:00:00 2001 From: Martin Lippert Date: Wed, 1 Feb 2017 15:30:49 +0100 Subject: [PATCH] refactored code to avoid duplicate string constants --- .../servers/SpringBootPropertiesLanguageServer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/src/org/springframework/boot/ide/properties/servers/SpringBootPropertiesLanguageServer.java b/eclipse-language-servers/org.springframework.boot.ide.properties.servers/src/org/springframework/boot/ide/properties/servers/SpringBootPropertiesLanguageServer.java index 3b3536788..eb69d50e3 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/src/org/springframework/boot/ide/properties/servers/SpringBootPropertiesLanguageServer.java +++ b/eclipse-language-servers/org.springframework.boot.ide.properties.servers/src/org/springframework/boot/ide/properties/servers/SpringBootPropertiesLanguageServer.java @@ -78,7 +78,7 @@ public class SpringBootPropertiesLanguageServer extends ProcessStreamConnectionP File dataFile = bundle.getDataFile(languageServer); if (!dataFile.exists()) { try { - copyLanguageServerJAR(); + copyLanguageServerJAR(languageServer); } catch (Exception e) { e.printStackTrace(); @@ -93,11 +93,11 @@ public class SpringBootPropertiesLanguageServer extends ProcessStreamConnectionP return System.getProperty("user.dir"); } - protected void copyLanguageServerJAR() throws Exception { + protected void copyLanguageServerJAR(String languageServerJarName) throws Exception { Bundle bundle = Platform.getBundle(Constants.PLUGIN_ID); - InputStream stream = FileLocator.openStream( bundle, new Path("servers/vscode-boot-properties-0.0.1-SNAPSHOT.jar"), false ); + InputStream stream = FileLocator.openStream( bundle, new Path("servers/" + languageServerJarName), false ); - File dataFile = bundle.getDataFile("vscode-boot-properties-0.0.1-SNAPSHOT.jar"); + File dataFile = bundle.getDataFile(languageServerJarName); Files.copy(stream, dataFile.toPath(), StandardCopyOption.REPLACE_EXISTING); }