<commit_before>package org.androidtransfuse.util;

import org.androidtransfuse.analysis.adapter.ASTMethod;
import org.androidtransfuse.analysis.adapter.ASTParameter;
import org.androidtransfuse.analysis.adapter.ASTPrimitiveType;
import org.androidtransfuse.analysis.adapter.ASTType;

import java.util.List;

/**
 * @author <NAME>
 */
public class MethodSignature {

    private String methodSignature;
    private ASTMethod method;

    public MethodSignature(ASTMethod method) {
        methodSignature = makeDescriptor(method);
        this.method = method;
    }

    public ASTMethod getMethod() {
        return method;
    }

    /**
     * Makes a descriptor for a given method.
     *
     * @param method
     * @return descriptor
     */
    public static String makeDescriptor(ASTMethod method) {
        List<ASTParameter> params = method.getParameters();
        return method.getName() + ':' + makeDescriptor(params, method.getReturnType());
    }

    /**
     * Makes a descriptor for a given method.
     *
     * @param params  parameter types.
     * @param retType return type.
     */
    public static String makeDescriptor(List<ASTParameter> params, ASTType retType) {
        StringBuilder builder = new StringBuilder();
        builder.append('(');
        for (ASTParameter param : params) {
            makeDesc(builder, param.getASTType());
        }

        builder.append(')');
        makeDesc(builder, retType);
        return builder.toString();
    }

    private static void makeDesc(StringBuilder builder, ASTType type) {
        if (type.isArray()) {
            builder.append('[');
        }
        makeTypeDesc(builder, type);
    }

    private static void makeTypeDesc(StringBuilder builder, ASTType type) {
        if (type instanceof ASTPrimitiveType) {
            builder.append(type.getName());
        } else {
            builder.append('L').append(type.getName().replace('.', '/')).append(';');
        }
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof MethodSignature)) {
            return false;
        }

        MethodSignature that = (MethodSignature) o;

        if (methodSignature != null ? !methodSignature.equals(that.methodSignature) : that.methodSignature != null) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        return methodSignature != null ? methodSignature.hashCode() : 0;
    }
}<commit_msg>cleaned up methods and equals/hashcode<commit_after>package org.androidtransfuse.util;

import org.androidtransfuse.analysis.adapter.ASTMethod;
import org.androidtransfuse.analysis.adapter.ASTParameter;
import org.androidtransfuse.analysis.adapter.ASTPrimitiveType;
import org.androidtransfuse.analysis.adapter.ASTType;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

import java.util.List;

/**
 * @author <NAME>
 */
public class MethodSignature {

    private String methodSignature;
    private ASTMethod method;

    public MethodSignature(ASTMethod method) {
        methodSignature = makeDescriptor(method);
        this.method = method;
    }

    public ASTMethod getMethod() {
        return method;
    }

    /**
     * Makes a descriptor for a given method.
     *
     * @param method
     * @return descriptor
     */
    private String makeDescriptor(ASTMethod method) {
        List<ASTParameter> params = method.getParameters();
        return method.getName() + ':' + makeDescriptor(params, method.getReturnType());
    }

    /**
     * Makes a descriptor for a given method.
     *
     * @param params  parameter types.
     * @param retType return type.
     * @return method descriptor
     */
    private String makeDescriptor(List<ASTParameter> params, ASTType retType) {
        StringBuilder builder = new StringBuilder();
        builder.append('(');
        for (ASTParameter param : params) {
            makeDesc(builder, param.getASTType());
        }

        builder.append(')');
        makeDesc(builder, retType);
        return builder.toString();
    }

    private void makeDesc(StringBuilder builder, ASTType type) {
        if (type.isArray()) {
            builder.append('[');
        }
        makeTypeDesc(builder, type);
    }

    private void makeTypeDesc(StringBuilder builder, ASTType type) {
        if (type instanceof ASTPrimitiveType) {
            builder.append(type.getName());
        } else {
            builder.append('L').append(type.getName().replace('.', '/')).append(';');
        }
    }

    @Override
    public boolean equals(Object o) {
        return EqualsBuilder.reflectionEquals(this, o, new String[]{"method"});
    }

    @Override
    public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this, new String[]{"method"});
    }
}
{'fraction_non_alphanumeric': 0.11206019930852146, 'fraction_numerical': 0.0002033760423022168, 'mean_word_length': 2.6108663729809103, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6616038', 'n_tokens_mistral': 1326, 'n_tokens_neox': 1292, 'n_words': 310}