<?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: A use case for Java 7</title>
	<atom:link href="http://blog.objectteams.org/2011/06/a-use-case-for-java-7/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.objectteams.org/2011/06/a-use-case-for-java-7/</link>
	<description>Everthing Object Teams - adding team spirit to your objects.</description>
	<pubDate>Fri, 18 May 2012 09:16:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Help the JDT Compiler helping you! - 1: Resource Leaks at The Object Teams Blog</title>
		<link>http://blog.objectteams.org/2011/06/a-use-case-for-java-7/#comment-33072</link>
		<dc:creator>Help the JDT Compiler helping you! - 1: Resource Leaks at The Object Teams Blog</dc:creator>
		<pubDate>Thu, 26 Jan 2012 14:32:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=111#comment-33072</guid>
		<description>[...] the JDT team was finishing up work on the new try-with-resources statement introduced in Java 7. So I was thinking: shouldn&#8217;t the compiler help users to migrate from notoriously brittle handling of resources [...]</description>
		<content:encoded><![CDATA[<p>[...] the JDT team was finishing up work on the new try-with-resources statement introduced in Java 7. So I was thinking: shouldn&#8217;t the compiler help users to migrate from notoriously brittle handling of resources [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://blog.objectteams.org/2011/06/a-use-case-for-java-7/#comment-17990</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Tue, 14 Jun 2011 22:51:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=111#comment-17990</guid>
		<description>"Best thing to do is contact the main developer on FindBugs and start a dialog there."

I tried to contact William Pugh regarding null annotations, but never got an answer. Others have reported the similarly.

"I would love to see more complete static code anlaysis in eclipse"

I'm trying to help here and there. Do you have any particular checks in mind? The big rule for JDT is, however, all analyses must be fast and general.

"and in particular known issues turned on by default."

I agree.</description>
		<content:encoded><![CDATA[<p>&#8220;Best thing to do is contact the main developer on FindBugs and start a dialog there.&#8221;</p>
<p>I tried to contact William Pugh regarding null annotations, but never got an answer. Others have reported the similarly.</p>
<p>&#8220;I would love to see more complete static code anlaysis in eclipse&#8221;</p>
<p>I&#8217;m trying to help here and there. Do you have any particular checks in mind? The big rule for JDT is, however, all analyses must be fast and general.</p>
<p>&#8220;and in particular known issues turned on by default.&#8221;</p>
<p>I agree.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://blog.objectteams.org/2011/06/a-use-case-for-java-7/#comment-17988</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Tue, 14 Jun 2011 22:42:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=111#comment-17988</guid>
		<description>Coming back to the original topic of my post: I think try-with-resources is actually a useful addition to the language, because it helps you to be more explicit by saying: "this block is responsible for the given resources". This helps connecting intent with enforcement, so we can write better code right away. And the occasion has shown the relevance of this particular kind of problem.

In this context analysis tools can help us stay on track, no more, no less.</description>
		<content:encoded><![CDATA[<p>Coming back to the original topic of my post: I think try-with-resources is actually a useful addition to the language, because it helps you to be more explicit by saying: &#8220;this block is responsible for the given resources&#8221;. This helps connecting intent with enforcement, so we can write better code right away. And the occasion has shown the relevance of this particular kind of problem.</p>
<p>In this context analysis tools can help us stay on track, no more, no less.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Carver</title>
		<link>http://blog.objectteams.org/2011/06/a-use-case-for-java-7/#comment-17986</link>
		<dc:creator>David Carver</dc:creator>
		<pubDate>Tue, 14 Jun 2011 22:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=111#comment-17986</guid>
		<description>Best thing to do is contact the main developer on FindBugs and start a dialog there.  I know he's run his tools against the eclipse code base.  Also there is a FindBugs plugin that you can use to run it locally within eclipse, so you can do some comparisons that way.

I would love to see more complete static code anlaysis in eclipse, and in particular known issues turned on by default.</description>
		<content:encoded><![CDATA[<p>Best thing to do is contact the main developer on FindBugs and start a dialog there.  I know he&#8217;s run his tools against the eclipse code base.  Also there is a FindBugs plugin that you can use to run it locally within eclipse, so you can do some comparisons that way.</p>
<p>I would love to see more complete static code anlaysis in eclipse, and in particular known issues turned on by default.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://blog.objectteams.org/2011/06/a-use-case-for-java-7/#comment-17985</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Tue, 14 Jun 2011 22:15:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=111#comment-17985</guid>
		<description>Stating that "every case it has detected for my use cases has been exactly correct" doesn't really say much about completeness :)

OTOH I know that tools specialized just in static analysis can of course detect more problems than a compiler.

I was just curious to learn *how* much deeper they look. E.g., what if a reference to an InputStream is passed around from one method to another? Normally it would take s.t. like annotations to express which method is responsible. In the academic world people talk of ownership models for expressing things like that.</description>
		<content:encoded><![CDATA[<p>Stating that &#8220;every case it has detected for my use cases has been exactly correct&#8221; doesn&#8217;t really say much about completeness <img src='http://blog.objectteams.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>OTOH I know that tools specialized just in static analysis can of course detect more problems than a compiler.</p>
<p>I was just curious to learn *how* much deeper they look. E.g., what if a reference to an InputStream is passed around from one method to another? Normally it would take s.t. like annotations to express which method is responsible. In the academic world people talk of ownership models for expressing things like that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Carver</title>
		<link>http://blog.objectteams.org/2011/06/a-use-case-for-java-7/#comment-17981</link>
		<dc:creator>David Carver</dc:creator>
		<pubDate>Tue, 14 Jun 2011 21:57:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=111#comment-17981</guid>
		<description>It's pretty complete in detecting the cases.  It is a byte code interpreter, but so far every case it has detected for my use cases has been exactly correct.

Compared to what FindBugs and PMD detect, the JDT compiler is way behind.</description>
		<content:encoded><![CDATA[<p>It&#8217;s pretty complete in detecting the cases.  It is a byte code interpreter, but so far every case it has detected for my use cases has been exactly correct.</p>
<p>Compared to what FindBugs and PMD detect, the JDT compiler is way behind.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://blog.objectteams.org/2011/06/a-use-case-for-java-7/#comment-17967</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Tue, 14 Jun 2011 18:12:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=111#comment-17967</guid>
		<description>@David: You might have noticed: the JDT compiler, too, is a static code analysis tool :), just developed with more emphasis on performance ("performed on each keystroke") than on completeness of analyses.

That said: can you report how complete FindBugs is wrt detecting not-closed streams? What if the reference to the stream is shared by many, as sp8472 mentioned?

My motivation for pushing some of these things into the JDT compiler is twofold: (1) for more immediate feedback, always, without the need to install additional tooling. (2) for optimal integration with quickfixes. This holds for un-closed resources, null-related problems, unused objects and things like that.</description>
		<content:encoded><![CDATA[<p>@David: You might have noticed: the JDT compiler, too, is a static code analysis tool :), just developed with more emphasis on performance (&#8221;performed on each keystroke&#8221;) than on completeness of analyses.</p>
<p>That said: can you report how complete FindBugs is wrt detecting not-closed streams? What if the reference to the stream is shared by many, as sp8472 mentioned?</p>
<p>My motivation for pushing some of these things into the JDT compiler is twofold: (1) for more immediate feedback, always, without the need to install additional tooling. (2) for optimal integration with quickfixes. This holds for un-closed resources, null-related problems, unused objects and things like that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Carver</title>
		<link>http://blog.objectteams.org/2011/06/a-use-case-for-java-7/#comment-17966</link>
		<dc:creator>David Carver</dc:creator>
		<pubDate>Tue, 14 Jun 2011 17:47:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=111#comment-17966</guid>
		<description>You should also consider running static code anlysis tools like FindBugs.  It'll catch the situations where you are not closing your streams.</description>
		<content:encoded><![CDATA[<p>You should also consider running static code anlysis tools like FindBugs.  It&#8217;ll catch the situations where you are not closing your streams.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://blog.objectteams.org/2011/06/a-use-case-for-java-7/#comment-17964</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Tue, 14 Jun 2011 17:27:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=111#comment-17964</guid>
		<description>@sp8472: First, yes, the ability to use @SuppressWarnings is precondition to making this RFE useful in practise.

But each time you use @SuppressWarnings it should make you think: I'm leaving the grounds where the compiler can help me. Perhaps I should restructure my code?

If a reference is handed around to too many folks it's just as in real life: all responsibility will just diffuse, everybody will expect "someone else" will take care. In this regard too much freedom will get us nowhere.

So the new construct should actually push you towards a design where for each resource indeed one method is in charge (if this is not already the case). In the RFE I already elaborated a bit on how the analysis could detect, which method this is supposed to be.

makes sense?</description>
		<content:encoded><![CDATA[<p>@sp8472: First, yes, the ability to use @SuppressWarnings is precondition to making this RFE useful in practise.</p>
<p>But each time you use @SuppressWarnings it should make you think: I&#8217;m leaving the grounds where the compiler can help me. Perhaps I should restructure my code?</p>
<p>If a reference is handed around to too many folks it&#8217;s just as in real life: all responsibility will just diffuse, everybody will expect &#8220;someone else&#8221; will take care. In this regard too much freedom will get us nowhere.</p>
<p>So the new construct should actually push you towards a design where for each resource indeed one method is in charge (if this is not already the case). In the RFE I already elaborated a bit on how the analysis could detect, which method this is supposed to be.</p>
<p>makes sense?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sp8472</title>
		<link>http://blog.objectteams.org/2011/06/a-use-case-for-java-7/#comment-17961</link>
		<dc:creator>sp8472</dc:creator>
		<pubDate>Tue, 14 Jun 2011 17:05:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.objectteams.org/?p=111#comment-17961</guid>
		<description>And what if you're reading only part of the output stream, and other clients will read the remainder? Then someone else has the responsibility of closing it... So perhaps this would need a @SuppressWarnings for such cases? Of course, once you add one of those, then it can no longer detect that you actually close it in another client...</description>
		<content:encoded><![CDATA[<p>And what if you&#8217;re reading only part of the output stream, and other clients will read the remainder? Then someone else has the responsibility of closing it&#8230; So perhaps this would need a @SuppressWarnings for such cases? Of course, once you add one of those, then it can no longer detect that you actually close it in another client&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

