Various cleanups

- missing copytight headers
- unused imports
- obsolete comments
- rename some strnage method names
This commit is contained in:
Kris De Volder
2018-07-12 14:19:56 -07:00
parent 57f42c9883
commit f29e7e9954
5 changed files with 23 additions and 10 deletions

View File

@@ -64,9 +64,7 @@ public class LocalSpringBootApp extends AbstractSpringBootApp {
public static Collection<SpringBootApp> getAllRunningJavaApps() throws Exception {
return cache.getAllRunningJavaApps();
}
/**
* @return Map that contains the boot apps, mapping the process ID -> boot app accessor object
*/
public static Collection<SpringBootApp> getAllRunningSpringApps() throws Exception {
return getAllRunningJavaApps().stream().filter(SpringBootApp::isSpringBootApp).collect(CollectorUtil.toImmutableList());
}

View File

@@ -1,3 +1,13 @@
/*******************************************************************************
* Copyright (c) 2018 Pivotal, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.vscode.commons.boot.app.cli;
import java.io.IOException;
@@ -30,7 +40,7 @@ public interface SpringBootApp {
Properties getSystemProperties() throws Exception;
JMXConnector getJmxConnector() throws MalformedURLException, IOException;
default String getSystemProperties(String string) throws Exception {
default String getSystemProperty(String string) throws Exception {
Object r = getSystemProperties().get(string);
if (r instanceof String) {
return (String) r;

View File

@@ -94,7 +94,7 @@ public class DefaultRunningAppProvider implements ProjectAwareRunningAppProvider
public static boolean doesProjectNameMatch(SpringBootApp app, IJavaProject project) {
try {
String projectName = app.getSystemProperties("spring.boot.project.name");
String projectName = app.getSystemProperty("spring.boot.project.name");
return projectName != null && projectName.equals(project.getElementName());
}
catch (Exception e) {

View File

@@ -1,3 +1,13 @@
/*******************************************************************************
* Copyright (c) 2018 Pivotal, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.vscode.boot.java.handlers;
import java.util.Collection;
@@ -14,8 +24,6 @@ import org.springframework.ide.vscode.commons.languageserver.util.Settings;
import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer;
import org.springframework.ide.vscode.commons.util.CollectorUtil;
import com.google.common.collect.ImmutableList;
public class RemoteRunningAppsProvider implements RunningAppProvider {
private static Logger logger = LoggerFactory.getLogger(RemoteRunningAppsProvider.class);

View File

@@ -40,9 +40,6 @@ public interface RunningAppProvider {
public static final RunningAppProvider NULL = () -> ImmutableList.of();
/**
* returns all running spring boot applications on the local machine.
*/
Collection<SpringBootApp> getAllRunningSpringApps() throws Exception;
static RunningAppProvider createDefault(SimpleLanguageServer server) {