From ca2f1ab4a37f0d590d5c116cd1fa7c341c77fad3 Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Mon, 30 Dec 2019 22:16:46 +0100 Subject: Implement modular getZoneSet --- src/main/java/pl/edu/mimuw/cloudatlas/model/ZMI.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/model') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/model/ZMI.java b/src/main/java/pl/edu/mimuw/cloudatlas/model/ZMI.java index 54fbf43..cda0296 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/model/ZMI.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/model/ZMI.java @@ -219,8 +219,12 @@ public class ZMI implements Cloneable, Serializable { * @return a PathName object representing this zone */ public PathName getPathName() { - String name = ((ValueString)getAttributes().get("name")).getValue(); - return getFather() == null? PathName.ROOT : getFather().getPathName().levelDown(name); + if (getFather() == null) { + return PathName.ROOT; + } else { + String name = ((ValueString)getAttributes().get("name")).getValue(); + return getFather().getPathName().levelDown(name); + } } public static ZMI deserialize(InputStream in) { -- cgit v1.2.3