diff --git a/bindings/java/src/org/hyperic/sigar/win32/EventLogRecord.java b/bindings/java/src/org/hyperic/sigar/win32/EventLogRecord.java index bd28ba41..cc432970 100644 --- a/bindings/java/src/org/hyperic/sigar/win32/EventLogRecord.java +++ b/bindings/java/src/org/hyperic/sigar/win32/EventLogRecord.java @@ -25,6 +25,8 @@ import java.util.Date; */ public class EventLogRecord { + private static final String NA = "N/A"; + long recordNumber; long timeGenerated; long timeWritten; @@ -158,7 +160,14 @@ public class EventLogRecord { public String getUser() { return this.user; } - + + private String getUserString() { + if (this.user == null) { + return NA; + } + return this.user; + } + /** * Get the message for the event. */ @@ -184,7 +193,7 @@ public class EventLogRecord { "[" + getSource() + "] " + "[" + getCategoryString() + "] " + "[" + getEventId() + "] " + - "[" + getUser() + "] " + + "[" + getUserString() + "] " + "[" + getComputerName() + "] " + getMessage(); }