diff --git a/bindings/java/src/net/hyperic/sigar/win32/Service.java b/bindings/java/src/net/hyperic/sigar/win32/Service.java index f38948bc..73551628 100644 --- a/bindings/java/src/net/hyperic/sigar/win32/Service.java +++ b/bindings/java/src/net/hyperic/sigar/win32/Service.java @@ -137,20 +137,17 @@ public class Service extends Win32 { throws Win32Exception { if (serviceName == null) { - throw new IllegalArgumentException("The serviceName argument " + - "cannot be null."); - } - - if (displayName == null) { - throw new IllegalArgumentException("The displayName argument " + - "cannot be null."); + throw new IllegalArgumentException("serviceName=null"); } if (path == null) { - throw new IllegalArgumentException("The displayName argument " + - "cannot be null."); + throw new IllegalArgumentException("path=null"); } - + + if (displayName == null) { + displayName = serviceName; + } + Service service = new Service(); service.service = CreateService(service.manager, serviceName,