#vulnerable code 
                                @Test
    public void testSegModeOther() throws IOException {
        JiebaAnalyzer analyzer = new JiebaAnalyzer("other", new File("data"),
                true);

        for (String sentence : sentences) {
            TokenStream tokenStream = analyzer.tokenStream(null,
                    new StringReader(sentence));
            tokenStream.reset();
            while (tokenStream.incrementToken()) {
                CharTermAttribute termAtt = tokenStream
                        .getAttribute(CharTermAttribute.class);
                OffsetAttribute offsetAtt = tokenStream
                        .getAttribute(OffsetAttribute.class);
                System.out
                        .println(termAtt.toString() + ","
                                + offsetAtt.startOffset() + ","
                                + offsetAtt.endOffset());
            }
            tokenStream.reset();
        }
    } 
                            #location 19 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void testSegModeOther() throws IOException {
        JiebaAnalyzer analyzer = new JiebaAnalyzer("other", new File("data"),
                true);

        for (String sentence : sentences) {
            TokenStream tokenStream = analyzer.tokenStream(null,
                    new StringReader(sentence));
            tokenStream.reset();
            while (tokenStream.incrementToken()) {
                CharTermAttribute termAtt = tokenStream
                        .getAttribute(CharTermAttribute.class);
                OffsetAttribute offsetAtt = tokenStream
                        .getAttribute(OffsetAttribute.class);
                System.out
                        .println(termAtt.toString() + ","
                                + offsetAtt.startOffset() + ","
                                + offsetAtt.endOffset());
            }
            tokenStream.reset();
        }
        
        analyzer.close();
    }