From 82a5ad05ab6d6460461ac705230ef4a9f4af6792 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sun, 26 Jun 2005 02:39:34 +0000 Subject: [PATCH] default displayName to serviceName --- .../src/net/hyperic/sigar/win32/Service.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) 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,