-
Notifications
You must be signed in to change notification settings - Fork 519
Closed
Description
VSCode implicitly import java.lang.StringTemplate.STR which conflict with org.yaml.snakeyaml.nodes.Tag.STR
Environment
- Operating System: Windows 10
- JDK version: 21
- Visual Studio Code version: 1.86.2
- Java extension version: v1.28.1
Steps To Reproduce
- Clone the open source project https://github.com/jhipster/jhipster-lite
- Import the java project
- Go to file tech.jhipster.lite.module.infrastructure.secondary.YamlFileSpringPropertiesHandler.java
- See the compilation error (
Type mismatch: cannot convert from StringTemplate.Processor<String,RuntimeException> to Tag)
Current Result
I have to change the code only to run the project:
FROM:
private Node buildScalarNode(Object value) {
Tag tag = STR;
if (value instanceof Integer || value instanceof Long) {
tag = INT;
} else if (value instanceof Double || value instanceof Float) {
tag = FLOAT;
} else if (value instanceof Boolean) {
tag = BOOL;
}
return new ScalarNode(tag, value.toString(), null, null, DumperOptions.ScalarStyle.PLAIN);
}TO:
private Node buildScalarNode(Object value) {
Tag tag = Tag.STR;
if (value instanceof Integer || value instanceof Long) {
tag = INT;
} else if (value instanceof Double || value instanceof Float) {
tag = FLOAT;
} else if (value instanceof Boolean) {
tag = BOOL;
}
return new ScalarNode(tag, value.toString(), null, null, DumperOptions.ScalarStyle.PLAIN);
}Expected Result
Is there a configuration to solve this problem without need to explicitly use Tag.STR?
Additional Informations
Reactions are currently unavailable
