public abstract class AppenderSkeleton implements Appender, OptionHandler {

  /** The layout variable does not need to be set if the appender
      implementation has its own layout. */
  protected Layout layout;

  /** Appenders are named. */
  protected String name;

  /**
     There is no level threshold filtering by default.  */
  protected Priority threshold;

  /**
      It is assumed and enforced that errorHandler is never null.
  */
  protected ErrorHandler errorHandler = new OnlyOnceErrorHandler();

  /** The first filter in the filter chain. Set to null
      initially. */
  protected Filter headFilter;
  /** The last filter in the filter chain. */
  protected Filter tailFilter;

  /**
     Is this appender closed?
   */
  protected boolean closed = false;

    /**
     * Create new instance.
     */
    public AppenderSkeleton() {
        super();
    }

    /**
     * Create new instance.
     * Provided for compatibility with log4j 1.3.
     *
     * @param isActive true if appender is ready for use upon construction.
     *                 Not used in log4j 1.2.x.
     * @since 1.2.15
     */
    protected AppenderSkeleton(final boolean isActive) {
        super();
    }

  /**
     Derived appenders should override this method if option structure
     requires it.  */
  public
  void activateOptions() {
  }

  /**
     Add a filter to end of the filter list.

     @since 0.9.0
   */
  public
  void addFilter(Filter newFilter) {
    if(headFilter == null) {
      headFilter = tailFilter = newFilter;
    } else {
      tailFilter.setNext(newFilter);
      tailFilter = newFilter;
    }
  }

  /**
     Subclasses of AppenderSkeleton should implement this
     method to perform actual logging. See also {@link #doAppend
     AppenderSkeleton.doAppend} method.

     @since 0.9.0
  */
  abstract
  protected
  void append(LoggingEvent event);

  /**
     Clear the filters chain.

     @since 0.9.0 */
  public
  void clearFilters() {
    headFilter = tailFilter = null;
  }

  /**
     Finalize this appender by calling the derived class'
     close method.

     @since 0.8.4 */
  public
  void finalize() {
    // An appender might be closed then garbage collected. There is no
    // point in closing twice.
    if(this.closed)
      return;

    LogLog.debug("Finalizing appender named ["+name+"].");
    close();
  }

  /**
      Return the currently set {@link ErrorHandler} for this
      Appender.

      @since 0.9.0 */
  public
  ErrorHandler getErrorHandler() {
    return this.errorHandler;
  }

  /**
     Returns the head Filter.

     @since 1.1
  */
  public
  Filter getFilter() {
    return headFilter;
  }

  /**
      Return the first filter in the filter chain for this
      Appender. The return value may be null if no is
      filter is set.

  */
  public
  final
  Filter getFirstFilter() {
    return headFilter;
  }

  /**
     Returns the layout of this appender. The value may be null.
  */
  public
  Layout getLayout() {
    return layout;
  }

  /**
     Returns the name of this appender.
     @return name, may be null.
   */
  public
  final
  String getName() {
    return this.name;
  }

  /**
     Returns this appenders threshold level. See the {@link
     #setThreshold} method for the meaning of this option.

     @since 1.1 */
  public
  Priority getThreshold() {
    return threshold;
  }

  /**
     Check whether the message level is below the appender's
     threshold. If there is no threshold set, then the return value is
     always true.

  */
  public
  boolean isAsSevereAsThreshold(Priority priority) {
    return ((threshold == null) || priority.isGreaterOrEqual(threshold));
  }

  /**
    * This method performs threshold checks and invokes filters before
    * delegating actual logging to the subclasses specific {@link
    * AppenderSkeleton#append} method.
    * */
  public
  synchronized
  void doAppend(LoggingEvent event) {
    if(closed) {
      LogLog.error("Attempted to append to closed appender named ["+name+"].");
      return;
    }

    if(!isAsSevereAsThreshold(event.getLevel())) {
      return;
    }

    Filter f = this.headFilter;

    FILTER_LOOP:
    while(f != null) {
      switch(f.decide(event)) {
      case Filter.DENY: return;
      case Filter.ACCEPT: break FILTER_LOOP;
      case Filter.NEUTRAL: f = f.getNext();
      }
    }

    this.append(event);
  }

  /**
      Set the {@link ErrorHandler} for this Appender.
      @since 0.9.0
  */
  public
  synchronized
  void setErrorHandler(ErrorHandler eh) {
    if(eh == null) {
      // We do not throw exception here since the cause is probably a
      // bad config file.
      LogLog.warn("You have tried to set a null error-handler.");
    } else {
      this.errorHandler = eh;
    }
  }

  /**
     Set the layout for this appender. Note that some appenders have
     their own (fixed) layouts or do not use one. For example, the
     {@link org.apache.log4j.net.SocketAppender} ignores the layout set
     here.
  */
  public
  void setLayout(Layout layout) {
    this.layout = layout;
  }

  /**
     Set the name of this Appender.
   */
  public
  void setName(String name) {
    this.name = name;
  }

  /**
     Set the threshold level. All log events with lower level
     than the threshold level are ignored by the appender.

In configuration files this option is specified by setting the
     value of the Threshold option to a level
     string, such as "DEBUG", "INFO" and so on.

     @since 0.8.3 */
  public
  void setThreshold(Priority threshold) {
    this.threshold = threshold;

FUNC_DECL IF PARAM BINARY_OP LITERAL_ANCHOR ASSIGN CALL ASSIGN ASSIGN

  Filter getFilter() {
    return headFilter;

  Layout getLayout() {
    return layout;

  String getName() {
    return this.name;

    public AppenderSkeleton() {
        super();


org.apache.tools.ant.TaskAdapter

public class TaskAdapter extends Task {

    Object proxy;

    /**
     * Do the execution.
     */
    public void execute() throws BuildException {
        Method executeM=null;
        try {
            Class c=proxy.getClass();
            executeM=c.getMethod( "execute", new Class[0] );
            if( executeM == null ) {
                log("No execute in " + proxy.getClass(), Project.MSG_ERR);
                throw new BuildException("No execute in " + proxy.getClass());
            }
            executeM.invoke(proxy, null);
            return;
        } catch( Exception ex ) {
            log("Error in " + proxy.getClass(), Project.MSG_ERR);
            throw new BuildException( ex );
        }

    }

    /**
     * Set the target object class
     */
    public void setProxy(Object o) {
        this.proxy = o;
    }

    public Object getProxy() {
        return this.proxy ;


org.apache.poi.hssf.record.formula.Ptg

public abstract class Ptg
{

    /** Creates new Ptg */

    public Ptg()
    {
    }

    /*
    private static List ptgsToList(Class [] ptgs)
    {
        List         result = new ArrayList();
        Constructor constructor;

        for (int i = 0; i < ptgs.length; i++)
        {
            Class ptg = null;

            ptg = ptgs[ i ];
            try
            {

                constructor = ptg.getConstructor(new Class[]
                {
                    byte [].class, int.class
                });
            }
            catch (Exception illegalArgumentException)
            {
                throw new RuntimeException(
                    "Now that didn't work nicely at all (couldn't do that there list of ptgs)");
            }
            result.add(constructor);
        }
        return result;
    }*/

    public static Ptg createPtg(byte [] data, int offset)
    {
        byte id     = data[ offset + 0 ];
        Ptg  retval = null;

        System.out.println("PTG = " + Integer.toHexString(id) + " (" + id
                           + ")");
        switch (id)
        {

            case AddPtg.sid :
                retval = new AddPtg(data, offset);
                break;

            case SubtractPtg.sid :
                retval = new SubtractPtg(data, offset);
                break;

            case IntPtg.sid :
                retval = new IntPtg(data, offset);
                break;

            case DividePtg.sid :
                retval = new DividePtg(data, offset);
                break;

            case MultiplyPtg.sid :
                retval = new MultiplyPtg(data, offset);
                break;

            case PowerPtg.sid :
                retval = new PowerPtg(data, offset);
                break;

            case AreaPtg.sid :
                retval = new AreaPtg(data, offset);
                break;

            case MemErrPtg.sid :
                retval = new MemErrPtg(data, offset);
                break;

            case AttrPtg.sid :
                retval = new AttrPtg(data, offset);
                break;

            case ValueReferencePtg.sid :
                retval = new ValueReferencePtg(data, offset);
                break;

            case ValueVariableFunctionPtg.sid :
                retval = new ValueVariableFunctionPtg(data, offset);
                break;

            case NamePtg.sid :
                retval = new NamePtg(data, offset);
                break;

            case ExpPtg.sid :
                retval = new ExpPtg(data, offset);
                break;

            default :

                throw new RuntimeException("Unknown PTG = "
                                           + Integer.toHexString(( int ) id)
                                           + " (" + ( int ) id + ")");
        }
        return retval;
    }

    public abstract int getSize();

    public final byte [] getBytes()
    {
        int    size  = getSize();
        byte[] bytes = new byte[ size ];

        writeBytes(bytes, 0);
        return bytes;
    }

    public abstract void writeBytes(byte [] array, int offset);

    public abstract String toFormulaString();

    /**
     * Ptg's should override this
     */

    public int getPrecedence() {
        return 100;
    }

    public int getStringLength() {
        return 0;


@XmlRootElement(name = "jaxb")
@XmlAccessorType(XmlAccessType.FIELD)
public class JaxbDataFormat extends DataFormatType {
    @XmlAttribute(required = false)
    private String contextPath;
    @XmlAttribute(required = false)
    private Boolean prettyPrint;
    @XmlAttribute(required = false)
    private Boolean ignoreJAXBElement;

    public JaxbDataFormat() {
        super("org.apache.camel.converter.jaxb.JaxbDataFormat");
    }

    public JaxbDataFormat(boolean prettyPrint) {
        this();
        setPrettyPrint(prettyPrint);
    }

    public String getContextPath() {
        return contextPath;
    }

    public void setContextPath(String contextPath) {
        this.contextPath = contextPath;
    }

    public Boolean getPrettyPrint() {
        return prettyPrint;
    }

    public void setPrettyPrint(Boolean prettyPrint) {
        this.prettyPrint = prettyPrint;
    }

    public Boolean getIgnoreJAXBElement() {
        return ignoreJAXBElement;
    }

    public void setIgnoreJAXBElement(Boolean ignoreJAXBElement) {
        this.ignoreJAXBElement = ignoreJAXBElement;
    }

    @Override
    protected void configureDataFormat(DataFormat dataFormat) {
        Boolean answer = ObjectHelper.toBoolean(getPrettyPrint());
        if (answer != null && !answer.booleanValue()) {
            setProperty(dataFormat, "prettyPrint", Boolean.FALSE);
            setProperty(dataFormat, "prettyPrint", Boolean.TRUE);
        }
        answer = ObjectHelper.toBoolean(getIgnoreJAXBElement());
        if (answer != null && !answer.booleanValue()) {
            setProperty(dataFormat, "ignoreJAXBElement", Boolean.FALSE);
            setProperty(dataFormat, "ignoreJAXBElement", Boolean.TRUE);
        }
        setProperty(dataFormat, "contextPath", contextPath);


public class TestEndpoint extends MockEndpoint implements Service {
    private static final transient Log LOG = LogFactory.getLog(TestEndpoint.class);
    private final Endpoint expectedMessageEndpoint;
    private long timeout = 2000L;

    public TestEndpoint(String endpointUri, Component component, Endpoint expectedMessageEndpoint) {
        super(endpointUri, component);
        this.expectedMessageEndpoint = expectedMessageEndpoint;
    }

    public TestEndpoint(String endpointUri, Endpoint expectedMessageEndpoint) {
        super(endpointUri);
        this.expectedMessageEndpoint = expectedMessageEndpoint;
    }

    public void start() throws Exception {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Consuming expected messages from: " + expectedMessageEndpoint);
        }
        final List expectedBodies = new ArrayList();
        EndpointHelper.pollEndpoint(expectedMessageEndpoint, new Processor() {
            public void process(Exchange exchange) throws Exception {
                Object body = getInBody(exchange);
                expectedBodies.add(body);
            }
        }, timeout);

        if (LOG.isDebugEnabled()) {
            LOG.debug("Received: " + expectedBodies.size() + " expected message(s) from: " + expectedMessageEndpoint);
        }
        expectedBodiesReceived(expectedBodies);
    }

    public void stop() throws Exception {
    }

    /**
     * This method allows us to convert or coerce the expected message body into some other type
     */
    protected Object getInBody(Exchange exchange) {
        return exchange.getIn().getBody();


public class SimpleRouteBuilder extends RouteBuilder {
    private List<String> fromUris = new ArrayList<String>();
    private List<String> toUris = new ArrayList<String>();
    private Class beanType;
    private String beanClass;
    private String beanRef;
    private String beanMethod;

    public void configure() throws Exception {
        if (fromUris.isEmpty()) {
            throw new IllegalArgumentException("the fromUris property must contain at least one valid URI");
        }
        for (String fromUri : fromUris) {
            ProcessorType route = from(fromUri);

            addBeanCall(route);
            for (String toUri : toUris) {
                route = route.to(toUri);
            }
        }
    }

    public void setFromUri(String uri) {
        setFromUris(singletonList(uri));
    }

    public void setToUri(String uri) {
        setToUris(singletonList(uri));
    }

    public List<String> getFromUris() {
        return fromUris;
    }

    public void setFromUris(List<String> fromUris) {
        this.fromUris = fromUris;
    }

    public List<String> getToUris() {
        return toUris;
    }

    public void setToUris(List<String> toUris) {
        this.toUris = toUris;
    }

    public String getBeanClass() {
        return beanClass;
    }

    public void setBeanClass(String beanClass) {
        this.beanClass = beanClass;
    }

    public String getBeanRef() {
        return beanRef;
    }

    public void setBeanRef(String beanRef) {
        this.beanRef = beanRef;
    }

    public Class getBeanType() {
        if (beanType == null) {
            if (beanClass != null) {
                beanType = ObjectHelper.loadClass(beanClass, getClass().getClassLoader());
            }
        }
        return beanType;
    }

    public void setBeanType(Class beanType) {
        this.beanType = beanType;
    }

    public String getBeanMethod() {
        return beanMethod;
    }

    public void setBeanMethod(String beanMethod) {
        this.beanMethod = beanMethod;
    }

    protected void addBeanCall(ProcessorType route) {
        Class type = getBeanType();
        if (type != null) {
            if (beanMethod != null) {
                route = route.bean(type, beanMethod);
            } else {
                route = route.bean(type);
            }
        } else if (beanRef != null) {
            if (beanMethod != null) {
                route = route.beanRef(beanRef, beanMethod);
            } else {
                route = route.beanRef(beanRef);
            }
        }
    }

    protected List<String> singletonList(String value) {
        List<String> uris = new ArrayList<String>();
        uris.add(value);
        return uris;

FUNC_DECL LOOP IF CALL LOOP VAR_DECL THROW_RAISE CALL CALL CALL LITERAL_ANCHOR ASSIGN CALL

FUNC_DECL RETURN VAR_DECL PARAM CALL CALL


com.microstar.xml.HandlerBase

public class HandlerBase implements XmlHandler {

  /**
    * Handle the start of the document.
    *
The default implementation does nothing.
    * @see com.microstar.xml.XmlHandler#startDocument
    * @exception java.lang.Exception Derived methods may throw exceptions.
    */
  public void startDocument ()
    throws java.lang.Exception
  {
  }

  /**
    * Handle the end of the document.
    *
The default implementation does nothing.
    * @see com.microstar.xml.XmlHandler#endDocument
    * @exception java.lang.Exception Derived methods may throw exceptions.
    */
  public void endDocument ()
    throws java.lang.Exception
  {
  }

  /**
    * Resolve an external entity.
    *
The default implementation simply returns the supplied
    * system identifier.
    * @see com.microstar.xml.XmlHandler#resolveEntity
    * @exception java.lang.Exception Derived methods may throw exceptions.
    */
  public Object resolveEntity (String publicId, String systemId)
    throws java.lang.Exception
  {
    return null;
  }

  /**
    * Handle the start of an external entity.
    *
The default implementation does nothing.
    * @see com.microstar.xml.XmlHandler#startExternalEntity
    * @exception java.lang.Exception Derived methods may throw exceptions.
    */
  public void startExternalEntity (String systemId)
    throws java.lang.Exception
  {
  }

  /**
    * Handle the end of an external entity.
    *
The default implementation does nothing.
    * @see com.microstar.xml.XmlHandler#endExternalEntity
    * @exception java.lang.Exception Derived methods may throw exceptions.
    */
  public void endExternalEntity (String systemId)
    throws java.lang.Exception
  {
  }

  /**
    * Handle a document type declaration.
    *
The default implementation does nothing.
    * @see com.microstar.xml.XmlHandler#doctypeDecl
    * @exception java.lang.Exception Derived methods may throw exceptions.
    */
  public void doctypeDecl (String name, String publicId, String systemId)
    throws java.lang.Exception
  {
  }

  /**
    * Handle an attribute assignment.
    *
The default implementation does nothing.
    * @see com.microstar.xml.XmlHandler#attribute
    * @exception java.lang.Exception Derived methods may throw exceptions.
    */
  public void attribute (String aname, String value, boolean isSpecified)
    throws java.lang.Exception
  {
  }

  /**
    * Handle the start of an element.
    *
The default implementation does nothing.
    * @see com.microstar.xml.XmlHandler#startElement
    * @exception java.lang.Exception Derived methods may throw exceptions.
    */
  public void startElement (String elname)
    throws java.lang.Exception
  {
  }

  /**
    * Handle the end of an element.
    *
The default implementation does nothing.
    * @see com.microstar.xml.XmlHandler#endElement
    * @exception java.lang.Exception Derived methods may throw exceptions.
    */
  public void endElement (String elname)
    throws java.lang.Exception
  {
  }

  /**
    * Handle character data.
    *
The default implementation does nothing.
    * @see com.microstar.xml.XmlHandler#charData
    * @exception java.lang.Exception Derived methods may throw exceptions.
    */
  public void charData (char ch[], int start, int length)
    throws java.lang.Exception
  {
  }

  /**
    * Handle ignorable whitespace.
    *
The default implementation does nothing.
    * @see com.microstar.xml.XmlHandler#ignorableWhitespace
    * @exception java.lang.Exception Derived methods may throw exceptions.
    */
  public void ignorableWhitespace (char ch[], int start, int length)
    throws java.lang.Exception
  {
  }

  /**
    * Handle a processing instruction.
    *
The default implementation does nothing.
    * @see com.microstar.xml.XmlHandler#processingInstruction
    * @exception java.lang.Exception Derived methods may throw exceptions.
    */
  public void processingInstruction (String target, String data)
    throws java.lang.Exception
  {
  }

  /**
    * Throw an exception for a fatal error.
    *
The default implementation throws XmlException.
    * @see com.microstar.xml.XmlHandler#error
    * @exception com.microstar.xml.XmlException A specific parsing error.
    * @exception java.lang.Exception Derived methods may throw exceptions.
    */
  public void error (String message, String systemId, int line, int column)
    throws XmlException, java.lang.Exception
  {
    throw new XmlException(message, systemId, line, column);

FUNC_DECL THROW_RAISE PARAM PARAM PARAM PARAM CALL


public class Field extends Object implements Member
{

  /** Field name, initializer          */
  public String name, initializer = null;

  /** Field modifiers          */
  int modifiers;

  /** Field realfield          */
  java.lang.reflect.Field realfield = null;

  /** Field declaringClass, type          */
  Class declaringClass, type;

  /**
   * Proxy constructor
   *
   * @param realfield
   * @param declaringClass
   */
  public Field(java.lang.reflect.Field realfield,
               org.apache.xml.utils.synthetic.Class declaringClass)
  {

    this(realfield.getName(), declaringClass);

    this.realfield = realfield;
    this.type =
      org.apache.xml.utils.synthetic.Class.forClass(realfield.getType());
  }

  /**
   * Synthesis constructor
   *
   * @param name
   * @param declaringClass
   */
  public Field(String name,
               org.apache.xml.utils.synthetic.Class declaringClass)
  {
    this.name = name;
    this.declaringClass = declaringClass;
  }

  /**
   * Compares this Field against the specified object.
   * Returns true if the objects are the same. Two
   * Fields are the same if they were declared by the
   * same class and have the same name and type.
   *
   * @param obj
   *
   */
  public boolean equals(Object obj)
  {

    if (realfield != null)
      return realfield.equals(obj);
    else if (obj instanceof Field)
    {
      Field objf = (Field) obj;

      return (declaringClass.equals(objf.declaringClass)
              && name.equals(objf.name) && type.equals(objf.type));
    }
    else
      return false;
  }

  /**
   * Returns the value of the field represented by this
   * Field, on the specified object. The value is
   * automatically wrapped in an object if it has a
   * primitive type.
   *

   * The underlying field's value is obtained as follows:
   *

   * If the underlying field is a static field, the object
   * argument is ignored; it may be null.
   *

   * Otherwise, the underlying field is an instance
   * field. If the specified object argument is null, the
   * method throws a NullPointerException. If the
   * specified object is not an instance of the class or
   * interface declaring the underlying field, the
   * method throws an IllegalArgumentException.
   *

   * If this Field object enforces Java language access
   * control, and the underlying field is inaccessible,
   * the method throws an IllegalAccessException.
   *

   * Otherwise, the value is retrieved from the
   * underlying instance or static field. If the field has a
   * primitive type, the value is wrapped in an object
   * before being returned, otherwise it is returned as
   * is.
   *
   *
   * @param obj
   *
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the specified object is not an instance of
   * the class or interface declaring the
   * underlying field.
   * @throws NullPointerException
   * if the specified object is null.
   */
  public Object get(Object obj)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      return realfield.get(obj);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Get the value of a field as a boolean on specified
   * object.
   *
   *
   * @param obj
   *
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the field value cannot be converted to the
   * return type by a widening conversion.
   */
  public boolean getBoolean(Object obj)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      return realfield.getBoolean(obj);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Get the value of a field as a byte on specified
   * object.
   *
   *
   * @param obj
   *
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the field value cannot be converted to the
   * return type by a widening conversion.
   */
  public byte getByte(Object obj)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      return realfield.getByte(obj);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Get the value of a field as a char on specified
   * object.
   *
   *
   * @param obj
   *
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the field value cannot be converted to the
   * return type by a widening conversion.
   */
  public char getChar(Object obj)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      return realfield.getChar(obj);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Returns the Class object representing the class or
   * interface that declares the field represented by this
   * Field object.
   *
   */
  public org.apache.xml.utils.synthetic.Class getDeclaringClass()
  {

    if (realfield != null)
      return org.apache.xml.utils.synthetic.Class.forClass(
        realfield.getDeclaringClass());

    throw new java.lang.IllegalStateException();
  }

  /**
   * Get the value of a field as a double on specified
   * object.
   *
   *
   * @param obj
   *
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the field value cannot be converted to the
   * return type by a widening conversion.
   */
  public double getDouble(Object obj)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      return realfield.getDouble(obj);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Get the value of a field as a float on specified
   * object.
   *
   *
   * @param obj
   *
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the field value cannot be converted to the
   * return type by a widening conversion.
   */
  public float getFloat(Object obj)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      return realfield.getFloat(obj);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Get the value of a field as a int on specified object.
   *
   *
   * @param obj
   *
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the field value cannot be converted to the
   * return type by a widening conversion.
   */
  public int getInt(Object obj)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      return realfield.getInt(obj);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Get the value of a field as a long on specified
   * object.
   *
   *
   * @param obj
   *
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the field value cannot be converted to the
   * return type by a widening conversion.
   */
  public long getLong(Object obj)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      return realfield.getLong(obj);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Returns the Java language modifiers for the field
   * represented by this Field object, as an integer. The
   * Modifier class should be used to decode the
   * modifiers.
   *
   */
  public int getModifiers()
  {

    if (realfield != null)
      modifiers = realfield.getModifiers();

    return modifiers;
  }

  /**
   * Method getInitializer
   *
   *
   * (getInitializer) @return
   */
  public String getInitializer()
  {
    return initializer;
  }

  /**
   * Method setInitializer
   *
   *
   * @param i
   *
   * @throws SynthesisException
   */
  public void setInitializer(String i) throws SynthesisException
  {

    if (realfield != null)
      throw new SynthesisException(SynthesisException.REIFIED);

    initializer = i;
  }

  /**
   * Insert the method's description here.
   * Creation date: (12-25-99 2:02:26 PM)
   * @return java.lang.String
   */
  public java.lang.String getName()
  {
    return name;
  }

  /**
   * Get the value of a field as a short on specified
   * object.
   *
   *
   * @param obj
   *
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the field value cannot be converted to the
   * return type by a widening conversion.
   */
  public short getShort(Object obj)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      return realfield.getShort(obj);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Returns a Class object that identifies the declared
   * type for the field represented by this Field object.
   *
   */
  public Class getType()
  {

    if (realfield != null)
      type = Class.forClass(realfield.getType());

    return type;
  }

  /**
   * Method setType
   *
   *
   * @param type
   *
   * @throws SynthesisException
   */
  public void setType(org.apache.xml.utils.synthetic.Class type)
          throws SynthesisException
  {

    if (realfield != null)
      throw new SynthesisException(SynthesisException.REIFIED);

    this.type = type;
  }

  /**
   * Returns a hashcode for this Field. This is
   * computed as the exclusive-or of the hashcodes for
   * the underlying field's declaring class name and its
   * name.
   *
   */
  public int hashCode()
  {

    if (realfield != null)
      return realfield.hashCode();
    else
      return declaringClass.getName().hashCode() ^ name.hashCode();
  }

  /**
   * Sets the field represented by this Field object on
   * the specified object argument to the specified new
   * value. The new value is automatically unwrapped
   * if the underlying field has a primitive type.
   *
   * The operation proceeds as follows:
   *
   * If the underlying field is static, the object
   * argument is ignored; it may be null.
   *
   * Otherwise the underlying field is an instance field.
   * If the specified object argument is null, the
   * method throws a NullPointerException. If the
   * specified object argument is not an instance of the
   * class or interface declaring the underlying field,
   * the method throws an IllegalArgumentException.
   *
   * If this Field object enforces Java language access
   * control, and the underlying field is inaccessible,
   * the method throws an IllegalAccessException.
   *
   * If the underlying field is final, the method throws
   * an IllegalAccessException.
   *
   * If the underlying field is of a primitive type, an
   * unwrapping conversion is attempted to convert the
   * new value to a value of a primitive type. If this
   * attempt fails, the method throws an
   * IllegalArgumentException.
   *
   * If, after possible unwrapping, the new value
   * cannot be converted to the type of the underlying
   * field by an identity or widening conversion, the
   * method throws an IllegalArgumentException.
   *
   * The field is set to the possibly unwrapped and
   * widened new value.
   *
   *
   * @param obj
   * @param value
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the specified object is not an instance of
   * the class or interface declaring the
   * underlying field, or if an unwrapping
   * conversion fails.
   * @throws NullPointerException
   * if the specified object is null.
   */
  public void set(Object obj, Object value)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      realfield.set(obj, value);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Set the value of a field as a boolean on specified
   * object.
   *
   *
   * @param obj
   * @param z
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the specified object is not an instance of
   * the class or interface declaring the
   * underlying field, or if an unwrapping
   * conversion fails.
   */
  public void setBoolean(Object obj, boolean z)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      realfield.setBoolean(obj, z);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Set the value of a field as a byte on specified
   * object.
   *
   *
   * @param obj
   * @param b
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the specified object is not an instance of
   * the class or interface declaring the
   * underlying field, or if an unwrapping
   * conversion fails.
   */
  public void setByte(Object obj, byte b)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      realfield.setByte(obj, b);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Set the value of a field as a char on specified
   * object.
   *
   *
   * @param obj
   * @param c
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the specified object is not an instance of
   * the class or interface declaring the
   * underlying field, or if an unwrapping
   * conversion fails.
   */
  public void setChar(Object obj, char c)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      realfield.setChar(obj, c);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Returns the Class object representing the class that
   * declares the constructor represented by this
   * Constructor object.
   *
   * @param declaringClass
   */
  public void setDeclaringClass(
          org.apache.xml.utils.synthetic.Class declaringClass)
  {
    this.declaringClass = declaringClass;
  }

  /**
   * Set the value of a field as a double on specified
   * object.
   *
   *
   * @param obj
   * @param d
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the specified object is not an instance of
   * the class or interface declaring the
   * underlying field, or if an unwrapping
   * conversion fails.
   */
  public void setDouble(Object obj, double d)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      realfield.setDouble(obj, d);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Set the value of a field as a float on specified
   * object.
   *
   *
   * @param obj
   * @param f
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the specified object is not an instance of
   * the class or interface declaring the
   * underlying field, or if an unwrapping
   * conversion fails.
   */
  public void setFloat(Object obj, float f)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      realfield.setFloat(obj, f);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Set the value of a field as an int on specified
   * object.
   *
   *
   * @param obj
   * @param i
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the specified object is not an instance of
   * the class or interface declaring the
   * underlying field, or if an unwrapping
   * conversion fails.
   */
  public void setInt(Object obj, int i)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      realfield.setInt(obj, i);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Set the value of a field as a long on specified
   * object.
   *
   *
   * @param obj
   * @param l
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the specified object is not an instance of
   * the class or interface declaring the
   * underlying field, or if an unwrapping
   * conversion fails.
   */
  public void setLong(Object obj, long l)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      realfield.setLong(obj, l);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Insert the method's description here.
   * Creation date: (12-25-99 1:28:28 PM)
   * @return int
   * @param modifiers int
   *
   * @throws SynthesisException
   */
  public void setModifiers(int modifiers) throws SynthesisException
  {

    if (realfield != null)
      throw new SynthesisException(SynthesisException.REIFIED);

    this.modifiers = modifiers;
  }

  /**
   * Set the value of a field as a short on specified
   * object.
   *
   *
   * @param obj
   * @param s
   * @throws IllegalAccessException
   * if the underlying constructor is inaccessible.
   * @throws IllegalArgumentException
   * if the specified object is not an instance of
   * the class or interface declaring the
   * underlying field, or if an unwrapping
   * conversion fails.
   */
  public void setShort(Object obj, short s)
          throws IllegalArgumentException, IllegalAccessException
  {

    if (realfield != null)
      realfield.setShort(obj, s);

    throw new java.lang.IllegalStateException();
  }

  /**
   * Return a string describing this Field. The format is
   * the access modifiers for the field, if any, followed
   * by the field type, followed by a space, followed by
   * the fully-qualified name of the class declaring the
   * field, followed by a period, followed by the name
   * of the field. For example:
   *
   * public static final int java.lang.Thread.MIN_PRIORITY
   * private int java.io.FileDescriptor.fd
   *
   *
   * The modifiers are placed in canonical order as
   * specified by "The Java Language Specification".
   * This is public, protected or private first,
   * and then other modifiers in the following order:
   * static, final, transient, volatile.
   *
   */
  public String toString()
  {

    if (realfield != null)
      return realfield.toString();

    throw new java.lang.IllegalStateException();
  }

  /**
   * Output the Field as Java sourcecode
   *
   */
  public String toSource()
  {

    StringBuffer sb = new StringBuffer(
      java.lang.reflect.Modifier.toString(getModifiers())).append(' ').append(
      getType().getJavaName()).append(' ').append(getName());
    String i = getInitializer();

    if (i != null && i.length() > 0)
      sb.append('=').append(i);

    sb.append(';');

    return sb.toString();

FUNC_DECL PARAM PARAM ASSIGN ASSIGN CALL CALL CALL


org.apache.camel.util.ResolverUtil

public class ResolverUtil<T> {
    protected static final transient Log LOG = LogFactory.getLog(ResolverUtil.class);

    /**
     * A simple interface that specifies how to test classes to determine if
     * they are to be included in the results produced by the ResolverUtil.
     */
    public static interface Test {
        /**
         * Will be called repeatedly with candidate classes. Must return True if
         * a class is to be included in the results, false otherwise.
         */
        boolean matches(Class type);
    }

    /**
     * A Test that checks to see if each class is assignable to the provided
     * class. Note that this test will match the parent type itself if it is
     * presented for matching.
     */
    public static class IsA implements Test {
        private Class parent;

        /**
         * Constructs an IsA test using the supplied Class as the parent
         * class/interface.
         */
        public IsA(Class parentType) {
            this.parent = parentType;
        }

        /**
         * Returns true if type is assignable to the parent type supplied in the
         * constructor.
         */
        public boolean matches(Class type) {
            return type != null && parent.isAssignableFrom(type);
        }

        @Override
        public String toString() {
            return "is assignable to " + parent.getSimpleName();
        }
    }

    /**
     * A Test that checks to see if each class is annotated with a specific
     * annotation. If it is, then the test returns true, otherwise false.
     */
    public static class AnnotatedWith implements Test {
        private Class<? extends Annotation> annotation;
        private boolean checkMetaAnnotations;

        /**
         * Constructs an AnnotatedWith test for the specified annotation type.
         */
        public AnnotatedWith(Class<? extends Annotation> annotation) {
            this(annotation, false);
        }

        /**
         * Constructs an AnnotatedWith test for the specified annotation type.
         */
        public AnnotatedWith(Class<? extends Annotation> annotation, boolean checkMetaAnnotations) {
            this.annotation = annotation;
            this.checkMetaAnnotations = checkMetaAnnotations;
        }

        /**
         * Returns true if the type is annotated with the class provided to the
         * constructor.
         */
        public boolean matches(Class type) {
            return type != null && ObjectHelper.hasAnnotation(type, annotation, checkMetaAnnotations);
        }

        @Override
        public String toString() {
            return "annotated with @" + annotation.getSimpleName();
        }
    }

    /**
     * The set of matches being accumulated.
     */
    private Set<Class<? extends T>> matches = new HashSet<Class<? extends T>>();

    /**
     * The ClassLoader to use when looking for classes. If null then the
     * ClassLoader returned by Thread.currentThread().getContextClassLoader()
     * will be used.
     */
    private Set<ClassLoader> classLoaders;

    /**
     * Provides access to the classes discovered so far. If no calls have been
     * made to any of the {@code find()} methods, this set will be empty.
     *
     * @return the set of classes that have been discovered.
     */
    public Set<Class<? extends T>> getClasses() {
        return matches;
    }

    /**
     * Returns the classloaders that will be used for scanning for classes. If no
     * explicit ClassLoader has been set by the calling, the context class
     * loader will and the one that has loaded this class ResolverUtil be used.
     *
     * @return the ClassLoader instances that will be used to scan for classes
     */
    public Set<ClassLoader> getClassLoaders() {
        if (classLoaders == null) {
            classLoaders = new HashSet<ClassLoader>();
            ClassLoader ccl = Thread.currentThread().getContextClassLoader();
            if (ccl != null) {
                classLoaders.add(ccl);
            }
            classLoaders.add(ResolverUtil.class.getClassLoader());
        }
        return classLoaders;
    }

    /**
     * Sets the ClassLoader instances that should be used when scanning for
     * classes. If none is set then the context classloader will be used.
     *
     * @param classLoaders a ClassLoader to use when scanning for classes
     */
    public void setClassLoaders(Set<ClassLoader> classLoaders) {
        this.classLoaders = classLoaders;
    }

    /**
     * Attempts to discover classes that are assignable to the type provided. In
     * the case that an interface is provided this method will collect
     * implementations. In the case of a non-interface class, subclasses will be
     * collected. Accumulated classes can be accessed by calling
     * {@link #getClasses()}.
     *
     * @param parent       the class of interface to find subclasses or
     *                     implementations of
     * @param packageNames one or more package names to scan (including
     *                     subpackages) for classes
     */
    public void findImplementations(Class parent, String... packageNames) {
        if (packageNames == null) {
            return;
        }

        if (LOG.isDebugEnabled()) {
            LOG.debug("Searching for implementations of " + parent.getName() + " in packages: " + Arrays
                .asList(packageNames));
        }

        Test test = new IsA(parent);
        for (String pkg : packageNames) {
            find(test, pkg);
        }

        if (LOG.isDebugEnabled()) {
            LOG.debug("Found: " + getClasses());
        }
    }

    /**
     * Attempts to discover classes that are annotated with to the annotation.
     * Accumulated classes can be accessed by calling {@link #getClasses()}.
     *
     * @param annotation   the annotation that should be present on matching
     *                     classes
     * @param packageNames one or more package names to scan (including
     *                     subpackages) for classes
     */
    public void findAnnotated(Class<? extends Annotation> annotation, String... packageNames) {
        if (packageNames == null) {
            return;
        }

        if (LOG.isDebugEnabled()) {
            LOG.debug("Searching for annotations of " + annotation.getName() + " in packages: " + Arrays
                .asList(packageNames));
        }

        Test test = new AnnotatedWith(annotation, true);
        for (String pkg : packageNames) {
            find(test, pkg);
        }

        if (LOG.isDebugEnabled()) {
            LOG.debug("Found: " + getClasses());
        }
    }

    /**
     * Scans for classes starting at the package provided and descending into
     * subpackages. Each class is offered up to the Test as it is discovered,
     * and if the Test returns true the class is retained. Accumulated classes
     * can be fetched by calling {@link #getClasses()}.
     *
     * @param test        an instance of {@link Test} that will be used to filter
     *                    classes
     * @param packageName the name of the package from which to start scanning
     *                    for classes, e.g. {@code net.sourceforge.stripes}
     */
    public void find(Test test, String packageName) {
        packageName = packageName.replace('.', '/');

        Set<ClassLoader> set = getClassLoaders();

        LOG.debug("Using only regular classloaders");
        for (ClassLoader classLoader : set) {
            find(test, packageName, classLoader);
        }
    }

    /**
     * Tries to find the reosurce in the package using the class loader.
     *

     * Will handle both plain URL based classloaders and OSGi bundle loaders.
     *
     * @param test what to find
     * @param packageName the package to search in
     * @param loader the class loader
     */
    protected void find(Test test, String packageName, ClassLoader loader) {
        if (LOG.isTraceEnabled()) {
            LOG.trace("Searching for: " + test + " in package: " + packageName + " using classloader: "
                    + loader.getClass().getName());
        }

        Enumeration<URL> urls;
        try {
            urls = getResources(loader, packageName);
            if (!urls.hasMoreElements()) {
                LOG.trace("No URLs returned by classloader");
            }
        } catch (IOException ioe) {
            LOG.warn("Could not read package: " + packageName, ioe);
            return;
        }

        while (urls.hasMoreElements()) {
            URL url = null;
            try {
                url = urls.nextElement();
                if (LOG.isTraceEnabled()) {
                    LOG.trace("URL from classloader: " + url);
                }

                String urlPath = url.getFile();
                urlPath = URLDecoder.decode(urlPath, "UTF-8");
                if (LOG.isTraceEnabled()) {
                    LOG.trace("Decoded urlPath: " + urlPath);
                }

                if (urlPath.startsWith("file:")) {
                    urlPath = urlPath.substring(5);
                }

                if (url.toString().startsWith("bundle:") || urlPath.startsWith("bundle:")) {
                    LOG.trace("It's a virtual osgi bundle, skipping");
                    continue;
                }

                if (urlPath.indexOf('!') > 0) {
                    urlPath = urlPath.substring(0, urlPath.indexOf('!'));
                }

                if (LOG.isTraceEnabled()) {
                    LOG.trace("Scanning for classes in [" + urlPath + "] matching criteria: " + test);
                }

                File file = new File(urlPath);
                if (file.isDirectory()) {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("Loading from directory: " + file);
                    }
                    loadImplementationsInDirectory(test, packageName, file);
                } else {
                    InputStream stream;
                    if (urlPath.startsWith("http:")) {
                        LOG.debug("The current jar is accessed via http");
                        URL urlStream = new URL(urlPath);
                        URLConnection con = urlStream.openConnection();
                        con.setUseCaches(false);
                        stream = con.getInputStream();
                    } else {
                        stream = new FileInputStream(file);
                    }

                    if (LOG.isDebugEnabled()) {
                        LOG.debug("Loading from jar: " + file);
                    }
                    loadImplementationsInJar(test, packageName, stream, urlPath);
                }
            } catch (IOException ioe) {
                LOG.warn("Could not read entries in url: " + url, ioe);
            }
        }
    }

    /**
     * Strategy to get the resources by the given classloader.
     *

     * Notice that in WebSphere platforms there is a {@link org.apache.camel.util.WebSphereResolverUtil}
     * to take care of WebSphere's odditiy of resource loading.
     *
     * @param loader  the classloader
     * @param packageName   the packagename for the package to load
     * @return  URL's for the given package
     * @throws IOException is thrown by the classloader
     */
    protected Enumeration<URL> getResources(ClassLoader loader, String packageName) throws IOException {
        if (LOG.isTraceEnabled()) {
            LOG.trace("Getting resource URL for package: " + packageName + " with classloader: " + loader);
        }
        return loader.getResources(packageName);
    }

    /**
     * Finds matches in a physical directory on a filesystem. Examines all files
     * within a directory - if the File object is not a directory, and ends with
     * .class the file is loaded and tested to see if it is acceptable
     * according to the Test. Operates recursively to find classes within a
     * folder structure matching the package structure.
     *
     * @param test     a Test used to filter the classes that are discovered
     * @param parent   the package name up to this directory in the package
     *                 hierarchy. E.g. if /classes is in the classpath and we wish to
     *                 examine files in /classes/org/apache then the values of
     *                 parent would be org/apache
     * @param location a File object representing a directory
     */
    private void loadImplementationsInDirectory(Test test, String parent, File location) {
        File[] files = location.listFiles();
        StringBuilder builder = null;

        for (File file : files) {
            builder = new StringBuilder(100);
            String name = file.getName();
            if (name != null) {
                name = name.trim();
                builder.append(parent).append("/").append(name);
                String packageOrClass = parent == null ? name : builder.toString();

                if (file.isDirectory()) {
                    loadImplementationsInDirectory(test, packageOrClass, file);
                } else if (name.endsWith(".class")) {
                    addIfMatching(test, packageOrClass);
                }
            }
        }
    }

    /**
     * Finds matching classes within a jar files that contains a folder
     * structure matching the package structure. If the File is not a JarFile or
     * does not exist a warning will be logged, but no error will be raised.
     *
     * @param test    a Test used to filter the classes that are discovered
     * @param parent  the parent package under which classes must be in order to
     *                be considered
     * @param jarfile the jar file to be examined for classes
     * @param stream  the inputstream of the jar file to be examined for classes
     * @param urlPath the url of the jar file to be examined for classes
     */
    private void loadImplementationsInJar(Test test, String parent, InputStream stream, String urlPath) {
        JarInputStream jarStream = null;
        try {
            jarStream = new JarInputStream(stream);

            JarEntry entry;
            while ((entry = jarStream.getNextJarEntry()) != null) {
                String name = entry.getName();
                if (name != null) {
                    name = name.trim();
                    if (!entry.isDirectory() && name.startsWith(parent) && name.endsWith(".class")) {
                        addIfMatching(test, name);
                    }
                }
            }
        } catch (IOException ioe) {
            LOG.error("Could not search jar file '" + urlPath + "' for classes matching criteria: " + test
                + " due to an IOException: " + ioe.getMessage(), ioe);
        } finally {
            ObjectHelper.close(jarStream, urlPath, LOG);
        }
    }

    /**
     * Add the class designated by the fully qualified class name provided to
     * the set of resolved classes if and only if it is approved by the Test
     * supplied.
     *
     * @param test the test used to determine if the class matches
     * @param fqn  the fully qualified name of a class
     */
    protected void addIfMatching(Test test, String fqn) {
        try {
            String externalName = fqn.substring(0, fqn.indexOf('.')).replace('/', '.');
            Set<ClassLoader> set = getClassLoaders();
            boolean found = false;
            for (ClassLoader classLoader : set) {
                if (LOG.isTraceEnabled()) {
                    LOG.trace("Testing for class " + externalName + " matches criteria [" + test + "]");
                }
                try {
                    Class type = classLoader.loadClass(externalName);
                    if (test.matches(type)) {
                        if (LOG.isTraceEnabled()) {
                            LOG.trace("Found class: " + type + " in classloader: " + classLoader);
                        }
                        matches.add((Class<T>)type);
                    }
                    found = true;
                    break;
                } catch (ClassNotFoundException e) {
                    LOG.debug("Could not find class '" + fqn + "' in classloader: " + classLoader
                        + ". Reason: " + e, e);
                } catch (NoClassDefFoundError e) {
                    LOG.debug("Could not find the class defintion '" + fqn + "' in classloader: " + classLoader
                              + ". Reason: " + e, e);
                }
            }
            if (!found) {
                LOG.warn("Could not find class '" + fqn + "' in any classloaders: " + set);
            }
        } catch (Throwable t) {
            LOG.warn("Could not examine class '" + fqn + "' due to a " + t.getClass().getName()
                + " with message: " + t.getMessage(), t);


public class MulBlankRecord
    extends Record
{
    public final static short sid = 0xbe;
    private int             field_1_row;
    private short             field_2_first_col;
    private short[]           field_3_xfs;
    private short             field_4_last_col;

    /** Creates new MulBlankRecord */

    public MulBlankRecord()
    {
    }

    /**
     * Constructs a MulBlank record and sets its fields appropriately.
     *
     * @param id     id must be 0xbe or an exception will be throw upon validation
     * @param size  the size of the data area of the record
     * @param data  data of the record (should not contain sid/len)
     */

    public MulBlankRecord(short id, short size, byte [] data)
    {
        super(id, size, data);
    }

    /**
     * Constructs a MulBlank record and sets its fields appropriately.
     *
     * @param id     id must be 0xbe or an exception will be throw upon validation
     * @param size  the size of the data area of the record
     * @param data  data of the record (should not contain sid/len)
     * @param offset of the record's data
     */

    public MulBlankRecord(short id, short size, byte [] data, int offset)
    {
        super(id, size, data, offset);
    }

    /**
     * get the row number of the cells this represents
     *
     * @return row number
     */

    public int getRow()
    {
        return field_1_row;
    }

    /**
     * starting column (first cell this holds in the row)
     * @return first column number
     */

    public short getFirstColumn()
    {
        return field_2_first_col;
    }

    /**
     * ending column (last cell this holds in the row)
     * @return first column number
     */

    public short getLastColumn()
    {
        return field_4_last_col;
    }

    /**
     * get the number of columns this contains (last-first +1)
     * @return number of columns (last - first +1)
     */

    public int getNumColumns()
    {
        return field_4_last_col - field_2_first_col + 1;
    }

    /**
     * returns the xf index for column (coffset = column - field_2_first_col)
     * @param coffset  the column (coffset = column - field_2_first_col)
     * @return the XF index for the column
     */

    public short getXFAt(int coffset)
    {
        return field_3_xfs[ coffset ];
    }

    /**
     * called by the constructor, should set class level fields.  Should throw
     * runtime exception for bad/icomplete data.
     *
     * @param data raw data
     * @param size size of data
     */

    protected void fillFields(byte [] data, short size, int offset)
    {
        field_1_row       = LittleEndian.getUShort(data, 0 + offset);
        field_2_first_col = LittleEndian.getShort(data, 2 + offset);
        field_3_xfs       = parseXFs(data, 4, offset, size);
        field_4_last_col  = LittleEndian.getShort(data,
                                                  (field_3_xfs.length * 2)
                                                  + 4 + offset);
    }

    private short [] parseXFs(byte [] data, int offset, int recoffset,
                              short size)
    {
        short[] retval = new short[ ((size - offset) - 2) / 2 ];
        int     idx    = 0;

        for (; offset < size - 2; )
        {
            short xf = 0;

            xf            = LittleEndian.getShort(data, offset + recoffset);
            offset        += 2;
            retval[ idx ] = xf;
            idx++;
        }
        return retval;
    }

    public String toString()
    {
        StringBuffer buffer = new StringBuffer();

        buffer.append("[MULBLANK]\n");
        buffer.append("row  = ")
            .append(Integer.toHexString(getRow())).append("\n");
        buffer.append("firstcol  = ")
            .append(Integer.toHexString(getFirstColumn())).append("\n");
        buffer.append(" lastcol  = ")
            .append(Integer.toHexString(getLastColumn())).append("\n");
        for (int k = 0; k < getNumColumns(); k++)
        {
            buffer.append("xf").append(k).append("        = ")
                .append(Integer.toHexString(getXFAt(k))).append("\n");
        }
        buffer.append("[/MULBLANK]\n");
        return buffer.toString();
    }

    /**
     * called by constructor, should throw runtime exception in the event of a
     * record passed with a differing ID.
     *
     * @param id alleged id for this record
     */

    protected void validateSid(short id)
    {
        if (id != sid)
        {
            throw new RecordFormatException("Not a MulBlankRecord!");
        }
    }

    public short getSid()
    {
        return this.sid;
    }

    public int serialize(int offset, byte [] data)
    {
        throw new RecordFormatException(
            "Sorry, you can't serialize a MulBlank in this release");


public class Files extends AbstractSelectorContainer
    implements Cloneable, ResourceCollection {

    private static final Iterator EMPTY_ITERATOR
        = Collections.EMPTY_SET.iterator();

    private PatternSet defaultPatterns = new PatternSet();
    private Vector additionalPatterns = new Vector();
    private Vector selectors = new Vector();

    private boolean useDefaultExcludes = true;
    private boolean caseSensitive = true;
    private boolean followSymlinks = true;

    /* cached DirectoryScanner instance */
    private DirectoryScanner ds = null;

    /**
     * Construct a new Files collection.
     */
    public Files() {
        super();
    }

    /**
     * Construct a new Files collection, shallowly cloned
     * from the specified Files.
     * @param f the Files to use as a template.
     */
    protected Files(Files f) {
        this.defaultPatterns = f.defaultPatterns;
        this.additionalPatterns = f.additionalPatterns;
        this.selectors = f.selectors;
        this.useDefaultExcludes = f.useDefaultExcludes;
        this.caseSensitive = f.caseSensitive;
        this.followSymlinks = f.followSymlinks;
        this.ds = f.ds;
        setProject(f.getProject());
    }

    /**
     * Make this instance in effect a reference to another instance.
     *
     *
You must not set another attribute or nest elements inside
     * this element if you make it a reference.

     * @param r the Reference to use.
     * @throws BuildException if there is a problem.
     */
    public void setRefid(Reference r) throws BuildException {
        if (hasPatterns(defaultPatterns)) {
            throw tooManyAttributes();
        }
        if (!additionalPatterns.isEmpty()) {
            throw noChildrenAllowed();
        }
        if (!selectors.isEmpty()) {
            throw noChildrenAllowed();
        }
        super.setRefid(r);
    }

    /**
     * Create a nested patternset.
     * @return PatternSet.
     */
    public synchronized PatternSet createPatternSet() {
        if (isReference()) {
            throw noChildrenAllowed();
        }
        PatternSet patterns = new PatternSet();
        additionalPatterns.addElement(patterns);
        ds = null;
        return patterns;
    }

    /**
     * Add a name entry to the include list.
     * @return PatternSet.NameEntry.
     */
    public synchronized PatternSet.NameEntry createInclude() {
        if (isReference()) {
            throw noChildrenAllowed();
        }
        ds = null;
        return defaultPatterns.createInclude();
    }

    /**
     * Add a name entry to the include files list.
     * @return PatternSet.NameEntry.
     */
    public synchronized PatternSet.NameEntry createIncludesFile() {
        if (isReference()) {
            throw noChildrenAllowed();
        }
        ds = null;
        return defaultPatterns.createIncludesFile();
    }

    /**
     * Add a name entry to the exclude list.
     * @return PatternSet.NameEntry.
     */
    public synchronized PatternSet.NameEntry createExclude() {
        if (isReference()) {
            throw noChildrenAllowed();
        }
        ds = null;
        return defaultPatterns.createExclude();
    }

    /**
     * Add a name entry to the excludes files list.
     * @return PatternSet.NameEntry.
     */
    public synchronized PatternSet.NameEntry createExcludesFile() {
        if (isReference()) {
            throw noChildrenAllowed();
        }
        ds = null;
        return defaultPatterns.createExcludesFile();
    }

    /**
     * Append includes to the current list of include
     * patterns.
     *
     *
Patterns may be separated by a comma or a space.

     *
     * @param includes the String containing the include patterns.
     */
    public synchronized void setIncludes(String includes) {
        checkAttributesAllowed();
        defaultPatterns.setIncludes(includes);
        ds = null;
    }

    /**
     * Append includes to the current list of include
     * patterns.
     *
     * @param includes array containing the include patterns.
     */
    public synchronized void appendIncludes(String[] includes) {
        checkAttributesAllowed();
        if (includes != null) {
            for (int i = 0; i < includes.length; i++) {
                defaultPatterns.createInclude().setName(includes[i]);
            }
            ds = null;
        }
    }

    /**
     * Append excludes to the current list of exclude
     * patterns.
     *
     *
Patterns may be separated by a comma or a space.

     *
     * @param excludes the String containing the exclude patterns.
     */
    public synchronized void setExcludes(String excludes) {
        checkAttributesAllowed();
        defaultPatterns.setExcludes(excludes);
        ds = null;
    }

    /**
     * Append excludes to the current list of include
     * patterns.
     *
     * @param excludes array containing the exclude patterns.
     */
    public synchronized void appendExcludes(String[] excludes) {
        checkAttributesAllowed();
        if (excludes != null) {
            for (int i = 0; i < excludes.length; i++) {
                defaultPatterns.createExclude().setName(excludes[i]);
            }
            ds = null;
        }
    }

    /**
     * Set the File containing the includes patterns.
     *
     * @param incl File instance.
     * @throws BuildException if there is a problem.
     */
    public synchronized void setIncludesfile(File incl) throws BuildException {
        checkAttributesAllowed();
        defaultPatterns.setIncludesfile(incl);
        ds = null;
    }

    /**
     * Set the File containing the excludes patterns.
     *
     * @param excl File instance.
     * @throws BuildException if there is a problem.
     */
    public synchronized void setExcludesfile(File excl) throws BuildException {
        checkAttributesAllowed();
        defaultPatterns.setExcludesfile(excl);
        ds = null;
    }

    /**
     * Set whether default exclusions should be used or not.
     *
     * @param useDefaultExcludes boolean.
     */
    public synchronized void setDefaultexcludes(boolean useDefaultExcludes) {
        checkAttributesAllowed();
        this.useDefaultExcludes = useDefaultExcludes;
        ds = null;
    }

    /**
     * Get whether default exclusions should be used or not.
     * @return the defaultexclusions value.
     */
    public synchronized boolean getDefaultexcludes() {
        return (isReference())
            ? getRef().getDefaultexcludes() : useDefaultExcludes;
    }

    /**
     * Set case-sensitivity of the Files collection.
     *
     * @param caseSensitive boolean.
     */
    public synchronized void setCaseSensitive(boolean caseSensitive) {
        checkAttributesAllowed();
        this.caseSensitive = caseSensitive;
        ds = null;
    }

    /**
     * Find out if this Files collection is case-sensitive.
     *
     * @return boolean indicating whether the Files
     * collection is case-sensitive.
     */
    public synchronized boolean isCaseSensitive() {
        return (isReference())
            ? getRef().isCaseSensitive() : caseSensitive;
    }

    /**
     * Set whether or not symbolic links should be followed.
     *
     * @param followSymlinks whether or not symbolic links should be followed.
     */
    public synchronized void setFollowSymlinks(boolean followSymlinks) {
        checkAttributesAllowed();
        this.followSymlinks = followSymlinks;
        ds = null;
    }

    /**
     * Find out whether symbolic links should be followed.
     *
     * @return boolean indicating whether symbolic links
     *         should be followed.
     */
    public synchronized boolean isFollowSymlinks() {
        return (isReference())
            ? getRef().isFollowSymlinks() : followSymlinks;
    }

    /**
     * Fulfill the ResourceCollection contract.
     * @return an Iterator of Resources.
     */
    public synchronized Iterator iterator() {
        if (isReference()) {
            return getRef().iterator();
        }
        ensureDirectoryScannerSetup();
        ds.scan();
        int fct = ds.getIncludedFilesCount();
        int dct = ds.getIncludedDirsCount();
        if (fct + dct == 0) {
            return EMPTY_ITERATOR;
        }
        FileResourceIterator result = new FileResourceIterator();
        if (fct > 0) {
            result.addFiles(ds.getIncludedFiles());
        }
        if (dct > 0) {
            result.addFiles(ds.getIncludedDirectories());
        }
        return result;
    }

    /**
     * Fulfill the ResourceCollection contract.
     * @return number of elements as int.
     */
    public synchronized int size() {
        if (isReference()) {
            return getRef().size();
        }
        ensureDirectoryScannerSetup();
        ds.scan();
        return ds.getIncludedFilesCount() + ds.getIncludedDirsCount();
    }

    /**
     * Find out whether this Files collection has patterns.
     *
     * @return whether any patterns are in this container.
     */
    public synchronized boolean hasPatterns() {
        if (isReference()) {
            return getRef().hasPatterns();
        }
        if (hasPatterns(defaultPatterns)) {
            return true;
        }
        for (Iterator i = additionalPatterns.iterator(); i.hasNext();) {
            if (hasPatterns((PatternSet) i.next())) {
                return true;
            }
        }
        return false;
    }

    /**
     * Add a new selector into this container.
     *
     * @param selector the new FileSelector to add.
     */
    public synchronized void appendSelector(FileSelector selector) {
        if (isReference()) {
            throw noChildrenAllowed();
        }
        super.appendSelector(selector);
        ds = null;
    }

    /**
     * Format this Files collection as a String.
     * @return a descriptive String.
     */
    public String toString() {
        if (isReference()) {
            return getRef().toString();
        }
        Iterator i = iterator();
        if (!i.hasNext()) {
            return "";
        }
        StringBuffer sb = new StringBuffer();
        while (i.hasNext()) {
            if (sb.length() > 0) {
                sb.append(File.pathSeparatorChar);
            }
            sb.append(i.next());
        }
        return sb.toString();
    }

    /**
     * Create a deep clone of this instance, except for the nested selectors
     * (the list of selectors is a shallow clone of this instance's list).
     * @return a cloned Object.
     */
    public synchronized Object clone() {
        if (isReference()) {
            return getRef().clone();
        }
        try {
            Files f = (Files) super.clone();
            f.defaultPatterns = (PatternSet) defaultPatterns.clone();
            f.additionalPatterns = new Vector(additionalPatterns.size());
            for (Iterator iter = additionalPatterns.iterator(); iter.hasNext();) {
                PatternSet ps = (PatternSet) iter.next();
                f.additionalPatterns.add(ps.clone());
            }
            f.selectors = new Vector(selectors);
            return f;
        } catch (CloneNotSupportedException e) {
            throw new BuildException(e);
        }
    }

    /**
     * Get the merged include patterns for this Files collection.
     * @param p Project instance.
     * @return the include patterns of the default pattern set and all
     * nested patternsets.
     */
    public String[] mergeIncludes(Project p) {
        return mergePatterns(p).getIncludePatterns(p);
    }

    /**
     * Get the merged exclude patterns for this Files collection.
     * @param p Project instance.
     * @return the exclude patterns of the default pattern set and all
     * nested patternsets.
     */
    public String[] mergeExcludes(Project p) {
        return mergePatterns(p).getExcludePatterns(p);
    }

    /**
     * Get the merged patterns for this Files collection.
     * @param p Project instance.
     * @return the default patternset merged with the additional sets
     * in a new PatternSet instance.
     */
    public synchronized PatternSet mergePatterns(Project p) {
        if (isReference()) {
            return getRef().mergePatterns(p);
        }
        PatternSet ps = new PatternSet();
        ps.append(defaultPatterns, p);
        final int count = additionalPatterns.size();
        for (int i = 0; i < count; i++) {
            Object o = additionalPatterns.elementAt(i);
            ps.append((PatternSet) o, p);
        }
        return ps;
    }

    /**
     * Always returns true.
     * @return true indicating that all elements of a Files collection
     *              will be FileResources.
     */
    public boolean isFilesystemOnly() {
        return true;
    }

    /**
     * Perform the check for circular references and return the
     * referenced Files collection.
     * @return FileCollection.
     */
    protected Files getRef() {
        return (Files) getCheckedRef();
    }

    private synchronized void ensureDirectoryScannerSetup() {
        if (ds == null) {
            ds = new DirectoryScanner();
            PatternSet ps = mergePatterns(getProject());
            ds.setIncludes(ps.getIncludePatterns(getProject()));
            ds.setExcludes(ps.getExcludePatterns(getProject()));
            ds.setSelectors(getSelectors(getProject()));
            if (useDefaultExcludes) {
                ds.addDefaultExcludes();
            }
            ds.setCaseSensitive(caseSensitive);
            ds.setFollowSymlinks(followSymlinks);
        }
    }

    private boolean hasPatterns(PatternSet ps) {
        String[] includePatterns = ps.getIncludePatterns(getProject());
        String[] excludePatterns = ps.getExcludePatterns(getProject());
        return (includePatterns != null && includePatterns.length > 0)
            || (includePatterns != null && excludePatterns.length > 0);

FUNC_DECL IF IF IF PARAM CALL CALL CALL THROW_RAISE THROW_RAISE THROW_RAISE CALL CALL CALL

FUNC_DECL RETURN IF CALL ASSIGN CALL LITERAL_ANCHOR THROW_RAISE CALL

FUNC_DECL PARAM ASSIGN CALL CALL LITERAL_ANCHOR

FUNC_DECL PARAM ASSIGN ASSIGN CALL LITERAL_ANCHOR

FUNC_DECL RETURN COND_EXPR CALL CALL CALL

FUNC_DECL RETURN IF BINARY_OP CALL CALL CALL CALL CALL RETURN CALL CALL

FUNC_DECL RETURN LOOP IF IF LITERAL_ANCHOR CALL CALL CALL IF RETURN RETURN CALL CALL LITERAL_ANCHOR CALL RETURN CALL LITERAL_ANCHOR CALL

FUNC_DECL RETURN LOOP VAR_DECL IF VAR_DECL IF CALL CALL CALL CALL IF CALL RETURN CALL RETURN CALL BINARY_OP LITERAL_ANCHOR CALL CALL LITERAL_ANCHOR CALL CALL CALL

FUNC_DECL TRY IF CATCH RETURN LOOP VAR_DECL CALL THROW_RAISE ASSIGN CALL ASSIGN ASSIGN RETURN CALL CALL VAR_DECL CALL CALL CALL CALL CALL CALL CALL CALL CALL

FUNC_DECL RETURN LOOP VAR_DECL VAR_DECL IF PARAM BINARY_OP CALL CALL VAR_DECL CALL CALL RETURN CALL LITERAL_ANCHOR CALL CALL CALL

FUNC_DECL IF BINARY_OP IF VAR_DECL LITERAL_ANCHOR CALL CALL CALL CALL CALL ASSIGN CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL

FUNC_DECL PARAM CALL ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN CALL


bsh.ConsoleInterface

public interface ConsoleInterface {
	public Reader getIn();
	public PrintStream getOut();
	public PrintStream getErr();
	public void println( String s );
	public void print( String s );
	public void error( String s );