#vulnerable code 
                                public String getText(final URL url) throws BoilerpipeProcessingException {
        try {
            final URLConnection conn = url.openConnection();
            final String encoding = conn.getContentEncoding();

            Charset cs = Charset.forName("Cp1252");
            if (encoding != null) {
                try {
                    cs = Charset.forName(encoding);
                } catch (UnsupportedCharsetException e) {
                    // keep default
                }
            }

            final InputStream in = conn.getInputStream();
            
            InputSource is = new InputSource(in);
            if(cs != null) {
                is.setEncoding(cs.name());
            }
            
            final String text = getText(is);
            in.close();
            return text;
        } catch (IOException e) {
            throw new BoilerpipeProcessingException(e);
        }
    } 
                            #location 15 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public String getText(final URL url) throws BoilerpipeProcessingException {
        try {
        	return getText(HTMLFetcher.fetch(url).toInputSource());
        } catch (IOException e) {
            throw new BoilerpipeProcessingException(e);
        }
    }