wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From el...@apache.org
Subject svn commit: r816071 - /incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/ClientConfig.java
Date Thu, 17 Sep 2009 06:54:59 GMT
Author: elman
Date: Thu Sep 17 06:54:59 2009
New Revision: 816071

URL: http://svn.apache.org/viewvc?rev=816071&view=rev
Log:
fix [WINK-191]

Modified:
    incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/ClientConfig.java

Modified: incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/ClientConfig.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/ClientConfig.java?rev=816071&r1=816070&r2=816071&view=diff
==============================================================================
--- incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/ClientConfig.java
(original)
+++ incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/ClientConfig.java
Thu Sep 17 06:54:59 2009
@@ -72,12 +72,15 @@
         followRedirects = true;
         isAcceptHeaderAutoSet = true;
         handlers = new LinkedList<ClientHandler>();
-        applications = new LinkedList<Application>();
-        initDefaultApplication();
     }
 
     private void initDefaultApplication() {
 
+        if (applications != null) {
+            return;
+        } else {
+            applications = new LinkedList<Application>();
+        }
         try {
             final Set<Class<?>> classes =
                 new ApplicationFileLoader(loadWinkApplications).getClasses();
@@ -305,6 +308,9 @@
      * @return
      */
     public final List<Application> getApplications() {
+        if (applications == null) {
+            initDefaultApplication();
+        }
         return Collections.unmodifiableList(applications);
     }
 
@@ -319,6 +325,9 @@
         if (!modifiable) {
             throw new ClientConfigException("configuration is unmodifiable");
         }
+        if (this.applications == null) {
+            initDefaultApplication();
+        }
         for (Application application : applications) {
             this.applications.add(application);
         }
@@ -327,6 +336,9 @@
 
     @Override
     protected ClientConfig clone() {
+        if (applications == null) {
+            initDefaultApplication();
+        }
         try {
             ClientConfig clone = (ClientConfig)super.clone();
             clone.handlers = new LinkedList<ClientHandler>(handlers);



Mime
View raw message