felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject svn commit: r566203 - in /felix/trunk: eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/tasks/ framework/src/main/java/org/apache/felix/framework/cache/ framework/src/main/java/org/apache/felix/framework/searchpolicy/ framework/src/main/j...
Date Wed, 15 Aug 2007 14:51:54 GMT
Author: pauls
Date: Wed Aug 15 07:51:53 2007
New Revision: 566203

URL: http://svn.apache.org/viewvc?view=rev&rev=566203
Log:
Rollback to previous version to undo the formating changes.

Modified:
    felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/tasks/DispatchTask.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleArchive.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleRevision.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
    felix/trunk/framework/src/main/java/org/osgi/framework/AdminPermission.java

Modified: felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/tasks/DispatchTask.java
URL: http://svn.apache.org/viewvc/felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/tasks/DispatchTask.java?view=diff&rev=566203&r1=566202&r2=566203
==============================================================================
--- felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/tasks/DispatchTask.java (original)
+++ felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/tasks/DispatchTask.java Wed Aug 15 07:51:53 2007
@@ -1,4 +1,4 @@
-/*
+/* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -22,21 +22,50 @@
 import org.apache.felix.eventadmin.impl.dispatch.TaskProducer;
 
 /**
- * This class is the core of the event dispatching (for both, synchronous and
+ * This class is the core of the event dispatching (for both, synchronous and 
  * asynchronous). It implements handover and timeout capabilities.
- *
+ * 
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class DispatchTask implements Runnable
-{
+{   
+    // A null scheduler object that does not schedule given tasks
+    private static final Scheduler NULL_SCHEDULER = new Scheduler()
+    {
+        /**
+         * This is a null object and will do nothing with the given task
+         * 
+         * @param task A task that is not used
+         * 
+         * @see org.apache.felix.eventadmin.impl.dispatch.Scheduler#schedule(java.lang.Runnable)
+         */
+        public void schedule(final Runnable task)
+        {
+            // This is a null object and will do nothing with the given task
+        }
+
+        /**
+         * This is a null object and will do nothing with the given task
+         * 
+         * @param task A task that is not used
+         * @parma nice A value that is not used
+         * 
+         * @see org.apache.felix.eventadmin.impl.dispatch.Scheduler#schedule(java.lang.Runnable, int)
+         */
+        public void schedule(final Runnable task, final int nice)
+        {
+            // This is a null object and will do nothing with the given task
+        }
+    };
+
     // A null producer object that will return null on any call to next()
     private static final TaskProducer NULL_PRODUCER = new TaskProducer()
     {
         /**
          * This is a null object and will return <tt>null</tt>
-         *
+         * 
          * @return <tt>null</tt>
-         *
+         * 
          * @see org.apache.felix.eventadmin.impl.dispatch.TaskProducer#next()
          */
         public HandlerTask next()
@@ -50,17 +79,17 @@
     {
         /**
          * This is a null object that will do nothing.
-         *
+         * 
          * @parma task A task that is not used
-         *
+         * 
          * @see org.apache.felix.eventadmin.impl.tasks.HandoverTask#execute(org.apache.felix.eventadmin.impl.tasks.DispatchTask)
          */
         public void execute(final DispatchTask task)
         {
             // This is a null object that will do nothing.
-        }
+        } 
     };
-
+    
     //  The internal lock for this object used instead synchronized(this)
     final Object m_lock = new Object();
 
@@ -82,9 +111,9 @@
     private boolean m_isHolding = false;
 
     /**
-     * The constructor of the object.
-     *
-     * @param producer The producer (i.e., the event queue) that provides the next
+     * The constructor of the object. 
+     * 
+     * @param producer The producer (i.e., the event queue) that provides the next 
      *      tasks
      * @param scheduler The scheduler to use for timeout actions
      * @param handover The callback to use on timeouts and handovers
@@ -98,7 +127,7 @@
 
         m_handover = handover;
     }
-
+    
     /*
      * Construct a new object from a old one.
      */
@@ -108,9 +137,9 @@
     }
 
     /**
-     * This will loop until the producer returns <tt>null</tt>. Until then the
+     * This will loop until the producer returns <tt>null</tt>. Until then the 
      * returned tasks are executed.
-     *
+     * 
      * @see java.lang.Runnable#run()
      */
     public void run()
@@ -120,7 +149,7 @@
         {
             synchronized (m_lock)
             {
-                // Set-up the timeout
+                // Set-up the timeout 
                 m_blackListTask = new BlackListTask(manager);
 
                 m_scheduler.schedule(m_blackListTask);
@@ -131,14 +160,14 @@
 
             synchronized (m_lock)
             {
-                // release the timeout
+                // release the timeout 
                 m_blackListTask.cancel();
             }
         }
     }
 
     /**
-     * This method will trigger a callback to the handover callback and stop this
+     * This method will trigger a callback to the handover callback and stop this 
      * task.
      */
     public void handover()
@@ -151,10 +180,10 @@
             // spin-off a new thread
             m_handover.execute(new DispatchTask(this));
 
-            this.stop();
+            stop();
         }
     }
-
+    
     /**
      * This method stops the tasks without a handover
      */
@@ -169,12 +198,12 @@
 
             m_producer = NULL_PRODUCER;
 
-            m_scheduler = Scheduler.NULL_SCHEDULER;
+            m_scheduler = NULL_SCHEDULER;
         }
     }
 
     /**
-     * This will pause the task (including its timeout clock) until a call to
+     * This will pause the task (including its timeout clock) until a call to 
      * <tt>resume()</tt>
      */
     public void hold()
@@ -205,7 +234,7 @@
             }
 
             // restore the timeout
-            m_blackListTask = new BlackListTask(m_blackListTask,
+            m_blackListTask = new BlackListTask(m_blackListTask, 
                 System.currentTimeMillis() - pastTime);
 
             m_scheduler.schedule(m_blackListTask, pastTime);
@@ -243,11 +272,11 @@
         {
             this(manager, System.currentTimeMillis());
         }
-
+        
         BlackListTask(final HandlerTask manager, final long time)
         {
             m_manager = manager;
-
+            
             m_time = time;
         }
 
@@ -265,20 +294,20 @@
         }
 
         /**
-         * We have been triggered hence, blacklist the handler except if we are
+         * We have been triggered hence, blacklist the handler except if we are 
          * already canceled
-         *
+         * 
          * @see java.lang.Runnable#run()
          */
         public void run()
         {
-            synchronized (DispatchTask.this.m_lock)
+            synchronized (m_lock)
             {
                 if (!m_canceled)
                 {
                     m_manager.blackListHandler();
 
-                    DispatchTask.this.handover();
+                    handover();
                 }
             }
         }
@@ -288,7 +317,7 @@
          */
         public void cancel()
         {
-            synchronized (DispatchTask.this.m_lock)
+            synchronized (m_lock)
             {
                 m_canceled = true;
             }

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleArchive.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleArchive.java?view=diff&rev=566203&r1=566202&r2=566203
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleArchive.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleArchive.java Wed Aug 15 07:51:53 2007
@@ -18,17 +18,7 @@
  */
 package org.apache.felix.framework.cache;
 
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Serializable;
+import java.io.*;
 
 import org.apache.felix.framework.Logger;
 import org.apache.felix.framework.util.ObjectInputStreamX;
@@ -147,10 +137,10 @@
         m_originalLocation = location;
 
         // Save state.
-        this.initialize();
+        initialize();
 
         // Add a revision for the content.
-        this.revise(m_originalLocation, is);
+        revise(m_originalLocation, is);
     }
 
     /**
@@ -184,7 +174,7 @@
             // will be in a directory named like:
             //     "${REVISION_DIRECTORY)${refresh-count}.${revision-count}"
             File revisionRootDir = new File(m_archiveRootDir,
-                REVISION_DIRECTORY + this.getRefreshCount() + "." + revisionCount);
+                REVISION_DIRECTORY + getRefreshCount() + "." + revisionCount);
             if (!BundleCache.getSecureAction().fileExists(revisionRootDir))
             {
                 break;
@@ -208,7 +198,7 @@
         // to read the location from the current revision - if that fails we
         // likely have an old bundle cache and read the location the old way.
         // The next revision will update the bundle cache.
-        this.revise(this.getRevisionLocation(revisionCount - 1), null);
+        revise(getRevisionLocation(revisionCount - 1), null);
     }
 
     /**
@@ -382,7 +372,7 @@
         {
             m_logger.log(
                 Logger.LOG_ERROR,
-                this.getClass().getName() + ": Unable to record state - " + ex);
+                getClass().getName() + ": Unable to record state - " + ex);
             throw ex;
         }
         finally
@@ -459,7 +449,7 @@
         {
             m_logger.log(
                 Logger.LOG_ERROR,
-                this.getClass().getName() + ": Unable to record start level - " + ex);
+                getClass().getName() + ": Unable to record start level - " + ex);
             throw ex;
         }
         finally
@@ -538,7 +528,7 @@
         {
             m_logger.log(
                 Logger.LOG_ERROR,
-                this.getClass().getName() + ": Unable to record last modification time - " + ex);
+                getClass().getName() + ": Unable to record last modification time - " + ex);
             throw ex;
         }
         finally
@@ -614,7 +604,7 @@
         {
             m_logger.log(
                 Logger.LOG_ERROR,
-                this.getClass().getName() + ": Trying to deserialize - " + ex);
+                getClass().getName() + ": Trying to deserialize - " + ex);
         }
         finally
         {
@@ -653,7 +643,7 @@
         {
             m_logger.log(
                 Logger.LOG_ERROR,
-                this.getClass().getName() + ": Unable to serialize activator - " + ex);
+                getClass().getName() + ": Unable to serialize activator - " + ex);
             throw ex;
         }
         finally
@@ -708,13 +698,13 @@
         {
             location = "inputstream:";
         }
-        BundleRevision revision = this.createRevisionFromLocation(location, is);
+        BundleRevision revision = createRevisionFromLocation(location, is);
         if (revision == null)
         {
             throw new Exception("Unable to revise archive.");
         }
 
-        this.setRevisionLocation(location, (m_revisions == null) ? 0 : m_revisions.length);
+        setRevisionLocation(location, (m_revisions == null) ? 0 : m_revisions.length);
 
         // Add new revision to revision array.
         if (m_revisions == null)
@@ -745,12 +735,12 @@
     public synchronized boolean undoRevise() throws Exception
     {
         // Can only undo the revision if there is more than one.
-        if (this.getRevisionCount() <= 1)
+        if (getRevisionCount() <= 1)
         {
             return false;
         }
 
-        String location = this.getRevisionLocation(m_revisions.length - 2);
+        String location = getRevisionLocation(m_revisions.length - 2);
 
         try
         {
@@ -758,12 +748,12 @@
         }
         catch(Exception ex)
         {
-           m_logger.log(Logger.LOG_ERROR, this.getClass().getName() +
+           m_logger.log(Logger.LOG_ERROR, getClass().getName() +
                ": Unable to dispose latest revision", ex);
         }
 
         File revisionDir = new File(m_archiveRootDir, REVISION_DIRECTORY +
-            this.getRefreshCount() + "." + (m_revisions.length - 1));
+            getRefreshCount() + "." + (m_revisions.length - 1));
 
         if (BundleCache.getSecureAction().fileExists(revisionDir))
         {
@@ -784,7 +774,7 @@
         {
             is = BundleCache.getSecureAction().getFileInputStream(new File(
                 new File(m_archiveRootDir, REVISION_DIRECTORY +
-                this.getRefreshCount() + "." + revision), REVISION_LOCATION_FILE));
+                getRefreshCount() + "." + revision), REVISION_LOCATION_FILE));
 
             br = new BufferedReader(new InputStreamReader(is));
             return br.readLine();
@@ -806,7 +796,7 @@
             os = BundleCache.getSecureAction()
                 .getFileOutputStream(new File(
                     new File(m_archiveRootDir, REVISION_DIRECTORY +
-                    this.getRefreshCount() + "." + revision), REVISION_LOCATION_FILE));
+                    getRefreshCount() + "." + revision), REVISION_LOCATION_FILE));
             bw = new BufferedWriter(new OutputStreamWriter(os));
             bw.write(location, 0, location.length());
         }
@@ -827,9 +817,9 @@
     public synchronized void purge() throws Exception
     {
         // Get the current refresh count.
-        long refreshCount = this.getRefreshCount();
+        long refreshCount = getRefreshCount();
         // Get the current revision count.
-        int count = this.getRevisionCount();
+        int count = getRevisionCount();
 
         // Dispose and delete all but the current revision.
         File revisionDir = null;
@@ -857,10 +847,10 @@
 
         // Save the current revision location for use later when
         // we recreate the revision.
-        String location = this.getRevisionLocation(count -1);
+        String location = getRevisionLocation(count -1);
 
         // Increment the refresh count.
-        this.setRefreshCount(refreshCount + 1);
+        setRefreshCount(refreshCount + 1);
 
         // Rename the current revision directory to be the zero revision
         // of the new refresh level.
@@ -871,7 +861,7 @@
         // Null the revision array since they are all invalid now.
         m_revisions = null;
         // Finally, recreate the revision for the current location.
-        BundleRevision revision = this.createRevisionFromLocation(location, null);
+        BundleRevision revision = createRevisionFromLocation(location, null);
         // Create new revision array.
         m_revisions = new BundleRevision[] { revision };
     }
@@ -888,7 +878,7 @@
         {
             m_logger.log(
                 Logger.LOG_ERROR,
-                this.getClass().getName()
+                getClass().getName()
                     + ": Unable to delete archive directory - "
                     + m_archiveRootDir);
         }
@@ -920,7 +910,7 @@
             {
                 m_logger.log(
                     Logger.LOG_ERROR,
-                    this.getClass().getName() + ": Unable to create archive directory.");
+                    getClass().getName() + ": Unable to create archive directory.");
                 throw new IOException("Unable to create archive directory.");
             }
 
@@ -976,7 +966,7 @@
         }
         catch (FileNotFoundException ex)
         {
-            return this.getLocation();
+            return getLocation();
         }
         finally
         {
@@ -1033,7 +1023,7 @@
         // refresh counter as a way to change the name of the revision
         // directory to give native libraries new absolute names.
         File revisionRootDir = new File(m_archiveRootDir,
-            REVISION_DIRECTORY + this.getRefreshCount() + "." + this.getRevisionCount());
+            REVISION_DIRECTORY + getRefreshCount() + "." + getRevisionCount());
 
         BundleRevision result = null;
 
@@ -1087,7 +1077,7 @@
                 {
                     m_logger.log(
                         Logger.LOG_ERROR,
-                        this.getClass().getName()
+                        getClass().getName()
                             + ": Unable to delete revision directory - "
                             + revisionRootDir);
                 }
@@ -1185,7 +1175,7 @@
         {
             m_logger.log(
                 Logger.LOG_ERROR,
-                this.getClass().getName() + ": Unable to write refresh counter: " + ex);
+                getClass().getName() + ": Unable to write refresh counter: " + ex);
             throw ex;
         }
         finally

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleRevision.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleRevision.java?view=diff&rev=566203&r1=566202&r2=566203
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleRevision.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleRevision.java Wed Aug 15 07:51:53 2007
@@ -19,7 +19,10 @@
 package org.apache.felix.framework.cache;
 
 import java.io.File;
-import java.util.Map;
+import java.io.InputStream;
+import java.security.cert.*;
+import java.util.*;
+import java.util.jar.*;
 
 import org.apache.felix.framework.Logger;
 import org.apache.felix.moduleloader.IContent;

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java?view=diff&rev=566203&r1=566202&r2=566203
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java Wed Aug 15 07:51:53 2007
@@ -18,21 +18,17 @@
  */
 package org.apache.felix.framework.cache;
 
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.jar.Manifest;
+import java.io.*;
+import java.net.MalformedURLException;
+import java.security.cert.X509Certificate;
+import java.util.*;
+import java.util.jar.*;
 
 import org.apache.felix.framework.Logger;
 import org.apache.felix.framework.util.FelixConstants;
 import org.apache.felix.framework.util.StringMap;
 import org.apache.felix.framework.util.manifestparser.ManifestParser;
-import org.apache.felix.moduleloader.DirectoryContent;
-import org.apache.felix.moduleloader.IContent;
-import org.apache.felix.moduleloader.JarContent;
+import org.apache.felix.moduleloader.*;
 
 /**
  * <p>
@@ -58,7 +54,7 @@
 
         // If the revision directory exists, then we don't
         // need to initialize since it has already been done.
-        if (BundleCache.getSecureAction().fileExists(this.getRevisionRootDir()))
+        if (BundleCache.getSecureAction().fileExists(getRevisionRootDir()))
         {
             return;
         }
@@ -66,11 +62,11 @@
         // Create revision directory, we only need this to store the
         // revision location, since nothing else needs to be extracted
         // since we are referencing a read directory already.
-        if (!BundleCache.getSecureAction().mkdir(this.getRevisionRootDir()))
+        if (!BundleCache.getSecureAction().mkdir(getRevisionRootDir()))
         {
-            this.getLogger().log(
+            getLogger().log(
                 Logger.LOG_ERROR,
-                this.getClass().getName() + ": Unable to create revision directory.");
+                getClass().getName() + ": Unable to create revision directory.");
             throw new IOException("Unable to create archive directory.");
         }
     }
@@ -122,7 +118,7 @@
         // objects for everything on the class path.
 
         // Get the bundle's manifest header.
-        Map map = this.getManifestHeader();
+        Map map = getManifestHeader();
 
         // Find class path meta-data.
         String classPath = (map == null)
@@ -178,7 +174,7 @@
 // TODO: This will need to consider security.
     public String findLibrary(String libName) throws Exception
     {
-        return BundleCache.getSecureAction().getAbsolutePath(new File(this.m_refDir, libName));
+        return BundleCache.getSecureAction().getAbsolutePath(new File(m_refDir, libName));
     }
 
     public void dispose() throws Exception

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java?view=diff&rev=566203&r1=566202&r2=566203
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java Wed Aug 15 07:51:53 2007
@@ -18,18 +18,12 @@
  */
 package org.apache.felix.framework.cache;
 
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLConnection;
+import java.io.*;
+import java.net.*;
 import java.security.PrivilegedActionException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
+import java.security.cert.X509Certificate;
+import java.util.*;
+import java.util.jar.*;
 import java.util.zip.ZipEntry;
 
 import org.apache.felix.framework.Logger;
@@ -37,9 +31,7 @@
 import org.apache.felix.framework.util.StringMap;
 import org.apache.felix.framework.util.Util;
 import org.apache.felix.framework.util.manifestparser.ManifestParser;
-import org.apache.felix.moduleloader.ContentDirectoryContent;
-import org.apache.felix.moduleloader.IContent;
-import org.apache.felix.moduleloader.JarContent;
+import org.apache.felix.moduleloader.*;
 
 /**
  * <p>
@@ -83,11 +75,11 @@
         }
         else
         {
-            m_bundleFile = new File(this.getRevisionRootDir(), BUNDLE_JAR_FILE);
+            m_bundleFile = new File(getRevisionRootDir(), BUNDLE_JAR_FILE);
         }
 
         // Save and process the bundle JAR.
-        this.initialize(byReference, is);
+        initialize(byReference, is);
     }
 
     public synchronized Map getManifestHeader() throws Exception
@@ -134,10 +126,10 @@
         // is on the bundle's class path and then creating content
         // objects for everything on the class path.
 
-        File embedDir = new File(this.getRevisionRootDir(), EMBEDDED_DIRECTORY);
+        File embedDir = new File(getRevisionRootDir(), EMBEDDED_DIRECTORY);
 
         // Get the bundle's manifest header.
-        Map map = this.getManifestHeader();
+        Map map = getManifestHeader();
 
         // Find class path meta-data.
         String classPath = (map == null)
@@ -205,7 +197,7 @@
     public synchronized String findLibrary(String libName) throws Exception
     {
         // Get bundle lib directory.
-        File libDir = new File(this.getRevisionRootDir(), LIBRARY_DIRECTORY);
+        File libDir = new File(getRevisionRootDir(), LIBRARY_DIRECTORY);
         // Get lib file.
         File libFile = new File(libDir, File.separatorChar + libName);
         // Make sure that the library's parent directory exists;
@@ -271,17 +263,17 @@
         {
             // If the revision directory exists, then we don't
             // need to initialize since it has already been done.
-            if (BundleCache.getSecureAction().fileExists(this.getRevisionRootDir()))
+            if (BundleCache.getSecureAction().fileExists(getRevisionRootDir()))
             {
                 return;
             }
 
             // Create revision directory.
-            if (!BundleCache.getSecureAction().mkdir(this.getRevisionRootDir()))
+            if (!BundleCache.getSecureAction().mkdir(getRevisionRootDir()))
             {
-                this.getLogger().log(
+                getLogger().log(
                     Logger.LOG_ERROR,
-                    this.getClass().getName() + ": Unable to create revision directory.");
+                    getClass().getName() + ": Unable to create revision directory.");
                 throw new IOException("Unable to create archive directory.");
             }
 
@@ -291,7 +283,7 @@
                 {
                     // Do it the manual way to have a chance to
                     // set request properties such as proxy auth.
-                    URL url = new URL(this.getLocation());
+                    URL url = new URL(getLocation());
                     URLConnection conn = url.openConnection();
 
                     // Support for http proxy authentication.
@@ -314,7 +306,7 @@
                 BundleCache.copyStreamToFile(is, m_bundleFile);
             }
 
-            this.preprocessBundleJar();
+            preprocessBundleJar();
         }
         finally
         {
@@ -335,7 +327,7 @@
         // for their existence all the time.
         //
 
-        File embedDir = new File(this.getRevisionRootDir(), EMBEDDED_DIRECTORY);
+        File embedDir = new File(getRevisionRootDir(), EMBEDDED_DIRECTORY);
         if (!BundleCache.getSecureAction().fileExists(embedDir))
         {
             if (!BundleCache.getSecureAction().mkdir(embedDir))
@@ -344,7 +336,7 @@
             }
         }
 
-        File libDir = new File(this.getRevisionRootDir(), LIBRARY_DIRECTORY);
+        File libDir = new File(getRevisionRootDir(), LIBRARY_DIRECTORY);
         if (!BundleCache.getSecureAction().fileExists(libDir))
         {
             if (!BundleCache.getSecureAction().mkdir(libDir))
@@ -360,7 +352,7 @@
         try
         {
             // Get the bundle's manifest header.
-            Map map = this.getManifestHeader();
+            Map map = getManifestHeader();
 
             // Find class path meta-data.
             String classPath = (map == null)
@@ -379,14 +371,14 @@
             {
                 if (!classPathStrings[i].equals(FelixConstants.CLASS_PATH_DOT))
                 {
-                    this.extractEmbeddedJar(classPathStrings[i]);
+                    extractEmbeddedJar(classPathStrings[i]);
                 }
             }
 
         }
         catch (PrivilegedActionException ex)
         {
-            throw (ex).getException();
+            throw ((PrivilegedActionException) ex).getException();
         }
     }
 
@@ -405,7 +397,7 @@
 
         // If JAR is already extracted, then don't re-extract it...
         File jarFile = new File(
-            this.getRevisionRootDir(), EMBEDDED_DIRECTORY + File.separatorChar + jarPath);
+            getRevisionRootDir(), EMBEDDED_DIRECTORY + File.separatorChar + jarPath);
 
         if (!BundleCache.getSecureAction().fileExists(jarFile))
         {
@@ -420,7 +412,7 @@
                 {
 // TODO: FRAMEWORK - Per the spec, this should fire a FrameworkEvent.INFO event;
 //       need to create an "Eventer" class like "Logger" perhaps.
-                    this.getLogger().log(Logger.LOG_INFO, "Class path entry not found: " + jarPath);
+                    getLogger().log(Logger.LOG_INFO, "Class path entry not found: " + jarPath);
                     return;
                 }
                 // If the zip entry is a directory, then ignore it since

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java?view=diff&rev=566203&r1=566202&r2=566203
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java Wed Aug 15 07:51:53 2007
@@ -22,36 +22,13 @@
 import java.lang.reflect.Proxy;
 import java.net.URL;
 import java.security.ProtectionDomain;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
+import java.util.*;
 
 import org.apache.felix.framework.Logger;
-import org.apache.felix.framework.util.SecurityManagerEx;
-import org.apache.felix.framework.util.Util;
-import org.apache.felix.framework.util.manifestparser.Capability;
-import org.apache.felix.framework.util.manifestparser.ManifestParser;
-import org.apache.felix.framework.util.manifestparser.R4Directive;
-import org.apache.felix.framework.util.manifestparser.R4Library;
-import org.apache.felix.framework.util.manifestparser.Requirement;
-import org.apache.felix.moduleloader.ICapability;
-import org.apache.felix.moduleloader.IModule;
-import org.apache.felix.moduleloader.IModuleFactory;
-import org.apache.felix.moduleloader.IRequirement;
-import org.apache.felix.moduleloader.IWire;
-import org.apache.felix.moduleloader.ModuleEvent;
-import org.apache.felix.moduleloader.ModuleImpl;
-import org.apache.felix.moduleloader.ModuleListener;
-import org.apache.felix.moduleloader.ResourceNotFoundException;
-import org.osgi.framework.Constants;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.PackagePermission;
-import org.osgi.framework.Version;
+import org.apache.felix.framework.util.*;
+import org.apache.felix.framework.util.manifestparser.*;
+import org.apache.felix.moduleloader.*;
+import org.osgi.framework.*;
 
 public class R4SearchPolicyCore implements ModuleListener
 {
@@ -172,7 +149,7 @@
     {
         try
         {
-            return (Class) this.findClassOrResource(module, name, true);
+            return (Class) findClassOrResource(module, name, true);
         }
         catch (ResourceNotFoundException ex)
         {
@@ -180,7 +157,7 @@
         }
         catch (ClassNotFoundException ex)
         {
-            String msg = this.diagnoseClassLoadError(module, name);
+            String msg = diagnoseClassLoadError(module, name);
             throw new ClassNotFoundException(msg, ex);
         }
 
@@ -193,7 +170,7 @@
     {
         try
         {
-            return (URL) this.findClassOrResource(module, name, false);
+            return (URL) findClassOrResource(module, name, false);
         }
         catch (ClassNotFoundException ex)
         {
@@ -217,7 +194,7 @@
 // for each class load.
         try
         {
-            this.resolve(module);
+            resolve(module);
         }
         catch (ResolveException ex)
         {
@@ -260,7 +237,7 @@
                 {
                     try
                     {
-                        urls = this.getClass().getClassLoader().getResources(name);
+                        urls = getClass().getClassLoader().getResources(name);
                         return urls;
                     }
                     catch (IOException ex)
@@ -301,7 +278,7 @@
         // At this point, the module's imports were searched and so was the
         // the module's content. Now we make an attempt to load the
         // class/resource via a dynamic import, if possible.
-        IWire wire = this.attemptDynamicImport(module, pkgName);
+        IWire wire = attemptDynamicImport(module, pkgName);
         if (wire != null)
         {
             urls = wire.getResources(name);
@@ -323,7 +300,7 @@
 // for each class load.
         try
         {
-            this.resolve(module);
+            resolve(module);
         }
         catch (ResolveException ex)
         {
@@ -380,8 +357,8 @@
                     || (!m_bootPkgWildcards[i] && m_bootPkgs[i].equals(pkgName)))
                 {
                     return (isClass)
-                        ? (Object) this.getClass().getClassLoader().loadClass(name)
-                        : (Object) this.getClass().getClassLoader().getResource(name);
+                        ? (Object) getClass().getClassLoader().loadClass(name)
+                        : (Object) getClass().getClassLoader().getResource(name);
                 }
             }
         }
@@ -389,7 +366,7 @@
         // Look in the module's imports. Note that the search may
         // be aborted if this method throws an exception, otherwise
         // it continues if a null is returned.
-        Object result = this.searchImports(module, name, isClass);
+        Object result = searchImports(module, name, isClass);
 
         // If not found, try the module's own class path.
         if (result == null)
@@ -401,7 +378,7 @@
             // If still not found, then try the module's dynamic imports.
             if (result == null)
             {
-                result = this.searchDynamicImports(module, name, pkgName, isClass);
+                result = searchDynamicImports(module, name, pkgName, isClass);
             }
         }
 
@@ -447,7 +424,7 @@
         // At this point, the module's imports were searched and so was the
         // the module's content. Now we make an attempt to load the
         // class/resource via a dynamic import, if possible.
-        IWire wire = this.attemptDynamicImport(module, pkgName);
+        IWire wire = attemptDynamicImport(module, pkgName);
 
         // If the dynamic import was successful, then this initial
         // time we must directly return the result from dynamically
@@ -589,8 +566,8 @@
                         {
                             // Get "in use" and "available" candidates and put
                             // the "in use" candidates first.
-                            PackageSource[] inuse = this.getInUseCandidates(req);
-                            PackageSource[] available = this.getUnusedCandidates(req);
+                            PackageSource[] inuse = getInUseCandidates(req);
+                            PackageSource[] available = getUnusedCandidates(req);
                             PackageSource[] candidates = new PackageSource[inuse.length + available.length];
                             System.arraycopy(inuse, 0, candidates, 0, inuse.length);
                             System.arraycopy(available, 0, candidates, inuse.length, available.length);
@@ -602,7 +579,7 @@
                             {
                                 try
                                 {
-                                    if (this.resolveDynamicImportCandidate(
+                                    if (resolveDynamicImportCandidate(
                                         candidates[candIdx].m_module, importer))
                                     {
                                         candidate = candidates[candIdx];
@@ -658,21 +635,21 @@
         // provider. If there is no consistent class space, then a resolve
         // exception is thrown.
         Map candidatesMap = new HashMap();
-        if (!this.isResolved(provider))
+        if (!isResolved(provider))
         {
-            this.populateCandidatesMap(candidatesMap, provider);
-            this.findConsistentClassSpace(candidatesMap, provider);
+            populateCandidatesMap(candidatesMap, provider);
+            findConsistentClassSpace(candidatesMap, provider);
         }
 
         // If the provider can be successfully resolved, then verify that
         // its class space is consistent with the existing class space of the
         // module that instigated the dynamic import.
         Map moduleMap = new HashMap();
-        Map importerPkgMap = this.getModulePackages(moduleMap, importer, candidatesMap);
+        Map importerPkgMap = getModulePackages(moduleMap, importer, candidatesMap);
 
         // Now we need to calculate the "uses" constraints of every package
         // accessible to the provider module based on its current candidates.
-        Map usesMap = this.calculateUsesConstraints(provider, moduleMap, candidatesMap);
+        Map usesMap = usesMap = calculateUsesConstraints(provider, moduleMap, candidatesMap);
 
         // Verify that none of the provider's implied "uses" constraints
         // in the uses map conflict with anything in the importing module's
@@ -730,7 +707,7 @@
             }
         }
 
-        Map resolvedModuleWireMap = this.createWires(candidatesMap, provider);
+        Map resolvedModuleWireMap = createWires(candidatesMap, provider);
 
         // Fire resolved events for all resolved modules;
         // the resolved modules array will only be set if the resolve
@@ -740,7 +717,7 @@
             Iterator iter = resolvedModuleWireMap.entrySet().iterator();
             while (iter.hasNext())
             {
-                this.fireModuleResolved((IModule) ((Map.Entry) iter.next()).getKey());
+                fireModuleResolved((IModule) ((Map.Entry) iter.next()).getKey());
             }
         }
 
@@ -887,7 +864,7 @@
                 ICapability cap = Util.getSatisfyingCapability(modules[modIdx], req);
                 // If compatible and it is not currently used, then add
                 // the available candidate to the list.
-                if ((cap != null) && !this.isCapabilityInUse(modules[modIdx], cap))
+                if ((cap != null) && !isCapabilityInUse(modules[modIdx], cap))
                 {
                     PackageSource[] tmp = new PackageSource[candidates.length + 1];
                     System.arraycopy(candidates, 0, tmp, 0, candidates.length);
@@ -904,7 +881,7 @@
         throws ResolveException
     {
         // If the module is already resolved, then we can just return.
-        if (this.isResolved(rootModule))
+        if (isResolved(rootModule))
         {
             return;
         }
@@ -937,7 +914,7 @@
             // this map will be resolved, only the target module and
             // any candidates selected to resolve its requirements and the
             // transitive requirements this implies.
-            this.populateCandidatesMap(candidatesMap, rootModule);
+            populateCandidatesMap(candidatesMap, rootModule);
 
             // The next step is to use the candidates map to determine if
             // the class space for the root module is consistent. This
@@ -949,7 +926,7 @@
             // a consistent set of candidates; otherwise, a resolve exception
             // is thrown if it exhausts all possible combinations and could
             // not find a consistent class space.
-            this.findConsistentClassSpace(candidatesMap, rootModule);
+            findConsistentClassSpace(candidatesMap, rootModule);
 
             // The final step is to create the wires for the root module and
             // transitively all modules that are to be resolved from the
@@ -959,7 +936,7 @@
             // to fire resolved events outside of the synchronized block.
             // The resolved module wire map maps a module to its array of
             // wires.
-            resolvedModuleWireMap = this.createWires(candidatesMap, rootModule);
+            resolvedModuleWireMap = createWires(candidatesMap, rootModule);
 
 //dumpUsedPackages();
         } // End of synchronized block on module manager.
@@ -972,7 +949,7 @@
             Iterator iter = resolvedModuleWireMap.entrySet().iterator();
             while (iter.hasNext())
             {
-                this.fireModuleResolved((IModule) ((Map.Entry) iter.next()).getKey());
+                fireModuleResolved((IModule) ((Map.Entry) iter.next()).getKey());
             }
         }
     }
@@ -1004,8 +981,8 @@
             // package maps. Candidates "in use" have higher priority
             // than "available" ones, so put the "in use" candidates
             // at the front of the list of candidates.
-            PackageSource[] inuse = this.getInUseCandidates(reqs[reqIdx]);
-            PackageSource[] available = this.getUnusedCandidates(reqs[reqIdx]);
+            PackageSource[] inuse = getInUseCandidates(reqs[reqIdx]);
+            PackageSource[] available = getUnusedCandidates(reqs[reqIdx]);
             PackageSource[] candidates = new PackageSource[inuse.length + available.length];
             System.arraycopy(inuse, 0, candidates, 0, inuse.length);
             System.arraycopy(available, 0, candidates, inuse.length, available.length);
@@ -1021,9 +998,9 @@
                     {
                         // Only populate the resolver map with modules that
                         // are not already resolved.
-                        if (!this.isResolved(candidates[candIdx].m_module))
+                        if (!isResolved(candidates[candIdx].m_module))
                         {
-                            this.populateCandidatesMap(candidatesMap, candidates[candIdx].m_module);
+                            populateCandidatesMap(candidatesMap, candidates[candIdx].m_module);
                         }
                     }
                     catch (ResolveException ex)
@@ -1119,7 +1096,7 @@
         // Test the current potential candidates to determine if they
         // are consistent. Keep looping until we find a consistent
         // set or an exception is thrown.
-        while (!this.isClassSpaceConsistent(rootModule, moduleMap, cycleMap, candidatesMap))
+        while (!isClassSpaceConsistent(rootModule, moduleMap, cycleMap, candidatesMap))
         {
             // The incrementCandidateConfiguration() method requires
             // ordered access to the candidates map, so we will create
@@ -1130,12 +1107,12 @@
                 for (Iterator iter = candidatesMap.entrySet().iterator();
                     iter.hasNext(); )
                 {
-                    candidatesList.add(((Map.Entry) iter.next()).getValue());
+                    candidatesList.add((List) ((Map.Entry) iter.next()).getValue());
                 }
             }
 
             // Increment the candidate configuration so we can test again.
-            this.incrementCandidateConfiguration(candidatesList);
+            incrementCandidateConfiguration(candidatesList);
 
             // Clear the module map.
             moduleMap.clear();
@@ -1164,7 +1141,7 @@
         Map pkgMap = null;
         try
         {
-            pkgMap = this.getModulePackages(moduleMap, targetModule, candidatesMap);
+            pkgMap = getModulePackages(moduleMap, targetModule, candidatesMap);
         }
         catch (ResolveException ex)
         {
@@ -1187,7 +1164,7 @@
             for (int srcIdx = 0; srcIdx < rp.m_sourceList.size(); srcIdx++)
             {
                 PackageSource ps = (PackageSource) rp.m_sourceList.get(srcIdx);
-                if (!this.isClassSpaceConsistent(ps.m_module, moduleMap, cycleMap, candidatesMap))
+                if (!isClassSpaceConsistent(ps.m_module, moduleMap, cycleMap, candidatesMap))
                 {
                     return false;
                 }
@@ -1199,7 +1176,7 @@
         Map usesMap = null;
         try
         {
-            usesMap = this.calculateUsesConstraints(targetModule, moduleMap, candidatesMap);
+            usesMap = calculateUsesConstraints(targetModule, moduleMap, candidatesMap);
         }
         catch (ResolveException ex)
         {
@@ -1284,7 +1261,7 @@
         Map cycleMap = new HashMap();
 
         // Get all packages accessible by the target module.
-        Map pkgMap = this.getModulePackages(moduleMap, targetModule, candidatesMap);
+        Map pkgMap = getModulePackages(moduleMap, targetModule, candidatesMap);
 
         // Each package accessible from the target module is potentially
         // comprised of one or more modules, called package sources. The
@@ -1297,7 +1274,7 @@
             ResolvedPackage rp = (ResolvedPackage) entry.getValue();
             for (int srcIdx = 0; srcIdx < rp.m_sourceList.size(); srcIdx++)
             {
-                usesMap = this.calculateUsesConstraints(
+                usesMap = calculateUsesConstraints(
                     (PackageSource) rp.m_sourceList.get(srcIdx),
                     moduleMap, usesMap, cycleMap, candidatesMap);
             }
@@ -1322,7 +1299,7 @@
 
         // Get all packages accessible from the module of the
         // target package source.
-        Map pkgMap = this.getModulePackages(moduleMap, psTarget.m_module, candidatesMap);
+        Map pkgMap = getModulePackages(moduleMap, psTarget.m_module, candidatesMap);
 
         // Get capability (i.e., package) of the target package source.
         Capability cap = (Capability) psTarget.m_capability;
@@ -1345,7 +1322,7 @@
                 // and combine the "uses" constraints for each package source.
                 for (int srcIdx = 0; srcIdx < rp.m_sourceList.size(); srcIdx++)
                 {
-                    usesMap = this.calculateUsesConstraints(
+                    usesMap = calculateUsesConstraints(
                         (PackageSource) rp.m_sourceList.get(srcIdx),
                         moduleMap, usesMap, cycleMap, candidatesMap);
                 }
@@ -1373,7 +1350,7 @@
 
         if (map == null)
         {
-            map = this.calculateModulePackages(module, candidatesMap);
+            map = calculateModulePackages(module, candidatesMap);
             moduleMap.put(module, map);
 //if (!module.getId().equals("0"))
 //{
@@ -1402,9 +1379,9 @@
         throws ResolveException
     {
 //System.out.println("calculateModulePackages("+module+")");
-        Map importedPackages = this.calculateImportedPackages(module, candidatesMap);
-        Map exportedPackages = this.calculateExportedPackages(module);
-        Map requiredPackages = this.calculateRequiredPackages(module, candidatesMap);
+        Map importedPackages = calculateImportedPackages(module, candidatesMap);
+        Map exportedPackages = calculateExportedPackages(module);
+        Map requiredPackages = calculateRequiredPackages(module, candidatesMap);
 
         // Merge exported packages into required packages. If a package is both
         // exported and required, then append the exported source to the end of
@@ -1441,8 +1418,8 @@
         throws ResolveException
     {
         return (candidatesMap.get(targetModule) == null)
-            ? this.calculateImportedPackagesResolved(targetModule)
-            : this.calculateImportedPackagesUnresolved(targetModule, candidatesMap);
+            ? calculateImportedPackagesResolved(targetModule)
+            : calculateImportedPackagesUnresolved(targetModule, candidatesMap);
     }
 
     private Map calculateImportedPackagesUnresolved(IModule targetModule, Map candidatesMap)
@@ -1478,7 +1455,7 @@
                 // of our imported package, unless we are the provider.
                 if (!targetModule.equals(ps.m_module))
                 {
-                    Map implicitPkgMap = this.calculateImplicitImportedPackages(
+                    Map implicitPkgMap = calculateImplicitImportedPackages(
                         ps.m_module, ps.m_capability, candidatesMap, new HashMap());
                     // Merge the implicitly imported packages with our imports and
                     // verify that there is no overlap.
@@ -1536,7 +1513,7 @@
                 // of our imported package, unless we are the provider.
                 if (!targetModule.equals(wires[wireIdx].getExporter()))
                 {
-                    Map implicitPkgMap = this.calculateImplicitImportedPackagesResolved(
+                    Map implicitPkgMap = calculateImplicitImportedPackagesResolved(
                         wires[wireIdx].getExporter(), wires[wireIdx].getCapability(), new HashMap());
                     // Merge the implicitly imported packages with our imports.
                     // No need to verify overlap since this is resolved and should
@@ -1558,10 +1535,10 @@
         Map candidatesMap, Map cycleMap)
     {
         return (candidatesMap.get(targetModule) == null)
-            ? this.calculateImplicitImportedPackagesResolved(
+            ? calculateImplicitImportedPackagesResolved(
                 targetModule, targetCapability, cycleMap)
-            : this.calculateImplicitImportedPackagesUnresolved(
-                targetModule, targetCapability, candidatesMap, cycleMap);
+            : calculateImplicitImportedPackagesUnresolved(
+                targetModule, targetCapability, candidatesMap, cycleMap);      
     }
 
     // TODO: EXPERIMENTAL - This is currently not defined recursively, but it should be.
@@ -1637,11 +1614,11 @@
         {
             Map cycleMap = new HashMap();
             cycleMap.put(module, module);
-            return this.calculateImplicitImportedPackages(
+            return calculateImplicitImportedPackages(
                 psTarget.m_module, psTarget.m_capability, candidatesMap, cycleMap);
         }
 
-        return null;
+        return null;      
     }
 
     private Map calculateExportedPackages(IModule targetModule)
@@ -1671,8 +1648,8 @@
     private Map calculateRequiredPackages(IModule targetModule, Map candidatesMap)
     {
         return (candidatesMap.get(targetModule) == null)
-            ? this.calculateRequiredPackagesResolved(targetModule)
-            : this.calculateRequiredPackagesUnresolved(targetModule, candidatesMap);
+            ? calculateRequiredPackagesResolved(targetModule)
+            : calculateRequiredPackagesUnresolved(targetModule, candidatesMap);      
     }
 
     private Map calculateRequiredPackagesUnresolved(IModule targetModule, Map candidatesMap)
@@ -1695,7 +1672,7 @@
                 Map cycleMap = new HashMap();
                 cycleMap.put(targetModule, targetModule);
                 Map requireMap =
-                    this.calculateExportedAndReexportedPackages(
+                    calculateExportedAndReexportedPackages(
                         ps, candidatesMap, cycleMap);
 
                 // Take the flattened required package map for the current
@@ -1743,7 +1720,7 @@
                 Map cycleMap = new HashMap();
                 cycleMap.put(targetModule, targetModule);
                 Map requireMap =
-                    this.calculateExportedAndReexportedPackagesResolved(
+                    calculateExportedAndReexportedPackagesResolved(
                         wires[i].getExporter(), cycleMap);
 
                 // Take the flattened required package map for the current
@@ -1775,8 +1752,8 @@
         PackageSource psTarget, Map candidatesMap, Map cycleMap)
     {
         return (candidatesMap.get(psTarget.m_module) == null)
-            ? this.calculateExportedAndReexportedPackagesResolved(psTarget.m_module, cycleMap)
-            : this.calculateExportedAndReexportedPackagesUnresolved(psTarget, candidatesMap, cycleMap);
+            ? calculateExportedAndReexportedPackagesResolved(psTarget.m_module, cycleMap)
+            : calculateExportedAndReexportedPackagesUnresolved(psTarget, candidatesMap, cycleMap);      
     }
 
     private Map calculateExportedAndReexportedPackagesUnresolved(
@@ -1823,7 +1800,7 @@
 
                 // Recursively calculate the required packages for the
                 // current candidate.
-                Map requiredMap = this.calculateExportedAndReexportedPackages(ps, candidatesMap, cycleMap);
+                Map requiredMap = calculateExportedAndReexportedPackages(ps, candidatesMap, cycleMap);
 
                 // Merge the candidate's exported and required packages
                 // into the complete set of required packages.
@@ -1939,7 +1916,7 @@
 
                 // Recursively calculate the required packages for the
                 // wire's exporting module.
-                Map requiredMap = this.calculateExportedAndReexportedPackagesResolved(wires[i].getExporter(), cycleMap);
+                Map requiredMap = calculateExportedAndReexportedPackagesResolved(wires[i].getExporter(), cycleMap);
 
                 // Merge the wires exported and re-exported packages
                 // into the complete set of required packages.
@@ -2020,7 +1997,7 @@
 //System.out.println("calculateCandidateRequiredPackages("+module+")");
         Map cycleMap = new HashMap();
         cycleMap.put(module, module);
-        return this.calculateExportedAndReexportedPackages(psTarget, candidatesMap, cycleMap);
+        return calculateExportedAndReexportedPackages(psTarget, candidatesMap, cycleMap);
     }
 
     private void incrementCandidateConfiguration(List resolverList)
@@ -2055,7 +2032,7 @@
     private Map createWires(Map candidatesMap, IModule rootModule)
     {
         Map resolvedModuleWireMap =
-            this.populateWireMap(candidatesMap, rootModule, new HashMap());
+            populateWireMap(candidatesMap, rootModule, new HashMap());
         Iterator iter = resolvedModuleWireMap.entrySet().iterator();
         while (iter.hasNext())
         {
@@ -2064,7 +2041,7 @@
             IWire[] wires = (IWire[]) entry.getValue();
 
             // Set the module's resolved and wiring attribute.
-            this.setResolved(module, true);
+            setResolved(module, true);
             // Only add wires attribute if some exist; export
             // only modules may not have wires.
             if (wires.length > 0)
@@ -2079,7 +2056,7 @@
                 (wires != null) && (wireIdx < wires.length);
                 wireIdx++)
             {
-                m_logger.log(Logger.LOG_DEBUG, "WIRE: " + wires[wireIdx]);
+m_logger.log(Logger.LOG_DEBUG, "WIRE: " + wires[wireIdx]);
                 // Add the exporter module of the wire to the "in use" capability map.
                 ICapability[] inUseCaps = (ICapability[]) m_inUseCapMap.get(wires[wireIdx].getExporter());
                 inUseCaps = addCapabilityToArray(inUseCaps, wires[wireIdx].getCapability());
@@ -2094,7 +2071,7 @@
                     String pkgName = (String)
                         wires[wireIdx].getCapability().getProperties().get(ICapability.PACKAGE_PROPERTY);
                     // Add to "in use" package index.
-                    this.indexPackageCapability(
+                    indexPackageCapability(
                         m_inUsePkgIndexMap,
                         wires[wireIdx].getExporter(),
                         wires[wireIdx].getCapability());
@@ -2143,7 +2120,7 @@
                         String pkgName = (String)
                             caps[capIdx].getProperties().get(ICapability.PACKAGE_PROPERTY);
                         // Add to "in use" package index.
-                        this.indexPackageCapability(
+                        indexPackageCapability(
                             m_inUsePkgIndexMap,
                             module,
                             caps[capIdx]);
@@ -2165,7 +2142,7 @@
     {
         // If the module is already resolved or it is part of
         // a cycle, then just return the wire map.
-        if (this.isResolved(importer) || (wireMap.get(importer) != null))
+        if (isResolved(importer) || (wireMap.get(importer) != null))
         {
             return wireMap;
         }
@@ -2195,7 +2172,7 @@
                     cs.m_requirement,
                     cs.m_candidates[cs.m_idx].m_module,
                     cs.m_candidates[cs.m_idx].m_capability,
-                    this.calculateCandidateRequiredPackages(importer, cs.m_candidates[cs.m_idx], candidatesMap)));
+                    calculateCandidateRequiredPackages(importer, cs.m_candidates[cs.m_idx], candidatesMap)));
             }
             else
             {
@@ -2206,11 +2183,11 @@
                     cs.m_candidates[cs.m_idx].m_module,
                     cs.m_candidates[cs.m_idx].m_capability));
 
-                // TODO: EXPERIMENTAL - The following is part of an experimental
+                // TODO: EXPERIMENTAL - The following is part of an experimental 
                 //       implicit imported wire concept. The above code is how
                 //       the wire should normally be created.
                 // Add wires for any implicitly imported package from provider.
-                Map pkgMap = this.calculateCandidateImplicitImportedPackages(
+                Map pkgMap = calculateCandidateImplicitImportedPackages(
                     importer, cs.m_candidates[cs.m_idx], candidatesMap);
                 if (pkgMap != null)
                 {
@@ -2228,7 +2205,7 @@
             }
 
             // Create any necessary wires for the selected candidate module.
-            wireMap = this.populateWireMap(
+            wireMap = populateWireMap(
                 candidatesMap, cs.m_candidates[cs.m_idx].m_module, wireMap);
         }
 
@@ -2402,7 +2379,7 @@
             {
                 if (caps[i].getNamespace().equals(ICapability.PACKAGE_NAMESPACE))
                 {
-                    this.indexPackageCapability(m_availPkgIndexMap, module, caps[i]);
+                    indexPackageCapability(m_availPkgIndexMap, module, caps[i]);
                 }
             }
         }
@@ -2691,7 +2668,7 @@
             m_module = module;
             m_requirement = requirement;
             m_candidates = candidates;
-            if (R4SearchPolicyCore.this.isResolved(m_module))
+            if (isResolved(m_module))
             {
                 m_visited = true;
             }
@@ -2776,7 +2753,7 @@
             {
                 return false;
             }
-            if (this.getClass() != o.getClass())
+            if (getClass() != o.getClass())
             {
                 return false;
             }
@@ -2839,7 +2816,7 @@
 
         public String toString()
         {
-            return this.toString("", new StringBuffer()).toString();
+            return toString("", new StringBuffer()).toString();
         }
 
         public StringBuffer toString(String padding, StringBuffer sb)
@@ -2974,9 +2951,9 @@
         if (imp != null)
         {
             // Try to see if there is an exporter available.
-            PackageSource[] exporters = this.getInUseCandidates(imp);
+            PackageSource[] exporters = getInUseCandidates(imp);
             exporters = (exporters.length == 0)
-                ? this.getUnusedCandidates(imp) : exporters;
+                ? getUnusedCandidates(imp) : exporters;
 
             // An exporter might be available, but it may have attributes
             // that do not match the importer's required attributes, so
@@ -2988,9 +2965,9 @@
                 {
                     IRequirement pkgReq = new Requirement(
                         ICapability.PACKAGE_NAMESPACE, "(package=" + pkgName + ")");
-                    exporters = this.getInUseCandidates(pkgReq);
+                    exporters = getInUseCandidates(pkgReq);
                     exporters = (exporters.length == 0)
-                        ? this.getUnusedCandidates(pkgReq) : exporters;
+                        ? getUnusedCandidates(pkgReq) : exporters;
                 }
                 catch (InvalidSyntaxException ex)
                 {
@@ -3039,14 +3016,14 @@
         {
             // This should never happen.
         }
-        PackageSource[] exporters = this.getInUseCandidates(pkgReq);
-        exporters = (exporters.length == 0) ? this.getUnusedCandidates(pkgReq) : exporters;
+        PackageSource[] exporters = getInUseCandidates(pkgReq);
+        exporters = (exporters.length == 0) ? getUnusedCandidates(pkgReq) : exporters;
         if (exporters.length > 0)
         {
             boolean classpath = false;
             try
             {
-                this.getClass().getClassLoader().loadClass(name);
+                getClass().getClassLoader().loadClass(name);
                 classpath = true;
             }
             catch (Exception ex)
@@ -3095,7 +3072,7 @@
         // class loader.
         try
         {
-            this.getClass().getClassLoader().loadClass(name);
+            getClass().getClassLoader().loadClass(name);
 
             StringBuffer sb = new StringBuffer("*** Package '");
             sb.append(pkgName);

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java?view=diff&rev=566203&r1=566202&r2=566203
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java Wed Aug 15 07:51:53 2007
@@ -1,4 +1,4 @@
-/*
+/* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -20,24 +20,11 @@
 
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.EventListener;
-import java.util.EventObject;
+import java.util.*;
 
+import org.apache.felix.framework.Felix;
 import org.apache.felix.framework.Logger;
-import org.osgi.framework.AllServiceListener;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.BundleListener;
-import org.osgi.framework.Constants;
-import org.osgi.framework.Filter;
-import org.osgi.framework.FrameworkEvent;
-import org.osgi.framework.FrameworkListener;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceListener;
-import org.osgi.framework.ServicePermission;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.SynchronousBundleListener;
+import org.osgi.framework.*;
 
 public class EventDispatcher
 {
@@ -101,7 +88,7 @@
 
         return eventDispatcher;
     }
-
+    
     public static void shutdown()
     {
         synchronized (m_threadLock)
@@ -118,7 +105,7 @@
             {
                 return;
             }
-
+            
             // Signal dispatch thread.
             m_stopping = true;
             synchronized (m_requestList)
@@ -137,7 +124,7 @@
                 {
                 }
             }
-
+            
             // remove the thread reference
             m_thread = null;
         }
@@ -158,7 +145,7 @@
 
         // See if we can simply update the listener, if so then
         // return immediately.
-        if (this.updateListener(bundle, clazz, l, filter))
+        if (updateListener(bundle, clazz, l, filter))
         {
             return;
         }
@@ -375,7 +362,7 @@
                 {
                     Class clazz = (Class) listeners[i + LISTENER_CLASS_OFFSET];
                     EventListener l = (EventListener) listeners[i + LISTENER_OBJECT_OFFSET];
-                    this.removeListener(bundle, clazz, l);
+                    removeListener(bundle, clazz, l);
                 }
             }
 
@@ -392,7 +379,7 @@
                 {
                     Class clazz = (Class) listeners[i + LISTENER_CLASS_OFFSET];
                     EventListener l = (EventListener) listeners[i + LISTENER_OBJECT_OFFSET];
-                    this.removeListener(bundle, clazz, l);
+                    removeListener(bundle, clazz, l);
                 }
             }
 
@@ -410,7 +397,7 @@
                 {
                     Class clazz = (Class) listeners[i + LISTENER_CLASS_OFFSET];
                     EventListener l = (EventListener) listeners[i + LISTENER_OBJECT_OFFSET];
-                    this.removeListener(bundle, clazz, l);
+                    removeListener(bundle, clazz, l);
                 }
             }
 
@@ -427,7 +414,7 @@
                 {
                     Class clazz = (Class) listeners[i + LISTENER_CLASS_OFFSET];
                     EventListener l = (EventListener) listeners[i + LISTENER_OBJECT_OFFSET];
-                    this.removeListener(bundle, clazz, l);
+                    removeListener(bundle, clazz, l);
                 }
             }
         }
@@ -458,7 +445,7 @@
             {
                 listeners = m_serviceListeners;
             }
-
+    
             // See if the listener is already registered, if so then
             // handle it according to the spec.
             for (int i = 0; i < listeners.length; i += LISTENER_ARRAY_INCREMENT)
@@ -498,7 +485,7 @@
         }
 
         // Fire all framework listeners on a separate thread.
-        this.fireEventAsynchronously(m_logger, Request.FRAMEWORK_EVENT, listeners, event);
+        fireEventAsynchronously(m_logger, Request.FRAMEWORK_EVENT, listeners, event);
     }
 
     public void fireBundleEvent(BundleEvent event)
@@ -521,7 +508,7 @@
             (event.getType() != BundleEvent.STOPPING))
         {
             // Fire asynchronous bundle listeners on a separate thread.
-            this.fireEventAsynchronously(m_logger, Request.BUNDLE_EVENT, listeners, event);
+            fireEventAsynchronously(m_logger, Request.BUNDLE_EVENT, listeners, event);
         }
     }
 
@@ -698,7 +685,7 @@
         if (objectClass != null)
         {
             boolean hasPermission = false;
-
+            
             Object sm = System.getSecurityManager();
             if ((acc != null) && (sm != null))
             {
@@ -706,15 +693,15 @@
                     !hasPermission && (i < objectClass.length);
                     i++)
                 {
-                    try
+                    try 
                     {
                         ServicePermission perm =
                             new ServicePermission(
                                 objectClass[i], ServicePermission.GET);
                         ((SecurityManager) sm).checkPermission(perm, acc);
                         hasPermission = true;
-                    }
-                    catch (Exception ex)
+                    } 
+                    catch (Exception ex) 
                     {
                     }
                 }

Modified: felix/trunk/framework/src/main/java/org/osgi/framework/AdminPermission.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/osgi/framework/AdminPermission.java?view=diff&rev=566203&r1=566202&r2=566203
==============================================================================
--- felix/trunk/framework/src/main/java/org/osgi/framework/AdminPermission.java (original)
+++ felix/trunk/framework/src/main/java/org/osgi/framework/AdminPermission.java Wed Aug 15 07:51:53 2007
@@ -1,4 +1,4 @@
-/*
+/* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -18,19 +18,10 @@
  */
 package org.osgi.framework;
 
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.BasicPermission;
-import java.security.Permission;
-import java.security.PermissionCollection;
-import java.security.PrivilegedAction;
-import java.util.Collections;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.StringTokenizer;
+import java.security.*;
+import java.util.*;
 
 import org.apache.felix.framework.FilterImpl;
 
@@ -125,12 +116,12 @@
 
 	AdminPermission p = (AdminPermission) obj;
 
-	return this.getName().equals(p.getName()) && (m_actionMask == p.m_actionMask);
+	return getName().equals(p.getName()) && (m_actionMask == p.m_actionMask);
     }
 
     public int hashCode()
     {
-	return this.getName().hashCode() ^ this.getActions().hashCode();
+	return getName().hashCode() ^ getActions().hashCode();
     }
 
     public String getActions()
@@ -170,12 +161,12 @@
         // filter is "*".
         if (admin.getName().equals("(id=*)"))
         {
-            return this.getName().equals("(id=*)");
+            return getName().equals("(id=*)");
         }
 
         // Next, if this object was create with a "*" we can return true
         // (This way we avoid creating and matching a filter).
-        if (this.getName().equals("(id=*)"))
+        if (getName().equals("(id=*)"))
         {
             return true;
         }
@@ -186,7 +177,7 @@
         {
             try
             {
-                m_filterImpl = new FilterImpl(this.getName());
+                m_filterImpl = new FilterImpl(getName());
             }
             catch (InvalidSyntaxException ex)
             {
@@ -222,9 +213,9 @@
                 {
                     public Object run()
                     {
-                        AdminPermission.this.m_bundleDict.put("location", AdminPermission.this.m_bundle.getLocation());
-
-                        createSigner(AdminPermission.this.m_bundle, AdminPermission.this.m_bundleDict);
+                        m_bundleDict.put("location", m_bundle.getLocation());
+                        
+                        createSigner(m_bundle, m_bundleDict);
                         return null;
                     }
                 });
@@ -245,9 +236,9 @@
             Method method = bundle.getClass().getDeclaredMethod(
                 "getSignerMatcher", null);
             method.setAccessible(true);
-
+            
             Object signer = method.invoke(bundle, null);
-
+            
             if (signer != null)
             {
                 dict.put("signer", signer);
@@ -407,7 +398,7 @@
         {
             throw new IllegalArgumentException("Invalid permission: " + permission);
         }
-        else if (this.isReadOnly())
+        else if (isReadOnly())
         {
             throw new SecurityException(
                 "Cannot add to read-only permission collection.");



Mime
View raw message