From 6ca1a9a369b10703da9af8f8a1ced0f3b02ae5c2 Mon Sep 17 00:00:00 2001 From: Deepak Bhole Date: Mon, 6 Dec 2010 15:34:01 -0500 Subject: Fixed indentation and spacing for all .java files. Added a new .settings directory which contains Eclipse preferences for code style. --- netx/javax/jnlp/ServiceManager.java | 64 +++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 35 deletions(-) (limited to 'netx/javax/jnlp/ServiceManager.java') diff --git a/netx/javax/jnlp/ServiceManager.java b/netx/javax/jnlp/ServiceManager.java index 7e6fb36..2f35a6f 100644 --- a/netx/javax/jnlp/ServiceManager.java +++ b/netx/javax/jnlp/ServiceManager.java @@ -1,54 +1,48 @@ - - - package javax.jnlp; import java.util.*; - public final class ServiceManager { - private static ServiceManagerStub stub = null; + private static ServiceManagerStub stub = null; - private static Map lookupTable - = new HashMap(); // ensure lookup is idempotent - - private ServiceManager() { - // says it can't be instantiated - } + private static Map lookupTable = new HashMap(); // ensure lookup is idempotent + private ServiceManager() { + // says it can't be instantiated + } - public static java.lang.Object lookup(java.lang.String name) throws UnavailableServiceException { - if (stub == null) - throw new UnavailableServiceException("service stub not set."); + public static java.lang.Object lookup(java.lang.String name) throws UnavailableServiceException { + if (stub == null) + throw new UnavailableServiceException("service stub not set."); - synchronized(lookupTable) { - Object result = lookupTable.get(name); + synchronized (lookupTable) { + Object result = lookupTable.get(name); - if (result == null) { - result = stub.lookup(name); - if (result != null) - lookupTable.put(name, result); - } + if (result == null) { + result = stub.lookup(name); + if (result != null) + lookupTable.put(name, result); + } - if (result == null) - throw new UnavailableServiceException("service not available (stub returned null)."); + if (result == null) + throw new UnavailableServiceException("service not available (stub returned null)."); - return result; + return result; + } } - } - public static java.lang.String[] getServiceNames() { - // should this return the required ones even though no stub?? - if (stub == null) - return new String[0]; + public static java.lang.String[] getServiceNames() { + // should this return the required ones even though no stub?? + if (stub == null) + return new String[0]; - return stub.getServiceNames(); - } + return stub.getServiceNames(); + } - public static void setServiceManagerStub(ServiceManagerStub stub) { - if (ServiceManager.stub == null) - ServiceManager.stub = stub; - } + public static void setServiceManagerStub(ServiceManagerStub stub) { + if (ServiceManager.stub == null) + ServiceManager.stub = stub; + } } -- cgit v1.2.3