Close this "FileInputStream" sonar
<p>I'm trying to adapt my code to Sonar and I don't get why I can't correct this blocker.</p>

<p>Its a 'Close this FileInputStream' with this starting code:</p>

<pre><code>BufferedReader localBufferedReader = null;
            try {
                localBufferedReader = new BufferedReader( new InputStreamReader( new FileInputStream(inputFile),"UTF-8")); //THIS INPUTSTREAM!!
                String line;
                //
                // Fill Hashmap
                HashMap hmVar = (HashMap) this.context.getAttribute(this.hmVarName);
                if (hmVar == null)
                    hmVar = new HashMap();
                String[] props = new String[2];
                while ((line = localBufferedReader.readLine()) != null) {
                    //Split line into key, value
                    if(line.startsWith("#"))
                        continue;
                    props = line.split("=");
                    hmVar.put(props[0], props[1]);  
                }

            this.context.setAttribute(this.hmVarName, hmVar);

            } catch (FileNotFoundException localException2) {
                this.context.logError("Unable to find file: " + inputFile);
                localException2.printStackTrace();
                throw new WFException("Unable to find file: " + inputFile);
            } catch (Exception localException4) {
                this.context.logError("Exception reading file: " + inputFile
                        + " (" + localException4.getMessage() + ")");
                localException4.printStackTrace();
                throw new WFException("Exception reading file: " + inputFile
                        + " (" + localException4.getMessage() + ")");
            } finally {

                try {
                    if (localBufferedReader != null) {
                        localBufferedReader.close();
                    }                       

                } catch (Exception localException5) {
                }

            }
</code></pre>

<p>So, ok. I declared apart the fileinputstream and go on, but it still doesn't like the way I close it.</p>

<pre><code>BufferedReader localBufferedReader = null;
            FileInputStream fis = null;
            try {
                //StringBuffer localStringBuffer = new StringBuffer();
                fis = new FileInputStream(inputFile);
                //localBufferedReader = new BufferedReader( new InputStreamReader( new FileInputStream(inputFile),"UTF-8")); SONAR correction FileInputStream needs to be closed
                localBufferedReader = new BufferedReader( new InputStreamReader( fis,"UTF-8"));
                String line;
                //
                // Fill Hashmap
                HashMap hmVar = (HashMap) this.context.getAttribute(this.hmVarName);
                if (hmVar == null)
                    hmVar = new HashMap();
                String[] props = new String[2];
                while ((line = localBufferedReader.readLine()) != null) {
                    //Split line into key, value
                    if(line.startsWith("#"))
                        continue;
                    props = line.split("=");
                    hmVar.put(props[0], props[1]);  
                }

            this.context.setAttribute(this.hmVarName, hmVar);

            } catch (FileNotFoundException localException2) {
                this.context.logError("Unable to find file: " + inputFile);
                localException2.printStackTrace();
                throw new WFException("Unable to find file: " + inputFile);
            } catch (Exception localException4) {
                this.context.logError("Exception reading file: " + inputFile
                        + " (" + localException4.getMessage() + ")");
                localException4.printStackTrace();
                throw new WFException("Exception reading file: " + inputFile
                        + " (" + localException4.getMessage() + ")");
            } finally {

                try {
                    if (localBufferedReader != null) {
                        localBufferedReader.close();
                    }                       

                    if (fis != null) {
                        fis.close();
                    }   
                } catch (Exception localException5) {
                }

            }
</code></pre>

<p>Any ideas? I'm closing it the same way the BufferedReader that returns no issue.</p>