<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Help the JDT Compiler helping you! - 1: Resource Leaks</title>
	<atom:link href="http://blog.objectteams.org/2012/01/help-the-jdt-compiler-helping-you-1-resource-leaks/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.objectteams.org/2012/01/help-the-jdt-compiler-helping-you-1-resource-leaks/</link>
	<description>Everthing Object Teams - adding team spirit to your objects.</description>
	<pubDate>Fri, 18 May 2012 09:20:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Help the JDT Compiler helping you! - 3: The essence of null annotations at The Object Teams Blog</title>
		<link>http://blog.objectteams.org/2012/01/help-the-jdt-compiler-helping-you-1-resource-leaks/#comment-36260</link>
		<dc:creator>Help the JDT Compiler helping you! - 3: The essence of null annotations at The Object Teams Blog</dc:creator>
		<pubDate>Mon, 05 Mar 2012 19:05:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=131#comment-36260</guid>
		<description>[...] my little excursion to detecting resource leaks let me return to our favorite bug: [...]</description>
		<content:encoded><![CDATA[<p>[...] my little excursion to detecting resource leaks let me return to our favorite bug: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Help the JDT Compiler helping you! - 2: Resource leaks - continued at The Object Teams Blog</title>
		<link>http://blog.objectteams.org/2012/01/help-the-jdt-compiler-helping-you-1-resource-leaks/#comment-33692</link>
		<dc:creator>Help the JDT Compiler helping you! - 2: Resource leaks - continued at The Object Teams Blog</dc:creator>
		<pubDate>Sat, 04 Feb 2012 20:11:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=131#comment-33692</guid>
		<description>[...] my previous post I showed the basics of a new analysis that I originally introduced in the JDT compiler as of 3.8 M3 [...]</description>
		<content:encoded><![CDATA[<p>[...] my previous post I showed the basics of a new analysis that I originally introduced in the JDT compiler as of 3.8 M3 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://blog.objectteams.org/2012/01/help-the-jdt-compiler-helping-you-1-resource-leaks/#comment-33655</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Sat, 04 Feb 2012 11:18:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=131#comment-33655</guid>
		<description>I added a paragraph for clarification about Buffered* and about the closing of wrapped resources.

Actually, in the example the requested warning against r4 would be useless, because a BufferedReader cannot truncated any file.

In my next post I'll say more about the balance between reporting everything that looks fishy and being shy regarding any possible false positives.</description>
		<content:encoded><![CDATA[<p>I added a paragraph for clarification about Buffered* and about the closing of wrapped resources.</p>
<p>Actually, in the example the requested warning against r4 would be useless, because a BufferedReader cannot truncated any file.</p>
<p>In my next post I&#8217;ll say more about the balance between reporting everything that looks fishy and being shy regarding any possible false positives.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Stanchfield</title>
		<link>http://blog.objectteams.org/2012/01/help-the-jdt-compiler-helping-you-1-resource-leaks/#comment-33110</link>
		<dc:creator>Scott Stanchfield</dc:creator>
		<pubDate>Fri, 27 Jan 2012 01:24:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=131#comment-33110</guid>
		<description>While it may not be a resource leak issue, making the distinction in this manner is bound to lead to confusion...

To the user, it seems like the compiler is telling him when he forgot to close a closeable, and they'll likely think they have the "close" logic proper in that example.

I agree that we can't catch everything statically, but this seems like you're making an exception in the more general analysis to rule _out_ a check that would be incredibly helpful.</description>
		<content:encoded><![CDATA[<p>While it may not be a resource leak issue, making the distinction in this manner is bound to lead to confusion&#8230;</p>
<p>To the user, it seems like the compiler is telling him when he forgot to close a closeable, and they&#8217;ll likely think they have the &#8220;close&#8221; logic proper in that example.</p>
<p>I agree that we can&#8217;t catch everything statically, but this seems like you&#8217;re making an exception in the more general analysis to rule _out_ a check that would be incredibly helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://blog.objectteams.org/2012/01/help-the-jdt-compiler-helping-you-1-resource-leaks/#comment-33077</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Thu, 26 Jan 2012 16:03:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=131#comment-33077</guid>
		<description>@Scott: thanks, that is a very valid point. 

However, it is not a point to be considered for leak analysis, or am I missing anything?

We don't certify correct program behavior, just absence of a very specific kind of problem: resource leaks. 

Programs in general are much more complex than any static analysis can digest :)

OTOH, your comment confirms our strategy to always flag resource problems against the top of a resource wrapper chain.</description>
		<content:encoded><![CDATA[<p>@Scott: thanks, that is a very valid point. </p>
<p>However, it is not a point to be considered for leak analysis, or am I missing anything?</p>
<p>We don&#8217;t certify correct program behavior, just absence of a very specific kind of problem: resource leaks. </p>
<p>Programs in general are much more complex than any static analysis can digest <img src='http://blog.objectteams.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>OTOH, your comment confirms our strategy to always flag resource problems against the top of a resource wrapper chain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Stanchfield</title>
		<link>http://blog.objectteams.org/2012/01/help-the-jdt-compiler-helping-you-1-resource-leaks/#comment-33074</link>
		<dc:creator>Scott Stanchfield</dc:creator>
		<pubDate>Thu, 26 Jan 2012 15:30:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=131#comment-33074</guid>
		<description>Closing wrappers is more complex than you may be thinking. Consider that many wrappers actually buffer content (most obviously the ones that start with "Buffered")... If you don't close (or flush) them, the content may not be passed to the wrapped stream.

In your example, anything written to r4 gets buffered before being written to r3. If r4 isn't flushed or closed, r3 will likely not have received all of the content that was written to r4 (unless the last data written to r4 happens to exactly hit the buffer boundry). Closing r3 effectively truncates the data.

Please rethink the handling of stream decorators like these...</description>
		<content:encoded><![CDATA[<p>Closing wrappers is more complex than you may be thinking. Consider that many wrappers actually buffer content (most obviously the ones that start with &#8220;Buffered&#8221;)&#8230; If you don&#8217;t close (or flush) them, the content may not be passed to the wrapped stream.</p>
<p>In your example, anything written to r4 gets buffered before being written to r3. If r4 isn&#8217;t flushed or closed, r3 will likely not have received all of the content that was written to r4 (unless the last data written to r4 happens to exactly hit the buffer boundry). Closing r3 effectively truncates the data.</p>
<p>Please rethink the handling of stream decorators like these&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

