text:
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Tup.Cobar4Net.Parser.Ast.Expression;
using Tup.Cobar4Net.Parser.Ast.Expression.Misc;
using Tup.Cobar4Net.Parser.Ast.Expression.Primary;
using Tup.Cobar4Net.Parser.Ast.Fragment;
using Tup.Cobar4Net.Parser.Ast.Fragment.Tableref;
using Tup.Cobar4Net.Parser.Ast.Stmt.Dml;
using Tup.Cobar4Net.Parser.Recognizer.Mysql.Lexer;

namespace Tup.Cobar4Net.Parser.Recognizer.Mysql.Syntax
{
    /// <author>
    ///     QIU Shuo
    /// </author>
    public abstract class MySqlDmlParser : MySqlParser
    {
        protected MySqlExprParser exprParser;

        public MySqlDmlParser(MySqlLexer lexer, MySqlExprParser exprParser)
            : base(lexer)
        {
            this.exprParser = exprParser;
        }

        /// nothing has been pre-consumed
        /// <returns>null if there is no order by</returns>
        /// <exception cref="System.SqlSyntaxErrorException" />
        protected internal virtual GroupBy GroupBy()
        {
            if (lexer.Token() != MySqlToken.KwGroup)
            {
                return null;
            }
            lexer.NextToken();
            Match(MySqlToken.KwBy);
            var expr = exprParser.Expression();
            var order = SortOrder.Asc;
            GroupBy groupBy;
            switch (lexer.Token())
            {
                case MySqlToken.KwDesc:
                {
                    order = SortOrder.Desc;
                    goto case MySqlToken.KwAsc;
                }

                case MySqlToken.KwAsc:
                {
                    lexer.NextToken();
                    goto default;
                }

                default:
                {
                    break;
                }
            }
            switch (lexer.Token())
            {
                case MySqlToken.KwWith:
                {
                    lexer.NextToken();
                    MatchIdentifier("ROLLUP");
                    return new GroupBy(expr, order, true);
                }

                case MySqlToken.PuncComma:
                {
                    break;
                }

                default:
                {
                    return new GroupBy(expr, order, false);
                }
            }
            for (groupBy = new GroupBy().AddOrderByItem(expr, order);
                 lexer.Token() == MySqlToken.PuncComma;)
            {
                lexer.NextToken();
                order = SortOrder.Asc;
                expr = exprParser.Expression();
                switch (lexer.Token())
                {
                    case MySqlToken.KwDesc:
                    {
                        order = SortOrder.Desc;
                        goto case MySqlToken.KwAsc;
                    }

                    case MySqlToken.KwAsc:
                    {
                        lexer.NextToken();
                        goto default;
                    }

                    default:
                    {
                        break;
                    }
                }
                groupBy.AddOrderByItem(expr, order);
                if (lexer.Token() == MySqlToken.KwWith)
                {
                    lexer.NextToken();
                    MatchIdentifier("ROLLUP");
                    return groupBy.SetWithRollup();
                }
            }
            return groupBy;
        }

        /// nothing has been pre-consumed
        /// <returns>null if there is no order by</returns>
        /// <exception cref="System.SqlSyntaxErrorException" />
        protected internal virtual OrderBy OrderBy()
        {
            if (lexer.Token() != MySqlToken.KwOrder)
            {
                return null;
            }
            lexer.NextToken();
            Match(MySqlToken.KwBy);
            var expr = exprParser.Expression();
            var order = SortOrder.Asc;
            OrderBy orderBy;
            switch (lexer.Token())
            {
                case MySqlToken.KwDesc:
                {
                    order = SortOrder.Desc;
                    goto case MySqlToken.KwAsc;
                }

                case MySqlToken.KwAsc:
                {
                    if (lexer.NextToken() != MySqlToken.PuncComma)
                    {
                        return new OrderBy(expr, order);
                    }
                    goto case MySqlToken.PuncComma;
                }

                case MySqlToken.PuncComma:
                {
                    orderBy = new OrderBy();
                    orderBy.AddOrderByItem(expr, order);
                    break;
                }

                default:
                {
                    return new OrderBy(expr, order);
                }
            }
            for (; lexer.Token() == MySqlToken.PuncComma;)
            {
                lexer.NextToken();
                order = SortOrder.Asc;
                expr = exprParser.Expression();
                switch (lexer.Token())
                {
                    case MySqlToken.KwDesc:
                    {
                        order = SortOrder.Desc;
                        goto case MySqlToken.KwAsc;
                    }

                    case MySqlToken.KwAsc:
                    {
                        lexer.NextToken();
                        break;
                    }
                }
                orderBy.AddOrderByItem(expr, order);
            }
            return orderBy;
        }

        /// <param name="id">never null</param>
        /// <exception cref="System.SqlSyntaxErrorException" />
        protected virtual IList<Identifier> BuildIdList(Identifier id)
        {
            if (lexer.Token() != MySqlToken.PuncComma)
            {
                IList<Identifier> list = new List<Identifier>(1);
                list.Add(id);
                return list;
            }
            IList<Identifier> list_1 = new List<Identifier>();
            list_1.Add(id);
            for (; lexer.Token() == MySqlToken.PuncComma;)
            {
                lexer.NextToken();
                id = Identifier();
                list_1.Add(id);
            }
            return list_1;
        }

        ///
        ///     (id (',' id)*)?
        ///
        /// <returns>
        ///     never null or empty.
        ///     <see cref="System.Collections.ArrayList{E}" />
        ///     is possible
        /// </returns>
        /// <exception cref="System.SqlSyntaxErrorException" />
        protected virtual IList<Identifier> IdList()
        {
            return BuildIdList(Identifier());
        }

        ///
        ///     ( idName (',' idName)*)? ')'
        ///
        /// <returns>empty list if emtpy id list</returns>
        /// <exception cref="System.SqlSyntaxErrorException" />
        protected virtual IList<string> IdNameList()
        {
            if (lexer.Token() != MySqlToken.Identifier)
            {
                Match(MySqlToken.PuncRightParen);
                return new List<string>(0);
            }
            IList<string> list;
            var str = lexer.GetStringValue();
            if (lexer.NextToken() == MySqlToken.PuncComma)
            {
                list = new List<string>();
                list.Add(str);
                for (; lexer.Token() == MySqlToken.PuncComma;)
                {
                    lexer.NextToken();
                    list.Add(lexer.GetStringValue());
                    Match(MySqlToken.Identifier);
                }
            }
            else
            {
                list = new List<string>(1);
                list.Add(str);
            }
            Match(MySqlToken.PuncRightParen);
            return list;
        }

        /// <returns>never null</returns>
        /// <exception cref="System.SqlSyntaxErrorException" />
        protected internal virtual TableReferences TableRefs()
        {
            var @ref = TableReference();
            return BuildTableReferences(@ref);
        }

        /// <exception cref="System.SqlSyntaxErrorException" />
        private TableReferences BuildTableReferences(TableReference @ref)
        {
            IList<TableReference> list;
            if (lexer.Token() == MySqlToken.PuncComma)
            {
                list = new List<TableReference>();
                list.Add(@ref);
                for (; lexer.Token() == MySqlToken.PuncComma;)
                {
                    lexer.NextToken();
                    @ref = TableReference();
                    list.Add(@ref);
                }
            }
            else
            {
                list = new List<TableReference>(1);
                list.Add(@ref);
            }
            return new TableReferences(list);
        }

        /// <exception cref="System.SqlSyntaxErrorException" />
        private TableReference TableReference()
        {
            var @ref = TableFactor();
            return BuildTableReference(@ref);
        }

        /// <exception cref="System.SqlSyntaxErrorException" />
        private TableReference BuildTableReference(TableReference @ref)
        {
            for (;;)
            {
                IExpression on;
                IList<string> @using;
                TableReference temp;
                var isOut = false;
                var isLeft = true;
                switch (lexer.Token())
                {
                    case MySqlToken.KwInner:
                    case MySqlToken.KwCross:
                    {
                        lexer.NextToken();
                        goto case MySqlToken.KwJoin;
                    }

                    case MySqlToken.KwJoin:
                    {
                        lexer.NextToken();
                        temp = TableFactor();
                        switch (lexer.Token())
                        {
                            case MySqlToken.KwOn:
                            {
                                lexer.NextToken();
                                on = exprParser.Expression();
                                @ref = new InnerJoin(@ref, temp, on);
                                break;
                            }

                            case MySqlToken.KwUsing:
                            {
                                lexer.NextToken();
                                Match(MySqlToken.PuncLeftParen);
                                @using = IdNameList();
                                @ref = new InnerJoin(@ref, temp, @using);
                                break;
                            }

                            default:
                            {
                                @ref = new InnerJoin(@ref, temp);
                                break;
                            }
                        }
                        break;
                    }

                    case MySqlToken.KwStraightJoin:
                    {
                        lexer.NextToken();
                        temp = TableFactor();
                        switch (lexer.Token())
                        {
                            case MySqlToken.KwOn:
                            {
                                lexer.NextToken();
                                on = exprParser.Expression();
                                @ref = new StraightJoin(@ref, temp, on);
                                break;
                            }

                            default:
                            {
                                @ref = new StraightJoin(@ref, temp);
                                break;
                            }
                        }
                        break;
                    }

                    case MySqlToken.KwRight:
                    {
                        isLeft = false;
                        goto case MySqlToken.KwLeft;
                    }

                    case MySqlToken.KwLeft:
                    {
                        lexer.NextToken();
                        if (lexer.Token() == MySqlToken.KwOuter)
                        {
                            lexer.NextToken();
                        }
                        Match(MySqlToken.KwJoin);
                        temp = TableReference();
                        switch (lexer.Token())
                        {
                            case MySqlToken.KwOn:
                            {
                                lexer.NextToken();
                                on = exprParser.Expression();
                                @ref = new OuterJoin(isLeft, @ref, temp, on);
                                break;
                            }

                            case MySqlToken.KwUsing:
                            {
                                lexer.NextToken();
                                Match(MySqlToken.PuncLeftParen);
                                @using = IdNameList();
                                @ref = new OuterJoin(isLeft, @ref, temp, @using);
                                break;
                            }

                            default:
                            {
                                var condition = temp.RemoveLastConditionElement();
                                if (condition is IExpression)
                                {
                                    @ref = new OuterJoin(isLeft, @ref, temp, (IExpression)condition);
                                }
                                else
                                {
                                    if (condition is IList)
                                    {
                                        @ref = new OuterJoin(isLeft, @ref, temp, (IList<string>)condition);
                                    }
                                    else
                                    {
                                        throw Err("conditionExpr cannot be null for outer join");
                                    }
                                }
                                break;
                            }
                        }
                        break;
                    }

                    case MySqlToken.KwNatural:
                    {
                        lexer.NextToken();
                        switch (lexer.Token())
                        {
                            case MySqlToken.KwRight:
                            {
                                isLeft = false;
                                goto case MySqlToken.KwLeft;
                            }

                            case MySqlToken.KwLeft:
                            {
                                lexer.NextToken();
                                if (lexer.Token() == MySqlToken.KwOuter)
                                {
                                    lexer.NextToken();
                                }
                                isOut = true;
                                goto case MySqlToken.KwJoin;
                            }

                            case MySqlToken.KwJoin:
                            {
                                lexer.NextToken();
                                temp = TableFactor();
                                @ref = new NaturalJoin(isOut, isLeft, @ref, temp);
                                break;
                            }

                            default:
                            {
                                throw Err("unexpected token after NATURAL for natural join:" + lexer.Token());
                            }
                        }
                        break;
                    }

                    default:
                    {
                        return @ref;
                    }
                }
            }
        }

        /// <exception cref="System.SqlSyntaxErrorException" />
        private TableReference TableFactor()
        {
            string alias = null;
            switch (lexer.Token())
            {
                case MySqlToken.PuncLeftParen:
                {
                    lexer.NextToken();
                    var @ref = TrsOrQuery();
                    Match(MySqlToken.PuncRightParen);
                    if (@ref is IQueryExpression)
                    {
                        alias = As();
                        return new SubqueryFactor((IQueryExpression)@ref, alias);
                    }
                    return (TableReferences)@ref;
                }

                case MySqlToken.Identifier:
                {
                    var table = Identifier();
                    alias = As();
                    var hintList = HintList();
                    return new TableRefFactor(table, alias, hintList);
                }

                default:
                {
                    throw Err("unexpected token for tableFactor: " + lexer.Token());
                }
            }
        }

        /// <returns>
        ///     never empty. upper-case if id format.
        ///     "alias1" |"`al`ias1`" | "'alias1'" | "_latin1'alias1'"
        /// </returns>
        /// <exception cref="System.SqlSyntaxErrorException" />
        protected virtual string As()
        {
            if (lexer.Token() == MySqlToken.KwAs)
            {
                lexer.NextToken();
            }
            var alias = new StringBuilder();
            var id = false;
            if (lexer.Token() == MySqlToken.Identifier)
            {
                alias.Append(lexer.GetStringValueUppercase());
                id = true;
                lexer.NextToken();
            }
            if (lexer.Token() == MySqlToken.LiteralChars)
            {
                if (!id || id && alias[0] == '_')
                {
                    alias.Append(lexer.GetStringValue());
                    lexer.NextToken();
                }
            }
            return alias.Length > 0 ? alias.ToString() : null;
        }

        /// <returns>
        ///     type of
        ///     <see cref="Tup.Cobar4Net.Parser.Ast.Expression.Misc.IQueryExpression" />
        ///     or
        ///     <see cref="TableReferences" />
        /// </returns>
        /// <exception cref="System.SqlSyntaxErrorException" />
        private object TrsOrQuery()
        {
            object @ref;
            switch (lexer.Token())
            {
                case MySqlToken.KwSelect:
                {
                    var select = SelectPrimary();
                    return BuildUnionSelect(select);
                }

                case MySqlToken.PuncLeftParen:
                {
                    lexer.NextToken();
                    @ref = TrsOrQuery();
                    Match(MySqlToken.PuncRightParen);
                    if (@ref is IQueryExpression)
                    {
                        if (@ref is DmlSelectStatement)
                        {
                            IQueryExpression rst = BuildUnionSelect((DmlSelectStatement)@ref);
                            if (rst != @ref)
                            {
                                return rst;
                            }
                        }
                        var alias = As();
                        if (alias != null)
                        {
                            @ref = new SubqueryFactor((IQueryExpression)@ref, alias);
                        }
                        else
                        {
                            return @ref;
                        }
                    }
                    // ---- build factor complete---------------
                    @ref = BuildTableReference((TableReference)@ref);
                    // ---- build ref complete---------------
                    break;
                }

                default:
                {
                    @ref = TableReference();
                    break;
                }
            }
            IList<TableReference> list;
            if (lexer.Token() == MySqlToken.PuncComma)
            {
                list = new List<TableReference>();
                list.Add((TableReference)@ref);
                for (; lexer.Token() == MySqlToken.PuncComma;)
                {
                    lexer.NextToken();
                    @ref = TableReference();
                    list.Add((TableReference)@ref);
                }
                return new TableReferences(list);
            }
            list = new List<TableReference>(1);
            list.Add((TableReference)@ref);
            return new TableReferences(list);
        }

        /// <returns>null if there is no hint</returns>
        /// <exception cref="System.SqlSyntaxErrorException" />
        private IList<IndexHint> HintList()
        {
            var hint = Hint();
            if (hint == null)
            {
                return null;
            }
            IList<IndexHint> list;
            var hint2 = Hint();
            if (hint2 == null)
            {
                list = new List<IndexHint>(1);
                list.Add(hint);
                return list;
            }
            list = new List<IndexHint>();
            list.Add(hint);
            list.Add(hint2);
            for (; (hint2 = Hint()) != null; list.Add(hint2))
            {
            }
            return list;
        }

        /// <returns>null if there is no hint</returns>
        /// <exception cref="System.SqlSyntaxErrorException" />
        private IndexHint Hint()
        {
            IndexHintAction _hintAction;
            switch (lexer.Token())
            {
                case MySqlToken.KwUse:
                {
                    _hintAction = IndexHintAction.Use;
                    break;
                }

                case MySqlToken.KwIgnore:
                {
                    _hintAction = IndexHintAction.Ignore;
                    break;
                }

                case MySqlToken.KwForce:
                {
                    _hintAction = IndexHintAction.Force;
                    break;
                }

                default:
                {
                    return null;
                }
            }
            IndexHintType _hintType;
            switch (lexer.NextToken())
            {
                case MySqlToken.KwIndex:
                {
                    _hintType = IndexHintType.Index;
                    break;
                }

                case MySqlToken.KwKey:
                {
                    _hintType = IndexHintType.Key;
                    break;
                }

                default:
                {
                    throw Err("must be INDEX or KEY for hint _hintType, not " + lexer.Token());
                }
            }
            var scope = IndexHintScope.All;
            if (lexer.NextToken() == MySqlToken.KwFor)
            {
                switch (lexer.NextToken())
                {
                    case MySqlToken.KwJoin:
                    {
                        lexer.NextToken();
                        scope = IndexHintScope.Join;
                        break;
                    }

                    case MySqlToken.KwOrder:
                    {
                        lexer.NextToken();
                        Match(MySqlToken.KwBy);
                        scope = IndexHintScope.OrderBy;
                        break;
                    }

                    case MySqlToken.KwGroup:
                    {
                        lexer.NextToken();
                        Match(MySqlToken.KwBy);
                        scope = IndexHintScope.GroupBy;
                        break;
                    }

                    default:
                    {
                        throw Err("must be JOIN or ORDER or GROUP for hint _hintScope, not " + lexer.Token());
                    }
                }
            }
            Match(MySqlToken.PuncLeftParen);
            var indexList = IdNameList();
            return new IndexHint(_hintAction, _hintType, scope, indexList);
        }

        /// <returns>argument itself if there is no union</returns>
        /// <exception cref="System.SqlSyntaxErrorException" />
        protected virtual DmlQueryStatement BuildUnionSelect(DmlSelectStatement select)
        {
            if (lexer.Token() != MySqlToken.KwUnion)
            {
                return select;
            }
            var union = new DmlSelectUnionStatement(select);
            for (; lexer.Token() == MySqlToken.KwUnion;)
            {
                lexer.NextToken();
                var isAll = false;
                switch (lexer.Token())
                {
                    case MySqlToken.KwAll:
                    {
                        isAll = true;
                        goto case MySqlToken.KwDistinct;
                    }

                    case MySqlToken.KwDistinct:
                    {
                        lexer.NextToken();
                        break;
                    }
                }
                select = SelectPrimary();
                union.AddSelect(select, isAll);
            }
            union.SetOrderBy(OrderBy()).SetLimit(Limit());
            return union;
        }

        /// <exception cref="System.SqlSyntaxErrorException" />
        protected virtual DmlSelectStatement SelectPrimary()
        {
            switch (lexer.Token())
            {
                case MySqlToken.KwSelect:
                {
                    return Select();
                }

                case MySqlToken.PuncLeftParen:
                {
                    lexer.NextToken();
                    var select = SelectPrimary();
                    Match(MySqlToken.PuncRightParen);
                    return select;
                }

                default:
                {
                    throw Err("unexpected token: " + lexer.Token());
                }
            }
        }

        ///
        ///     first token is
        ///     <see cref="MySqlToken.KwSelect">SELECT</see>
        ///     which has been scanned
        ///     but not yet consumed
        ///
        /// <exception cref="System.SqlSyntaxErrorException" />
        public virtual DmlSelectStatement Select()
        {
            return new MySqlDmlSelectParser(lexer, exprParser).Select();
        }
    }
}


text:
package org.activiti.standalone.jpa;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;

import org.activiti.engine.impl.test.AbstractFlowableTestCase;
import org.activiti.engine.impl.variable.EntityManagerSession;
import org.activiti.engine.impl.variable.EntityManagerSessionFactory;
import org.activiti.engine.task.Task;
import org.flowable.engine.ProcessEngine;
import org.flowable.engine.ProcessEngineConfiguration;
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.engine.test.Deployment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Test for JPA enhancement support
 *
 * @author Eugene Khrustalev
 */
public class JPAEnhancedVariableTest extends AbstractFlowableTestCase {

  protected static final Logger logger = LoggerFactory.getLogger(JPAEnhancedVariableTest.class);
  protected static EntityManagerFactory entityManagerFactory;
  protected static ProcessEngine cachedProcessEngine;
  protected static org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl activiti5ProcessEngineConfig;

  protected static FieldAccessJPAEntity fieldEntity;
  protected static FieldAccessJPAEntity fieldEntity2;
  protected static PropertyAccessJPAEntity propertyEntity;

  @Override
  protected void initializeProcessEngine() {
    if (cachedProcessEngine == null) {
      ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
          .createProcessEngineConfigurationFromResource("org/activiti/standalone/jpa/flowable.cfg.xml");

      cachedProcessEngine = processEngineConfiguration.buildProcessEngine();

      activiti5ProcessEngineConfig = (org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl)
          ((ProcessEngineConfigurationImpl) cachedProcessEngine.getProcessEngineConfiguration()).getFlowable5CompatibilityHandler().getRawProcessConfiguration();

      EntityManagerSessionFactory entityManagerSessionFactory = (EntityManagerSessionFactory) activiti5ProcessEngineConfig
          .getSessionFactories()
          .get(EntityManagerSession.class);

      entityManagerFactory = entityManagerSessionFactory.getEntityManagerFactory();

      setupJPAVariables();
    }
    processEngine = cachedProcessEngine;
  }

  private static void setupJPAVariables() {
    EntityManager em = entityManagerFactory.createEntityManager();
    em.getTransaction().begin();

    fieldEntity = new FieldAccessJPAEntity();
    fieldEntity.setId(1L);
    fieldEntity.setValue("fieldEntity");
    em.persist(fieldEntity);

    propertyEntity = new PropertyAccessJPAEntity();
    propertyEntity.setId(1L);
    propertyEntity.setValue("propertyEntity");
    em.persist(propertyEntity);

    em.flush();
    em.getTransaction().commit();
    em.close();

    // load enhanced versions of entities
    em = entityManagerFactory.createEntityManager();

    fieldEntity = em.find(FieldAccessJPAEntity.class, fieldEntity.getId());
    propertyEntity = em.find(PropertyAccessJPAEntity.class, propertyEntity.getId());

    em.getTransaction().begin();

    fieldEntity2 = new FieldAccessJPAEntity();
    fieldEntity2.setId(2L);
    fieldEntity2.setValue("fieldEntity2");
    em.persist(fieldEntity2);

    em.flush();
    em.getTransaction().commit();
    em.close();
  }

  private Task getTask(ProcessInstance instance) {
    return activiti5ProcessEngineConfig.getTaskService()
            .createTaskQuery()
            .processInstanceId(instance.getProcessInstanceId())
            .includeProcessVariables()
            .singleResult();
  }

  @Deployment(resources = {
          "org/activiti/standalone/jpa/JPAVariableTest.testStoreJPAEntityAsVariable.bpmn20.xml"
  })
  public void testEnhancedEntityVariables() throws Exception {
    // test if enhancement is used
    if (FieldAccessJPAEntity.class == fieldEntity.getClass() || PropertyAccessJPAEntity.class == propertyEntity.getClass()) {
        logger.warn("Entity enhancement is not used");
        return;
    }

    // start process with enhanced jpa variables
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("fieldEntity", fieldEntity);
    params.put("propertyEntity", propertyEntity);
    ProcessInstance instance = processEngine.getRuntimeService().startProcessInstanceByKey("JPAVariableProcess", params);

    Task task = getTask(instance);
    for (Map.Entry<String, Object> entry : task.getProcessVariables().entrySet()) {
        String name = entry.getKey();
        Object value = entry.getValue();
        if (name.equals("fieldEntity")) {
            assertTrue(value instanceof FieldAccessJPAEntity);
        } else if (name.equals("propertyEntity")) {
            assertTrue(value instanceof PropertyAccessJPAEntity);
        } else {
            fail();
        }
    }
  }

  @Deployment(resources = {
          "org/activiti/standalone/jpa/JPAVariableTest.testStoreJPAEntityAsVariable.bpmn20.xml"
  })
  public void testEnhancedEntityListVariables() throws Exception {
    // test if enhancement is used
    if (FieldAccessJPAEntity.class == fieldEntity.getClass() || PropertyAccessJPAEntity.class == propertyEntity.getClass()) {
        logger.warn("Entity enhancement is not used");
        return;
    }

    // start process with lists of enhanced jpa variables
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("list1", Arrays.asList(fieldEntity, fieldEntity));
    params.put("list2", Arrays.asList(propertyEntity, propertyEntity));
    ProcessInstance instance = processEngine.getRuntimeService().startProcessInstanceByKey("JPAVariableProcess", params);

    Task task = getTask(instance);
    List list = (List) task.getProcessVariables().get("list1");
    assertEquals(2, list.size());
    assertTrue(list.get(0) instanceof FieldAccessJPAEntity);
    assertTrue(list.get(1) instanceof FieldAccessJPAEntity);

    list = (List) task.getProcessVariables().get("list2");
    assertEquals(2, list.size());
    assertTrue(list.get(0) instanceof PropertyAccessJPAEntity);
    assertTrue(list.get(1) instanceof PropertyAccessJPAEntity);

    // start process with enhanced and persisted only jpa variables in the same list
    params.putAll(Collections.singletonMap("list", Arrays.asList(fieldEntity, fieldEntity2)));
    instance = processEngine.getRuntimeService().startProcessInstanceByKey("JPAVariableProcess", params);

    task = getTask(instance);
    list = (List) task.getProcessVariables().get("list");
    assertEquals(2, list.size());
    assertTrue(list.get(0) instanceof FieldAccessJPAEntity);
    assertEquals(1L, (long) ((FieldAccessJPAEntity) list.get(0)).getId());
    assertTrue(list.get(1) instanceof FieldAccessJPAEntity);
    assertEquals(2L, (long) ((FieldAccessJPAEntity) list.get(1)).getId());

    // shuffle list and start a new process
    params.putAll(Collections.singletonMap("list", Arrays.asList(fieldEntity2, fieldEntity)));
    instance = processEngine.getRuntimeService().startProcessInstanceByKey("JPAVariableProcess", params);

    task = getTask(instance);
    list = (List) task.getProcessVariables().get("list");
    assertEquals(2, list.size());
    assertTrue(list.get(0) instanceof FieldAccessJPAEntity);
    assertEquals(2L, (long) ((FieldAccessJPAEntity) list.get(0)).getId());
    assertTrue(list.get(1) instanceof FieldAccessJPAEntity);
    assertEquals(1L, (long) ((FieldAccessJPAEntity) list.get(1)).getId());

    // start process with mixed jpa entities in list
    try {
        params = new HashMap<String, Object>();
        params.put("list", Arrays.asList(fieldEntity, propertyEntity));
        instance = processEngine.getRuntimeService().startProcessInstanceByKey("JPAVariableProcess", params);
        fail();
    } catch (Exception e) {
        /* do nothing */
    }
  }
}

redpajama_set_name: RedPajamaGithub


text: require 'simply_taggable/autotest'


text:
<?php
$config['ClassMap']['classes'] = array
(
	'upload' => 'System/Libraries/StaticAccess/FileSystem/__USE_STATIC_ACCESS__Upload.php',
	'haberler' => 'Application/Models/haberler.php',
	'oturum' => 'Application/Models/oturum.php',
	'yonetici' => 'Application/Models/yonetici.php',
	'__use_static_access__user' => 'System/Libraries/Authentication/User.php',
	'user' => 'System/Libraries/StaticAccess/Authentication/__USE_STATIC_ACCESS__User.php',
	'__use_static_access__benchmark' => 'System/Libraries/Benchmarking/Benchmark.php',
	'benchmark' => 'System/Libraries/StaticAccess/Benchmarking/__USE_STATIC_ACCESS__Benchmark.php',
	'__use_static_access__ob' => 'System/Libraries/Buffering/OB.php',
	'ob' => 'System/Libraries/StaticAccess/Buffering/__USE_STATIC_ACCESS__OB.php',
	'__use_static_access__cache' => 'System/Libraries/Caching/Cache.php',
	'cache' => 'System/Libraries/StaticAccess/Caching/__USE_STATIC_ACCESS__Cache.php',
	'apcdriver' => 'System/Libraries/Caching/Drivers/ApcDriver.php',
	'filedriver' => 'System/Libraries/Caching/Drivers/FileDriver.php',
	'memcachedriver' => 'System/Libraries/Caching/Drivers/MemcacheDriver.php',
	'redisdriver' => 'System/Libraries/Caching/Drivers/RedisDriver.php',
	'wincachedriver' => 'System/Libraries/Caching/Drivers/WincacheDriver.php',
	'__use_static_access__calendar' => 'System/Libraries/Components/Calendar.php',
	'calendar' => 'System/Libraries/StaticAccess/Components/__USE_STATIC_ACCESS__Calendar.php',
	'__use_static_access__captcha' => 'System/Libraries/Components/Captcha.php',
	'captcha' => 'System/Libraries/StaticAccess/Components/__USE_STATIC_ACCESS__Captcha.php',
	'__use_static_access__pagination' => 'System/Libraries/Components/Pagination.php',
	'pagination' => 'System/Libraries/StaticAccess/Components/__USE_STATIC_ACCESS__Pagination.php',
	'__use_static_access__schedule' => 'System/Libraries/Components/Schedule.php',
	'schedule' => 'System/Libraries/StaticAccess/Components/__USE_STATIC_ACCESS__Schedule.php',
	'__use_static_access__table' => 'System/Libraries/Components/Table.php',
	'table' => 'System/Libraries/StaticAccess/Components/__USE_STATIC_ACCESS__Table.php',
	'__use_static_access__terminal' => 'System/Libraries/Components/Terminal.php',
	'terminal' => 'System/Libraries/StaticAccess/Components/__USE_STATIC_ACCESS__Terminal.php',
	'__use_static_access__compress' => 'System/Libraries/Compression/Compress.php',
	'compress' => 'System/Libraries/StaticAccess/Compression/__USE_STATIC_ACCESS__Compress.php',
	'bzdriver' => 'System/Libraries/Compression/Drivers/BZDriver.php',
	'gzdriver' => 'System/Libraries/Compression/Drivers/GZDriver.php',
	'lzfdriver' => 'System/Libraries/Compression/Drivers/LZFDriver.php',
	'rardriver' => 'System/Libraries/Compression/Drivers/RarDriver.php',
	'zipdriver' => 'System/Libraries/Compression/Drivers/ZipDriver.php',
	'zlibdriver' => 'System/Libraries/Compression/Drivers/ZlibDriver.php',
	'__use_static_access__crypto' => 'System/Libraries/Cryptography/Crypto.php',
	'crypto' => 'System/Libraries/StaticAccess/Cryptography/__USE_STATIC_ACCESS__Crypto.php',
	'hashdriver' => 'System/Libraries/Cryptography/Drivers/HashDriver.php',
	'mcryptdriver' => 'System/Libraries/Cryptography/Drivers/McryptDriver.php',
	'mhashdriver' => 'System/Libraries/Cryptography/Drivers/MhashDriver.php',
	'openssldriver' => 'System/Libraries/Cryptography/Drivers/OpensslDriver.php',
	'phashdriver' => 'System/Libraries/Cryptography/Drivers/PhashDriver.php',
	'__use_static_access__encode' => 'System/Libraries/Cryptography/Encode.php',
	'encode' => 'System/Libraries/StaticAccess/Cryptography/__USE_STATIC_ACCESS__Encode.php',
	'__use_static_access__db' => 'System/Libraries/Database/DB.php',
	'db' => 'System/Libraries/StaticAccess/Database/__USE_STATIC_ACCESS__DB.php',
	'dbcommon' => 'System/Libraries/Database/DBCommon.php',
	'__use_static_access__dbforge' => 'System/Libraries/Database/DBForge.php',
	'dbforge' => 'System/Libraries/StaticAccess/Database/__USE_STATIC_ACCESS__DBForge.php',
	'__use_static_access__dbtool' => 'System/Libraries/Database/DBTool.php',
	'dbtool' => 'System/Libraries/StaticAccess/Database/__USE_STATIC_ACCESS__DBTool.php',
	'cubriddriver' => 'System/Libraries/Database/Drivers/CubridDriver.php',
	'fbsqldriver' => 'System/Libraries/Database/Drivers/FbsqlDriver.php',
	'ibasedriver' => 'System/Libraries/Database/Drivers/IbaseDriver.php',
	'mssqldriver' => 'System/Libraries/Database/Drivers/MssqlDriver.php',
	'mysqldriver' => 'System/Libraries/Database/Drivers/MysqlDriver.php',
	'mysqlidriver' => 'System/Libraries/Database/Drivers/MysqliDriver.php',
	'oci8driver' => 'System/Libraries/Database/Drivers/Oci8Driver.php',
	'odbcdriver' => 'System/Libraries/Database/Drivers/OdbcDriver.php',
	'pdo4ddriver' => 'System/Libraries/Database/Drivers/PDODrivers/PDO4dDriver.php',
	'pdocubriddriver' => 'System/Libraries/Database/Drivers/PDODrivers/PDOCubridDriver.php',
	'pdodblibdriver' => 'System/Libraries/Database/Drivers/PDODrivers/PDODblibDriver.php',
	'pdofirebirddriver' => 'System/Libraries/Database/Drivers/PDODrivers/PDOFirebirdDriver.php',
	'pdoibmdriver' => 'System/Libraries/Database/Drivers/PDODrivers/PDOIbmDriver.php',
	'pdoinformixdriver' => 'System/Libraries/Database/Drivers/PDODrivers/PDOInformixDriver.php',
	'pdomysqldriver' => 'System/Libraries/Database/Drivers/PDODrivers/PDOMysqlDriver.php',
	'pdoocidriver' => 'System/Libraries/Database/Drivers/PDODrivers/PDOOciDriver.php',
	'pdoodbcdriver' => 'System/Libraries/Database/Drivers/PDODrivers/PDOOdbcDriver.php',
	'pdopgsqldriver' => 'System/Libraries/Database/Drivers/PDODrivers/PDOPgsqlDriver.php',
	'pdosqlitedriver' => 'System/Libraries/Database/Drivers/PDODrivers/PDOSqliteDriver.php',
	'pdosqlsrvdriver' => 'System/Libraries/Database/Drivers/PDODrivers/PDOSqlsrvDriver.php',
	'pdodriver' => 'System/Libraries/Database/Drivers/PdoDriver.php',
	'sqlite3driver' => 'System/Libraries/Database/Drivers/Sqlite3Driver.php',
	'sqlitedriver' => 'System/Libraries/Database/Drivers/SqliteDriver.php',
	'sqlsrvdriver' => 'System/Libraries/Database/Drivers/SqlsrvDriver.php',
	'sybasedriver' => 'System/Libraries/Database/Drivers/SybaseDriver.php',
	'__use_static_access__date' => 'System/Libraries/DateTime/Date.php',
	'date' => 'System/Libraries/StaticAccess/DateTime/__USE_STATIC_ACCESS__Date.php',
	'__use_static_access__time' => 'System/Libraries/DateTime/Time.php',
	'time' => 'System/Libraries/StaticAccess/DateTime/__USE_STATIC_ACCESS__Time.php',
	'imapdriver' => 'System/Libraries/EmailService/Drivers/ImapDriver.php',
	'maildriver' => 'System/Libraries/EmailService/Drivers/MailDriver.php',
	'pipedriver' => 'System/Libraries/EmailService/Drivers/PipeDriver.php',
	'senddriver' => 'System/Libraries/EmailService/Drivers/SendDriver.php',
	'smtpdriver' => 'System/Libraries/EmailService/Drivers/SmtpDriver.php',
	'__use_static_access__email' => 'System/Libraries/EmailService/Email.php',
	'email' => 'System/Libraries/StaticAccess/EmailService/__USE_STATIC_ACCESS__Email.php',
	'__use_static_access__gt' => 'System/Libraries/EncodingSupport/GT.php',
	'gt' => 'System/Libraries/StaticAccess/EncodingSupport/__USE_STATIC_ACCESS__GT.php',
	'__use_static_access__iv' => 'System/Libraries/EncodingSupport/IV.php',
	'iv' => 'System/Libraries/StaticAccess/EncodingSupport/__USE_STATIC_ACCESS__IV.php',
	'__use_static_access__mb' => 'System/Libraries/EncodingSupport/MB.php',
	'mb' => 'System/Libraries/StaticAccess/EncodingSupport/__USE_STATIC_ACCESS__MB.php',
	'__use_static_access__ml' => 'System/Libraries/EncodingSupport/ML.php',
	'ml' => 'System/Libraries/StaticAccess/EncodingSupport/__USE_STATIC_ACCESS__ML.php',
	'error' => 'System/Libraries/ErrorHandling/Error.php',
	'exceptions' => 'System/Libraries/ErrorHandling/Exceptions.php',
	'__use_static_access__download' => 'System/Libraries/FileSystem/Download.php',
	'download' => 'System/Libraries/StaticAccess/FileSystem/__USE_STATIC_ACCESS__Download.php',
	'__use_static_access__file' => 'System/Libraries/FileSystem/File.php',
	'file' => 'System/Libraries/StaticAccess/FileSystem/__USE_STATIC_ACCESS__File.php',
	'__use_static_access__folder' => 'System/Libraries/FileSystem/Folder.php',
	'folder' => 'System/Libraries/StaticAccess/FileSystem/__USE_STATIC_ACCESS__Folder.php',
	'__use_static_access__upload' => 'System/Libraries/FileSystem/Upload.php',
	'__use_static_access__znr' => 'System/Libraries/FileSystem/ZNR.php',
	'znr' => 'System/Libraries/StaticAccess/FileSystem/__USE_STATIC_ACCESS__ZNR.php',
	'controller' => 'System/Libraries/Foundations/Controller.php',
	'__use_static_access__driver' => 'System/Libraries/Foundations/Driver.php',
	'driver' => 'System/Libraries/StaticAccess/Foundations/__USE_STATIC_ACCESS__Driver.php',
	'import' => 'System/Libraries/Foundations/Import.php',
	'__use_static_access__method' => 'System/Libraries/Foundations/Method.php',
	'method' => 'System/Libraries/StaticAccess/Foundations/__USE_STATIC_ACCESS__Method.php',
	'repair' => 'System/Libraries/Foundations/Repair.php',
	'__use_static_access__route' => 'System/Libraries/Foundations/Route.php',
	'route' => 'System/Libraries/StaticAccess/__USE_STATIC_ACCESS__Route.php',
	'staticaccess' => 'System/Libraries/Foundations/StaticAccess.php',
	'__use_static_access__uri' => 'System/Libraries/Foundations/URI.php',
	'uri' => 'System/Libraries/StaticAccess/Foundations/__USE_STATIC_ACCESS__URI.php',
	'__use_static_access__build' => 'System/Libraries/Helpers/Build.php',
	'build' => 'System/Libraries/StaticAccess/Helpers/__USE_STATIC_ACCESS__Build.php',
	'__use_static_access__clean' => 'System/Libraries/Helpers/Clean.php',
	'clean' => 'System/Libraries/StaticAccess/Helpers/__USE_STATIC_ACCESS__Clean.php',
	'__use_static_access__convert' => 'System/Libraries/Helpers/Convert.php',
	'convert' => 'System/Libraries/StaticAccess/Helpers/__USE_STATIC_ACCESS__Convert.php',
	'__use_static_access__filter' => 'System/Libraries/Helpers/Filter.php',
	'filter' => 'System/Libraries/StaticAccess/Helpers/__USE_STATIC_ACCESS__Filter.php',
	'__use_static_access__format' => 'System/Libraries/Helpers/Format.php',
	'format' => 'System/Libraries/StaticAccess/Helpers/__USE_STATIC_ACCESS__Format.php',
	'__use_static_access__json' => 'System/Libraries/Helpers/Json.php',
	'json' => 'System/Libraries/StaticAccess/Helpers/__USE_STATIC_ACCESS__Json.php',
	'__use_static_access__limit' => 'System/Libraries/Helpers/Limit.php',
	'limit' => 'System/Libraries/StaticAccess/Helpers/__USE_STATIC_ACCESS__Limit.php',
	'__use_static_access__round' => 'System/Libraries/Helpers/Round.php',
	'round' => 'System/Libraries/StaticAccess/Helpers/__USE_STATIC_ACCESS__Round.php',
	'__use_static_access__search' => 'System/Libraries/Helpers/Search.php',
	'search' => 'System/Libraries/StaticAccess/Helpers/__USE_STATIC_ACCESS__Search.php',
	'__use_static_access__separator' => 'System/Libraries/Helpers/Separator.php',
	'separator' => 'System/Libraries/StaticAccess/Helpers/__USE_STATIC_ACCESS__Separator.php',
	'__use_static_access__symbol' => 'System/Libraries/Helpers/Symbol.php',
	'symbol' => 'System/Libraries/StaticAccess/Helpers/__USE_STATIC_ACCESS__Symbol.php',
	'__use_static_access__form' => 'System/Libraries/HyperText/Form.php',
	'form' => 'System/Libraries/StaticAccess/HyperText/__USE_STATIC_ACCESS__Form.php',
	'__use_static_access__html' => 'System/Libraries/HyperText/HTML.php',
	'html' => 'System/Libraries/StaticAccess/HyperText/__USE_STATIC_ACCESS__HTML.php',
	'__use_static_access__html5' => 'System/Libraries/HyperText/HTML5.php',
	'html5' => 'System/Libraries/StaticAccess/HyperText/__USE_STATIC_ACCESS__HTML5.php',
	'__use_static_access__gd' => 'System/Libraries/ImageProcessing/GD.php',
	'gd' => 'System/Libraries/StaticAccess/ImageProcessing/__USE_STATIC_ACCESS__GD.php',
	'__use_static_access__image' => 'System/Libraries/ImageProcessing/Image.php',
	'image' => 'System/Libraries/StaticAccess/ImageProcessing/__USE_STATIC_ACCESS__Image.php',
	'__use_static_access__thumb' => 'System/Libraries/ImageProcessing/Thumb.php',
	'thumb' => 'System/Libraries/StaticAccess/ImageProcessing/__USE_STATIC_ACCESS__Thumb.php',
	'__use_static_access__jq' => 'System/Libraries/Javascript/JQ.php',
	'jq' => 'System/Libraries/StaticAccess/Javascript/__USE_STATIC_ACCESS__JQ.php',
	'__use_static_access__jqaction' => 'System/Libraries/Javascript/JQAction.php',
	'jqaction' => 'System/Libraries/StaticAccess/Javascript/__USE_STATIC_ACCESS__JQAction.php',
	'__use_static_access__jqajax' => 'System/Libraries/Javascript/JQAjax.php',
	'jqajax' => 'System/Libraries/StaticAccess/Javascript/__USE_STATIC_ACCESS__JQAjax.php',
	'__use_static_access__jqanimate' => 'System/Libraries/Javascript/JQAnimate.php',
	'jqanimate' => 'System/Libraries/StaticAccess/Javascript/__USE_STATIC_ACCESS__JQAnimate.php',
	'__use_static_access__jqbuilder' => 'System/Libraries/Javascript/JQBuilder.php',
	'jqbuilder' => 'System/Libraries/StaticAccess/Javascript/__USE_STATIC_ACCESS__JQBuilder.php',
	'__use_static_access__jqevent' => 'System/Libraries/Javascript/JQEvent.php',
	'jqevent' => 'System/Libraries/StaticAccess/Javascript/__USE_STATIC_ACCESS__JQEvent.php',
	'__use_static_access__js' => 'System/Libraries/Javascript/JS.php',
	'js' => 'System/Libraries/StaticAccess/Javascript/__USE_STATIC_ACCESS__JS.php',
	'jscommon' => 'System/Libraries/Javascript/JSCommon.php',
	'__use_static_access__permission' => 'System/Libraries/Permission/Permission.php',
	'permission' => 'System/Libraries/StaticAccess/Permission/__USE_STATIC_ACCESS__Permission.php',
	'__use_static_access__security' => 'System/Libraries/Security/Security.php',
	'security' => 'System/Libraries/StaticAccess/Security/__USE_STATIC_ACCESS__Security.php',
	'__use_static_access__curl' => 'System/Libraries/Services/CURL.php',
	'curl' => 'System/Libraries/StaticAccess/Services/__USE_STATIC_ACCESS__CURL.php',
	'__use_static_access__ftp' => 'System/Libraries/Services/FTP.php',
	'ftp' => 'System/Libraries/StaticAccess/Services/__USE_STATIC_ACCESS__FTP.php',
	'__use_static_access__net' => 'System/Libraries/Services/Net.php',
	'net' => 'System/Libraries/StaticAccess/Services/__USE_STATIC_ACCESS__Net.php',
	'__use_static_access__cookie' => 'System/Libraries/SessionCookie/Cookie.php',
	'cookie' => 'System/Libraries/StaticAccess/SessionCookie/__USE_STATIC_ACCESS__Cookie.php',
	'__use_static_access__session' => 'System/Libraries/SessionCookie/Session.php',
	'session' => 'System/Libraries/StaticAccess/SessionCookie/__USE_STATIC_ACCESS__Session.php',
	'__use_static_access__cart' => 'System/Libraries/ShoppingCart/Cart.php',
	'cart' => 'System/Libraries/StaticAccess/ShoppingCart/__USE_STATIC_ACCESS__Cart.php',
	'animation' => 'System/Libraries/StaticAccess/StyleSheet/__USE_STATIC_ACCESS__Animation.php',
	'css' => 'System/Libraries/StaticAccess/StyleSheet/__USE_STATIC_ACCESS__CSS.php',
	'css3' => 'System/Libraries/StaticAccess/StyleSheet/__USE_STATIC_ACCESS__CSS3.php',
	'shadow' => 'System/Libraries/StaticAccess/StyleSheet/__USE_STATIC_ACCESS__Shadow.php',
	'style' => 'System/Libraries/StaticAccess/StyleSheet/__USE_STATIC_ACCESS__Style.php',
	'transform' => 'System/Libraries/StaticAccess/StyleSheet/__USE_STATIC_ACCESS__Transform.php',
	'transition' => 'System/Libraries/StaticAccess/StyleSheet/__USE_STATIC_ACCESS__Transition.php',
	'blade' => 'System/Libraries/StaticAccess/Templating/__USE_STATIC_ACCESS__Blade.php',
	'parser' => 'System/Libraries/StaticAccess/Templating/__USE_STATIC_ACCESS__Parser.php',
	'saber' => 'System/Libraries/StaticAccess/Templating/__USE_STATIC_ACCESS__Saber.php',
	'regex' => 'System/Libraries/StaticAccess/TextProcessing/__USE_STATIC_ACCESS__Regex.php',
	'strings' => 'System/Libraries/StaticAccess/TextProcessing/__USE_STATIC_ACCESS__Strings.php',
	'validation' => 'System/Libraries/StaticAccess/Validation/__USE_STATIC_ACCESS__Validation.php',
	'arrays' => 'System/Libraries/StaticAccess/VariableTypes/__USE_STATIC_ACCESS__Arrays.php',
	'chars' => 'System/Libraries/StaticAccess/VariableTypes/__USE_STATIC_ACCESS__Chars.php',
	'classes' => 'System/Libraries/StaticAccess/VariableTypes/__USE_STATIC_ACCESS__Classes.php',
	'filters' => 'System/Libraries/StaticAccess/VariableTypes/__USE_STATIC_ACCESS__Filters.php',
	'functions' => 'System/Libraries/StaticAccess/VariableTypes/__USE_STATIC_ACCESS__Functions.php',
	'vars' => 'System/Libraries/StaticAccess/VariableTypes/__USE_STATIC_ACCESS__Vars.php',
	'xml' => 'System/Libraries/StaticAccess/XMLManipulation/__USE_STATIC_ACCESS__XML.php',
	'__use_static_access__animation' => 'System/Libraries/StyleSheet/Animation.php',
	'__use_static_access__css' => 'System/Libraries/StyleSheet/CSS.php',
	'__use_static_access__css3' => 'System/Libraries/StyleSheet/CSS3.php',
	'__use_static_access__shadow' => 'System/Libraries/StyleSheet/Shadow.php',
	'__use_static_access__style' => 'System/Libraries/StyleSheet/Style.php',
	'__use_static_access__transform' => 'System/Libraries/StyleSheet/Transform.php',
	'__use_static_access__transition' => 'System/Libraries/StyleSheet/Transition.php',
	'__use_static_access__blade' => 'System/Libraries/Templating/Blade.php',
	'__use_static_access__parser' => 'System/Libraries/Templating/Parser.php',
	'__use_static_access__saber' => 'System/Libraries/Templating/Saber.php',
	'__use_static_access__regex' => 'System/Libraries/TextProcessing/Regex.php',
	'__use_static_access__strings' => 'System/Libraries/TextProcessing/Strings.php',
	'__use_static_access__validation' => 'System/Libraries/Validation/Validation.php',
	'__use_static_access__arrays' => 'System/Libraries/VariableTypes/Arrays.php',
	'__use_static_access__chars' => 'System/Libraries/VariableTypes/Chars.php',
	'__use_static_access__classes' => 'System/Libraries/VariableTypes/Classes.php',
	'__use_static_access__filters' => 'System/Libraries/VariableTypes/Filters.php',
	'__use_static_access__functions' => 'System/Libraries/VariableTypes/Functions.php',
	'__use_static_access__vars' => 'System/Libraries/VariableTypes/Vars.php',
	'__use_static_access__xml' => 'System/Libraries/XMLManipulation/XML.php'
);

$config['ClassMap']['namespaces'] = array
(
);


text:
package com.google.cloud.bigtable.grpc.scanner;

import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

import com.google.cloud.bigtable.grpc.BigtableSessionSharedThreadPools;
import com.google.cloud.bigtable.grpc.io.IOExceptionWithStatus;
import com.google.protobuf.ByteString;
import io.grpc.Status;
import io.grpc.StatusRuntimeException;
import io.grpc.stub.ClientCallStreamObserver;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

@RunWith(JUnit4.class)
@SuppressWarnings({"rawtypes", "unchecked"})
public class ResponseQueueReaderTest {

  @Mock private ClientCallStreamObserver mockClientCallStreamObserver;

  @Rule public ExpectedException expectedException = ExpectedException.none();

  private ResponseQueueReader underTest;

  @Before
  public void setup() {
    MockitoAnnotations.initMocks(this);
    underTest = new ResponseQueueReader();
    underTest.beforeStart(mockClientCallStreamObserver);
  }

  @Test
  public void testNone() throws IOException {
    underTest.onCompleted();
    assertNull(underTest.getNextMergedRow());
  }

  @Test
  public void testSinglePostComplete() throws IOException {
    FlatRow row = new FlatRow(ByteString.EMPTY, null);
    underTest.onNext(row);
    underTest.addRequestResultMarker();
    underTest.onCompleted();
    assertSame(row, underTest.getNextMergedRow());
    verify(mockClientCallStreamObserver, times(0)).request(anyInt());
  }

  @Test
  public void testSinglePrecomplete() throws IOException {
    FlatRow row = new FlatRow(ByteString.EMPTY, null);
    underTest.onNext(row);
    underTest.addRequestResultMarker();
    assertSame(row, underTest.getNextMergedRow());
    // getNextMergedRow() will block until either a result is present or the operation is complete.
    BigtableSessionSharedThreadPools.getInstance()
        .getRetryExecutor()
        .schedule(
            new Runnable() {
              @Override
              public void run() {
                underTest.onCompleted();
              }
            },
            50,
            TimeUnit.MILLISECONDS);
    assertNull(underTest.getNextMergedRow());
    verify(mockClientCallStreamObserver, times(1)).request(eq(1));
  }

  @Test
  public void testException() throws IOException {
    StatusRuntimeException exception = Status.DEADLINE_EXCEEDED.asRuntimeException();
    expectedException.expect(IOExceptionWithStatus.class);
    underTest.onError(exception);
    underTest.getNextMergedRow();
  }
}


text:
package com.spriteproject.pocketpet.main.gameobjects.pet;

import java.util.Calendar;

import org.json.JSONException;
import org.json.JSONObject;

import android.graphics.Canvas;
import android.util.Log;
import android.view.MotionEvent;

import com.spriteproject.pocketpet.R;
import com.spriteproject.pocketpet.assets.Constants;
import com.spriteproject.pocketpet.assets.Constants.State;
import com.spriteproject.pocketpet.assets.Constants.Type;
import com.spriteproject.pocketpet.assets.Screen;
import com.spriteproject.pocketpet.main.MainView;
import com.spriteproject.pocketpet.main.gameobjects.GameObject;

public abstract class Pet extends GameObject {

	// Status
	protected int angelpower;
	protected int hunger;
	protected int happiness;
	protected int health;
	protected int weight;
	protected boolean isDead;
	protected int evolutionStage;
	protected float randomMovementTimer;
	private float poopTimer;
	private float evolutionTimer;
	private float happinessUpdateTimer;
	private float hungerUpdateTimer;
	private float foodTimer;
	private float healthUpdateTimer;
	private int angelpowerUpdateTimer;
	private float wokenUpTimer;
	private float timeSlept;

	// Tapping
	private float lastTap;
	private int tapCount;

	// Controllers
	protected ConditionController conditionController;
	protected StateController stateController;

	public Pet(MainView view, int id, float x, float y) {
		super(view, id, x, y);

		// Setup initial values
		init();

		// Setup controllers
		conditionController = new ConditionController(view);
		stateController = new StateController(this, view, id);
		stateController.resetStateToDefault();
	}

	public Pet(MainView view, JSONObject obj, float time) throws JSONException {
		super(view, obj, time);
	}

	private void init() {
		// Status values
		angelpower = 0;
		isDead = false;
		hunger = 5;
		happiness = 5;
		health = 10;
		weight = Constants.WEIGHT_GAIN_BABY;
		evolutionStage = 0;
		randomMovementTimer = 0;
		poopTimer = 0;
		evolutionTimer = 0;
		happinessUpdateTimer = 0;
		hungerUpdateTimer = 0;
		foodTimer = 0;
		healthUpdateTimer = 0;

		// Sleep
		wokenUpTimer = 0;
		timeSlept = 0;

		// Tapping
		lastTap = 0;
		tapCount = 0;

		Log.d(TAG, "init done");
	}

	@Override
	public void update(float delta) {
		if (!touched) {
			updateCollisionWithWalls();
			randomMovement(delta);
			posX += velX;
			posY += velY;
		}

		if (getCondition() != null) {
			getCondition().update(delta);
		}

		if (!isDead) {
			updatePoop(delta);
			updateHunger(delta);
			updateEvolution(delta);
			updateHealth(delta);
			updateSleep(delta);
			updateHappiness(delta);
			updateAngelPower(delta);
		}

		stateController.update(delta);
		animate(delta);
		lifeTime += delta;

		if (tapCount > 0 && System.nanoTime() / 1000000 - lastTap > Constants.TAP_DELTA) {
			tapCount = 0;
		}
	}

	@Override
	public void draw(Canvas canvas) {
		super.draw(canvas);
		if (getCondition() != null) {
			getCondition().draw(canvas);
		}
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		// set touched or not touched
		if (event.getAction() == MotionEvent.ACTION_DOWN) {
			if (!touched && draggable) {
				handleActionDown(event.getX(), event.getY());
			}
			lastTap = System.nanoTime() / 1000000;
		}

		// apply action when pet is touched
		if (event.getAction() == MotionEvent.ACTION_MOVE) {
			if (touched) {
				if (event.getX() >= 0 && event.getX() <= Screen.getWidth()) {
					setPosX(event.getX());
				}

				if (event.getY() >= Constants.BUTTON_HEIGHT && event.getY() <= Screen.getHeight() - Constants.BUTTON_HEIGHT) {
					setPosY(event.getY());
				}
			}
		}

		// remove touched flag when touch event ends
		if (event.getAction() == MotionEvent.ACTION_UP) {
			if (touched) {
				touched = false;
				view.setTouchPresent(false);

				if (System.nanoTime() / 1000000 - lastTap < Constants.TAP_DELTA) {
					if (tapCount < Constants.TAP_LIMIT) {
						tapCount++;
					}
					else {
						if (getState() != State.SICK) {
							setState(State.ANGRY);
							tapCount = 0;
							wokenUpTimer = 0;
						}
					}
				}
			}
			Log.d(TAG, "Tap Count: " + tapCount);
		}
		return true;
	}

	@Override
	protected void animate(float delta) {
		// Get the correct row based on pet state
		currentRow = stateController.getCurrentRow();

		// If timer still going, don't change the frame
		if (frameTimer > 0) {
			frameTimer -= delta;
		}
		else {
			currentFrame = stateController.getCurrentFrame();
			resetFrameTimer();
		}

		sourceRect.left = currentFrame * spriteWidth;
		sourceRect.right = sourceRect.left + spriteWidth;
		sourceRect.top = currentRow * spriteHeight;
		sourceRect.bottom = sourceRect.top + spriteHeight;
	}

	protected void randomMovement(float delta) {

		// Stay in place: when the pet is eating or sleeping
		if (getState() == State.EATING || getState() == State.SLEEPING) {
			stop();
			return;
		}

		// Pets have a 50% chance to move around and 50% change to stay in place, every interval
		if (randomMovementTimer > Constants.RANDOM_MOVEMENT_INTERVAL) {
			// Stay in place
			if (random.nextDouble() > 0.5f) {
				stop();
			}
			// Move around
			else {
				moveInRandomDirection();
			}
			randomMovementTimer = 0;
		}
		else {
			randomMovementTimer += delta;
		}
	}

	protected void moveInRandomDirection() {
		if (random.nextDouble() > 0.5f) {
			velX = Constants.MOVEMENT_SPEED;
		}
		else {
			velX = -Constants.MOVEMENT_SPEED;
		}

		if (random.nextDouble() > 0.5f) {
			velY = Constants.MOVEMENT_SPEED;
		}
		else {
			velY = -Constants.MOVEMENT_SPEED;
		}
	}

	protected void stop() {
		velX = 0;
		velY = 0;
	}

	protected void updatePoop(float delta) {
		// Pets shouldn't poop if they are sleeping
		if (getState() == State.SLEEPING) {
			return;
		}

		if (poopTimer > Constants.POOP_INTERVAL && hunger > Constants.POOP_HUNGER_THRESHOLD) {
			Log.d(TAG, "Did a poo");
			view.createGameObject(Type.POO, R.drawable.poo, getPosX(), getPosY());
			hunger--;
			poopTimer = 0;

			if (view.Count(Type.POO) >= Constants.POOP_SICK_THRESHOLD) {
				setState(State.SICK);
			}
		}
		poopTimer += delta;
	}

	protected void updateHealth(float delta) {
		float interval;

		// When sleeping, updates are twice a slow
		if (getState() == State.SLEEPING) {
			interval = 2 * Constants.HEALTH_INTERVAL;
		}
		// When sick, health decreases twice as fast
		else if(getState() == State.SICK){
			interval = 0.5f * Constants.HEALTH_INTERVAL;
		}
		// Normal case
		else {
			interval = Constants.HEALTH_INTERVAL;
		}

		if (healthUpdateTimer > interval) {

			if (hunger <= Constants.HUNGRY_THRESHOLD_LOWER || getState() == State.SICK) {
				if (health > 0) {
					incrementHealth(-1);
				}
				else {
					isDead = true;
					changeSpeciesTo(R.drawable.ghost);
				}
			}
			else if (hunger >= Constants.HUNGRY_THRESHOLD_UPPER) {
				incrementHealth(1);
			}
			healthUpdateTimer = 0;

		}
		else {
			healthUpdateTimer += delta;
		}

	}

	protected void updateHappiness(float delta) {
		float interval;

		// When sleeping, updates are twice a slow
		if (getState() == State.SLEEPING) {
			interval = 2 * Constants.HAPPINESS_INTERVAL;
		}
		// When sick, decreases twice as fast
		else if(getState() == State.SICK){
			interval = 0.5f * Constants.HAPPINESS_INTERVAL;
		}
		// Normal case
		else {
			interval = Constants.HAPPINESS_INTERVAL;
		}

		if (happinessUpdateTimer > interval) {
			incrementHappiness(-1);
			happinessUpdateTimer = 0;
		}
		else {
			happinessUpdateTimer += delta;
		}

	}

	protected void updateHunger(float delta) {
		float interval;

		if (getState() == State.SLEEPING) {
			interval = 2 * Constants.HUNGER_INTERVAL;
		}
		else {
			interval = Constants.HUNGER_INTERVAL;
		}

		if (hungerUpdateTimer > interval) {
			incrementHunger(-1);
			incrementWeight(Constants.WEIGHT_GAIN_FOOD);
			Log.d(TAG, "Hungry! " + hunger);
			hungerUpdateTimer = 0;
		}
		hungerUpdateTimer += delta;
	}

	protected void updateEvolution(float delta) {
		if (getState() != State.SLEEPING) {
			// Baby
			if (evolutionStage == 0 && evolutionTimer > Constants.EVOLUTION_INTERVAL_1) {
				if (angelpower > Constants.AP_LEVEL_BEST_1) {
					changeSpeciesTo(R.drawable.teen_angel);
				}
				else {
					changeSpeciesTo(R.drawable.teen_duck);
				}
				weight += Constants.WEIGHT_GAIN_TEEN;
				incrementEvolutionStage(1);
				evolutionTimer = 0;
				resetAngelpower();
			}
			// Teen
			else if (evolutionStage == 1 && evolutionTimer > Constants.EVOLUTION_INTERVAL_2) {
				if(id == R.drawable.teen_angel) {
					if (angelpower > Constants.AP_LEVEL_BEST_2) {
						changeSpeciesTo(R.drawable.baby_human);
					}
					else {
						changeSpeciesTo(R.drawable.adult_angel);
					}
				}
				else if(id == R.drawable.teen_duck) {
					if (angelpower > Constants.AP_LEVEL_BEST_2) {
						changeSpeciesTo(R.drawable.adult_human);
					}
					else if (angelpower < Constants.AP_LEVEL_WORST_2){
						changeSpeciesTo(R.drawable.adult_unhealthy);
					}
					else {
						changeSpeciesTo(R.drawable.adult_duck);
					}
				}

				weight += Constants.WEIGHT_GAIN_ADULT;
				incrementEvolutionStage(1);
				evolutionTimer = 0;
				resetAngelpower();
			}
			// Adult
			else if (evolutionStage == 2 && evolutionTimer > Constants.EVOLUTION_INTERVAL_3) {
				if(id == R.drawable.baby_human || id == R.drawable.adult_human) {
					if (angelpower > Constants.AP_LEVEL_BEST_3) {
						changeSpeciesTo(R.drawable.secret_twins);
						incrementEvolutionStage(1);
						evolutionTimer = 0;
						resetAngelpower();
					}
				}
				else if (id == R.drawable.adult_unhealthy) {
					if (angelpower > Constants.AP_LEVEL_BEST_3) {
						changeSpeciesTo(R.drawable.secret_unhealthy);
						incrementEvolutionStage(1);
						evolutionTimer = 0;
						resetAngelpower();
					}
				}
				else {
					MakeRandomEgg();
					incrementEvolutionStage(1);
					evolutionTimer = 0;
				}
			}
			// Extra stage (for secrets)
			else if (evolutionStage == 3 && evolutionTimer > Constants.EVOLUTION_INTERVAL_3) {
				if(id == R.drawable.secret_twins) {
					MakeRandomEgg();
					MakeRandomEgg();
					incrementEvolutionStage(1);
					evolutionTimer = 0;
				}
				else if (id == R.drawable.secret_unhealthy) {
					MakeRandomEgg();
					incrementEvolutionStage(1);
					evolutionTimer = 0;
				}
			}
		}
		evolutionTimer += delta;
	}

	private void MakeRandomEgg() {
		if(random.nextDouble() > 0.9f) {
			if(random.nextDouble() > 0.5f) {
				view.MakeAnEgg(R.drawable.cat_sprites_red, Type.CAT, posX, posY);
			}
			else {
				view.MakeAnEgg(R.drawable.cat_sprites_blue, Type.CAT, posX, posY);
			}
		}
		else {
			view.MakeAnEgg(R.drawable.baby_angel, Type.ANGEL, posX, posY);
		}
	}

	/** Change pet species
	 *
	 * @param name Species resource ID
	 */
	protected void changeSpeciesTo(int name) {
		Log.d(TAG, "Changing Pet Species...");
		setBitmapParameters(name);
		setSpriteDimensions();
		stateController.init();
	}

	private void resetAngelpower() {
		angelpower = 0;
	}

	// Overall treatment level (high AP = better pet)
	protected void updateAngelPower(float delta) {
		if (angelpowerUpdateTimer > Constants.ANGELPOWER_INTERVAL) {
			if(hunger >= 8 && happiness >= 8) {
				angelpower++;
			}
			else if(hunger <= 2 || happiness <= 2) {
				angelpower--;
			}
			angelpowerUpdateTimer = 0;
		}
		else {
			angelpowerUpdateTimer += delta;
		}
	}

	protected void updateSleep(float delta) {
		int hour = calendar.get(Calendar.HOUR_OF_DAY);

		// Night Time
		if (hour >= Constants.SLEEP_HOUR_START || hour < Constants.SLEEP_HOUR_END) {
			// Pet isn't sleeping
			if (getState() != State.SLEEPING) {
				// Check that pet has not slept enough
				if(timeSlept < Constants.TIME_TO_SLEEP) {
					// Check that pet has not been woken up recently
					if(wokenUpTimer > Constants.TIME_TO_WAIT_AFTER_WOKEN_UP) {
						setState(State.SLEEPING); // Put it to sleep
					}
					else {
						wokenUpTimer += delta;
					}
				}
			}
			// Pet is asleep
			else {
				// Wake up if slept enough
				if (timeSlept > Constants.TIME_TO_SLEEP) {
					setState(State.IDLE);
				}
				else {
					timeSlept += delta;
				}
			}
		}
		// Day Time
		else {
			// Wake up if pet is sleeping
			if(getState() == State.SLEEPING) {
				setState(State.IDLE);
				timeSlept = 0;	// Reset the sleep timer for the next night time
			}
		}
	}

	@Override
	public JSONObject getObjectData() throws JSONException {
		JSONObject obj = new JSONObject();
		obj.put("angelpower", angelpower);
		obj.put("angelpowerUpdateTimer", angelpowerUpdateTimer);
		obj.put("id", id);
		obj.put("type", type.name());
		obj.put("state", getState().name());
		obj.put("posX", getPosX());
		obj.put("posY", getPosY());
		obj.put("happiness", happiness);
		obj.put("hunger", hunger);
		obj.put("health", health);
		obj.put("weight", weight);
		obj.put("lifeTime", lifeTime);
		obj.put("evolutionStage", evolutionStage);
		obj.put("poopTimer", poopTimer);
		obj.put("evolutionTimer", evolutionTimer);
		obj.put("happinessUpdateTimer", happinessUpdateTimer);
		obj.put("hungerUpdateTimer", hungerUpdateTimer);
		obj.put("foodTimer", foodTimer);
		obj.put("healthUpdateTimer", healthUpdateTimer);
		obj.put("isDead", isDead);

		return obj;
	}

	@Override
	public void restoreObjectData(JSONObject obj, float time) throws JSONException {

		Log.d(TAG,"Restoring");

		angelpower = obj.getInt("angelpower");
		angelpowerUpdateTimer = obj.getInt("angelpowerUpdateTimer");
		id = obj.getInt("id");
		posX = obj.getLong("posX");
		posY = obj.getLong("posY");
		conditionController = new ConditionController(view);
		stateController = new StateController(this, view, id);
		setBitmapParameters(id);
		setSpriteDimensions();
		setState(State.valueOf(obj.getString("state")));

		isDead = obj.getBoolean("isDead");
		hunger = obj.getInt("hunger");
		happiness = obj.getInt("happiness");
		health = obj.getInt("health");
		weight = obj.getInt("weight");
		lifeTime = obj.getInt("lifeTime");
		evolutionStage = obj.getInt("evolutionStage");
		poopTimer = obj.getInt("poopTimer");
		evolutionTimer = obj.getInt("evolutionTimer");
		happinessUpdateTimer = obj.getInt("happinessUpdateTimer");
		hungerUpdateTimer = obj.getInt("hungerUpdateTimer");
		foodTimer = obj.getInt("foodTimer");
		healthUpdateTimer = obj.getInt("healthUpdateTimer");

		if (!view.isGamePaused()) {
			while (time > 0) {

				Log.d(TAG,"Running through time");

				float delta;
				if (time > Constants.ANGELPOWER_INTERVAL) {
					time -= Constants.ANGELPOWER_INTERVAL;
					delta = Constants.ANGELPOWER_INTERVAL;
				}
				else {
					delta = time;
					time = 0;
				}
				Log.d(TAG, "Advanced " + delta / (1000 * 60) + " minutes.");

				updatePoop(delta);
				updateHunger(delta);
				updateEvolution(delta);
				updateHealth(delta);
				updateSleep(delta);
				updateHappiness(delta);
				updateAngelPower(delta);

				lifeTime += delta;
			}
		}
	}

	public int getHunger() {
		return hunger;
	}

	public boolean isDead() {
		return isDead;
	}

	public void setDead(boolean isDead) {
		this.isDead = isDead;
	}

	public int getHappiness() {
		return happiness;
	}

	public int getHealth() {
		return health;
	}

	public int getWeight() {
		return weight;
	}

	public void incrementHappiness(int i) {
		happiness += i;
		if(happiness > 10) happiness = 10;
		else if (happiness < 0) happiness = 0;
	}

	public void incrementHealth(int i) {
		health += i;
		if(health > 10) health = 10;
		else if (health < 0) health = 0;
	}

	public void incrementWeight(int i) {
		this.weight += i;
	}

	public void incrementHunger(int i) {
		this.hunger += i;
		if(hunger > 10) hunger = 10;
		else if (hunger < 0) hunger = 0;
	}

	public void incrementEvolutionStage(int i) {
		this.evolutionStage += i;
		if(evolutionStage > 3) evolutionStage = 3;
		else if (evolutionStage < 0) evolutionStage = 0;
	}

	public State getState() {
		return stateController.getState();
	}

	public void setState(State state) {
		stateController.setState(state);
	}

	public Condition getCondition() {
		return conditionController.getCondition();
	}

	public void setCondition(Condition condition) {
		conditionController.setCondition(condition);
	}
}


text:
package de.rosebud.core.debug;

import java.util.Map;

import com.google.common.eventbus.EventBus;

import de.rosebud.core.Behaviour;
import de.rosebud.core.DefaultBehaviour;
import de.rosebud.core.Environment;
import de.rosebud.core.Fragment;

// adds a representation of the current page tree to the data
public class CollectTreeBehaviour extends DefaultBehaviour implements Behaviour {

    class node {
        String name;
        String indent;
    }

    @Override
    public void collectData(Map<String, Object> additionalData,
                            EventBus eventBus, Environment env) {
        // find root
        Fragment root = this.getHostFragment();
        while (root.getParent() != null) {
            root = root.getParent();
        }
        String treeAsString = createTreeAsString(root, "");
        this.getHostFragment().addSingleData("tree", treeAsString);

    }

    private String createTreeAsString(Fragment node, String indent) {
        StringBuilder content = new StringBuilder();
        content.append(indent).append(node.getStartTemplate()).append("
");
        content.append("" + node.getData() + "
");
        for (Fragment child : node.getChilds()) {
            content.append(createTreeAsString(child, indent + "-"));
        }
        return content.toString();
    }

}


text:
package org.basex.query.func;

import static org.basex.query.QueryError.*;
import static org.basex.query.func.Function.*;

import org.basex.io.*;
import org.basex.query.*;
import org.junit.*;

/**
 * This class tests the functions of the Archive Module.
 *
 * @author BaseX Team 2005-15, BSD License
 * @author Christian Gruen
 */
public final class ArchiveModuleTest extends AdvancedQueryTest {
  /** Test ZIP file. */
  private static final String ZIP = "src/test/resources/xml.zip";
  /** Test GZIP file. */
  private static final String GZIP = "src/test/resources/xml.gz";

  /** Test method. */
  @Test
  public void create() {
    // simple zip files
    query(COUNT.args(_ARCHIVE_CREATE.args("X", "")), "1");
    // simple zip files
    query(COUNT.args(_ARCHIVE_CREATE.args("<archive:entry>X</archive:entry>", "")), "1");
    query(COUNT.args(_ARCHIVE_CREATE.args(
        "<archive:entry level='9'>X</archive:entry>", "")), "1");
    query(COUNT.args(_ARCHIVE_CREATE.args(
        "<archive:entry encoding='US-ASCII'>X</archive:entry>", "")),
        "1");
    query(COUNT.args(_ARCHIVE_CREATE.args("<archive:entry " +
        "last-modified='2000-01-01T12:12:12'>X</archive:entry>", "")), "1");
    query(COUNT.args(_ARCHIVE_CREATE.args("<archive:entry>X</archive:entry>", "",
        " map { }")), "1");
    query(COUNT.args(_ARCHIVE_CREATE.args("<archive:entry>X</archive:entry>", "",
        " map { 'format':'zip', 'algorithm':'deflate' }")), "1");
    query(COUNT.args(_ARCHIVE_CREATE.args("X", "", "<archive:options/>")), "1");
    query(COUNT.args(_ARCHIVE_CREATE.args("<archive:entry>X</archive:entry>", "",
        "<archive:options><archive:format value='zip'/>" +
        "<archive:algorithm value='deflate'/></archive:options>")), "1");
    query(COUNT.args(_ARCHIVE_CREATE.args("<archive:entry>X</archive:entry>", "",
        "<archive:options><archive:format value='zip'/></archive:options>")), "1");
    query(COUNT.args(_ARCHIVE_CREATE.args("<archive:entry>X</archive:entry>", "",
        "<archive:options><archive:format value='gzip'/></archive:options>")), "1");

    // different number of entries and contents
    error(_ARCHIVE_CREATE.args("X", "()"), ARCH_DIFF_X_X);
    // name must not be empty
    error(_ARCHIVE_CREATE.args("<archive:entry/>", ""), ARCH_EMPTY);
    // invalid compression level
    error(_ARCHIVE_CREATE.args("<archive:entry compression-level='x'>X</archive:entry>", ""),
        ARCH_LEVEL_X);
    error(_ARCHIVE_CREATE.args("<archive:entry compression-level='10'>X</archive:entry>", ""),
        ARCH_LEVEL_X);
    // invalid modification date
    error(_ARCHIVE_CREATE.args("<archive:entry last-modified='2020'>X</archive:entry>", ""),
        ARCH_DATETIME_X);
    // content must be string or binary
    error(_ARCHIVE_CREATE.args("<archive:entry>X</archive:entry>", " 123"), STRBIN_X_X);
    // wrong encoding
    error(_ARCHIVE_CREATE.args("<archive:entry encoding='x'>X</archive:entry>", ""),
        ARCH_ENCODING_X);
    // errors while converting a string
    error(_ARCHIVE_CREATE.args("<archive:entry encoding='US-ASCII'>X</archive:entry>",
        "\u00fc"), ARCH_ENCODE_X);
    // format not supported
    error(_ARCHIVE_CREATE.args("<archive:entry>X</archive:entry>", "", " map { 'format':'rar' }"),
        ARCH_UNKNOWN);
    // unknown option
    error(_ARCHIVE_CREATE.args("<archive:entry>X</archive:entry>", "", " map { 'x':'y' }"),
        INVALIDOPT_X);
    error(_ARCHIVE_CREATE.args("<archive:entry>X</archive:entry>", "",
        "<archive:options><archive:format value='rar'/></archive:options>"),
        ARCH_UNKNOWN);
    // algorithm not supported
    error(_ARCHIVE_CREATE.args("<archive:entry>X</archive:entry>", "",
        "<archive:options><archive:algorithm value='unknown'/></archive:options>"),
        ARCH_SUPP_X_X);
    // algorithm not supported
    error(_ARCHIVE_CREATE.args("('x','y')", "('a','b')",
        "<archive:options><archive:format value='gzip'/></archive:options>"),
        ARCH_ONE_X);
  }

  /** Test method. */
  @Test
  public void entries() {
    // read entries
    query(COUNT.args(_ARCHIVE_ENTRIES.args(_FILE_READ_BINARY.args(ZIP))), "5");
    // simple zip files
    query(COUNT.args(_ARCHIVE_ENTRIES.args(_FILE_READ_BINARY.args(ZIP)) +
        "[@size][@last-modified][@compressed-size]"), "5");
    // simple gzip files
    query(COUNT.args(_ARCHIVE_ENTRIES.args(_FILE_READ_BINARY.args(GZIP)) +
        "[not(@size)][not(@last-modified)][not(@compressed-size)][not(text())]"), "1");
  }

  /** Test method. */
  @Test
  public void options() {
    // read entries
    query(_ARCHIVE_OPTIONS.args(_FILE_READ_BINARY.args(ZIP)) + "//@value/data()",
        "zip\ndeflate");
    query(_ARCHIVE_OPTIONS.args(_FILE_READ_BINARY.args(GZIP)) + "//@value/data()",
        "gzip\ndeflate");
  }

  /** Test method. */
  @Test
  public void extractText() {
    // extract all entries
    query(COUNT.args(_ARCHIVE_EXTRACT_TEXT.args(_FILE_READ_BINARY.args(ZIP))), "5");
    // extract all entries
    query("let $a := " + _FILE_READ_BINARY.args(ZIP) +
          "let $b := " + _ARCHIVE_ENTRIES.args("$a") +
          "return " + COUNT.args(_ARCHIVE_EXTRACT_TEXT.args("$a", "$b")), 5);
    // extract single entry
    query("let $a := " + _FILE_READ_BINARY.args(ZIP) +
          "let $b := " + _ARCHIVE_EXTRACT_TEXT.args("$a", "test/input.xml") +
          "let $c := " + PARSE_XML.args("$b") +
          "return $c//title/text()", "XML");
    // extract single entry
    query("let $a := " + _FILE_READ_BINARY.args(ZIP) +
          "let $b := " + _ARCHIVE_EXTRACT_TEXT.args("$a",
              "<archive:entry>test/input.xml</archive:entry>") +
          "let $c := " + PARSE_XML.args("$b") +
          "return $c//title/text()", "XML");
  }

  /** Test method. */
  @Test
  public void extractBinary() {
    // extract all entries
    query(COUNT.args(_ARCHIVE_EXTRACT_BINARY.args(_FILE_READ_BINARY.args(ZIP))), "5");
    // extract all entries
    query("let $a := " + _FILE_READ_BINARY.args(ZIP) +
          "let $b := " + _ARCHIVE_ENTRIES.args("$a") +
          "return count(" + _ARCHIVE_EXTRACT_BINARY.args("$a", "$b") + ')', 5);
    // extract single entry
    query("let $a := " + _FILE_READ_BINARY.args(ZIP) +
          "let $b := " + _ARCHIVE_EXTRACT_BINARY.args("$a", "test/input.xml") +
          "let $c := " + _CONVERT_BINARY_TO_STRING.args("$b") +
          "let $d := " + PARSE_XML.args("$c") +
          "return $d//title/text()", "XML");
    // extract single entry
    query("let $a := " + _FILE_READ_BINARY.args(ZIP) +
          "let $b := " + _ARCHIVE_EXTRACT_BINARY.args("$a",
              "<archive:entry>test/input.xml</archive:entry>") +
          "let $c := " + _CONVERT_BINARY_TO_STRING.args("$b") +
          "let $d := " + PARSE_XML.args("$c") +
          "return $d//title/text()", "XML");
  }

  /** Test method. */
  @Test
  public void update() {
    // add a new entry
    query(_FILE_READ_BINARY.args(ZIP) + " ! " +
        _ARCHIVE_UPDATE.args(" .", "X", "X") + " ! " +
        COUNT.args(_ARCHIVE_ENTRIES.args(" .")), 6);
    // add a new entry
    query(_FILE_READ_BINARY.args(ZIP) + " ! " +
        _ARCHIVE_UPDATE.args(" .", "<archive:entry>X</archive:entry>", "X") + " ! " +
        COUNT.args(_ARCHIVE_ENTRIES.args(" .")), 6);
    query(_ARCHIVE_CREATE.args("<archive:entry>X</archive:entry>", "X") + " ! " +
        _ARCHIVE_UPDATE.args(" .", "<archive:entry>Y</archive:entry>", "Y") + " ! " +
        _ARCHIVE_EXTRACT_TEXT.args(" ."), "X\nY");
    // updates an existing entry
    query(_ARCHIVE_CREATE.args("<archive:entry>X</archive:entry>", "X") + " ! " +
        _ARCHIVE_UPDATE.args(" .", "<archive:entry>X</archive:entry>", "Y") + " ! " +
        _ARCHIVE_EXTRACT_TEXT.args(" ."), "Y");
    // updates an existing entry
    error(_ARCHIVE_CREATE.args("X", "X",
        "<archive:options><archive:format value='gzip'/></archive:options>") + " ! " +
        _ARCHIVE_UPDATE.args(" .", "X", "Y"), ARCH_MODIFY_X);
  }

  /** Test method. */
  @Test
  public void delete() {
    // delete single entry
    query("let $a := " + _FILE_READ_BINARY.args(ZIP) +
          "let $b := " + _ARCHIVE_DELETE.args("$a", "infos/stopWords") +
          "let $c := " + _ARCHIVE_ENTRIES.args("$b") +
          "return count($c)", 4);
    // delete all entries except for the first
    query("let $a := " + _FILE_READ_BINARY.args(ZIP) +
          "let $b := " + _ARCHIVE_ENTRIES.args("$a") +
          "let $c := " + _ARCHIVE_DELETE.args("$a", "$b[position() > 1]") +
          "return count(archive:entries($c))", "1");
    // updates an existing entry
    error(_ARCHIVE_CREATE.args("X", "X",
        "<archive:options><archive:format value='gzip'/></archive:options>") + " ! " +
        _ARCHIVE_DELETE.args(" .", "X"), ARCH_MODIFY_X);
  }

  /** Test method. */
  @Test
  public void write() {
    // write archive and count number of entries
    final String tmp = new IOFile(sandbox(), "tmp").path();
    query(_ARCHIVE_WRITE.args(tmp, _FILE_READ_BINARY.args(ZIP)));
    query(COUNT.args(_ARCHIVE_ENTRIES.args(_FILE_READ_BINARY.args(ZIP))), "5");
    // write archive and count number of entries
    query(_ARCHIVE_WRITE.args(tmp, _FILE_READ_BINARY.args(ZIP),
        _ARCHIVE_ENTRIES.args(_FILE_READ_BINARY.args(ZIP))));
    query(COUNT.args(_ARCHIVE_ENTRIES.args(_FILE_READ_BINARY.args(ZIP))), "5");

    query("let $a := " + _ARCHIVE_ENTRIES.args(
      _FILE_READ_BINARY.args(ZIP)) + "/string() " +
      "let $f := " + _FILE_LIST.args(tmp, "true()") + '[' +
      _FILE_IS_FILE.args(" '" + tmp + "/'||.") + "] ! replace(., '\\\\', '/') " +
      "return (every $e in $a satisfies $e = $f) and (every $e in $f satisfies $e =$ a)",
      "true");
  }
}


text:
package net.opengis.gml.provider;

import java.util.Collection;
import java.util.List;

import net.opengis.citygml.building.provider.CityGMLEditPlugin;

import net.opengis.gml.GmlPackage;
import net.opengis.gml.MeasureType;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.ResourceLocator;

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

/**
 * This is the item provider adapter for a {@link net.opengis.gml.MeasureType} object.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public class MeasureTypeItemProvider
	extends ItemProviderAdapter
	implements
		IEditingDomainItemProvider,
		IStructuredItemContentProvider,
		ITreeItemContentProvider,
		IItemLabelProvider,
		IItemPropertySource {
	/**
	 * This constructs an instance from a factory and a notifier.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MeasureTypeItemProvider(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	/**
	 * This returns the property descriptors for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
		if (itemPropertyDescriptors == null) {
			super.getPropertyDescriptors(object);

			addValuePropertyDescriptor(object);
			addUomPropertyDescriptor(object);
		}
		return itemPropertyDescriptors;
	}

	/**
	 * This adds a property descriptor for the Value feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addValuePropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_MeasureType_value_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_MeasureType_value_feature", "_UI_MeasureType_type"),
				 GmlPackage.eINSTANCE.getMeasureType_Value(),
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.REAL_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Uom feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addUomPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_MeasureType_uom_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_MeasureType_uom_feature", "_UI_MeasureType_type"),
				 GmlPackage.eINSTANCE.getMeasureType_Uom(),
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This returns MeasureType.gif.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object getImage(Object object) {
		return overlayImage(object, getResourceLocator().getImage("full/obj16/MeasureType"));
	}

	/**
	 * This returns the label text for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String getText(Object object) {
		MeasureType measureType = (MeasureType)object;
		return getString("_UI_MeasureType_type") + " " + measureType.getValue();
	}

	/**
	 * This handles model notifications by calling {@link #updateChildren} to update any cached
	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void notifyChanged(Notification notification) {
		updateChildren(notification);

		switch (notification.getFeatureID(MeasureType.class)) {
			case GmlPackage.MEASURE_TYPE__VALUE:
			case GmlPackage.MEASURE_TYPE__UOM:
				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
				return;
		}
		super.notifyChanged(notification);
	}

	/**
	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
	 * that can be created under this object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
		super.collectNewChildDescriptors(newChildDescriptors, object);
	}

	/**
	 * Return the resource locator for this item provider's resources.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public ResourceLocator getResourceLocator() {
		return CityGMLEditPlugin.INSTANCE;
	}

}


text:
<?php

class Twig_Tests_Node_Expression_TestTest extends Twig_Test_NodeTestCase
{
    public function testConstructor()
    {
        $expr = new Twig_Node_Expression_Constant('foo', 1);
        $name = new Twig_Node_Expression_Constant('null', 1);
        $args = new Twig_Node();
        $node = new Twig_Node_Expression_Test($expr, $name, $args, 1);

        $this->assertEquals($expr, $node->getNode('node'));
        $this->assertEquals($args, $node->getNode('arguments'));
        $this->assertEquals($name, $node->getAttribute('name'));
    }

    public function getTests()
    {
        $tests = array();

        $expr = new Twig_Node_Expression_Constant('foo', 1);
        $node = new Twig_Node_Expression_Test_Null($expr, 'null', new Twig_Node(array()), 1);
        $tests[] = array($node, '(null === "foo")');

        // test as an anonymous function
        if (PHP_VERSION_ID >= 50300) {
            $node = $this->createTest(new Twig_Node_Expression_Constant('foo', 1), 'anonymous', array(new Twig_Node_Expression_Constant('foo', 1)));
            $tests[] = array($node, 'call_user_func_array($this->env->getTest(\'anonymous\')->getCallable(), array("foo", "foo"))');
        }

        return $tests;
    }

    protected function createTest($node, $name, array $arguments = array())
    {
        return new Twig_Node_Expression_Test($node, $name, new Twig_Node($arguments), 1);
    }

    protected function getEnvironment()
    {
        if (PHP_VERSION_ID >= 50300) {
            return include 'PHP53/TestInclude.php';
        }

        return parent::getEnvironment();
    }
}


text:
/**
 * Module dependencies.
 */

var EventEmitter	= require('events').EventEmitter,
	async			= require('async'),
	util			= require( '../util'),
	loadSails		= require('./load'),
	onTeardown		= require('./teardown'),
	exposeGlobals	= require('./exposeGlobals'),
	runBootstrap	= require('./bootstrap'),
	Grunt			= require('../grunt');

/**
 * Expose `Sails` constructor
 */

module.exports = Sails;

/**
 * Sails constructor
 *
 * @api private
 */

function Sails () {

	/**
	 * Keep track of spanwed child processes
	 */

	this.childProcesses = [];

	/**
	 * Expose utilities
	 *
	 * @api private
	 */

	this.util = util;

	/**
	 * Load the pieces of a Sails app
	 *
	 * @api private
	 */

	this.load = loadSails(this);

	/**
	 * Sails.prototype.initialize()
	 *
	 * Start the Sails server
	 * NOTE: sails.load() should be run first.
	 *
	 * @api private
	 */

	this.initialize = function (cb) {

		// Make callback optional
		cb = util.optional(cb);

		var sails = this;

		// Indicate that server is starting
		sails.log.verbose('Starting app at ' + sails.config.appPath + '...');

		// Optionally expose services, models, sails, _, async, etc. as globals
		exposeGlobals(sails)();

		// Add beforeShutdown event
		onTeardown(sails)();

		// Run the app bootstrap
		runBootstrap(sails)(function (err) {
			if (err) return cb(err);

			// And fire the `ready` event
			// This is listened to by attached servers, etc.
			sails.emit('ready');
			cb();
		});
	};

	/**
	 * Sails.prototype.lift()
	 *
	 * Loads the app, then starts all attached servers.
	 *
	 * @api public
	 */

	this.lift = function (configOverride, cb) {
		// Make callback optional
		cb = util.optional(cb);

		var sails = this;

		var load = this.load;

		async.series([

			function (cb) {
				load(configOverride, cb);

				// Provide an initial heartbeat to let user know that Sails is working
				// (only relevant on very slow systems) or in bootstrap functions with
				// very complex synchronous code
				util.defer(function maybeLoggerIsReady () {
					sails.log.verbose('Configuring app...');
				}, 1);
			},

			this.initialize

		], function sailsReady (err, results) {

			if (err) return cb(err);

			// Gather app meta-info
			var usingSSL = (
				(
					sails.config.serverOptions &&
					sails.config.serverOptions.key &&
					sails.config.serverOptions.cert
				) || (
					sails.config.express &&
					sails.config.express.serverOptions &&
					sails.config.express.serverOptions.key &&
					sails.config.express.serverOptions.cert
				)
			);
			var Env = sails.config.environment[0].toUpperCase() + sails.config.environment.slice(1);
			var localAppURL = ( usingSSL ? 'https' : 'http' ) + '://' + sails.config.host + ':' + sails.config.port + '';

			sails.log.ship();

			var log = sails.log;
			sails.log.info('Server lifted in `' + sails.config.appPath + '`');
			sails.log.info('To see your app, visit ' + localAppURL);
			sails.log.info('To shut down Sails, press <CTRL> + C at any time.');
			console.log();
            log('--------------------------------------------------------');
			log(':: ' + new Date());
			log();
			log('Environment\t: ' + sails.config.environment);
			if (sails.explicitHost) {
				log('Host\t\t: ' + sails.explicitHost);
			}
			log('Port\t\t: ' + sails.config.port);
            log('--------------------------------------------------------');
			return cb(err, sails);
		});
	};

	/**
	 * Sails.prototype.lower()
	 *
	 * The inverse of `initialize()`, this method
	 * shuts down all attached servers.
	 *
	 * It also unbinds listeners and terminates child processes.
	 *
	 * @api public
	 */

	this.lower = function (cb) {
		var sails = this;

		sails.log('Lowering sails...');
		cb = util.optional(cb);
		sails._exiting = true;

		// Wait until beforeShutdown logic runs
		var beforeShutdown =
				util.isFunction(sails.config.beforeShutdown) ?
				sails.config.beforeShutdown :
				function (cb) { cb(); };

		beforeShutdown(function (err) {
			if (err) sails.log.error(err);

			// Kill all child processes
			util.each(sails.childProcesses, function kill (childProcess) {
				sails.log.verbose('Sent kill signal to grunt child process...');
				childProcess.kill('SIGHUP');
			});

			// Shut down HTTP server
			// TODO: defer this to the http and sockets hooks-- use sails.emit('lowering')
			// Shut down Socket server
			// wait for all attached servers to stop
			var log = sails.log.verbose;
			async.series([
				function shutdownSockets(cb) {
					if (!sails.config.hooks.sockets) {
						return cb();
					}

					try {
						log('Shutting down socket server...');
						setTimeout(cb, 100);
						sails.io.server.unref();
						sails.io.server.close();
						sails.io.server.on('close', function () {
							log('Socket server shut down successfully.');
							cb();
						});
					}
					catch (e) { cb(); }
				},

				function shutdownHTTP(cb) {
					try {
						log('Shutting down HTTP server...');
						setTimeout(cb, 100);
						sails.express.server.unref();
						sails.express.server.close();
						sails.express.server.on('close', function () {
							log('HTTP server shut down successfully.');
							cb();
						});
					}
					catch (e) { cb(); }
				},

				function removeListeners(cb) {
					// removeAllListeners doesn't work correctly without arguments,
					// so we'll do it manually
					for (var key in sails._events) {
						sails.removeAllListeners(key);
					}
					cb();
				}
			], cb);

		});

	};

	/**
	 * Sails.prototype.build();
	 *
	 * Run the `grunt build` task
	 * TODO: this should probably be pulled into the CLI
	 *
	 * @api private
	 */

	this.build = function (taskName, cb) {

		// Default to 'build' task
		taskName = taskName || 'build';

		var log = this.log;
		log.info('Building assets into directory...');

		// Fire up grunt
		var grunt = Grunt(this);
		grunt(taskName, function (err) {
			if (err) return cb && cb(err);

			log.info('Successfully built \'www\' directory in the application root.');
			cb && cb();
		});
	};

	util.bindAll(this);
}

/**
 * Extend from EventEmitter to allow hooks to listen to stuff
 *
 * @api private
 */

Sails.prototype = new EventEmitter();
Sails.prototype.constructor = Sails;

// Remove memory-leak warning about max listeners
// See: http://nodejs.org/docs/latest/api/events.html#events_emitter_setmaxlisteners_n
Sails.prototype.setMaxListeners(0);


text:
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';

@Injectable({ providedIn: 'root' })
export class PreviewService {

    public content: Blob = null;
    public name: string = null;

    constructor(private router: Router) {}

    showResource(resourceId, versionId?): void {
        if (versionId) {
            this.router.navigate([{outlets: {overlay: ['files', resourceId, versionId, 'view']}}]);
        } else {
            this.router.navigate([{outlets: {overlay: ['files', resourceId, 'view']}}]);
        }
    }

    showBlob(name: string, content: Blob): void {
        this.name = name;
        this.content = content;
        this.router.navigate([{ outlets: { overlay: ['preview', 'blob'] } }]);
    }
}


text:
<!DOCTYPE HTML>

<title>io.ebean.event Class Hierarchy (ebean api 12.8.0 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2021-03-18">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

All Classes

SEARCH:
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">

JavaScript is disabled on your browser.

Hierarchy For Package io.ebean.event

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

io.ebean.event.AbstractBeanPersistListener (implements io.ebean.event.BeanPersistListener)

io.ebean.event.BeanPersistAdapter (implements io.ebean.event.BeanPersistController)

io.ebean.event.ServletContextListener (implements javax.servlet.ServletContextListener)

io.ebean.event.ShutdownManager

Interface Hierarchy

io.ebean.event.BeanDeleteIdRequest

io.ebean.event.BeanFindController

io.ebean.event.BeanPersistController

io.ebean.event.BeanPersistListener

io.ebean.event.BeanPersistRequest<T>

io.ebean.event.BeanPostConstructListener

io.ebean.event.BeanPostLoad

io.ebean.event.BeanQueryAdapter

io.ebean.event.BeanQueryRequest<T>

io.ebean.event.BulkTableEvent

io.ebean.event.BulkTableEventListener

io.ebean.event.ServerConfigStartup

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

All Classes

JavaScript is disabled on your browser.

Copyright © 2021. All rights reserved.


text:
using System;

namespace System.Data
{
    public sealed class StateChangeEventArgs : System.EventArgs
    {
        private ConnectionState _originalState;
        private ConnectionState _currentState;

        public StateChangeEventArgs(ConnectionState originalState, ConnectionState currentState)
        {
            _originalState = originalState;
            _currentState = currentState;
        }

        public ConnectionState CurrentState
        {
            get
            {
                return _currentState;
            }
        }

        public ConnectionState OriginalState
        {
            get
            {
                return _originalState;
            }
        }
    }
}