<commit_before>package projectgson;

import gson.DateDeserializerAdapter;
import gson.GsonManager;
import gson.ModuleDeserializerAdapter;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import sample.pojo.Module;
import sample.pojo.Student;

/*
 * @Type : Class
 * @Dependencies : N/A
 * @Data : N/A
 * @Description : N/A
 */
public class ProjectGson {

    public static void main(String[] args) {
        //============= Map of Composite Objects ============================================================
        Map<Type, Object> compositeObjectAdapterMap = new HashMap<Type, Object>();
        compositeObjectAdapterMap.put(Date.class, new DateDeserializerAdapter());
        compositeObjectAdapterMap.put(Module.class, new ModuleDeserializerAdapter());

        //============= Instead of Json file, Json String is passed =========================================
        String s = "{name:'Sajitha',id:'ST-001',date:'2016-07-09',age:24,subjects:['Maths','English'],module:{id:'MD00-CS',name:'Secure Systems'}}";

        Student student = (Student) GsonManager.getContext(compositeObjectAdapterMap, s, Student.class);
        //============= Used Reflection - Not Important
        printTheFields(student);
    }

    public static void printTheFields(Student student) {
        try {
            Field[] fields = Student.class.getDeclaredFields();
            for (Field field : fields) {
                if (field.getName().equals("module")) {
                    Object newObj = field.get(student);
                    Module module = (Module) newObj;
                    System.out.println(field.getName()+".id" + " :" + module.getId());
                    System.out.println(field.getName()+".name" + " :" + module.getName());
                } else {
                    field.setAccessible(true);
                    Object newObj = field.get(student);
                    System.out.println(field.getName() + " :" + newObj);
                }
            }
        } catch (Exception e) {
            System.out.println("Exception : " + e.getMessage());
        }
    }
}<commit_msg>updating imports<commit_after>package projectgson;

import gson.deserializer.DateDeserializerAdapter;
import gson.deserializer.GsonDeserilaizeManager;
import gson.deserializer.ModuleDeserializerAdapter;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import sample.pojo.Module;
import sample.pojo.Student;

/*
 * @Type : Class
 * @Dependencies : N/A
 * @Data : N/A
 * @Description : N/A
 */
public class ReadingFromJson {

    public static void main(String[] args) {
        //============= Map of Composite Objects ============================================================
        Map<Type, Object> compositeObjectAdapterMap = new HashMap<Type, Object>();
        compositeObjectAdapterMap.put(Date.class, new DateDeserializerAdapter());
        compositeObjectAdapterMap.put(Module.class, new ModuleDeserializerAdapter());

        //============= Instead of Json file, Json String is passed =========================================
        String s = "{name:'Sajitha',id:'ST-001',date:'2016-07-09',age:24,subjects:['Maths','English'],module:{id:'MD00-CS',name:'Secure Systems'}}";

        Student student = (Student) GsonDeserilaizeManager.getContext(compositeObjectAdapterMap, s, Student.class);
        //============= Used Reflection - Not Important
        printTheFields(student);
    }

    public static void printTheFields(Student student) {
        try {
            Field[] fields = Student.class.getDeclaredFields();
            for (Field field : fields) {
                if (field.getName().equals("module")) {
                    Object newObj = field.get(student);
                    Module module = (Module) newObj;
                    System.out.println(field.getName()+".id" + " :" + module.getId());
                    System.out.println(field.getName()+".name" + " :" + module.getName());
                } else {
                    field.setAccessible(true);
                    Object newObj = field.get(student);
                    System.out.println(field.getName() + " :" + newObj);
                }
            }
        } catch (Exception e) {
            System.out.println("Exception : " + e.getMessage());
        }
    }
}
{'fraction_non_alphanumeric': 0.18536036036036035, 'fraction_numerical': 0.006756756756756757, 'mean_word_length': 2.735071488645921, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4806888', 'n_tokens_mistral': 1223, 'n_tokens_neox': 1167, 'n_words': 231}