From: Minkee Lee Date: Thu, 4 Feb 2016 13:12:20 +0000 (+0900) Subject: VM-property: set VMPropertyValue early X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=29b0951129129b50af99dc8334427c85e16f2a79;p=sdk%2Femulator%2Femulator-manager.git VM-property: set VMPropertyValue early Change-Id: I55333be372172204b27432196edac66e947eb402 Signed-off-by: Minkee Lee --- diff --git a/src/org/tizen/emulator/manager/platform/Profile.java b/src/org/tizen/emulator/manager/platform/Profile.java index 2aeb482..e7f69e3 100644 --- a/src/org/tizen/emulator/manager/platform/Profile.java +++ b/src/org/tizen/emulator/manager/platform/Profile.java @@ -75,6 +75,11 @@ public class Profile { this.name = name; initLastCreatedPropertyPath(); + // XXX remove if there is no listener in console mode. + if (EmulatorManager.isConsoleMode()) { + return; + } + VMKeeper.addListChangeListener(new ListChangeListener() { @Override public void elementRemoved(VMProperty property) { diff --git a/src/org/tizen/emulator/manager/vms/VMProperty.java b/src/org/tizen/emulator/manager/vms/VMProperty.java index d027b53..13eff8a 100644 --- a/src/org/tizen/emulator/manager/vms/VMProperty.java +++ b/src/org/tizen/emulator/manager/vms/VMProperty.java @@ -170,21 +170,22 @@ public final class VMProperty { configuration.setConfiguration(element); } - if (value != null) { - value.settingConfigure(this); + value = new VMPropertyValue(this); + + // Each platform has default-property and it doesn't have name. + if (value.vmsName == null) { + return; } - if (configuration.getName() != null) { - Path logFile = Paths.get(VMLogUtil.getEmulatorLogPath(configuration.getName())); - if (Files.exists(logFile)) { - try { - lastLaunched = Files.getLastModifiedTime(logFile).toMillis(); - } catch (IOException e) { - e.printStackTrace(); - } - } else { - lastLaunched = 0; + Path logFile = Paths.get(VMLogUtil.getEmulatorLogPath(value.vmsName)); + if (Files.exists(logFile)) { + try { + lastLaunched = Files.getLastModifiedTime(logFile).toMillis(); + } catch (IOException e) { + e.printStackTrace(); } + } else { + lastLaunched = 0; } }; @@ -211,10 +212,7 @@ public final class VMProperty { } public VMPropertyValue getPropertyValue() { - if(this.value == null) { - this.value = new VMPropertyValue(this); - } - + assert value != null; return value; }