groovy-all-2.1.7

16:21:47.770 INFO  jd.cli.Main - Decompiling groovy-all-2.1.7.jar
package groovy.util;

import groovy.lang.Closure;
import org.codehaus.groovy.runtime.GeneratedClosure;
import org.codehaus.groovy.runtime.ScriptBytecodeAdapter;
import org.codehaus.groovy.runtime.callsite.CallSite;
import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation;

class CliBuilder$_expandArgumentFile_closure2
  extends Closure
  implements GeneratedClosure
{
  public CliBuilder$_expandArgumentFile_closure2(Object _outerInstance, Object _thisObject)
  {
    super(_outerInstance, _thisObject);
  }
  
  public Object doCall(String s)
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();return Integer.valueOf(DefaultTypeTransformation.intUnbox(ScriptBytecodeAdapter.asType(arrayOfCallSite[0].call(s), Integer.TYPE)));return null;
  }
  
  public Object call(String s)
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();
    return arrayOfCallSite[1].callCurrent(this, s);
    return null;
  }
  
  static {}
}

/* Location:
 * Qualified Name:     groovy.util.CliBuilder._expandArgumentFile_closure2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package groovy.util;

import groovy.lang.Closure;
import groovy.lang.Reference;
import java.io.StreamTokenizer;
import org.codehaus.groovy.runtime.GeneratedClosure;
import org.codehaus.groovy.runtime.callsite.CallSite;

class CliBuilder$_expandArgumentFile_closure3
  extends Closure
  implements GeneratedClosure
{
  public CliBuilder$_expandArgumentFile_closure3(Object _outerInstance, Object _thisObject, Reference args, Reference charAsInt)
  {
    super(_outerInstance, _thisObject);
    Reference localReference1 = args;
    this.args = localReference1;
    Reference localReference2 = charAsInt;
    this.charAsInt = localReference2;
  }
  
  public Object doCall(Object r)
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();return arrayOfCallSite[0].call(arrayOfCallSite[1].callConstructor(StreamTokenizer.class, r), new CliBuilder._expandArgumentFile_closure3_closure4(this, getThisObject(), args, charAsInt));return null;
  }
  
  public Object getArgs()
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();
    return args.get();
    return null;
  }
  
  public Object getCharAsInt()
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();
    return charAsInt.get();
    return null;
  }
  
  static {}
}

/* Location:
 * Qualified Name:     groovy.util.CliBuilder._expandArgumentFile_closure3
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package groovy.util;

import groovy.lang.Closure;
import groovy.lang.Reference;
import java.io.StreamTokenizer;
import org.codehaus.groovy.runtime.GeneratedClosure;
import org.codehaus.groovy.runtime.ScriptBytecodeAdapter;
import org.codehaus.groovy.runtime.callsite.CallSite;

class CliBuilder$_expandArgumentFile_closure3_closure4
  extends Closure
  implements GeneratedClosure
{
  public CliBuilder$_expandArgumentFile_closure3_closure4(Object _outerInstance, Object _thisObject, Reference args, Reference charAsInt)
  {
    super(_outerInstance, _thisObject);
    Reference localReference1 = args;
    this.args = localReference1;
    Reference localReference2 = charAsInt;
    this.charAsInt = localReference2;
  }
  
  public Object doCall(Object it)
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();arrayOfCallSite[0].callCurrent(this);
    arrayOfCallSite[1].callCurrent(this, arrayOfCallSite[2].call(charAsInt.get(), " "), Integer.valueOf(255));
    arrayOfCallSite[3].callCurrent(this, Integer.valueOf(0), arrayOfCallSite[4].call(charAsInt.get(), " "));
    arrayOfCallSite[5].callCurrent(this, arrayOfCallSite[6].call(charAsInt.get(), "#"));
    arrayOfCallSite[7].callCurrent(this, arrayOfCallSite[8].call(charAsInt.get(), "\""));
    arrayOfCallSite[9].callCurrent(this, arrayOfCallSite[10].call(charAsInt.get(), "'"));
    while (ScriptBytecodeAdapter.compareNotEqual(arrayOfCallSite[11].callCurrent(this), arrayOfCallSite[12].callGetProperty(StreamTokenizer.class))) {
      arrayOfCallSite[13].call(args.get(), arrayOfCallSite[14].callGetProperty(this));
    }
    return null;return null;
  }
  
  public Object getArgs()
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();
    return args.get();
    return null;
  }
  
  public Object getCharAsInt()
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();
    return charAsInt.get();
    return null;
  }
  
  public Object doCall()
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();
    return doCall(null);
    return null;
  }
  
  static {}
}

/* Location:
 * Qualified Name:     groovy.util.CliBuilder._expandArgumentFile_closure3_closure4
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package groovy.util;

import groovy.lang.Closure;
import groovy.lang.Reference;
import org.apache.commons.cli.Option;
import org.codehaus.groovy.runtime.GeneratedClosure;
import org.codehaus.groovy.runtime.ScriptBytecodeAdapter;
import org.codehaus.groovy.runtime.callsite.CallSite;

class CliBuilder$_option_closure1
  extends Closure
  implements GeneratedClosure
{
  public CliBuilder$_option_closure1(Object _outerInstance, Object _thisObject, Reference option)
  {
    super(_outerInstance, _thisObject);
    Reference localReference = option;
    this.option = localReference;
  }
  
  public Object doCall(Object key, Object value)
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();Object localObject = value;arrayOfCallSite[0].call(option.get(), key, localObject);return localObject;return null;
  }
  
  public Object call(Object key, Object value)
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();
    return arrayOfCallSite[1].callCurrent(this, key, value);
    return null;
  }
  
  public Option getOption()
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();
    return (Option)ScriptBytecodeAdapter.castToType(option.get(), Option.class);
    return null;
  }
  
  static {}
}

/* Location:
 * Qualified Name:     groovy.util.CliBuilder._option_closure1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package groovy.util;

import groovy.lang.Closure;
import groovy.lang.GString;
import groovy.lang.GroovyObject;
import groovy.lang.MetaClass;
import groovy.lang.Reference;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.GnuParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.Parser;
import org.apache.commons.cli.PosixParser;
import org.codehaus.groovy.cli.GroovyPosixParser;
import org.codehaus.groovy.runtime.ArrayUtil;
import org.codehaus.groovy.runtime.BytecodeInterface8;
import org.codehaus.groovy.runtime.GeneratedClosure;
import org.codehaus.groovy.runtime.InvokerHelper;
import org.codehaus.groovy.runtime.ScriptBytecodeAdapter;
import org.codehaus.groovy.runtime.callsite.CallSite;
import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation;

public class CliBuilder
  implements GroovyObject
{
  private String usage;
  private CommandLineParser parser;
  @Deprecated
  private Boolean posix;
  private boolean expandArgumentFiles;
  private HelpFormatter formatter;
  private PrintWriter writer;
  private String header;
  private String footer;
  private boolean stopAtNonOption;
  private int width;
  private Options options;
  
  public CliBuilder()
  {
    CliBuilder this;
    CallSite[] arrayOfCallSite = $getCallSiteArray();String str1 = "groovy";usage = str1;Object localObject1 = null;parser = ((CommandLineParser)ScriptBytecodeAdapter.castToType(localObject1, CommandLineParser.class));Object localObject2 = null;posix = ((Boolean)ScriptBytecodeAdapter.castToType(localObject2, Boolean.class));boolean bool1 = true;expandArgumentFiles = bool1;Object localObject3 = arrayOfCallSite[0].callConstructor(HelpFormatter.class);formatter = ((HelpFormatter)ScriptBytecodeAdapter.castToType(localObject3, HelpFormatter.class));
    
    Object localObject4 = arrayOfCallSite[1].callConstructor(PrintWriter.class, arrayOfCallSite[2].callGetProperty(System.class));writer = ((PrintWriter)ScriptBytecodeAdapter.castToType(localObject4, PrintWriter.class));String str2 = "";header = str2;String str3 = "";footer = str3;boolean bool2 = true;stopAtNonOption = bool2;Object localObject5 = arrayOfCallSite[3].callGetProperty(formatter);width = DefaultTypeTransformation.intUnbox(localObject5);
    
    Object localObject6 = arrayOfCallSite[4].callConstructor(Options.class);options = ((Options)ScriptBytecodeAdapter.castToType(localObject6, Options.class));MetaClass localMetaClass = $getStaticMetaClass();metaClass = localMetaClass;
  }
  
  public Object invokeMethod(String name, Object args)
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();
    if ((!BytecodeInterface8.isOrigInt()) || (!BytecodeInterface8.isOrigZ()) || (__$stMC) || (BytecodeInterface8.disabledStandardMetaClass()))
    {
      if ((args instanceof Object[]))
      {
        if (ScriptBytecodeAdapter.compareEqual(arrayOfCallSite[5].call(args), Integer.valueOf(1))) {}
        if (((((arrayOfCallSite[6].call(args, Integer.valueOf(0)) instanceof String)) || ((arrayOfCallSite[7].call(args, Integer.valueOf(0)) instanceof GString)) ? 1 : 0) != 0 ? 1 : 0) != 0)
        {
          arrayOfCallSite[8].call(options, arrayOfCallSite[9].callCurrent(this, name, ScriptBytecodeAdapter.createMap(new Object[0]), arrayOfCallSite[10].call(args, Integer.valueOf(0))));
          return null;
        }
        if (((ScriptBytecodeAdapter.compareEqual(arrayOfCallSite[11].call(args), Integer.valueOf(1))) && ((arrayOfCallSite[12].call(args, Integer.valueOf(0)) instanceof Option)) ? 1 : 0) != 0) {}
        if ((ScriptBytecodeAdapter.compareEqual(name, "leftShift") ? 1 : 0) != 0)
        {
          arrayOfCallSite[13].call(options, arrayOfCallSite[14].call(args, Integer.valueOf(0)));
          return null;
        }
        if (((ScriptBytecodeAdapter.compareEqual(arrayOfCallSite[15].call(args), Integer.valueOf(2))) && ((arrayOfCallSite[16].call(args, Integer.valueOf(0)) instanceof Map)) ? 1 : 0) != 0)
        {
          arrayOfCallSite[17].call(options, arrayOfCallSite[18].callCurrent(this, name, arrayOfCallSite[19].call(args, Integer.valueOf(0)), arrayOfCallSite[20].call(args, Integer.valueOf(1))));
          return null;
        }
      }
    }
    else if ((args instanceof Object[]))
    {
      if (ScriptBytecodeAdapter.compareEqual(arrayOfCallSite[21].call(args), Integer.valueOf(1))) {}
      if (((((arrayOfCallSite[22].call(args, Integer.valueOf(0)) instanceof String)) || ((arrayOfCallSite[23].call(args, Integer.valueOf(0)) instanceof GString)) ? 1 : 0) != 0 ? 1 : 0) != 0)
      {
        arrayOfCallSite[24].call(options, arrayOfCallSite[25].callCurrent(this, name, ScriptBytecodeAdapter.createMap(new Object[0]), arrayOfCallSite[26].call(args, Integer.valueOf(0))));
        return null;
      }
      if (((ScriptBytecodeAdapter.compareEqual(arrayOfCallSite[27].call(args), Integer.valueOf(1))) && ((arrayOfCallSite[28].call(args, Integer.valueOf(0)) instanceof Option)) ? 1 : 0) != 0) {}
      if ((ScriptBytecodeAdapter.compareEqual(name, "leftShift") ? 1 : 0) != 0)
      {
        arrayOfCallSite[29].call(options, arrayOfCallSite[30].call(args, Integer.valueOf(0)));
        return null;
      }
      if (((ScriptBytecodeAdapter.compareEqual(arrayOfCallSite[31].call(args), Integer.valueOf(2))) && ((arrayOfCallSite[32].call(args, Integer.valueOf(0)) instanceof Map)) ? 1 : 0) != 0)
      {
        arrayOfCallSite[33].call(options, arrayOfCallSite[34].callCurrent(this, name, arrayOfCallSite[35].call(args, Integer.valueOf(0)), arrayOfCallSite[36].call(args, Integer.valueOf(1))));
        return null;
      }
    }
    return arrayOfCallSite[37].call(arrayOfCallSite[38].call(InvokerHelper.class, this), this, name, args);return null;
  }
  
  public OptionAccessor parse(Object args)
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();
    Object localObject1;
    if (expandArgumentFiles)
    {
      localObject1 = arrayOfCallSite[39].callStatic(CliBuilder.class, args);args = localObject1;
    }
    Parser localParser1;
    Parser localParser2;
    if ((!BytecodeInterface8.isOrigZ()) || (__$stMC) || (BytecodeInterface8.disabledStandardMetaClass()))
    {
      if ((!DefaultTypeTransformation.booleanUnbox(parser) ? 1 : 0) != 0)
      {
        localParser1 = ScriptBytecodeAdapter.compareEqual(posix, Boolean.valueOf(true)) ? (Parser)ScriptBytecodeAdapter.castToType(arrayOfCallSite[41].callConstructor(PosixParser.class), Parser.class) : ScriptBytecodeAdapter.compareEqual(posix, null) ? arrayOfCallSite[40].callConstructor(GroovyPosixParser.class) : (Parser)ScriptBytecodeAdapter.castToType(arrayOfCallSite[42].callConstructor(GnuParser.class), Parser.class);parser = ((CommandLineParser)ScriptBytecodeAdapter.castToType(localParser1, CommandLineParser.class));
      }
    }
    else if ((!DefaultTypeTransformation.booleanUnbox(parser) ? 1 : 0) != 0)
    {
      localParser2 = ScriptBytecodeAdapter.compareEqual(posix, Boolean.valueOf(true)) ? (Parser)ScriptBytecodeAdapter.castToType(arrayOfCallSite[44].callConstructor(PosixParser.class), Parser.class) : ScriptBytecodeAdapter.compareEqual(posix, null) ? arrayOfCallSite[43].callConstructor(GroovyPosixParser.class) : (Parser)ScriptBytecodeAdapter.castToType(arrayOfCallSite[45].callConstructor(GnuParser.class), Parser.class);parser = ((CommandLineParser)ScriptBytecodeAdapter.castToType(localParser2, CommandLineParser.class));
    }
    try
    {
      try
      {
        return (OptionAccessor)ScriptBytecodeAdapter.castToType(arrayOfCallSite[46].callConstructor(OptionAccessor.class, arrayOfCallSite[47].call(parser, options, ScriptBytecodeAdapter.createPojoWrapper((String[])ScriptBytecodeAdapter.asType(args, String[].class), String[].class), Boolean.valueOf(stopAtNonOption))), OptionAccessor.class);
      }
      catch (ParseException pe)
      {
        arrayOfCallSite[48].call(writer, arrayOfCallSite[49].call("error: ", arrayOfCallSite[50].callGetProperty(pe)));
        if ((!__$stMC) && (!BytecodeInterface8.disabledStandardMetaClass())) {
          break label425;
        }
        arrayOfCallSite[51].callCurrent(this);
        break label432;
        label425:
        usage();
        null;
        label432:
        return (OptionAccessor)ScriptBytecodeAdapter.castToType(null, OptionAccessor.class);
      }
    }
    finally {}
    return null;
  }
  
  public void usage()
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();arrayOfCallSite[52].call(formatter, ArrayUtil.createArray(writer, Integer.valueOf(width), usage, header, options, arrayOfCallSite[53].callGetProperty(formatter), arrayOfCallSite[54].callGetProperty(formatter), footer));
    arrayOfCallSite[55].call(writer);
  }
  
  class _option_closure1
    extends Closure
    implements GeneratedClosure
  {
    public _option_closure1(Object _thisObject, Reference option)
    {
      super(_thisObject);
      Reference localReference = option;
      this.option = localReference;
    }
    
    public Object doCall(Object key, Object value)
    {
      CallSite[] arrayOfCallSite = $getCallSiteArray();Object localObject = value;arrayOfCallSite[0].call(option.get(), key, localObject);return localObject;return null;
    }
    
    public Object call(Object key, Object value)
    {
      CallSite[] arrayOfCallSite = $getCallSiteArray();
      return arrayOfCallSite[1].callCurrent(this, key, value);
      return null;
    }
    
    public Option getOption()
    {
      CallSite[] arrayOfCallSite = $getCallSiteArray();
      return (Option)ScriptBytecodeAdapter.castToType(option.get(), Option.class);
      return null;
    }
    
    static {}
  }
  
  public Option option(Object shortname, Map details, Object info)
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();Reference option = new Reference(null);((Option)option.get());
    Object localObject2;
    Object localObject4;
    if ((!BytecodeInterface8.isOrigZ()) || (__$stMC) || (BytecodeInterface8.disabledStandardMetaClass()))
    {
      if (ScriptBytecodeAdapter.compareEqual(shortname, "_"))
      {
        Object localObject1 = arrayOfCallSite[56].call(arrayOfCallSite[57].call(arrayOfCallSite[58].call(OptionBuilder.class, info), arrayOfCallSite[59].callGetProperty(details)));((Reference)option).set((Option)ScriptBytecodeAdapter.castToType(localObject1, Option.class));
        arrayOfCallSite[60].call(details, "longOpt");
      }
      else
      {
        localObject2 = arrayOfCallSite[61].callConstructor(Option.class, shortname, info);((Reference)option).set((Option)ScriptBytecodeAdapter.castToType(localObject2, Option.class));
      }
    }
    else if (ScriptBytecodeAdapter.compareEqual(shortname, "_"))
    {
      Object localObject3 = arrayOfCallSite[62].call(arrayOfCallSite[63].call(arrayOfCallSite[64].call(OptionBuilder.class, info), arrayOfCallSite[65].callGetProperty(details)));((Reference)option).set((Option)ScriptBytecodeAdapter.castToType(localObject3, Option.class));
      arrayOfCallSite[66].call(details, "longOpt");
    }
    else
    {
      localObject4 = arrayOfCallSite[67].callConstructor(Option.class, shortname, info);((Reference)option).set((Option)ScriptBytecodeAdapter.castToType(localObject4, Option.class));
    }
    arrayOfCallSite[68].call(details, new _option_closure1(this, option));
    return (Option)option.get();return null;
  }
  
  public static Object expandArgumentFiles(Object args)
    throws IOException
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();Object result = ScriptBytecodeAdapter.createList(new Object[0]);
    Object arg = null;
    for (Iterator localIterator = (Iterator)ScriptBytecodeAdapter.castToType(arrayOfCallSite[69].call(args), Iterator.class); localIterator.hasNext();)
    {
      arg = localIterator.next();
      if (((DefaultTypeTransformation.booleanUnbox(arg)) && (ScriptBytecodeAdapter.compareNotEqual(arg, "@")) ? 1 : 0) != 0) {}
      if ((ScriptBytecodeAdapter.compareEqual(arrayOfCallSite[70].call(arg, Integer.valueOf(0)), "@") ? 1 : 0) != 0)
      {
        Object localObject1 = arrayOfCallSite[71].call(arg, Integer.valueOf(1));arg = localObject1;
        if (ScriptBytecodeAdapter.compareNotEqual(arrayOfCallSite[72].call(arg, Integer.valueOf(0)), "@"))
        {
          arrayOfCallSite[73].callStatic(CliBuilder.class, arg, result);
          continue;
        }
      }
      arrayOfCallSite[74].call(result, arg);
    }
    return result;return null;
  }
  
  class _expandArgumentFile_closure2
    extends Closure
    implements GeneratedClosure
  {
    public _expandArgumentFile_closure2(Object _thisObject)
    {
      super(_thisObject);
    }
    
    public Object doCall(String s)
    {
      CallSite[] arrayOfCallSite = $getCallSiteArray();return Integer.valueOf(DefaultTypeTransformation.intUnbox(ScriptBytecodeAdapter.asType(arrayOfCallSite[0].call(s), Integer.TYPE)));return null;
    }
    
    public Object call(String s)
    {
      CallSite[] arrayOfCallSite = $getCallSiteArray();
      return arrayOfCallSite[1].callCurrent(this, s);
      return null;
    }
    
    static {}
  }
  
  private static Object expandArgumentFile(Object name, Object args)
    throws IOException
  {
    Reference args = new Reference(args);CallSite[] arrayOfCallSite = $getCallSiteArray();Reference charAsInt = new Reference(new _expandArgumentFile_closure2(CliBuilder.class, CliBuilder.class));
    return arrayOfCallSite[75].call(arrayOfCallSite[76].callConstructor(File.class, name), new _expandArgumentFile_closure3(CliBuilder.class, CliBuilder.class, args, charAsInt));return null;
  }
  
  static
  {
    __$swapInit();
    long l1 = 0L;
    __timeStamp__239_neverHappen1378413779050 = l1;
    long l2 = 1378413779050L;
    __timeStamp = l2;
  }
  
  public String getUsage()
  {
    return usage;
  }
  
  public void setUsage(String paramString)
  {
    usage = paramString;
  }
  
  public CommandLineParser getParser()
  {
    return parser;
  }
  
  public void setParser(CommandLineParser paramCommandLineParser)
  {
    parser = paramCommandLineParser;
  }
  
  public Boolean getPosix()
  {
    return posix;
  }
  
  public void setPosix(Boolean paramBoolean)
  {
    posix = paramBoolean;
  }
  
  public boolean getExpandArgumentFiles()
  {
    return expandArgumentFiles;
  }
  
  public boolean isExpandArgumentFiles()
  {
    return expandArgumentFiles;
  }
  
  public void setExpandArgumentFiles(boolean paramBoolean)
  {
    expandArgumentFiles = paramBoolean;
  }
  
  public HelpFormatter getFormatter()
  {
    return formatter;
  }
  
  public void setFormatter(HelpFormatter paramHelpFormatter)
  {
    formatter = paramHelpFormatter;
  }
  
  public PrintWriter getWriter()
  {
    return writer;
  }
  
  public void setWriter(PrintWriter paramPrintWriter)
  {
    writer = paramPrintWriter;
  }
  
  public String getHeader()
  {
    return header;
  }
  
  public void setHeader(String paramString)
  {
    header = paramString;
  }
  
  public String getFooter()
  {
    return footer;
  }
  
  public void setFooter(String paramString)
  {
    footer = paramString;
  }
  
  public boolean getStopAtNonOption()
  {
    return stopAtNonOption;
  }
  
  public boolean isStopAtNonOption()
  {
    return stopAtNonOption;
  }
  
  public void setStopAtNonOption(boolean paramBoolean)
  {
    stopAtNonOption = paramBoolean;
  }
  
  public int getWidth()
  {
    return width;
  }
  
  public void setWidth(int paramInt)
  {
    width = paramInt;
  }
  
  public Options getOptions()
  {
    return options;
  }
  
  public void setOptions(Options paramOptions)
  {
    options = paramOptions;
  }
  
  class _expandArgumentFile_closure3
    extends Closure
    implements GeneratedClosure
  {
    public _expandArgumentFile_closure3(Object _thisObject, Reference args, Reference charAsInt)
    {
      super(_thisObject);
      Reference localReference1 = args;
      this.args = localReference1;
      Reference localReference2 = charAsInt;
      this.charAsInt = localReference2;
    }
    
    public Object doCall(Object r)
    {
      CallSite[] arrayOfCallSite = $getCallSiteArray();return arrayOfCallSite[0].call(arrayOfCallSite[1].callConstructor(StreamTokenizer.class, r), new CliBuilder._expandArgumentFile_closure3_closure4(this, getThisObject(), args, charAsInt));return null;
    }
    
    public Object getArgs()
    {
      CallSite[] arrayOfCallSite = $getCallSiteArray();
      return args.get();
      return null;
    }
    
    public Object getCharAsInt()
    {
      CallSite[] arrayOfCallSite = $getCallSiteArray();
      return charAsInt.get();
      return null;
    }
    
    static {}
  }
}

/* Location:
 * Qualified Name:     groovy.util.CliBuilder
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package groovy.util;

import groovy.lang.GroovyObject;
import groovy.lang.MetaClass;
import java.util.List;
import org.apache.commons.cli.CommandLine;
import org.codehaus.groovy.runtime.BytecodeInterface8;
import org.codehaus.groovy.runtime.InvokerHelper;
import org.codehaus.groovy.runtime.ScriptBytecodeAdapter;
import org.codehaus.groovy.runtime.callsite.CallSite;
import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation;

public class OptionAccessor
  implements GroovyObject
{
  private CommandLine inner;
  
  public OptionAccessor(CommandLine arg1)
  {
    CommandLine inner;
    CallSite[] arrayOfCallSite = $getCallSiteArray();MetaClass localMetaClass = $getStaticMetaClass();metaClass = localMetaClass;CommandLine localCommandLine1 = inner;this.inner = ((CommandLine)ScriptBytecodeAdapter.castToType(localCommandLine1, CommandLine.class));
  }
  
  public Object invokeMethod(String name, Object args)
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();return arrayOfCallSite[0].call(arrayOfCallSite[1].call(InvokerHelper.class, inner), inner, name, args);return null;
  }
  
  public Object getProperty(String name)
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();Object methodname = "getOptionValue";
    if ((!BytecodeInterface8.isOrigInt()) || (!BytecodeInterface8.isOrigZ()) || (__$stMC) || (BytecodeInterface8.disabledStandardMetaClass()))
    {
      if (((ScriptBytecodeAdapter.compareGreaterThan(arrayOfCallSite[2].call(name), Integer.valueOf(1))) && (DefaultTypeTransformation.booleanUnbox(arrayOfCallSite[3].call(name, "s"))) ? 1 : 0) != 0)
      {
        Object singularName = arrayOfCallSite[4].call(name, ScriptBytecodeAdapter.createRange(Integer.valueOf(0), Integer.valueOf(-2), 1));
        if (DefaultTypeTransformation.booleanUnbox(arrayOfCallSite[5].callCurrent(this, singularName)))
        {
          Object localObject1 = singularName;name = (String)ScriptBytecodeAdapter.castToType(localObject1, String.class);
          (methodname = arrayOfCallSite[6].call(methodname, "s"));
        }
      }
    }
    else if (((ScriptBytecodeAdapter.compareGreaterThan(arrayOfCallSite[7].call(name), Integer.valueOf(1))) && (DefaultTypeTransformation.booleanUnbox(arrayOfCallSite[8].call(name, "s"))) ? 1 : 0) != 0)
    {
      Object singularName = arrayOfCallSite[9].call(name, ScriptBytecodeAdapter.createRange(Integer.valueOf(0), Integer.valueOf(-2), 1));
      if (DefaultTypeTransformation.booleanUnbox(arrayOfCallSite[10].callCurrent(this, singularName)))
      {
        Object localObject2 = singularName;name = (String)ScriptBytecodeAdapter.castToType(localObject2, String.class);
        (methodname = arrayOfCallSite[11].call(methodname, "s"));
      }
    }
    char c1;
    char c2;
    if ((!BytecodeInterface8.isOrigInt()) || (!BytecodeInterface8.isOrigZ()) || (__$stMC) || (BytecodeInterface8.disabledStandardMetaClass()))
    {
      if (ScriptBytecodeAdapter.compareEqual(arrayOfCallSite[12].call(name), Integer.valueOf(1)))
      {
        c1 = DefaultTypeTransformation.charUnbox(ScriptBytecodeAdapter.asType(name, Character.TYPE));name = (String)ScriptBytecodeAdapter.castToType(Character.valueOf(c1), String.class);
      }
    }
    else if (ScriptBytecodeAdapter.compareEqual(arrayOfCallSite[13].call(name), Integer.valueOf(1)))
    {
      c2 = DefaultTypeTransformation.charUnbox(ScriptBytecodeAdapter.asType(name, Character.TYPE));name = (String)ScriptBytecodeAdapter.castToType(Character.valueOf(c2), String.class);
    }
    Object result = arrayOfCallSite[14].call(arrayOfCallSite[15].call(InvokerHelper.class, inner), inner, methodname, name);
    Object localObject3;
    Object localObject4;
    if ((!BytecodeInterface8.isOrigZ()) || (__$stMC) || (BytecodeInterface8.disabledStandardMetaClass()))
    {
      if (ScriptBytecodeAdapter.compareEqual(null, result))
      {
        localObject3 = arrayOfCallSite[16].call(inner, name);result = localObject3;
      }
    }
    else if (ScriptBytecodeAdapter.compareEqual(null, result))
    {
      localObject4 = arrayOfCallSite[17].call(inner, name);result = localObject4;
    }
    Object localObject5;
    if ((result instanceof String[]))
    {
      localObject5 = arrayOfCallSite[18].call(result);result = localObject5;
    }
    return result;return null;
  }
  
  public List<String> arguments()
  {
    CallSite[] arrayOfCallSite = $getCallSiteArray();return (List)ScriptBytecodeAdapter.castToType(arrayOfCallSite[19].call(arrayOfCallSite[20].callGetProperty(inner)), List.class);return null;
  }
  
  static
  {
    __$swapInit();
    long l1 = 0L;
    __timeStamp__239_neverHappen1378413779116 = l1;
    long l2 = 1378413779116L;
    __timeStamp = l2;
  }
  
  public CommandLine getInner()
  {
    return inner;
  }
  
  public void setInner(CommandLine paramCommandLine)
  {
    inner = paramCommandLine;
  }
}

/* Location:
 * Qualified Name:     groovy.util.OptionAccessor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.codehaus.groovy.cli;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.Parser;

public class GroovyPosixParser
  extends Parser
{
  private List tokens = new ArrayList();
  private boolean eatTheRest;
  private Option currentOption;
  private Options options;
  
  private void init()
  {
    eatTheRest = false;
    tokens.clear();
  }
  
  protected String[] flatten(Options options, String[] arguments, boolean stopAtNonOption)
  {
    init();
    this.options = options;
    
    Iterator iter = Arrays.asList(arguments).iterator();
    while (iter.hasNext())
    {
      String token = (String)iter.next();
      if (token.startsWith("--"))
      {
        int pos = token.indexOf('=');
        String opt = pos == -1 ? token : token.substring(0, pos);
        if (!options.hasOption(opt))
        {
          processNonOptionToken(token, stopAtNonOption);
        }
        else
        {
          tokens.add(opt);
          if (pos != -1) {
            tokens.add(token.substring(pos + 1));
          } else {
            currentOption = options.getOption(opt);
          }
        }
      }
      else if ("-".equals(token))
      {
        tokens.add(token);
      }
      else if (token.startsWith("-"))
      {
        if ((token.length() == 2) || (options.hasOption(token))) {
          processOptionToken(token, stopAtNonOption);
        } else {
          burstToken(token, stopAtNonOption);
        }
      }
      else
      {
        processNonOptionToken(token, stopAtNonOption);
      }
      gobble(iter);
    }
    return (String[])tokens.toArray(new String[tokens.size()]);
  }
  
  private void gobble(Iterator iter)
  {
    if (eatTheRest) {
      while (iter.hasNext()) {
        tokens.add(iter.next());
      }
    }
  }
  
  private void processNonOptionToken(String value, boolean stopAtNonOption)
  {
    if ((stopAtNonOption) && ((currentOption == null) || (!currentOption.hasArg())))
    {
      eatTheRest = true;
      tokens.add("--");
    }
    tokens.add(value);
    currentOption = null;
  }
  
  private void processOptionToken(String token, boolean stopAtNonOption)
  {
    if ((stopAtNonOption) && (!options.hasOption(token))) {
      eatTheRest = true;
    }
    if (options.hasOption(token)) {
      currentOption = options.getOption(token);
    } else {
      currentOption = null;
    }
    tokens.add(token);
  }
  
  protected void burstToken(String token, boolean stopAtNonOption)
  {
    for (int i = 1; i < token.length(); i++)
    {
      String ch = String.valueOf(token.charAt(i));
      if (options.hasOption(ch))
      {
        tokens.add("-" + ch);
        currentOption = options.getOption(ch);
        if ((currentOption.hasArg()) && (token.length() != i + 1))
        {
          tokens.add(token.substring(i + 1));
          break;
        }
      }
      else
      {
        if (stopAtNonOption)
        {
          processNonOptionToken(token.substring(i), true);
          break;
        }
        tokens.add(token);
        break;
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.codehaus.groovy.cli.GroovyPosixParser
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package groovy.beans;

import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.codehaus.groovy.transform.GroovyASTTransformationClass;

@Documented
@Retention(RetentionPolicy.SOURCE)
@Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.TYPE})
@GroovyASTTransformationClass({"groovy.beans.BindableASTTransformation"})
public @interface Bindable {}

/* Location:
 * Qualified Name:     groovy.beans.Bindable
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package groovy.beans;

import groovyjarjarasm.asm.Opcodes;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.List;
import org.codehaus.groovy.ast.ASTNode;
import org.codehaus.groovy.ast.AnnotatedNode;
import org.codehaus.groovy.ast.AnnotationNode;
import org.codehaus.groovy.ast.ClassHelper;
import org.codehaus.groovy.ast.ClassNode;
import org.codehaus.groovy.ast.FieldNode;
import org.codehaus.groovy.ast.MethodNode;
import org.codehaus.groovy.ast.Parameter;
import org.codehaus.groovy.ast.PropertyNode;
import org.codehaus.groovy.ast.expr.ArgumentListExpression;
import org.codehaus.groovy.ast.expr.BinaryExpression;
import org.codehaus.groovy.ast.expr.ConstantExpression;
import org.codehaus.groovy.ast.expr.ConstructorCallExpression;
import org.codehaus.groovy.ast.expr.DeclarationExpression;
import org.codehaus.groovy.ast.expr.Expression;
import org.codehaus.groovy.ast.expr.FieldExpression;
import org.codehaus.groovy.ast.expr.MethodCallExpression;
import org.codehaus.groovy.ast.expr.VariableExpression;
import org.codehaus.groovy.ast.stmt.BlockStatement;
import org.codehaus.groovy.ast.stmt.ExpressionStatement;
import org.codehaus.groovy.ast.stmt.ReturnStatement;
import org.codehaus.groovy.ast.stmt.Statement;
import org.codehaus.groovy.control.CompilePhase;
import org.codehaus.groovy.control.ErrorCollector;
import org.codehaus.groovy.control.SourceUnit;
import org.codehaus.groovy.control.messages.SimpleMessage;
import org.codehaus.groovy.control.messages.SyntaxErrorMessage;
import org.codehaus.groovy.runtime.MetaClassHelper;
import org.codehaus.groovy.syntax.SyntaxException;
import org.codehaus.groovy.syntax.Token;
import org.codehaus.groovy.transform.ASTTransformation;
import org.codehaus.groovy.transform.GroovyASTTransformation;

@GroovyASTTransformation(phase=CompilePhase.CANONICALIZATION)
public class BindableASTTransformation
  implements ASTTransformation, Opcodes
{
  protected static ClassNode boundClassNode = ClassHelper.make(Bindable.class);
  protected ClassNode pcsClassNode = ClassHelper.make(PropertyChangeSupport.class);
  
  public static boolean hasBindableAnnotation(AnnotatedNode node)
  {
    for (AnnotationNode annotation : node.getAnnotations()) {
      if (boundClassNode.equals(annotation.getClassNode())) {
        return true;
      }
    }
    return false;
  }
  
  public void visit(ASTNode[] nodes, SourceUnit source)
  {
    if ((!(nodes[0] instanceof AnnotationNode)) || (!(nodes[1] instanceof AnnotatedNode))) {
      throw new RuntimeException("Internal error: wrong types: $node.class / $parent.class");
    }
    AnnotationNode node = (AnnotationNode)nodes[0];
    AnnotatedNode parent = (AnnotatedNode)nodes[1];
    if (VetoableASTTransformation.hasVetoableAnnotation(parent)) {
      return;
    }
    ClassNode declaringClass = parent.getDeclaringClass();
    if ((parent instanceof FieldNode))
    {
      if ((((FieldNode)parent).getModifiers() & 0x10) != 0) {
        source.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(new SyntaxException("@groovy.beans.Bindable cannot annotate a final property.", node.getLineNumber(), node.getColumnNumber(), node.getLastLineNumber(), node.getLastColumnNumber()), source));
      }
      if (VetoableASTTransformation.hasVetoableAnnotation(parent.getDeclaringClass())) {
        return;
      }
      addListenerToProperty(source, node, declaringClass, (FieldNode)parent);
    }
    else if ((parent instanceof ClassNode))
    {
      addListenerToClass(source, node, (ClassNode)parent);
    }
  }
  
  private void addListenerToProperty(SourceUnit source, AnnotationNode node, ClassNode declaringClass, FieldNode field)
  {
    String fieldName = field.getName();
    for (PropertyNode propertyNode : declaringClass.getProperties()) {
      if (propertyNode.getName().equals(fieldName))
      {
        if (field.isStatic())
        {
          source.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(new SyntaxException("@groovy.beans.Bindable cannot annotate a static property.", node.getLineNumber(), node.getColumnNumber(), node.getLastLineNumber(), node.getLastColumnNumber()), source));
        }
        else
        {
          if (needsPropertyChangeSupport(declaringClass, source)) {
            addPropertyChangeSupport(declaringClass);
          }
          createListenerSetter(source, node, declaringClass, propertyNode);
        }
        return;
      }
    }
    source.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(new SyntaxException("@groovy.beans.Bindable must be on a property, not a field.  Try removing the private, protected, or public modifier.", node.getLineNumber(), node.getColumnNumber(), node.getLastLineNumber(), node.getLastColumnNumber()), source));
  }
  
  private void addListenerToClass(SourceUnit source, AnnotationNode node, ClassNode classNode)
  {
    if (needsPropertyChangeSupport(classNode, source)) {
      addPropertyChangeSupport(classNode);
    }
    for (PropertyNode propertyNode : classNode.getProperties())
    {
      FieldNode field = propertyNode.getField();
      if ((!hasBindableAnnotation(field)) && ((field.getModifiers() & 0x10) == 0) && (!field.isStatic()) && (!VetoableASTTransformation.hasVetoableAnnotation(field))) {
        createListenerSetter(source, node, classNode, propertyNode);
      }
    }
  }
  
  private void wrapSetterMethod(ClassNode classNode, String propertyName)
  {
    String getterName = "get" + MetaClassHelper.capitalize(propertyName);
    MethodNode setter = classNode.getSetterMethod("set" + MetaClassHelper.capitalize(propertyName));
    if (setter != null)
    {
      Statement code = setter.getCode();
      
      VariableExpression oldValue = new VariableExpression("$oldValue");
      VariableExpression newValue = new VariableExpression("$newValue");
      BlockStatement block = new BlockStatement();
      
      block.addStatement(new ExpressionStatement(new DeclarationExpression(oldValue, Token.newSymbol(100, 0, 0), new MethodCallExpression(VariableExpression.THIS_EXPRESSION, getterName, ArgumentListExpression.EMPTY_ARGUMENTS))));
      
      block.addStatement(code);
      
      block.addStatement(new ExpressionStatement(new DeclarationExpression(newValue, Token.newSymbol(100, 0, 0), new MethodCallExpression(VariableExpression.THIS_EXPRESSION, getterName, ArgumentListExpression.EMPTY_ARGUMENTS))));
      
      block.addStatement(new ExpressionStatement(new MethodCallExpression(VariableExpression.THIS_EXPRESSION, "firePropertyChange", new ArgumentListExpression(new Expression[] { new ConstantExpression(propertyName), oldValue, newValue }))));
      
      setter.setCode(block);
    }
  }
  
  private void createListenerSetter(SourceUnit source, AnnotationNode node, ClassNode classNode, PropertyNode propertyNode)
  {
    String setterName = "set" + MetaClassHelper.capitalize(propertyNode.getName());
    if (classNode.getMethods(setterName).isEmpty())
    {
      Expression fieldExpression = new FieldExpression(propertyNode.getField());
      Statement setterBlock = createBindableStatement(propertyNode, fieldExpression);
      
      createSetterMethod(classNode, propertyNode, setterName, setterBlock);
    }
    else
    {
      wrapSetterMethod(classNode, propertyNode.getName());
    }
  }
  
  protected Statement createBindableStatement(PropertyNode propertyNode, Expression fieldExpression)
  {
    return new ExpressionStatement(new MethodCallExpression(VariableExpression.THIS_EXPRESSION, "firePropertyChange", new ArgumentListExpression(new Expression[] { new ConstantExpression(propertyNode.getName()), fieldExpression, new BinaryExpression(fieldExpression, Token.newSymbol(100, 0, 0), new VariableExpression("value")) })));
  }
  
  protected void createSetterMethod(ClassNode declaringClas
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 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333

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