Upgrade boot and rewrite libs
This commit is contained in:
@@ -17,13 +17,14 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.ide.vscode.bosh.BoshCliConfig;
|
||||
import org.springframework.ide.vscode.commons.util.Assert;
|
||||
import org.springframework.ide.vscode.commons.util.CollectorUtil;
|
||||
import org.springframework.ide.vscode.commons.util.ExternalCommand;
|
||||
import org.springframework.ide.vscode.commons.util.ExternalProcess;
|
||||
import org.springframework.ide.vscode.commons.util.GsonUtil;
|
||||
import org.springframework.ide.vscode.commons.util.Log;
|
||||
import org.springframework.ide.vscode.commons.util.StringUtil;
|
||||
import org.springframework.ide.vscode.commons.util.text.LanguageId;
|
||||
import org.springframework.ide.vscode.commons.util.text.TextDocument;
|
||||
@@ -31,7 +32,7 @@ import org.springframework.ide.vscode.commons.yaml.ast.YamlFileAST;
|
||||
import org.springframework.ide.vscode.commons.yaml.ast.YamlParser;
|
||||
import org.springframework.ide.vscode.commons.yaml.path.YamlTraversal;
|
||||
import org.springframework.ide.vscode.commons.yaml.util.JSONCursor;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
import org.yaml.snakeyaml.DumperOptions;
|
||||
import org.yaml.snakeyaml.representer.Representer;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
@@ -44,6 +45,8 @@ import com.google.gson.annotations.SerializedName;
|
||||
* command (with `--json`) swtich and then extracts information from its json output.
|
||||
*/
|
||||
public abstract class BoshCommandBasedModelProvider<T> implements DynamicModelProvider<T> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BoshCommandBasedModelProvider.class);
|
||||
|
||||
private final YamlParser yamlParser;
|
||||
|
||||
@@ -55,7 +58,7 @@ public abstract class BoshCommandBasedModelProvider<T> implements DynamicModelPr
|
||||
|
||||
protected BoshCommandBasedModelProvider(BoshCliConfig config) {
|
||||
this.config = config;
|
||||
Representer representer = new Representer();
|
||||
Representer representer = new Representer(new DumperOptions());
|
||||
representer.getPropertyUtils().setSkipMissingProperties(true);
|
||||
yamlParser = new YamlParser();
|
||||
}
|
||||
@@ -115,7 +118,7 @@ public abstract class BoshCommandBasedModelProvider<T> implements DynamicModelPr
|
||||
|
||||
protected String executeCommand(ExternalCommand command) throws Exception {
|
||||
if (command==null) {
|
||||
Log.log("bosh cli based editor features are disabled");
|
||||
log.warn("bosh cli based editor features are disabled");
|
||||
throw new IOException("bosh cli based editor features are disabled. "
|
||||
+ "Consult the atom/vscode extension's readme for detailed "
|
||||
+ "instructions on how to target a director and enable them.");
|
||||
@@ -124,7 +127,7 @@ public abstract class BoshCommandBasedModelProvider<T> implements DynamicModelPr
|
||||
ExternalProcess process = new ExternalProcess(getWorkingDir(), command, true, config.getTimeout());
|
||||
return process.getOut();
|
||||
} catch (Exception e) {
|
||||
Log.log("executing cmd FAILED", e);
|
||||
log.error("executing cmd FAILED", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2016-2017 Pivotal, Inc.
|
||||
* Copyright (c) 2016-2023 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
|
||||
@@ -38,7 +38,7 @@ public class YamlParser implements YamlASTProvider {
|
||||
reader.setInput(atTokenTransformHack(doc.get()));
|
||||
LoaderOptions loaderOpts = new LoaderOptions();
|
||||
loaderOpts.setMaxAliasesForCollections(1000);
|
||||
Iterable<Node> nodes = new Yaml(new SafeConstructor(loaderOpts), new Representer(), new DumperOptions(), loaderOpts).composeAll(reader);
|
||||
Iterable<Node> nodes = new Yaml(new SafeConstructor(loaderOpts), new Representer(new DumperOptions()), new DumperOptions(), loaderOpts).composeAll(reader);
|
||||
return new YamlFileAST(doc, ImmutableList.copyOf(nodes));
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.1.5</version>
|
||||
<version>3.2.1</version>
|
||||
<relativePath></relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -118,9 +118,9 @@
|
||||
<kotlin.version>1.9.20</kotlin.version>
|
||||
|
||||
<!-- Rewrite specific properties -->
|
||||
<rewrite-version>8.9.9</rewrite-version>
|
||||
<rewrite-kotlin-version>1.7.7</rewrite-kotlin-version>
|
||||
<rewrite-spring-version>5.1.4</rewrite-spring-version>
|
||||
<rewrite-version>8.11.5</rewrite-version>
|
||||
<rewrite-kotlin-version>1.8.4</rewrite-kotlin-version>
|
||||
<rewrite-spring-version>5.1.7</rewrite-spring-version>
|
||||
<rewrite-gradle-tooling-api-version>1.5.0</rewrite-gradle-tooling-api-version>
|
||||
|
||||
<gradle-tooling.version>8.4</gradle-tooling.version>
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.springframework.ide.vscode.commons.util.FileObserver;
|
||||
import org.springframework.ide.vscode.commons.util.FuzzyMap;
|
||||
import org.springframework.ide.vscode.commons.util.text.LanguageId;
|
||||
import org.springframework.ide.vscode.commons.yaml.ast.NodeUtil;
|
||||
import org.yaml.snakeyaml.LoaderOptions;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
import org.yaml.snakeyaml.constructor.SafeConstructor;
|
||||
import org.yaml.snakeyaml.nodes.MappingNode;
|
||||
@@ -140,7 +141,7 @@ public class AdHocSpringPropertyIndexProvider implements ProjectBasedPropertyInd
|
||||
|
||||
private Properties parseYaml(File yamlFile) {
|
||||
if (yamlFile.isFile()) {
|
||||
Yaml yaml = new Yaml(new SafeConstructor());
|
||||
Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));
|
||||
try (Reader reader = new InputStreamReader(new FileInputStream(yamlFile), "UTF8")) {
|
||||
Properties props = new Properties();
|
||||
for (Node node : yaml.composeAll(reader)) {
|
||||
|
||||
Reference in New Issue
Block a user