org.eclipse.osgi_3.7.2.v20120110-1415

nt cur = 0;
    
    public ArrayEnumeration(E[] array, int size)
    {
      Object[] a = new Object[size];
      this.array = a;
      System.arraycopy(array, 0, this.array, 0, this.array.length);
    }
    
    public boolean hasMoreElements()
    {
      return cur < array.length;
    }
    
    public E nextElement()
    {
      return (E)array[(cur++)];
    }
  }
  
  public synchronized void clear()
  {
    if (readOnly) {
      throw new UnsupportedOperationException();
    }
  }
  
  public synchronized boolean containsKey(Object key)
  {
    return getIndex(key) >= 0;
  }
  
  public boolean containsValue(Object value)
  {
    throw new UnsupportedOperationException();
  }
  
  public Set<Map.Entry<K, V>> entrySet()
  {
    throw new UnsupportedOperationException();
  }
  
  public Set<K> keySet()
  {
    throw new UnsupportedOperationException();
  }
  
  public void putAll(Map<? extends K, ? extends V> c)
  {
    throw new UnsupportedOperationException();
  }
  
  public Collection<V> values()
  {
    throw new UnsupportedOperationException();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.Headers
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

public abstract interface KeyedElement
{
  public abstract int getKeyHashCode();
  
  public abstract boolean compare(KeyedElement paramKeyedElement);
  
  public abstract Object getKey();
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.KeyedElement
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.util.Iterator;
import java.util.NoSuchElementException;

class KeyedHashSet$EquinoxSetIterator
  implements Iterator<KeyedElement>
{
  private int currentIndex = -1;
  private int found;
  final KeyedHashSet this$0;
  
  KeyedHashSet$EquinoxSetIterator(KeyedHashSet paramKeyedHashSet) {}
  
  public boolean hasNext()
  {
    return found < this$0.elementCount;
  }
  
  public KeyedElement next()
  {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    while (++currentIndex < this$0.elements.length) {
      if (this$0.elements[currentIndex] != null)
      {
        found += 1;
        return this$0.elements[currentIndex];
      }
    }
    throw new NoSuchElementException();
  }
  
  public void remove()
  {
    throw new UnsupportedOperationException();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.KeyedHashSet.EquinoxSetIterator
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.util.Iterator;
import java.util.NoSuchElementException;

public class KeyedHashSet
{
  public static final int MINIMUM_SIZE = 7;
  int elementCount = 0;
  KeyedElement[] elements;
  private boolean replace;
  private int capacity;
  
  public KeyedHashSet()
  {
    this(7, true);
  }
  
  public KeyedHashSet(boolean replace)
  {
    this(7, replace);
  }
  
  public KeyedHashSet(int capacity)
  {
    this(capacity, true);
  }
  
  public KeyedHashSet(int capacity, boolean replace)
  {
    elements = new KeyedElement[Math.max(7, capacity * 2)];
    this.replace = replace;
    this.capacity = capacity;
  }
  
  public KeyedHashSet(KeyedHashSet original)
  {
    elements = new KeyedElement[elements.length];
    System.arraycopy(elements, 0, elements, 0, elements.length);
    elementCount = elementCount;
    replace = replace;
    capacity = capacity;
  }
  
  public boolean add(KeyedElement element)
  {
    int hash = hash(element);
    for (int i = hash; i < elements.length; i++)
    {
      if (elements[i] == null)
      {
        elements[i] = element;
        elementCount += 1;
        if (shouldGrow()) {
          expand();
        }
        return true;
      }
      if (elements[i].compare(element))
      {
        if (replace) {
          elements[i] = element;
        }
        return replace;
      }
    }
    for (int i = 0; i < hash - 1; i++)
    {
      if (elements[i] == null)
      {
        elements[i] = element;
        elementCount += 1;
        if (shouldGrow()) {
          expand();
        }
        return true;
      }
      if (elements[i].compare(element))
      {
        if (replace) {
          elements[i] = element;
        }
        return replace;
      }
    }
    expand();
    return add(element);
  }
  
  public void addAll(KeyedElement[] toAdd)
  {
    for (int i = 0; i < toAdd.length; i++) {
      add(toAdd[i]);
    }
  }
  
  public boolean contains(KeyedElement element)
  {
    return get(element) != null;
  }
  
  public boolean containsKey(Object key)
  {
    return getByKey(key) != null;
  }
  
  public KeyedElement[] elements()
  {
    return (KeyedElement[])elements(new KeyedElement[elementCount]);
  }
  
  public Object[] elements(Object[] result)
  {
    int j = 0;
    for (int i = 0; i < elements.length; i++)
    {
      KeyedElement element = elements[i];
      if (element != null) {
        result[(j++)] = element;
      }
    }
    return result;
  }
  
  protected void expand()
  {
    KeyedElement[] oldElements = elements;
    elements = new KeyedElement[elements.length * 2];
    
    int maxArrayIndex = elements.length - 1;
    for (int i = 0; i < oldElements.length; i++)
    {
      KeyedElement element = oldElements[i];
      if (element != null)
      {
        int hash = hash(element);
        while (elements[hash] != null)
        {
          hash++;
          if (hash > maxArrayIndex) {
            hash = 0;
          }
        }
        elements[hash] = element;
      }
    }
  }
  
  public KeyedElement getByKey(Object key)
  {
    if (elementCount == 0) {
      return null;
    }
    int hash = keyHash(key);
    for (int i = hash; i < elements.length; i++)
    {
      KeyedElement element = elements[i];
      if (element == null) {
        return null;
      }
      if (element.getKey().equals(key)) {
        return element;
      }
    }
    for (int i = 0; i < hash - 1; i++)
    {
      KeyedElement element = elements[i];
      if (element == null) {
        return null;
      }
      if (element.getKey().equals(key)) {
        return element;
      }
    }
    return null;
  }
  
  public KeyedElement get(KeyedElement otherElement)
  {
    if (elementCount == 0) {
      return null;
    }
    int hash = hash(otherElement);
    for (int i = hash; i < elements.length; i++)
    {
      KeyedElement element = elements[i];
      if (element == null) {
        return null;
      }
      if (element.compare(otherElement)) {
        return element;
      }
    }
    for (int i = 0; i < hash - 1; i++)
    {
      KeyedElement element = elements[i];
      if (element == null) {
        return null;
      }
      if (element.compare(otherElement)) {
        return element;
      }
    }
    return null;
  }
  
  public boolean isEmpty()
  {
    return elementCount == 0;
  }
  
  protected void rehashTo(int anIndex)
  {
    int target = anIndex;
    int index = anIndex + 1;
    if (index >= elements.length) {
      index = 0;
    }
    KeyedElement element = elements[index];
    while (element != null)
    {
      int hashIndex = hash(element);
      boolean match;
      boolean match;
      if (index < target) {
        match = (hashIndex <= target) && (hashIndex > index);
      } else {
        match = (hashIndex <= target) || (hashIndex > index);
      }
      if (match)
      {
        elements[target] = element;
        target = index;
      }
      index++;
      if (index >= elements.length) {
        index = 0;
      }
      element = elements[index];
    }
    elements[target] = null;
  }
  
  public boolean removeByKey(Object key)
  {
    if (elementCount == 0) {
      return false;
    }
    int hash = keyHash(key);
    for (int i = hash; i < elements.length; i++)
    {
      KeyedElement element = elements[i];
      if (element == null) {
        return false;
      }
      if (element.getKey().equals(key))
      {
        rehashTo(i);
        elementCount -= 1;
        return true;
      }
    }
    for (int i = 0; i < hash - 1; i++)
    {
      KeyedElement element = elements[i];
      if (element == null) {
        return false;
      }
      if (element.getKey().equals(key))
      {
        rehashTo(i);
        elementCount -= 1;
        return true;
      }
    }
    return true;
  }
  
  public boolean remove(KeyedElement toRemove)
  {
    if (elementCount == 0) {
      return false;
    }
    int hash = hash(toRemove);
    for (int i = hash; i < elements.length; i++)
    {
      KeyedElement element = elements[i];
      if (element == null) {
        return false;
      }
      if (element.compare(toRemove))
      {
        rehashTo(i);
        elementCount -= 1;
        return true;
      }
    }
    for (int i = 0; i < hash - 1; i++)
    {
      KeyedElement element = elements[i];
      if (element == null) {
        return false;
      }
      if (element.compare(toRemove))
      {
        rehashTo(i);
        elementCount -= 1;
        return true;
      }
    }
    return false;
  }
  
  private int hash(KeyedElement element)
  {
    return Math.abs(element.getKeyHashCode()) % elements.length;
  }
  
  private int keyHash(Object key)
  {
    return Math.abs(key.hashCode()) % elements.length;
  }
  
  public void removeAll(KeyedElement[] toRemove)
  {
    for (int i = 0; i < toRemove.length; i++) {
      remove(toRemove[i]);
    }
  }
  
  private boolean shouldGrow()
  {
    return elementCount > elements.length * 0.75D;
  }
  
  public int size()
  {
    return elementCount;
  }
  
  public String toString()
  {
    StringBuffer result = new StringBuffer(100);
    result.append("{");
    boolean first = true;
    for (int i = 0; i < elements.length; i++) {
      if (elements[i] != null)
      {
        if (first) {
          first = false;
        } else {
          result.append(", ");
        }
        result.append(elements[i]);
      }
    }
    result.append("}");
    return result.toString();
  }
  
  public int countCollisions()
  {
    int result = 0;
    int lastHash = 0;
    boolean found = false;
    for (int i = 0; i < elements.length; i++)
    {
      KeyedElement element = elements[i];
      if (element == null)
      {
        found = false;
      }
      else
      {
        int hash = hash(element);
        if (found)
        {
          if (lastHash == hash) {
            result++;
          } else {
            found = false;
          }
        }
        else
        {
          lastHash = hash;
          found = true;
        }
      }
    }
    return result;
  }
  
  public Iterator<KeyedElement> iterator()
  {
    return new EquinoxSetIterator();
  }
  
  class EquinoxSetIterator
    implements Iterator<KeyedElement>
  {
    private int currentIndex = -1;
    private int found;
    
    EquinoxSetIterator() {}
    
    public boolean hasNext()
    {
      return found < elementCount;
    }
    
    public KeyedElement next()
    {
      if (!hasNext()) {
        throw new NoSuchElementException();
      }
      while (++currentIndex < elements.length) {
        if (elements[currentIndex] != null)
        {
          found += 1;
          return elements[currentIndex];
        }
      }
      throw new NoSuchElementException();
    }
    
    public void remove()
    {
      throw new UnsupportedOperationException();
    }
  }
  
  public void clear()
  {
    elements = new KeyedElement[Math.max(7, capacity * 2)];
    elementCount = 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.KeyedHashSet
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.lang.ref.WeakReference;
import java.util.Map;
import java.util.WeakHashMap;
import org.eclipse.osgi.framework.debug.Debug;
import org.eclipse.osgi.framework.debug.FrameworkDebugOptions;

public class ObjectPool
{
  private static String OPTION_DEBUG_OBJECTPOOL_ADDS = "org.eclipse.osgi/debug/objectPool/adds";
  private static String OPTION_DEBUG_OBJECTPOOL_DUPS = "org.eclipse.osgi/debug/objectPool/dups";
  private static final boolean DEBUG_OBJECTPOOL_ADDS;
  private static final boolean DEBUG_OBJECTPOOL_DUPS;
  private static Map<Object, WeakReference<Object>> objectCache = new WeakHashMap();
  
  static
  {
    FrameworkDebugOptions dbgOptions = FrameworkDebugOptions.getDefault();
    if (dbgOptions != null)
    {
      DEBUG_OBJECTPOOL_ADDS = dbgOptions.getBooleanOption(OPTION_DEBUG_OBJECTPOOL_ADDS, false);
      DEBUG_OBJECTPOOL_DUPS = dbgOptions.getBooleanOption(OPTION_DEBUG_OBJECTPOOL_DUPS, false);
    }
    else
    {
      DEBUG_OBJECTPOOL_ADDS = false;
      DEBUG_OBJECTPOOL_DUPS = false;
    }
  }
  
  public static Object intern(Object obj)
  {
    synchronized (objectCache)
    {
      WeakReference<Object> ref = (WeakReference)objectCache.get(obj);
      if (ref != null)
      {
        Object refValue = ref.get();
        if (refValue != null)
        {
          obj = refValue;
          if (DEBUG_OBJECTPOOL_DUPS) {
            Debug.println("[ObjectPool] Found duplicate object: " + getObjectString(obj));
          }
        }
      }
      else
      {
        objectCache.put(obj, new WeakReference(obj));
        if (DEBUG_OBJECTPOOL_ADDS) {
          Debug.println("[ObjectPool] Added unique object to pool: " + getObjectString(obj) + " Pool size: " + objectCache.size());
        }
      }
    }
    return obj;
  }
  
  private static String getObjectString(Object obj)
  {
    return "[(" + obj.getClass().getName() + ") " + obj.toString() + "]";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.ObjectPool
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

class SecureAction$1$1
  extends ClassLoader
{
  final SecureAction.1 this$1;
  
  SecureAction$1$1(SecureAction.1 param1, ClassLoader $anonymous0)
  {
    super($anonymous0);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.1.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.security.PrivilegedAction;

class SecureAction$1
  implements PrivilegedAction<ClassLoader>
{
  public ClassLoader run()
  {
    Class tmp8_5 = SecureAction.class$0;
    if (tmp8_5 == null)
    {
      tmp8_5;
      try
      {
        tmpTernaryOp = (SecureAction.class$0 = Class.forName("java.lang.Object"));
      }
      catch (ClassNotFoundException localClassNotFoundException)
      {
        throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
      }
    }
    new ClassLoader(tmp8_5.getClassLoader()) {};
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.io.File;
import java.security.PrivilegedAction;

class SecureAction$10
  implements PrivilegedAction<Boolean>
{
  final SecureAction this$0;
  
  SecureAction$10(SecureAction paramSecureAction, File paramFile) {}
  
  public Boolean run()
  {
    return val$file.exists() ? Boolean.TRUE : Boolean.FALSE;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.10
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.io.File;
import java.security.PrivilegedAction;

class SecureAction$11
  implements PrivilegedAction<Boolean>
{
  final SecureAction this$0;
  
  SecureAction$11(SecureAction paramSecureAction, File paramFile) {}
  
  public Boolean run()
  {
    return val$file.isDirectory() ? Boolean.TRUE : Boolean.FALSE;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.11
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.io.File;
import java.security.PrivilegedAction;

class SecureAction$12
  implements PrivilegedAction<Long>
{
  final SecureAction this$0;
  
  SecureAction$12(SecureAction paramSecureAction, File paramFile) {}
  
  public Long run()
  {
    return new Long(val$file.lastModified());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.12
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.io.File;
import java.security.PrivilegedAction;

class SecureAction$13
  implements PrivilegedAction<String[]>
{
  final SecureAction this$0;
  
  SecureAction$13(SecureAction paramSecureAction, File paramFile) {}
  
  public String[] run()
  {
    return val$file.list();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.13
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.io.File;
import java.io.IOException;
import java.security.PrivilegedExceptionAction;
import java.util.zip.ZipFile;

class SecureAction$14
  implements PrivilegedExceptionAction<ZipFile>
{
  final SecureAction this$0;
  
  SecureAction$14(SecureAction paramSecureAction, File paramFile) {}
  
  public ZipFile run()
    throws IOException
  {
    return new ZipFile(val$file);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.14
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLStreamHandler;
import java.security.PrivilegedExceptionAction;

class SecureAction$15
  implements PrivilegedExceptionAction<URL>
{
  final SecureAction this$0;
  
  SecureAction$15(SecureAction paramSecureAction, String paramString1, String paramString2, int paramInt, String paramString3, URLStreamHandler paramURLStreamHandler) {}
  
  public URL run()
    throws MalformedURLException
  {
    return new URL(val$protocol, val$host, val$port, val$file, val$handler);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.15
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.security.PrivilegedAction;

class SecureAction$16
  implements PrivilegedAction<Thread>
{
  final SecureAction this$0;
  
  SecureAction$16(SecureAction paramSecureAction, Runnable paramRunnable, String paramString, ClassLoader paramClassLoader) {}
  
  public Thread run()
  {
    return this$0.createThread0(val$target, val$name, val$contextLoader);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.16
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.security.PrivilegedAction;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;

class SecureAction$17
  implements PrivilegedAction<S>
{
  final SecureAction this$0;
  
  SecureAction$17(SecureAction paramSecureAction, BundleContext paramBundleContext, ServiceReference paramServiceReference) {}
  
  public S run()
  {
    return (S)val$context.getService(val$reference);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.17
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.security.PrivilegedExceptionAction;

class SecureAction$18
  implements PrivilegedExceptionAction<Class<?>>
{
  final SecureAction this$0;
  
  SecureAction$18(SecureAction paramSecureAction, String paramString) {}
  
  public Class<?> run()
    throws Exception
  {
    return Class.forName(val$name);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.18
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.security.PrivilegedExceptionAction;

class SecureAction$19
  implements PrivilegedExceptionAction<Class<?>>
{
  final SecureAction this$0;
  
  SecureAction$19(SecureAction paramSecureAction, String paramString) {}
  
  public Class<?> run()
    throws Exception
  {
    ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
    return systemClassLoader != null ? systemClassLoader.loadClass(val$name) : SecureAction.bootClassLoader.loadClass(val$name);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.19
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.security.PrivilegedAction;

class SecureAction$2
  implements PrivilegedAction<SecureAction>
{
  public SecureAction run()
  {
    return new SecureAction();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.2
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.security.PrivilegedAction;
import org.osgi.util.tracker.ServiceTracker;

class SecureAction$20
  implements PrivilegedAction<Object>
{
  final SecureAction this$0;
  
  SecureAction$20(SecureAction paramSecureAction, ServiceTracker paramServiceTracker) {}
  
  public Object run()
  {
    val$tracker.open();
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.20
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.security.PrivilegedExceptionAction;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;

class SecureAction$21
  implements PrivilegedExceptionAction<Object>
{
  final SecureAction this$0;
  
  SecureAction$21(SecureAction paramSecureAction, Bundle paramBundle, int paramInt) {}
  
  public Object run()
    throws BundleException
  {
    val$bundle.start(val$options);
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.21
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.security.PrivilegedAction;
import org.eclipse.osgi.framework.internal.core.FrameworkProperties;

class SecureAction$3
  implements PrivilegedAction<String>
{
  final SecureAction this$0;
  
  SecureAction$3(SecureAction paramSecureAction, String paramString) {}
  
  public String run()
  {
    return FrameworkProperties.getProperty(val$property);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.3
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.security.PrivilegedAction;
import org.eclipse.osgi.framework.internal.core.FrameworkProperties;

class SecureAction$4
  implements PrivilegedAction<String>
{
  final SecureAction this$0;
  
  SecureAction$4(SecureAction paramSecureAction, String paramString1, String paramString2) {}
  
  public String run()
  {
    return FrameworkProperties.getProperty(val$property, val$def);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.4
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.security.PrivilegedAction;
import java.util.Properties;
import org.eclipse.osgi.framework.internal.core.FrameworkProperties;

class SecureAction$5
  implements PrivilegedAction<Properties>
{
  final SecureAction this$0;
  
  SecureAction$5(SecureAction paramSecureAction) {}
  
  public Properties run()
  {
    return FrameworkProperties.getProperties();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.5
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.security.PrivilegedExceptionAction;

class SecureAction$6
  implements PrivilegedExceptionAction<FileInputStream>
{
  final SecureAction this$0;
  
  SecureAction$6(SecureAction paramSecureAction, File paramFile) {}
  
  public FileInputStream run()
    throws FileNotFoundException
  {
    return new FileInputStream(val$file);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.6
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.security.PrivilegedExceptionAction;

class SecureAction$7
  implements PrivilegedExceptionAction<FileOutputStream>
{
  final SecureAction this$0;
  
  SecureAction$7(SecureAction paramSecureAction, File paramFile, boolean paramBoolean) {}
  
  public FileOutputStream run()
    throws FileNotFoundException
  {
    return new FileOutputStream(val$file.getAbsolutePath(), val$append);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.7
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.io.File;
import java.security.PrivilegedAction;

class SecureAction$8
  implements PrivilegedAction<Long>
{
  final SecureAction this$0;
  
  SecureAction$8(SecureAction paramSecureAction, File paramFile) {}
  
  public Long run()
  {
    return new Long(val$file.length());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.8
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.io.File;
import java.io.IOException;
import java.security.PrivilegedExceptionAction;

class SecureAction$9
  implements PrivilegedExceptionAction<String>
{
  final SecureAction this$0;
  
  SecureAction$9(SecureAction paramSecureAction, File paramFile) {}
  
  public String run()
    throws IOException
  {
    return val$file.getCanonicalPath();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.util.SecureAction.9
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLStreamHandler;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.Properties;
import java.util.zip.ZipFile;
import org.eclipse.osgi.framework.internal.core.FrameworkProperties;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;

public class SecureAction
{
  private AccessControlContext controlContext;
  static final ClassLoader bootClassLoader = (ClassLoader)AccessController.doPrivileged(new PrivilegedAction()
  {
    public ClassLoader run()
    {
      Class tmp8_5 = SecureAction.class$0;
      if (tmp8_5 == null)
      {
        tmp8_5;
        try
        {
          tmpTernaryOp = (SecureAction.class$0 = Class.forName("java.lang.Object"));
        }
        catch (ClassNotFoundException localClassNotFoundException)
        {
          throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
        }
      }
      new ClassLoader(tmp8_5.getClassLoader()) {};
    }
  });
  static Class class$0;
  
  SecureAction()
  {
    controlContext = AccessController.getContext();
  }
  
  public static PrivilegedAction<SecureAction> createSecureAction()
  {
    new PrivilegedAction()
    {
      public SecureAction run()
      {
        return new SecureAction();
      }
    };
  }
  
  public String getProperty(final String property)
  {
    if (System.getSecurityManager() == null) {
      return FrameworkProperties.getProperty(property);
    }
    (String)AccessController.doPrivileged(new PrivilegedAction()
    {
      public String run()
      {
        return FrameworkProperties.getProperty(property);
      }
    }, controlContext);
  }
  
  public String getProperty(final String property, final String def)
  {
    if (System.getSecurityManager() == null) {
      return FrameworkProperties.getProperty(property, def);
    }
    (String)AccessController.doPrivileged(new PrivilegedAction()
    {
      public String run()
      {
        return FrameworkProperties.getProperty(property, def);
      }
    }, controlContext);
  }
  
  public Properties getProperties()
  {
    if (System.getSecurityManager() == null) {
      return FrameworkProperties.getProperties();
    }
    (Properties)AccessController.doPrivileged(new PrivilegedAction()
    {
      public Properties run()
      {
        return FrameworkProperties.getProperties();
      }
    }, controlContext);
  }
  
  public FileInputStream getFileInputStream(final File file)
    throws FileNotFoundException
  {
    if (System.getSecurityManager() == null) {
      return new FileInputStream(file);
    }
    try
    {
      (FileInputStream)AccessController.doPrivileged(new PrivilegedExceptionAction()
      {
        public FileInputStream run()
          throws FileNotFoundException
        {
          return new FileInputStream(file);
        }
      }, controlContext);
    }
    catch (PrivilegedActionException e)
    {
      if ((e.getException() instanceof FileNotFoundException)) {
        throw ((FileNotFoundException)e.getException());
      }
      throw ((RuntimeException)e.getException());
    }
  }
  
  public FileOutputStream getFileOutputStream(final File file, final boolean append)
    throws FileNotFoundException
  {
    if (System.getSecurityManager() == null) {
      return new FileOutputStream(file.getAbsolutePath(), append);
    }
    try
    {
      (FileOutputStream)AccessController.doPrivileged(new PrivilegedExceptionAction()
      {
        public FileOutputStream run()
          throws FileNotFoundException
        {
          return new FileOutputStream(file.getAbsolutePath(), append);
        }
      }, controlContext);
    }
    catch (PrivilegedActionException e)
    {
      if ((e.getException() instanceof FileNotFoundException)) {
        throw ((FileNotFoundException)e.getException());
      }
      throw ((RuntimeException)e.getException());
    }
  }
  
  public long length(final File file)
  {
    if (System.getSecurityManager() == null) {
      return file.length();
    }
    
    
      ((Long)AccessController.doPrivileged(new PrivilegedAction()
      {
        public Long run()
        {
          return new Long(file.length());
        }
      }, controlContext)).longValue();
  }
  
  public String getCanonicalPath(final File file)
    throws IOException
  {
    if (System.getSecurityManager() == null) {
      return file.getCanonicalPath();
    }
    try
    {
      (String)AccessController.doPrivileged(new PrivilegedExceptionAction()
      {
        public String run()
          throws IOException
        {
          return file.getCanonicalPath();
        }
      }, controlContext);
    }
    catch (PrivilegedActionException e)
    {
      if ((e.getException() instanceof IOException)) {
        throw ((IOException)e.getException());
      }
      throw ((RuntimeException)e.getException());
    }
  }
  
  public boolean exists(final File file)
  {
    if (System.getSecurityManager() == null) {
      return file.exists();
    }
    
    
      ((Boolean)AccessController.doPrivileged(new PrivilegedAction()
      {
        public Boolean run()
        {
          return file.exists() ? Boolean.TRUE : Boolean.FALSE;
        }
      }, controlContext)).booleanValue();
  }
  
  public boolean isDirectory(final File file)
  {
    if (System.getSecurityManager() == null) {
      return file.isDirectory();
    }
    
    
      ((Boolean)AccessController.doPrivileged(new PrivilegedAction()
      {
        public Boolean run()
        {
          return file.isDirectory() ? Boolean.TRUE : Boolean.FALSE;
        }
      }, controlContext)).booleanValue();
  }
  
  public long lastModified(final File file)
  {
    if (System.getSecurityManager() == null) {
      return file.lastModified();
    }
    
    
      ((Long)AccessController.doPrivileged(new PrivilegedAction()
      {
        public Long run()
        {
          return new Long(file.lastModified());
        }
      }, controlContext)).longValue();
  }
  
  public String[] list(final File file)
  {
    if (System.getSecurityManager() == null) {
      return file.list();
    }
    (String[])AccessController.doPrivileged(new PrivilegedAction()
    {
      public String[] run()
      {
        return file.list();
      }
    }, controlContext);
  }
  
  /* Error */
  public ZipFile getZipFile(final File file)
    throws IOException
  {
    // Byte code:
    //   0: invokestatic 312	java/lang/System:getSecurityManager	()Ljava/lang/SecurityManager;
    //   3: ifnonnull +12 -> 15
    //   6: new 144	java/util/zip/ZipFile
    //   9: dup
    //   10: aload_1
    //   11: invokespecial 323	java/util/zip/ZipFile:<init>	(Ljava/io/File;)V
    //   14: areturn
    //   15: new 152	org/eclipse/osgi/framework/util/SecureAction$14
    //   18: dup
    //   19: aload_0
    //   20: aload_1
    //   21: invokespecial 334	org/eclipse/osgi/framework/util/SecureAction$14:<init>	(Lorg/eclipse/osgi/framework/util/SecureAction;Ljava/io/File;)V
    //   24: aload_0
    //   25: getfield 290	org/eclipse/osgi/framework/util/SecureAction:controlContext	Ljava/security/AccessControlContext;
    //   28: invokestatic 319	java/security/AccessController:doPrivileged	(Ljava/security/PrivilegedExceptionAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;
    //   31: checkcast 144	java/util/zip/ZipFile
    //   34: areturn
    //   35: astore_2
    //   36: aload_2
    //   37: invokevirtual 320	java/security/PrivilegedActionException:getException	()Ljava/lang/Exception;
    //   40: instanceof 126
    //   43: ifeq +11 -> 54
    //   46: aload_2
    //   47: invokevirtual 320	java/security/PrivilegedActionException:getException	()Ljava/lang/Exception;
    //   50: checkcast 126	java/io/IOException
    //   53: athrow
    //   54: aload_2
    //   55: invokevirtual 320	java/security/PrivilegedActionException:getException	()Ljava/lang/Exception;
    //   58: checkcast 133	java/lang/RuntimeException
    //   61: athrow
    //   62: astore_2
    //   63: new 143	java/util/zip/ZipException
    //   66: dup
    //   67: new 135	java/lang/StringBuffer
    //   70: dup
    //   71: ldc 1
    //   73: invokespecial 310	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   76: aload_1
    //   77: invokevirtual 297	java/io/File:getPath	()Ljava/lang/String;
    //   80: invokevirtual 311	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   83: invokevirtual 309	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   86: invokespecial 321	java/util/zip/ZipException:<init>	(Ljava/lang/String;)V
    //   89: astore_3
    //   90: aload_3
    //   91: aload_2
    //   92: invokevirtual 322	java/util/zip/ZipException:initCause	(Ljava/lang/Throwable;)Ljava/lang/Throwable;
    //   95: pop
    //   96: aload_3
    //   97: athrow
    //   98: astore_2
    //   99: new 126	java/io/IOException
    //   102: dup
    //   103: new 135	java/lang/StringBuffer
    //   106: dup
    //   107: ldc 1
    //   109: invokespecial 310	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   112: aload_1
    //   113: invokevirtual 297	java/io/File:getPath	()Ljava/lang/String;
    //   116: invokevirtual 311	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   119: invokevirtual 309	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   122: invokespecial 301	java/io/IOException:<init>	(Ljava/lang/String;)V
    //   125: astore_3
    //   126: aload_3
    //   127: aload_2
    //   128: invokevirtual 302	java/io/IOException:initCause	(Ljava/lang/Throwable;)Ljava/lang/Throwable;
    //   131: pop
    //   132: aload_3
    //   133: athrow
    // Line number table:
    //   Java source line #273	-> byte code offset #0
    //   Java source line #274	-> byte code offset #6
    //   Java source line #276	-> byte code offset #15
    //   Java source line #280	-> byte code offset #24
    //   Java source line #276	-> byte code offset #28
    //   Java source line #281	-> byte code offset #35
    //   Java source line #282	-> byte code offset #36
    //   Java source line #283	-> byte code offset #46
    //   Java source line #284	-> byte code offset #54
    //   Java source line #286	-> byte code offset #62
    //   Java source line #287	-> byte code offset #63
    //   Java source line #288	-> byte code offset #90
    //   Java source line #289	-> byte code offset #96
    //   Java source line #290	-> byte code offset #98
    //   Java source line #291	-> byte code offset #99
    //   Java source line #292	-> byte code offset #126
    //   Java source line #293	-> byte code offset #132
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	134	0	this	SecureAction
    //   0	134	1	file	File
    //   35	20	2	e	PrivilegedActionException
    //   62	30	2	e	java.util.zip.ZipException
    //   98	30	2	e	IOException
    //   89	8	3	zipNameException	java.util.zip.ZipException
    //   125	8	3	fileNameException	IOException
    // Exception table:
    //   from	to	target	type
    //   15	34	35	java/security/PrivilegedActionException
    //   0	14	62	java/util/zip/ZipException
    //   15	34	62	java/util/zip/ZipException
    //   35	62	62	java/util/zip/ZipException
    //   0	14	98	java/io/IOException
    //   15	34	98	java/io/IOException
    //   35	62	98	java/io/IOException
  }
  
  public URL getURL(final String protocol, final String host, final int port, final String file, final URLStreamHandler handler)
    throws MalformedURLException
  {
    if (System.getSecurityManager() == null) {
      return new URL(protocol, host, port, file, handler);
    }
    try
    {
      (URL)AccessController.doPrivileged(new PrivilegedExceptionAction()
      {
        public URL run()
          throws MalformedURLException
        {
          return new URL(protocol, host, port, file, handler);
        }
      }, controlContext);
    }
    catch (PrivilegedActionException e)
    {
      if ((e.getException() instanceof MalformedURLException)) {
        throw ((MalformedURLException)e.getException());
      }
      throw ((RuntimeException)e.getException());
    }
  }
  
  public Thread createThread(final Runnable target, final String name, final ClassLoader contextLoader)
  {
    if (System.getSecurityManager() == null) {
      return createThread0(target, name, contextLoader);
    }
    (Thread)AccessController.doPrivileged(new PrivilegedAction()
    {
      public Thread run()
      {
        return createThread0(target, name, contextLoader);
      }
    }, controlContext);
  }
  
  Thread createThread0(Runnable target, String name, ClassLoader contextLoader)
  {
    Thread result = new Thread(target, name);
    if (contextLoader != null) {
      result.setContextClassLoader(contextLoader);
    }
    return result;
  }
  
  public <S> S getService(final ServiceReference<S> reference, final BundleContext context)
  {
    if (System.getSecurityManager() == null) {
      return (S)context.getService(reference);
    }
    (S)AccessController.doPrivileged(new PrivilegedAction()
    {
      public S run()
      {
        return (S)context.ge
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd