public String getAttrString() {
        return attrString;
    }

package org.opends.server.replication.plugin;

import static org.opends.server.replication.plugin.HistAttrModificationKey.*;
import static org.opends.server.util.StaticUtils.*;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.ModificationType;
import org.opends.server.core.DirectoryServer;
import org.opends.server.replication.common.CSN;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeBuilder;
import org.opends.server.types.AttributeDescription;
import org.opends.server.types.AttributeType;
import org.opends.server.types.Modification;

/**
 * This class stores an internal usable representation of the value of
 * the historical related to an entry.
 * It encodes/decodes from the String form stored in the DB attribute
 * from/to the internal usable form.
 *
 * an historical attribute value looks like :
 *  description:00000108b3a65541000000000001:add:added_value
 *  or
 *  description:00000108b3a6cbb8000000000001:del:deleted_value
 *  or
 *  description:00000108b3a6cbb8000000000001:repl:new_value
 *  or
 *  description:00000108b3a6cbb8000000000001:attrDel
 *  or
 *  description:00000108b3a65541000000000001:add
 *  or
 *  dn:00000108b3a65541000000000001:add (ADD operation)
 *  or
 *  dn:00000108b3a65541000000000001:moddn (MODIFYDN operation)
 *
 *  so after split
 *  token[0] will contain the attribute name
 *  token[1] will contain the CSN
 *  token[2] will contain the type of historical information
 *  token[3] will contain the attribute value
 *
 *  options are stored with the attribute names using; as a separator
 *  example :
 *  description;FR;France:00000108b3a65541000000000001:add:added_value
 */
class HistoricalAttributeValue {

    private final AttributeDescription attrDesc;

    /**
     * The lowercase attribute string representation.
     */
    private final String attrString;

    private final ByteString attributeValue;

    private final CSN csn;

    private final HistAttrModificationKey histKey;

    private final String stringValue;

    /**
     * This flag indicates that this value was generated to store the last date
     * when the entry was renamed.
     */
    private boolean isModDN;

    /**
     * Create a new object from the String encoded form.
     *
     * @param strVal The String encoded form of historical attribute value.
     * @see EntryHistorical#encodeAndPurge() encoding in EntryHistorical
     */
    HistoricalAttributeValue(String strVal) {
        String[] token = strVal.split(":", 4);
        Set<String> options;
        if (token[0].contains(";")) {
            options = new LinkedHashSet<>();
            String[] optionsToken = token[0].split(";");
            int index = 1;
            while (index < optionsToken.length) {
                options.add(optionsToken[index]);
                index++;
            }
            attrString = toLowerCase(optionsToken[0]);
        } else {
            options = Collections.emptySet();
            attrString = toLowerCase(token[0]);
        }
        AttributeType attrType;
        if (attrString.compareTo("dn") != 0) {
            // This HistVal was used to store the date when some
            // modifications were done to the entries.
            attrType = DirectoryServer.getAttributeTypeOrDefault(attrString);
        } else {
            // This HistVal is used to store the date when the entry
            // was added to the directory or when it was last renamed.
            attrType = null;
            if (token.length >= 3 && token[2].compareTo("moddn") == 0) {
                isModDN = true;
            }
        }
        this.attrDesc = attrType != null ? AttributeDescription.create(attrType, options) : null;
        csn = new CSN(token[1]);
        histKey = HistAttrModificationKey.decodeKey(token[2]);
        if (histKey != ATTRDEL) {
            if (token.length == 4) {
                stringValue = token[3];
                attributeValue = ByteString.valueOfUtf8(stringValue);
            } else {
                stringValue = null;
                attributeValue = null;
            }
        } else {
            stringValue = null;
            attributeValue = null;
        }
    }

    private AttributeType getAttributeType() {
        return attrDesc != null ? attrDesc.getAttributeType() : null;
    }

    private Set<String> getOptions() {
        return attrDesc != null ? attrDesc.getOptions() : Collections.<String>emptySet();
    }

    /**
     * Get the String form of the attribute type.
     *
     * @return Returns the String form of the attribute type.
     */

    /**
     * Get the attribute description of this HistVal.
     *
     * @return Returns the attribute description of this HistVal.
     *         Can return {@code null} if the HistVal was generated for a ADD Operation.
     */
    AttributeDescription getAttributeDescription() {
        return attrDesc;
    }

    /**
     * Get the CSN of this HistVal.
     * @return Returns the CSN of this HistVal.
     */
    public CSN getCSN() {
        return csn;
    }

    /**
     * Get the HistKey.
     * @return Returns the histKey.
     */
    public HistAttrModificationKey getHistKey() {
        return histKey;
    }

    /**
     * Get the Attribute Value.
     * @return The Attribute Value.
     */
    public ByteString getAttributeValue() {
        return attributeValue;
    }

    /**
     * Generate a Modification equivalent to this value of the historical
     * attribute.
     *
     * @return A modification equivalent to this value of the historical
     * attribute.
     */
    public Modification generateMod() {
        AttributeBuilder builder = new AttributeBuilder(getAttributeType(), attrString);
        builder.setOptions(getOptions());
        if (histKey != ATTRDEL) {
            builder.add(attributeValue);
        }
        Attribute attr = builder.toAttribute();
        switch(histKey) {
            case ADD:
                return new Modification(ModificationType.ADD, attr);
            case DEL:
            case ATTRDEL:
                return new Modification(ModificationType.DELETE, attr);
            case REPL:
                return new Modification(ModificationType.REPLACE, attr);
            default:
                return null;
        }
    }

    /**
     * Indicates if this value of the historical attribute was generated
     * for a ADD operation.
     *
     * @return a boolean indicating if this was generated for a ADD operation.
     */
    public boolean isADDOperation() {
        return getAttributeType() == null && !isModDN;
    }

    /**
     * Indicates if this value of the historical attribute was generated
     * for a MODDN operation.
     *
     * @return a boolean indicating if this was generated for a ADDMODDN operation.
     */
    public boolean isMODDNOperation() {
        return getAttributeType() == null && isModDN;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append(attrString);
        for (String option : getOptions()) {
            sb.append(";").append(option);
        }
        sb.append(":").append(csn).append(":").append(getModificationType());
        if (stringValue != null) {
            sb.append(":").append(stringValue);
        }
        return sb.toString();
    }

    private String getModificationType() {
        if (isModDN) {
            return "moddn";
        } else if (histKey != null) {
            return histKey.toString();
        }
        return "TODO";
    }
}


switch(histKey) {
            case ADD:
                return new Modification(ModificationType.ADD, attr);
            case DEL:
            case ATTRDEL:
                return new Modification(ModificationType.DELETE, attr);
            case REPL:
                return new Modification(ModificationType.REPLACE, attr);
            default:
                return null;
        }

package org.opends.server.replication.plugin;

import static org.opends.server.replication.plugin.HistAttrModificationKey.*;
import static org.opends.server.util.StaticUtils.*;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.ModificationType;
import org.opends.server.core.DirectoryServer;
import org.opends.server.replication.common.CSN;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeBuilder;
import org.opends.server.types.AttributeDescription;
import org.opends.server.types.AttributeType;
import org.opends.server.types.Modification;

/**
 * This class stores an internal usable representation of the value of
 * the historical related to an entry.
 * It encodes/decodes from the String form stored in the DB attribute
 * from/to the internal usable form.
 *
 * an historical attribute value looks like :
 *  description:00000108b3a65541000000000001:add:added_value
 *  or
 *  description:00000108b3a6cbb8000000000001:del:deleted_value
 *  or
 *  description:00000108b3a6cbb8000000000001:repl:new_value
 *  or
 *  description:00000108b3a6cbb8000000000001:attrDel
 *  or
 *  description:00000108b3a65541000000000001:add
 *  or
 *  dn:00000108b3a65541000000000001:add (ADD operation)
 *  or
 *  dn:00000108b3a65541000000000001:moddn (MODIFYDN operation)
 *
 *  so after split
 *  token[0] will contain the attribute name
 *  token[1] will contain the CSN
 *  token[2] will contain the type of historical information
 *  token[3] will contain the attribute value
 *
 *  options are stored with the attribute names using; as a separator
 *  example :
 *  description;FR;France:00000108b3a65541000000000001:add:added_value
 */
class HistoricalAttributeValue {

    private final AttributeDescription attrDesc;

    /**
     * The lowercase attribute string representation.
     */
    private final String attrString;

    private final ByteString attributeValue;

    private final CSN csn;

    private final HistAttrModificationKey histKey;

    private final String stringValue;

    /**
     * This flag indicates that this value was generated to store the last date
     * when the entry was renamed.
     */
    private boolean isModDN;

    /**
     * Create a new object from the String encoded form.
     *
     * @param strVal The String encoded form of historical attribute value.
     * @see EntryHistorical#encodeAndPurge() encoding in EntryHistorical
     */
    HistoricalAttributeValue(String strVal) {
        String[] token = strVal.split(":", 4);
        Set<String> options;
        if (token[0].contains(";")) {
            options = new LinkedHashSet<>();
            String[] optionsToken = token[0].split(";");
            int index = 1;
            while (index < optionsToken.length) {
                options.add(optionsToken[index]);
                index++;
            }
            attrString = toLowerCase(optionsToken[0]);
        } else {
            options = Collections.emptySet();
            attrString = toLowerCase(token[0]);
        }
        AttributeType attrType;
        if (attrString.compareTo("dn") != 0) {
            // This HistVal was used to store the date when some
            // modifications were done to the entries.
            attrType = DirectoryServer.getAttributeTypeOrDefault(attrString);
        } else {
            // This HistVal is used to store the date when the entry
            // was added to the directory or when it was last renamed.
            attrType = null;
            if (token.length >= 3 && token[2].compareTo("moddn") == 0) {
                isModDN = true;
            }
        }
        this.attrDesc = attrType != null ? AttributeDescription.create(attrType, options) : null;
        csn = new CSN(token[1]);
        histKey = HistAttrModificationKey.decodeKey(token[2]);
        if (histKey != ATTRDEL) {
            if (token.length == 4) {
                stringValue = token[3];
                attributeValue = ByteString.valueOfUtf8(stringValue);
            } else {
                stringValue = null;
                attributeValue = null;
            }
        } else {
            stringValue = null;
            attributeValue = null;
        }
    }

    private AttributeType getAttributeType() {
        return attrDesc != null ? attrDesc.getAttributeType() : null;
    }

    private Set<String> getOptions() {
        return attrDesc != null ? attrDesc.getOptions() : Collections.<String>emptySet();
    }

    /**
     * Get the String form of the attribute type.
     *
     * @return Returns the String form of the attribute type.
     */
    public String getAttrString() {
        return attrString;
    }

    /**
     * Get the attribute description of this HistVal.
     *
     * @return Returns the attribute description of this HistVal.
     *         Can return {@code null} if the HistVal was generated for a ADD Operation.
     */
    AttributeDescription getAttributeDescription() {
        return attrDesc;
    }

    /**
     * Get the CSN of this HistVal.
     * @return Returns the CSN of this HistVal.
     */
    public CSN getCSN() {
        return csn;
    }

    /**
     * Get the HistKey.
     * @return Returns the histKey.
     */
    public HistAttrModificationKey getHistKey() {
        return histKey;
    }

    /**
     * Get the Attribute Value.
     * @return The Attribute Value.
     */
    public ByteString getAttributeValue() {
        return attributeValue;
    }

    /**
     * Generate a Modification equivalent to this value of the historical
     * attribute.
     *
     * @return A modification equivalent to this value of the historical
     * attribute.
     */
    public Modification generateMod() {
        AttributeBuilder builder = new AttributeBuilder(getAttributeType(), attrString);
        builder.setOptions(getOptions());
        if (histKey != ATTRDEL) {
            builder.add(attributeValue);
        }
        Attribute attr = builder.toAttribute();

    }

    /**
     * Indicates if this value of the historical attribute was generated
     * for a ADD operation.
     *
     * @return a boolean indicating if this was generated for a ADD operation.
     */
    public boolean isADDOperation() {
        return getAttributeType() == null && !isModDN;
    }

    /**
     * Indicates if this value of the historical attribute was generated
     * for a MODDN operation.
     *
     * @return a boolean indicating if this was generated for a ADDMODDN operation.
     */
    public boolean isMODDNOperation() {
        return getAttributeType() == null && isModDN;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append(attrString);
        for (String option : getOptions()) {
            sb.append(";").append(option);
        }
        sb.append(":").append(csn).append(":").append(getModificationType());
        if (stringValue != null) {
            sb.append(":").append(stringValue);
        }
        return sb.toString();
    }

    private String getModificationType() {
        if (isModDN) {
            return "moddn";
        } else if (histKey != null) {
            return histKey.toString();
        }
        return "TODO";
    }
}


while (index < optionsToken.length) {
                options.add(optionsToken[index]);
                index++;
            }

package org.opends.server.replication.plugin;

import static org.opends.server.replication.plugin.HistAttrModificationKey.*;
import static org.opends.server.util.StaticUtils.*;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.ModificationType;
import org.opends.server.core.DirectoryServer;
import org.opends.server.replication.common.CSN;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeBuilder;
import org.opends.server.types.AttributeDescription;
import org.opends.server.types.AttributeType;
import org.opends.server.types.Modification;

/**
 * This class stores an internal usable representation of the value of
 * the historical related to an entry.
 * It encodes/decodes from the String form stored in the DB attribute
 * from/to the internal usable form.
 *
 * an historical attribute value looks like :
 *  description:00000108b3a65541000000000001:add:added_value
 *  or
 *  description:00000108b3a6cbb8000000000001:del:deleted_value
 *  or
 *  description:00000108b3a6cbb8000000000001:repl:new_value
 *  or
 *  description:00000108b3a6cbb8000000000001:attrDel
 *  or
 *  description:00000108b3a65541000000000001:add
 *  or
 *  dn:00000108b3a65541000000000001:add (ADD operation)
 *  or
 *  dn:00000108b3a65541000000000001:moddn (MODIFYDN operation)
 *
 *  so after split
 *  token[0] will contain the attribute name
 *  token[1] will contain the CSN
 *  token[2] will contain the type of historical information
 *  token[3] will contain the attribute value
 *
 *  options are stored with the attribute names using; as a separator
 *  example :
 *  description;FR;France:00000108b3a65541000000000001:add:added_value
 */
class HistoricalAttributeValue {

    private final AttributeDescription attrDesc;

    /**
     * The lowercase attribute string representation.
     */
    private final String attrString;

    private final ByteString attributeValue;

    private final CSN csn;

    private final HistAttrModificationKey histKey;

    private final String stringValue;

    /**
     * This flag indicates that this value was generated to store the last date
     * when the entry was renamed.
     */
    private boolean isModDN;

    /**
     * Create a new object from the String encoded form.
     *
     * @param strVal The String encoded form of historical attribute value.
     * @see EntryHistorical#encodeAndPurge() encoding in EntryHistorical
     */
    HistoricalAttributeValue(String strVal) {
        String[] token = strVal.split(":", 4);
        Set<String> options;
        if (token[0].contains(";")) {
            options = new LinkedHashSet<>();
            String[] optionsToken = token[0].split(";");
            int index = 1;

            attrString = toLowerCase(optionsToken[0]);
        } else {
            options = Collections.emptySet();
            attrString = toLowerCase(token[0]);
        }
        AttributeType attrType;
        if (attrString.compareTo("dn") != 0) {
            // This HistVal was used to store the date when some
            // modifications were done to the entries.
            attrType = DirectoryServer.getAttributeTypeOrDefault(attrString);
        } else {
            // This HistVal is used to store the date when the entry
            // was added to the directory or when it was last renamed.
            attrType = null;
            if (token.length >= 3 && token[2].compareTo("moddn") == 0) {
                isModDN = true;
            }
        }
        this.attrDesc = attrType != null ? AttributeDescription.create(attrType, options) : null;
        csn = new CSN(token[1]);
        histKey = HistAttrModificationKey.decodeKey(token[2]);
        if (histKey != ATTRDEL) {
            if (token.length == 4) {
                stringValue = token[3];
                attributeValue = ByteString.valueOfUtf8(stringValue);
            } else {
                stringValue = null;
                attributeValue = null;
            }
        } else {
            stringValue = null;
            attributeValue = null;
        }
    }

    private AttributeType getAttributeType() {
        return attrDesc != null ? attrDesc.getAttributeType() : null;
    }

    private Set<String> getOptions() {
        return attrDesc != null ? attrDesc.getOptions() : Collections.<String>emptySet();
    }

    /**
     * Get the String form of the attribute type.
     *
     * @return Returns the String form of the attribute type.
     */
    public String getAttrString() {
        return attrString;
    }

    /**
     * Get the attribute description of this HistVal.
     *
     * @return Returns the attribute description of this HistVal.
     *         Can return {@code null} if the HistVal was generated for a ADD Operation.
     */
    AttributeDescription getAttributeDescription() {
        return attrDesc;
    }

    /**
     * Get the CSN of this HistVal.
     * @return Returns the CSN of this HistVal.
     */
    public CSN getCSN() {
        return csn;
    }

    /**
     * Get the HistKey.
     * @return Returns the histKey.
     */
    public HistAttrModificationKey getHistKey() {
        return histKey;
    }

    /**
     * Get the Attribute Value.
     * @return The Attribute Value.
     */
    public ByteString getAttributeValue() {
        return attributeValue;
    }

    /**
     * Generate a Modification equivalent to this value of the historical
     * attribute.
     *
     * @return A modification equivalent to this value of the historical
     * attribute.
     */
    public Modification generateMod() {
        AttributeBuilder builder = new AttributeBuilder(getAttributeType(), attrString);
        builder.setOptions(getOptions());
        if (histKey != ATTRDEL) {
            builder.add(attributeValue);
        }
        Attribute attr = builder.toAttribute();
        switch(histKey) {
            case ADD:
                return new Modification(ModificationType.ADD, attr);
            case DEL:
            case ATTRDEL:
                return new Modification(ModificationType.DELETE, attr);
            case REPL:
                return new Modification(ModificationType.REPLACE, attr);
            default:
                return null;
        }
    }

    /**
     * Indicates if this value of the historical attribute was generated
     * for a ADD operation.
     *
     * @return a boolean indicating if this was generated for a ADD operation.
     */
    public boolean isADDOperation() {
        return getAttributeType() == null && !isModDN;
    }

    /**
     * Indicates if this value of the historical attribute was generated
     * for a MODDN operation.
     *
     * @return a boolean indicating if this was generated for a ADDMODDN operation.
     */
    public boolean isMODDNOperation() {
        return getAttributeType() == null && isModDN;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append(attrString);
        for (String option : getOptions()) {
            sb.append(";").append(option);
        }
        sb.append(":").append(csn).append(":").append(getModificationType());
        if (stringValue != null) {
            sb.append(":").append(stringValue);
        }
        return sb.toString();
    }

    private String getModificationType() {
        if (isModDN) {
            return "moddn";
        } else if (histKey != null) {
            return histKey.toString();
        }
        return "TODO";
    }
}


@Override
    public boolean equals(Object o)

package com.complone.base.table;

import com.complone.base.include.Slice;
import java.util.Map;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Objects.requireNonNull;

public class BlockEntry implements Map.Entry<Slice, Slice> {

    private final Slice key;

    private final Slice value;

    public BlockEntry(Slice key, Slice value) {
        requireNonNull(key, "key is null");
        requireNonNull(value, "value is null");
        this.key = key;
        this.value = value;
    }

    @Override
    public Slice getKey() {
        return key;
    }

    @Override
    public Slice getValue() {
        return value;
    }

    /**
     * @throws UnsupportedOperationException always
     */
    @Override
    public final Slice setValue(Slice value) {
        throw new UnsupportedOperationException();
    }

{
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        BlockEntry entry = (BlockEntry) o;
        if (!key.equals(entry.key)) {
            return false;
        }
        if (!value.equals(entry.value)) {
            return false;
        }
        return true;
    }

    /**
     * 压缩前缀提取 每个数据块的前缀有一定几率会重叠
     * //为了避免前缀重合
     * restart_中每个元素都是
     * 一个数字，为了查找方便，
     * finish直接按每个元素32bit进行存储。
     * http://example.com
     * @return
     */
    @Override
    public int hashCode() {
        int result = key.hashCode();
        result = 31 * result + value.hashCode();
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("BlockEntry");
        // todo don't print the real value
        sb.append("{key=").append(key.toString(UTF_8));
        sb.append(", value=").append(value.toString(UTF_8));
        sb.append('}');
        return sb.toString();
    }
}


{
        throw new UnsupportedOperationException();
    }

package com.complone.base.table;

import com.complone.base.include.Slice;
import java.util.Map;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Objects.requireNonNull;

public class BlockEntry implements Map.Entry<Slice, Slice> {

    private final Slice key;

    private final Slice value;

    public BlockEntry(Slice key, Slice value) {
        requireNonNull(key, "key is null");
        requireNonNull(value, "value is null");
        this.key = key;
        this.value = value;
    }

    @Override
    public Slice getKey() {
        return key;
    }

    @Override
    public Slice getValue() {
        return value;
    }

    /**
     * @throws UnsupportedOperationException always
     */
    @Override
    public final Slice setValue(Slice value)

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        BlockEntry entry = (BlockEntry) o;
        if (!key.equals(entry.key)) {
            return false;
        }
        if (!value.equals(entry.value)) {
            return false;
        }
        return true;
    }

    /**
     * 压缩前缀提取 每个数据块的前缀有一定几率会重叠
     * //为了避免前缀重合
     * restart_中每个元素都是
     * 一个数字，为了查找方便，
     * finish直接按每个元素32bit进行存储。
     * http://example.com
     * @return
     */
    @Override
    public int hashCode() {
        int result = key.hashCode();
        result = 31 * result + value.hashCode();
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("BlockEntry");
        // todo don't print the real value
        sb.append("{key=").append(key.toString(UTF_8));
        sb.append(", value=").append(value.toString(UTF_8));
        sb.append('}');
        return sb.toString();
    }
}


package com.complone.base.table;

import com.complone.base.include.Slice;
import java.util.Map;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Objects.requireNonNull;

public class BlockEntry implements Map.Entry<Slice, Slice> {

    private final Slice key;

    private final Slice value;

    public BlockEntry(Slice key, Slice value) {
        requireNonNull(key, "key is null");
        requireNonNull(value, "value is null");
        this.key = key;
        this.value = value;
    }

    @Override
    public Slice getKey() {
        return key;
    }

    @Override
    public Slice getValue() {
        return value;
    }

    /**
     * @throws UnsupportedOperationException always
     */
    @Override
    public final Slice setValue(Slice value) {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        BlockEntry entry = (BlockEntry) o;
        if (!key.equals(entry.key)) {
            return false;
        }
        if (!value.equals(entry.value)) {
            return false;
        }
        return true;
    }

    /**
     * 压缩前缀提取 每个数据块的前缀有一定几率会重叠
     * //为了避免前缀重合
     * restart_中每个元素都是
     * 一个数字，为了查找方便，
     * finish直接按每个元素32bit进行存储。
     * http://example.com
     * @return
     */
    @Override
    public int hashCode() {
        int result = key.hashCode();
        result = 31 * result + value.hashCode();
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("BlockEntry");
        // todo don't print the real value
        sb.append("{key=").append(key.toString(UTF_8));
        sb.append(", value=").append(value.toString

        sb.append('}');
        return sb.toString();
    }
}


@Override
    public int hashCode() {
        int result = key.hashCode();
        result = 31 * result + value.hashCode();
        return result;
    }

package com.complone.base.table;

import com.complone.base.include.Slice;
import java.util.Map;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Objects.requireNonNull;

public class BlockEntry implements Map.Entry<Slice, Slice> {

    private final Slice key;

    private final Slice value;

    public BlockEntry(Slice key, Slice value) {
        requireNonNull(key, "key is null");
        requireNonNull(value, "value is null");
        this.key = key;
        this.value = value;
    }

    @Override
    public Slice getKey() {
        return key;
    }

    @Override
    public Slice getValue() {
        return value;
    }

    /**
     * @throws UnsupportedOperationException always
     */
    @Override
    public final Slice setValue(Slice value) {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        BlockEntry entry = (BlockEntry) o;
        if (!key.equals(entry.key)) {
            return false;
        }
        if (!value.equals(entry.value)) {
            return false;
        }
        return true;
    }

    /**
     * 压缩前缀提取 每个数据块的前缀有一定几率会重叠
     * //为了避免前缀重合
     * restart_中每个元素都是
     * 一个数字，为了查找方便，
     * finish直接按每个元素32bit进行存储。
     * http://example.com
     * @return
     */

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("BlockEntry");
        // todo don't print the real value
        sb.append("{key=").append(key.toString(UTF_8));
        sb.append(", value=").append(value.toString(UTF_8));
        sb.append('}');
        return sb.toString();
    }
}


package com.ys.yoosir.zzshow.mvp.ui.fragments.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.ys.yoosir.zzshow.MyApplication;
import com.ys.yoosir.zzshow.R;
import com.ys.yoosir.zzshow.di.component.AppComponent;
import com.ys.yoosir.zzshow.mvp.presenter.interfaces.BasePresenter;
import javax.inject.Inject;
import butterknife.ButterKnife;
import rx.Subscription;

/**
 * Created by Yoosir on 2016/10/19 0019.
 */
public abstract class BaseFragment<T extends BasePresenter> extends Fragment {

    private final static String TAG = "BaseFragment";

    protected MyApplication mApplication;

    @Inject
    protected T mPresenter;

    protected View mFragmentView;

    protected Subscription mSubscription;

    // 提供AppComponent(提供所有的单例对象)给子类，进行Component依赖
    protected abstract void setupFragmentComponent(AppComponent appComponent);

    protected abstract int getLayoutId();

    protected abstract void initViews(View view);

    protected abstract void initData();

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        Log.d(TAG, "onActivityCreated");
        mApplication = (MyApplication) getActivity().getApplication();
        setupFragmentComponent(mApplication.getAppComponent());
        initData();
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG, "onCreate");
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        Log.d(TAG, "onCreateView");
        if (mFragmentView == null) {
            mFragmentView = inflater.inflate(getLayoutId(), container, false);
            ButterKnife.bind(this, mFragmentView);
            initViews(mFragmentView);
        }
        return mFragmentView;
    }

{
        super.onDestroy();
        if (mPresenter != null) {
            mPresenter.onDestroy();
            mPresenter = null;
        }
        if (mSubscription != null && !mSubscription.isUnsubscribed()) {
            mSubscription.unsubscribe();
            mSubscription = null;
        }
        this.mFragmentView = null;
    }
}


{
        Log.d(TAG, "onCreateView");
        if (mFragmentView == null) {
            mFragmentView = inflater.inflate(getLayoutId(), container, false);
            ButterKnife.bind(this, mFragmentView);
            initViews(mFragmentView);
        }
        return mFragmentView;
    }

package com.ys.yoosir.zzshow.mvp.ui.fragments.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.ys.yoosir.zzshow.MyApplication;
import com.ys.yoosir.zzshow.R;
import com.ys.yoosir.zzshow.di.component.AppComponent;
import com.ys.yoosir.zzshow.mvp.presenter.interfaces.BasePresenter;
import javax.inject.Inject;
import butterknife.ButterKnife;
import rx.Subscription;

/**
 * Created by Yoosir on 2016/10/19 0019.
 */
public abstract class BaseFragment<T extends BasePresenter> extends Fragment {

    private final static String TAG = "BaseFragment";

    protected MyApplication mApplication;

    @Inject
    protected T mPresenter;

    protected View mFragmentView;

    protected Subscription mSubscription;

    // 提供AppComponent(提供所有的单例对象)给子类，进行Component依赖
    protected abstract void setupFragmentComponent(AppComponent appComponent);

    protected abstract int getLayoutId();

    protected abstract void initViews(View view);

    protected abstract void initData();

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        Log.d(TAG, "onActivityCreated");
        mApplication = (MyApplication) getActivity().getApplication();
        setupFragmentComponent(mApplication.getAppComponent());
        initData();
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG, "onCreate");
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (mPresenter != null) {
            mPresenter.onDestroy();
            mPresenter = null;
        }
        if (mSubscription != null && !mSubscription.isUnsubscribed()) {
            mSubscription.unsubscribe();
            mSubscription = null;
        }
        this.mFragmentView = null;
    }
}


package com.ys.yoosir.zzshow.mvp.ui.fragments.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.ys.yoosir.zzshow.MyApplication;
import com.ys.yoosir.zzshow.R;
import com.ys.yoosir.zzshow.di.component.AppComponent;
import com.ys.yoosir.zzshow.mvp.presenter.interfaces.BasePresenter;
import javax.inject.Inject;
import butterknife.ButterKnife;
import rx.Subscription;

/**
 * Created by Yoosir on 2016/10/19 0019.
 */
public abstract class BaseFragment<T extends BasePresenter> extends Fragment {

    private final static String TAG = "BaseFragment";

    protected MyApplication mApplication;

    @Inject
    protected T mPresenter;

    protected View mFragmentView;

    protected Subscription mSubscription;

    // 提供AppComponent(提供所有的单例对象)给子类，进行Component依赖
    protected abstract void setupFragmentComponent(AppComponent appComponent);

    protected abstract int getLayoutId();

    protected abstract void initViews(View view);

    protected abstract void initData();

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        Log.d(TAG, "onActivityCreated");
        mApplication = (MyApplication) getActivity().getApplication();
        setupFragmentComponent(mApplication.getAppComponent());
        initData();
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG, "onCreate");
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        Log.d(TAG, "onC

        if (mFragmentView == null) {
            mFragmentView = inflater.inflate(getLayoutId(), container, false);
            ButterKnife.bind(this, mFragmentView);
            initViews(mFragmentView);
        }
        return mFragmentView;
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (mPresenter != null) {
            mPresenter.onDestroy();
            mPresenter = null;
        }
        if (mSubscription != null && !mSubscription.isUnsubscribed()) {
            mSubscription.unsubscribe();
            mSubscription = null;
        }
        this.mFragmentView = null;
    }
}


public void dfs(char[][] board, int x, int y)

package io.github.wkk.everyday.aug;

/**
 * @author example@nnthink.com
 * @since 2020/8/20上午8:35
 */
public class Minesweeper {

    int[] dirX = { 0, 1, 0, -1, 1, 1, -1, -1 };

    int[] dirY = { 1, 0, -1, 0, 1, -1, 1, -1 };

    public char[][] updateBoard(char[][] board, int[] click) {
        int x = click[0], y = click[1];
        if (board[x][y] == 'M') {
            board[x][y] = 'X';
        } else {
            dfs(board, x, y);
        }
        return board;
    }

{
        int cnt = 0;
        for (int i = 0; i < 8; ++i) {
            int tx = x + dirX[i];
            int ty = y + dirY[i];
            if (tx < 0 || tx >= board.length || ty < 0 || ty >= board[0].length) {
                continue;
            }
            // 不用判断 M，因为如果有 M 的话游戏已经结束了
            if (board[tx][ty] == 'M') {
                ++cnt;
            }
        }
        if (cnt > 0) {
            board[x][y] = (char) (cnt + '0');
        } else {
            board[x][y] = 'B';
            for (int i = 0; i < 8; ++i) {
                int tx = x + dirX[i];
                int ty = y + dirY[i];
                // 这里不需要在存在 B 的时候继续扩展，因为 B 之前被点击的时候已经被扩展过了
                if (tx < 0 || tx >= board.length || ty < 0 || ty >= board[0].length || board[tx][ty] != 'E') {
                    continue;
                }
                dfs(board, tx, ty);
            }
        }
    }
}


{
        int x = click[0], y = click[1];
        if (board[x][y] == 'M') {
            board[x][y] = 'X';
        } else {
            dfs(board, x, y);
        }
        return board;
    }

package io.github.wkk.everyday.aug;

/**
 * @author example@nnthink.com
 * @since 2020/8/20上午8:35
 */
public class Minesweeper {

    int[] dirX = { 0, 1, 0, -1, 1, 1, -1, -1 };

    int[] dirY = { 1, 0, -1, 0, 1, -1, 1, -1 };

    public char[][] updateBoard(char[][] board, int[] click)

    public void dfs(char[][] board, int x, int y) {
        int cnt = 0;
        for (int i = 0; i < 8; ++i) {
            int tx = x + dirX[i];
            int ty = y + dirY[i];
            if (tx < 0 || tx >= board.length || ty < 0 || ty >= board[0].length) {
                continue;
            }
            // 不用判断 M，因为如果有 M 的话游戏已经结束了
            if (board[tx][ty] == 'M') {
                ++cnt;
            }
        }
        if (cnt > 0) {
            board[x][y] = (char) (cnt + '0');
        } else {
            board[x][y] = 'B';
            for (int i = 0; i < 8; ++i) {
                int tx = x + dirX[i];
                int ty = y + dirY[i];
                // 这里不需要在存在 B 的时候继续扩展，因为 B 之前被点击的时候已经被扩展过了
                if (tx < 0 || tx >= board.length || ty < 0 || ty >= board[0].length || board[tx][ty] != 'E') {
                    continue;
                }
                dfs(board, tx, ty);
            }
        }
    }
}


package io.github.wkk.everyday.aug;

/**
 * @author example@nnthink.com
 * @since 2020/8/20上午8:35
 */
public class Minesweeper {

    int[] dirX = { 0, 1, 0, -1, 1, 1, -1, -1 };

    int[] dirY = { 1, 0, -1, 0, 1, -1, 1, -1 };

    public char[][] updateBoard(char[][] board, int[] click) {
        int x = click[0], y = click[1];
        if (board[x][y] == 'M') {
            board[x][y] = 'X';
        } else {
            dfs(board, x, y);
        }
        return boar

    }

    public void dfs(char[][] board, int x, int y) {
        int cnt = 0;
        for (int i = 0; i < 8; ++i) {
            int tx = x + dirX[i];
            int ty = y + dirY[i];
            if (tx < 0 || tx >= board.length || ty < 0 || ty >= board[0].length) {
                continue;
            }
            // 不用判断 M，因为如果有 M 的话游戏已经结束了
            if (board[tx][ty] == 'M') {
                ++cnt;
            }
        }
        if (cnt > 0) {
            board[x][y] = (char) (cnt + '0');
        } else {
            board[x][y] = 'B';
            for (int i = 0; i < 8; ++i) {
                int tx = x + dirX[i];
                int ty = y + dirY[i];
                // 这里不需要在存在 B 的时候继续扩展，因为 B 之前被点击的时候已经被扩展过了
                if (tx < 0 || tx >= board.length || ty < 0 || ty >= board[0].length || board[tx][ty] != 'E') {
                    continue;
                }
                dfs(board, tx, ty);
            }
        }
    }
}


for (int i = 0; i < 8; ++i) {
                int tx = x + dirX[i];
                int ty = y + dirY[i];
                // 这里不需要在存在 B 的时候继续扩展，因为 B 之前被点击的时候已经被扩展过了
                if (tx < 0 || tx >= board.length || ty < 0 || ty >= board[0].length || board[tx][ty] != 'E') {
                    continue;
                }
                dfs(board, tx, ty);
            }

package io.github.wkk.everyday.aug;

/**
 * @author example@nnthink.com
 * @since 2020/8/20上午8:35
 */
public class Minesweeper {

    int[] dirX = { 0, 1, 0, -1, 1, 1, -1, -1 };

    int[] dirY = { 1, 0, -1, 0, 1, -1, 1, -1 };

    public char[][] updateBoard(char[][] board, int[] click) {
        int x = click[0], y = click[1];
        if (board[x][y] == 'M') {
            board[x][y] = 'X';
        } else {
            dfs(board, x, y);
        }
        return board;
    }

    public void dfs(char[][] board, int x, int y) {
        int cnt = 0;
        for (int i = 0; i < 8; ++i) {
            int tx = x + dirX[i];
            int ty = y + dirY[i];
            if (tx < 0 || tx >= board.length || ty < 0 || ty >= board[0].length) {
                continue;
            }
            // 不用判断 M，因为如果有 M 的话游戏已经结束了
            if (board[tx][ty] == 'M') {
                ++cnt;
            }
        }
        if (cnt > 0) {
            board[x][y] = (char) (cnt + '0');
        } else {
            board[x][y] = 'B';


@Override
    protected Class<? extends StagemonitorByteBuddyTransformer> getAdviceClass()

package org.stagemonitor.tracing;

import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.annotation.AnnotationDescription;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.method.ParameterDescription;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.implementation.bytecode.assign.Assigner;
import net.bytebuddy.implementation.bytecode.constant.NullConstant;
import org.stagemonitor.core.Stagemonitor;
import org.stagemonitor.core.instrument.StagemonitorByteBuddyTransformer;
import org.stagemonitor.tracing.metrics.MetricsSpanEventListener;
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import io.opentracing.Span;

public class AbstractTracingTransformer extends StagemonitorByteBuddyTransformer {

{
        return AbstractTracingTransformer.class;
    }

    @Advice.OnMethodEnter(inline = false)
    public static void monitorStart(@ParameterNames String parameterNames, @Advice.AllArguments Object[] args, @RequestName String requestName, @Advice.Origin("#t") String className, @Advice.Origin("#m") String methodName, @Advice.This(optional = true) Object thiz) {
        final String[] paramNames = parameterNames.split(",");
        Map<String, Object> params = new LinkedHashMap<String, Object>();
        for (int i = 0; i < args.length; i++) {
            params.put(paramNames[i], args[i]);
        }
        final MonitoredMethodRequest monitoredRequest = new MonitoredMethodRequest(Stagemonitor.getConfiguration(), requestName, null, params);
        final TracingPlugin tracingPlugin = Stagemonitor.getPlugin(TracingPlugin.class);
        tracingPlugin.getRequestMonitor().monitorStart(monitoredRequest);
        final Span span = TracingPlugin.getCurrentSpan();
        if (requestName == null) {
            span.setOperationName(getBusinessTransationName(thiz != null ? thiz.getClass().getName() : className, methodName));
        }
        span.setTag(MetricsSpanEventListener.ENABLE_TRACKING_METRICS_TAG, true);
    }

    @Advice.OnMethodExit(onThrowable = Throwable.class, inline = false)
    public static void monitorStop(@Advice.Thrown Throwable exception) {
        final RequestMonitor requestMonitor = Stagemonitor.getPlugin(TracingPlugin.class).getRequestMonitor();
        if (exception != null && exception instanceof Exception) {
            requestMonitor.recordException((Exception) exception);
        }
        requestMonitor.monitorStop();
    }

    @Override
    protected int getOrder() {
        return Integer.MIN_VALUE;
    }

    @Override
    protected List<Advice.OffsetMapping.Factory<? extends Annotation>> getOffsetMappingFactories() {
        final Advice.OffsetMapping.Factory<? extends Annotation> requestNameDynamicValue = new RequestNameDynamicValue();
        return Arrays.asList(requestNameDynamicValue, new ParameterNamesDynamicValue());
    }

    @Retention(RetentionPolicy.RUNTIME)
    @Target(ElementType.PARAMETER)
    public @interface RequestName {
    }

    public static class RequestNameDynamicValue implements Advice.OffsetMapping.Factory<RequestName> {

        @Override
        public Class<RequestName> getAnnotationType() {
            return RequestName.class;
        }

        @Override
        public Advice.OffsetMapping make(ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<RequestName> annotation, AdviceType adviceType) {
            return new Advice.OffsetMapping() {

                @Override
                public Target resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Advice.ArgumentHandler argumentHandler, Sort sort) {
                    final String requestName = getRequestName(instrumentedMethod);
                    if (requestName != null) {
                        return Target.ForStackManipulation.of(requestName);
                    } else {
                        return new Target.ForStackManipulation(NullConstant.INSTANCE);
                    }
                }
            };
        }
    }

    public static String getRequestName(MethodDescription instrumentedMethod) {
        final AnnotationDescription.Loadable<Traced> monitorRequestsLoadable = instrumentedMethod.getDeclaredAnnotations().ofType(Traced.class);
        if (monitorRequestsLoadable != null) {
            final Traced traced = monitorRequestsLoadable.loadSilent();
            if (!traced.requestName().isEmpty()) {
                return traced.requestName();
            }
            if (traced.resolveNameAtRuntime()) {
                return null;
            }
        }
        return getBusinessTransationName(instrumentedMethod.getDeclaringType().getTypeName(), instrumentedMethod.getName());
    }

    private static String getBusinessTransationName(String className, String methodName) {
        return configuration.getConfig(TracingPlugin.class).getBusinessTransactionNamingStrategy().getBusinessTransactionName(className, methodName);
    }

    @Retention(RetentionPolicy.RUNTIME)
    @Target(ElementType.PARAMETER)
    public @interface ParameterNames {
    }

    public static class ParameterNamesDynamicValue implements Advice.OffsetMapping.Factory<ParameterNames> {

        @Override
        public Class<ParameterNames> getAnnotationType() {
            return ParameterNames.class;
        }

        @Override
        public Advice.OffsetMapping make(ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<ParameterNames> annotation, AdviceType adviceType) {
            return new Advice.OffsetMapping() {

                @Override
                public Target resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Advice.ArgumentHandler argumentHandler, Sort sort) {
                    final StringBuilder params = new StringBuilder();
                    for (ParameterDescription param : instrumentedMethod.getParameters()) {
                        params.append(param.getName()).append(',');
                    }
                    return Advice.OffsetMapping.Target.ForStackManipulation.of(params.toString());
                }
            };
        }
    }
}


{
        return AbstractTracingTransformer.class;
    }

package org.stagemonitor.tracing;

import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.annotation.AnnotationDescription;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.method.ParameterDescription;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.implementation.bytecode.assign.Assigner;
import net.bytebuddy.implementation.bytecode.constant.NullConstant;
import org.stagemonitor.core.Stagemonitor;
import org.stagemonitor.core.instrument.StagemonitorByteBuddyTransformer;
import org.stagemonitor.tracing.metrics.MetricsSpanEventListener;
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import io.opentracing.Span;

public class AbstractTracingTransformer extends StagemonitorByteBuddyTransformer {

    @Override
    protected Class<? extends StagemonitorByteBuddyTransformer> getAdviceClass()

    @Advice.OnMethodEnter(inline = false)
    public static void monitorStart(@ParameterNames String parameterNames, @Advice.AllArguments Object[] args, @RequestName String requestName, @Advice.Origin("#t") String className, @Advice.Origin("#m") String methodName, @Advice.This(optional = true) Object thiz) {
        final String[] paramNames = parameterNames.split(",");
        Map<String, Object> params = new LinkedHashMap<String, Object>();
        for (int i = 0; i < args.length; i++) {
            params.put(paramNames[i], args[i]);
        }
        final MonitoredMethodRequest monitoredRequest = new MonitoredMethodRequest(Stagemonitor.getConfiguration(), requestName, null, params);
        final TracingPlugin tracingPlugin = Stagemonitor.getPlugin(TracingPlugin.class);
        tracingPlugin.getRequestMonitor().monitorStart(monitoredRequest);
        final Span span = TracingPlugin.getCurrentSpan();
        if (requestName == null) {
            span.setOperationName(getBusinessTransationName(thiz != null ? thiz.getClass().getName() : className, methodName));
        }
        span.setTag(MetricsSpanEventListener.ENABLE_TRACKING_METRICS_TAG, true);
    }

    @Advice.OnMethodExit(onThrowable = Throwable.class, inline = false)
    public static void monitorStop(@Advice.Thrown Throwable exception) {
        final RequestMonitor requestMonitor = Stagemonitor.getPlugin(TracingPlugin.class).getRequestMonitor();
        if (exception != null && exception instanceof Exception) {
            requestMonitor.recordException((Exception) exception);
        }
        requestMonitor.monitorStop();
    }

    @Override
    protected int getOrder() {
        return Integer.MIN_VALUE;
    }

    @Override
    protected List<Advice.OffsetMapping.Factory<? extends Annotation>> getOffsetMappingFactories() {
        final Advice.OffsetMapping.Factory<? extends Annotation> requestNameDynamicValue = new RequestNameDynamicValue();
        return Arrays.asList(requestNameDynamicValue, new ParameterNamesDynamicValue());
    }

    @Retention(RetentionPolicy.RUNTIME)
    @Target(ElementType.PARAMETER)
    public @interface RequestName {
    }

    public static class RequestNameDynamicValue implements Advice.OffsetMapping.Factory<RequestName> {

        @Override
        public Class<RequestName> getAnnotationType() {
            return RequestName.class;
        }

        @Override
        public Advice.OffsetMapping make(ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<RequestName> annotation, AdviceType adviceType) {
            return new Advice.OffsetMapping() {

                @Override
                public Target resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Advice.ArgumentHandler argumentHandler, Sort sort) {
                    final String requestName = getRequestName(instrumentedMethod);
                    if (requestName != null) {
                        return Target.ForStackManipulation.of(requestName);
                    } else {
                        return new Target.ForStackManipulation(NullConstant.INSTANCE);
                    }
                }
            };
        }
    }

    public static String getRequestName(MethodDescription instrumentedMethod) {
        final AnnotationDescription.Loadable<Traced> monitorRequestsLoadable = instrumentedMethod.getDeclaredAnnotations().ofType(Traced.class);
        if (monitorRequestsLoadable != null) {
            final Traced traced = monitorRequestsLoadable.loadSilent();
            if (!traced.requestName().isEmpty()) {
                return traced.requestName();
            }
            if (traced.resolveNameAtRuntime()) {
                return null;
            }
        }
        return getBusinessTransationName(instrumentedMethod.getDeclaringType().getTypeName(), instrumentedMethod.getName());
    }

    private static String getBusinessTransationName(String className, String methodName) {
        return configuration.getConfig(TracingPlugin.class).getBusinessTransactionNamingStrategy().getBusinessTransactionName(className, methodName);
    }

    @Retention(RetentionPolicy.RUNTIME)
    @Target(ElementType.PARAMETER)
    public @interface ParameterNames {
    }

    public static class ParameterNamesDynamicValue implements Advice.OffsetMapping.Factory<ParameterNames> {

        @Override
        public Class<ParameterNames> getAnnotationType() {
            return ParameterNames.class;
        }

        @Override
        public Advice.OffsetMapping make(ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<ParameterNames> annotation, AdviceType adviceType) {
            return new Advice.OffsetMapping() {

                @Override
                public Target resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Advice.ArgumentHandler argumentHandler, Sort sort) {
                    final StringBuilder params = new StringBuilder();
                    for (ParameterDescription param : instrumentedMethod.getParameters()) {
                        params.append(param.getName()).append(',');
                    }
                    return Advice.OffsetMapping.Target.ForStackManipulation.of(params.toString());
                }
            };
        }
    }
}


package org.stagemonitor.tracing;

import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.annotation.AnnotationDescription;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.method.ParameterDescription;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.implementation.bytecode.assign.Assigner;
import net.bytebuddy.implementation.bytecode.constant.NullConstant;
import org.stagemonitor.core.Stagemonitor;
import org.stagemonitor.core.instrument.StagemonitorByteBuddyTransformer;
import org.stagemonitor.tracing.metrics.MetricsSpanEventListener;
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import io.opentracing.Span;

public class AbstractTracingTransformer extends StagemonitorByteBuddyTransformer {

    @Override
    protected Class<? extends StagemonitorByteBuddyTransformer> getAdviceClass() {
        return AbstractTracingTransformer.class;
    }

    @Advice.OnMethodEnter(inline = false)
    public static void monitorStart(@ParameterNames String parameterNames, @Advice.AllArguments Object[] args, @RequestName String requestName, @Advice.Origin("#t") String className, @Advice.Origin("#m") String methodName, @Advice.This(optional = true) Object thiz) {
        final String[] paramNames = parameterNames.split(",");
        Map<String, Object> params = new LinkedHashMap<String, O

        for (int i = 0; i < args.length; i++) {
            params.put(paramNames[i], args[i]);
        }
        final MonitoredMethodRequest monitoredRequest = new MonitoredMethodRequest(Stagemonitor.getConfiguration(), requestName, null, params);
        final TracingPlugin tracingPlugin = Stagemonitor.getPlugin(TracingPlugin.class);
        tracingPlugin.getRequestMonitor().monitorStart(monitoredRequest);
        final Span span = TracingPlugin.getCurrentSpan();
        if (requestName == null) {
            span.setOperationName(getBusinessTransationName(thiz != null ? thiz.getClass().getName() : className, methodName));
        }
        span.setTag(MetricsSpanEventListener.ENABLE_TRACKING_METRICS_TAG, true);
    }

    @Advice.OnMethodExit(onThrowable = Throwable.class, inline = false)
    public static void monitorStop(@Advice.Thrown Throwable exception) {
        final RequestMonitor requestMonitor = Stagemonitor.getPlugin(TracingPlugin.class).getRequestMonitor();
        if (exception != null && exception instanceof Exception) {
            requestMonitor.recordException((Exception) exception);
        }
        requestMonitor.monitorStop();
    }

    @Override
    protected int getOrder() {
        return Integer.MIN_VALUE;
    }

    @Override
    protected List<Advice.OffsetMapping.Factory<? extends Annotation>> getOffsetMappingFactories() {
        final Advice.OffsetMapping.Factory<? extends Annotation> requestNameDynamicValue = new RequestNameDynamicValue();
        return Arrays.asList(requestNameDynamicValue, new ParameterNamesDynamicValue());
    }

    @Retention(RetentionPolicy.RUNTIME)
    @Target(ElementType.PARAMETER)
    public @interface RequestName {
    }

    public static class RequestNameDynamicValue implements Advice.OffsetMapping.Factory<RequestName> {

        @Override
        public Class<RequestName> getAnnotationType() {
            return RequestName.class;
        }

        @Override
        public Advice.OffsetMapping make(ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<RequestName> annotation, AdviceType adviceType) {
            return new Advice.OffsetMapping() {

                @Override
                public Target resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Advice.ArgumentHandler argumentHandler, Sort sort) {
                    final String requestName = getRequestName(instrumentedMethod);
                    if (requestName != null) {
                        return Target.ForStackManipulation.of(requestName);
                    } else {
                        return new Target.ForStackManipulation(NullConstant.INSTANCE);
                    }
                }
            };
        }
    }

    public static String getRequestName(MethodDescription instrumentedMethod) {
        final AnnotationDescription.Loadable<Traced> monitorRequestsLoadable = instrumentedMethod.getDeclaredAnnotations().ofType(Traced.class);
        if (monitorRequestsLoadable != null) {
            final Traced traced = monitorRequestsLoadable.loadSilent();
            if (!traced.requestName().isEmpty()) {
                return traced.requestName();
            }
            if (traced.resolveNameAtRuntime()) {
                return null;
            }
        }
        return getBusinessTransationName(instrumentedMethod.getDeclaringType().getTypeName(), instrumentedMethod.getName());
    }

    private static String getBusinessTransationName(String className, String methodName) {
        return configuration.getConfig(TracingPlugin.class).getBusinessTransactionNamingStrategy().getBusinessTransactionName(className, methodName);
    }

    @Retention(RetentionPolicy.RUNTIME)
    @Target(ElementType.PARAMETER)
    public @interface ParameterNames {
    }

    public static class ParameterNamesDynamicValue implements Advice.OffsetMapping.Factory<ParameterNames> {

        @Override
        public Class<ParameterNames> getAnnotationType() {
            return ParameterNames.class;
        }

        @Override
        public Advice.OffsetMapping make(ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<ParameterNames> annotation, AdviceType adviceType) {
            return new Advice.OffsetMapping() {

                @Override
                public Target resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Advice.ArgumentHandler argumentHandler, Sort sort) {
                    final StringBuilder params = new StringBuilder();
                    for (ParameterDescription param : instrumentedMethod.getParameters()) {
                        params.append(param.getName()).append(',');
                    }
                    return Advice.OffsetMapping.Target.ForStackManipulation.of(params.toString());
                }
            };
        }
    }
}


for (int i = 0; i < args.length; i++) {
            params.put(paramNames[i], args[i]);
        }

package org.stagemonitor.tracing;

import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.annotation.AnnotationDescription;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.method.ParameterDescription;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.implementation.bytecode.assign.Assigner;
import net.bytebuddy.implementation.bytecode.constant.NullConstant;
import org.stagemonitor.core.Stagemonitor;
import org.stagemonitor.core.instrument.StagemonitorByteBuddyTransformer;
import org.stagemonitor.tracing.metrics.MetricsSpanEventListener;
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import io.opentracing.Span;

public class AbstractTracingTransformer extends StagemonitorByteBuddyTransformer {

    @Override
    protected Class<? extends StagemonitorByteBuddyTransformer> getAdviceClass() {
        return AbstractTracingTransformer.class;
    }

    @Advice.OnMethodEnter(inline = false)
    public static void monitorStart(@ParameterNames String parameterNames, @Advice.AllArguments Object[] args, @RequestName String requestName, @Advice.Origin("#t") String className, @Advice.Origin("#m") String methodName, @Advice.This(optional = true) Object thiz) {
        final String[] paramNames = parameterNames.split(",");
        Map<String, Object> params = new LinkedHashMap<String, Object>();

        final MonitoredMethodRequest monitoredRequest = new MonitoredMethodRequest(Stagemonitor.getConfiguration(), requestName, null, params);
        final TracingPlugin tracingPlugin = Stagemonitor.getPlugin(TracingPlugin.class);
        tracingPlugin.getRequestMonitor().monitorStart(monitoredRequest);
        final Span span = TracingPlugin.getCurrentSpan();
        if (requestName == null) {
            span.setOperationName(getBusinessTransationName(thiz != null ? thiz.getClass().getName() : className, methodName));
        }
        span.setTag(MetricsSpanEventListener.ENABLE_TRACKING_METRICS_TAG, true);
    }

    @Advice.OnMethodExit(onThrowable = Throwable.class, inline = false)
    public static void monitorStop(@Advice.Thrown Throwable exception) {
        final RequestMonitor requestMonitor = Stagemonitor.getPlugin(TracingPlugin.class).getRequestMonitor();
        if (exception != null && exception instanceof Exception) {
            requestMonitor.recordException((Exception) exception);
        }
        requestMonitor.monitorStop();
    }

    @Override
    protected int getOrder() {
        return Integer.MIN_VALUE;
    }

    @Override
    protected List<Advice.OffsetMapping.Factory<? extends Annotation>> getOffsetMappingFactories() {
        final Advice.OffsetMapping.Factory<? extends Annotation> requestNameDynamicValue = new RequestNameDynamicValue();
        return Arrays.asList(requestNameDynamicValue, new ParameterNamesDynamicValue());
    }

    @Retention(RetentionPolicy.RUNTIME)
    @Target(ElementType.PARAMETER)
    public @interface RequestName {
    }

    public static class RequestNameDynamicValue implements Advice.OffsetMapping.Factory<RequestName> {

        @Override
        public Class<RequestName> getAnnotationType() {
            return RequestName.class;
        }

        @Override
        public Advice.OffsetMapping make(ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<RequestName> annotation, AdviceType adviceType) {
            return new Advice.OffsetMapping() {

                @Override
                public Target resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Advice.ArgumentHandler argumentHandler, Sort sort) {
                    final String requestName = getRequestName(instrumentedMethod);
                    if (requestName != null) {
                        return Target.ForStackManipulation.of(requestName);
                    } else {
                        return new Target.ForStackManipulation(NullConstant.INSTANCE);
                    }
                }
            };
        }
    }

    public static String getRequestName(MethodDescription instrumentedMethod) {
        final AnnotationDescription.Loadable<Traced> monitorRequestsLoadable = instrumentedMethod.getDeclaredAnnotations().ofType(Traced.class);
        if (monitorRequestsLoadable != null) {
            final Traced traced = monitorRequestsLoadable.loadSilent();
            if (!traced.requestName().isEmpty()) {
                return traced.requestName();
            }
            if (traced.resolveNameAtRuntime()) {
                return null;
            }
        }
        return getBusinessTransationName(instrumentedMethod.getDeclaringType().getTypeName(), instrumentedMethod.getName());
    }

    private static String getBusinessTransationName(String className, String methodName) {
        return configuration.getConfig(TracingPlugin.class).getBusinessTransactionNamingStrategy().getBusinessTransactionName(className, methodName);
    }

    @Retention(RetentionPolicy.RUNTIME)
    @Target(ElementType.PARAMETER)
    public @interface ParameterNames {
    }

    public static class ParameterNamesDynamicValue implements Advice.OffsetMapping.Factory<ParameterNames> {

        @Override
        public Class<ParameterNames> getAnnotationType() {
            return ParameterNames.class;
        }

        @Override
        public Advice.OffsetMapping make(ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<ParameterNames> annotation, AdviceType adviceType) {
            return new Advice.OffsetMapping() {

                @Override
                public Target resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Advice.ArgumentHandler argumentHandler, Sort sort) {
                    final StringBuilder params = new StringBuilder();
                    for (ParameterDescription param : instrumentedMethod.getParameters()) {
                        params.append(param.getName()).append(',');
                    }
                    return Advice.OffsetMapping.Target.ForStackManipulation.of(params.toString());
                }
            };
        }
    }
}


@Override
    @SideOnly(Side.CLIENT)
    protected void execute()

package net.shadowmage.ancientwarfare.structure.network;

import io.netty.buffer.ByteBuf;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.shadowmage.ancientwarfare.core.network.PacketBase;
import net.shadowmage.ancientwarfare.structure.render.BlockHighlightRenderer;
import net.shadowmage.ancientwarfare.structure.util.BlockHighlightInfo;
import java.io.IOException;

public class PacketHighlightBlock extends PacketBase {

    private BlockHighlightInfo blockHighlightInfo;

    public PacketHighlightBlock(BlockHighlightInfo blockHighlightInfo) {
        this.blockHighlightInfo = blockHighlightInfo;
    }

    public PacketHighlightBlock() {
    }

    @Override
    protected void writeToStream(ByteBuf data) {
        blockHighlightInfo.serializeToBuffer(data);
    }

    @Override
    protected void readFromStream(ByteBuf data) throws IOException {
        blockHighlightInfo = BlockHighlightInfo.deserializeFromBuffer(data);
    }

{
        BlockHighlightRenderer.setBlockHighlightInfo(blockHighlightInfo);
    }
}


{
        BlockHighlightRenderer.setBlockHighlightInfo(blockHighlightInfo);
    }

package net.shadowmage.ancientwarfare.structure.network;

import io.netty.buffer.ByteBuf;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.shadowmage.ancientwarfare.core.network.PacketBase;
import net.shadowmage.ancientwarfare.structure.render.BlockHighlightRenderer;
import net.shadowmage.ancientwarfare.structure.util.BlockHighlightInfo;
import java.io.IOException;

public class PacketHighlightBlock extends PacketBase {

    private BlockHighlightInfo blockHighlightInfo;

    public PacketHighlightBlock(BlockHighlightInfo blockHighlightInfo) {
        this.blockHighlightInfo = blockHighlightInfo;
    }

    public PacketHighlightBlock() {
    }

    @Override
    protected void writeToStream(ByteBuf data) {
        blockHighlightInfo.serializeToBuffer(data);
    }

    @Override
    protected void readFromStream(ByteBuf data) throws IOException {
        blockHighlightInfo = BlockHighlightInfo.deserializeFromBuffer(data);
    }

    @Override
    @SideOnly(Side.CLIENT)
    protected void execute()


package net.shadowmage.ancientwarfare.structure.network;

import io.netty.buffer.ByteBuf;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.shadowmage.ancientwarfare.core.network.PacketBase;
import net.shadowmage.ancientwarfare.structure.render.BlockHighlightRenderer;
import net.shadowmage.ancientwarfare.structure.util.BlockHighlightInfo;
import java.io.IOException;

public class PacketHighlightBlock extends PacketBase {

    private BlockHighlightInfo blockHighlightInfo;

    public PacketHighlightBlock(BlockHighlightInfo blockHighlightInfo) {
        this.blockHighlightInfo = blockHighlightInfo;
    }

    public PacketHighlightBlock() {
    }

    @Override
    protected void writeToStream(ByteBuf data) {
        blockHighlightInfo.serializeToBuffer(data);
    }

    @Override
    protected void readFromStream(ByteBuf data) throws IOException {
        blockHighlightInfo = BlockHighlightInfo.deserializeFromBuffer(data)

    }

    @Override
    @SideOnly(Side.CLIENT)
    protected void execute() {
        BlockHighlightRenderer.setBlockHighlightInfo(blockHighlightInfo);
    }
}


package com.aliyuncs.oam.model.v20170101;

import com.aliyuncs.AcsResponse;
import com.aliyuncs.oam.transform.v20170101.AddUserToGroupResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;

/**
 * @author auto create
 * @version
 */
public class AddUserToGroupResponse extends AcsResponse {

    private String code;

    private String message;

{
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public AddUserToGroupResponse getInstance(UnmarshallerContext context) {
        return AddUserToGroupResponseUnmarshaller.unmarshall(this, context);
    }
}


{
        return AddUserToGroupResponseUnmarshaller.unmarshall(this, context);
    }

package com.aliyuncs.oam.model.v20170101;

import com.aliyuncs.AcsResponse;
import com.aliyuncs.oam.transform.v20170101.AddUserToGroupResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;

/**
 * @author auto create
 * @version
 */
public class AddUserToGroupResponse extends AcsResponse {

    private String code;

    private String message;

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public AddUserToGroupResponse getInstance(UnmarshallerContext context)


package com.aliyuncs.oam.model.v20170101;

import com.aliyuncs.AcsResponse;
import com.aliyuncs.oam.transform.v20170101.AddUserToGroupResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;

/**
 * @author auto create
 * @version
 */
public class AddUserToGroupResponse extends AcsResponse {

    private String code;

    private String message;

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.me

    }

    @Override
    public AddUserToGroupResponse getInstance(UnmarshallerContext context) {
        return AddUserToGroupResponseUnmarshaller.unmarshall(this, context);
    }
}


/*
 * You may obtain a copy of the Licence at:
 * http://example.com
 */
package net.dries007.tfc.network;

import net.minecraft.world.entity.player.Player;
import net.minecraftforge.fmllegacy.network.NetworkEvent;
import net.dries007.tfc.client.ClientHelpers;
import net.dries007.tfc.common.capabilities.food.TFCFoodData;

/**
 * A packet that signals to the client it needs to replace the client player's food stats object
 */
public class FoodDataReplacePacket {

{
        context.enqueueWork(() -> {
            final Player player = ClientHelpers.getPlayer();
            if (player != null) {
                TFCFoodData.replaceFoodStats(player);
            }
        });
    }
}


{
        context.enqueueWork(() -> {
            final Player player = ClientHelpers.getPlayer();
            if (player != null) {
                TFCFoodData.replaceFoodStats(player);
            }
        });
    }

/*
 * You may obtain a copy of the Licence at:
 * http://example.com
 */
package net.dries007.tfc.network;

import net.minecraft.world.entity.player.Player;
import net.minecraftforge.fmllegacy.network.NetworkEvent;
import net.dries007.tfc.client.ClientHelpers;
import net.dries007.tfc.common.capabilities.food.TFCFoodData;

/**
 * A packet that signals to the client it needs to replace the client player's food stats object
 */
public class FoodDataReplacePacket {

    void handle(NetworkEvent.Context context)


public static <T extends CommittedChangeList> Collection<Pair<VcsRevisionNumber, List<T>>> getVcsRootsForChanges(final AbstractVcs vcs, final Collection<Change> changes) throws VcsException

package com.intellij.openapi.vcs;

import com.intellij.openapi.util.Pair;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangesUtil;
import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
import com.intellij.openapi.vfs.VirtualFile;
import java.util.*;

public class OutgoingChangesUtil {

{
        final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(vcs.getProject());
        final VcsOutgoingChangesProvider provider = vcs.getOutgoingChangesProvider();
        if (provider == null)
            return Collections.emptyList();
        final VirtualFile[] files = ChangesUtil.getFilesFromChanges(changes);
        final Set<VirtualFile> roots = new HashSet<VirtualFile>();
        for (VirtualFile file : files) {
            final VirtualFile root = vcsManager.getVcsRootFor(file);
            if (root != null) {
                roots.add(root);
            }
        }
        final Collection<Pair<VcsRevisionNumber, List<T>>> result = new ArrayList<Pair<VcsRevisionNumber, List<T>>>(roots.size());
        for (VirtualFile root : roots) {
            final Pair<VcsRevisionNumber, List<T>> pair = provider.getOutgoingChanges(root, true);
            result.add(pair);
        }
        return result;
    }
}


package com.intellij.openapi.vcs;

import com.intellij.openapi.util.Pair;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangesUtil;
import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
import com.intellij.openapi.vfs.VirtualFile;
import java.util.*;

public class OutgoingChangesUtil {

    public static <T extends CommittedChangeList> Collection<Pair<VcsRevisionNumber, List<T>>> getVcsRootsForChanges(final AbstractVcs vcs, final Collection<Change> changes) throws VcsException {
        final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(vcs.getProject());
        final VcsOutgoingChangesProvider provider = vcs.getOutgoingChangesProvider();
        if (provider == null)
            return Collections.emptyList();
        final VirtualFile[] files = ChangesUtil.getFilesFromChanges(changes);
        final Set<VirtualFile> roots = new Ha

        for (VirtualFile file : files) {
            final VirtualFile root = vcsManager.getVcsRootFor(file);
            if (root != null) {
                roots.add(root);
            }
        }
        final Collection<Pair<VcsRevisionNumber, List<T>>> result = new ArrayList<Pair<VcsRevisionNumber, List<T>>>(roots.size());
        for (VirtualFile root : roots) {
            final Pair<VcsRevisionNumber, List<T>> pair = provider.getOutgoingChanges(root, true);
            result.add(pair);
        }
        return result;
    }
}


private Complex function(final double x)

package org.toilelibre.libe.soundtransform.infrastructure.service.converted.sound.transforms;

import org.apache.commons.math3.complex.Complex;
import org.toilelibre.libe.soundtransform.model.converted.FormatInfo;
import org.toilelibre.libe.soundtransform.model.converted.sound.transform.SimpleFrequencySoundTransform;
import org.toilelibre.libe.soundtransform.model.converted.spectrum.Spectrum;

/**
 * Equalizer which cuts the treble and the bass frequencies of a sound
 */
public class GaussianEqualizerSoundTransform extends SimpleFrequencySoundTransform<Complex[]> {

    private static final int DELTA_X = 3500;

    private static final int EXPONENT = 2;

    private static final int DIVISION = 1000;

    private static final int HALF = 2;

    public GaussianEqualizerSoundTransform() {
        super();
    }

{
        return new Complex(1 - Math.exp(-Math.pow(x - GaussianEqualizerSoundTransform.DELTA_X, GaussianEqualizerSoundTransform.EXPONENT) / GaussianEqualizerSoundTransform.DIVISION) / GaussianEqualizerSoundTransform.HALF);
    }

    @Override
    public Spectrum<Complex[]> transformFrequencies(final Spectrum<Complex[]> fs, final int offset, final int powOf2NearestLength, final int length) {
        final Complex[] newAmpl = new Complex[powOf2NearestLength];
        for (double j = 0; j < length; j++) {
            final double freq = j * fs.getSampleRate() / fs.getState().length;
            newAmpl[(int) j] = fs.getState()[(int) j].multiply(this.function(freq));
        }
        for (int j = length; j < powOf2NearestLength; j++) {
            newAmpl[j] = new Complex(0, 0);
        }
        return new Spectrum<Complex[]>(newAmpl, new FormatInfo(fs.getSampleSize(), fs.getSampleRate()));
    }
}


{
        return new Complex(1 - Math.exp(-Math.pow(x - GaussianEqualizerSoundTransform.DELTA_X, GaussianEqualizerSoundTransform.EXPONENT) / GaussianEqualizerSoundTransform.DIVISION) / GaussianEqualizerSoundTransform.HALF);
    }

package org.toilelibre.libe.soundtransform.infrastructure.service.converted.sound.transforms;

import org.apache.commons.math3.complex.Complex;
import org.toilelibre.libe.soundtransform.model.converted.FormatInfo;
import org.toilelibre.libe.soundtransform.model.converted.sound.transform.SimpleFrequencySoundTransform;
import org.toilelibre.libe.soundtransform.model.converted.spectrum.Spectrum;

/**
 * Equalizer which cuts the treble and the bass frequencies of a sound
 */
public class GaussianEqualizerSoundTransform extends SimpleFrequencySoundTransform<Complex[]> {

    private static final int DELTA_X = 3500;

    private static final int EXPONENT = 2;

    private static final int DIVISION = 1000;

    private static final int HALF = 2;

    public GaussianEqualizerSoundTransform() {
        super();
    }

    private Complex function(final double x)

    @Override
    public Spectrum<Complex[]> transformFrequencies(final Spectrum<Complex[]> fs, final int offset, final int powOf2NearestLength, final int length) {
        final Complex[] newAmpl = new Complex[powOf2NearestLength];
        for (double j = 0; j < length; j++) {
            final double freq = j * fs.getSampleRate() / fs.getState().length;
            newAmpl[(int) j] = fs.getState()[(int) j].multiply(this.function(freq));
        }
        for (int j = length; j < powOf2NearestLength; j++) {
            newAmpl[j] = new Complex(0, 0);
        }
        return new Spectrum<Complex[]>(newAmpl, new FormatInfo(fs.getSampleSize(), fs.getSampleRate()));
    }
}


package org.toilelibre.libe.soundtransform.infrastructure.service.converted.sound.transforms;

import org.apache.commons.math3.complex.Complex;
import org.toilelibre.libe.soundtransform.model.converted.FormatInfo;
import org.toilelibre.libe.soundtransform.model.converted.sound.transform.SimpleFrequencySoundTransform;
import org.toilelibre.libe.soundtransform.model.converted.spectrum.Spectrum;

/**
 * Equalizer which cuts the treble and the bass frequencies of a sound
 */
public class GaussianEqualizerSoundTransform extends SimpleFrequencySoundTransform<Complex[]> {

    private static final int DELTA_X = 3500;

    private static final int EXPONENT = 2;

    private static final int DIVISION = 1000;

    private static final int HALF = 2;

    public GaussianEqualizerSoundTransform() {
        super();
    }

    private Complex function(final double x) {
        return new Complex(1 - Math.exp(-Math.pow(x - GaussianEqualizerSoundTransform.DELTA_X, GaussianEqualizerSoundTransform.EXPONENT) / GaussianEqualizerSoundTransform.DIVISION) / GaussianEqualizerSoundTransform.HALF);
    }

    @Override
    public Spectrum<Complex[]> transformFrequencies(final Spectrum<Complex[]> fs, final int offset, final int powOf2NearestLength, final int length) {
        final Complex[] newAmpl = new Complex[powOf

        for (double j = 0; j < length; j++) {
            final double freq = j * fs.getSampleRate() / fs.getState().length;
            newAmpl[(int) j] = fs.getState()[(int) j].multiply(this.function(freq));
        }
        for (int j = length; j < powOf2NearestLength; j++) {
            newAmpl[j] = new Complex(0, 0);
        }
        return new Spectrum<Complex[]>(newAmpl, new FormatInfo(fs.getSampleSize(), fs.getSampleRate()));
    }
}


for (double j = 0; j < length; j++) {
            final double freq = j * fs.getSampleRate() / fs.getState().length;
            newAmpl[(int) j] = fs.getState()[(int) j].multiply(this.function(freq));
        }

package org.toilelibre.libe.soundtransform.infrastructure.service.converted.sound.transforms;

import org.apache.commons.math3.complex.Complex;
import org.toilelibre.libe.soundtransform.model.converted.FormatInfo;
import org.toilelibre.libe.soundtransform.model.converted.sound.transform.SimpleFrequencySoundTransform;
import org.toilelibre.libe.soundtransform.model.converted.spectrum.Spectrum;

/**
 * Equalizer which cuts the treble and the bass frequencies of a sound
 */
public class GaussianEqualizerSoundTransform extends SimpleFrequencySoundTransform<Complex[]> {

    private static final int DELTA_X = 3500;

    private static final int EXPONENT = 2;

    private static final int DIVISION = 1000;

    private static final int HALF = 2;

    public GaussianEqualizerSoundTransform() {
        super();
    }

    private Complex function(final double x) {
        return new Complex(1 - Math.exp(-Math.pow(x - GaussianEqualizerSoundTransform.DELTA_X, GaussianEqualizerSoundTransform.EXPONENT) / GaussianEqualizerSoundTransform.DIVISION) / GaussianEqualizerSoundTransform.HALF);
    }

    @Override
    public Spectrum<Complex[]> transformFrequencies(final Spectrum<Complex[]> fs, final int offset, final int powOf2NearestLength, final int length) {
        final Complex[] newAmpl = new Complex[powOf2NearestLength];

        for (int j = length; j < powOf2NearestLength; j++) {
            newAmpl[j] = new Complex(0, 0);
        }
        return new Spectrum<Complex[]>(newAmpl, new FormatInfo(fs.getSampleSize(), fs.getSampleRate()));
    }
}


@Override
    public Collection<SourceDataEntry> poll()

package org.apache.rocketmq.connect.jms.connector;

import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.jms.BytesMessage;
import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.ObjectMessage;
import javax.jms.StreamMessage;
import javax.jms.TextMessage;
import org.apache.rocketmq.connect.jms.Config;
import org.apache.rocketmq.connect.jms.ErrorCode;
import org.apache.rocketmq.connect.jms.Replicator;
import org.apache.rocketmq.connect.jms.pattern.PatternProcessor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.fastjson.JSON;
import io.openmessaging.KeyValue;
import io.openmessaging.connector.api.data.EntryType;
import io.openmessaging.connector.api.data.SourceDataEntry;
import io.openmessaging.connector.api.exception.DataConnectException;
import io.openmessaging.connector.api.source.SourceTask;

public abstract class BaseJmsSourceTask extends SourceTask {

    private static final Logger log = LoggerFactory.getLogger(BaseJmsSourceTask.class);

    private Replicator replicator;

    private Config config;

    private ByteBuffer sourcePartition;

{
        List<SourceDataEntry> res = new ArrayList<>();
        try {
            Message message = replicator.getQueue().poll(1000, TimeUnit.MILLISECONDS);
            if (message != null) {
                Object[] payload = new Object[] { config.getDestinationType(), config.getDestinationName(), getMessageContent(message) };
                SourceDataEntry sourceDataEntry = new SourceDataEntry(sourcePartition, null, System.currentTimeMillis(), EntryType.CREATE, null, null, payload);
                res.add(sourceDataEntry);
            }
        } catch (Exception e) {
            log.error("activemq task poll error, current config:" + JSON.toJSONString(config), e);
        }
        return res;
    }

    @Override
    public void start(KeyValue props) {
        try {
            this.config = new Config();
            this.config.load(props);
            this.sourcePartition = ByteBuffer.wrap(config.getBrokerUrl().getBytes("UTF-8"));
            this.replicator.start();
        } catch (Exception e) {
            log.error("activemq task start failed.", e);
            throw new DataConnectException(ErrorCode.START_ERROR_CODE, e.getMessage(), e);
        }
    }

    @Override
    public void stop() {
        try {
            replicator.stop();
        } catch (Exception e) {
            log.error("activemq task stop failed.", e);
            throw new DataConnectException(ErrorCode.STOP_ERROR_CODE, e.getMessage(), e);
        }
    }

    @Override
    public void pause() {
    }

    @Override
    public void resume() {
    }

    @SuppressWarnings("unchecked")
    public ByteBuffer getMessageContent(Message message) throws JMSException {
        byte[] data = null;
        if (message instanceof TextMessage) {
            data = ((TextMessage) message).getText().getBytes();
        } else if (message instanceof ObjectMessage) {
            data = JSON.toJSONBytes(((ObjectMessage) message).getObject());
        } else if (message instanceof BytesMessage) {
            BytesMessage bytesMessage = (BytesMessage) message;
            data = new byte[(int) bytesMessage.getBodyLength()];
            bytesMessage.readBytes(data);
        } else if (message instanceof MapMessage) {
            MapMessage mapMessage = (MapMessage) message;
            Map<String, Object> map = new HashMap<>();
            Enumeration<Object> names = mapMessage.getMapNames();
            while (names.hasMoreElements()) {
                String name = names.nextElement().toString();
                map.put(name, mapMessage.getObject(name));
            }
            data = JSON.toJSONBytes(map);
        } else if (message instanceof StreamMessage) {
            StreamMessage streamMessage = (StreamMessage) message;
            ByteArrayOutputStream bis = new ByteArrayOutputStream();
            byte[] by = new byte[1024];
            int i = 0;
            while ((i = streamMessage.readBytes(by)) != -1) {
                bis.write(by, 0, i);
            }
            data = bis.toByteArray();
        } else {
            // The exception is printed and does not need to be written as a DataConnectException
            throw new RuntimeException("message type exception");
        }
        return ByteBuffer.wrap(data);
    }

    public abstract Config getConfig();

    public abstract PatternProcessor getPatternProcessor(Replicator replicator);
}


{
        try {
            this.config = new Config();
            this.config.load(props);
            this.sourcePartition = ByteBuffer.wrap(config.getBrokerUrl().getBytes("UTF-8"));
            this.replicator.start();
        } catch (Exception e) {
            log.error("activemq task start failed.", e);
            throw new DataConnectException(ErrorCode.START_ERROR_CODE, e.getMessage(), e);
        }
    }

package org.apache.rocketmq.connect.jms.connector;

import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.jms.BytesMessage;
import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.ObjectMessage;
import javax.jms.StreamMessage;
import javax.jms.TextMessage;
import org.apache.rocketmq.connect.jms.Config;
import org.apache.rocketmq.connect.jms.ErrorCode;
import org.apache.rocketmq.connect.jms.Replicator;
import org.apache.rocketmq.connect.jms.pattern.PatternProcessor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.fastjson.JSON;
import io.openmessaging.KeyValue;
import io.openmessaging.connector.api.data.EntryType;
import io.openmessaging.connector.api.data.SourceDataEntry;
import io.openmessaging.connector.api.exception.DataConnectException;
import io.openmessaging.connector.api.source.SourceTask;

public abstract class BaseJmsSourceTask extends SourceTask {

    private static final Logger log = LoggerFactory.getLogger(BaseJmsSourceTask.class);

    private Replicator replicator;

    private Config config;

    private ByteBuffer sourcePartition;

    @Override
    public Collection<SourceDataEntry> poll() {
        List<SourceDataEntry> res = new ArrayList<>();
        try {
            Message message = replicator.getQueue().poll(1000, TimeUnit.MILLISECONDS);
            if (message != null) {
                Object[] payload = new Object[] { config.getDestinationType(), config.getDestinationName(), getMessageContent(message) };
                SourceDataEntry sourceDataEntry = new SourceDataEntry(sourcePartition, null, System.currentTimeMillis(), EntryType.CREATE, null, null, payload);
                res.add(sourceDataEntry);
            }
        } catch (Exception e) {
            log.error("activemq task poll error, current config:" + JSON.toJSONString(config), e);
        }
        return res;
    }

    @Override
    public void start(KeyValue props)

    @Override
    public void stop() {
        try {
            replicator.stop();
        } catch (Exception e) {
            log.error("activemq task stop failed.", e);
            throw new DataConnectException(ErrorCode.STOP_ERROR_CODE, e.getMessage(), e);
        }
    }

    @Override
    public void pause() {
    }

    @Override
    public void resume() {
    }

    @SuppressWarnings("unchecked")
    public ByteBuffer getMessageContent(Message message) throws JMSException {
        byte[] data = null;
        if (message instanceof TextMessage) {
            data = ((TextMessage) message).getText().getBytes();
        } else if (message instanceof ObjectMessage) {
            data = JSON.toJSONBytes(((ObjectMessage) message).getObject());
        } else if (message instanceof BytesMessage) {
            BytesMessage bytesMessage = (BytesMessage) message;
            data = new byte[(int) bytesMessage.getBodyLength()];
            bytesMessage.readBytes(data);
        } else if (message instanceof MapMessage) {
            MapMessage mapMessage = (MapMessage) message;
            Map<String, Object> map = new HashMap<>();
            Enumeration<Object> names = mapMessage.getMapNames();
            while (names.hasMoreElements()) {
                String name = names.nextElement().toString();
                map.put(name, mapMessage.getObject(name));
            }
            data = JSON.toJSONBytes(map);
        } else if (message instanceof StreamMessage) {
            StreamMessage streamMessage = (StreamMessage) message;
            ByteArrayOutputStream bis = new ByteArrayOutputStream();
            byte[] by = new byte[1024];
            int i = 0;
            while ((i = streamMessage.readBytes(by)) != -1) {
                bis.write(by, 0, i);
            }
            data = bis.toByteArray();
        } else {
            // The exception is printed and does not need to be written as a DataConnectException
            throw new RuntimeException("message type exception");
        }
        return ByteBuffer.wrap(data);
    }

    public abstract Config getConfig();

    public abstract PatternProcessor getPatternProcessor(Replicator replicator);
}