#vulnerable code 
                                @Override
    public Tokenizer create(Reader reader) {
        logger.info(seg_type);
        Seg seg_method=null;
        if(seg_type.equals("max_word")){
            seg_method = new MaxWordSeg(dic);
        }else if(seg_type.equals("complex")){
            seg_method = new ComplexSeg(dic);
        }else if(seg_type.equals("simple")){
            seg_method =new SimpleSeg(dic);
        }
        logger.info(seg_method.toString());
        return  new MMSegTokenizer(seg_method,reader);
    } 
                            #location 12 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Override
    public Tokenizer create(Reader reader) {
        Seg seg_method=null;
        if(seg_type.equals("max_word")){
            seg_method = new MaxWordSeg(dic);
        }else if(seg_type.equals("complex")){
            seg_method = new ComplexSeg(dic);
        }else if(seg_type.equals("simple")){
            seg_method =new SimpleSeg(dic);
        }
        return  new MMSegTokenizer(seg_method,reader);
    }