mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 10:36:06 +01:00
fix: Java 11 compatibility with instanceof pattern
This commit is contained in:
parent
e3e3c039c3
commit
433160f187
@ -107,8 +107,8 @@ public class MVSettings {
|
||||
if (node.getComments().length > 0) {
|
||||
tempConfig.addComment(node.getPath(), node.getComments());
|
||||
}
|
||||
if (node instanceof ValueNode valueNode) {
|
||||
tempConfig.set(node.getPath(), get(valueNode));
|
||||
if (node instanceof ValueNode) {
|
||||
tempConfig.set(node.getPath(), get((ValueNode) node));
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@ public class MVSettings {
|
||||
*/
|
||||
public Object get(@NotNull String name) {
|
||||
return nodes.findNode(name)
|
||||
.map(node -> (node instanceof ValueNode valueNode) ? get(valueNode) : null)
|
||||
.map(node -> (node instanceof ValueNode) ? get((ValueNode) node) : null)
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ public class MVSettings {
|
||||
*/
|
||||
public boolean set(@NotNull String name, Object value) {
|
||||
return nodes.findNode(name)
|
||||
.map(node -> node instanceof ValueNode valueNode && set(valueNode, value))
|
||||
.map(node -> node instanceof ValueNode && set((ValueNode) node, value))
|
||||
.orElse(false);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user