<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi programmers,<br><br>Eclipse complains about a lot places in the source code., e.g.<br>"Resource leak: 'fmt' is never closed SyntaxException.java /mkgmap/src/uk/me/parabola/mkgmap/scan line 45 Java Problem"<br><br>The code looks like this:<br><br><font style="" face="Courier New"> public String getMessage() {</font><font style="" face="Courier New"><br></font><font style="" face="Courier New"> Formatter fmt = new Formatter();</font><font style="" face="Courier New"><br></font><font style="" face="Courier New"> fmt.format("Error: ");</font><font style="" face="Courier New"><br></font><font style="" face="Courier New"> if (fileName != null)</font><font style="" face="Courier New"><br></font><font style="" face="Courier New"> fmt.format("(%s:%d): ", fileName, lineNumber);</font><font style="" face="Courier New"><br></font><font style="" face="Courier New"><br></font><font style="" face="Courier New"> fmt.format(super.getMessage());</font><font style="" face="Courier New"><br></font><font style="" face="Courier New"> return fmt.toString();</font><font style="" face="Courier New"><br></font><font style="" face="Courier New"> }</font><font style="" face="Courier New"><br></font><br>The message disappears if I change the last line to this:<br><font style="" face="Courier New"> String res = fmt.toString();</font><font style="" face="Courier New"><br></font><font style="" face="Courier New"> fmt.close();</font><font style="" face="Courier New"><br></font><font style="" face="Courier New"> return res;</font><font style="" face="Courier New"><br></font><br>Does anybody know if this can really improve something?<br><br>Gerd<br>                                            </div></body>
</html>