org.eclipse.equinox.preferences_3.5.1.v20121031-182809

16:44:41.510 INFO  jd.cli.Main - Decompiling org.eclipse.equinox.preferences_3.5.1.v20121031-182809.jar
package org.eclipse.core.internal.preferences;

import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.osgi.service.prefs.Preferences;

public abstract class AbstractScope
  implements IScopeContext
{
  public abstract String getName();
  
  public IEclipsePreferences getNode(String qualifier)
  {
    if (qualifier == null) {
      throw new IllegalArgumentException();
    }
    return (IEclipsePreferences)PreferencesService.getDefault().getRootNode().node(getName()).node(qualifier);
  }
  
  public abstract IPath getLocation();
  
  public boolean equals(Object obj)
  {
    if (this == obj) {
      return true;
    }
    if (!(obj instanceof IScopeContext)) {
      return false;
    }
    IScopeContext other = (IScopeContext)obj;
    if (!getName().equals(other.getName())) {
      return false;
    }
    IPath location = getLocation();
    return location == null ? false : other.getLocation() == null ? true : location.equals(other.getLocation());
  }
  
  public int hashCode()
  {
    return getName().hashCode();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.core.internal.preferences.AbstractScope
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.core.internal.preferences;

import java.util.Hashtable;
import org.eclipse.core.internal.runtime.RuntimeLog;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.osgi.service.environment.EnvironmentInfo;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;

public class Activator
  implements BundleActivator, ServiceTrackerCustomizer
{
  public static final String PI_PREFERENCES = "org.eclipse.equinox.preferences";
  private static final String PROP_REGISTER_PERF_SERVICE = "eclipse.service.pref";
  private static final String PROP_CUSTOMIZATION = "eclipse.pluginCustomization";
  private ServiceTracker registryServiceTracker;
  private static BundleContext bundleContext;
  private ServiceRegistration preferencesService = null;
  private ServiceRegistration osgiPreferencesService = null;
  
  public void start(BundleContext context)
    throws Exception
  {
    bundleContext = context;
    
    PreferencesOSGiUtils.getDefault().openServices();
    processCommandLine();
    
    boolean shouldRegister = !"false".equalsIgnoreCase(context.getProperty("eclipse.service.pref"));
    if (shouldRegister)
    {
      preferencesService = bundleContext.registerService(IPreferencesService.class.getName(), PreferencesService.getDefault(), new Hashtable());
      osgiPreferencesService = bundleContext.registerService(org.osgi.service.prefs.PreferencesService.class.getName(), new OSGiPreferencesServiceManager(bundleContext), null);
    }
    registryServiceTracker = new ServiceTracker(bundleContext, "org.eclipse.core.runtime.IExtensionRegistry", this);
    registryServiceTracker.open();
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    PreferencesOSGiUtils.getDefault().closeServices();
    if (registryServiceTracker != null)
    {
      registryServiceTracker.close();
      registryServiceTracker = null;
    }
    if (preferencesService != null)
    {
      preferencesService.unregister();
      preferencesService = null;
    }
    if (osgiPreferencesService != null)
    {
      osgiPreferencesService.unregister();
      osgiPreferencesService = null;
    }
    bundleContext = null;
  }
  
  static BundleContext getContext()
  {
    return bundleContext;
  }
  
  public synchronized Object addingService(ServiceReference reference)
  {
    Object service = bundleContext.getService(reference);
    if (service != null) {
      try
      {
        Object helper = new PreferenceServiceRegistryHelper(PreferencesService.getDefault(), service);
        PreferencesService.getDefault().setRegistryHelper(helper);
      }
      catch (Exception e)
      {
        RuntimeLog.log(new Status(4, "org.eclipse.equinox.preferences", 0, PrefsMessages.noRegistry, e));
      }
      catch (NoClassDefFoundError localNoClassDefFoundError)
      {
        return null;
      }
    }
    return service;
  }
  
  public void modifiedService(ServiceReference reference, Object service) {}
  
  public synchronized void removedService(ServiceReference reference, Object service)
  {
    PreferencesService.getDefault().setRegistryHelper(null);
    bundleContext.ungetService(reference);
  }
  
  private void processCommandLine()
  {
    String value = bundleContext.getProperty("eclipse.pluginCustomization");
    if (value != null)
    {
      DefaultPreferences.pluginCustomizationFile = value;
      return;
    }
    ServiceTracker environmentTracker = new ServiceTracker(bundleContext, EnvironmentInfo.class.getName(), null);
    environmentTracker.open();
    EnvironmentInfo environmentInfo = (EnvironmentInfo)environmentTracker.getService();
    environmentTracker.close();
    if (environmentInfo == null) {
      return;
    }
    String[] args = environmentInfo.getNonFrameworkArgs();
    if ((args == null) || (args.length == 0)) {
      return;
    }
    for (int i = 0; i < args.length; i++) {
      if (args[i].equalsIgnoreCase("-plugincustomization"))
      {
        if (args.length <= i + 1) {
          break;
        }
        DefaultPreferences.pluginCustomizationFile = args[(i + 1)];
        break;
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.core.internal.preferences.Activator
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.core.internal.preferences;

public class Base64
{
  private static final byte equalSign = 61;
  static char[] digits = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 
    'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 
    'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 
    'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' };
  
  public static byte[] decode(byte[] data)
  {
    if (data.length == 0) {
      return data;
    }
    int lastRealDataIndex = data.length - 1;
    while (data[lastRealDataIndex] == 61) {
      lastRealDataIndex--;
    }
    int padBytes = data.length - 1 - lastRealDataIndex;
    int byteLength = data.length * 6 / 8 - padBytes;
    byte[] result = new byte[byteLength];
    
    int dataIndex = 0;
    int resultIndex = 0;
    int allBits = 0;
    
    int resultChunks = (lastRealDataIndex + 1) / 4;
    for (int i = 0; i < resultChunks; i++)
    {
      allBits = 0;
      for (int j = 0; j < 4; j++) {
        allBits = allBits << 6 | decodeDigit(data[(dataIndex++)]);
      }
      for (int j = resultIndex + 2; j >= resultIndex; j--)
      {
        result[j] = ((byte)(allBits & 0xFF));
        allBits >>>= 8;
      }
      resultIndex += 3;
    }
    switch (padBytes)
    {
    case 1: 
      allBits = 0;
      for (int j = 0; j < 3; j++) {
        allBits = allBits << 6 | decodeDigit(data[(dataIndex++)]);
      }
      allBits <<= 6;
      
      allBits >>>= 8;
      for (int j = resultIndex + 1; j >= resultIndex; j--)
      {
        result[j] = ((byte)(allBits & 0xFF));
        
        allBits >>>= 8;
      }
      break;
    case 2: 
      allBits = 0;
      for (int j = 0; j < 2; j++) {
        allBits = allBits << 6 | decodeDigit(data[(dataIndex++)]);
      }
      allBits <<= 6;
      allBits <<= 6;
      
      allBits >>>= 8;
      allBits >>>= 8;
      result[resultIndex] = ((byte)(allBits & 0xFF));
    }
    return result;
  }
  
  static int decodeDigit(byte data)
  {
    char charData = (char)data;
    if ((charData <= 'Z') && (charData >= 'A')) {
      return charData - 'A';
    }
    if ((charData <= 'z') && (charData >= 'a')) {
      return charData - 'a' + 26;
    }
    if ((charData <= '9') && (charData >= '0')) {
      return charData - '0' + 52;
    }
    switch (charData)
    {
    case '+': 
      return 62;
    case '/': 
      return 63;
    }
    throw new IllegalArgumentException("Invalid char to decode: " + data);
  }
  
  public static byte[] encode(byte[] data)
  {
    int sourceChunks = data.length / 3;
    int len = (data.length + 2) / 3 * 4;
    byte[] result = new byte[len];
    int extraBytes = data.length - sourceChunks * 3;
    
    int dataIndex = 0;
    int resultIndex = 0;
    int allBits = 0;
    for (int i = 0; i < sourceChunks; i++)
    {
      allBits = 0;
      for (int j = 0; j < 3; j++) {
        allBits = allBits << 8 | data[(dataIndex++)] & 0xFF;
      }
      for (int j = resultIndex + 3; j >= resultIndex; j--)
      {
        result[j] = ((byte)digits[(allBits & 0x3F)]);
        
        allBits >>>= 6;
      }
      resultIndex += 4;
    }
    switch (extraBytes)
    {
    case 1: 
      allBits = data[(dataIndex++)];
      allBits <<= 8;
      allBits <<= 8;
      for (int j = resultIndex + 3; j >= resultIndex; j--)
      {
        result[j] = ((byte)digits[(allBits & 0x3F)]);
        
        allBits >>>= 6;
      }
      result[(result.length - 1)] = 61;
      result[(result.length - 2)] = 61;
      break;
    case 2: 
      allBits = data[(dataIndex++)];
      allBits = allBits << 8 | data[(dataIndex++)] & 0xFF;
      
      allBits <<= 8;
      for (int j = resultIndex + 3; j >= resultIndex; j--)
      {
        result[j] = ((byte)digits[(allBits & 0x3F)]);
        
        allBits >>>= 6;
      }
      result[(result.length - 1)] = 61;
    }
    return result;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.core.internal.preferences.Base64
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.core.internal.preferences;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.osgi.service.prefs.Preferences;

public class BundleDefaultPreferences
  extends EclipsePreferences
{
  private static Set loadedNodes = Collections.synchronizedSet(new HashSet());
  private String qualifier;
  private int segmentCount;
  private IEclipsePreferences loadLevel;
  
  public BundleDefaultPreferences()
  {
    this(null, null);
  }
  
  private BundleDefaultPreferences(EclipsePreferences parent, String name)
  {
    super(parent, name);
    
    IPath path = new Path(absolutePath());
    segmentCount = path.segmentCount();
    if (segmentCount < 2) {
      return;
    }
    String scope = path.segment(0);
    if ("bundle_defaults".equals(scope)) {
      qualifier = path.segment(1);
    }
    if (qualifier == null) {}
  }
  
  protected IEclipsePreferences getLoadLevel()
  {
    if (loadLevel == null)
    {
      if (qualifier == null) {
        return null;
      }
      IEclipsePreferences node = this;
      for (int i = 2; i < segmentCount; i++) {
        node = (IEclipsePreferences)node.parent();
      }
      loadLevel = node;
    }
    return loadLevel;
  }
  
  protected boolean isAlreadyLoaded(IEclipsePreferences node)
  {
    return loadedNodes.contains(node.name());
  }
  
  protected void loaded()
  {
    loadedNodes.add(name());
  }
  
  protected void load()
  {
    String relativePath = DefaultPreferences.getScopeRelativePath(absolutePath());
    if (relativePath != null) {
      PreferencesService.getDefault().getRootNode().node("default").node(relativePath);
    }
  }
  
  protected EclipsePreferences internalCreate(EclipsePreferences nodeParent, String nodeName, Object context)
  {
    return new BundleDefaultPreferences(nodeParent, nodeName);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.core.internal.preferences.BundleDefaultPreferences
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.core.internal.preferences;

import java.net.URL;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.osgi.service.datalocation.Location;

public class ConfigurationPreferences
  extends EclipsePreferences
{
  private int segmentCount;
  private String qualifier;
  private IPath location;
  private IEclipsePreferences loadLevel;
  private static Set loadedNodes = Collections.synchronizedSet(new HashSet());
  private static boolean initialized = false;
  private static IPath baseLocation;
  
  static
  {
    Location location = PreferencesOSGiUtils.getDefault().getConfigurationLocation();
    if (location != null)
    {
      URL url = location.getURL();
      if (url != null) {
        baseLocation = new Path(url.getFile());
      }
    }
  }
  
  public ConfigurationPreferences()
  {
    this(null, null);
  }
  
  private ConfigurationPreferences(EclipsePreferences parent, String name)
  {
    super(parent, name);
    
    initializeChildren();
    
    String path = absolutePath();
    segmentCount = getSegmentCount(path);
    if (segmentCount < 2) {
      return;
    }
    qualifier = getSegment(path, 1);
    if (qualifier == null) {
      return;
    }
    if (baseLocation != null) {
      location = computeLocation(baseLocation, qualifier);
    }
  }
  
  protected IPath getLocation()
  {
    return location;
  }
  
  protected boolean isAlreadyLoaded(IEclipsePreferences node)
  {
    return loadedNodes.contains(node.name());
  }
  
  protected void loaded()
  {
    loadedNodes.add(name());
  }
  
  protected IEclipsePreferences getLoadLevel()
  {
    if (loadLevel == null)
    {
      if (qualifier == null) {
        return null;
      }
      IEclipsePreferences node = this;
      for (int i = 2; i < segmentCount; i++) {
        node = (EclipsePreferences)node.parent();
      }
      loadLevel = node;
    }
    return loadLevel;
  }
  
  protected void initializeChildren()
  {
    if ((initialized) || (parent == null)) {
      return;
    }
    try
    {
      synchronized (this)
      {
        if (baseLocation == null) {
          return;
        }
        String[] names = computeChildren(baseLocation);
        for (int i = 0; i < names.length; i++) {
          addChild(names[i], null);
        }
      }
    }
    finally
    {
      initialized = true;
    }
  }
  
  protected EclipsePreferences internalCreate(EclipsePreferences nodeParent, String nodeName, Object context)
  {
    return new ConfigurationPreferences(nodeParent, nodeName);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.core.internal.preferences.ConfigurationPreferences
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.core.internal.preferences;

import java.lang.ref.WeakReference;
import java.net.URL;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
import org.eclipse.core.internal.preferences.exchange.IProductPreferencesService;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.service.prefs.Preferences;
import org.osgi.util.tracker.ServiceTracker;

public class DefaultPreferences
  extends EclipsePreferences
{
  private static Set loadedNodes = Collections.synchronizedSet(new HashSet());
  private static final String KEY_PREFIX = "%";
  private static final String KEY_DOUBLE_PREFIX = "%%";
  private static final IPath NL_DIR = new Path("$nl$");
  private static final String PROPERTIES_FILE_EXTENSION = "properties";
  private static Properties productCustomization;
  private static Properties productTranslation;
  private static Properties commandLineCustomization;
  private EclipsePreferences loadLevel;
  private Thread initializingThread;
  private String qualifier;
  private int segmentCount;
  private WeakReference pluginReference;
  public static String pluginCustomizationFile = null;
  
  public DefaultPreferences()
  {
    this(null, null);
  }
  
  private DefaultPreferences(EclipsePreferences parent, String name, Object context)
  {
    this(parent, name);
    pluginReference = new WeakReference(context);
  }
  
  private DefaultPreferences(EclipsePreferences parent, String name)
  {
    super(parent, name);
    if ((parent instanceof DefaultPreferences)) {
      pluginReference = pluginReference;
    }
    String path = absolutePath();
    segmentCount = getSegmentCount(path);
    if (segmentCount < 2) {
      return;
    }
    qualifier = getSegment(path, 1);
  }
  
  private void applyBundleDefaults()
  {
    Bundle bundle = PreferencesOSGiUtils.getDefault().getBundle(name());
    if (bundle == null) {
      return;
    }
    URL url = FileLocator.find(bundle, new Path("preferences.ini"), null);
    if (url == null)
    {
      if (EclipsePreferences.DEBUG_PREFERENCE_GENERAL) {
        PrefsMessages.message("Preference default override file not found for bundle: " + bundle.getSymbolicName());
      }
      return;
    }
    URL transURL = FileLocator.find(bundle, NL_DIR.append("preferences").addFileExtension("properties"), null);
    if ((transURL == null) && (EclipsePreferences.DEBUG_PREFERENCE_GENERAL)) {
      PrefsMessages.message("Preference translation file not found for bundle: " + bundle.getSymbolicName());
    }
    applyDefaults(name(), loadProperties(url), loadProperties(transURL));
  }
  
  private void applyCommandLineDefaults()
  {
    if (commandLineCustomization == null)
    {
      String filename = pluginCustomizationFile;
      if (filename == null)
      {
        if (EclipsePreferences.DEBUG_PREFERENCE_GENERAL) {
          PrefsMessages.message("Command-line preferences customization file not specified.");
        }
        return;
      }
      if (EclipsePreferences.DEBUG_PREFERENCE_GENERAL) {
        PrefsMessages.message("Using command-line preference customization file: " + filename);
      }
      commandLineCustomization = loadProperties(filename);
    }
    applyDefaults(null, commandLineCustomization, null);
  }
  
  private void applyDefaults(String id, Properties defaultValues, Properties translations)
  {
    for (Enumeration e = defaultValues.keys(); e.hasMoreElements();)
    {
      String fullKey = (String)e.nextElement();
      String value = defaultValues.getProperty(fullKey);
      if (value != null)
      {
        IPath childPath = new Path(fullKey);
        String key = childPath.lastSegment();
        childPath = childPath.removeLastSegments(1);
        String localQualifier = id;
        if (id == null)
        {
          localQualifier = childPath.segment(0);
          childPath = childPath.removeFirstSegments(1);
        }
        if (name().equals(localQualifier))
        {
          value = translatePreference(value, translations);
          if (EclipsePreferences.DEBUG_PREFERENCE_SET) {
            PrefsMessages.message("Setting default preference: " + new Path(absolutePath()).append(childPath).append(key) + '=' + value);
          }
          ((EclipsePreferences)internalNode(childPath.toString(), false, null)).internalPut(key, value);
        }
      }
    }
  }
  
  public IEclipsePreferences node(String childName, Object context)
  {
    return internalNode(childName, true, context);
  }
  
  private void applyRuntimeDefaults()
  {
    WeakReference ref = PreferencesService.getDefault().applyRuntimeDefaults(name(), pluginReference);
    if (ref != null) {
      pluginReference = ref;
    }
  }
  
  private void applyProductDefaults()
  {
    if (productCustomization == null)
    {
      BundleContext context = Activator.getContext();
      if (context != null)
      {
        ServiceTracker productTracker = new ServiceTracker(context, IProductPreferencesService.class.getName(), null);
        productTracker.open();
        IProductPreferencesService productSpecials = (IProductPreferencesService)productTracker.getService();
        if (productSpecials != null)
        {
          productCustomization = productSpecials.getProductCustomization();
          productTranslation = productSpecials.getProductTranslation();
        }
        productTracker.close();
      }
      else
      {
        PrefsMessages.message("Product-specified preferences called before plugin is started");
      }
      if (productCustomization == null) {
        productCustomization = new Properties();
      }
    }
    if (!productCustomization.isEmpty()) {
      applyDefaults(null, productCustomization, productTranslation);
    }
  }
  
  public void flush() {}
  
  protected IEclipsePreferences getLoadLevel()
  {
    if (loadLevel == null)
    {
      if (qualifier == null) {
        return null;
      }
      EclipsePreferences node = this;
      for (int i = 2; i < segmentCount; i++) {
        node = (EclipsePreferences)node.parent();
      }
      loadLevel = node;
    }
    return loadLevel;
  }
  
  protected EclipsePreferences internalCreate(EclipsePreferences nodeParent, String nodeName, Object context)
  {
    return new DefaultPreferences(nodeParent, nodeName, context);
  }
  
  protected boolean isAlreadyLoaded(IEclipsePreferences node)
  {
    return loadedNodes.contains(node.name());
  }
  
  /* Error */
  protected void load()
  {
    // Byte code:
    //   0: aload_0
    //   1: invokespecial 459	org/eclipse/core/internal/preferences/DefaultPreferences:setInitializingBundleDefaults	()V
    //   4: aload_0
    //   5: invokespecial 457	org/eclipse/core/internal/preferences/DefaultPreferences:applyRuntimeDefaults	()V
    //   8: aload_0
    //   9: invokespecial 454	org/eclipse/core/internal/preferences/DefaultPreferences:applyBundleDefaults	()V
    //   12: goto +10 -> 22
    //   15: astore_1
    //   16: aload_0
    //   17: invokespecial 458	org/eclipse/core/internal/preferences/DefaultPreferences:clearInitializingBundleDefaults	()V
    //   20: aload_1
    //   21: athrow
    //   22: aload_0
    //   23: invokespecial 458	org/eclipse/core/internal/preferences/DefaultPreferences:clearInitializingBundleDefaults	()V
    //   26: aload_0
    //   27: invokespecial 456	org/eclipse/core/internal/preferences/DefaultPreferences:applyProductDefaults	()V
    //   30: aload_0
    //   31: invokespecial 455	org/eclipse/core/internal/preferences/DefaultPreferences:applyCommandLineDefaults	()V
    //   34: return
    // Line number table:
    //   Java source line #235	-> byte code offset #0
    //   Java source line #237	-> byte code offset #4
    //   Java source line #238	-> byte code offset #8
    //   Java source line #239	-> byte code offset #15
    //   Java source line #240	-> byte code offset #16
    //   Java source line #241	-> byte code offset #20
    //   Java source line #240	-> byte code offset #22
    //   Java source line #242	-> byte code offset #26
    //   Java source line #243	-> byte code offset #30
    //   Java source line #244	-> byte code offset #34
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	35	0	this	DefaultPreferences
    //   15	6	1	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   4	15	15	finally
  }
  
  protected String internalPut(String key, String newValue)
  {
    String result = super.internalPut(key, newValue);
    if (isInitializingBundleDefaults())
    {
      String relativePath = getScopeRelativePath(absolutePath());
      if (relativePath != null)
      {
        Preferences node = PreferencesService.getDefault().getRootNode().node("bundle_defaults").node(relativePath);
        node.put(key, newValue);
      }
    }
    return result;
  }
  
  private void setInitializingBundleDefaults()
  {
    IEclipsePreferences node = getLoadLevel();
    if ((node instanceof DefaultPreferences))
    {
      DefaultPreferences loader = (DefaultPreferences)node;
      initializingThread = Thread.currentThread();
    }
  }
  
  private void clearInitializingBundleDefaults()
  {
    IEclipsePreferences node = getLoadLevel();
    if ((node instanceof DefaultPreferences))
    {
      DefaultPreferences loader = (DefaultPreferences)node;
      initializingThread = null;
    }
  }
  
  private boolean isInitializingBundleDefaults()
  {
    IEclipsePreferences node = getLoadLevel();
    if ((node instanceof DefaultPreferences))
    {
      DefaultPreferences loader = (DefaultPreferences)node;
      return initializingThread == Thread.currentThread();
    }
    return false;
  }
  
  protected static String getScopeRelativePath(String absolutePath)
  {
    if (absolutePath.length() < 2) {
      return null;
    }
    int index = absolutePath.indexOf('/', 1);
    if ((index == -1) || (index + 1 >= absolutePath.length())) {
      return null;
    }
    return absolutePath.substring(index + 1);
  }
  
  /* Error */
  private Properties loadProperties(URL url)
  {
    // Byte code:
    //   0: new 221	java/util/Properties
    //   3: dup
    //   4: invokespecial 447	java/util/Properties:<init>	()V
    //   7: astore_2
    //   8: aload_1
    //   9: ifnonnull +5 -> 14
    //   12: aload_2
    //   13: areturn
    //   14: aconst_null
    //   15: astore_3
    //   16: aload_1
    //   17: invokevirtual 444	java/net/URL:openStream	()Ljava/io/InputStream;
    //   20: astore_3
    //   21: aload_2
    //   22: aload_3
    //   23: invokevirtual 449	java/util/Properties:load	(Ljava/io/InputStream;)V
    //   26: goto +68 -> 94
    //   29: astore 4
    //   31: getstatic 418	org/eclipse/core/internal/preferences/EclipsePreferences:DEBUG_PREFERENCE_GENERAL	Z
    //   34: ifeq +28 -> 62
    //   37: new 213	java/lang/StringBuffer
    //   40: dup
    //   41: ldc_w 198
    //   44: invokespecial 437	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   47: aload_1
    //   48: invokevirtual 439	java/lang/StringBuffer:append	(Ljava/lang/Object;)Ljava/lang/StringBuffer;
    //   51: invokevirtual 436	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   54: invokestatic 482	org/eclipse/core/internal/preferences/PrefsMessages:message	(Ljava/lang/String;)V
    //   57: aload 4
    //   59: invokevirtual 423	java/io/IOException:printStackTrace	()V
    //   62: aload_3
    //   63: ifnull +43 -> 106
    //   66: aload_3
    //   67: invokevirtual 424	java/io/InputStream:close	()V
    //   70: goto +36 -> 106
    //   73: pop
    //   74: goto +32 -> 106
    //   77: astore 5
    //   79: aload_3
    //   80: ifnull +11 -> 91
    //   83: aload_3
    //   84: invokevirtual 424	java/io/InputStream:close	()V
    //   87: goto +4 -> 91
    //   90: pop
    //   91: aload 5
    //   93: athrow
    //   94: aload_3
    //   95: ifnull +11 -> 106
    //   98: aload_3
    //   99: invokevirtual 424	java/io/InputStream:close	()V
    //   102: goto +4 -> 106
    //   105: pop
    //   106: aload_2
    //   107: areturn
    // Line number table:
    //   Java source line #320	-> byte code offset #0
    //   Java source line #321	-> byte code offset #8
    //   Java source line #322	-> byte code offset #12
    //   Java source line #323	-> byte code offset #14
    //   Java source line #325	-> byte code offset #16
    //   Java source line #326	-> byte code offset #21
    //   Java source line #327	-> byte code offset #29
    //   Java source line #328	-> byte code offset #31
    //   Java source line #329	-> byte code offset #37
    //   Java source line #330	-> byte code offset #57
    //   Java source line #333	-> byte code offset #62
    //   Java source line #335	-> byte code offset #66
    //   Java source line #336	-> byte code offset #73
    //   Java source line #332	-> byte code offset #77
    //   Java source line #333	-> byte code offset #79
    //   Java source line #335	-> byte code offset #83
    //   Java source line #336	-> byte code offset #90
    //   Java source line #339	-> byte code offset #91
    //   Java source line #333	-> byte code offset #94
    //   Java source line #335	-> byte code offset #98
    //   Java source line #336	-> byte code offset #105
    //   Java source line #340	-> byte code offset #106
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	108	0	this	DefaultPreferences
    //   0	108	1	url	URL
    //   7	100	2	result	Properties
    //   15	84	3	input	java.io.InputStream
    //   29	29	4	e	java.io.IOException
    //   77	15	5	localObject	Object
    //   73	1	6	localIOException1	java.io.IOException
    //   90	1	7	localIOException2	java.io.IOException
    //   105	1	8	localIOException3	java.io.IOException
    // Exception table:
    //   from	to	target	type
    //   16	26	29	java/io/IOException
    //   66	70	73	java/io/IOException
    //   16	62	77	finally
    //   83	87	90	java/io/IOException
    //   98	102	105	java/io/IOException
  }
  
  /* Error */
  private Properties loadProperties(String filename)
  {
    // Byte code:
    //   0: new 221	java/util/Properties
    //   3: dup
    //   4: invokespecial 447	java/util/Properties:<init>	()V
    //   7: astore_2
    //   8: aconst_null
    //   9: astore_3
    //   10: new 203	java/io/BufferedInputStream
    //   13: dup
    //   14: new 204	java/io/FileInputStream
    //   17: dup
    //   18: aload_1
    //   19: invokespecial 422	java/io/FileInputStream:<init>	(Ljava/lang/String;)V
    //   22: invokespecial 421	java/io/BufferedInputStream:<init>	(Ljava/io/InputStream;)V
    //   25: astore_3
    //   26: aload_2
    //   27: aload_3
    //   28: invokevirtual 449	java/util/Properties:load	(Ljava/io/InputStream;)V
    //   31: goto +111 -> 142
    //   34: pop
    //   35: getstatic 418	org/eclipse/core/internal/preferences/EclipsePreferences:DEBUG_PREFERENCE_GENERAL	Z
    //   38: ifeq +23 -> 61
    //   41: new 213	java/lang/StringBuffer
    //   44: dup
    //   45: ldc_w 197
    //   48: invokespecial 437	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   51: aload_1
    //   52: invokevirtual 440	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   55: invokevirtual 436	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   58: invokestatic 482	org/eclipse/core/internal/preferences/PrefsMessages:message	(Ljava/lang/String;)V
    //   61: aload_3
    //   62: ifnull +92 -> 154
    //   65: aload_3
    //   66: invokevirtual 424	java/io/InputStream:close	()V
    //   69: goto +85 -> 154
    //   72: pop
    //   73: goto +81 -> 154
    //   76: astore 4
    //   78: getstatic 420	org/eclipse/core/internal/preferences/PrefsMessages:preferences_loadException	Ljava/lang/String;
    //   81: aload_1
    //   82: invokestatic 488	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   85: astore 5
    //   87: new 234	org/eclipse/core/runtime/Status
    //   90: dup
    //   91: iconst_4
    //   92: ldc_w 202
    //   95: iconst_4
    //   96: aload 5
    //   98: aload 4
    //   100: invokespecial 487	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
    //   103: astore 6
    //   105: aload 6
    //   107: invokestatic 483	org/eclipse/core/internal/runtime/RuntimeLog:log	(Lorg/eclipse/core/runtime/IStatus;)V
    //   110: aload_3
    //   111: ifnull +43 -> 154
    //   114: aload_3
    //   115: invokevirtual 424	java/io/InputStream:close	()V
    //   118: goto +36 -> 154
    //   121: pop
    //   122: goto +32 -> 154
    //   125: astore 7
    //   127: aload_3
    //   128: ifnull +11 -> 139
    //   131: aload_3
    //   132: invokevirtual 424	java/io/InputStream:close	()V
    //   135: goto +4 -> 139
    //   138: pop
    //   139: aload 7
    //   141: athrow
    //   142: aload_3
    //   143: ifnull +11 -> 154
    //   146: aload_3
    //   147: invokevirtual 424	java/io/InputStream:close	()V
    //   150: goto +4 -> 154
    //   153: pop
    //   154: aload_2
    //   155: areturn
    // Line number table:
    //   Java source line #344	-> byte code offset #0
    //   Java source line #345	-> byte code offset #8
    //   Java source line #347	-> byte code offset #10
    //   Java source line #348	-> byte code offset #26
    //   Java source line #349	-> byte code offset #34
    //   Java source line #350	-> byte code offset #35
    //   Java source line #351	-> byte code offset #41
    //   Java source line #357	-> byte code offset #61
    //   Java source line #359	-> byte code offset #65
    //   Java source line #360	-> byte code offset #72
    //   Java source line #352	-> byte code offset #76
    //   Java source line #353	-> byte code offset #78
    //   Java source line #354	-> byte code offset #87
    //   Java source line #355	-> byte code offset #105
    //   Java source line #357	-> byte code offset #110
    //   Java source line #359	-> byte code offset #114
    //   Java source line #360	-> byte code offset #121
    //   Java source line #356	-> byte code offset #125
    //   Java source line #357	-> byte code offset #127
    //   Java source line #359	-> byte code offset #131
    //   Java source line #360	-> byte code offset #138
    //   Java source line #363	-> byte code offset #139
    //   Java source line #357	-> byte code offset #142
    //   Java source line #359	-> byte code offset #146
    //   Java source line #360	-> byte code offset #153
    //   Java source line #364	-> byte code offset #154
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	156	0	this	DefaultPreferences
    //   0	156	1	filename	String
    //   7	148	2	result	Properties
    //   9	138	3	input	java.io.InputStream
    //   76	23	4	e	java.io.IOException
    //   85	12	5	message	String
    //   103	3	6	status	org.eclipse.core.runtime.IStatus
    //   125	15	7	localObject	Object
    //   34	1	8	localFileNotFoundException	java.io.FileNotFoundException
    //   72	1	9	localIOException1	java.io.IOException
    //   121	1	10	localIOException2	java.io.IOException
    //   138	1	11	localIOException3	java.io.IOException
    //   153	1	12	localIOException4	java.io.IOException
    // Exception table:
    //   from	to	target	type
    //   10	31	34	java/io/FileNotFoundException
    //   65	69	72	java/io/IOException
    //   10	31	76	java/io/IOException
    //   114	118	121	java/io/IOException
    //   10	61	125	finally
    //   76	110	125	finally
    //   131	135	138	java/io/IOException
    //   146	150	153	java/io/IOException
  }
  
  protected void loaded()
  {
    loadedNodes.add(name());
  }
  
  public void sync() {}
  
  private String translatePreference(String origValue, Properties props)
  {
    if ((props == null) || (origValue.startsWith("%%"))) {
      return origValue;
    }
    if (origValue.startsWith("%"))
    {
      String value = origValue.trim();
      int ix = value.indexOf(" ");
      String key = ix == -1 ? value.substring(1) : value.substring(1, ix);
      String dflt = ix == -1 ? value : value.substring(ix + 1);
      return props.getProperty(key, dflt);
    }
    return origValue;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.core.internal.preferences.DefaultPreferences
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.core.internal.preferences;

import java.util.Comparator;
import java.util.Map.Entry;

class EclipsePreferences$1
  implements Comparator
{
  final EclipsePreferences.SortedProperties this$1;
  
  EclipsePreferences$1(EclipsePreferences.SortedProperties paramSortedProperties)
  {
    this$1 = paramSortedProperties;
  }
  
  public int compare(Object e1, Object e2)
  {
    String s1 = (String)((Map.Entry)e1).getKey();
    String s2 = (String)((Map.Entry)e2).getKey();
    return s1.compareTo(s2);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.core.internal.preferences.EclipsePreferences.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.core.internal.preferences;

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.INodeChangeListener;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.NodeChangeEvent;

class EclipsePreferences$2
  implements ISafeRunnable
{
  final EclipsePreferences this$0;
  private final boolean val$added;
  private final IEclipsePreferences.INodeChangeListener val$listener;
  private final IEclipsePreferences.NodeChangeEvent val$event;
  
  EclipsePreferences$2(EclipsePreferences paramEclipsePreferences, boolean paramBoolean, IEclipsePreferences.INodeChangeListener paramINodeChangeListener, IEclipsePreferences.NodeChangeEvent paramNodeChangeEvent)
  {
    this$0 = paramEclipsePreferences;val$added = paramBoolean;val$listener = paramINodeChangeListener;val$event = paramNodeChangeEvent;
  }
  
  public void handleException(Throwable exception) {}
  
  public void run()
    throws Exception
  {
    if (val$added) {
      val$listener.added(val$event);
    } else {
      val$listener.removed(val$event);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.core.internal.preferences.EclipsePreferences.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.core.internal.preferences;

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;

class EclipsePreferences$3
  implements ISafeRunnable
{
  final EclipsePreferences this$0;
  private final IEclipsePreferences.IPreferenceChangeListener val$listener;
  private final IEclipsePreferences.PreferenceChangeEvent val$event;
  
  EclipsePreferences$3(EclipsePreferences paramEclipsePreferences, IEclipsePreferences.IPreferenceChangeListener paramIPreferenceChangeListener, IEclipsePreferences.PreferenceChangeEvent paramPreferenceChangeEvent)
  {
    this$0 = paramEclipsePreferences;val$listener = paramIPreferenceChangeListener;val$event = paramPreferenceChangeEvent;
  }
  
  public void handleException(Throwable exception) {}
  
  public void run()
    throws Exception
  {
    val$listener.preferenceChange(val$event);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.core.internal.preferences.EclipsePreferences.3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.core.internal.preferences;

import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IPreferenceNodeVisitor;
import org.osgi.service.prefs.BackingStoreException;

class EclipsePreferences$4
  implements IPreferenceNodeVisitor
{
  final EclipsePreferences this$0;
  private final StringBuffer val$buffer;
  
  EclipsePreferences$4(EclipsePreferences paramEclipsePreferences, StringBuffer paramStringBuffer)
  {
    this$0 = paramEclipsePreferences;val$buffer = paramStringBuffer;
  }
  
  public boolean visit(IEclipsePreferences node)
    throws BackingStoreException
  {
    val$buffer.append(node);
    val$buffer.append('\n');
    String[] keys = node.keys();
    for (int i = 0; i < keys.length; i++)
    {
      val$buffer.append(node.absolutePath());
      val$buffer.append(EclipsePreferences.PATH_SEPARATOR);
      val$buffer.append(keys[i]);
      val$buffer.append('=');
      val$buffer.append(node.get(keys[i], "*default*"));
      val$buffer.append('\n');
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.core.internal.preferences.EclipsePrefere
1 2 3 4 5 6 7

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-2017. Infinite Loop Ltd