public class Method extends EntryPoint implements Member
{

  /**
   * Insert the method's description here.
   *

   * Creation date: (12-27-99 2:31:39 PM)
   * @param realConstructor java.lang.reflect.Constructor
   *
   * @param name
   * @param declaringclass
   */
  public Method(String name,
                org.apache.xml.utils.synthetic.Class declaringclass)
  {

    super(declaringclass);

    this.name = name;
  }

  /**
   * Insert the method's description here.
   *

   * Creation date: (12-27-99 2:31:39 PM)
   * @param realConstructor java.lang.reflect.Constructor
   *
   * @param ctor
   * @param declaringclass
   */
  public Method(java.lang.reflect.Method ctor,
                org.apache.xml.utils.synthetic.Class declaringclass)
  {
    super(ctor, declaringclass);
  }

  /**
   * Insert the method's description here.
   *

   * Creation date: (12-27-99 2:31:39 PM)
   * @param realConstructor java.lang.reflect.Constructor
   *
   * @param realmethod
   */
  public Method(java.lang.reflect.Method realmethod)
  {
    super(realmethod);
  }

  /**
   * Returns a hashcode for this Method. The hashcode
   * is computed as the exclusive-or of the hashcodes
   * for the underlying method's declaring class name
   * and the method's name.
   *
   */

  /**
   * Returns a hashcode for this Constructor. The
   * hashcode for a Method is the hashcode for the
   * underlying constructor's declaring class name,
   * XORed with the name of this method.
   */
  public int hashCode()
  {
    return getDeclaringClass().getName().hashCode() ^ getName().hashCode();
  }

  /**
   * Invokes the underlying method represented by this
   * Method object, on the specified object with the
   * specified parameters. Individual parameters are
   * automatically unwrapped to match primitive
   * formal parameters, and both primitive and
   * reference parameters are subject to widening
   * conversions as necessary. The value returned by
   * the underlying method is automatically wrapped
   * in an object if it has a primitive type.
   *
   * Method invocation proceeds with the following
   * steps, in order:
   *
   * If the underlying method is static, then the
   * specified object argument is ignored. It may be
   * null.
   *
   * Otherwise, the method is an instance method. If
   * the specified object argument is null, the
   * invocation throws a NullPointerException.
   * Otherwise, if the specified object argument is not
   * an instance of the class or interface declaring the
   * underlying method, the invocation throws an
   * IllegalArgumentException.
   *
   * If this Method object enforces Java language access
   * control and the underlying method is inaccessible,
   * the invocation throws an IllegalAccessException.
   *
   * If the number of actual parameters supplied via
   * args is different from the number of formal
   * parameters required by the underlying method, the
   * invocation throws an IllegalArgumentException.
   *
   * For each actual parameter in the supplied args
   * array:
   *
   * If the corresponding formal parameter has a
   * primitive type, an unwrapping conversion is
   * attempted to convert the object value to a value of
   * a primitive type. If this attempt fails, the
   * invocation throws an IllegalArgumentException.
   *
   * If, after possible unwrapping, the parameter value
   * cannot be converted to the corresponding formal
   * parameter type by an identity or widening
   * conversion, the invocation throws an
   * IllegalArgumentException.
   *
   * If the underlying method is an instance method, it
   * is invoked using dynamic method lookup as
   * documented in The Java Language Specification,
   * section 15.11.4.4; in particular, overriding based
   * on the runtime type of the target object will occur.
   *
   * If the underlying method is static, it is invoked as
   * exactly the method on the declaring class.
   *
   * Control transfers to the underlying method. If the
   * method completes abruptly by throwing an
   * exception, the exception is placed in an
   * InvocationTargetException and thrown in turn to
   * the caller of invoke.
   *
   * If the method completes normally, the value it
   * returns is returned to the caller of invoke; if the
   * value has a primitive type, it is first appropriately
   * wrapped in an object. If the underlying method
   * return type is void, the invocation returns null.
   *
   * Throws: IllegalAccessException
   * if the underlying method is inaccessible.
   * Throws: IllegalArgumentException
   * if the number of actual and formal
   * parameters differ, or if an unwrapping
   * conversion fails.
   * Throws: InvocationTargetException
   * if the underlying method throws an
   * exception.
   * Throws: NullPointerException
   * if the specified object is null.
   *
   * @param obj
   * @param args
   *
   *
   * @throws IllegalAccessException
   * @throws IllegalArgumentException
   * @throws java.lang.reflect.InvocationTargetException
   */
  public Object invoke(Object obj, Object args[])
          throws IllegalAccessException, IllegalArgumentException,
                 java.lang.reflect.InvocationTargetException
  {

    if (realep != null)
      return ((java.lang.reflect.Method) realep).invoke(obj, args);
    else
      throw new IllegalAccessException(
        "Un-reified org.apache.xml.utils.synthetic.Class doesn't yet support invocation");
  }

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

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

    this.returntype = returntype;

FUNC_DECL RETURN BINARY_OP CALL CALL CALL CALL CALL


public class ClasspathUtils {

    /**
     * Name of the magic property that controls classloader reuse in Ant 1.4.
     */
    public static final String REUSE_LOADER_REF = MagicNames.REFID_CLASSPATH_REUSE_LOADER;

    /**
     * Convenience overloaded version of {@link
     * #getClassLoaderForPath(Project, Reference, boolean)}.
     *
     *
Assumes the logical 'false' for the reverseLoader.

     *
     * @param p the project
     * @param ref the reference
     * @return The class loader
     */
    public static ClassLoader getClassLoaderForPath(
        Project p, Reference ref) {

        return getClassLoaderForPath(p, ref, false);
    }

    /**
     * Convenience overloaded version of {@link #getClassLoaderForPath(Project, Path,
     * String, boolean)}.
     *
     *
Delegates to the other one after extracting the referenced
     * Path from the Project. This checks also that the passed
     * Reference is pointing to a Path all right.

     * @param p current Ant project
     * @param ref Reference to Path structure
     * @param reverseLoader if set to true this new loader will take
     * precedence over its parent (which is contra the regular
     * classloader behaviour)
     * @return The class loader
     */
    public static ClassLoader getClassLoaderForPath(
        Project p, Reference ref, boolean reverseLoader) {

        String pathId = ref.getRefId();
        Object path = p.getReference(pathId);
        if (!(path instanceof Path)) {
            throw new BuildException(
                "The specified classpathref "
                    + pathId
                    + " does not reference a Path.");
        }
        String loaderId = MagicNames.REFID_CLASSPATH_LOADER_PREFIX + pathId;
        return getClassLoaderForPath(p, (Path) path, loaderId, reverseLoader);
    }

    /**
     * Convenience overloaded version of {@link
     * #getClassLoaderForPath(Project, Path, String, boolean)}.
     *
     *
Assumes the logical 'false' for the reverseLoader.

     *
     * @param p current Ant project
     * @param path the path
     * @param loaderId the loader id string
     * @return The class loader
     */
    public static ClassLoader getClassLoaderForPath(
        Project p, Path path, String loaderId) {

        return getClassLoaderForPath(p, path, loaderId, false);
    }

    /**
     * Convenience overloaded version of {@link
     * #getClassLoaderForPath(Project, Path, String, boolean, boolean)}.
     *
     *
Sets value for 'reuseLoader' to true if the magic property
     * has been set.

     *
     * @param p the project
     * @param path the path
     * @param loaderId the loader id string
     * @param reverseLoader if set to true this new loader will take
     * precedence over its parent (which is contra the regular
     * classloader behaviour)
     * @return The class loader
     */
    public static ClassLoader getClassLoaderForPath(
        Project p, Path path, String loaderId, boolean reverseLoader) {
        return getClassLoaderForPath(p, path, loaderId, reverseLoader,
                                     isMagicPropertySet(p));
    }

    /**
     * Gets a classloader that loads classes from the classpath
     * defined in the path argument.
     *
     *
Based on the setting of the magic property
     * 'ant.reuse.loader' this will try to reuse the previously
     * created loader with that id, and of course store it there upon
     * creation.

     * @param p             Ant Project where the handled components are living in.
     * @param path          Path object to be used as classpath for this classloader
     * @param loaderId      identification for this Loader,
     * @param reverseLoader if set to true this new loader will take
     *                      precedence over its parent (which is contra the regular
     *                      classloader behaviour)
     * @param reuseLoader   if true reuse the loader if it is found
     * @return              ClassLoader that uses the Path as its classpath.
     */
    public static ClassLoader getClassLoaderForPath(
        Project p, Path path, String loaderId, boolean reverseLoader,
        boolean reuseLoader) {

        ClassLoader cl = null;

        if (loaderId != null && reuseLoader) {
            Object reusedLoader = p.getReference(loaderId);
            if (reusedLoader != null
                && !(reusedLoader instanceof ClassLoader)) {
                throw new BuildException("The specified loader id " + loaderId
                    + " does not reference a class loader");
            }
            cl = (ClassLoader) reusedLoader;
        }
        if (cl == null) {
            cl = getUniqueClassLoaderForPath(p, path, reverseLoader);
            if (loaderId != null && reuseLoader) {
                p.addReference(loaderId, cl);
            }
        }
        return cl;
    }

    /**
     * Gets a fresh, different, previously unused classloader that uses the
     * passed path as its classpath.
     *
     *
This method completely ignores the ant.reuse.loader magic
     * property and should be used with caution.

     * @param p             Ant Project where the handled components are living in.
     * @param path          the classpath for this loader
     * @param reverseLoader if set to true this new loader will take
     *                      precedence over its parent (which is contra the regular
     *                      classloader behaviour)
     * @return The fresh, different, previously unused class loader.
     */
    public static ClassLoader getUniqueClassLoaderForPath(
        Project p,
        Path path,
        boolean reverseLoader) {
        AntClassLoader acl = p.createClassLoader(path);
        if (reverseLoader) {
            acl.setParentFirst(false);
            acl.addJavaLibraries();
        }
        return acl;
    }

    /**
     * Creates a fresh object instance of the specified classname.
     *
     *
 This uses the userDefinedLoader to load the specified class,
     * and then makes an instance using the default no-argument constructor.
     *

     *
     * @param className the full qualified class name to load.
     * @param userDefinedLoader the classloader to use.
     * @return The fresh object instance
     * @throws BuildException when loading or instantiation failed.
     */
    public static Object newInstance(
            String className,
            ClassLoader userDefinedLoader) {
        return newInstance(className, userDefinedLoader, Object.class);
    }

    /**
     * Creates a fresh object instance of the specified classname.
     *
     *
 This uses the userDefinedLoader to load the specified class,
     * and then makes an instance using the default no-argument constructor.
     *

     *
     * @param className the full qualified class name to load.
     * @param userDefinedLoader the classloader to use.
     * @param expectedType the Class that the result should be assignment
     * compatible with. (No ClassCastException will be thrown in case
     * the result of this method is casted to the expectedType)
     * @return The fresh object instance
     * @throws BuildException when loading or instantiation failed.
     * @since Ant 1.7
     */
    public static Object newInstance(
        String className,
        ClassLoader userDefinedLoader,
        Class expectedType) {
        try {
            Class clazz = Class.forName(className, true, userDefinedLoader);
            Object o = clazz.newInstance();
            if (!expectedType.isInstance(o)) {
                throw new BuildException(
                    "Class of unexpected Type: "
                        + className
                        + " expected :"
                        + expectedType);
            }
            return o;
        } catch (ClassNotFoundException e) {
            throw new BuildException(
                "Class not found: "
                    + className,
                e);
        } catch (InstantiationException e) {
            throw new BuildException(
                "Could not instantiate "
                    + className
                    + ". Specified class should have a no "
                    + "argument constructor.",
                e);
        } catch (IllegalAccessException e) {
            throw new BuildException(
                "Could not instantiate "
                    + className
                    + ". Specified class should have a "
                    + "public constructor.",
                e);
        } catch (LinkageError e) {
            throw new BuildException(
                "Class "
                    + className
                    + " could not be loaded because of an invalid dependency.",
                e);
        }
    }

    /**
     * Obtains a delegate that helps out with classic classpath configuration.
     *
     * @param component your projectComponent that needs the assistence
     * @return the helper, delegate.
     * @see ClasspathUtils.Delegate
     */
    public static Delegate getDelegate(ProjectComponent component) {
        return new Delegate(component);
    }

    /**
     * Checks for the magic property that enables class loader reuse
     * for <taskdef> and <typedef> in Ant 1.5 and earlier.
     */
    private static boolean isMagicPropertySet(Project p) {
        return p.getProperty(REUSE_LOADER_REF) != null;
    }

    /**
     * Delegate that helps out any specific ProjectComponent that needs
     * dynamic classloading.
     *
     *
Ant ProjectComponents that need a to be able to dynamically load
     * Classes and instantiate them often expose the following ant syntax
     * sugar:

     *
     *

 nested <classpath>

     *
 attribute @classpathref

     *
 attribute @classname

     *
     *
 This class functions as a delegate handling the configuration
     * issues for this recurring pattern.  Its usage pattern, as the name
     * suggests, is delegation rather than inheritance.

     *
     * @since Ant 1.6
     */
    public static class Delegate {
        private final ProjectComponent component;
        private Path classpath;
        private String classpathId;
        private String className;
        private String loaderId;
        private boolean reverseLoader = false;

        /**
         * Construct a Delegate
         * @param component the ProjectComponent this delegate is for.
         */
        Delegate(ProjectComponent component) {
            this.component = component;
        }

        /**
         * This method is a Delegate method handling the @classpath attribute.
         *
         *
This attribute can set a path to add to the classpath.

         *
         * @param classpath the path to use for the classpath.
         */
        public void setClasspath(Path classpath) {
            if (this.classpath == null) {
                this.classpath = classpath;
            } else {
                this.classpath.append(classpath);
            }
        }

        /**
         * Delegate method handling the <classpath> tag.
         *
         *
This nested path-like structure can set a path to add to the
         * classpath.

         *
         * @return the created path.
         */
        public Path createClasspath() {
            if (this.classpath == null) {
                this.classpath = new Path(component.getProject());
            }
            return this.classpath.createPath();
        }

        /**
         * Delegate method handling the @classname attribute.
         *
         *
This attribute sets the full qualified class name of the class
         * to load and instantiate.

         *
         * @param fcqn the name of the class to load.
         */
        public void setClassname(String fcqn) {
            this.className = fcqn;
        }

        /**
         * Delegate method handling the @classpathref attribute.
         *
         *
This attribute can add a referenced path-like structure to the
         * classpath.

         *
         * @param r the reference to the classpath.
         */
        public void setClasspathref(Reference r) {
            this.classpathId = r.getRefId();
            createClasspath().setRefid(r);
        }

        /**
         * Delegate method handling the @reverseLoader attribute.
         *
         *
This attribute can set a boolean indicating that the used
         * classloader should NOT follow the classical parent-first scheme.
         *

         *
         *
By default this is supposed to be false.

         *
         *
Caution: this behaviour is contradictory to the normal way
         * classloaders work.  Do not let your ProjectComponent use it if
         * you are not really sure.

         *
         * @param reverseLoader if true reverse the order of looking up a class.
         */
        public void setReverseLoader(boolean reverseLoader) {
            this.reverseLoader = reverseLoader;
        }

        /**
         * Sets the loaderRef.
         * @param r the reference to the loader.
         */
        public void setLoaderRef(Reference r) {
            this.loaderId = r.getRefId();
        }

        /**
         * Finds or creates the classloader for this object.
         * @return The class loader.
         */
        public ClassLoader getClassLoader() {
            return getClassLoaderForPath(
                    getContextProject(),
                    this.classpath,
                    getClassLoadId(),
                    this.reverseLoader,
                    loaderId != null || isMagicPropertySet(getContextProject()));
        }

        /**
         * The project of the ProjectComponent we are working for.
         */
        private Project getContextProject() {
            return this.component.getProject();
        }

        /**
         * Computes the loaderId based on the configuration of the component.
         * @return a loader identifier.
         */
        public String getClassLoadId() {
            return this.loaderId == null && this.classpathId != null
                ? MagicNames.REFID_CLASSPATH_LOADER_PREFIX + this.classpathId
                : this.loaderId;
        }

        /**
         * Helper method obtaining a fresh instance of the class specified
         * in the @classname and using the specified classpath.
         *
         * @return the fresh instantiated object.
         */
        public Object newInstance() {
            return ClasspathUtils.newInstance(this.className, getClassLoader());
        }

        /**
         * The classpath.
         * @return the classpath.
         */
        public Path getClasspath() {
            return classpath;
        }

        /**
         * Get the reverseLoader setting.
         * @return true if looking up in reverse order.
         */
        public boolean isReverseLoader() {
            return reverseLoader;

FUNC_DECL RETURN PARAM PARAM CALL LITERAL_ANCHOR

FUNC_DECL RETURN PARAM PARAM PARAM CALL LITERAL_ANCHOR

FUNC_DECL RETURN PARAM PARAM PARAM PARAM CALL CALL

FUNC_DECL RETURN IF VAR_DECL PARAM PARAM PARAM CALL CALL CALL LITERAL_ANCHOR


org.apache.tools.ant.taskdefs.Jar

public class Jar extends Zip {

    private File manifest;
    private boolean manifestAdded;

    public Jar() {
        super();
        archiveType = "jar";
        emptyBehavior = "create";
    }

    public void setJarfile(File jarFile) {
        super.setZipfile(jarFile);
    }

    public void setManifest(File manifestFile) {
        manifest = manifestFile;
        if (!manifest.exists())
            throw new BuildException("Manifest file: " + manifest + " does not exist.");

        ZipFileSet fs = new ZipFileSet();
        fs.setDir(new File(manifest.getParent()));
        fs.setIncludes(manifest.getName());
        fs.setFullpath("META-INF/MANIFEST.MF");
        super.addFileset(fs);
    }

    protected void initZipOutputStream(ZipOutputStream zOut)
        throws IOException, BuildException
    {
        if (manifest == null) {
            String s = "/org/apache/tools/ant/defaultManifest.mf";
            InputStream in = this.getClass().getResourceAsStream(s);
            if ( in == null )
                throw new BuildException ( "Could not find: " + s );
            zipDir(null, zOut, "META-INF/");
            zipFile(in, zOut, "META-INF/MANIFEST.MF", System.currentTimeMillis());
        }

        super.initZipOutputStream(zOut);
    }

    protected void zipFile(File file, ZipOutputStream zOut, String vPath)
        throws IOException
    {
        if (vPath.equalsIgnoreCase("META-INF/MANIFEST.MF"))  {
            if (manifest == null || !manifest.equals(file) || manifestAdded) {
                log("Warning: selected "+archiveType+" files include a META-INF/MANIFEST.MF which will be ignored " +
                    "(please use manifest attribute to "+archiveType+" task)", Project.MSG_WARN);
            } else {
                super.zipFile(file, zOut, vPath);
                manifestAdded = true;
            }
        } else {
            super.zipFile(file, zOut, vPath);
        }
    }

    /**
     * Make sure we don't think we already have a MANIFEST next time this task
     * gets executed.
     */
    protected void cleanUp() {
        manifestAdded = false;
        super.cleanUp();


@XmlRootElement(name = "javaScript")
public class JavaScriptExpression extends ExpressionType {
    public JavaScriptExpression() {
    }

    public JavaScriptExpression(String expression) {
        super(expression);
    }

    public String getLanguage() {
        return "js";


public class BeanInvocation implements Externalizable {
    private Object[] args;
    private MethodBean methodBean;
    private transient Method method;

    public BeanInvocation() {
    }

    public BeanInvocation(Method method, Object[] args) {
        this.method = method;
        this.args = args;
    }

    @Override
    public String toString() {
        Object list = null;
        if (args != null) {
            list = Arrays.asList(args);
        }
        return "BeanInvocation " + method + " with " + list + "]";
    }

    public Object[] getArgs() {
        return args;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public void setArgs(Object[] args) {
        this.args = args;
    }

    /**
     * This causes us to invoke the endpoint Pojo using reflection.
     *
     * @param pojo     the bean on which to perform this invocation
     * @param exchange the exchange carrying the method invocation
     */
    public void invoke(Object pojo, Exchange exchange) {
        try {
            Object response = getMethod().invoke(pojo, getArgs());
            exchange.getOut().setBody(response);
        } catch (InvocationTargetException e) {
            exchange.setException(e.getCause());
        } catch (RuntimeException e) {
            throw e;
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
    }

    public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException {
        methodBean = ObjectHelper.cast(MethodBean.class, objectInput.readObject());
        try {
            method = methodBean.getMethod();
        } catch (NoSuchMethodException e) {
            throw IOHelper.createIOException(e);
        }
        args = ObjectHelper.cast(Object[].class, objectInput.readObject());
    }

    public void writeExternal(ObjectOutput objectOutput) throws IOException {
        if (methodBean == null) {
            methodBean = new MethodBean(method);
        }
        objectOutput.writeObject(methodBean);
        objectOutput.writeObject(args);

FUNC_DECL TRY PARAM PARAM CATCH CATCH CATCH VAR_DECL THROW_RAISE THROW_RAISE CALL CALL CALL CALL CALL CALL CALL CALL

FUNC_DECL TRY PARAM ASSIGN CATCH ASSIGN CALL THROW_RAISE ASSIGN CALL CALL CALL CALL CALL

FUNC_DECL IF PARAM CALL CALL BINARY_OP LITERAL_ANCHOR ASSIGN CALL


org.apache.poi.ddf.EscherDggRecord

public class EscherDggRecord
    extends EscherRecord
{
    public static final short RECORD_ID = (short) 0xF006;
    public static final String RECORD_DESCRIPTION = "MsofbtDgg";

    private int field_1_shapeIdMax;
    private int field_3_numShapesSaved;
    private int field_4_drawingsSaved;
    private FileIdCluster[] field_5_fileIdClusters;

    public static class FileIdCluster
    {
        public FileIdCluster( int drawingGroupId, int numShapeIdsUsed )
        {
            this.field_1_drawingGroupId = drawingGroupId;
            this.field_2_numShapeIdsUsed = numShapeIdsUsed;
        }

        private int field_1_drawingGroupId;
        private int field_2_numShapeIdsUsed;

        public int getDrawingGroupId()
        {
            return field_1_drawingGroupId;
        }

        public int getNumShapeIdsUsed()
        {
            return field_2_numShapeIdsUsed;
        }

        public void incrementShapeId( )
        {
            this.field_2_numShapeIdsUsed++;
        }
    }

    /**
     * This method deserializes the record from a byte array.
     *
     * @param data          The byte array containing the escher record information
     * @param offset        The starting offset into data.
     * @param recordFactory May be null since this is not a container record.
     * @return The number of bytes read from the byte array.
     */
    public int fillFields( byte[] data, int offset, EscherRecordFactory recordFactory )
    {
        int bytesRemaining = readHeader( data, offset );
        int pos            = offset + 8;
        int size           = 0;
        field_1_shapeIdMax     =  LittleEndian.getInt( data, pos + size );size+=4;
        int field_2_numIdClusters  =  LittleEndian.getInt( data, pos + size );size+=4;
        field_3_numShapesSaved =  LittleEndian.getInt( data, pos + size );size+=4;
        field_4_drawingsSaved  =  LittleEndian.getInt( data, pos + size );size+=4;
        for (int i = 0; i < field_5_fileIdClusters.length; i++)
        {
            field_5_fileIdClusters[i] = new FileIdCluster(LittleEndian.getInt( data, pos + size ), LittleEndian.getInt( data, pos + size + 4 ));
            size += 8;
        }
        bytesRemaining         -= size;
        if (bytesRemaining != 0)
            throw new RecordFormatException("Expecting no remaining data but got " + bytesRemaining + " byte(s).");
        return 8 + size + bytesRemaining;
    }

    /**
     * This method serializes this escher record into a byte array.
     *
     * @param offset   The offset into data to start writing the record data to.
     * @param data     The byte array to serialize to.
     * @param listener A listener to retrieve start and end callbacks.  Use a NullEscherSerailizationListener to ignore these events.
     * @return The number of bytes written.
     *
     * @see NullEscherSerializationListener
     */
    public int serialize( int offset, byte[] data, EscherSerializationListener listener )
    {
        listener.beforeRecordSerialize( offset, getRecordId(), this );

        int pos = offset;
        LittleEndian.putShort( data, pos, getOptions() );     pos += 2;
        LittleEndian.putShort( data, pos, getRecordId() );    pos += 2;
        int remainingBytes = getRecordSize() - 8;
        LittleEndian.putInt( data, pos, remainingBytes );              pos += 4;

        LittleEndian.putInt( data, pos, field_1_shapeIdMax );          pos += 4;
        LittleEndian.putInt( data, pos, getNumIdClusters() );          pos += 4;
        LittleEndian.putInt( data, pos, field_3_numShapesSaved );      pos += 4;
        LittleEndian.putInt( data, pos, field_4_drawingsSaved );       pos += 4;
        for ( int i = 0; i < field_5_fileIdClusters.length; i++ )
        {
            LittleEndian.putInt( data, pos, field_5_fileIdClusters[i].field_1_drawingGroupId );   pos += 4;
            LittleEndian.putInt( data, pos, field_5_fileIdClusters[i].field_2_numShapeIdsUsed );  pos += 4;
        }

        listener.afterRecordSerialize( pos, getRecordId(), getRecordSize(), this );
        return getRecordSize();
    }

    /**
     * Returns the number of bytes that are required to serialize this record.
     *
     * @return Number of bytes
     */
    public int getRecordSize()
    {
        return 8 + 16 + (8 * field_5_fileIdClusters.length);
    }

    public short getRecordId()
    {
        return RECORD_ID;
    }

    /**
     * The short name for this record
     */
    public String getRecordName()
    {
        return "Dgg";
    }

    public String toString()
    {
        String nl = System.getProperty("line.separator");

        StringBuffer field_5_string = new StringBuffer();
        for ( int i = 0; i < field_5_fileIdClusters.length; i++ )
        {
            field_5_string.append("  DrawingGroupId").append(i+1).append(": ");
            field_5_string.append(field_5_fileIdClusters[i].field_1_drawingGroupId);
            field_5_string.append(nl);
            field_5_string.append("  NumShapeIdsUsed").append(i+1).append(": ");
            field_5_string.append(field_5_fileIdClusters[i].field_2_numShapeIdsUsed);
            field_5_string.append(nl);
        }
        return getClass().getName() + ":" + nl +
                "  RecordId: 0x" + HexDump.toHex(RECORD_ID) + nl +
                "  Options: 0x" + HexDump.toHex(getOptions()) + nl +
                "  ShapeIdMax: " + field_1_shapeIdMax + nl +
                "  NumIdClusters: " + getNumIdClusters() + nl +
                "  NumShapesSaved: " + field_3_numShapesSaved + nl +
                "  DrawingsSaved: " + field_4_drawingsSaved + nl +
                "" + field_5_string.toString();

    }

    public int getShapeIdMax()
    {
        return field_1_shapeIdMax;
    }

    /**
     * The maximum is actually the next available. shape id.
     */
    public void setShapeIdMax( int field_1_shapeIdMax )
    {
        this.field_1_shapeIdMax = field_1_shapeIdMax;
    }

    /**
     * Number of id clusters + 1
     */
    public int getNumIdClusters()
    {
        return field_5_fileIdClusters.length + 1;
    }

    public int getNumShapesSaved()
    {
        return field_3_numShapesSaved;
    }

    public void setNumShapesSaved( int field_3_numShapesSaved )
    {
        this.field_3_numShapesSaved = field_3_numShapesSaved;
    }

    public int getDrawingsSaved()
    {
        return field_4_drawingsSaved;
    }

    public void setDrawingsSaved( int field_4_drawingsSaved )
    {
        this.field_4_drawingsSaved = field_4_drawingsSaved;
    }

    public FileIdCluster[] getFileIdClusters()
    {
        return field_5_fileIdClusters;
    }

    public void setFileIdClusters( FileIdCluster[] field_5_fileIdClusters )
    {
        this.field_5_fileIdClusters = field_5_fileIdClusters;
    }

    public void addCluster( int dgId, int numShapedUsed )
    {
        List clusters = new ArrayList(Arrays.asList(field_5_fileIdClusters));
        clusters.add(new FileIdCluster(dgId, numShapedUsed));
        Collections.sort(clusters, new Comparator()
        {
            public int compare( Object o1, Object o2 )
            {
                FileIdCluster f1 = (FileIdCluster) o1;
                FileIdCluster f2 = (FileIdCluster) o2;
                if (f1.getDrawingGroupId() == f2.getDrawingGroupId())
                    return 0;
                if (f1.getDrawingGroupId() < f2.getDrawingGroupId())
                    return -1;
                else
                    return +1;
            }
        } );
        field_5_fileIdClusters = (FileIdCluster[]) clusters.toArray( new FileIdCluster[clusters.size()] );

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

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


public class InstrumentationLifecycleStrategy implements LifecycleStrategy {
    private static final transient Log LOG = LogFactory.getLog(InstrumentationProcessor.class);

    private InstrumentationAgent agent;
    private CamelNamingStrategy namingStrategy;
    private boolean initialized;

    private Map<Endpoint, InstrumentationProcessor> interceptorMap =
        new HashMap<Endpoint, InstrumentationProcessor>();

    public InstrumentationLifecycleStrategy() {
        this(new DefaultInstrumentationAgent());
    }

    public InstrumentationLifecycleStrategy(InstrumentationAgent agent) {
        this.agent = agent;
    }
    /**
     * Constructor for camel context that has been started.
     *
     * @param agent
     * @param context
     */
    public InstrumentationLifecycleStrategy(InstrumentationAgent agent,
            CamelContext context) {
        this.agent = agent;
        onContextStart(context);
    }

    public void onContextStart(CamelContext context) {
        if (context instanceof DefaultCamelContext) {
            try {
                initialized = true;
                DefaultCamelContext dc = (DefaultCamelContext)context;
                dc.addService(agent);
                namingStrategy = new CamelNamingStrategy(agent.getMBeanObjectDomainName());
                ManagedService ms = new ManagedService(dc);
                agent.register(ms, getNamingStrategy().getObjectName(dc));
            } catch (Exception e) {
                LOG.warn("Could not register CamelContext MBean", e);
            }
        }
    }

    public void onEndpointAdd(Endpoint<? extends Exchange> endpoint) {

        if (!initialized) {
            return;
        }

        try {
            ManagedEndpoint me = new ManagedEndpoint(endpoint);
            agent.register(me, getNamingStrategy().getObjectName(me));
        } catch (JMException e) {
            LOG.warn("Could not register Endpoint MBean", e);
        }
    }

    public void onRoutesAdd(Collection<Route> routes) {

        if (!initialized) {
            return;
        }

        for (Route route : routes) {
            try {
                ManagedRoute mr = new ManagedRoute(route);
                InstrumentationProcessor interceptor = interceptorMap.get(route.getEndpoint());
                if (interceptor == null) {
                    LOG.warn("Instrumentation processor not found for route endpoint "
                             + route.getEndpoint());
                } else {
                    interceptor.setCounter(mr);
                }
                agent.register(mr, getNamingStrategy().getObjectName(mr));
            } catch (JMException e) {
                LOG.warn("Could not register Route MBean", e);
            }
        }
    }

    public void onServiceAdd(CamelContext context, Service service) {

        if (!initialized) {
            return;
        }
        if (service instanceof ServiceSupport) {
            try {
                ManagedService ms = new ManagedService((ServiceSupport)service);
                agent.register(ms, getNamingStrategy().getObjectName(context, ms));
            } catch (JMException e) {
                LOG.warn("Could not register Service MBean", e);
            }
        }
    }

    public void onRouteContextCreate(RouteContext routeContext) {

        if (!initialized) {
            return;
        }

        Map<ProcessorType, PerformanceCounter> counterMap =
            new HashMap<ProcessorType, PerformanceCounter>();

        RouteType route = routeContext.getRoute();

        for (ProcessorType processor : route.getOutputs()) {
            ObjectName name = null;
            try {
                name = getNamingStrategy().getObjectName(routeContext, processor);

                PerformanceCounter pc = new PerformanceCounter();
                agent.register(pc, name);

                counterMap.put(processor, pc);
            } catch (MalformedObjectNameException e) {
                LOG.warn("Could not create MBean name: " + name, e);
            } catch (JMException e) {
                LOG.warn("Could not register PerformanceCounter MBean: " + name, e);
            }
        }

        routeContext.addInterceptStrategy(new InstrumentationInterceptStrategy(counterMap));

        routeContext.setErrorHandlerWrappingStrategy(
                new InstrumentationErrorHandlerWrappingStrategy(counterMap));

        RouteType routeType = routeContext.getRoute();
        if (routeType.getInputs() != null && !routeType.getInputs().isEmpty()) {
            if (routeType.getInputs().size() > 1) {
                LOG.warn("Add InstrumentationProcessor to first input only.");
            }

            Endpoint endpoint  = routeType.getInputs().get(0).getEndpoint();

            List<ProcessorType<?>> exceptionHandlers = new ArrayList<ProcessorType<?>>();
            List<ProcessorType<?>> outputs = new ArrayList<ProcessorType<?>>();

            for (ProcessorType output : routeType.getOutputs()) {
                if (output instanceof ExceptionType) {
                    exceptionHandlers.add(output);
                } else {
                    outputs.add(output);
                }
            }

            routeType.clearOutput();

            routeType.getOutputs().addAll(exceptionHandlers);

            InstrumentationProcessor processor = new InstrumentationProcessor();
            routeType.intercept(processor);

            for (ProcessorType<?> processorType : outputs) {
                routeType.addOutput(processorType);
            }

            interceptorMap.put(endpoint, processor);
        }

    }

    public CamelNamingStrategy getNamingStrategy() {
        return namingStrategy;
    }

    public void setNamingStrategy(CamelNamingStrategy strategy) {
        this.namingStrategy = strategy;
    }

    public void setAgent(InstrumentationAgent agent) {
        this.agent = agent;

FUNC_DECL IF PARAM BINARY_OP TRY CATCH VAR_DECL VAR_DECL CALL ASSIGN CALL ASSIGN CALL CALL CALL CALL LITERAL_ANCHOR LITERAL_ANCHOR CALL CALL

FUNC_DECL TRY IF PARAM CATCH VAR_DECL CALL RETURN CALL CALL CALL LITERAL_ANCHOR CALL

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

FUNC_DECL IF IF PARAM PARAM BINARY_OP TRY RETURN CATCH VAR_DECL CALL CALL CALL CALL LITERAL_ANCHOR CALL

FUNC_DECL IF VAR_DECL LOOP VAR_DECL VAR_DECL IF PARAM BINARY_OP CALL CALL LOOP VAR_DECL LOOP VAR_DECL VAR_DECL VAR_DECL IF CALL BINARY_OP CALL CALL CALL TRY VAR_DECL CALL CALL CALL RETURN CALL CALL CALL CALL BINARY_OP CALL LITERAL_ANCHOR CALL CATCH CATCH VAR_DECL CALL CALL IF CALL CALL CALL CALL LITERAL_ANCHOR CALL CALL CALL ASSIGN LITERAL_ANCHOR CALL BINARY_OP CALL CALL CALL CALL CALL CALL CALL CALL LITERAL_ANCHOR LITERAL_ANCHOR BINARY_OP BINARY_OP CALL CALL CALL LITERAL_ANCHOR LITERAL_ANCHOR


public class DocumentNode
    extends EntryNode
    implements DocumentEntry, POIFSViewable
{

    private POIFSDocument _document;

    /**
     * create a DocumentNode. This method is not public by design; it
     * is intended strictly for the internal use of this package
     *
     * @param property the DocumentProperty for this DocumentEntry
     * @param parent the parent of this entry
     */

    DocumentNode(final DocumentProperty property, final DirectoryNode parent)
    {
        super(property, parent);
        _document = property.getDocument();
    }

    /**
     * get the POIFSDocument
     *
     * @return the internal POIFSDocument
     */

    POIFSDocument getDocument()
    {
        return _document;
    }

    /* ********** START implementation of DocumentEntry ********** */

    /**
     * get the zize of the document, in bytes
     *
     * @return size in bytes
     */

    public int getSize()
    {
        return getProperty().getSize();
    }

    /* **********  END  implementation of DocumentEntry ********** */
    /* ********** START implementation of Entry ********** */

    /**
     * is this a DocumentEntry?
     *
     * @return true if the Entry is a DocumentEntry, else false
     */

    public boolean isDocumentEntry()
    {
        return true;
    }

    /* **********  END  implementation of Entry ********** */
    /* ********** START extension of Entry ********** */

    /**
     * extensions use this method to verify internal rules regarding
     * deletion of the underlying store.
     *
     * @return true if it's ok to delete the underlying store, else
     *         false
     */

    protected boolean isDeleteOK()
    {
        return true;
    }

    /* **********  END  extension of Entry ********** */
    /* ********** START begin implementation of POIFSViewable ********** */

    /**
     * Get an array of objects, some of which may implement
     * POIFSViewable
     *
     * @return an array of Object; may not be null, but may be empty
     */

    public Object [] getViewableArray()
    {
        return new Object[ 0 ];
    }

    /**
     * Get an Iterator of objects, some of which may implement
     * POIFSViewable
     *
     * @return an Iterator; may not be null, but may have an empty
     * back end store
     */

    public Iterator getViewableIterator()
    {
        List components = new ArrayList();

        components.add(getProperty());
        components.add(_document);
        return components.iterator();
    }

    /**
     * Give viewers a hint as to whether to call getViewableArray or
     * getViewableIterator
     *
     * @return true if a viewer should call getViewableArray, false if
     *         a viewer should call getViewableIterator
     */

    public boolean preferArray()
    {
        return false;
    }

    /**
     * Provides a short description of the object, to be used when a
     * POIFSViewable object has not provided its contents.
     *
     * @return short description
     */

    public String getShortDescription()
    {
        return getName();

FUNC_DECL RETURN VAR_DECL CALL CALL CALL CALL CALL


public class LoggingExceptionHandler implements ExceptionHandler {
    private final Logger logger;

    public LoggingExceptionHandler(Class ownerType) {
        this(new Logger(LogFactory.getLog(ownerType), LoggingLevel.ERROR));
    }

    public LoggingExceptionHandler(Logger logger) {
        this.logger = logger;
    }

    public void handleException(Throwable exception) {
        logger.log(exception.getMessage(), exception);


public class DelegateProcessor extends ServiceSupport implements Processor {
    protected Processor processor;

    public DelegateProcessor() {
    }

    public DelegateProcessor(Processor processor) {
        this.processor = processor;
    }

    public void process(Exchange exchange) throws Exception {
        processNext(exchange);
    }

    protected void processNext(Exchange exchange) throws Exception {
        if (processor != null) {
            processor.process(exchange);
        }
    }

    @Override
    public String toString() {
        return "Delegate(" + processor + ")";
    }

    public Processor getProcessor() {
        return processor;
    }

    public void setProcessor(Processor processor) {
        this.processor = processor;
    }

    protected void doStart() throws Exception {
        ServiceHelper.startServices(processor);
    }

    protected void doStop() throws Exception {
        ServiceHelper.stopServices(processor);
    }

    /**
     * Proceed with the underlying delegated processor
     */
    public void proceed(Exchange exchange) throws Exception {
        processNext(exchange);


org.apache.xalan.xsltc.compiler.ValueOf

final class ValueOf extends Instruction {
    private Expression _select;
    private boolean _escaping = true;
    private boolean _isString = false;

    public void display(int indent) {
        indent(indent);
        Util.println("ValueOf");
        indent(indent + IndentIncrement);
        Util.println("select " + _select.toString());
    }

    public void parseContents(Parser parser) {
        _select = parser.parseExpression(this, "select", null);

        if (_select.isDummy()) {
            reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "select");
            return;
        }
        final String str = getAttribute("disable-output-escaping");
        if ((str != null) && (str.equals("yes"))) _escaping = false;
    }

    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
        Type type = _select.typeCheck(stable);

        if (type != null && !type.identicalTo(Type.Node)) {
            /***
             *** %HZ% Would like to treat result-tree fragments in the same
             *** %HZ% way as node sets for value-of, but that's running into
             *** %HZ% some snags.  Instead, they'll be converted to String
            if (type.identicalTo(Type.ResultTree)) {
                _select = new CastExpr(new CastExpr(_select, Type.NodeSet),
                                       Type.Node);
            } else
            ***/
            if (type.identicalTo(Type.NodeSet)) {
                _select = new CastExpr(_select, Type.Node);
            } else {
                _isString = true;
                if (!type.identicalTo(Type.String)) {
                    _select = new CastExpr(_select, Type.String);
                }
                _isString = true;
            }
        }
        return Type.Void;
    }

    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
        final ConstantPoolGen cpg = classGen.getConstantPool();
        final InstructionList il = methodGen.getInstructionList();
        final int setEscaping = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
                                                          "setEscaping","(Z)Z");

        if (!_escaping) {
            il.append(methodGen.loadHandler());
            il.append(new PUSH(cpg,false));
            il.append(new INVOKEINTERFACE(setEscaping,2));
        }

        if (_isString) {
            final int characters = cpg.addMethodref(TRANSLET_CLASS,
                                                    CHARACTERSW,
                                                    CHARACTERSW_SIG);

            il.append(classGen.loadTranslet());
            _select.translate(classGen, methodGen);
            il.append(methodGen.loadHandler());
            il.append(new INVOKEVIRTUAL(characters));
        } else {
            final int characters = cpg.addInterfaceMethodref(DOM_INTF,
                                                             CHARACTERS,
                                                             CHARACTERS_SIG);

            il.append(methodGen.loadDOM());
            _select.translate(classGen, methodGen);
            il.append(methodGen.loadHandler());
            il.append(new INVOKEINTERFACE(characters, 3));
        }

        if (!_escaping) {
            il.append(methodGen.loadHandler());
            il.append(SWAP);
            il.append(new INVOKEINTERFACE(setEscaping,2));
            il.append(POP);

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

FUNC_DECL IF IF IF VAR_DECL VAR_DECL VAR_DECL PARAM PARAM VAR_DECL VAR_DECL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL LITERAL_ANCHOR LITERAL_ANCHOR CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL LITERAL_ANCHOR LITERAL_ANCHOR LITERAL_ANCHOR LITERAL_ANCHOR


public class IterationRecord
    extends Record
{
    public final static short sid = 0x11;
    private short             field_1_iteration;

    public IterationRecord()
    {
    }

    /**
     * Constructs an Iteration record and sets its fields appropriately.
     *
     * @param id     id must be 0x11 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 IterationRecord(RecordInputStream in)
    {
        super(in);
    }

    protected void validateSid(short id)
    {
        if (id != sid)
        {
            throw new RecordFormatException("NOT An ITERATION RECORD");
        }
    }

    protected void fillFields(RecordInputStream in)
    {
        field_1_iteration = in.readShort();
    }

    /**
     * set whether or not to iterate for calculations
     * @param iterate or not
     */

    public void setIteration(boolean iterate)
    {
        if (iterate)
        {
            field_1_iteration = 1;
        }
        else
        {
            field_1_iteration = 0;
        }
    }

    /**
     * get whether or not to iterate for calculations
     *
     * @return whether iterative calculations are turned off or on
     */

    public boolean getIteration()
    {
        return (field_1_iteration == 1);
    }

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

        buffer.append("[ITERATION]\n");
        buffer.append("    .iteration      = ").append(getIteration())
            .append("\n");
        buffer.append("[/ITERATION]\n");
        return buffer.toString();
    }

    public int serialize(int offset, byte [] data)
    {
        LittleEndian.putShort(data, 0 + offset, sid);
        LittleEndian.putShort(data, 2 + offset, ( short ) 0x2);
        LittleEndian.putShort(data, 4 + offset, field_1_iteration);
        return getRecordSize();
    }

    public int getRecordSize()
    {
        return 6;
    }

    public short getSid()
    {
        return sid;
    }

    public Object clone() {
      IterationRecord rec = new IterationRecord();
      rec.field_1_iteration = field_1_iteration;
      return rec;

    public int getRecordSize()
    {
        return 6;

    public short getSid()
    {
        return sid;


final class FilteredAbsoluteLocationPath extends Expression {

    public FilteredAbsoluteLocationPath() {
	_path = null;
    }

    public FilteredAbsoluteLocationPath(Expression path) {
	_path = path;
	if (path != null) {
	    _path.setParent(this);
	}
    }

    public void setParser(Parser parser) {
	super.setParser(parser);
	if (_path != null) {
	    _path.setParser(parser);
	}
    }

    public Expression getPath() {
	return(_path);
    }

    public String toString() {
	return "FilteredAbsoluteLocationPath(" +
	    (_path != null ? _path.toString() : "null") + ')';
    }

    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
	if (_path != null) {
	    final Type ptype = _path.typeCheck(stable);
		_path = new CastExpr(_path, Type.NodeSet);

	}
	return _type = Type.NodeSet;
    }

    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
	final ConstantPoolGen cpg = classGen.getConstantPool();
	final InstructionList il = methodGen.getInstructionList();
	if (_path != null) {
	    final int initDFI = cpg.addMethodref(DUP_FILTERED_ITERATOR,
						"<init>",
						"("
						+ NODE_ITERATOR_SIG
						+ ")V");
	    il.append(new NEW(cpg.addClass(DUP_FILTERED_ITERATOR)));
	    il.append(DUP);

	    _path.translate(classGen, methodGen);

	    il.append(new INVOKESPECIAL(initDFI));
	}
	else {
	    final int git = cpg.addInterfaceMethodref(DOM_INTF,
						      "getIterator",
						      "()"+NODE_ITERATOR_SIG);
	    il.append(methodGen.loadDOM());
	    il.append(new INVOKEINTERFACE(git, 1));


org.apache.xpath.XPathException

public class XPathException extends TransformerException
{

  /** The home of the expression that caused the error.
   *  @serial  */
  Object m_styleNode = null;

  /**
   * Get the stylesheet node from where this error originated.
   * @return The stylesheet node from where this error originated, or null.
   */
  public Object getStylesheetNode()
  {
    return m_styleNode;
  }

  /**
   * Set the stylesheet node from where this error originated.
   * @param styleNode The stylesheet node from where this error originated, or null.
   */
  public void setStylesheetNode(Object styleNode)
  {
    m_styleNode = styleNode;
  }

  /** A nested exception.
   *  @serial   */
  protected Exception m_exception;

  /**
   * Create an XPathException object that holds
   * an error message.
   * @param message The error message.
   */
  public XPathException(String message, ExpressionNode ex)
  {
    super(message);
    this.setLocator(ex);
    setStylesheetNode(getStylesheetNode(ex));
  }

  /**
   * Create an XPathException object that holds
   * an error message.
   * @param message The error message.
   */
  public XPathException(String message)
  {
    super(message);
  }

  /**
   * Get the XSLT ElemVariable that this sub-expression references.  In order for
   * this to work, the SourceLocator must be the owning ElemTemplateElement.
   * @return The dereference to the ElemVariable, or null if not found.
   */
  public org.w3c.dom.Node getStylesheetNode(ExpressionNode ex)
  {

    ExpressionNode owner = getExpressionOwner(ex);

    if (null != owner && owner instanceof org.w3c.dom.Node)
    {
		return ((org.w3c.dom.Node)owner);
    }
    return null;

  }

  /**
   * Get the first non-Expression parent of this node.
   * @return null or first ancestor that is not an Expression.
   */
  protected ExpressionNode getExpressionOwner(ExpressionNode ex)
  {
  	ExpressionNode parent = ex.exprGetParent();
  	while((null != parent) && (parent instanceof Expression))
  		parent = parent.exprGetParent();
  	return parent;
  }

  /**
   * Create an XPathException object that holds
   * an error message and the stylesheet node that
   * the error originated from.
   * @param message The error message.
   * @param styleNode The stylesheet node that the error originated from.
   */
  public XPathException(String message, Object styleNode)
  {

    super(message);

    m_styleNode = styleNode;
  }

  /**
   * Create an XPathException object that holds
   * an error message, the stylesheet node that
   * the error originated from, and another exception
   * that caused this exception.
   * @param message The error message.
   * @param styleNode The stylesheet node that the error originated from.
   * @param e The exception that caused this exception.
   */
  public XPathException(String message, Node styleNode, Exception e)
  {

    super(message);

    m_styleNode = styleNode;
    this.m_exception = e;
  }

  /**
   * Create an XPathException object that holds
   * an error message, and another exception
   * that caused this exception.
   * @param message The error message.
   * @param e The exception that caused this exception.
   */
  public XPathException(String message, Exception e)
  {

    super(message);

    this.m_exception = e;
  }

  /**
   * Print the the trace of methods from where the error
   * originated.  This will trace all nested exception
   * objects, as well as this object.
   * @param s The stream where the dump will be sent to.
   */
  public void printStackTrace(java.io.PrintStream s)
  {

    if (s == null)
      s = System.err;

    try
    {
      super.printStackTrace(s);
    }
    catch (Exception e){}

    Throwable exception = m_exception;

    for (int i = 0; (i < 10) && (null != exception); i++)
    {
      s.println("---------");
      exception.printStackTrace(s);

      if (exception instanceof TransformerException)
      {
        TransformerException se = (TransformerException) exception;
        Throwable prev = exception;

        exception = se.getException();

        if (prev == exception)
          break;
      }
      else
      {
        exception = null;
      }
    }
  }

  /**
   * Find the most contained message.
   *
   * @return The error message of the originating exception.
   */
  public String getMessage()
  {

    String lastMessage = super.getMessage();
    Throwable exception = m_exception;

    while (null != exception)
    {
      String nextMessage = exception.getMessage();

      if (null != nextMessage)
        lastMessage = nextMessage;

      if (exception instanceof TransformerException)
      {
        TransformerException se = (TransformerException) exception;
        Throwable prev = exception;

        exception = se.getException();

        if (prev == exception)
          break;
      }
      else
      {
        exception = null;
      }
    }

    return (null != lastMessage) ? lastMessage : "";
  }

  /**
   * Print the the trace of methods from where the error
   * originated.  This will trace all nested exception
   * objects, as well as this object.
   * @param s The writer where the dump will be sent to.
   */
  public void printStackTrace(java.io.PrintWriter s)
  {

    if (s == null)
      s = new java.io.PrintWriter(System.err);

    try
    {
      super.printStackTrace(s);
    }
    catch (Exception e){}

    Throwable exception = m_exception;

    for (int i = 0; (i < 10) && (null != exception); i++)
    {
      s.println("---------");

      try
      {
        exception.printStackTrace(s);
      }
      catch (Exception e)
      {
        s.println("Could not print stack trace...");
      }

      if (exception instanceof TransformerException)
      {
        TransformerException se = (TransformerException) exception;
        Throwable prev = exception;

        exception = se.getException();

        if (prev == exception)
        {
          exception = null;

          break;
        }
      }
      else
      {
        exception = null;
      }
    }
  }

  /**
   *  Return the embedded exception, if any.
   *  Overrides javax.xml.transform.TransformerException.getException().
   *
   *  @return The embedded exception, or null if there is none.
   */
  public Throwable getException()
  {
    return m_exception;

FUNC_DECL PARAM PARAM PARAM ASSIGN ASSIGN


public class ExtendedGridLayoutConstraints
{
	/**
	  * Specifies that this component is the
	  * last component in its column or row
	  * and takes up the remaining space.
	  */
	public static final int REMAINDER = Integer.MAX_VALUE;

	/**
	  * Specifies the row in which a component starts its display area.
	  * {@code row} has to be non-negative and the default
	  * value is 0.
	  */
	private int row;

	/**
	  * Specifies the column in which a component starts its display area.
	  * {@code col} has to be non-negative.
	  */
	private int col;

	/**
	  * Specifies the number of cells in a row for the
	  * component's display area.
	  *

	  * Use {@code REMAINDER} to specify that the component's
	  * display area will be from its grid position to the last
	  * cell in the row.
	  *

	  * {@code colspan} has to be {@literal >= 1} and the default
	  * value is 1.
	  *
	  * @see #REMAINDER
	  * @see #rowspan
	  */
	private int colspan;

	/**
	  * Specifies the effective number of cells in a row for the
	  * component's display area. This is used internally
	  * to get the effective number of cells in a row in cases
	  * where {@code REMAINDER} is used for colspan.
	  *
	  * @see #REMAINDER
	  * @see #colspan
	  */
	private int effectiveColspan;

	/**
	  * Specifies the number of cells in a column for the
	  * component's display area.
	  *

	  * Use {@code REMAINDER} to specify that the component's
	  * display area will be from its grid position to the last
	  * cell in the column.
	  *

	  * {@code rowspan} has to be {@literal >= 1} and the default
	  * value is 1.
	  *
	  * @see #REMAINDER
	  * @see #colspan
	  */
	private int rowspan;

	/**
	  * Specifies the effective number of cells in a column for the
	  * component's display area. This is used internally
	  * to get the effective number of cells in a column in cases
	  * where {@code REMAINDER} is used for rowspan.
	  *
	  * @see #REMAINDER
	  * @see #rowspan
	  */
	private int effectiveRowspan;

	/**
	  * Specifies if this Constraint is used as placeholder to build the grid.
	  * This is used internally and the default value is {@code false}.
	  */
	private boolean placeholder;

	/**
	  * Specifies the mainConstraints object for which this constraints
	  * object is a placeholder. If this constraints object is no placeholder,
	  * mainConstraints is set to {@code null}.
	  */
	private ExtendedGridLayoutConstraints mainConstraints;

	/**
	  * Specifies the {@code Component} this constraints object describes.
	  */
	private Component component;

	/**
	  * Creates an {@code ExtendedGridLayoutConstraints} object with
	  * all of its fields set to their default value. For further information
	  * about the default values see
	  * {@link #ExtendedGridLayoutConstraints(int, int, int, java.awt.Component)}.
	  *
	  * @param component The {@code Component} this constraints object describes
	  */
	public ExtendedGridLayoutConstraints(Component component)
	{
		this(0,0,1,1,component,false,null);
	}

	/**
	  * Creates an {@code ExtendedGridLayoutConstraints} object with
	  * all of its fields set to their default value
	  * except of the row which is specified. For further information
	  * about the default values see
	  * {@link #ExtendedGridLayoutConstraints(int, int, int, java.awt.Component)}.
	  *
	  * @param row       The row in which a component starts its display area. First row is 0
	  * @param component The {@code Component} this constraints object d describes
	  * @throws IllegalArgumentException If row {@literal < 0}
	  */
	public ExtendedGridLayoutConstraints(int row, Component component)
	{
		this(row,0,1,1,component,false,null);
	}

	/**
	  * Creates an {@code ExtendedGridLayoutConstraints} object with
	  * all of its fields set to the passed-in arguments.
	  *
	  * @param row       The row in which a component starts its display area.
	  *                  First row is 0. Default value is 0.
	  * @param colspan   The number of cells in a row for the component's display area.
	  *                  Use {@code REMAINDER} to specify that the component's
	  *                  display area will be from its grid position to the last
	  *                  cell in the row. Default value is 1.
	  * @param rowspan   The number of cells in a column for the component's display area.
	  *                  Use {@code REMAINDER} to specify that the component's
	  *                  display area will be from its grid position to the last
	  *                  cell in the column. Default value is 1.
	  * @param component The {@code Component} this constraints object describes
	  * @throws IllegalArgumentException If row {@literal < 0}
	  * @throws IllegalArgumentException If colspan {@literal < 1}
	  * @throws IllegalArgumentException If rowspan {@literal < 1}
	  */
	public ExtendedGridLayoutConstraints(int row, int colspan, int rowspan, Component component)
	{
		this(row,0,colspan,rowspan,component,false,null);
	}

	/**
	  * Creates an {@code ExtendedGridLayoutConstraints} object with
	  * all of its fields set to the passed-in arguments.
	  *
	  * @param row             The row in which a component starts its display area.
	  *                        First row is 0.
	  * @param col             The col in which a component starts its display area.
	  *                        First col is 0.
	  * @param colspan         The number of cells in a row for the component's display area.
	  *                        Use {@code REMAINDER} to specify that the component's
	  *                        display area will be from its grid position to the last
	  *                        cell in the row.
	  * @param rowspan         The number of cells in a column for the component's display area.
	  *                        Use {@code REMAINDER} to specify that the component's
	  *                        display area will be from its grid position to the last
	  *                        cell in the column.
	  * @param component       The {@code Component} this constraints object describes
	  * @param placeholder     If this constraints are used as placeholder to build the grid
	  * @param mainConstraints The mainConstraints object for which this constraints
	  *                        object is a placeholder
	  * @throws IllegalArgumentException If row {@literal < 0}
	  * @throws IllegalArgumentException If col {@literal < 0}
	  * @throws IllegalArgumentException If colspan {@literal < 1}
	  * @throws IllegalArgumentException If rowspan {@literal < 1}
	  */
	private ExtendedGridLayoutConstraints(int row, int col, int colspan, int rowspan, Component component, boolean placeholder, ExtendedGridLayoutConstraints mainConstraints)
	{
		if (row < 0)
		{
			throw new IllegalArgumentException("row must be non-negative (" + row + ')');
		}
		if (col < 0)
		{
			throw new IllegalArgumentException("col must be non-negative (" + col + ')');
		}
		if (colspan < 1)
		{
			throw new IllegalArgumentException("colspan must be at least 1 (" + colspan + ')');
		}
		if (rowspan < 1)
		{
			throw new IllegalArgumentException("rowspan must be at least 1 (" + rowspan + ')');
		}
		this.row = row;
		this.col = col;
		this.colspan = colspan;
		effectiveColspan = 1;
		this.rowspan = rowspan;
		effectiveRowspan = 1;
		this.component = component;
		this.placeholder = placeholder;
		this.mainConstraints = mainConstraints;
	}

	/**
	  * Creates an {@code ExtendedGridLayoutConstraints} object which can be
	  * used as placeholder for building a grid with colspans.
	  *
	  * @param forUsage If the returned object will be used in the grid
	  *                 and therefor the effectiveColspan should be raised by one
	  * @return The newly created {@code ExtendedGridLayoutConstraints}
	  *         object or {@code null} if no colspan is applicable
	  * @see #getRowspanPlaceholder(boolean)
	  */
	ExtendedGridLayoutConstraints getColspanPlaceholder(boolean forUsage)
	{
		if (1 == colspan)
		{
			return null;
		}
		ExtendedGridLayoutConstraints result = new ExtendedGridLayoutConstraints(row,col+1,colspan==REMAINDER ? REMAINDER : colspan-1,rowspan,component,true,null == mainConstraints ? this : mainConstraints);
		if (forUsage && (result.mainConstraints.row == row))
		{
			result.mainConstraints.effectiveColspan++;
		}
		return result;
	}

	/**
	  * Creates an {@code ExtendedGridLayoutConstraints} object which can be
	  * used as placeholder for building a grid with rowspans.
	  *
	  * @param forUsage If the returned object will be used in the grid
	  *                 and therefor the effectiveRowspan should be raised by one
	  * @return The newly created {@code ExtendedGridLayoutConstraints}
	  *         object or {@code null} if no rowspan is applicable
	  * @see #getColspanPlaceholder(boolean)
	  */
	ExtendedGridLayoutConstraints getRowspanPlaceholder(boolean forUsage)
	{
		if (1 == rowspan)
		{
			return null;
		}
		ExtendedGridLayoutConstraints result = new ExtendedGridLayoutConstraints(row+1,col,colspan,rowspan==REMAINDER ? REMAINDER : rowspan-1,component,true,null == mainConstraints ? this : mainConstraints);
		if (forUsage && (result.mainConstraints.col == col))
		{
			result.mainConstraints.effectiveRowspan++;
		}
		return result;
	}

	/**
	  * @return The row in which the component starts its display area.
	  */
	public int getRow()
	{
		return row;
	}

	/**
	  * @return The column in which the component starts its display area.
	  */
	public int getCol()
	{
		return col;
	}

	/**
	  * @param col The column in which the component starts its display area.
	  */
	void setCol(int col)
	{
		if (col < 0)
		{
			throw new IllegalArgumentException("col must be non-negative (" + col + ')');
		}
		this.col = col;
	}

	/**
	  * @return The number of cells in a row for the component's display area
	  *         or {@code REMAINDER} if the component's display area will be
	  *         from its grid position to the last cell in the row.
	  */
	public int getColspan()
	{
		return colspan;
	}

	/**
	  * @return The effective number of cells in a row for the component's display area.
	  */
	int getEffectiveColspan()
	{
		return null == mainConstraints ? effectiveColspan : mainConstraints.effectiveColspan;
	}

	/**
	  * @return The number of cells in a column for the component's display area
	  *         or {@code REMAINDER} if the component's display area will be
	  *         from its grid position to the last cell in the column.
	  */
	public int getRowspan()
	{
		return rowspan;
	}

	/**
	  * @return The effective number of cells in a column for the component's display area.
	  */
	int getEffectiveRowspan()
	{
		return null == mainConstraints ? effectiveRowspan : mainConstraints.effectiveRowspan;
	}

	/**
	  * @return The {@code Component} this constraints object describes
	  */
	Component getComponent()
	{
		return component;
	}

	/**
	  * @return Whether this constraints object is a placeholder or not
	  */
	public boolean isPlaceholder()
	{
		return placeholder;
	}

	/**
	  * @return A work copy if this constraints object. This is a flat copy
	  *         which means that the reference to the component stays the same.
	  *         The returned object could be used without modifying this
	  *         constraints object.
	  */
	ExtendedGridLayoutConstraints getWorkCopy()
	{
		return new ExtendedGridLayoutConstraints(row,col,colspan,rowspan,component,placeholder,(null == mainConstraints ? null : mainConstraints.getWorkCopy()));
	}

	/**
	  * Indicates whether some other object is "equal to" this one.
	  *

	  * The {@code equals} method implements an equivalence relation
	  * on non-null object references:
	  *

	  *
It is reflexive: for any non-null reference value
	  *     {@code x}, {@code x.equals(x)} returns
	  *     {@code true}.
	  *
It is symmetric: for any non-null reference values
	  *     {@code x} and {@code y}, {@code x.equals(y)}
	  *     returns {@code true} if and only if
	  *     {@code y.equals(x)} returns {@code true}.
	  *
It is transitive: for any non-null reference values
	  *     {@code x}, {@code y}, and {@code z}, if
	  *     {@code x.equals(y)} returns {@code true} and
	  *     {@code y.equals(z)} returns {@code true}, then
	  *     {@code x.equals(z)} returns {@code true}.
	  *
It is consistent: for any non-null reference values
	  *     {@code x} and {@code y}, multiple invocations of
	  *     <tt>x.equals(y)</tt> consistently return {@code true}
	  *     or consistently return {@code false}, provided no
	  *     information used in {@code equals} comparisons on the
	  *     objects is modified.
	  *
For any non-null reference value {@code x},
	  *     {@code x.equals(null)} returns {@code false}.
	  *

	  *

	  * The <tt>equals</tt> method for class
	  * {@code ExtendedGridLayoutConstraints} returns {@code true}
	  * if and only if the constraints objects describe the same {@code Component}
	  *
	  * @param o the reference object with which to compare.
	  * @return {@code true} if this object is the same as the o
	  *         argument; {@code false} otherwise.
	  * @see #hashCode()
	  * @see java.util.Hashtable
	  */
	public boolean equals(Object o)
	{
		if ((o == null) ||
		    (!(o instanceof ExtendedGridLayoutConstraints)))
		{
			return false;
		}
		if (component == null)
		{
			return ((ExtendedGridLayoutConstraints)o).component == null;
		}
		return component.equals(((ExtendedGridLayoutConstraints)o).component);
	}

	/**
	  * Returns a hash code value for the object. This method is
	  * supported for the benefit of hashtables such as those provided by
	  * {@code java.util.Hashtable}.
	  *

	  * The general contract of {@code hashCode} is:
	  *

	  *
Whenever it is invoked on the same object more than once during
	  *     an execution of a Java application, the <tt>hashCode</tt> method
	  *     must consistently return the same integer, provided no information
	  *     used in <tt>equals</tt> comparisons on the object is modified.
	  *     This integer need not remain consistent from one execution of an
	  *     application to another execution of the same application.
	  *
If two objects are equal according to the <tt>equals(Object)</tt>
	  *     method, then calling the {@code hashCode} method on each of
	  *     the two objects must produce the same integer result.
	  *
It is not required that if two objects are unequal
	  *     according to the
	  *     {@code java.lang.Object#equals(java.lang.Object)}
	  *     method, then calling the <tt>hashCode</tt> method on each of the
	  *     two objects must produce distinct integer results.  However, the
	  *     programmer should be aware that producing distinct integer results
	  *     for unequal objects may improve the performance of hashtables.
	  *

	  *
	  * @return a hash code value for this object.
	  * @see #equals(java.lang.Object)
	  * @see java.util.Hashtable
	  */
	public int hashCode()
	{
		if (null == component)
		{
			return 0;
		}
		return component.hashCode();
	}

	/**
	  * Returns a string representation of the object. In general, the
	  * {@code toString} method returns a string that
	  * "textually represents" this object. The result should
	  * be a concise but informative representation that is easy for a
	  * person to read.
	  *
	  * @return  a string representation of the object.
	  */
	public String toString()
	{
		return getClass().getName() + "[row=" + row + ",col=" + col
			+ ",colspan=" + colspan + ",effectiveColspan=" + effectiveColspan
			+ ",rowspan=" + rowspan + ",effectiveRowspan=" + effectiveRowspan
			+ ",placeholder=" + placeholder + ",component=" + component
			+ ",mainConstraints=" + mainConstraints + "]";


org.apache.tools.zip.AsiExtraField

public class AsiExtraField implements ZipExtraField, UnixStat, Cloneable {

    private final static ZipShort HEADER_ID = new ZipShort(0x756E);

    /**
     * Standard Unix stat(2) file mode.
     *
     * @since 1.1
     */
    private int mode = 0;
    /**
     * User ID.
     *
     * @since 1.1
     */
    private int uid = 0;
    /**
     * Group ID.
     *
     * @since 1.1
     */
    private int gid = 0;
    /**
     * File this entry points to, if it is a symbolic link.
     *
     *
empty string - if entry is not a symbolic link.

     *
     * @since 1.1
     */
    private String link = "";
    /**
     * Is this an entry for a directory?
     *
     * @since 1.1
     */
    private boolean dirFlag = false;

    /**
     * Instance used to calculate checksums.
     *
     * @since 1.1
     */
    private CRC32 crc = new CRC32();

    public AsiExtraField() {
    }

    /**
     * The Header-ID.
     *
     * @since 1.1
     */
    public ZipShort getHeaderId() {
        return HEADER_ID;
    }

    /**
     * Length of the extra field in the local file data - without
     * Header-ID or length specifier.
     *
     * @since 1.1
     */
    public ZipShort getLocalFileDataLength() {
                            return(getLinkedFile().getBytes().length);
    }

    /**
     * Delegate to local file data.
     *
     * @since 1.1
     */
    public ZipShort getCentralDirectoryLength() {
        return getLocalFileDataLength();
    }

    /**
     * The actual data to put into local file data - without Header-ID
     * or length specifier.
     *
     * @since 1.1
     */
    public byte[] getLocalFileDataData() {
        byte[] data = new byte[getLocalFileDataLength().getValue() - 4];
        System.arraycopy((new ZipShort(getMode())).getBytes(), 0, data, 0, 2);

        byte[] linkArray = getLinkedFile().getBytes();
        System.arraycopy((new ZipLong(linkArray.length)).getBytes(),
                         0, data, 2, 4);

        System.arraycopy((new ZipShort(getUserId())).getBytes(),
                         0, data, 6, 2);
        System.arraycopy((new ZipShort(getGroupId())).getBytes(),
                         0, data, 8, 2);

        System.arraycopy(linkArray, 0, data, 10, linkArray.length);

        crc.reset();
        crc.update(data);
        long checksum = crc.getValue();

        byte[] result = new byte[data.length + 4];
        System.arraycopy((new ZipLong(checksum)).getBytes(), 0, result, 0, 4);
        System.arraycopy(data, 0, result, 4, data.length);
        return result;
    }

    /**
     * Delegate to local file data.
     *
     * @since 1.1
     */
    public byte[] getCentralDirectoryData() {
        return getLocalFileDataData();
    }

    /**
     * Set the user id.
     *
     * @since 1.1
     */
    public void setUserId(int uid) {
        this.uid = uid;
    }

    /**
     * Get the user id.
     *
     * @since 1.1
     */
    public int getUserId() {
        return uid;
    }

    /**
     * Set the group id.
     *
     * @since 1.1
     */
    public void setGroupId(int gid) {
        this.gid = gid;
    }

    /**
     * Get the group id.
     *
     * @since 1.1
     */
    public int getGroupId() {
        return gid;
    }

    /**
     * Indicate that this entry is a symbolic link to the given filename.
     *
     * @param name Name of the file this entry links to, empty String
     *             if it is not a symbolic link.
     *
     * @since 1.1
     */
    public void setLinkedFile(String name) {
        link = name;
        mode = getMode(mode);
    }

    /**
     * Name of linked file
     *
     * @return name of the file this entry links to if it is a
     *         symbolic link, the empty string otherwise.
     *
     * @since 1.1
     */
    public String getLinkedFile() {
        return link;
    }

    /**
     * Is this entry a symbolic link?
     *
     * @since 1.1
     */
    public boolean isLink() {
        return getLinkedFile().length() != 0;
    }

    /**
     * File mode of this file.
     *
     * @since 1.1
     */
    public void setMode(int mode) {
        this.mode = getMode(mode);
    }

    /**
     * File mode of this file.
     *
     * @since 1.1
     */
    public int getMode() {
        return mode;
    }

    /**
     * Indicate whether this entry is a directory.
     *
     * @since 1.1
     */
    public void setDirectory(boolean dirFlag) {
        this.dirFlag = dirFlag;
        mode = getMode(mode);
    }

    /**
     * Is this entry a directory?
     *
     * @since 1.1
     */
    public boolean isDirectory() {
        return dirFlag && !isLink();
    }

    /**
     * Populate data from this array as if it was in local file data.
     *
     * @since 1.1
     */
    public void parseFromLocalFileData(byte[] data, int offset, int length)
        throws ZipException {

        long givenChecksum = (new ZipLong(data, offset)).getValue();
        byte[] tmp = new byte[length-4];
        System.arraycopy(data, offset+4, tmp, 0, length-4);
        crc.reset();
        crc.update(tmp);
        long realChecksum = crc.getValue();
        if (givenChecksum != realChecksum) {
            throw new ZipException("bad CRC checksum "
                                   + Long.toHexString(givenChecksum)
                                   + " instead of "
                                   + Long.toHexString(realChecksum));
        }

        int newMode = (new ZipShort(tmp, 0)).getValue();
        byte[] linkArray = new byte[(int) (new ZipLong(tmp, 2)).getValue()];
        uid = (new ZipShort(tmp, 6)).getValue();
        gid = (new ZipShort(tmp, 8)).getValue();

        if (linkArray.length == 0) {
            link = "";
        } else {
            System.arraycopy(tmp, 10, linkArray, 0, linkArray.length);
            link = new String(linkArray);
        }
        setDirectory((newMode & DIR_FLAG) != 0);
        setMode(newMode);

    }

    /**
     * Get the file mode for given permissions with the correct file type.
     *
     * @since 1.1
     */
    protected int getMode(int mode) {
        int type = FILE_FLAG;
        if (isLink()) {
            type = LINK_FLAG;
        } else if (isDirectory()) {
            type = DIR_FLAG;
        }
        return type | (mode & PERM_MASK);

    public int getUserId() {
        return uid;

    public int getGroupId() {
        return gid;

    public int getMode() {
        return mode;

FUNC_DECL RETURN IF VAR_DECL PARAM BINARY_OP IF CALL BINARY_OP CALL ASSIGN ASSIGN


class ChangeLogParser {
    private static final int GET_FILE = 1;
    private static final int GET_DATE = 2;
    private static final int GET_COMMENT = 3;
    private static final int GET_REVISION = 4;
    private static final int GET_PREVIOUS_REV = 5;

    /** input format for dates read in from cvs log */
    private static final SimpleDateFormat c_inputDate
        = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");

    static {
        TimeZone utc = TimeZone.getTimeZone("UTC");
        c_inputDate.setTimeZone(utc);
    }

    private String m_file;
    private String m_date;
    private String m_author;
    private String m_comment;
    private String m_revision;
    private String m_previousRevision;

    private int m_status = GET_FILE;

    /** rcs entries */
    private final Hashtable m_entries = new Hashtable();

    /**
     * Get a list of rcs entries as an array.
     *
     * @return a list of rcs entries as an array
     */
    CVSEntry[] getEntrySetAsArray() {
        final CVSEntry[] array = new CVSEntry[ m_entries.size() ];
        Enumeration e = m_entries.elements();
        int i = 0;
        while (e.hasMoreElements()) {
            array[i++] = (CVSEntry) e.nextElement();
        }
        return array;
    }

    /**
     * Receive notification about the process writing
     * to standard output.
     */
    public void stdout(final String line) {
        switch(m_status) {
            case GET_FILE:
                reset();
                processFile(line);
                break;
            case GET_REVISION:
                processRevision(line);
                break;

            case GET_DATE:
                processDate(line);
                break;

            case GET_COMMENT:
                processComment(line);
                break;

            case GET_PREVIOUS_REV:
                processGetPreviousRevision(line);
                break;
        }
    }

    /**
     * Process a line while in "GET_COMMENT" state.
     *
     * @param line the line
     */
    private void processComment(final String line) {
        final String lineSeparator = System.getProperty("line.separator");
        if (line.startsWith("======")) {
            final int end;
            m_comment = m_comment.substring(0, end);
            saveEntry();
            m_status = GET_FILE;
        } else if (line.startsWith("----------------------------")) {
            final int end;
            m_comment = m_comment.substring(0, end);
            m_status = GET_PREVIOUS_REV;
        } else {
            m_comment += line + lineSeparator;
        }
    }

    /**
     * Process a line while in "GET_FILE" state.
     *
     * @param line the line
     */
    private void processFile(final String line) {
        if (line.startsWith("Working file:")) {
            m_file = line.substring(14, line.length());
            m_status = GET_REVISION;
        }
    }

    /**
     * Process a line while in "REVISION" state.
     *
     * @param line the line
     */
    private void processRevision(final String line) {
        if (line.startsWith("revision")) {
            m_revision = line.substring(9);
            m_status = GET_DATE;
        } else if (line.startsWith("======")) {
            m_status = GET_FILE;
        }
    }

    /**
     * Process a line while in "DATE" state.
     *
     * @param line the line
     */
    private void processDate(final String line) {
        if (line.startsWith("date:")) {
            m_date = line.substring(6, 25);
            String lineData = line.substring(line.indexOf(";") + 1);
            m_author = lineData.substring(10, lineData.indexOf(";"));

            m_status = GET_COMMENT;

            m_comment = "";
        }
    }

    /**
     * Process a line while in "GET_PREVIOUS_REVISION" state.
     *
     * @param line the line
     */
    private void processGetPreviousRevision(final String line) {
        if (!line.startsWith("revision")) {
            throw new IllegalStateException("Unexpected line from CVS: "
                + line);
        }
        m_previousRevision = line.substring(9);

        saveEntry();

        m_revision = m_previousRevision;
        m_status = GET_DATE;
    }

    /**
     * Utility method that saves the current entry.
     */
    private void saveEntry() {
        final String entryKey = m_date + m_author + m_comment;
        CVSEntry entry;
        if (!m_entries.containsKey(entryKey)) {
            entry = new CVSEntry(parseDate(m_date), m_author, m_comment);
            m_entries.put(entryKey, entry);
        } else {
            entry = (CVSEntry) m_entries.get(entryKey);
        }

        entry.addFile(m_file, m_revision, m_previousRevision);
    }

    /**
     * Parse date out from expected format.
     *
     * @param date the string holding dat
     * @return the date object or null if unknown date format
     */
    private Date parseDate(final String date) {
        try {
            return c_inputDate.parse(date);
        } catch (ParseException e) {
            return null;
        }
    }

    /**
     * reset all internal attributes except status.
     */
    private void reset() {
        m_file = null;
        m_date = null;
        m_author = null;
        m_comment = null;
        m_revision = null;
        m_previousRevision = null;

FUNC_DECL IF PARAM CALL LITERAL_ANCHOR ASSIGN ASSIGN CALL CALL LITERAL_ANCHOR

FUNC_DECL IF PARAM IF CALL CALL LITERAL_ANCHOR LITERAL_ANCHOR ASSIGN ASSIGN ASSIGN CALL LITERAL_ANCHOR

FUNC_DECL TRY PARAM CATCH RETURN RETURN CALL LITERAL_ANCHOR


public class MultipleChoiceInputRequest extends InputRequest {
    private Vector choices = new Vector();

    /**
     * @param prompt The prompt to show to the user.  Must not be null.
     * @param choices holds all input values that are allowed.
     *                Must not be null.
     */
    public MultipleChoiceInputRequest(String prompt, Vector choices) {
        super(prompt);
        if (choices == null) {
            throw new IllegalArgumentException("choices must not be null");
        }
        this.choices = choices;
    }

    /**
     * @return The possible values.
     */
    public Vector getChoices() {
        return choices;
    }

    /**
     * @return true if the input is one of the allowed values.
     */
    public boolean isInputValid() {
        return choices.contains(getInput());