org.eclipse.osgi_3.7.2.v20120110-1415

 + "=" + val);
        }
        try
        {
          if (directive) {
            manifestElement.addDirective(next, val);
          } else {
            manifestElement.addAttribute(next, val);
          }
          directive = false;
        }
        catch (Exception e)
        {
          throw new BundleException(NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, header, value), 3, e);
        }
        c = tokenizer.getChar();
        if (c == ';')
        {
          next = tokenizer.getToken("=:");
          if (next == null) {
            throw new BundleException(NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, header, value), 3);
          }
          c = tokenizer.getChar();
        }
      }
      headerElements.add(manifestElement);
      if (Debug.DEBUG_MANIFEST) {
        Debug.println("");
      }
    } while (c == ',');
    if (c != 0) {
      throw new BundleException(NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, header, value), 3);
    }
    int size = headerElements.size();
    if (size == 0) {
      return null;
    }
    ManifestElement[] result = (ManifestElement[])headerElements.toArray(new ManifestElement[size]);
    return result;
  }
  
  public static String[] getArrayFromList(String stringList)
  {
    String[] result = getArrayFromList(stringList, ",");
    return result.length == 0 ? null : result;
  }
  
  public static String[] getArrayFromList(String stringList, String separator)
  {
    if ((stringList == null) || (stringList.trim().length() == 0)) {
      return new String[0];
    }
    List<String> list = new ArrayList();
    StringTokenizer tokens = new StringTokenizer(stringList, separator);
    while (tokens.hasMoreTokens())
    {
      String token = tokens.nextToken().trim();
      if (token.length() != 0) {
        list.add(token);
      }
    }
    return (String[])list.toArray(new String[list.size()]);
  }
  
  /* Error */
  public static java.util.Map<String, String> parseBundleManifest(java.io.InputStream manifest, java.util.Map<String, String> headers)
    throws java.io.IOException, BundleException
  {
    // Byte code:
    //   0: aload_1
    //   1: ifnonnull +11 -> 12
    //   4: new 167	java/util/HashMap
    //   7: dup
    //   8: invokespecial 333	java/util/HashMap:<init>	()V
    //   11: astore_1
    //   12: new 157	java/io/BufferedReader
    //   15: dup
    //   16: new 159	java/io/InputStreamReader
    //   19: dup
    //   20: aload_0
    //   21: ldc_w 154
    //   24: invokespecial 314	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;Ljava/lang/String;)V
    //   27: invokespecial 311	java/io/BufferedReader:<init>	(Ljava/io/Reader;)V
    //   30: astore_2
    //   31: goto +20 -> 51
    //   34: pop
    //   35: new 157	java/io/BufferedReader
    //   38: dup
    //   39: new 159	java/io/InputStreamReader
    //   42: dup
    //   43: aload_0
    //   44: invokespecial 313	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;)V
    //   47: invokespecial 311	java/io/BufferedReader:<init>	(Ljava/io/Reader;)V
    //   50: astore_2
    //   51: aconst_null
    //   52: astore_3
    //   53: new 164	java/lang/StringBuffer
    //   56: dup
    //   57: sipush 256
    //   60: invokespecial 325	java/lang/StringBuffer:<init>	(I)V
    //   63: astore 4
    //   65: iconst_1
    //   66: istore 5
    //   68: aload_2
    //   69: invokevirtual 312	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   72: astore 6
    //   74: aload 6
    //   76: ifnull +11 -> 87
    //   79: aload 6
    //   81: invokevirtual 316	java/lang/String:length	()I
    //   84: ifne +27 -> 111
    //   87: iload 5
    //   89: ifne +175 -> 264
    //   92: aload_1
    //   93: aload_3
    //   94: aload 4
    //   96: invokevirtual 327	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   99: invokevirtual 320	java/lang/String:trim	()Ljava/lang/String;
    //   102: invokeinterface 371 3 0
    //   107: pop
    //   108: goto +156 -> 264
    //   111: aload 6
    //   113: iconst_0
    //   114: invokevirtual 317	java/lang/String:charAt	(I)C
    //   117: bipush 32
    //   119: if_icmpne +40 -> 159
    //   122: iload 5
    //   124: ifeq +20 -> 144
    //   127: new 177	org/osgi/framework/BundleException
    //   130: dup
    //   131: getstatic 305	org/eclipse/osgi/framework/internal/core/Msg:MANIFEST_INVALID_SPACE	Ljava/lang/String;
    //   134: aload 6
    //   136: invokestatic 361	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   139: iconst_3
    //   140: invokespecial 363	org/osgi/framework/BundleException:<init>	(Ljava/lang/String;I)V
    //   143: athrow
    //   144: aload 4
    //   146: aload 6
    //   148: iconst_1
    //   149: invokevirtual 321	java/lang/String:substring	(I)Ljava/lang/String;
    //   152: invokevirtual 330	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   155: pop
    //   156: goto -88 -> 68
    //   159: iload 5
    //   161: ifne +25 -> 186
    //   164: aload_1
    //   165: aload_3
    //   166: aload 4
    //   168: invokevirtual 327	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   171: invokevirtual 320	java/lang/String:trim	()Ljava/lang/String;
    //   174: invokeinterface 371 3 0
    //   179: pop
    //   180: aload 4
    //   182: iconst_0
    //   183: invokevirtual 326	java/lang/StringBuffer:setLength	(I)V
    //   186: aload 6
    //   188: bipush 58
    //   190: invokevirtual 318	java/lang/String:indexOf	(I)I
    //   193: istore 7
    //   195: iload 7
    //   197: iconst_m1
    //   198: if_icmpne +20 -> 218
    //   201: new 177	org/osgi/framework/BundleException
    //   204: dup
    //   205: getstatic 304	org/eclipse/osgi/framework/internal/core/Msg:MANIFEST_INVALID_LINE_NOCOLON	Ljava/lang/String;
    //   208: aload 6
    //   210: invokestatic 361	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   213: iconst_3
    //   214: invokespecial 363	org/osgi/framework/BundleException:<init>	(Ljava/lang/String;I)V
    //   217: athrow
    //   218: aload 6
    //   220: iconst_0
    //   221: iload 7
    //   223: invokevirtual 322	java/lang/String:substring	(II)Ljava/lang/String;
    //   226: invokevirtual 320	java/lang/String:trim	()Ljava/lang/String;
    //   229: astore_3
    //   230: aload 4
    //   232: aload 6
    //   234: iload 7
    //   236: iconst_1
    //   237: iadd
    //   238: invokevirtual 321	java/lang/String:substring	(I)Ljava/lang/String;
    //   241: invokevirtual 330	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   244: pop
    //   245: iconst_0
    //   246: istore 5
    //   248: goto -180 -> 68
    //   251: astore 8
    //   253: aload_2
    //   254: invokevirtual 310	java/io/BufferedReader:close	()V
    //   257: goto +4 -> 261
    //   260: pop
    //   261: aload 8
    //   263: athrow
    //   264: aload_2
    //   265: invokevirtual 310	java/io/BufferedReader:close	()V
    //   268: goto +4 -> 272
    //   271: pop
    //   272: aload_1
    //   273: areturn
    // Line number table:
    //   Java source line #502	-> byte code offset #0
    //   Java source line #503	-> byte code offset #4
    //   Java source line #506	-> byte code offset #12
    //   Java source line #507	-> byte code offset #34
    //   Java source line #508	-> byte code offset #35
    //   Java source line #511	-> byte code offset #51
    //   Java source line #512	-> byte code offset #53
    //   Java source line #513	-> byte code offset #65
    //   Java source line #516	-> byte code offset #68
    //   Java source line #523	-> byte code offset #74
    //   Java source line #525	-> byte code offset #87
    //   Java source line #527	-> byte code offset #92
    //   Java source line #529	-> byte code offset #108
    //   Java source line #532	-> byte code offset #111
    //   Java source line #534	-> byte code offset #122
    //   Java source line #536	-> byte code offset #127
    //   Java source line #538	-> byte code offset #144
    //   Java source line #539	-> byte code offset #156
    //   Java source line #542	-> byte code offset #159
    //   Java source line #543	-> byte code offset #164
    //   Java source line #544	-> byte code offset #180
    //   Java source line #547	-> byte code offset #186
    //   Java source line #548	-> byte code offset #195
    //   Java source line #550	-> byte code offset #201
    //   Java source line #552	-> byte code offset #218
    //   Java source line #553	-> byte code offset #230
    //   Java source line #554	-> byte code offset #245
    //   Java source line #515	-> byte code offset #248
    //   Java source line #556	-> byte code offset #251
    //   Java source line #558	-> byte code offset #253
    //   Java source line #559	-> byte code offset #260
    //   Java source line #562	-> byte code offset #261
    //   Java source line #558	-> byte code offset #264
    //   Java source line #559	-> byte code offset #271
    //   Java source line #563	-> byte code offset #272
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	274	0	manifest	java.io.InputStream
    //   0	274	1	headers	java.util.Map<String, String>
    //   30	2	2	br	java.io.BufferedReader
    //   50	215	2	br	java.io.BufferedReader
    //   52	178	3	header	String
    //   63	168	4	value	StringBuffer
    //   66	181	5	firstLine	boolean
    //   72	161	6	line	String
    //   193	42	7	colon	int
    //   251	11	8	localObject	Object
    //   34	1	10	localUnsupportedEncodingException	java.io.UnsupportedEncodingException
    //   260	1	11	localIOException1	java.io.IOException
    //   271	1	12	localIOException2	java.io.IOException
    // Exception table:
    //   from	to	target	type
    //   12	31	34	java/io/UnsupportedEncodingException
    //   51	251	251	finally
    //   253	257	260	java/io/IOException
    //   264	268	271	java/io/IOException
  }
  
  public String toString()
  {
    Enumeration<String> attrKeys = getKeys();
    Enumeration<String> directiveKeys = getDirectiveKeys();
    if ((attrKeys == null) && (directiveKeys == null)) {
      return mainValue;
    }
    StringBuffer result = new StringBuffer(mainValue);
    if (attrKeys != null) {
      while (attrKeys.hasMoreElements())
      {
        String key = (String)attrKeys.nextElement();
        addValues(false, key, getAttributes(key), result);
      }
    }
    if (directiveKeys != null) {
      while (directiveKeys.hasMoreElements())
      {
        String key = (String)directiveKeys.nextElement();
        addValues(true, key, getDirectives(key), result);
      }
    }
    return result.toString();
  }
  
  private void addValues(boolean directive, String key, String[] values, StringBuffer result)
  {
    if (values == null) {
      return;
    }
    for (int i = 0; i < values.length; i++)
    {
      result.append(';').append(key);
      if (directive) {
        result.append(':');
      }
      result.append("=\"").append(values[i]).append('"');
    }
  }
}

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

import java.security.PrivilegedAction;

class NLS$1
  implements PrivilegedAction<Object>
{
  private final String val$baseName;
  
  NLS$1(String paramString, Class paramClass) {}
  
  public Object run()
  {
    NLS.load(val$baseName, val$clazz);
    return null;
  }
}

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

import java.io.PrintStream;
import java.lang.reflect.Field;
import java.util.Map;
import java.util.Properties;
import org.eclipse.osgi.framework.debug.Debug;

class NLS$MessagesProperties
  extends Properties
{
  private static final int MOD_EXPECTED = 9;
  private static final int MOD_MASK = 25;
  private static final long serialVersionUID = 1L;
  private final String bundleName;
  private final Map<Object, Object> fields;
  private final boolean isAccessible;
  
  public NLS$MessagesProperties(Map<Object, Object> fieldMap, String bundleName, boolean isAccessible)
  {
    fields = fieldMap;
    this.bundleName = bundleName;
    this.isAccessible = isAccessible;
  }
  
  public synchronized Object put(Object key, Object value)
  {
    Object fieldObject = fields.put(key, NLS.ASSIGNED);
    if (fieldObject == NLS.ASSIGNED) {
      return null;
    }
    if (fieldObject == null)
    {
      String msg = "NLS unused message: " + key + " in: " + bundleName;
      if (Debug.DEBUG_MESSAGE_BUNDLES) {
        System.out.println(msg);
      }
      NLS.log(2, msg, null);
      return null;
    }
    Field field = (Field)fieldObject;
    if ((field.getModifiers() & 0x19) != 9) {
      return null;
    }
    try
    {
      if (!isAccessible) {
        field.setAccessible(true);
      }
      field.set(null, new String(((String)value).toCharArray()));
    }
    catch (Exception e)
    {
      NLS.log(4, "Exception setting field value.", e);
    }
    return null;
  }
}

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

import java.io.PrintStream;
import java.lang.reflect.Field;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import org.eclipse.osgi.framework.debug.Debug;
import org.eclipse.osgi.framework.internal.core.FrameworkProperties;
import org.eclipse.osgi.framework.log.FrameworkLog;
import org.eclipse.osgi.framework.log.FrameworkLogEntry;

public abstract class NLS
{
  private static final Object[] EMPTY_ARGS = new Object[0];
  private static final String EXTENSION = ".properties";
  private static String[] nlSuffixes;
  private static final String PROP_WARNINGS = "osgi.nls.warnings";
  private static final String IGNORE = "ignore";
  private static final boolean ignoreWarnings = "ignore".equals(FrameworkProperties.getProperty("osgi.nls.warnings"));
  private static FrameworkLog frameworkLog;
  static final int SEVERITY_ERROR = 4;
  static final int SEVERITY_WARNING = 2;
  static final Object ASSIGNED = new Object();
  
  public static String bind(String message, Object binding)
  {
    return internalBind(message, null, String.valueOf(binding), null);
  }
  
  public static String bind(String message, Object binding1, Object binding2)
  {
    return internalBind(message, null, String.valueOf(binding1), String.valueOf(binding2));
  }
  
  public static String bind(String message, Object[] bindings)
  {
    return internalBind(message, bindings, null, null);
  }
  
  public static void initializeMessages(String baseName, final Class<?> clazz)
  {
    if (System.getSecurityManager() == null)
    {
      load(baseName, clazz);
      return;
    }
    AccessController.doPrivileged(new PrivilegedAction()
    {
      public Object run()
      {
        NLS.load(NLS.this, clazz);
        return null;
      }
    });
  }
  
  private static String internalBind(String message, Object[] args, String argZero, String argOne)
  {
    if (message == null) {
      return "No message available.";
    }
    if ((args == null) || (args.length == 0)) {
      args = EMPTY_ARGS;
    }
    int length = message.length();
    
    int bufLen = length + args.length * 5;
    if (argZero != null) {
      bufLen += argZero.length() - 3;
    }
    if (argOne != null) {
      bufLen += argOne.length() - 3;
    }
    StringBuffer buffer = new StringBuffer(bufLen < 0 ? 0 : bufLen);
    for (int i = 0; i < length; i++)
    {
      char c = message.charAt(i);
      switch (c)
      {
      case '{': 
        int index = message.indexOf('}', i);
        if (index == -1)
        {
          buffer.append(c);
        }
        else
        {
          i++;
          if (i >= length)
          {
            buffer.append(c);
          }
          else
          {
            int number = -1;
            try
            {
              number = Integer.parseInt(message.substring(i, index));
            }
            catch (NumberFormatException e)
            {
              throw ((IllegalArgumentException)new IllegalArgumentException().initCause(e));
            }
            if ((number == 0) && (argZero != null))
            {
              buffer.append(argZero);
            }
            else if ((number == 1) && (argOne != null))
            {
              buffer.append(argOne);
            }
            else
            {
              if ((number >= args.length) || (number < 0))
              {
                buffer.append("<missing argument>");
                i = index;
                continue;
              }
              buffer.append(args[number]);
            }
            i = index;
          }
        }
        break;
      case '\'': 
        int nextIndex = i + 1;
        if (nextIndex >= length)
        {
          buffer.append(c);
        }
        else
        {
          char next = message.charAt(nextIndex);
          if (next == '\'')
          {
            i++;
            buffer.append(c);
          }
          else
          {
            int index = message.indexOf('\'', nextIndex);
            if (index == -1)
            {
              buffer.append(c);
            }
            else
            {
              buffer.append(message.substring(nextIndex, index));
              i = index;
            }
          }
        }
        break;
      default: 
        buffer.append(c);
      }
    }
    return buffer.toString();
  }
  
  private static String[] buildVariants(String root)
  {
    if (nlSuffixes == null)
    {
      String nl = Locale.getDefault().toString();
      List<String> result = new ArrayList(4);
      for (;;)
      {
        result.add('_' + nl + ".properties");
        int lastSeparator = nl.lastIndexOf('_');
        if (lastSeparator == -1) {
          break;
        }
        nl = nl.substring(0, lastSeparator);
      }
      int lastSeparator;
      result.add(".properties");
      nlSuffixes = (String[])result.toArray(new String[result.size()]);
    }
    root = root.replace('.', '/');
    String[] variants = new String[nlSuffixes.length];
    for (int i = 0; i < variants.length; i++) {
      variants[i] = (root + nlSuffixes[i]);
    }
    return variants;
  }
  
  private static void computeMissingMessages(String bundleName, Class<?> clazz, Map<Object, Object> fieldMap, Field[] fieldArray, boolean isAccessible)
  {
    int numFields = fieldArray.length;
    for (int i = 0; i < numFields; i++)
    {
      Field field = fieldArray[i];
      if ((field.getModifiers() & 0x19) == 9) {
        if (fieldMap.get(field.getName()) != ASSIGNED) {
          try
          {
            String value = "NLS missing message: " + field.getName() + " in: " + bundleName;
            if (Debug.DEBUG_MESSAGE_BUNDLES) {
              System.out.println(value);
            }
            log(2, value, null);
            if (!isAccessible) {
              field.setAccessible(true);
            }
            field.set(null, value);
          }
          catch (Exception e)
          {
            log(4, "Error setting the missing message value for: " + field.getName(), e);
          }
        }
      }
    }
  }
  
  /* Error */
  static void load(String bundleName, Class<?> clazz)
  {
    // Byte code:
    //   0: invokestatic 354	java/lang/System:currentTimeMillis	()J
    //   3: lstore_2
    //   4: aload_1
    //   5: invokevirtual 329	java/lang/Class:getDeclaredFields	()[Ljava/lang/reflect/Field;
    //   8: astore 4
    //   10: aload_1
    //   11: invokevirtual 328	java/lang/Class:getClassLoader	()Ljava/lang/ClassLoader;
    //   14: astore 5
    //   16: aload_1
    //   17: invokevirtual 327	java/lang/Class:getModifiers	()I
    //   20: iconst_1
    //   21: iand
    //   22: ifeq +7 -> 29
    //   25: iconst_1
    //   26: goto +4 -> 30
    //   29: iconst_0
    //   30: istore 6
    //   32: aload 4
    //   34: arraylength
    //   35: istore 7
    //   37: new 189	java/util/HashMap
    //   40: dup
    //   41: iload 7
    //   43: iconst_2
    //   44: imul
    //   45: invokespecial 362	java/util/HashMap:<init>	(I)V
    //   48: astore 8
    //   50: iconst_0
    //   51: istore 9
    //   53: goto +27 -> 80
    //   56: aload 8
    //   58: aload 4
    //   60: iload 9
    //   62: aaload
    //   63: invokevirtual 358	java/lang/reflect/Field:getName	()Ljava/lang/String;
    //   66: aload 4
    //   68: iload 9
    //   70: aaload
    //   71: invokeinterface 379 3 0
    //   76: pop
    //   77: iinc 9 1
    //   80: iload 9
    //   82: iload 7
    //   84: if_icmplt -28 -> 56
    //   87: aload_0
    //   88: invokestatic 369	org/eclipse/osgi/util/NLS:buildVariants	(Ljava/lang/String;)[Ljava/lang/String;
    //   91: astore 9
    //   93: iconst_0
    //   94: istore 10
    //   96: goto +145 -> 241
    //   99: aload 5
    //   101: ifnonnull +14 -> 115
    //   104: aload 9
    //   106: iload 10
    //   108: aaload
    //   109: invokestatic 331	java/lang/ClassLoader:getSystemResourceAsStream	(Ljava/lang/String;)Ljava/io/InputStream;
    //   112: goto +13 -> 125
    //   115: aload 5
    //   117: aload 9
    //   119: iload 10
    //   121: aaload
    //   122: invokevirtual 330	java/lang/ClassLoader:getResourceAsStream	(Ljava/lang/String;)Ljava/io/InputStream;
    //   125: astore 11
    //   127: aload 11
    //   129: ifnonnull +6 -> 135
    //   132: goto +106 -> 238
    //   135: new 199	org/eclipse/osgi/util/NLS$MessagesProperties
    //   138: dup
    //   139: aload 8
    //   141: aload_0
    //   142: iload 6
    //   144: invokespecial 374	org/eclipse/osgi/util/NLS$MessagesProperties:<init>	(Ljava/util/Map;Ljava/lang/String;Z)V
    //   147: astore 12
    //   149: aload 12
    //   151: aload 11
    //   153: invokevirtual 373	org/eclipse/osgi/util/NLS$MessagesProperties:load	(Ljava/io/InputStream;)V
    //   156: goto +68 -> 224
    //   159: astore 12
    //   161: iconst_4
    //   162: new 184	java/lang/StringBuffer
    //   165: dup
    //   166: ldc_w 165
    //   169: invokespecial 349	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   172: aload 9
    //   174: iload 10
    //   176: aaload
    //   177: invokevirtual 353	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   180: invokevirtual 348	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   183: aload 12
    //   185: invokestatic 368	org/eclipse/osgi/util/NLS:log	(ILjava/lang/String;Ljava/lang/Exception;)V
    //   188: aload 11
    //   190: ifnull +48 -> 238
    //   193: aload 11
    //   195: invokevirtual 325	java/io/InputStream:close	()V
    //   198: goto +40 -> 238
    //   201: pop
    //   202: goto +36 -> 238
    //   205: astore 13
    //   207: aload 11
    //   209: ifnull +12 -> 221
    //   212: aload 11
    //   214: invokevirtual 325	java/io/InputStream:close	()V
    //   217: goto +4 -> 221
    //   220: pop
    //   221: aload 13
    //   223: athrow
    //   224: aload 11
    //   226: ifnull +12 -> 238
    //   229: aload 11
    //   231: invokevirtual 325	java/io/InputStream:close	()V
    //   234: goto +4 -> 238
    //   237: pop
    //   238: iinc 10 1
    //   241: iload 10
    //   243: aload 9
    //   245: arraylength
    //   246: if_icmplt -147 -> 99
    //   249: aload_0
    //   250: aload_1
    //   251: aload 8
    //   253: aload 4
    //   255: iload 6
    //   257: invokestatic 370	org/eclipse/osgi/util/NLS:computeMissingMessages	(Ljava/lang/String;Ljava/lang/Class;Ljava/util/Map;[Ljava/lang/reflect/Field;Z)V
    //   260: getstatic 319	org/eclipse/osgi/framework/debug/Debug:DEBUG_MESSAGE_BUNDLES	Z
    //   263: ifeq +46 -> 309
    //   266: getstatic 318	java/lang/System:out	Ljava/io/PrintStream;
    //   269: new 184	java/lang/StringBuffer
    //   272: dup
    //   273: ldc_w 168
    //   276: invokespecial 349	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   279: aload_0
    //   280: invokevirtual 353	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   283: ldc_w 163
    //   286: invokevirtual 353	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   289: invokestatic 354	java/lang/System:currentTimeMillis	()J
    //   292: lload_2
    //   293: lsub
    //   294: invokevirtual 351	java/lang/StringBuffer:append	(J)Ljava/lang/StringBuffer;
    //   297: ldc_w 170
    //   300: invokevirtual 353	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   303: invokevirtual 348	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   306: invokevirtual 326	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   309: return
    // Line number table:
    //   Java source line #301	-> byte code offset #0
    //   Java source line #302	-> byte code offset #4
    //   Java source line #303	-> byte code offset #10
    //   Java source line #305	-> byte code offset #16
    //   Java source line #308	-> byte code offset #32
    //   Java source line #309	-> byte code offset #37
    //   Java source line #310	-> byte code offset #50
    //   Java source line #311	-> byte code offset #56
    //   Java source line #310	-> byte code offset #77
    //   Java source line #316	-> byte code offset #87
    //   Java source line #317	-> byte code offset #93
    //   Java source line #319	-> byte code offset #99
    //   Java source line #320	-> byte code offset #127
    //   Java source line #321	-> byte code offset #132
    //   Java source line #323	-> byte code offset #135
    //   Java source line #324	-> byte code offset #149
    //   Java source line #325	-> byte code offset #159
    //   Java source line #326	-> byte code offset #161
    //   Java source line #328	-> byte code offset #188
    //   Java source line #330	-> byte code offset #193
    //   Java source line #331	-> byte code offset #201
    //   Java source line #327	-> byte code offset #205
    //   Java source line #328	-> byte code offset #207
    //   Java source line #330	-> byte code offset #212
    //   Java source line #331	-> byte code offset #220
    //   Java source line #334	-> byte code offset #221
    //   Java source line #328	-> byte code offset #224
    //   Java source line #330	-> byte code offset #229
    //   Java source line #331	-> byte code offset #237
    //   Java source line #317	-> byte code offset #238
    //   Java source line #336	-> byte code offset #249
    //   Java source line #337	-> byte code offset #260
    //   Java source line #338	-> byte code offset #266
    //   Java source line #339	-> byte code offset #309
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	310	0	bundleName	String
    //   0	310	1	clazz	Class<?>
    //   3	290	2	start	long
    //   8	246	4	fieldArray	Field[]
    //   14	102	5	loader	ClassLoader
    //   30	226	6	isAccessible	boolean
    //   35	48	7	len	int
    //   48	204	8	fields	Map<Object, Object>
    //   51	30	9	i	int
    //   91	153	9	variants	String[]
    //   94	148	10	i	int
    //   125	105	11	input	java.io.InputStream
    //   147	3	12	properties	MessagesProperties
    //   159	25	12	e	java.io.IOException
    //   205	17	13	localObject	Object
    //   201	1	15	localIOException1	java.io.IOException
    //   220	1	16	localIOException2	java.io.IOException
    //   237	1	17	localIOException3	java.io.IOException
    // Exception table:
    //   from	to	target	type
    //   135	156	159	java/io/IOException
    //   193	198	201	java/io/IOException
    //   135	188	205	finally
    //   212	217	220	java/io/IOException
    //   229	234	237	java/io/IOException
  }
  
  static void log(int severity, String message, Exception e)
  {
    if ((severity == 2) && (ignoreWarnings)) {
      return;
    }
    if (frameworkLog != null)
    {
      frameworkLog.log(new FrameworkLogEntry("org.eclipse.osgi", severity, 1, message, 0, e, null)); return;
    }
    String statusMsg;
    String statusMsg;
    switch (severity)
    {
    case 4: 
      statusMsg = "Error: ";
      break;
    case 2: 
    case 3: 
    default: 
      statusMsg = "Warning: ";
    }
    if (message != null) {
      statusMsg = statusMsg + message;
    }
    if (e != null) {
      statusMsg = statusMsg + ": " + e.getMessage();
    }
    System.err.println(statusMsg);
    if (e != null) {
      e.printStackTrace();
    }
  }
  
  private static class MessagesProperties
    extends Properties
  {
    private static final int MOD_EXPECTED = 9;
    private static final int MOD_MASK = 25;
    private static final long serialVersionUID = 1L;
    private final String bundleName;
    private final Map<Object, Object> fields;
    private final boolean isAccessible;
    
    public MessagesProperties(Map<Object, Object> fieldMap, String bundleName, boolean isAccessible)
    {
      fields = fieldMap;
      this.bundleName = bundleName;
      this.isAccessible = isAccessible;
    }
    
    public synchronized Object put(Object key, Object value)
    {
      Object fieldObject = fields.put(key, NLS.ASSIGNED);
      if (fieldObject == NLS.ASSIGNED) {
        return null;
      }
      if (fieldObject == null)
      {
        String msg = "NLS unused message: " + key + " in: " + bundleName;
        if (Debug.DEBUG_MESSAGE_BUNDLES) {
          System.out.println(msg);
        }
        NLS.log(2, msg, null);
        return null;
      }
      Field field = (Field)fieldObject;
      if ((field.getModifiers() & 0x19) != 9) {
        return null;
      }
      try
      {
        if (!isAccessible) {
          field.setAccessible(true);
        }
        field.set(null, new String(((String)value).toCharArray()));
      }
      catch (Exception e)
      {
        NLS.log(4, "Exception setting field value.", e);
      }
      return null;
    }
  }
}

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

import java.util.Locale;

public class TextProcessor
{
  private static final String DOT = ".";
  private static final String COLON = ":";
  private static final String FILE_SEP_FSLASH = "/";
  private static final String FILE_SEP_BSLASH = "\\";
  private static final String delimiterString = ".:/\\";
  private static final char LRM = '?';
  private static final char LRE = '?';
  private static final char PDF = '?';
  private static boolean IS_PROCESSING_NEEDED = false;
  private static final int INDEX_NOT_SET = 999999999;
  
  static
  {
    Locale locale = Locale.getDefault();
    String lang = locale.getLanguage();
    if (("iw".equals(lang)) || ("he".equals(lang)) || ("ar".equals(lang)) || ("fa".equals(lang)) || ("ur".equals(lang)))
    {
      String osName = System.getProperty("os.name").toLowerCase();
      if ((osName.startsWith("windows")) || (osName.startsWith("linux")) || (osName.startsWith("mac"))) {
        IS_PROCESSING_NEEDED = true;
      }
    }
  }
  
  public static String process(String text)
  {
    if ((!IS_PROCESSING_NEEDED) || (text == null) || (text.length() <= 1)) {
      return text;
    }
    return process(text, getDefaultDelimiters());
  }
  
  public static String process(String str, String delimiter)
  {
    if ((!IS_PROCESSING_NEEDED) || (str == null) || (str.length() <= 1)) {
      return str;
    }
    if ((str.charAt(0) == '?') && (str.charAt(str.length() - 1) == '?')) {
      return str;
    }
    boolean isStringBidi = false;
    
    boolean isLastRTL = false;
    
    int delimIndex = 999999999;
    
    delimiter = delimiter == null ? getDefaultDelimiters() : delimiter;
    
    StringBuffer target = new StringBuffer();
    target.append('?');
    
    int i = 0;
    for (int n = str.length(); i < n; i++)
    {
      char ch = str.charAt(i);
      if (delimiter.indexOf(ch) != -1)
      {
        if (isLastRTL) {
          delimIndex = target.length();
        }
      }
      else if (Character.isDigit(ch))
      {
        if (delimIndex != 999999999)
        {
          target.insert(delimIndex, '?');
          delimIndex = 999999999;
          isLastRTL = false;
        }
      }
      else if (Character.isLetter(ch)) {
        if (isRTL(ch))
        {
          isStringBidi = true;
          if (delimIndex != 999999999)
          {
            target.insert(delimIndex, '?');
            delimIndex = 999999999;
          }
          isLastRTL = true;
        }
        else
        {
          delimIndex = 999999999;
          isLastRTL = false;
        }
      }
      target.append(ch);
    }
    if ((isStringBidi) || (!Character.isLetter(str.charAt(0))) || (isNeutral(str.charAt(str.length() - 1))))
    {
      target.append('?');
      return target.toString();
    }
    return str;
  }
  
  public static String deprocess(String str)
  {
    if ((!IS_PROCESSING_NEEDED) || (str == null) || (str.length() <= 1)) {
      return str;
    }
    StringBuffer buf = new StringBuffer();
    for (int i = 0; i < str.length(); i++)
    {
      char c = str.charAt(i);
      switch (c)
      {
      case '?': 
        break;
      case '?': 
        break;
      case '?': 
        break;
      default: 
        buf.append(c);
      }
    }
    return buf.toString();
  }
  
  public static String getDefaultDelimiters()
  {
    return ".:/\\";
  }
  
  private static boolean isRTL(char c)
  {
    return ((c >= '?') && (c <= '?')) || ((c >= 64285) && (c <= 65276));
  }
  
  private static boolean isNeutral(char c)
  {
    return (!Character.isDigit(c)) && (!Character.isLetter(c));
  }
}

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

import java.security.PrivilegedAction;
import java.util.Map;

class AdaptPermission$1
  implements PrivilegedAction<Object>
{
  final AdaptPermission this$0;
  
  AdaptPermission$1(AdaptPermission paramAdaptPermission, Map paramMap) {}
  
  public Object run()
  {
    val$map.put("id", new Long(this$0.bundle.getBundleId()));
    val$map.put("location", this$0.bundle.getLocation());
    String name = this$0.bundle.getSymbolicName();
    if (name != null) {
      val$map.put("name", name);
    }
    SignerProperty signer = new SignerProperty(this$0.bundle);
    if (signer.isBundleSigned()) {
      val$map.put("signer", signer);
    }
    return null;
  }
}

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

import java.io.IOException;
import java.io.NotSerializableException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.security.AccessController;
import java.security.BasicPermission;
import java.security.Permission;
import java.security.PermissionCollection;
import java.security.PrivilegedAction;
import java.util.HashMap;
import java.util.Map;

public class AdaptPermission
  extends BasicPermission
{
  private static final long serialVersionUID = 1L;
  public static final String ADAPT = "adapt";
  private static final int ACTION_ADAPT = 1;
  private static final int ACTION_ALL = 1;
  static final int ACTION_NONE = 0;
  transient int action_mask;
  private volatile String actions = null;
  final transient Bundle bundle;
  transient Filter filter;
  private volatile transient Map<String, Object> properties;
  
  public AdaptPermission(String filter, String actions)
  {
    this(parseFilter(filter), parseActions(actions));
  }
  
  public AdaptPermission(String adaptClass, Bundle adaptableBundle, String actions)
  {
    super(adaptClass);
    setTransients(null, parseActions(actions));
    bundle = adaptableBundle;
    if (adaptClass == null) {
      throw new NullPointerException("adaptClass must not be null");
    }
    if (adaptableBundle == null) {
      throw new NullPointerException("adaptableBundle must not be null");
    }
  }
  
  AdaptPermission(Filter filter, int mask)
  {
    super(filter == null ? "*" : filter.toString());
    setTransients(filter, mask);
    bundle = null;
  }
  
  private void setTransients(Filter filter, int mask)
  {
    this.filter = filter;
    if ((mask == 0) || ((mask & 0x1) != mask)) {
      throw new IllegalArgumentException("invalid action string");
    }
    action_mask = mask;
  }
  
  private static int parseActions(String actions)
  {
    boolean seencomma = false;
    
    int mask = 0;
    if (actions == null) {
      return mask;
    }
    char[] a = actions.toCharArray();
    
    int i = a.length - 1;
    if (i < 0) {}
    while (i != -1)
    {
      return mask;
      char c;
      while ((i != -1) && (
        ((c = a[i]) == ' ') || (c == '\r') || (c == '\n') || 
        (c == '\f') || (c == '\t')))
      {
        char c;
        i--;
      }
      if ((i >= 4) && ((a[(i - 4)] == 'a') || (a[(i - 4)] == 'A')) && 
        ((a[(i - 3)] == 'd') || (a[(i - 3)] == 'D')) && 
        ((a[(i - 2)] == 'a') || (a[(i - 2)] == 'A')) && 
        ((a[(i - 1)] == 'p') || (a[(i - 1)] == 'P')) && (
        (a[i] == 't') || (a[i] == 'T')))
      {
        int matchlen = 5;
        mask |= 0x1;
      }
      else
      {
        throw new IllegalArgumentException("invalid actions: " + 
          actions);
      }
      int matchlen;
      seencomma = false;
      while ((i >= matchlen) && (!seencomma))
      {
        switch (a[(i - matchlen)])
        {
        case ',': 
          seencomma = true;
        case '\t': 
        case '\n': 
        case '\f': 
        case '\r': 
        case ' ': 
          break;
        default: 
          throw new IllegalArgumentException(
            "invalid permission: " + actions);
        }
        i--;
      }
      i -= matchlen;
    }
    if (seencomma) {
      throw new IllegalArgumentException("invalid actions: " + actions);
    }
    return mask;
  }
  
  private static Filter parseFilter(String filterString)
  {
    filterString = filterString.trim();
    if (filterString.equals("*")) {
      return null;
    }
    try
    {
      return FrameworkUtil.createFilter(filterString);
    }
    catch (InvalidSyntaxException e)
    {
      IllegalArgumentException iae = new IllegalArgumentException(
        "invalid filter");
      iae.initCause(e);
      throw iae;
    }
  }
  
  public boolean implies(Permission p)
  {
    if (!(p instanceof AdaptPermission)) {
      return false;
    }
    AdaptPermission requested = (AdaptPermission)p;
    if (bundle != null) {
      return false;
    }
    if (filter != null) {
      return false;
    }
    return implies0(requested, 0);
  }
  
  boolean implies0(AdaptPermission requested, int effective)
  {
    effective |= action_mask;
    int desired = action_mask;
    if ((effective & desired) != desired) {
      return false;
    }
    Filter f = filter;
    if (f == null) {
      return true;
    }
    return f.matches(requested.getProperties());
  }
  
  public String getActions()
  {
    String result = actions;
    if (result == null) {
      actions = (result = "adapt");
    }
    return result;
  }
  
  public PermissionCollection newPermissionCollection()
  {
    return new AdaptPermissionCollection();
  }
  
  public boolean equals(Object obj)
  {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof AdaptPermission)) {
      return false;
    }
    AdaptPermission cp = (AdaptPermission)obj;
    
    return (action_mask == action_mask) && (getName().equals(cp.getName())) && ((bundle == bundle) || ((bundle != null) && (bundle.equals(bundle))));
  }
  
  public int hashCode()
  {
    int h = 527 + getName().hashCode();
    h = 31 * h + getActions().h
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-2017. Infinite Loop Ltd