<commit_before>package ben.upsilon.exp;

import android.app.Activity;
import android.util.Log;
import android.view.View;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Field;

/**
 * Created by ben on 14/11/8.
 */
public final class ViewExp {


    private static final String LogTag=ViewExp.class.getCanonicalName();

    public  static void init(Activity _context){
        Field[] fields=_context.getClass().getDeclaredFields();
        if(null !=fields&&fields.length>0){
            for (Field field:fields){
                Log.d(LogTag,field.toGenericString());
                id _id=field.getAnnotation(id.class);
                if(null!=_id){
                   View view= _context.findViewById(_id.value());
                    if (null != view) {
                        field.setAccessible(true);
                        try {
                            field.set(_context,view);
                        } catch (IllegalAccessException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
        }
    }

    @Target(ElementType.FIELD)
    @Retention(RetentionPolicy.RUNTIME)
    public @interface id {
        int value() default -1;
    }
}<commit_msg>注解获取view.补充view调用<commit_after>package ben.upsilon.exp;

import android.app.Activity;
import android.util.Log;
import android.view.View;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Field;

/**
 * 注解去获取view id
 * Created by ben on 14/11/8.
 */
public final class ViewExp {


    private static final String LogTag=ViewExp.class.getCanonicalName();

    public  static void init(Activity _context){
        Field[] fields=_context.getClass().getDeclaredFields();
        if(null !=fields&&fields.length>0){
            for (Field field:fields){
                Log.d(LogTag,field.toGenericString());
                id _id=field.getAnnotation(id.class);
                if(null!=_id){
                   View view= _context.findViewById(_id.value());
                    if (null != view) {
                        field.setAccessible(true);
                        try {
                            field.set(_context, view);
                        } catch (IllegalAccessException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
        }
    }

    public static void init(View _context) {
        Field[] fields = _context.getClass().getDeclaredFields();
        if (null != fields && fields.length > 0) {
            for (Field field : fields) {
                Log.d(LogTag, field.toGenericString());
                id _id = field.getAnnotation(id.class);
                if (null != _id) {
                    View view = _context.findViewById(_id.value());
                    if (null != view) {
                        field.setAccessible(true);
                        try {
                            field.set(_context,view);
                        } catch (IllegalAccessException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
        }
    }

    @Target(ElementType.FIELD)
    @Retention(RetentionPolicy.RUNTIME)
    public @interface id {
        int value() default -1;
    }
}
{'fraction_non_alphanumeric': 0.10602275881210102, 'fraction_numerical': 0.004163197335553705, 'mean_word_length': 1.5469964664310953, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '5391654', 'n_tokens_mistral': 963, 'n_tokens_neox': 919, 'n_words': 181}