org.apache.camel.builder.FromBuilder

public class FromBuilder extends BuilderSupport implements ProcessorFactory {
    public static final String DEFAULT_TRACE_CATEGORY = "org.apache.camel.TRACE";
    private RouteBuilder builder;
    private Endpoint from;
    private List<Processor> processors = new ArrayList<Processor>();
    private List<ProcessorFactory> processFactories = new ArrayList<ProcessorFactory>();
    private FromBuilder routeBuilder;

    public FromBuilder(RouteBuilder builder, Endpoint from) {
        super(builder);
        this.builder = builder;
        this.from = from;
    }

    public FromBuilder(FromBuilder parent) {
        super(parent);
        this.builder = parent.getBuilder();
        this.from = parent.getFrom();
    }

    /**
     * Sends the exchange to the given endpoint URI
     */
    @Fluent
    public ProcessorFactory to(@FluentArg("uri")String uri) {
        return to(endpoint(uri));
    }

    /**
     * Sends the exchange to the given endpoint
     */
    @Fluent
    public ProcessorFactory to(@FluentArg("ref")Endpoint endpoint) {
        ToBuilder answer = new ToBuilder(this, endpoint);
        addProcessBuilder(answer);
        return answer;
    }

    /**
     * Sends the exchange to a list of endpoints using the {@link MulticastProcessor} pattern
     */
    @Fluent
    public ProcessorFactory to(String... uris) {
        return to(endpoints(uris));
    }

    /**
     * Sends the exchange to a list of endpoints using the {@link MulticastProcessor} pattern
     */
    @Fluent
    public ProcessorFactory to(
            @FluentArg(value = "endpoint", attribute = false, element = true)
            Endpoint... endpoints) {
        return to(endpoints(endpoints));
    }

    /**
     * Sends the exchange to a list of endpoint using the {@link MulticastProcessor} pattern
     */
    @Fluent
    public ProcessorFactory to(@FluentArg(value = "endpoint", attribute = false, element = true)
    Collection<Endpoint> endpoints) {
        return addProcessBuilder(new MulticastBuilder(this, endpoints));
    }

    /**
     * Creates a {@link Pipeline} of the list of endpoints so that the message will get processed by each endpoint in turn
     * and for request/response the output of one endpoint will be the input of the next endpoint
     */
    @Fluent
    public ProcessorFactory pipeline(@FluentArg("uris")String... uris) {
        return pipeline(endpoints(uris));
    }

    /**
     * Creates a {@link Pipeline} of the list of endpoints so that the message will get processed by each endpoint in turn
     * and for request/response the output of one endpoint will be the input of the next endpoint
     */
    @Fluent
    public ProcessorFactory pipeline(@FluentArg("endpoints")Endpoint... endpoints) {
        return pipeline(endpoints(endpoints));
    }

    /**
     * Creates a {@link Pipeline} of the list of endpoints so that the message will get processed by each endpoint in turn
     * and for request/response the output of one endpoint will be the input of the next endpoint
     */
    @Fluent
    public ProcessorFactory pipeline(@FluentArg("endpoints")Collection<Endpoint> endpoints) {
        return addProcessBuilder(new PipelineBuilder(this, endpoints));
    }

    /**
     * Creates an {@link IdempotentConsumer} to avoid duplicate messages
     */
    @Fluent
    public IdempotentConsumerBuilder idempotentConsumer(
            @FluentArg("messageIdExpression")Expression messageIdExpression,
            @FluentArg("MessageIdRepository")MessageIdRepository messageIdRepository) {
        return (IdempotentConsumerBuilder) addProcessBuilder(new IdempotentConsumerBuilder(this, messageIdExpression, messageIdRepository));
    }

    /**
     * Creates a predicate which is applied and only if it is true then
     * the exchange is forwarded to the destination
     *
     * @return the builder for a predicate
     */
    @Fluent
    public FilterBuilder filter(
            @FluentArg(value = "predicate", element = true)
            Predicate predicate) {
        FilterBuilder answer = new FilterBuilder(this, predicate);
        addProcessBuilder(answer);
        return answer;
    }

    /**
     * Creates a choice of one or more predicates with an otherwise clause
     *
     * @return the builder for a choice expression
     */
    @Fluent(nestedActions = true)
    public ChoiceBuilder choice() {
        ChoiceBuilder answer = new ChoiceBuilder(this);
        addProcessBuilder(answer);
        return answer;
    }

    /**
     *
     * @param receipients is the builder of the expression used in the {@link RecipientList} to decide the destinations
     */
    @Fluent
    public RecipientListBuilder recipientList(
            @FluentArg(value = "recipients", element = true)
            Expression receipients) {
        RecipientListBuilder answer = new RecipientListBuilder(this, receipients);
        addProcessBuilder(answer);
        return answer;
    }

    /**
     * where an expression is evaluated to iterate through each of the parts of a message and then each part is then send to some endpoint.
     *
     * @param receipients the expression on which to split
     * @return the builder
     */
    @Fluent
    public SplitterBuilder splitter(@FluentArg(value = "recipients", element = true)Expression receipients) {
        SplitterBuilder answer = new SplitterBuilder(this, receipients);
        addProcessBuilder(answer);
        return answer;
    }

    /**
     * where an expression is evaluated to be able to compare the message exchanges to reorder them. e.g. you
     * may wish to sort by some header
     *
     * @param expression the expression on which to compare messages in order
     * @return the builder
     */
    public ResequencerBuilder resequencer(Expression<Exchange> expression) {
        return resequencer(Collections.<Expression<Exchange>>singletonList(expression));
    }

    /**
     * where a list of expressions are evaluated to be able to compare the message exchanges to reorder them. e.g. you
     * may wish to sort by some headers
     *
     * @param expressions the expressions on which to compare messages in order
     * @return the builder
     */
    @Fluent
    public ResequencerBuilder resequencer(@FluentArg(value = "expressions")List<Expression<Exchange>> expressions) {
        ResequencerBuilder answer = new ResequencerBuilder(this, expressions);
        setRouteBuilder(answer);
        return answer;
    }

    /**
     * where a list of expressions are evaluated to be able to compare the message exchanges to reorder them. e.g. you
     * may wish to sort by some headers
     *
     * @param expressions the expressions on which to compare messages in order
     * @return the builder
     */
    @Fluent
    public ResequencerBuilder resequencer(Expression<Exchange>... expressions) {
        List<Expression<Exchange>> list = new ArrayList<Expression<Exchange>>();
        for (Expression<Exchange> expression : expressions) {
            list.add(expression);
        }
        return resequencer(list);
    }

    /**
     * Installs the given error handler builder
     *
     * @param errorHandlerBuilder the error handler to be used by default for all child routes
     * @return the current builder with the error handler configured
     */
    @Fluent
    public FromBuilder errorHandler(@FluentArg("handler")ErrorHandlerBuilder errorHandlerBuilder) {
        setErrorHandlerBuilder(errorHandlerBuilder);
        return this;
    }

    /**
     * Configures whether or not the error handler is inherited by every processing node (or just the top most one)
     *
     * @param condition the falg as to whether error handlers should be inherited or not
     * @return the current builder
     */
    @Fluent
    public FromBuilder inheritErrorHandler(@FluentArg("condition")boolean condition) {
        setInheritErrorHandler(condition);
        return this;
    }

    @Fluent(nestedActions = true)
    public InterceptorBuilder intercept() {
        InterceptorBuilder answer = new InterceptorBuilder(this);
        addProcessBuilder(answer);
        return answer;
    }

    /**
     * Trace logs the exchange before it goes to the next processing step using the {@link #DEFAULT_TRACE_CATEGORY} logging
     * category.
     *
     * @return
     */
    @Fluent
    public FromBuilder trace() {
        return trace(DEFAULT_TRACE_CATEGORY);
    }

    /**
     * Trace logs the exchange before it goes to the next processing step using the specified logging
     * category.
     *
     * @param category the logging category trace messages will sent to.
     * @return
     */
    @Fluent
    public FromBuilder trace(@FluentArg("category")String category) {
        final Log log = LogFactory.getLog(category);
        return intercept(new DelegateProcessor() {
            @Override
            public void process(Exchange exchange) throws Exception {
                log.trace(exchange);
                processNext(exchange);
            }
        });
    }

    @Fluent
    public FromBuilder intercept(@FluentArg("interceptor")DelegateProcessor interceptor) {
        InterceptorBuilder answer = new InterceptorBuilder(this);
        answer.add(interceptor);
        addProcessBuilder(answer);
        return answer.target();
    }

    @Fluent(nestedActions = true)
    public PolicyBuilder policies() {
        PolicyBuilder answer = new PolicyBuilder(this);
        addProcessBuilder(answer);
        return answer;
    }

    @Fluent
    public FromBuilder policy(@FluentArg("policy")Policy policy) {
        PolicyBuilder answer = new PolicyBuilder(this);
        answer.add(policy);
        addProcessBuilder(answer);
        return answer.target();
    }

    /**
     * Adds the custom processor to this destination which could be a final destination, or could be a transformation in a pipeline
     */
    @Fluent
    public FromBuilder process(@FluentArg("ref")Processor processor) {
        addProcessorBuilder(processor);
        return this;
    }

    /**
     * Adds a processor which sets the body on the IN message
     */
    @Fluent
    public FromBuilder setBody(Expression expression) {
        addProcessorBuilder(ProcessorBuilder.setBody(expression));
        return this;
    }

    /**
     * Adds a processor which sets the body on the OUT message
     */
    @Fluent
    public FromBuilder setOutBody(Expression expression) {
        addProcessorBuilder(ProcessorBuilder.setOutBody(expression));
        return this;
    }

    /**
     * Adds a processor which sets the header on the IN message
     */
    @Fluent
    public FromBuilder setHeader(String name, Expression expression) {
        addProcessorBuilder(ProcessorBuilder.setHeader(name, expression));
        return this;
    }

    /**
     * Adds a processor which sets the header on the OUT message
     */
    @Fluent
    public FromBuilder setOutHeader(String name, Expression expression) {
        addProcessorBuilder(ProcessorBuilder.setOutHeader(name, expression));
        return this;
    }

    /**
     * Adds a processor which sets the exchange property
     */
    @Fluent
    public FromBuilder setProperty(String name, Expression expression) {
        addProcessorBuilder(ProcessorBuilder.setProperty(name, expression));
        return this;
    }

    /**
     * Converts the IN message body to the specified type
     */
    @Fluent
    public FromBuilder convertBodyTo(Class type) {
        addProcessorBuilder(ProcessorBuilder.setBody(Builder.body().convertTo(type)));
        return this;
    }

    /**
     * Converts the OUT message body to the specified type
     */
    @Fluent
    public FromBuilder convertOutBodyTo(Class type) {
        addProcessorBuilder(ProcessorBuilder.setOutBody(Builder.outBody().convertTo(type)));
        return this;
    }

    public RouteBuilder getBuilder() {
        return builder;
    }

    public Endpoint getFrom() {
        return from;
    }

    public List<Processor> getProcessors() {
        return processors;
    }

    public ProcessorFactory addProcessBuilder(ProcessorFactory processFactory) {
        processFactories.add(processFactory);
        return processFactory;
    }

    protected void addProcessorBuilder(Processor processor) {
        addProcessBuilder(new ConstantProcessorBuilder(processor));
    }

    public void addProcessor(Processor processor) {
        processors.add(processor);
    }

    public Route createRoute() throws Exception {
        if (routeBuilder != null) {
            return routeBuilder.createRoute();
        }
        Processor processor = createProcessor();
        if (processor == null) {
            throw new IllegalArgumentException("No processor created for: " + this);
        }
        return new EventDrivenConsumerRoute(getFrom(), processor);
    }

    public Processor createProcessor() throws Exception {
        List<Processor> answer = new ArrayList<Processor>();

        for (ProcessorFactory processFactory : processFactories) {
            Processor processor = makeProcessor(processFactory);
            if (processor == null) {
                throw new IllegalArgumentException("No processor created for processBuilder: " + processFactory);
            }
            answer.add(processor);
        }
        if (answer.size() == 0) {
            return null;
        }
        Processor processor = null;
        if (answer.size() == 1) {
            processor = answer.get(0);
        }
        else {
            processor = new CompositeProcessor(answer);
        }
        return processor;
    }

    /**
     * Creates the processor and wraps it in any necessary interceptors and error handlers
     */
    protected Processor makeProcessor(ProcessorFactory processFactory) throws Exception {
        Processor processor = processFactory.createProcessor();
        processor = wrapProcessor(processor);
        return wrapInErrorHandler(processor);
    }

    /**
     * A strategy method to allow newly created processors to be wrapped in an error handler. This feature
     * could be disabled for child builders such as {@link IdempotentConsumerBuilder} which will rely on the
     * {@link FromBuilder} to perform the error handling to avoid doubly-wrapped processors with 2 nested error handlers
     */
    protected Processor wrapInErrorHandler(Processor processor) throws Exception {
        return getErrorHandlerBuilder().createErrorHandler(processor);
    }

    /**
     * A strategy method which allows derived classes to wrap the child processor in some kind of interceptor such as
     * a filter for the {@link IdempotentConsumerBuilder}.
     *
     * @param processor the processor which can be wrapped
     * @return the original processor or a new wrapped interceptor
     */
    protected Processor wrapProcessor(Processor processor) {
        return processor;
    }

    protected FromBuilder getRouteBuilder() {
        return routeBuilder;
    }

    protected void setRouteBuilder(FromBuilder routeBuilder) {
        this.routeBuilder = routeBuilder;

FUNC_DECL RETURN PARAM CALL LITERAL_ANCHOR CALL

FUNC_DECL RETURN LOOP VAR_DECL PARAM CALL CALL CALL

FUNC_DECL RETURN VAR_DECL PARAM CALL LITERAL_ANCHOR CALL CALL FUNC_DECL PARAM CALL CALL

FUNC_DECL RETURN VAR_DECL PARAM CALL CALL CALL LITERAL_ANCHOR CALL

FUNC_DECL RETURN PARAM CALL CALL CALL CALL

FUNC_DECL RETURN VAR_DECL PARAM CALL ASSIGN CALL CALL


class SecuritySupport12 extends SecuritySupport {

    ClassLoader getContextClassLoader() {
        return (ClassLoader)
                AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() {
                ClassLoader cl = null;
                try {
                    cl = Thread.currentThread().getContextClassLoader();
                } catch (SecurityException ex) { }
                return cl;
            }
        });
    }

    ClassLoader getSystemClassLoader() {
        return (ClassLoader)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    ClassLoader cl = null;
                    try {
                        cl = ClassLoader.getSystemClassLoader();
                    } catch (SecurityException ex) {}
                    return cl;
                }
            });
    }

    ClassLoader getParentClassLoader(final ClassLoader cl) {
        return (ClassLoader)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    ClassLoader parent = null;
                    try {
                        parent = cl.getParent();
                    } catch (SecurityException ex) {}

                    return (parent == cl) ? null : parent;
                }
            });
    }

    String getSystemProperty(final String propName) {
        return (String)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    return System.getProperty(propName);
                }
            });
    }

    FileInputStream getFileInputStream(final File file)
        throws FileNotFoundException
    {
        try {
            return (FileInputStream)
                AccessController.doPrivileged(new PrivilegedExceptionAction() {
                    public Object run() throws FileNotFoundException {
                        return new FileInputStream(file);
                    }
                });
        } catch (PrivilegedActionException e) {
            throw (FileNotFoundException)e.getException();
        }
    }

    InputStream getResourceAsStream(final ClassLoader cl,
                                           final String name)
    {
        return (InputStream)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    InputStream ris;
                    if (cl == null) {
                        ris = ClassLoader.getSystemResourceAsStream(name);
                    } else {
                        ris = cl.getResourceAsStream(name);
                    }
                    return ris;
                }
            });
    }

    boolean getFileExists(final File f) {
    return ((Boolean)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    return new Boolean(f.exists());
                }
            })).booleanValue();
    }

    long getLastModified(final File f) {
    return ((Long)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    return new Long(f.lastModified());

FUNC_DECL RETURN CALL CALL FUNC_DECL RETURN TRY VAR_DECL CATCH ASSIGN LITERAL_ANCHOR CALL CALL

FUNC_DECL TRY PARAM CATCH RETURN THROW_RAISE CALL CALL CALL FUNC_DECL RETURN CALL

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

FUNC_DECL RETURN PARAM CALL CALL FUNC_DECL RETURN CALL CALL


org.apache.tools.ant.taskdefs.Touch

public class Touch extends Task {

    private File file;
    private long millis = -1;
    private String dateTime;
    private Vector filesets = new Vector();
    private FileUtils fileUtils;

    public Touch() {
        fileUtils = FileUtils.newFileUtils();
    }

    /**
     * Sets a single source file to touch.  If the file does not exist
     * an empty file will be created.
     */
    public void setFile(File file) {
        this.file = file;
    }

    /**
     * the new modification time of the file
     * in milliseconds since midnight Jan 1 1970.
     * Optional, default=now
     */
    public void setMillis(long millis) {
        this.millis = millis;
    }

    /**
     * the new modification time of the file
     * in the format MM/DD/YYYY HH:MM AM <i>or</i> PM;
     * Optional, default=now
     */
    public void setDatetime(String dateTime) {
        this.dateTime = dateTime;
    }

    /**
     * Add a set of files to touch
     */
    public void addFileset(FileSet set) {
        filesets.addElement(set);
    }

    /**
     * Execute the touch operation.
     */
    public void execute() throws BuildException {
        long savedMillis = millis;

        if (file == null && filesets.size() == 0) {
            throw
                new BuildException("Specify at least one source - a file or "
                                   + "a fileset.");
        }

        if (file != null && file.exists() && file.isDirectory()) {
            throw new BuildException("Use a fileset to touch directories.");
        }

        try {
            if (dateTime != null) {
                DateFormat df =
                    DateFormat.getDateTimeInstance(DateFormat.SHORT,
                                                   DateFormat.SHORT,
                                                   Locale.US);
                try {
                    setMillis(df.parse(dateTime).getTime());
                    if (millis < 0) {
                        throw new BuildException("Date of " + dateTime
                                                 + " results in negative "
                                                 + "milliseconds value "
                                                 + "relative to epoch "
                                                 + "(January 1, 1970, "
                                                 + "00:00:00 GMT).");
                    }
                } catch (ParseException pe) {
                    throw new BuildException(pe.getMessage(), pe, location);
                }
            }

            touch();
        } finally {
            millis = savedMillis;
        }
    }

    /**
     * Does the actual work. Entry point for Untar and Expand as well.
     */
    protected void touch() throws BuildException {
        if (file != null) {
            if (!file.exists()) {
                log("Creating " + file, Project.MSG_INFO);
                try {
                    fileUtils.createNewFile(file);
                } catch (IOException ioe) {
                    throw new BuildException("Could not create " + file, ioe,
                                             location);
                }
            }
        }

        if (millis >= 0 &&
            JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
            log("modification time of files cannot be set in JDK 1.1",
                Project.MSG_WARN);
            return;
        }

        boolean resetMillis = false;
        if (millis < 0) {
            resetMillis = true;
            millis = System.currentTimeMillis();
        }

        if (file != null) {
            touch(file);
        }

        for (int i = 0; i < filesets.size(); i++) {
            FileSet fs = (FileSet) filesets.elementAt(i);
            DirectoryScanner ds = fs.getDirectoryScanner(project);
            File fromDir = fs.getDir(project);

            String[] srcFiles = ds.getIncludedFiles();
            String[] srcDirs = ds.getIncludedDirectories();

            for (int j = 0; j < srcFiles.length ; j++) {
                touch(new File(fromDir, srcFiles[j]));
            }

            for (int j = 0; j < srcDirs.length ; j++) {
                touch(new File(fromDir, srcDirs[j]));
            }
        }

        if (resetMillis) {
            millis = -1;
        }
    }

    protected void touch(File file) throws BuildException {
        if (!file.canWrite()) {
            throw new BuildException("Can not change modification date of "
                                     + "read-only file " + file);
        }

        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
            return;
        }

        fileUtils.setFileLastModified(file, millis);


public abstract class AssertionClause<E extends Exchange> implements Runnable {

    private List<Predicate<E>> predicates = new ArrayList<Predicate<E>>();

    /**
     * Adds the given predicate to this assertion clause
     */
    public AssertionClause<E> predicate(Predicate<E> predicate) {
        addPredicate(predicate);
        return this;
    }

    /**
     * Returns a predicate and value builder for headers on an exchange
     */

    public ValueBuilder<E> header(String name) {
        Expression<E> expression = headerExpression(name);
        return new PredicateValueBuilder(expression);
    }

    /**
     * Returns a predicate and value builder for the inbound body on an exchange
     */

    public PredicateValueBuilder body() {
        Expression<E> expression = bodyExpression();
        return new PredicateValueBuilder(expression);
    }

    /**
     * Returns a predicate and value builder for the inbound message body as a
     * specific type
     */

    public <T> PredicateValueBuilder bodyAs(Class<T> type) {
        Expression<E> expression = bodyExpression(type);
        return new PredicateValueBuilder(expression);
    }

    /**
     * Returns a predicate and value builder for the outbound body on an
     * exchange
     */

    public PredicateValueBuilder outBody() {
        Expression<E> expression = bodyExpression();
        return new PredicateValueBuilder(expression);
    }

    /**
     * Returns a predicate and value builder for the outbound message body as a
     * specific type
     */

    public <T> PredicateValueBuilder outBody(Class<T> type) {
        Expression<E> expression = bodyExpression(type);
        return new PredicateValueBuilder(expression);
    }

    /**
     * Performs any assertions on the given exchange
     */
    protected void applyAssertionOn(MockEndpoint endpoint, int index, E exchange) {
        for (Predicate<E> predicate : predicates) {
            predicate.assertMatches(endpoint.getEndpointUri() + " ", exchange);
        }
    }

    protected void addPredicate(Predicate<E> predicate) {
        predicates.add(predicate);
    }

    public class PredicateValueBuilder extends ValueBuilder<E> {

        public PredicateValueBuilder(Expression<E> expression) {
            super(expression);
        }

        protected Predicate<E> onNewPredicate(Predicate<E> predicate) {
            addPredicate(predicate);
            return predicate;

FUNC_DECL RETURN VAR_DECL PARAM CALL CALL

FUNC_DECL LOOP PARAM PARAM PARAM CALL BINARY_OP LITERAL_ANCHOR CALL


public class Category implements AppenderAttachable {

  /**
     The hierarchy where categories are attached to by default.
  */
  //static
  //public
  //final Hierarchy defaultHierarchy = new Hierarchy(new
  //					   RootCategory(Level.DEBUG));

  /**
     The name of this category.
  */
  protected String   name;

  /**
     The assigned level of this category.  The
     level variable need not be assigned a value in
     which case it is inherited form the hierarchy.  */
  volatile protected Level level;

  /**
     The parent of this category. All categories have at least one
     ancestor which is the root category. */
  volatile protected Category parent;

  /**
     The fully qualified name of the Category class. See also the
     getFQCN method. */
  private static final String FQCN = Category.class.getName();

  protected ResourceBundle resourceBundle;

  // Categories need to know what Hierarchy they are in
  protected LoggerRepository repository;

  AppenderAttachableImpl aai;

  /** Additivity is set to true by default, that is children inherit
      the appenders of their ancestors by default. If this variable is
      set to false then the appenders found in the
      ancestors of this category are not used. However, the children
      of this category will inherit its appenders, unless the children
      have their additivity flag set to false too. See
      the user manual for more details. */
  protected boolean additive = true;

  /**
     This constructor created a new Category instance and
     sets its name.

It is intended to be used by sub-classes only. You should not
     create categories directly.

     @param name The name of the category.
  */
  protected
  Category(String name) {
    this.name = name;
  }

  /**
     Add newAppender to the list of appenders of this
     Category instance.

If newAppender is already in the list of
     appenders, then it won't be added again.
  */
  synchronized
  public
  void addAppender(Appender newAppender) {
    if(aai == null) {
      aai = new AppenderAttachableImpl();
    }
    aai.addAppender(newAppender);
    repository.fireAddAppenderEvent(this, newAppender);
  }

  /**
     If assertion parameter is false, then
     logs msg as an {@link #error(Object) error} statement.

The assert method has been renamed to
     assertLog because assert is a language
     reserved word in JDK 1.4.

     @param assertion
     @param msg The message to print if assertion is
     false.

     @since 1.2 */
  public
  void assertLog(boolean assertion, String msg) {
    if(!assertion)
      this.error(msg);
  }

  /**
     Call the appenders in the hierrachy starting at
     this.  If no appenders could be found, emit a
     warning.

This method calls all the appenders inherited from the
     hierarchy circumventing any evaluation of whether to log or not
     to log the particular log request.

     @param event the event to log.  */
  public
  void callAppenders(LoggingEvent event) {
    int writes = 0;

    for(Category c = this; c != null; c=c.parent) {
      // Protected against simultaneous call to addAppender, removeAppender,...
      synchronized(c) {
	if(c.aai != null) {
	  writes += c.aai.appendLoopOnAppenders(event);
	}
	if(!c.additive) {
	  break;
	}
      }
    }

    if(writes == 0) {
      repository.emitNoAppenderWarning(this);
    }
  }

  /**
     Close all attached appenders implementing the AppenderAttachable
     interface.
     @since 1.0
  */
  synchronized
  void closeNestedAppenders() {
    Enumeration enumeration = this.getAllAppenders();
    if(enumeration != null) {
      while(enumeration.hasMoreElements()) {
	Appender a = (Appender) enumeration.nextElement();
	if(a instanceof AppenderAttachable) {
	  a.close();
	}
      }
    }
  }

  /**
    Log a message object with the {@link Level#DEBUG DEBUG} level.

This method first checks if this category is DEBUG
    enabled by comparing the level of this category with the {@link
    Level#DEBUG DEBUG} level. If this category is
    DEBUG enabled, then it converts the message object
    (passed as parameter) to a string by invoking the appropriate
    {@link org.apache.log4j.or.ObjectRenderer}. It then proceeds to call all the
    registered appenders in this category and also higher in the
    hierarchy depending on the value of the additivity flag.

WARNING Note that passing a {@link Throwable} to this
    method will print the name of the Throwable but no
    stack trace. To print a stack trace use the {@link #debug(Object,
    Throwable)} form instead.

    @param message the message object to log. */
  public
  void debug(Object message) {
    if(repository.isDisabled(Level.DEBUG_INT))
      return;
    if(Level.DEBUG.isGreaterOrEqual(this.getEffectiveLevel())) {
      forcedLog(FQCN, Level.DEBUG, message, null);
    }
  }

  /**
   Log a message object with the DEBUG level including
   the stack trace of the {@link Throwable} t passed as
   parameter.

See {@link #debug(Object)} form for more detailed information.

   @param message the message object to log.
   @param t the exception to log, including its stack trace.  */
  public
  void debug(Object message, Throwable t) {
    if(repository.isDisabled(Level.DEBUG_INT))
      return;
    if(Level.DEBUG.isGreaterOrEqual(this.getEffectiveLevel()))
      forcedLog(FQCN, Level.DEBUG, message, t);
  }

  /**
    Log a message object with the {@link Level#ERROR ERROR} Level.

This method first checks if this category is ERROR
    enabled by comparing the level of this category with {@link
    Level#ERROR ERROR} Level. If this category is ERROR
    enabled, then it converts the message object passed as parameter
    to a string by invoking the appropriate {@link
    org.apache.log4j.or.ObjectRenderer}. It proceeds to call all the
    registered appenders in this category and also higher in the
    hierarchy depending on the value of the additivity flag.

WARNING Note that passing a {@link Throwable} to this
    method will print the name of the Throwable but no
    stack trace. To print a stack trace use the {@link #error(Object,
    Throwable)} form instead.

    @param message the message object to log */
  public
  void error(Object message) {
    if(repository.isDisabled(Level.ERROR_INT))
      return;
    if(Level.ERROR.isGreaterOrEqual(this.getEffectiveLevel()))
      forcedLog(FQCN, Level.ERROR, message, null);
  }

  /**
   Log a message object with the ERROR level including
   the stack trace of the {@link Throwable} t passed as
   parameter.

See {@link #error(Object)} form for more detailed information.

   @param message the message object to log.
   @param t the exception to log, including its stack trace.  */
  public
  void error(Object message, Throwable t) {
    if(repository.isDisabled(Level.ERROR_INT))
      return;
    if(Level.ERROR.isGreaterOrEqual(this.getEffectiveLevel()))
      forcedLog(FQCN, Level.ERROR, message, t);

  }

  /**
     If the named category exists (in the default hierarchy) then it
     returns a reference to the category, otherwise it returns
     null.

     @deprecated Please use {@link LogManager#exists} instead.

     @since 0.8.5 */
  public
  static
  Logger exists(String name) {
    return LogManager.exists(name);
  }

  /**
    Log a message object with the {@link Level#FATAL FATAL} Level.

This method first checks if this category is FATAL
    enabled by comparing the level of this category with {@link
    Level#FATAL FATAL} Level. If the category is FATAL
    enabled, then it converts the message object passed as parameter
    to a string by invoking the appropriate
    {@link org.apache.log4j.or.ObjectRenderer}. It
    proceeds to call all the registered appenders in this category and
    also higher in the hierarchy depending on the value of the
    additivity flag.

WARNING Note that passing a {@link Throwable} to this
    method will print the name of the Throwable but no stack trace. To
    print a stack trace use the {@link #fatal(Object, Throwable)} form
    instead.

    @param message the message object to log */
  public
  void fatal(Object message) {
    if(repository.isDisabled(Level.FATAL_INT))
      return;
    if(Level.FATAL.isGreaterOrEqual(this.getEffectiveLevel()))
      forcedLog(FQCN, Level.FATAL, message, null);
  }

  /**
   Log a message object with the FATAL level including
   the stack trace of the {@link Throwable} t passed as
   parameter.

See {@link #fatal(Object)} for more detailed information.

   @param message the message object to log.
   @param t the exception to log, including its stack trace.  */
  public
  void fatal(Object message, Throwable t) {
    if(repository.isDisabled(Level.FATAL_INT))
      return;
    if(Level.FATAL.isGreaterOrEqual(this.getEffectiveLevel()))
      forcedLog(FQCN, Level.FATAL, message, t);
  }

  /**
     This method creates a new logging event and logs the event
     without further checks.  */
  protected
  void forcedLog(String fqcn, Priority level, Object message, Throwable t) {
    callAppenders(new LoggingEvent(fqcn, this, level, message, t));
  }

  /**
     Get the additivity flag for this Category instance.
  */
  public
  boolean getAdditivity() {
    return additive;
  }

  /**
     Get the appenders contained in this category as an {@link
     Enumeration}. If no appenders can be found, then a {@link NullEnumeration}
     is returned.

     @return Enumeration An enumeration of the appenders in this category.  */
  synchronized
  public
  Enumeration getAllAppenders() {
    if(aai == null)
      return NullEnumeration.getInstance();
    else
      return aai.getAllAppenders();
  }

  /**
     Look for the appender named as name.

Return the appender with that name if in the list. Return
     null otherwise.  */
  synchronized
  public
  Appender getAppender(String name) {
     if(aai == null || name == null)
      return null;

     return aai.getAppender(name);
  }

  /**
     Starting from this category, search the category hierarchy for a
     non-null level and return it. Otherwise, return the level of the
     root category.

The Category class is designed so that this method executes as
     quickly as possible.
   */
  public
  Level getEffectiveLevel() {
    for(Category c = this; c != null; c=c.parent) {
      if(c.level != null)
	return c.level;
    }
    return null; // If reached will cause an NullPointerException.
  }

  /**
    *
    * @deprecated Please use the the {@link #getEffectiveLevel} method
    * instead.
    * */
  public
  Priority getChainedPriority() {
    for(Category c = this; c != null; c=c.parent) {
      if(c.level != null)
	return c.level;
    }
    return null; // If reached will cause an NullPointerException.
  }

  /**
     Returns all the currently defined categories in the default
     hierarchy as an {@link java.util.Enumeration Enumeration}.

The root category is not included in the returned
     {@link Enumeration}.

     @deprecated Please use {@link LogManager#getCurrentLoggers()} instead.
  */
  public
  static
  Enumeration getCurrentCategories() {
    return LogManager.getCurrentLoggers();
  }

  /**
     Return the default Hierarchy instance.

     @deprecated Please use {@link LogManager#getLoggerRepository()} instead.

     @since 1.0
   */
  public
  static
  LoggerRepository getDefaultHierarchy() {
    return LogManager.getLoggerRepository();
  }

  /**
     Return the the {@link Hierarchy} where this Category
     instance is attached.

     @deprecated Please use {@link #getLoggerRepository} instead.

     @since 1.1 */
  public
  LoggerRepository  getHierarchy() {
    return repository;
  }

  /**
     Return the the {@link LoggerRepository} where this
     Category is attached.

     @since 1.2 */
  public
  LoggerRepository  getLoggerRepository() {
    return repository;
  }

 /**
  * @deprecated Make sure to use {@link Logger#getLogger(String)} instead.
  */
  public
  static
  Category getInstance(String name) {
    return LogManager.getLogger(name);
  }

 /**
  * @deprecated Please make sure to use {@link Logger#getLogger(Class)} instead.
  */
  public
  static
  Category getInstance(Class clazz) {
    return LogManager.getLogger(clazz);
  }

  /**
     Return the category name.  */
  public
  final
  String getName() {
    return name;
  }

  /**
     Returns the parent of this category. Note that the parent of a
     given category may change during the lifetime of the category.

The root category will return null.

     @since 1.2
  */
  final
  public
  Category getParent() {
    return this.parent;
  }

  /**
     Returns the assigned {@link Level}, if any, for this Category.

     @return Level - the assigned Level, can be null.
  */
  final
  public
  Level getLevel() {
    return this.level;
  }

  /**
     @deprecated Please use {@link #getLevel} instead.
  */
  final
  public
  Level getPriority() {
    return this.level;
  }

  /**
   *  @deprecated Please use {@link Logger#getRootLogger()} instead.
   */
  final
  public
  static
  Category getRoot() {
    return LogManager.getRootLogger();
  }

  /**
     Return the inherited {@link ResourceBundle} for this
     category.

This method walks the hierarchy to find the appropriate
     resource bundle. It will return the resource bundle attached to
     the closest ancestor of this category, much like the way
     priorities are searched. In case there is no bundle in the
     hierarchy then null is returned.

     @since 0.9.0 */
  public
  ResourceBundle getResourceBundle() {
    for(Category c = this; c != null; c=c.parent) {
      if(c.resourceBundle != null)
	return c.resourceBundle;
    }
    // It might be the case that there is no resource bundle
    return null;
  }

  /**
     Returns the string resource coresponding to key in
     this category's inherited resource bundle. See also {@link
     #getResourceBundle}.

If the resource cannot be found, then an {@link #error error}
     message will be logged complaining about the missing resource.
  */
  protected
  String getResourceBundleString(String key) {
    ResourceBundle rb = getResourceBundle();
    // This is one of the rare cases where we can use logging in order
    // to report errors from within log4j.
    if(rb == null) {
      //if(!hierarchy.emittedNoResourceBundleWarning) {
      //error("No resource bundle has been set for category "+name);
      //hierarchy.emittedNoResourceBundleWarning = true;
      //}
      return null;
    }
    else {
      try {
	return rb.getString(key);
      }
      catch(MissingResourceException mre) {
	error("No resource is associated with key \""+key+"\".");
	return null;
      }
    }
  }

  /**
    Log a message object with the {@link Level#INFO INFO} Level.

This method first checks if this category is INFO
    enabled by comparing the level of this category with {@link
    Level#INFO INFO} Level. If the category is INFO
    enabled, then it converts the message object passed as parameter
    to a string by invoking the appropriate
    {@link org.apache.log4j.or.ObjectRenderer}. It
    proceeds to call all the registered appenders in this category and
    also higher in the hierarchy depending on the value of the
    additivity flag.

WARNING Note that passing a {@link Throwable} to this
    method will print the name of the Throwable but no stack trace. To
    print a stack trace use the {@link #info(Object, Throwable)} form
    instead.

    @param message the message object to log */
  public
  void info(Object message) {
    if(repository.isDisabled(Level.INFO_INT))
      return;
    if(Level.INFO.isGreaterOrEqual(this.getEffectiveLevel()))
      forcedLog(FQCN, Level.INFO, message, null);
  }

  /**
   Log a message object with the INFO level including
   the stack trace of the {@link Throwable} t passed as
   parameter.

See {@link #info(Object)} for more detailed information.

   @param message the message object to log.
   @param t the exception to log, including its stack trace.  */
  public
  void info(Object message, Throwable t) {
    if(repository.isDisabled(Level.INFO_INT))
      return;
    if(Level.INFO.isGreaterOrEqual(this.getEffectiveLevel()))
      forcedLog(FQCN, Level.INFO, message, t);
  }

  /**
     Is the appender passed as parameter attached to this category?
   */
  public
  boolean isAttached(Appender appender) {
    if(appender == null || aai == null)
      return false;
    else {
      return aai.isAttached(appender);
    }
  }

  /**
    *  Check whether this category is enabled for the DEBUG
    *  Level.
    *
    *
 This function is intended to lessen the computational cost of
    *  disabled log debug statements.
    *
    *
 For some cat Category object, when you write,
    *

    *      cat.debug("This is entry number: " + i );
    *

    *
    *
You incur the cost constructing the message, concatenatiion in
    *  this case, regardless of whether the message is logged or not.
    *
    *
If you are worried about speed, then you should write
    *

    * 	 if(cat.isDebugEnabled()) {
    * 	   cat.debug("This is entry number: " + i );
    * 	 }
    *

    *
    *
This way you will not incur the cost of parameter
    *  construction if debugging is disabled for cat. On
    *  the other hand, if the cat is debug enabled, you
    *  will incur the cost of evaluating whether the category is debug
    *  enabled twice. Once in isDebugEnabled and once in
    *  the debug.  This is an insignificant overhead
    *  since evaluating a category takes about 1%% of the time it
    *  takes to actually log.
    *
    *  @return boolean - true if this category is debug
    *  enabled, false otherwise.
    *   */
  public
  boolean isDebugEnabled() {
    if(repository.isDisabled( Level.DEBUG_INT))
      return false;
    return Level.DEBUG.isGreaterOrEqual(this.getEffectiveLevel());
  }

  /**
     Check whether this category is enabled for a given {@link
     Level} passed as parameter.

     See also {@link #isDebugEnabled}.

     @return boolean True if this category is enabled for level.
  */
  public
  boolean isEnabledFor(Priority level) {
    if(repository.isDisabled(level.level))
      return false;
    return level.isGreaterOrEqual(this.getEffectiveLevel());
  }

  /**
    Check whether this category is enabled for the info Level.
    See also {@link #isDebugEnabled}.

    @return boolean - true if this category is enabled
    for level info, false otherwise.
  */
  public
  boolean isInfoEnabled() {
    if(repository.isDisabled(Level.INFO_INT))
      return false;
    return Level.INFO.isGreaterOrEqual(this.getEffectiveLevel());
  }

  /**
     Log a localized message. The user supplied parameter
     key is replaced by its localized version from the
     resource bundle.

     @see #setResourceBundle

     @since 0.8.4 */
  public
  void l7dlog(Priority priority, String key, Throwable t) {
    if(repository.isDisabled(priority.level)) {
      return;
    }
    if(priority.isGreaterOrEqual(this.getEffectiveLevel())) {
      String msg = getResourceBundleString(key);
      // if message corresponding to 'key' could not be found in the
      // resource bundle, then default to 'key'.
      if(msg == null) {
	msg = key;
      }
      forcedLog(FQCN, priority, msg, t);
    }
  }
  /**
     Log a localized and parameterized message. First, the user
     supplied key is searched in the resource
     bundle. Next, the resulting pattern is formatted using
     {@link java.text.MessageFormat#format(String,Object[])} method with the
     user supplied object array params.

     @since 0.8.4
  */
  public
  void l7dlog(Priority priority, String key,  Object[] params, Throwable t) {
    if(repository.isDisabled(priority.level)) {
      return;
    }
    if(priority.isGreaterOrEqual(this.getEffectiveLevel())) {
      String pattern = getResourceBundleString(key);
      String msg;
      if(pattern == null)
	msg = key;
      else
	msg = java.text.MessageFormat.format(pattern, params);
      forcedLog(FQCN, priority, msg, t);
    }
  }

  /**
     This generic form is intended to be used by wrappers.
   */
  public
  void log(Priority priority, Object message, Throwable t) {
    if(repository.isDisabled(priority.level)) {
      return;
    }
    if(priority.isGreaterOrEqual(this.getEffectiveLevel()))
      forcedLog(FQCN, priority, message, t);
  }

 /**
    This generic form is intended to be used by wrappers.
 */
  public
  void log(Priority priority, Object message) {
    if(repository.isDisabled(priority.level)) {
      return;
    }
    if(priority.isGreaterOrEqual(this.getEffectiveLevel()))
      forcedLog(FQCN, priority, message, null);
  }

  /**

     This is the most generic printing method. It is intended to be
     invoked by wrapper classes.

     @param callerFQCN The wrapper class' fully qualified class name.
     @param level The level of the logging request.
     @param message The message of the logging request.
     @param t The throwable of the logging request, may be null.  */
  public
  void log(String callerFQCN, Priority level, Object message, Throwable t) {
    if(repository.isDisabled(level.level)) {
      return;
    }
    if(level.isGreaterOrEqual(this.getEffectiveLevel())) {
      forcedLog(callerFQCN, level, message, t);
    }
  }

    /**
      *  LoggerRepository forgot the fireRemoveAppenderEvent method,
      *     if using the stock Hierarchy implementation, then call its fireRemove.
      *     Custom repositories can implement HierarchyEventListener if they
      *     want remove notifications.
     * @param appender appender, may be null.
     */
   private void fireRemoveAppenderEvent(final Appender appender) {
       if (appender != null) {
         if (repository instanceof Hierarchy) {
           ((Hierarchy) repository).fireRemoveAppenderEvent(this, appender);
         } else if (repository instanceof HierarchyEventListener) {
             ((HierarchyEventListener) repository).removeAppenderEvent(this, appender);
         }
       }
   }

  /**
     Remove all previously added appenders from this Category
     instance.

This is useful when re-reading configuration information.
  */
  synchronized
  public
  void removeAllAppenders() {
    if(aai != null) {
      Vector appenders = new Vector();
      for (Enumeration iter = aai.getAllAppenders(); iter != null && iter.hasMoreElements();) {
          appenders.add(iter.nextElement());
      }
      aai.removeAllAppenders();
      for(Enumeration iter = appenders.elements(); iter.hasMoreElements();) {
          fireRemoveAppenderEvent((Appender) iter.nextElement());
      }
      aai = null;
    }
  }

  /**
     Remove the appender passed as parameter form the list of appenders.

     @since 0.8.2
  */
  synchronized
  public
  void removeAppender(Appender appender) {
    if(appender == null || aai == null)
      return;
    boolean wasAttached = aai.isAttached(appender);
    aai.removeAppender(appender);
    if (wasAttached) {
        fireRemoveAppenderEvent(appender);
    }
  }

  /**
     Remove the appender with the name passed as parameter form the
     list of appenders.

     @since 0.8.2 */
  synchronized
  public
  void removeAppender(String name) {
    if(name == null || aai == null) return;
    Appender appender = aai.getAppender(name);
    aai.removeAppender(name);
    if (appender != null) {
        fireRemoveAppenderEvent(appender);
    }
  }

  /**
     Set the additivity flag for this Category instance.
     @since 0.8.1
   */
  public
  void setAdditivity(boolean additive) {
    this.additive = additive;
  }

  /**
     Only the Hiearchy class can set the hiearchy of a
     category. Default package access is MANDATORY here.  */
  final
  void setHierarchy(LoggerRepository repository) {
    this.repository = repository;
  }

  /**
     Set the level of this Category. If you are passing any of
     Level.DEBUG, Level.INFO,
     Level.WARN, Level.ERROR,
     Level.FATAL as a parameter, you need to case them as
     Level.

As in
    logger.setLevel((Level) Level.DEBUG);

Null values are admitted.  */
  public
  void setLevel(Level level) {
    this.level = level;
  }

  /**
     Set the level of this Category.

Null values are admitted.

     @deprecated Please use {@link #setLevel} instead.
  */
  public
  void setPriority(Priority priority) {
    this.level = (Level) priority;
  }

  /**
     Set the resource bundle to be used with localized logging
     methods {@link #l7dlog(Priority,String,Throwable)} and {@link
     #l7dlog(Priority,String,Object[],Throwable)}.

     @since 0.8.4
   */
  public
  void setResourceBundle(ResourceBundle bundle) {
    resourceBundle = bundle;
  }

  /**
     Calling this method will safely close and remove all
     appenders in all the categories including root contained in the
     default hierachy.

Some appenders such as {@link org.apache.log4j.net.SocketAppender}
     and {@link AsyncAppender} need to be closed before the
     application exists. Otherwise, pending logging events might be
     lost.

The shutdown method is careful to close nested
     appenders before closing regular appenders. This is allows
     configurations where a regular appender is attached to a category
     and again to a nested appender.

     @deprecated Please use {@link LogManager#shutdown()} instead.

     @since 1.0
  */
  public
  static
  void shutdown() {
    LogManager.shutdown();
  }

  /**
    Log a message object with the {@link Level#WARN WARN} Level.

This method first checks if this category is WARN
    enabled by comparing the level of this category with {@link
    Level#WARN WARN} Level. If the category is WARN
    enabled, then it converts the message object passed as parameter
    to a string by invoking the appropriate
    {@link org.apache.log4j.or.ObjectRenderer}. It
    proceeds to call all the registered appenders in this category and
    also higher in the hieararchy depending on the value of the
    additivity flag.

WARNING Note that passing a {@link Throwable} to this
    method will print the name of the Throwable but no stack trace. To
    print a stack trace use the {@link #warn(Object, Throwable)} form
    instead.

    @param message the message object to log.  */
  public
  void warn(Object message) {
    if(repository.isDisabled( Level.WARN_INT))
      return;

    if(Level.WARN.isGreaterOrEqual(this.getEffectiveLevel()))
      forcedLog(FQCN, Level.WARN, message, null);
  }

  /**
   Log a message with the WARN level including the
   stack trace of the {@link Throwable} t passed as
   parameter.

See {@link #warn(Object)} for more detailed information.

   @param message the message object to log.
   @param t the exception to log, including its stack trace.  */
  public
  void warn(Object message, Throwable t) {
    if(repository.isDisabled(Level.WARN_INT))
      return;
    if(Level.WARN.isGreaterOrEqual(this.getEffectiveLevel()))
      forcedLog(FQCN, Level.WARN, message, t);

FUNC_DECL IF PARAM CALL CALL BINARY_OP LITERAL_ANCHOR ASSIGN CALL

FUNC_DECL IF IF PARAM CALL RETURN CALL CALL CALL LITERAL_ANCHOR

FUNC_DECL IF IF PARAM PARAM CALL RETURN CALL CALL CALL

FUNC_DECL IF IF PARAM CALL RETURN CALL CALL LITERAL_ANCHOR CALL

FUNC_DECL PARAM PARAM PARAM PARAM CALL CALL

  Level getLevel() {
    return this.level;

FUNC_DECL RETURN IF CALL RETURN CALL LITERAL_ANCHOR CALL

FUNC_DECL RETURN IF PARAM CALL RETURN CALL LITERAL_ANCHOR CALL

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

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

FUNC_DECL IF IF PARAM PARAM PARAM CALL CALL CALL RETURN CALL

FUNC_DECL IF IF PARAM PARAM CALL CALL CALL RETURN LITERAL_ANCHOR CALL

FUNC_DECL IF IF PARAM PARAM PARAM PARAM CALL CALL RETURN CALL CALL

  void shutdown() {
    LogManager.shutdown();


org.apache.poi.hssf.record.BeginRecord

public class BeginRecord
    extends Record
{
    public static final short sid = 0x1033;

    public BeginRecord()
    {
    }

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

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

    protected void fillFields(RecordInputStream in)
    {
    }

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

        buffer.append("[BEGIN]\n");
        buffer.append("[/BEGIN]\n");
        return buffer.toString();
    }

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

    public int getRecordSize()
    {
        return 4;
    }

    public short getSid()
    {
        return sid;

    public int getRecordSize()
    {
        return 4;

    public short getSid()
    {
        return sid;


org.gjt.sp.jedit.gui.HistoryModel

public class HistoryModel
{
	//{{{ HistoryModel constructor
	/**
	 * Creates a new history list. Calling this is normally not
	 * necessary.
	 */
	public HistoryModel(String name)
	{
		this.name = name;

		max = jEdit.getIntegerProperty("history",25);
		data = new Vector(max);
	} //}}}

	//{{{ addItem() method
	/**
	 * Adds an item to the end of this history list, trimming the list
	 * to the maximum number of items if necessary.
	 * @param text The item
	 */
	public void addItem(String text)
	{
		if(text == null || text.length() == 0)
			return;

		int index = data.indexOf(text);
		if(index != -1)
			data.removeElementAt(index);

		data.insertElementAt(text,0);

		while(getSize() > max)
			data.removeElementAt(data.size() - 1);
	} //}}}

	//{{{ getItem() method
	/**
	 * Returns an item from the history list.
	 * @param index The index
	 */
	public String getItem(int index)
	{
		return (String)data.elementAt(index);
	} //}}}

	//{{{ getSize() method
	/**
	 * Returns the number of elements in this history list.
	 */
	public int getSize()
	{
		return data.size();
	} //}}}

	//{{{ getName() method
	/**
	 * Returns the name of this history list. This can be passed
	 * to the HistoryTextField constructor.
	 */
	public String getName()
	{
		return name;
	} //}}}

	//{{{ getModel() method
	/**
	 * Returns a named model. If the specified model does not
	 * already exist, it will be created.
	 * @param name The model name
	 */
	public static HistoryModel getModel(String name)
	{
		if(models == null)
			models = new Hashtable();

		HistoryModel model = (HistoryModel)models.get(name);
		if(model == null)
		{
			model = new HistoryModel(name);
			models.put(name,model);
		}

		return model;
	} //}}}

	//{{{ loadHistory() method
	/**
	 * Loads the history from the specified file.
	 *
	 * jEdit calls this method on startup.
	 * @param The file
	 */
	public static void loadHistory(File file)
	{
		if(models == null)
			models = new Hashtable();

		try
		{
			BufferedReader in = new BufferedReader(new FileReader(file));

			HistoryModel currentModel = null;
			String line;

			while((line = in.readLine()) != null)
			{
				if(line.startsWith("[") && line.endsWith("]"))
				{
					if(currentModel != null)
					{
						models.put(currentModel.getName(),
							currentModel);
					}
					currentModel = new HistoryModel(line
						.substring(1,line.length() - 1));
				}
				else if(currentModel == null)
				{
					throw new IOException("History data starts"
						+ " before model name");
				}
				else
				{
					currentModel.data.addElement(MiscUtilities
						.escapesToChars(line));
				}
			}

			if(currentModel != null)
			{
				models.put(currentModel.getName(),currentModel);
			}

			in.close();
		}
		catch(FileNotFoundException fnf)
		{
			Log.log(Log.DEBUG,HistoryModel.class,fnf);
		}
		catch(IOException io)
		{
			Log.log(Log.ERROR,HistoryModel.class,io);
		}
	} //}}}

	//{{{ saveHistory() method
	/**
	 * Saves the history to the specified file.
	 *
	 * jEdit calls this method when it is exiting.
	 * @param file The file
	 */
	public static void saveHistory(File file)
	{
		String lineSep = System.getProperty("line.separator");
		try
		{
			BufferedWriter out = new BufferedWriter(
				new FileWriter(file));

			if(models == null)
			{
				out.close();
				return;
			}

			Enumeration modelEnum = models.elements();
			while(modelEnum.hasMoreElements())
			{
				HistoryModel model = (HistoryModel)modelEnum
					.nextElement();

				out.write('[');
				out.write(model.getName());
				out.write(']');
				out.write(lineSep);

				for(int i = 0; i < model.getSize(); i++)
				{
					out.write(MiscUtilities.charsToEscapes(
						model.getItem(i),
						TO_ESCAPE));
					out.write(lineSep);
				}
			}

			out.close();
		}
		catch(IOException io)
		{
			Log.log(Log.ERROR,HistoryModel.class,io);
		}
	} //}}}

	//{{{ Private members
	private static final String TO_ESCAPE = "\n\t\\\"'[]";
	private String name;
	private int max;
	private Vector data;
	private static Hashtable models;

	public String getName()
	{
		return name;

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

FUNC_DECL PARAM ASSIGN ASSIGN ASSIGN CALL CALL LITERAL_ANCHOR LITERAL_ANCHOR


org.apache.xalan.xslt.ObjectFactory

class ObjectFactory {

    private static final String DEFAULT_PROPERTIES_FILENAME =
                                                     "xalan.properties";

    private static final String SERVICES_PATH = "META-INF/services/";

    /** Set to true for debugging */
    private static final boolean DEBUG = false;

    /** cache the contents of the xalan.properties file.
     *  Until an attempt has been made to read this file, this will
     * be null; if the file does not exist or we encounter some other error
     * during the read, this will be empty.
     */
    private static Properties fXalanProperties = null;

    /***
     * Cache the time stamp of the xalan.properties file so
     * that we know if it's been modified and can invalidate
     * the cache when necessary.
     */
    private static long fLastModified = -1;

    /**
     * Finds the implementation Class object in the specified order.  The
     * specified order is the following:
     *

     *
query the system property using System.getProperty
     *
read META-INF/services/factoryId file
     *
use fallback classname
     *

     *
     * @return instance of factory, never null
     *
     * @param factoryId             Name of the factory to find, same as
     *                              a property name
     * @param fallbackClassName     Implementation class name, if nothing else
     *                              is found.  Use null to mean no fallback.
     *
     * @exception ObjectFactory.ConfigurationError
     */
    static Object createObject(String factoryId, String fallbackClassName)
        throws ConfigurationError {
        return createObject(factoryId, null, fallbackClassName);
		}
    /**
     * Finds the implementation Class object in the specified order.  The
     * specified order is the following:
     *

     *
query the system property using System.getProperty
     *
read $java.home/lib/propertiesFilename file
     *
read META-INF/services/factoryId file
     *
use fallback classname
     *

     *
     * @return instance of factory, never null
     *
     * @param factoryId             Name of the factory to find, same as
     *                              a property name
     * @param propertiesFilename The filename in the $java.home/lib directory
     *                           of the properties file.  If none specified,
     *                           ${java.home}/lib/xalan.properties will be used.
     * @param fallbackClassName     Implementation class name, if nothing else
     *                              is found.  Use null to mean no fallback.
     *
     * @exception ObjectFactory.ConfigurationError
     */
    static Object createObject(String factoryId,
                                      String propertiesFilename,
                                      String fallbackClassName)
        throws ConfigurationError
    {
        Class factoryClass = lookUpFactoryClass(factoryId,
                                                propertiesFilename,
                                                fallbackClassName);

        if (factoryClass == null) {
            throw new ConfigurationError(
                "Provider for " + factoryId + " cannot be found", null);
        }

        try{
            Object instance = factoryClass.newInstance();
            debugPrintln("created new instance of factory " + factoryId);
            return instance;
        } catch (Exception x) {
            throw new ConfigurationError(
                "Provider for factory " + factoryId
                    + " could not be instantiated: " + x, x);
        }
	}
    /**
     * Finds the implementation Class object in the specified order.  The
     * specified order is the following:
     *

     *
query the system property using System.getProperty
     *
read $java.home/lib/propertiesFilename file
     *
read META-INF/services/factoryId file
     *
use fallback classname
     *

     *
     * @return Class object of factory, never null
     *
     * @param factoryId             Name of the factory to find, same as
     *                              a property name
     * @param propertiesFilename The filename in the $java.home/lib directory
     *                           of the properties file.  If none specified,
     *                           ${java.home}/lib/xalan.properties will be used.
     * @param fallbackClassName     Implementation class name, if nothing else
     *                              is found.  Use null to mean no fallback.
     *
     * @exception ObjectFactory.ConfigurationError
     */
    static Class lookUpFactoryClass(String factoryId)
        throws ConfigurationError
    {
        return lookUpFactoryClass(factoryId, null, null);
	}
    /**
     * Finds the implementation Class object in the specified order.  The
     * specified order is the following:
     *

     *
query the system property using System.getProperty
     *
read $java.home/lib/propertiesFilename file
     *
read META-INF/services/factoryId file
     *
use fallback classname
     *

     *
     * @return Class object that provides factory service, never null
     *
     * @param factoryId             Name of the factory to find, same as
     *                              a property name
     * @param propertiesFilename The filename in the $java.home/lib directory
     *                           of the properties file.  If none specified,
     *                           ${java.home}/lib/xalan.properties will be used.
     * @param fallbackClassName     Implementation class name, if nothing else
     *                              is found.  Use null to mean no fallback.
     *
     * @exception ObjectFactory.ConfigurationError
     */
    static Class lookUpFactoryClass(String factoryId,
                                           String propertiesFilename,
                                           String fallbackClassName)
        throws ConfigurationError
    {
        String factoryClassName = lookUpFactoryClassName(factoryId,
                                                         propertiesFilename,
                                                         fallbackClassName);
        ClassLoader cl = findClassLoader();

        if (factoryClassName == null) {
            factoryClassName = fallbackClassName;
        }

        try{
            Class providerClass = findProviderClass(factoryClassName,
                                                    cl,
                                                    true);
            debugPrintln("created new instance of " + providerClass +
                   " using ClassLoader: " + cl);
            return providerClass;
        } catch (ClassNotFoundException x) {
            throw new ConfigurationError(
                "Provider " + factoryClassName + " not found", x);
        } catch (Exception x) {
            throw new ConfigurationError(
                "Provider "+factoryClassName+" could not be instantiated: "+x,
                x);
        }
	}
    /**
     * Finds the name of the required implementation class in the specified
     * order.  The specified order is the following:
     *

     *
query the system property using System.getProperty
     *
read $java.home/lib/propertiesFilename file
     *
read META-INF/services/factoryId file
     *
use fallback classname
     *

     *
     * @return name of class that provides factory service, never null
     *
     * @param factoryId             Name of the factory to find, same as
     *                              a property name
     * @param propertiesFilename The filename in the $java.home/lib directory
     *                           of the properties file.  If none specified,
     *                           ${java.home}/lib/xalan.properties will be used.
     * @param fallbackClassName     Implementation class name, if nothing else
     *                              is found.  Use null to mean no fallback.
     *
     * @exception ObjectFactory.ConfigurationError
     */
    static String lookUpFactoryClassName(String factoryId,
                                                String propertiesFilename,
                                                String fallbackClassName)
    {
        SecuritySupport ss = SecuritySupport.getInstance();

        try {
            String systemProp = ss.getSystemProperty(factoryId);
            if (systemProp != null) {
                debugPrintln("found system property, value=" + systemProp);
                return systemProp;
            }
        } catch (SecurityException se) {
        }

        String factoryClassName = null;
        if (propertiesFilename == null) {
            File propertiesFile = null;
            boolean propertiesFileExists = false;
            try {
                String javah = ss.getSystemProperty("java.home");
                propertiesFilename = javah + File.separator +
                    "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
                propertiesFile = new File(propertiesFilename);
                propertiesFileExists = ss.getFileExists(propertiesFile);
            } catch (SecurityException e) {
                fLastModified = -1;
                fXalanProperties = null;
            }

            synchronized (ObjectFactory.class) {
                boolean loadProperties = false;
                FileInputStream fis = null;
                try {
                    if(fLastModified >= 0) {
                        if(propertiesFileExists &&
                                (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
                            loadProperties = true;
                        } else {
                            if(!propertiesFileExists) {
                                fLastModified = -1;
                                fXalanProperties = null;
							}
                        }
                    } else {
                        if(propertiesFileExists) {
                            loadProperties = true;
                            fLastModified = ss.getLastModified(propertiesFile);
						}
                    }
                    if(loadProperties) {
                        fXalanProperties = new Properties();
                        fis = ss.getFileInputStream(propertiesFile);
                        fXalanProperties.load(fis);
                    }
	        } catch (Exception x) {
	            fXalanProperties = null;
	            fLastModified = -1;
	        }
                finally {
                    if (fis != null) {
                        try {
                            fis.close();
                        }
                        catch (IOException exc) {}
                    }
                }
            }
            if(fXalanProperties != null) {
                factoryClassName = fXalanProperties.getProperty(factoryId);
            }
        } else {
            FileInputStream fis = null;
            try {
                fis = ss.getFileInputStream(new File(propertiesFilename));
                Properties props = new Properties();
                props.load(fis);
                factoryClassName = props.getProperty(factoryId);
            } catch (Exception x) {
            }
            finally {
                if (fis != null) {
                    try {
                        fis.close();
                    }
                    catch (IOException exc) {}
                }
            }
        }
        if (factoryClassName != null) {
            debugPrintln("found in " + propertiesFilename + ", value="
                          + factoryClassName);
            return factoryClassName;
        }

        return findJarServiceProviderName(factoryId);
	}

    /** Prints a message to standard error if debugging is enabled. */
    private static void debugPrintln(String msg) {
        if (DEBUG) {
            System.err.println("JAXP: " + msg);
        }
	}
    /**
     * Figure out which ClassLoader to use.  For JDK 1.2 and later use
     * the context ClassLoader.
     */
    static ClassLoader findClassLoader()
        throws ConfigurationError
    {
        SecuritySupport ss = SecuritySupport.getInstance();

        ClassLoader context = ss.getContextClassLoader();
        ClassLoader system = ss.getSystemClassLoader();

        ClassLoader chain = system;
        while (true) {
            if (context == chain) {
                ClassLoader current = ObjectFactory.class.getClassLoader();

                chain = system;
                while (true) {
                    if (current == chain) {
                        return system;
                    }
                    if (chain == null) {
                        break;
                    }
                    chain = ss.getParentClassLoader(chain);
                }

                return current;
            }

            if (chain == null) {
                break;
            }

            chain = ss.getParentClassLoader(chain);
        };

        return context;
	}
    /**
     * Create an instance of a class using the specified ClassLoader
     */
    static Object newInstance(String className, ClassLoader cl,
                                      boolean doFallback)
        throws ConfigurationError
    {
        try{
            Class providerClass = findProviderClass(className, cl, doFallback);
            Object instance = providerClass.newInstance();
            debugPrintln("created new instance of " + providerClass +
                   " using ClassLoader: " + cl);
            return instance;
        } catch (ClassNotFoundException x) {
            throw new ConfigurationError(
                "Provider " + className + " not found", x);
        } catch (Exception x) {
            throw new ConfigurationError(
                "Provider " + className + " could not be instantiated: " + x,
                x);
        }
    }

    /**
     * Find a Class using the specified ClassLoader
     */
    static Class findProviderClass(String className, ClassLoader cl,
                                           boolean doFallback)
        throws ClassNotFoundException, ConfigurationError
    {
        SecurityManager security = System.getSecurityManager();
        try{
                if (security != null){
                    final int lastDot = className.lastIndexOf(".");
                    String packageName = className;
                    if (lastDot != -1) packageName = className.substring(0, lastDot);
                    security.checkPackageAccess(packageName);
                 }
        }catch(SecurityException e){
            throw e;
        }

        Class providerClass;
        if (cl == null) {
            providerClass = Class.forName(className);
        } else {
            try {
                providerClass = cl.loadClass(className);
            } catch (ClassNotFoundException x) {
                if (doFallback) {
                    ClassLoader current = ObjectFactory.class.getClassLoader();
                    if (current == null) {
                        providerClass = Class.forName(className);
                    } else if (cl != current) {
                        cl = current;
                        providerClass = cl.loadClass(className);
                    } else {
                        throw x;
                    }
                } else {
                    throw x;
                }
            }
        }

        return providerClass;
    }

    /**
     * Find the name of service provider using Jar Service Provider Mechanism
     *
     * @return instance of provider class if found or null
     */
    private static String findJarServiceProviderName(String factoryId)
    {
        SecuritySupport ss = SecuritySupport.getInstance();
        String serviceId = SERVICES_PATH + factoryId;
        InputStream is = null;

        ClassLoader cl = findClassLoader();

        is = ss.getResourceAsStream(cl, serviceId);

        if (is == null) {
            ClassLoader current = ObjectFactory.class.getClassLoader();
            if (cl != current) {
                cl = current;
                is = ss.getResourceAsStream(cl, serviceId);
            }
        }

        if (is == null) {
            return null;
        }

        debugPrintln("found jar resource=" + serviceId +
               " using ClassLoader: " + cl);

        BufferedReader rd;
        try {
            rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
        } catch (java.io.UnsupportedEncodingException e) {
            rd = new BufferedReader(new InputStreamReader(is));
        }

        String factoryClassName = null;
        try {
            factoryClassName = rd.readLine();
        } catch (IOException x) {
            return null;
        }
        finally {
            try {
                rd.close();
            }
            catch (IOException exc) {}
        }

        if (factoryClassName != null &&
            ! "".equals(factoryClassName)) {
            debugPrintln("found in resource, value="
                   + factoryClassName);

            return factoryClassName;
        }

        return null;
    }

    /**
     * A configuration error.
     */
    static class ConfigurationError
        extends Error {
                static final long serialVersionUID = 2276082712114762609L;

        /** Exception. */
        private Exception exception;

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
		}

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;

FUNC_DECL RETURN PARAM PARAM CALL LITERAL_ANCHOR


public class JuelExpression extends ExpressionSupport<Exchange> {
    private final String expression;
    private final Class<?> type;
    private ExpressionFactory expressionFactory;
    private Properties expressionFactoryProperties;

    public JuelExpression(String expression, Class<?> type) {
        this.expression = expression;
        this.type = type;
    }

    public static JuelExpression el(String expression) {
        return new JuelExpression(expression, Object.class);
    }

    public Object evaluate(Exchange exchange) {
        ELContext context = populateContext(createContext(), exchange);
        ValueExpression valueExpression = getExpressionFactory().createValueExpression(context, expression, type);
        return valueExpression.getValue(context);
    }

    public ExpressionFactory getExpressionFactory() {
        if (expressionFactory == null) {
            Properties properties = getExpressionFactoryProperties();
            expressionFactory = ExpressionFactory.newInstance(properties);
        }
        return expressionFactory;
    }

    public void setExpressionFactory(ExpressionFactory expressionFactory) {
        this.expressionFactory = expressionFactory;
    }

    public Properties getExpressionFactoryProperties() {
        if (expressionFactoryProperties == null) {
            expressionFactoryProperties = new Properties();
            populateDefaultExpressionProperties(expressionFactoryProperties);
        }
        return expressionFactoryProperties;
    }

    public void setExpressionFactoryProperties(Properties expressionFactoryProperties) {
        this.expressionFactoryProperties = expressionFactoryProperties;
    }

    protected ELContext populateContext(ELContext context, Exchange exchange) {
        setVariable(context, "exchange", exchange, Exchange.class);
        setVariable(context, "in", exchange.getIn(), Message.class);
        Message out = exchange.getOut(false);
        setVariable(context, "out", out, Message.class);
        return context;
    }

    /**
     * A Strategy Method to populate the default properties used to create the expression factory
     */
    protected void populateDefaultExpressionProperties(Properties properties) {
        properties.setProperty("javax.el.methodInvocations", "true");
    }

    protected void setVariable(ELContext context, String name, Object value, Class<?> type) {
        ValueExpression valueExpression = getExpressionFactory().createValueExpression(value, type);
        SimpleContext simpleContext = (SimpleContext) context;
        simpleContext.setVariable(name, valueExpression);
    }

    /**
     * Factory method to create the EL context
     */
    protected ELContext createContext() {
        ELResolver resolver = new CompositeELResolver() {
            {
                add(new ArrayELResolver(false));
                add(new ListELResolver(false));
                add(new MapELResolver(false));
                add(new ResourceBundleELResolver());
                add(new BeanAndMethodELResolver());
            }
        };
        return new SimpleContext(resolver);
    }

    protected String assertionFailureMessage(Exchange exchange) {
        return expression;

FUNC_DECL RETURN VAR_DECL VAR_DECL PARAM CALL CALL CALL CALL CALL

FUNC_DECL VAR_DECL VAR_DECL PARAM PARAM PARAM PARAM CALL CALL CALL


public class CacheResolver extends FileSystemResolver {
    public CacheResolver() {
    }

    public CacheResolver(ResolverSettings settings) {
        setSettings(settings);
        setName("cache");
    }

    public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data)
            throws ParseException {
        clearIvyAttempts();

        ModuleRevisionId mrid = dd.getDependencyRevisionId();
        // check revision

        ResolvedModuleRevision rmr = getRepositoryCacheManager()
            .findModuleInCache(dd, mrid, getCacheOptions(data), null);
        if (rmr != null) {
            Message.verbose("\t" + getName() + ": revision in cache: " + mrid);
            return rmr;
        } else if (!getSettings().getVersionMatcher().isDynamic(mrid)) {
            Message.verbose("\t" + getName() + ": no ivy file in cache found for " + mrid);
            return null;
        } else {
            ensureConfigured();
            ResolvedResource ivyRef = findIvyFileRef(dd, data);
            if (ivyRef != null) {
                Message.verbose("\t" + getName() + ": found ivy file in cache for " + mrid);
                Message.verbose("\t\t=> " + ivyRef);

                ModuleRevisionId resolvedMrid = ModuleRevisionId.newInstance(mrid, ivyRef
                        .getRevision());
                IvyNode node = data.getNode(resolvedMrid);
                if (node != null && node.getModuleRevision() != null) {
                    // this revision has already be resolved : return it
                    Message.verbose("\t" + getName() + ": revision already resolved: "
                            + resolvedMrid);
                    return node.getModuleRevision();
                }
                rmr = getRepositoryCacheManager().findModuleInCache(
                        dd.clone(ModuleRevisionId.newInstance(
                            dd.getDependencyRevisionId(), ivyRef.getRevision())),
                        dd.getDependencyRevisionId(),
                        getCacheOptions(data), null);
                if (rmr != null) {
                    Message.verbose("\t" + getName() + ": revision in cache: " + resolvedMrid);
                    return rmr;
                } else {
                    Message.error("\t" + getName()
                            + ": inconsistent cache: clean it and resolve again");
                    return null;
                }
            } else {
                Message.verbose("\t" + getName() + ": no ivy file in cache found for " + mrid);
                return null;
            }
        }
    }

    public DownloadReport download(Artifact[] artifacts, DownloadOptions options) {
        clearArtifactAttempts();
        DownloadReport dr = new DownloadReport();
        for (int i = 0; i < artifacts.length; i++) {
            final ArtifactDownloadReport adr = new ArtifactDownloadReport(artifacts[i]);
            dr.addArtifactReport(adr);
            ResolvedResource artifactRef = getArtifactRef(artifacts[i], null);
            if (artifactRef != null) {
                Message.verbose("\t[NOT REQUIRED] " + artifacts[i]);
                ArtifactOrigin origin = new ArtifactOrigin(
                    artifacts[i], true, artifactRef.getResource().getName());
                File archiveFile = ((FileResource) artifactRef.getResource()).getFile();
                adr.setDownloadStatus(DownloadStatus.NO);
                adr.setSize(archiveFile.length());
                adr.setArtifactOrigin(origin);
                adr.setLocalFile(archiveFile);
            } else {
                adr.setDownloadStatus(DownloadStatus.FAILED);
            }
        }
        return dr;
    }

    public boolean exists(Artifact artifact) {
        ensureConfigured();
        return super.exists(artifact);
    }

    public ArtifactOrigin locate(Artifact artifact) {
        ensureConfigured();
        return super.locate(artifact);
    }

    public void publish(Artifact artifact, File src, boolean overwrite) throws IOException {
        ensureConfigured();
        super.publish(artifact, src, overwrite);
    }

    public OrganisationEntry[] listOrganisations() {
        ensureConfigured();
        return super.listOrganisations();
    }

    public ModuleEntry[] listModules(OrganisationEntry org) {
        ensureConfigured();
        return super.listModules(org);
    }

    public RevisionEntry[] listRevisions(ModuleEntry module) {
        ensureConfigured();
        return super.listRevisions(module);
    }

    public void dumpSettings() {
        Message.verbose("\t" + getName() + " [cache]");
    }

    private void ensureConfigured() {
        if (getIvyPatterns().isEmpty()) {
            setIvyPatterns(new ArrayList());
            setArtifactPatterns(new ArrayList());
            RepositoryCacheManager[] caches = getSettings().getRepositoryCacheManagers();
            for (int i = 0; i < caches.length; i++) {
                if (caches[i] instanceof DefaultRepositoryCacheManager) {
                    DefaultRepositoryCacheManager c = (DefaultRepositoryCacheManager) caches[i];
                    addIvyPattern(c.getBasedir().getAbsolutePath() + "/" + c.getIvyPattern());
                    addArtifactPattern(
                        c.getBasedir().getAbsolutePath() + "/" + c.getArtifactPattern());
                } else {
                    Message.verbose(
                        caches[i] + ": cache implementation is not a DefaultRepositoryCacheManager:"
                        + " unable to configure cache resolver with it");
                }
            }
        }
    }

    public String getTypeName() {
        return "cache";


org.apache.tools.ant.types.FileList

public class FileList extends DataType {

    private Vector filenames = new Vector();
    private File dir;

    public FileList() {
        super();
    }

    protected FileList(FileList filelist) {
        this.dir       = filelist.dir;
        this.filenames = filelist.filenames;
        setProject(filelist.getProject());
    }

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

     */
    public void setRefid(Reference r) throws BuildException {
        if ((dir != null) || (filenames.size() != 0)) {
            throw tooManyAttributes();
        }
        super.setRefid(r);
    }

    public void setDir(File dir) throws BuildException {
        if (isReference()) {
            throw tooManyAttributes();
        }
        this.dir = dir;
    }

    public File getDir(Project p) {
        if (isReference()) {
            return getRef(p).getDir(p);
        }
        return dir;
    }

    public void setFiles(String filenames) {
        if (isReference()) {
            throw tooManyAttributes();
        }
        if (filenames != null && filenames.length() > 0) {
            StringTokenizer tok = new StringTokenizer(filenames, ", \t\n\r\f", false);
            while (tok.hasMoreTokens()) {
               this.filenames.addElement(tok.nextToken());
            }
        }
    }

    /**
     * Returns the list of files represented by this FileList.
     */
    public String[] getFiles(Project p) {
        if (isReference()) {
            return getRef(p).getFiles(p);
        }

        if (dir == null) {
            throw new BuildException("No directory specified for filelist.");
        }

        if (filenames.size() == 0) {
            throw new BuildException("No files specified for filelist.");
        }

        String[] result = new String[filenames.size()];
        filenames.copyInto(result);
        return result;
    }

    /**
     * Performs the check for circular references and returns the
     * referenced FileList.
     */
    protected FileList getRef(Project p) {
        if (!checked) {
            Stack stk = new Stack();
            stk.push(this);
            dieOnCircularReference(stk, p);
        }

        Object o = ref.getReferencedObject(p);
        if (!(o instanceof FileList)) {
            String msg = ref.getRefId() + " doesn\'t denote a filelist";
            throw new BuildException(msg);
        } else {
            return (FileList) o;

FUNC_DECL IF PARAM ASSIGN CALL THROW_RAISE CALL

FUNC_DECL RETURN IF PARAM CALL RETURN CALL CALL

    public FileList() {
        super();