org.eclipse.osgi_3.8.2.v20130124-134944

 void log(FrameworkLogEntry paramFrameworkLogEntry);
  
  public abstract void setWriter(Writer paramWriter, boolean paramBoolean);
  
  public abstract void setFile(File paramFile, boolean paramBoolean)
    throws IOException;
  
  public abstract File getFile();
  
  public abstract void setConsoleLog(boolean paramBoolean);
  
  public abstract void close();
}

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

public class FrameworkLogEntry
{
  public static final int OK = 0;
  public static final int INFO = 1;
  public static final int WARNING = 2;
  public static final int ERROR = 4;
  public static final int CANCEL = 8;
  private final String entry;
  private final String message;
  private final int stackCode;
  private final Throwable throwable;
  private final FrameworkLogEntry[] children;
  private final int severity;
  private final int bundleCode;
  private final Object context;
  
  public FrameworkLogEntry(String entry, String message, int stackCode, Throwable throwable, FrameworkLogEntry[] children)
  {
    this(null, entry, 0, 0, message, stackCode, throwable, children);
  }
  
  public FrameworkLogEntry(String entry, int severity, int bundleCode, String message, int stackCode, Throwable throwable, FrameworkLogEntry[] children)
  {
    this(null, entry, severity, bundleCode, message, stackCode, throwable, children);
  }
  
  public FrameworkLogEntry(Object context, String entry, int severity, int bundleCode, String message, int stackCode, Throwable throwable, FrameworkLogEntry[] children)
  {
    this.context = context;
    this.entry = entry;
    this.message = message;
    this.stackCode = stackCode;
    this.throwable = throwable;
    this.children = children;
    this.severity = severity;
    this.bundleCode = bundleCode;
  }
  
  public FrameworkLogEntry[] getChildren()
  {
    return children;
  }
  
  public String getEntry()
  {
    return entry;
  }
  
  public String getMessage()
  {
    return message;
  }
  
  public int getStackCode()
  {
    return stackCode;
  }
  
  public Throwable getThrowable()
  {
    return throwable;
  }
  
  public int getSeverity()
  {
    return severity;
  }
  
  public int getBundleCode()
  {
    return bundleCode;
  }
  
  public Object getContext()
  {
    return context;
  }
}

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

import java.util.Enumeration;

class Headers$ArrayEnumeration<E>
  implements Enumeration<E>
{
  private E[] array;
  int cur = 0;
  
  public Headers$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++)];
  }
}

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

import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.osgi.framework.internal.core.Msg;
import org.eclipse.osgi.util.ManifestElement;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.BundleException;

public class Headers<K, V>
  extends Dictionary<K, V>
  implements Map<K, V>
{
  private boolean readOnly = false;
  private K[] headers;
  private V[] values;
  private int size = 0;
  
  public Headers(int initialCapacity)
  {
    Object[] k = new Object[initialCapacity];
    headers = k;
    
    Object[] v = new Object[initialCapacity];
    values = v;
  }
  
  public Headers(Dictionary<? extends K, ? extends V> values)
  {
    this(values.size());
    
    Enumeration<? extends K> keys = values.keys();
    while (keys.hasMoreElements())
    {
      K key = keys.nextElement();
      set(key, values.get(key));
    }
  }
  
  public synchronized Enumeration<K> keys()
  {
    return new ArrayEnumeration(headers, size);
  }
  
  public synchronized Enumeration<V> elements()
  {
    return new ArrayEnumeration(values, size);
  }
  
  private int getIndex(Object key)
  {
    boolean stringKey = key instanceof String;
    for (int i = 0; i < size; i++) {
      if ((stringKey) && ((headers[i] instanceof String)))
      {
        if (((String)headers[i]).equalsIgnoreCase((String)key)) {
          return i;
        }
      }
      else if (headers[i].equals(key)) {
        return i;
      }
    }
    return -1;
  }
  
  private V remove(int remove)
  {
    V removed = values[remove];
    for (int i = remove; i < size; i++) {
      if (i == headers.length - 1)
      {
        headers[i] = null;
        values[i] = null;
      }
      else
      {
        headers[i] = headers[(i + 1)];
        values[i] = values[(i + 1)];
      }
    }
    if (remove < size) {
      size -= 1;
    }
    return removed;
  }
  
  private void add(K header, V value)
  {
    if (size == headers.length)
    {
      Object[] nh = new Object[headers.length + 10];
      Object[] newHeaders = nh;
      
      Object[] nv = new Object[values.length + 10];
      Object[] newValues = nv;
      System.arraycopy(headers, 0, newHeaders, 0, headers.length);
      System.arraycopy(values, 0, newValues, 0, values.length);
      headers = newHeaders;
      values = newValues;
    }
    headers[size] = header;
    values[size] = value;
    size += 1;
  }
  
  public synchronized V get(Object key)
  {
    int i = -1;
    if ((i = getIndex(key)) != -1) {
      return (V)values[i];
    }
    return null;
  }
  
  public synchronized V set(K key, V value, boolean replace)
  {
    if (readOnly) {
      throw new UnsupportedOperationException();
    }
    if ((key instanceof String))
    {
      K k = ((String)key).intern();
      key = k;
    }
    int i = getIndex(key);
    if (value == null)
    {
      if (i != -1) {
        return (V)remove(i);
      }
    }
    else
    {
      if (i != -1)
      {
        if (!replace) {
          throw new IllegalArgumentException(NLS.bind(Msg.HEADER_DUPLICATE_KEY_EXCEPTION, key));
        }
        V oldVal = values[i];
        values[i] = value;
        return oldVal;
      }
      add(key, value);
    }
    return null;
  }
  
  public synchronized V set(K key, V value)
  {
    return (V)set(key, value, false);
  }
  
  public synchronized void setReadOnly()
  {
    readOnly = true;
  }
  
  public synchronized int size()
  {
    return size;
  }
  
  public synchronized boolean isEmpty()
  {
    return size == 0;
  }
  
  public synchronized V put(K key, V value)
  {
    if (readOnly) {
      throw new UnsupportedOperationException();
    }
    return (V)set(key, value, true);
  }
  
  public V remove(Object key)
  {
    throw new UnsupportedOperationException();
  }
  
  public String toString()
  {
    return values.toString();
  }
  
  public static Headers<String, String> parseManifest(InputStream in)
    throws BundleException
  {
    Headers<String, String> headers = new Headers(10);
    try
    {
      ManifestElement.parseBundleManifest(in, headers);
    }
    catch (IOException e)
    {
      throw new BundleException(Msg.MANIFEST_IOEXCEPTION, 3, e);
    }
    headers.setReadOnly();
    return headers;
  }
  
  private static class ArrayEnumeration<E>
    implements Enumeration<E>
  {
    private E[] array;
    int 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();
    
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 85 86 87

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