起初我有一个类:
public class MyClass implements Serializable {
private List<Role> roles;
}
Run Code Online (Sandbox Code Playgroud)
SonarQube指出List
,可序列化类的成员本身不可序列化.很公平,我会切换到序列化实施的List
类似ArrayList
.
public class MyClass implements Serializable {
private ArrayList<Role> roles;
}
Run Code Online (Sandbox Code Playgroud)
在这一点上,SonarQube不高兴,因为"角色应该使用诸如'List'之类的接口,而不是像'ArrayList'这样的实现,这让我回到原来的位置.
有没有办法摆脱这种循环?
我目前正在将Spring Cloud Vault Config集成到Spring Boot应用程序中。从主页:
Spring Cloud Vault Config使用应用程序名称和活动配置文件从Vault读取配置属性:
/secret/{application}/{profile}
/secret/{application}
/secret/{default-context}/{profile}
/secret/{default-context}
Run Code Online (Sandbox Code Playgroud)
我想提供自己的位置,从中从不以/ secret开头的Vault中提取属性(例如/ deployments / prod)。我一直在浏览参考文档,但始终没有找到指定它的方法-可以吗?