<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>A Concurrent Affair &#187; DrJava</title>
	<atom:link href="http://www.concurrentaffair.org/category/drjava/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.concurrentaffair.org</link>
	<description>a blog about Mathias&#039; work and play.</description>
	<lastBuildDate>Fri, 20 Jan 2012 23:04:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>DrJava DefinitionsPaneMemoryLeakTest fails on Mac</title>
		<link>http://www.concurrentaffair.org/2011/11/14/drjava-definitionspanememoryleaktest-fails-on-mac/</link>
		<comments>http://www.concurrentaffair.org/2011/11/14/drjava-definitionspanememoryleaktest-fails-on-mac/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 06:28:38 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2735</guid>
		<description><![CDATA[I submitted a bugfix for a problem with the debug panel when no debugger is available. I noticed that on the Mac, the DefinitionsPaneMemoryLeakTest now fails: 1234567891011121314151617181920212223242526&#160; &#160;[junit] DefinitionsPaneMemoryLeakTest &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;26.92 sec &#160; &#160;[junit] &#8230; <a href="http://www.concurrentaffair.org/2011/11/14/drjava-definitionspanememoryleaktest-fails-on-mac/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I submitted a <a href="https://sourceforge.net/tracker/?func=detail&#038;aid=3436749&#038;group_id=44253&#038;atid=438935">bugfix for a problem with the debug panel when no
debugger is available</a>.</p>

<p>I noticed that on the Mac, the DefinitionsPaneMemoryLeakTest now
fails:</p>

<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp;[junit] DefinitionsPaneMemoryLeakTest &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;26.92 sec<br />
&nbsp; &nbsp;[junit] Testsuite: edu.rice.cs.drjava.ui.DefinitionsPaneMemoryLeakTest<br />
&nbsp; &nbsp;[junit] Tests run: 1, Failures: 1, Errors: 0<br />
&nbsp; &nbsp;[junit] ------------- Standard Error -----------------<br />
&nbsp; &nbsp;[junit] Skipped analysing class java.security.ProtectionDomain<br />
because of java.lang.AssertionError<br />
&nbsp; &nbsp;[junit] ------------- ---------------- ---------------<br />
&nbsp; &nbsp;[junit] Testcase:<br />
testDocumentPaneMemoryLeak(edu.rice.cs.drjava.ui.DefinitionsPaneMemoryLeakTest): &nbsp; &nbsp; &nbsp; &nbsp;FAILED<br />
&nbsp; &nbsp;[junit] Document 0 leaked:<br />
&nbsp; &nbsp;[junit] private static sun.awt.AppContext<br />
sun.awt.AppContext.mainAppContext-&gt;<br />
&nbsp; &nbsp;[junit] sun.awt.AppContext@4998a455-table-&gt;<br />
&nbsp; &nbsp;[junit] java.util.HashMap@7f1bfcfc-table-&gt;<br />
<br />
...<br />
<br />
&nbsp; &nbsp;[junit] [Ljava.beans.PropertyChangeListener;@67b50846-[373]-&gt;<br />
&nbsp; &nbsp;[junit] javax.swing.JViewport$1@7ceade87-this$0-&gt;<br />
&nbsp; &nbsp;[junit] javax.swing.JViewport@48be3a5e-component-&gt;<br />
&nbsp; &nbsp;[junit] java.util.ArrayList@6b333f77-elementData-&gt;<br />
&nbsp; &nbsp;[junit] [Ljava.lang.Object;@559b52d3-[0]-&gt;<br />
&nbsp; &nbsp;[junit] edu.rice.cs.drjava.ui.DefinitionsPane@2a38d0a8-_doc-&gt;<br />
&nbsp; &nbsp;[junit] edu.rice.cs.drjava.model.DefaultGlobalModel$ConcreteOpenDefDoc@557e5cbd<br />
&nbsp; &nbsp;[junit] &nbsp; &nbsp; at<br />
org.netbeans.test.MemoryTestUtils.assertGC(MemoryTestUtils.java:137)</div></td></tr></tbody></table></div>

<p>It passes on Windows, and I haven&#8217;t tried it on Linux. I rolled
back as far as revision 5266, which was from June 3, 2010, and it was
still failing on the Mac. I have a feeling that something must have
changed in Mac OS (Lion) or the Java version I have running
(1.6.0_29). I know I&#8217;ve successfully run the unit tests many times
since then on the Mac, even on my MacBook Pro. I even think I have run
them successfully on Mac OS Lion.</p>

<p>It would be great if I could still run the unit tests on an older Mac, with an older Mac OS. I&#8217;ll dig into this, but it may take some time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2011/11/14/drjava-definitionspanememoryleaktest-fails-on-mac/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Better Number Highlighting in DrJava More Difficult</title>
		<link>http://www.concurrentaffair.org/2011/09/29/better-number-highlighting-in-drjava-more-difficult/</link>
		<comments>http://www.concurrentaffair.org/2011/09/29/better-number-highlighting-in-drjava-more-difficult/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 06:58:00 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2697</guid>
		<description><![CDATA[Getting the lexing right for the syntax highlighting will be a little bit more work than I thought. Right now, DrJava tokenizes numbers like 3.14 separately as &#8220;3&#8243; &#8220;.&#8221; &#8220;14&#8243;, and then it highlights &#8220;3&#8243; and &#8220;14&#8243; as numbers. That &#8230; <a href="http://www.concurrentaffair.org/2011/09/29/better-number-highlighting-in-drjava-more-difficult/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Getting the lexing right for the syntax highlighting will be a little
bit more work than I thought. Right now, DrJava tokenizes numbers like
3.14 separately as &#8220;3&#8243; &#8220;.&#8221; &#8220;14&#8243;, and then it highlights &#8220;3&#8243; and &#8220;14&#8243;
as numbers. That approach never was quite right, but I think it gets
even uglier with the new literals.</p>

<p>I&#8217;m continuing the process of giving the compiler adapters more
responsibility. The first step that I made for supporting HJ and Mint
was to put the list of keywords into the adapters. I was now going to
put the highlight determination into the adapters, but it seems like I
may have to put tokenization there as well.</p>

<p>Of course, that fits well with plans of eventually supporting more languages, and languages that differ more.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2011/09/29/better-number-highlighting-in-drjava-more-difficult/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Additional Java 5 Syntax Highlighting Errors in DrJava</title>
		<link>http://www.concurrentaffair.org/2011/09/27/additional-java-5-syntax-highlighting-errors-in-drjava/</link>
		<comments>http://www.concurrentaffair.org/2011/09/27/additional-java-5-syntax-highlighting-errors-in-drjava/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 16:15:42 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2690</guid>
		<description><![CDATA[While adding syntax highlighting for underscores and binary literals introduced in Java 7 to DrJava, I discovered that a few other numbers aren&#8217;t syntax-highlighted correctly. Some of these problems go back to the beginning of Java, others go back to &#8230; <a href="http://www.concurrentaffair.org/2011/09/27/additional-java-5-syntax-highlighting-errors-in-drjava/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While adding <a href="https://sourceforge.net/tracker/?func=detail&#038;aid=3404387&#038;group_id=44253&#038;atid=438935">syntax highlighting for underscores and binary literals introduced in Java 7</a> to <a href="http://drjava.org/">DrJava</a>, I discovered that a few other numbers aren&#8217;t syntax-highlighted correctly. Some of these problems go back to the beginning of Java, others go back to Java 5, when the obscure hexadecimal floating-point literal was introduced.</p>

<p>Here are the numbers that give DrJava&#8217;s syntax highlighter trouble:</p>

<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight: bold;">float</span> f <span style="color: #339933;">=</span> 6.022137e<span style="color: #339933;">+</span>23f<span style="color: #339933;">;</span><br />
f <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2</span>.<span style="color: #006633;">f</span><span style="color: #339933;">;</span><br />
f <span style="color: #339933;">=</span> .3f<span style="color: #339933;">;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">double</span> d <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2</span>.<span style="color: #339933;">;</span><br />
d <span style="color: #339933;">=</span> .3<span style="color: #339933;">;</span><br />
d <span style="color: #339933;">=</span> 1e<span style="color: #339933;">-</span>9d<span style="color: #339933;">;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">double</span> x <span style="color: #339933;">=</span> 0x1.8p1<span style="color: #339933;">;</span><br />
x <span style="color: #339933;">=</span> 0x1.<span style="color: #006633;">fffffffffffffp1023</span><span style="color: #339933;">;</span><br />
x <span style="color: #339933;">=</span> 0x1.0P<span style="color: #339933;">-</span><span style="color: #cc66cc;">1074</span><span style="color: #339933;">;</span><br />
x <span style="color: #339933;">=</span> 0x0.0000000000001P<span style="color: #339933;">-</span><span style="color: #cc66cc;">1022</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>

<p>Did you know about these hexadecimal floating-point literals? I didn&#8217;t.</p>

<p>I created a <a href="https://sourceforge.net/tracker/?func=detail&#038;aid=3414514&#038;group_id=44253&#038;atid=438935">bug report for these Java 5 highlighting bugs</a>.</p>

<p>References:</p>

<ul>
    <li><a href="http://download.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html">Underscores in Numeric Literals</a></li>
    <li><a href="http://download.oracle.com/javase/7/docs/technotes/guides/language/binary-literals.html">Binary Literals</a></li>
    <li><a href="http://blogs.oracle.com/darcy/entry/hexadecimal_floating_point_literals">Hexadecimal Floating Point Literals</a></li>
    <li><a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#48272">Java 5 Literals</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2011/09/27/additional-java-5-syntax-highlighting-errors-in-drjava/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Suggestions for Better Java 7 Support in DrJava</title>
		<link>http://www.concurrentaffair.org/2011/09/04/suggestions-for-better-java-7-support-in-drjava/</link>
		<comments>http://www.concurrentaffair.org/2011/09/04/suggestions-for-better-java-7-support-in-drjava/#comments</comments>
		<pubDate>Sun, 04 Sep 2011 19:43:00 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2655</guid>
		<description><![CDATA[I just looked through the new language features in Java 7, and experimented with them in DrJava. None of the changes are supported in the Interactions Pane, and there will be a lot of required work to make these things &#8230; <a href="http://www.concurrentaffair.org/2011/09/04/suggestions-for-better-java-7-support-in-drjava/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I just looked through the <a href="http://download.oracle.com/javase/7/docs/technotes/guides/language/enhancements.html#javase7">new language features in Java 7</a>, and experimented with them in <a href="http://drjava.org">DrJava</a>.</p>

<p>None of the changes are supported in the Interactions Pane, and there will be a lot of required work to make these things work there. We&#8217;ll have to change the parser, change the type checker, change the interpreter, and so on.</p>

<p>There are, however, smaller changes that we should do to provide better support in the Definitions Pane:</p>

<ol>
    <li>Binary literals <code class="codecolorer java mac-classic"><span class="java"><span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> 0b100000<span style="color: #339933;">;</span></span></code> are not syntax-highlighted correctly.</li>
    <li>Numeric literals with an underscore in them <code class="codecolorer text mac-classic"><span class="text">int i = 1_000; double d = 3.141_5927;</span></code> are not syntax-highlighted correctly.</li>
    <li>In some cases, try-with-resources is indented badly:

<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; <span style="color: #666666; font-style: italic;">// badly indented</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> tryWithResources2<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> f<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">InputStream</span></a> is <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afileinputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">FileInputStream</span></a><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afile+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">File</span></a><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">InputStream</span></a> is2 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afileinputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">FileInputStream</span></a><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afile+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">File</span></a><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;is.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aioexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">IOException</span></a> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>

</li>
</ol>

<p>Everything else looks pretty good. Here&#8217;s the sample class that I used:</p>

<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.*</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.*</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Java7Samples <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; stringSwitch<span style="color: #009900;">&#40;</span>args<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; intSwitch<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a><span style="color: #009900;">&#40;</span>args<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; tryWithResources<span style="color: #009900;">&#40;</span>args<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; tryWithResources2<span style="color: #009900;">&#40;</span>args<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; multiCatch<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a><span style="color: #009900;">&#40;</span>args<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// bad integer syntax highlighting</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> 0b100000<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// bad numeric syntax highlighting</span><br />
&nbsp; &nbsp; i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span>_000_000<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2</span>__000__000<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// int illegal = _1000;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// int illegal2 = 1000_;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">double</span> d <span style="color: #339933;">=</span> <span style="color: #cc66cc;">123</span>_456.789_012<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>d<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> stringSwitch<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> arg<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span><span style="color: #009900;">&#40;</span>arg<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #0000ff;">&quot;one&quot;</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;case one&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #0000ff;">&quot;two&quot;</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #0000ff;">&quot;three&quot;</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;case two or three&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">default</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;default case&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> intSwitch<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> arg<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span><span style="color: #009900;">&#40;</span>arg<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;case 1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;case 2 or 3&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">default</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;default case&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> tryWithResources<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> f<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">InputStream</span></a> is <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afileinputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">FileInputStream</span></a><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afile+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">File</span></a><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; is.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aioexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">IOException</span></a> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #666666; font-style: italic;">// badly indented</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> tryWithResources2<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> f<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">InputStream</span></a> is <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afileinputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">FileInputStream</span></a><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afile+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">File</span></a><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">InputStream</span></a> is2 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afileinputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">FileInputStream</span></a><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afile+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">File</span></a><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;is.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aioexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">IOException</span></a> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">class</span> Ex1 <span style="color: #000000; font-weight: bold;">extends</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aruntimeexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">RuntimeException</span></a> <span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">class</span> Ex2 <span style="color: #000000; font-weight: bold;">extends</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aruntimeexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">RuntimeException</span></a> <span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">class</span> Ex3or4 <span style="color: #000000; font-weight: bold;">extends</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aruntimeexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">RuntimeException</span></a> <span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">class</span> Ex3 <span style="color: #000000; font-weight: bold;">extends</span> Ex3or4 <span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">class</span> Ex4 <span style="color: #000000; font-weight: bold;">extends</span> Ex3or4 <span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> doSomething<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> Ex1, Ex2, Ex3, Ex4 <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> Ex1<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> Ex2<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> Ex3<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> Ex4<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> handleEx1Or2<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aruntimeexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">RuntimeException</span></a> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;handlEx1Or2&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> handleEx3Or4<span style="color: #009900;">&#40;</span>Ex3or4 e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;handlEx3Or4&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> multiCatch<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; doSomething<span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>Ex1 <span style="color: #339933;">|</span> Ex2 ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; handleEx1Or2<span style="color: #009900;">&#40;</span>ex<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>Ex3 <span style="color: #339933;">|</span> Ex4 ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; handleEx3Or4<span style="color: #009900;">&#40;</span>ex<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> multiCatch2<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; doSomething<span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>Ex1 <span style="color: #339933;">|</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Ex2 ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; handleEx1Or2<span style="color: #009900;">&#40;</span>ex<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>Ex3 <span style="color: #339933;">|</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Ex4 ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; handleEx3Or4<span style="color: #009900;">&#40;</span>ex<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> Map<span style="color: #339933;">&lt;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>, String<span style="color: #339933;">&gt;</span> diamond<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> HashMap<span style="color: #339933;">&lt;&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> diamond2<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; Map<span style="color: #339933;">&lt;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>, String<span style="color: #339933;">&gt;</span> map <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HashMap<span style="color: #339933;">&lt;&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>

<p><strong>Update</strong></p>

<p>I filed bugs <a href="https://sourceforge.net/tracker/?func=detail&#038;aid=3404387&#038;group_id=44253&#038;atid=438935">3404387</a> and <a href="https://sourceforge.net/tracker/?func=detail&#038;aid=3404389&#038;group_id=44253&#038;atid=438935">3404389</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2011/09/04/suggestions-for-better-java-7-support-in-drjava/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New DrJava Beta Release: drjava-beta-20110822-r5448</title>
		<link>http://www.concurrentaffair.org/2011/08/23/new-drjava-beta-release-drjava-beta-20110822-r5448/</link>
		<comments>http://www.concurrentaffair.org/2011/08/23/new-drjava-beta-release-drjava-beta-20110822-r5448/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 06:30:09 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2635</guid>
		<description><![CDATA[We have made a new development release available: drjava-beta-20110822-r5448. You can download it from the DrJava website or from SourceForge. Available for download at http://drjava.org. DrJava is a lightweight programming environment for Java designed to foster test-driven software development. It &#8230; <a href="http://www.concurrentaffair.org/2011/08/23/new-drjava-beta-release-drjava-beta-20110822-r5448/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We have made a new development release available: drjava-beta-20110822-r5448. You can download it from the <a href="http://drjava.org">DrJava website</a> or from <a href="https://sourceforge.net/projects/drjava/files/1.%20DrJava%20Stable%20Releases/drjava-beta-20110822-r5448/">SourceForge</a>.</p>

<p>Available for download at <a href="http://drjava.org">http://drjava.org</a>.</p>

<p>DrJava is a lightweight programming environment for Java designed to foster test-driven software development. It includes an intelligent program editor, an interactions pane for evaluating program text, a source level debugger, and a unit testing tool.</p>

<p>In addition to bug fixes, this beta release includes a two new features introduced after the last development release:</p>

<ol>
    <li>The debugger has been revised to interface properly with functional language level files. The source line numbers shown in the debugger now consistently correspond to the source files open in DrJava, even when the source files are language level files. During tracing, line numbers corresponding to augmented code that does not appear in language level files are mapped to -1.</li>
    <li>A compiler adapter for Java 7 has been added to DrJava. Unfortunately, the adapter does not find the Java 7 compiler on Windows unless DrJava is started from a JDK installation rather than a JRE installation. As a result, running this release on Windows with Java 7 will typically invoke the bundled Eclipse Java compiler rather than the Oracle/Sun Java 7 compiler.

Note: Java 1.4 compatibility has been dropped. To use DrJava, you will need Java 5 or newer.</li>
</ol>

<p>New features since the last <beta/development> release:</p>

<ul>
    <li>better integration of the functional languaage level with the debugger</li>
    <li>a Java 7 compiler adapter.</li>
</ul>

<p>Bug fixes since last <beta/development> release:</p>

<ul>
    <li>the code has been revised to more closely conform with the synchronization invariants governing the design.</li>
</ul>

<p>New features since the last stable release:</p>

<ul>
    <li>better integration of the functional languaage level with the debugger</li>
    <li>a Java 7 compiler adapter</li>
    <li>refactored language level</li>
    <li>improved compiler support, including support for Habanero Java</li>
    <li>added support for copying the Compiler Errors pane to clipboard</li>
    <li>preferences like indent level can now be stored on a per-project basis (see &#8220;Project Properties&#8221;, &#8220;Advanced&#8221;).</li>
</ul>

<p>Bug fixes since the last stable release:</p>

<ul>
    <li>the code has been revised to more closely conform with the synchronization invariants governing the design</li>
    <li>applet viewer not started in event thread anymore to avoid exception</li>
    <li>Static type checking for primitive casts in Interactions pane.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2011/08/23/new-drjava-beta-release-drjava-beta-20110822-r5448/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DrJava Now Works Even When Launched with the Java 7 JRE</title>
		<link>http://www.concurrentaffair.org/2011/08/22/drjava-now-works-even-when-launched-with-the-java-7-jre/</link>
		<comments>http://www.concurrentaffair.org/2011/08/22/drjava-now-works-even-when-launched-with-the-java-7-jre/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 05:26:44 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2631</guid>
		<description><![CDATA[I think I&#8217;ve got DrJava working with the Java 7 compiler the way it should, even when started with the JRE (as long as the JDK is installed as well). That was the situation that both Corky and I got &#8230; <a href="http://www.concurrentaffair.org/2011/08/22/drjava-now-works-even-when-launched-with-the-java-7-jre/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I think I&#8217;ve got DrJava working with the Java 7 compiler the way it should, even when started with the JRE (as long as the JDK is installed as well). That was the situation that both Corky and I got into when we double-clicked on DrJava.</p>

<p>Please give the weekly build <a href="http://www.cs.rice.edu/~javaplt/drjavarice/weekly/files/drjava-weekly-20110822-r5448.jar">drjava-weekly-20110822-r5448.jar</a> a shot.</p>

<p>In the original JDK7 compiler adapter, I followed the instructions and
used the <code class="codecolorer java mac-classic"><span class="java">javax.<span style="color: #006633;">tools</span>.<span style="color: #006633;">ToolProvider</span>.<span style="color: #006633;">getSystemJavaCompiler</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></span></code> method to get the Java compiler. Unfortunately, when a user starts DrJava with
the JRE, the tools.jar file is not on the boot classpath, and the <code class="codecolorer java mac-classic"><span class="java">getSystemJavaCompiler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></span></code> method will not find the
<code class="codecolorer java mac-classic"><span class="java">com.<span style="color: #006633;">sun</span>.<span style="color: #006633;">tools</span>.<span style="color: #006633;">javac</span>.<span style="color: #006633;">api</span>.<span style="color: #006633;">JavacTool</span></span></code> class, even when we later provide the tools.jar file to the class loader. The <code class="codecolorer java mac-classic"><span class="java">javax.<span style="color: #006633;">tools</span></span></code> package cannot be shadowed, so we can&#8217;t load one version of it for one compiler and a different version for another compiler.</p>

<p>Instead of using <code class="codecolorer java mac-classic"><span class="java">ToolProvider</span></code>, I now do a
<code class="codecolorer java mac-classic"><span class="java"><span style="color: #000000; font-weight: bold;">Class</span>.<span style="color: #006633;">forName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;com.sun.tools.javac.api.JavacTool&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></span></code> directly. That&#8217;s exactly what <code class="codecolorer java mac-classic"><span class="java">ToolProvider</span></code> is doing too, but we can shadow the <code class="codecolorer java mac-classic"><span class="java">com.<span style="color: #006633;">sun</span>.<span style="color: #006633;">tools</span>.<span style="color: #006633;">javac</span>.<span style="color: #339933;">*</span></span></code> packages and have control over the classloader.</p>

<p>I&#8217;m sorry that it took this long. I had a long day on Friday and I&#8217;m on call this coming week; I wanted to make sure I have time to goof off and enjoy the beautiful weather this weekend.</p>

<p>If other issues come up, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2011/08/22/drjava-now-works-even-when-launched-with-the-java-7-jre/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java 7 for DrJava and Concutest</title>
		<link>http://www.concurrentaffair.org/2011/08/01/java-7-for-drjava-and-concutest/</link>
		<comments>http://www.concurrentaffair.org/2011/08/01/java-7-for-drjava-and-concutest/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 15:58:49 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[Concurrent Unit Testing]]></category>
		<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/2011/08/01/java-7-for-drjava-and-concutest/</guid>
		<description><![CDATA[I worked on Java 7 support this weekend, and I&#8217;m almost done. I just discovered that Concutest is currently incompatible with Java 7, though, so I will need to disable the ConcJUnit option in DrJava when using Java 7. I &#8230; <a href="http://www.concurrentaffair.org/2011/08/01/java-7-for-drjava-and-concutest/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I worked on Java 7 support this weekend, and I&#8217;m almost done. I just discovered that Concutest is currently incompatible with Java 7, though, so I will need to disable the ConcJUnit option in DrJava when using Java 7. I also need to test on Mac and Linux.</p>

<p>I&#8217;ll try to finish this tonight so we can get a beta out. Or should we release a stable version without this code?</p>

<p>Fixing Concutest will take a bit longer, of course.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2011/08/01/java-7-for-drjava-and-concutest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yes, DrJava Works under Mac OS X 10.7 Lion</title>
		<link>http://www.concurrentaffair.org/2011/07/28/yes-drjava-works-under-mac-os-x-10-7-lion/</link>
		<comments>http://www.concurrentaffair.org/2011/07/28/yes-drjava-works-under-mac-os-x-10-7-lion/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 07:29:52 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2612</guid>
		<description><![CDATA[I just upgraded to Mac OS X 10.7, and DrJava works flawlessly. The one vague report that someone had filed therefore proved to be wrong. When I started DrJava the first time, Mac OS X asked me if I wanted &#8230; <a href="http://www.concurrentaffair.org/2011/07/28/yes-drjava-works-under-mac-os-x-10-7-lion/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I just upgraded to Mac OS X 10.7, and DrJava works flawlessly. The one <a href="http://www.concurrentaffair.org/2011/07/23/does-drjava-work-on-mac-os-x-lion/">vague report that someone had filed</a> therefore proved to be wrong.</p>

<p>When I started DrJava the first time, Mac OS X asked me if I wanted to
download a Java runtime environment. I said yes. The JRE was
downloaded and installed, and after that, DrJava opened.</p>

<p>I&#8217;m still not sure about Mac OS X Lion, but I continue to be excited about DrJava:</p>

<div id="attachment_2613" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.concurrentaffair.org/wp-content/uploads/2011/07/DrJavaMacOSXLion.jpg"><img src="http://www.concurrentaffair.org/wp-content/uploads/2011/07/DrJavaMacOSXLion-1024x640.jpg" alt="DrJava on Mac OS X Lion" title="DrJavaMacOSXLion" width="640" height="400" class="size-large wp-image-2613" /></a><p class="wp-caption-text">DrJava on Mac OS X Lion</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2011/07/28/yes-drjava-works-under-mac-os-x-10-7-lion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Does DrJava Work on Mac OS X Lion?</title>
		<link>http://www.concurrentaffair.org/2011/07/23/does-drjava-work-on-mac-os-x-lion/</link>
		<comments>http://www.concurrentaffair.org/2011/07/23/does-drjava-work-on-mac-os-x-lion/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 22:17:43 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2597</guid>
		<description><![CDATA[We were just informed of an entry on RoaringApps indicating that DrJava does not work on Mac OS X Lion. Is that the case? We don&#8217;t know at this time. DrJava has always worked on previous versions of Mac OS &#8230; <a href="http://www.concurrentaffair.org/2011/07/23/does-drjava-work-on-mac-os-x-lion/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We were just informed of an entry on <a href="http://roaringapps.com/app:2268#post-2095">RoaringApps</a> indicating that <a href="http://drjava.org/">DrJava</a> does not work on Mac OS X Lion.</p>

<p>Is that the case? We don&#8217;t know at this time. DrJava has always worked on previous versions of Mac OS X, but we haven&#8217;t had the opportunity to test it on Mac OS X Lion. If you have Mac OS X Lion, could you please download and run DrJava and corroborate the information?</p>

<p>Thanks!</p>

<p><strong>Update</strong></p>

<p>Yes, it does work! DrJava works flawlessly in Mac OS X 10.7 Lion.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2011/07/23/does-drjava-work-on-mac-os-x-lion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Two DrJava Tutorials on YouTube</title>
		<link>http://www.concurrentaffair.org/2011/07/11/two-drjava-tutorials-on-youtube/</link>
		<comments>http://www.concurrentaffair.org/2011/07/11/two-drjava-tutorials-on-youtube/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 05:55:05 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2587</guid>
		<description><![CDATA[On YouTube, I found two tutorial series that describe DrJava: DrJava &#8211; Easy to use java editor (We will use this in our Java Tutorial) DrJava &#8211; The &#8220;Interaction Pane&#8221; Overview and Introductory tour of DrJava 2nd DrJava Tutorial &#8211; &#8230; <a href="http://www.concurrentaffair.org/2011/07/11/two-drjava-tutorials-on-youtube/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>On YouTube, I found two tutorial series that describe DrJava:</p>

<ol>
    <li><a href="http://www.youtube.com/watch?v=7X3PeVq5DS8">DrJava &#8211; Easy to use java editor (We will use this in our Java Tutorial)</a></li>
    <li><a href="http://www.youtube.com/watch?v=3SrfEag_CwI">DrJava &#8211; The &#8220;Interaction Pane&#8221; Overview</a></li>
</ol>

<p>and</p>

<ol>
    <li><a href="http://www.youtube.com/watch?v=hoxs8pnic_0&#038;feature=related">Introductory tour of DrJava</a>
</li>
    <li><a href="http://www.youtube.com/watch?v=1IB26Jcy_nE&#038;feature=related">2nd DrJava Tutorial &#8211; Using Interactions Pane to Investigate How Java Handles Numbers</a>
</li>
    <li><a href="http://www.youtube.com/watch?v=GuHe6LAwfbM&#038;feature=related">3rd Tutorial &#8211; How to write a java program finding the area of a circle </a>
</li>
</ol>

<p>Neither of them covers very advanced topics, but I&#8217;m always happy to hear that beginners choose DrJava. It&#8217;s the primary audience for our IDE.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2011/07/11/two-drjava-tutorials-on-youtube/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PPPJ 2011 Tool Paper Accepted</title>
		<link>http://www.concurrentaffair.org/2011/06/26/pppj-2011-tool-paper-accepted/</link>
		<comments>http://www.concurrentaffair.org/2011/06/26/pppj-2011-tool-paper-accepted/#comments</comments>
		<pubDate>Sun, 26 Jun 2011 07:24:01 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2580</guid>
		<description><![CDATA[A while ago I worked on a paper together with Vivek, Corky, Vincent, Jared and Raghavan at Rice. We still have to make some final revisions, but I&#8217;m happy to report that our tool paper &#8220;DrHJ &#8212; a lightweight pedagogic &#8230; <a href="http://www.concurrentaffair.org/2011/06/26/pppj-2011-tool-paper-accepted/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.concurrentaffair.org/2011/05/20/working-on-yet-another-flight/">A while ago</a> I worked on a paper together with Vivek, Corky, Vincent, Jared and Raghavan at Rice. We still have to make some final revisions, but I&#8217;m happy to report that our tool paper &#8220;DrHJ &mdash; a lightweight pedagogic IDE for Habanero Java&#8221; has been accepted to <a href="http://pppj2011.imm.dtu.dk/">PPPJ 2011</a> in Denmark.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2011/06/26/pppj-2011-tool-paper-accepted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse Has Messed with My Shortcut-fu for DrJava</title>
		<link>http://www.concurrentaffair.org/2011/06/12/eclipse-has-messed-with-my-shortcut-fu-for-drjava/</link>
		<comments>http://www.concurrentaffair.org/2011/06/12/eclipse-has-messed-with-my-shortcut-fu-for-drjava/#comments</comments>
		<pubDate>Sun, 12 Jun 2011 07:36:22 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2568</guid>
		<description><![CDATA[Working with Eclipse for nearly half a year has definitely messed with my shortcut-fu for DrJava. I keep pressing the wrong buttons now: Very confusing indeed. I decided to pick up working on this file I/O bug in DrJava again, &#8230; <a href="http://www.concurrentaffair.org/2011/06/12/eclipse-has-messed-with-my-shortcut-fu-for-drjava/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Working with Eclipse for nearly half a year has definitely messed with my shortcut-fu for DrJava. I keep pressing the wrong buttons now:</p>


<table id="wp-table-reloaded-id-2-no-1" class="wp-table-reloaded wp-table-reloaded-id-2">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Function</th><th class="column-2">Eclipse</th><th class="column-3">DrJava</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">Go to class under cursor</td><td class="column-2">F3</td><td class="column-3">F6</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">Go to class</td><td class="column-2">Ctrl-Shift-T</td><td class="column-3">Ctrl-Shift-G</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">Run unit tests</td><td class="column-2">F11 / Ctrl-F11</td><td class="column-3">Ctrl-Shift-T</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">Find next</td><td class="column-2">Ctrl-K</td><td class="column-3">F3</td>
	</tr>
</tbody>
</table>


<p><br/>Very confusing indeed.</p>

<p>I decided to pick up working on this <a href="https://sourceforge.net/tracker/index.php?func=detail&#038;aid=3192492&#038;group_id=44253&#038;atid=438935">file I/O bug</a> in DrJava again, though, and I verified that the <a href="https://sourceforge.net/tracker/index.php?func=detail&#038;aid=3298398&#038;group_id=44253&#038;atid=438935">font dialog in Windows 7 is verifiable problematic</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2011/06/12/eclipse-has-messed-with-my-shortcut-fu-for-drjava/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DrJava Is Virus-Free</title>
		<link>http://www.concurrentaffair.org/2011/03/08/drjava-is-virus-free/</link>
		<comments>http://www.concurrentaffair.org/2011/03/08/drjava-is-virus-free/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 08:05:29 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2518</guid>
		<description><![CDATA[Today, Ian Barland informed me that someone on the AP-CS mailing list believed he found a virus in DrJava. Let me reassure you, if you download from drjava.org or SourceForge, our software is virus-free. We build on Linux or Mac &#8230; <a href="http://www.concurrentaffair.org/2011/03/08/drjava-is-virus-free/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today, Ian Barland informed me that someone on the AP-CS mailing list believed he found a virus in DrJava. Let me reassure you, if you download from <a href="http://drjava.org">drjava.org</a> or <a href="http://sourceforge.net/projects/drjava/">SourceForge</a>, our software is virus-free. We build on Linux or Mac systems and only test on Windows, which makes a virus infection even less likely.</p>

<p>Our software has also been independently certified as clean by hosting
providers such as <a href="http://www.downloadroute.com/DrJava-DrJava-Team/antivirus_report.html">DowloadRoute</a>, <a href="http://www.dodownload.com/av-report/drjava.html">DoDownload</a>,
<a href="http://www.geardownload.com/development/drjava.html">GearDownload</a>,
and <a href="http://www.downloadatlas.com/open-source-50522018.html">DownloadAtlas</a>. We even got this clunky award images:</p>

<div><a href="http://www.downloadroute.com/DrJava-DrJava-Team.html"><img src="http://www.concurrentaffair.org/wp-content/uploads/2011/03/downloadroute.png" alt="DrJava is Certified by DownloadRoute.com" border="0"></a><br /><a href="http://www.downloadroute.com/DrJava-DrJava-Team.html"><small>DrJava download test: PASSED</small></a></div>

<div><a href="http://www.downloadroute.com/"><img src="http://www.concurrentaffair.org/wp-content/uploads/2011/03/downloadroute_editorspick.png" style="border:none;" width="70" height="70" alt="DrJava download"></a></div>

<p><a href="http://www.dodownload.com/web+building/java+sun/drjava.html"><img src="http://www.concurrentaffair.org/wp-content/uploads/2011/03/dodownload.png" alt="Safe DrJava file" border="0"></a></p>

<div><a href="http://www.downloadatlas.com/open-source-50522018.html"><img src="http://www.concurrentaffair.org/wp-content/uploads/2011/03/downloadatlas.png" style="border:none;" width="160" height="114" alt="DrJava is clean!" /></a></div>

<div><a href="http://www.downloadatlas.com/open-source-50522018.html"><img src="http://www.concurrentaffair.org/wp-content/uploads/2011/03/downloadatlas-editors_choice.png" style="border:none;" width="80" height="80" alt="DrJava Editor's Choice" /></a></div>

<div><a href="http://www.geardownload.com/development/drjava.html"><img src="http://www.concurrentaffair.org/wp-content/uploads/2011/03/geardownload.jpg" style="border:none;" width="170" height="90" alt="DrJava 20100913-r5387 is 100% clean" /></a></div>

<p><br/>I also just commissioned an online virus scan of the latest DrJava development release, drjava-20110205-r5425, using VirusTotal, a free service that uses over 30 different anti-malware products, and our software came out clean. Here are the reports for the <a href="http://www.virustotal.com/file-scan/report.html?id=1d5acda9b6dc6922c37d655bc3230bd0336fc790e898148f097027dac63e1e00-1299569541">exe</a> file (<a href="http://www.virustotal.com/url-scan/report.html?id=abecb1f323f5d7937486c258352ec128-1299565914">exe file directly downloaded from SourceForge</a>), the <a href="http://www.virustotal.com/file-scan/report.html?id=a7e5ddc641a8c73d8c50e59624c469b72f4d154aabc6dc553bca5979ec58cfc0-1299570389">jar</a> file (<a href="http://www.virustotal.com/url-scan/report.html?id=2bceb450b915984c6deac41bd3e56d6e-1299566760">jar file directly downloaded from SourceForge</a>), and the <a href="http://www.virustotal.com/file-scan/report.html?id=39a6baa1cd481f24c267fcef4d144ef89af4345103b3bf3b120c9b30b6900181-1299570498">Mac application</a> (<a href="http://www.virustotal.com/url-scan/report.html?id=36ea717154d034f27acba553410b72d1-1299566873">Mac application directly downloaded from SourceForge</a>).</p>

<p>Not that I ever had a doubt, but DrJava is virus-free.</p>

<p>I would be interested in seeing more information about this virus
infection report, like what virus scanner was used, what virus was
reported, and where the user downloaded the file.</p>

<p>I&#8217;m glad Ian brought this to our attention. We need to take even a false positive seriously.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2011/03/08/drjava-is-virus-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DrJava Build and Release Instructions</title>
		<link>http://www.concurrentaffair.org/2011/02/09/drjava-build-and-release-instructions/</link>
		<comments>http://www.concurrentaffair.org/2011/02/09/drjava-build-and-release-instructions/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 08:03:38 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2503</guid>
		<description><![CDATA[As part of our knowledge (back) transfer, I wrote up these instructions for creating a fresh build of all parts of DrJava and then making a new release on SourceForge. Note: Our build process is currently broken for Windows machines &#8230; <a href="http://www.concurrentaffair.org/2011/02/09/drjava-build-and-release-instructions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As part of our knowledge (back) transfer, I wrote up these instructions for creating a fresh build of all parts of DrJava and then making a new release on SourceForge.</p>

<p>Note: Our build process is currently broken for Windows machines (see
&#8220;instructions below for building just DrJava&#8221;, step 6,  &#8220;Make the
release and put it into Subversion&#8221;.)</p>

<ol>
    <li>Check out trunk (<tt>svn co <a href="https://drjava.svn.sourceforge.net/svnroot/drjava/trunk">https://drjava.svn.sourceforge.net/svnroot/drjava/trunk</a></tt>), or if you have trunk checked out, update it.</li>
    <li><tt>cd drjava</tt></li>
    <li><tt>ant clean jar</tt></li>
    <li><tt>cd ../platform</tt></li>
    <li><tt>export DRJAVA_JAR=../drjava/drjava.jar</tt></li>
    <li><tt>ant clean compile-??? jar</tt><br /><br />

Note: Which <tt>compile-???</tt> targets you can run depends on the platform
you are compiling on. You need to be on a Mac to run compile-mac and
on Windows to run compile-windows. Since the compiled classes are
stored in Subversion, you can always do<br />
<br />
<tt>ant clean jar</tt><br />
<br />
to just get all the class files without recompiling.</li>
<li><tt>cp platform.jar ../drjava/lib</tt></li>
<li><tt>cd ../plt</tt></li>
<li><tt>ant clean test jar</tt></li>
<li>Copy the generated new <tt>plt.jar</tt> file over all other <tt>plt.jar</tt> files.
This can be done using<br />
<br />
<tt>find .. -name plt.jar -not -samefile plt.jar | xargs -n 1 cp -v plt.jar</tt></li>
<li><tt>cd ../dynamicjava</tt></li>
<li><tt>ant clean test jar-base</tt></li>
<li><tt>cp dynamicjava-base.jar ../drjava/lib</tt></li>
<li><tt>cd ../javalanglevels</tt></li>
<li><tt>ant clean test jar-base</tt></li>
<li><tt>cp javalanglevels-base.jar ../drjava/lib</tt></li>
<li><tt>cd ..</tt></li>
<li>Continue with the instructions below for building just DrJava, but not
plt.jar, etc. from scrach.</li>
</ol>

<p>Building the DrJava application (not the libraries) and making a new release:</p>

<ol>
    <li>cd drjava</li>
    <li>Create the release locally. It&#8217;s a good idea to do this first, without touching Subversion or SourceForge. To create a development release:<br />
<pre>ant clean release-local
To create a beta release:
ant clean release-local-beta
To create a stable release:
ant clean release-local-stable</pre></li>
    <li>This cleans, compiles, runs the unit tests, builds the jar, exe and
Mac application, and it also generates the Javadoc and a zip file with
source code.</li>
    <li>It makes sense to test the three different variants of DrJava: Run
the jar on some platform, run the exe on Windows, and run the Mac
application on a Mac, because sometimes one of them may be corrupted.
This can has happened sometimes for the exe file when building on a
Mac, or for the Mac application when building on Windows or Linux.</li>
    <li><tt>ant clean</tt><br />
This deletes the locally built release again.</li>
    <li>Make the release and put it into Subversion. Run one of:<br />
<pre>ant release
ant release-beta
ant release-stable</pre>
You may want to add <tt>-Dtest-repeat=0</tt> to the command line (e.g. <tt>ant
-Dtest-repeat=0 release</tt>). That tells Ant not to run the unit tests.
You can leave it out, but we just ran the unit tests, so it should not
be necessary to run them again.<br />
Note that this step may ask you for your SourceForge password if you
have never committed code to Subversion from the computer you are
working on.</li>
    <li>The build script will now create a &#8220;tag&#8221; of DrJava that will
contain exactly the source code versions and libraries used to build
this release of DrJava. This is useful in analyzing bugs that users
report in a specific version.</li>
    <li>Make note of that tag. It should be something like this:
<tt>drjava-20110205-r5425</tt></li>
    <li>To upload files to SourceForge, we will follow this guide written by <a href="https://sourceforge.net/apps/trac/sourceforge/wiki/Release%20files%20for%20download">SourceForge</a>. I find that using SFTP is the easiest.</li>
    <li>Log into SFTP. In the following command, replace <tt>&lt;username&gt;</tt> with your SourceForge username:<br />
<tt>sftp &lt;username&gt;,drjava@frs.sourceforge.net</tt><br />
Example: <tt>sftp mgricken,drjava@frs.sourceforge.net</tt></li>
    <li>On the SFTP server: <tt>cd /home/frs/project/d/dr/drjava</tt></li>
    <li>If you are building a stable or beta release, type:<br />
<tt>cd "1. DrJava Stable Releases"</tt><br />
If you are building a development release, type:<br />
<tt>cd "2. DrJava Development Releases"</tt></li>
    <li>Create a directory with the name of the tag from step 8 above.<br />
Example: <tt>mkdir drjava-20110205-r5425</tt></li>
    <li>Change into that directory.<br />
Example: <tt>cd drjava-20110205-r5425</tt></li>
    <li>Upload the files. You can do that with the command:<br />
<tt>put &lt;tag&gt;*</tt><br />
Example: <tt>put drjava-20110205-r5425*</tt></li>
    <li>Exit SFTP:<br />
<tt>exit</tt></li>
    <li>Browse to DrJava&#8217;s SourceForge site at
<a href="http://sourceforge.net/projects/drjava/develop">http://sourceforge.net/projects/drjava/develop</a> and log in.</li>
    <li>Click on the &#8220;Files&#8221; tab (or go to
<a href="https://sourceforge.net/projects/drjava/files/">https://sourceforge.net/projects/drjava/files/</a>).</li>
    <li>Click on <tt>1. DrJava Stable Releases</tt> or <tt>2. DrJava Development Releases</tt>, find the tag, and enter that directory. You should see the
files you uploaded.</li>
    <li>Click on the <tt>(i)</tt> (Info) button next to the exe file, check the
Windows checkbox, and press save.<br />
Click on the <tt>(i)</tt> (Info) button next to the Mac application, check the
Mac checkbox, and press save.<br />
Click on the <tt>(i)</tt> (Info) button next to the jar file, check all the
other checkboxes (except Windows and Mac), and press save.<br />
This step changes the default download on DrJava&#8217;s SourceForge page
(in the &#8220;Download Now!&#8221; button on <a href="https://sourceforge.net/projects/drjava/">https://sourceforge.net/projects/drjava/</a>). People downloading
directly from the SourceForge page will start getting the new release.</li>
    <li>Prepare the release notes text file called <tt>readme.txt</tt>. I start
with a template that looks like the one below. To determine the lists
of new features and bug fixes, you can look up the revision number of
the last release you&#8217;re comparing to, and then you can go through the
Subversion log and look at the descriptions of the commits, which
should hopefully be good enough to tell you what was done. Unless the
last version was a stable release, I usually include a comparison to
the last stable release as well, which is easy to create just by
copying and pasting the lists from individual release notes together.

<hr />
<pre>Available for download at http://drjava.org  .

DrJava is a lightweight programming environment for Java designed to
foster test-driven software development. It includes an intelligent
program editor, an interactions pane for evaluating program text, a
source level debugger, and a unit testing tool.

In addition to bug fixes, this <stable/beta/development> release
includes a number of new features introduced after the last
<stable/beta/development> release:

<brief description of MAJOR features>

Note: Java 1.4 compatibility has been dropped. To use DrJava, you will
need Java 5 or newer.


New features since the last <beta/development> release:
 - list of new features since the last beta/development release



Bug fixes since last <beta/development> release:
 - list of bug fixes since the last beta/development release



New features since the last stable release:
 - list of new features since the last stable release



Bug fixes since the last stable release:
 - list of bug fixes since the last stable release
</pre><hr /></li>
    <li>On the DrJava SourceForge page, upload the release notes into the
new release&#8217;s folder. You can do that either using SFTP again or using
the web upload by clicking on &#8220;Add File&#8221;. I just find that SFTP works
better for uploading the multiple large files earlier in step 15.</li>
    <li>On the DrJava SourceForge page, hover over &#8220;Develop&#8221; and click on
&#8220;News&#8221; (or go to <a href="https://sourceforge.net/news/?group_id=44253">https://sourceforge.net/news/?group_id=44253</a>, but that link has changed frequently). Click on &#8220;Submit&#8221; and paste the contents of the <tt>readme.txt</tt> file into the &#8220;Details&#8221; part. In the &#8220;Subject&#8221; line, I usually put something like &#8220;DrJava Development
Release 20110205-r5425&#8243;. Press &#8220;Submit&#8221;.</li>
    <li>Send an email to the following addresses: <tt>drjava@rice.edu,
drjava-hackers@lists.sf.net, drjava-users@lists.sf.net</tt></li>
    <li>I use the same text that was used in step 23 for the SourceForge news,
but I let the following text precede the email:

<hr />
<pre>Dear DrJava Users:

We have made a new &lt;stable/beta/development&gt; version available: &lt;tag&gt;

You can download it from the DrJava website at http://drjava.org/
or from SourceForge.net by following this link:

&lt;link&gt;

You receive this email because you have subscribed to a DrJava mailing list.
</pre>
<hr />

Replace the <tt>&lt;link&gt;</tt> part with the link to the SourceForge page that has
the files for this release, i.e. the website you navigated to in step
19. Example: <tt><a href="https://sourceforge.net/projects/drjava/files/2.%20DrJava%20Development%20Releases/drjava-20110205-r5425/">https://sourceforge.net/projects/drjava/files/2.%20DrJava%20Development%20Releases/drjava-20110205-r5425/</a></tt></li>
    <li>SSH into CSnet as <tt>javaplt</tt> (e.g. <tt>ssh javaplt@finland.cs.rice.edu</tt>).</li>
    <li><tt>cd ~/public_html/drjava</tt></li>
    <li>Run the <tt>drjava-update-news</tt> script. This pulls the SourceForge news
onto the DrJava website. Note that for now, this only happens on our
CSnet mirror at <a href="http://www.cs.rice.edu/~javaplt/drjava/">http://www.cs.rice.edu/~javaplt/drjava/</a><br />
<tt>drjava-update-news</tt></li>
    <li>Edit the <tt>LATEST_DEV_VERSION.TXT</tt>, <tt>LATEST_BETA_VERSION.TXT</tt> or
<tt>LATEST_VERSION.TXT</tt> file, depending on whether you have a development,
beta, or stable version. Put the new tag into the file. Make sure
there is no newline at the end of the file!</li>
    <li>If you made a stable release, you will want to remove the download
links for the beta and development releases. Edit <tt>main.shtml</tt> and
change the line

<pre>&lt;!--#include virtual="beta.shtml"--&gt;</pre>

to

<pre>&lt;!--include virtual="beta.shtml"--&gt;</pre>

and

<pre>&lt;!--#include virtual="devrelease.shtml"--&gt;</pre>

to

<pre>&lt;!--include virtual="devrelease.shtml"--&gt;</pre>

If you made a beta release, you want the hash mark for the <tt>#include</tt> of
the <tt>beta.shtml</tt> file, but not for the <tt>devrelease.shtml</tt> file. If you
made a development release, you probably want the hash mark for the
<tt>devrelease.shtml</tt> file, but not for the <tt>beta.shtml</tt> file.</li>
    <li>Do a similar thing as in step 29 for <tt>download.shtml</tt>. The
corresponding lines are

<pre>&lt;!--include virtual="beta_long.shtml" --&gt;</pre>

and

<pre>&lt;!--include virtual="devrelease_long.shtml" --&gt;</pre>
</li>
    <li>Go to <a href="http://www.cs.rice.edu/~javaplt/drjava/">http://www.cs.rice.edu/~javaplt/drjava/</a> and check that the
download buttons link to the right files, the ones that you have just
released. It&#8217;s a good idea to download them all and run them, to make
sure there were no upload errors.</li>
    <li>Delete backup files:<br />
<tt>rm *~</tt></li>
    <li>Copy the website to the SourceForge server using the
<tt>drjava-cs-to-sf</tt> script. Note that it may also update Javadocs, test
coverage, and other files.<br />
<tt>drjava-cs-to-sf</tt></li>
    <li>That&#8217;s it! Thanks for helping make DrJava even better.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2011/02/09/drjava-build-and-release-instructions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New DrJava Development Release: drjava-20110205-r5425</title>
		<link>http://www.concurrentaffair.org/2011/02/05/new-drjava-development-release-drjava-20110205-r5425/</link>
		<comments>http://www.concurrentaffair.org/2011/02/05/new-drjava-development-release-drjava-20110205-r5425/#comments</comments>
		<pubDate>Sat, 05 Feb 2011 19:36:52 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2494</guid>
		<description><![CDATA[We have made a new development release available: drjava-20110205-r5425. You can download it from the DrJava website or from SourceForge. Available for download at http://drjava.org . DrJava is a lightweight programming environment for Java designed to foster test-driven software development. &#8230; <a href="http://www.concurrentaffair.org/2011/02/05/new-drjava-development-release-drjava-20110205-r5425/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We have made a new development release available: drjava-20110205-r5425. You can download it from the <a href="http://drjava.org/">DrJava website</a> or from <a href="https://sourceforge.net/projects/drjava/files/2.%20DrJava%20Development%20Releases/drjava-20110205-r5425/">SourceForge</a>.</p>

<p>Available for download at <a href="http://drjava.org">http://drjava.org</a>  .</p>

<p>DrJava is a lightweight programming environment for Java designed to foster test-driven software development. It includes an intelligent program editor, an interactions pane for evaluating program text, a source level debugger, and a unit testing tool.</p>

<p>In addition to bug fixes, this development release includes a number of new features introduced after the last stable release:</p>

<p>The language level facility has been changed to consist of two language levels, Functional Java (corresponding to the old Intermediate level) and Full Java. The old files can still be compiled, but DrJava will ask if it should rename .dj0 and .dj1 to .dj and .dj2 files to .java.</p>

<p>DrJava&#8217;s compiler support has been improved, and DrJava now supports compiling files with file extensions other than .java, .dj, .dj0, .dj1, and .dj2. This includes support for Habanero Java .hj files, provided the Habanero Java compiler is installed.</p>

<p>DrJava preferences like indent level can now be stored on a per- project basis (see &#8220;Project Properties&#8221;, &#8220;Advanced&#8221;).</p>

<p>Note: Java 1.4 compatibility has been dropped. To use DrJava, you will
need Java 5 or newer.</p>

<p>New features since the last stable release:</p>

<ul>
<li>refactored language levels</li>
<li>improved compiler support, including support for Habanero Java</li>
<li>The contents of the Compiler Errors pane can now be copied the clipboard.</li>
<li>DrJava preferences like indent level can now be stored on a per-project basis (see &#8220;Project Properties&#8221;, &#8220;Advanced&#8221;).</li>
</ul>

<p>Bug fixes since last stable release:</p>

<ul>
<li>Applet viewer not started in event thread anymore to avoid exception</li>
<li>Static type checking for primitive casts in Interactions pane</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2011/02/05/new-drjava-development-release-drjava-20110205-r5425/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrating the Habanero Java Race Detector into DrJava</title>
		<link>http://www.concurrentaffair.org/2010/11/22/integrating-the-habanero-java-race-detector-into-drjava/</link>
		<comments>http://www.concurrentaffair.org/2010/11/22/integrating-the-habanero-java-race-detector-into-drjava/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 17:53:35 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2391</guid>
		<description><![CDATA[Jarred, Vincent and the guys of the Habanero Java group are planning to add a race detector to the Habanero Java compiler adapter in DrJava. I won&#8217;t have much time to help them with this, but I gave them some &#8230; <a href="http://www.concurrentaffair.org/2010/11/22/integrating-the-habanero-java-race-detector-into-drjava/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Jarred, Vincent and the guys of the Habanero Java group are planning to add a race detector to the Habanero Java compiler adapter in DrJava. I won&#8217;t have much time to help them with this, but I gave them some pointers.</p>

<p><strong>Adding a race detector pane</strong></p>

<p>I would probably use a panel that is shown in the &#8220;Tabbed Panes&#8221; part at the bottom of DrJava. You could look at JUnitPanel (extending ErrorPanel, which has a list of errors with file-and-line location information) or at BreakpointsPanel (extending RegionsTreePanel, which has a tree of documents, each having line numbers in them).
<br/></p>

<p><strong>Specialized handler for race condition runtime exceptions</strong></p>

<p>Right now, we have special treatment for <code class="codecolorer java mac-classic"><span class="java"><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aoutofmemoryerror+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">OutOfMemoryError</span></a></span></code> exceptions. This portion is in MainFrame.java:</p>

<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>lastError.<span style="color: #006633;">startsWith</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;java.lang.OutOfMemoryError&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; askToIncreaseSlaveMaxHeap<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>

<p>I don&#8217;t think this is the perfect place to put it, and we should probably refactor the code at some point so it doesn&#8217;t fill up <code class="codecolorer java mac-classic"><span class="java">MainFrame</span></code> even more, but this is the simplest place to extend DrJava. That&#8217;s where you could display the race condition pane.</p>

<p>There is one problem: Since the exception is thrown in another JVM (interpreter JVM) and then passed to the JVM where the main DrJava IDE is running (main JVM), the exception would have to be serializable. Right now, we just pass a string, not the exception itself. Unless you want to change the current design, you probably have to put the file and line number information into the string and then parse it again in the IDE.
<br/></p>

<p><strong>Compilation options for the Habanero Java compiler adapter</strong></p>

<p>You can create a panel in the Preferences pane in ConfigFrame.java and add options in OptionConstants.java. Then, in
<code class="codecolorer java mac-classic"><span class="java">HjCompiler.<span style="color: #006633;">transformHJCommand</span></span></code>, you can check the state of those options, e.g. using
<code class="codecolorer java mac-classic"><span class="java">DrJava.<span style="color: #006633;">getConfig</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getSetting</span><span style="color: #009900;">&#40;</span>HJ_USE_RACE_DETECTION<span style="color: #009900;">&#41;</span></span></code> or something like that, to create the appropriate command line.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2010/11/22/integrating-the-habanero-java-race-detector-into-drjava/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DrJava Listed in Overview of Java IDEs</title>
		<link>http://www.concurrentaffair.org/2010/11/22/drjava-listed-in-overview-of-java-ides/</link>
		<comments>http://www.concurrentaffair.org/2010/11/22/drjava-listed-in-overview-of-java-ides/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 15:29:52 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2386</guid>
		<description><![CDATA[DrJava was included in this overview of Java IDEs: Dr. Java- This is a lightweight IDE geared towards students in introductory level classes, including the Advanced Placement Computer Science course. Dr. Java has support for evaluating snippets of code without &#8230; <a href="http://www.concurrentaffair.org/2010/11/22/drjava-listed-in-overview-of-java-ides/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>DrJava was included in this <a href="http://www.dzone.com/links/r/an_overview_of_java_ides.html">overview of Java IDEs</a>:</p>

<blockquote>
Dr. Java- This is a lightweight IDE geared towards students in introductory level classes, including the Advanced Placement Computer Science course. Dr. Java has support for evaluating snippets of code without compiling them. In addition, Dr. Java supports the AP Computer Science GridWorld API, having features to aid developers in getting it setup as well as some basic GridWorld tutorials.</blockquote>

<p><br/>
One commenter even listed DrJava as his favorite. I agree, but I&#8217;ve probably made DrJava organically grow around me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2010/11/22/drjava-listed-in-overview-of-java-ides/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DrJava Preferences Stored in Project Files</title>
		<link>http://www.concurrentaffair.org/2010/11/16/drjava-preferences-stored-in-project-files/</link>
		<comments>http://www.concurrentaffair.org/2010/11/16/drjava-preferences-stored-in-project-files/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 06:55:15 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2381</guid>
		<description><![CDATA[I told myself I wouldn&#8217;t work on DrJava anymore, but here I go again. I Implemented feature request 3081586, Store Preferences within Projects, mainly because this was something I had wanted for a long time (I kept going back and &#8230; <a href="http://www.concurrentaffair.org/2010/11/16/drjava-preferences-stored-in-project-files/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I told myself I wouldn&#8217;t work on DrJava anymore, but here I go again. I Implemented <a href="https://sourceforge.net/tracker/index.php?func=detail&#038;aid=3081586&#038;group_id=44253&#038;atid=438938">feature request 3081586, Store Preferences within Projects</a>, mainly because this was something I had wanted for a long time (I kept going back and forth between indent levels of 2 and 4), and because Corky had requested the language level setting to be stored in project files. This feature request was more general than what he wanted, but I think it was what DrJava needed.</p>

<p>There now is an &#8220;Advanced&#8221; button on the &#8220;Project Properties&#8221; dialog that takes the user to a secondary window. In that window, the user can list (by name, using predictive input)
those preferences that should be saved in the project file.</p>

<p>Note that for simplicity, the actual values are still configured in the &#8220;Preferences&#8221; window (Edit menu). This list only names the preferences whose values should be stored in the project file when the project is saved, and restored when the project is loaded again.</p>

<p>By default and for new projects, the language level and the indent level are saved in the project file and restored upon loading of the project.</p>

<p>For existing projects, you can cause DrJava to store the language level in the project file by going to Project Properties, clicking the new &#8220;Advanced&#8221; button in the bottom left corner, pressing the &#8220;Add&#8221; button underneath the list, and entering &#8220;Language Level&#8221;. Once you press OK to add that preference to the list, and OK to close the &#8220;Advanced&#8221; window, and then &#8220;OK&#8221; to close the Project Properties window, DrJava will store the language level in the project file.</p>

<p>Now I can set the indent level to 2 for DrJava and to 4 for most other projects. So can you if you grab the <a href="http://www.cs.rice.edu/~javaplt/drjavarice/weekly/">latest weekly build of DrJava</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2010/11/16/drjava-preferences-stored-in-project-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spam on the DrJava SourceForge Trackers</title>
		<link>http://www.concurrentaffair.org/2010/10/20/spam-on-the-drjava-sourceforge-trackers/</link>
		<comments>http://www.concurrentaffair.org/2010/10/20/spam-on-the-drjava-sourceforge-trackers/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 23:28:50 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2363</guid>
		<description><![CDATA[We&#8217;ve been getting tons of pharmaceutical spam on the DrJava trackers (bug reports, feature requests, support requests) today. Unfortunately, when it comes to limiting the amount of spam from automated bots, the only mechanism that SourceForge provides is requiring users &#8230; <a href="http://www.concurrentaffair.org/2010/10/20/spam-on-the-drjava-sourceforge-trackers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been getting tons of pharmaceutical spam on the DrJava trackers (bug reports, feature requests, support requests) today. Unfortunately, when it comes to limiting the amount of spam from automated bots, the only mechanism that SourceForge provides is requiring users to register for a SourceForge account.</p>

<p>I don&#8217;t like doing this, but at this point, it seems like it&#8217;s the only simple action we can take. There are more advanced &#8220;<a href="https://sourceforge.net/apps/trac/sourceforge/wiki/Hosted%20Apps">hosted apps</a>&#8221; that can be used for bug tracking, but I have not evaluated any of them.</p>

<p>If you feel strongly that we should allow anonymous postings again, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2010/10/20/spam-on-the-drjava-sourceforge-trackers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another DrJava User Site: University of Western Ontario</title>
		<link>http://www.concurrentaffair.org/2010/10/17/another-drjava-user-site-uwo/</link>
		<comments>http://www.concurrentaffair.org/2010/10/17/another-drjava-user-site-uwo/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 02:41:34 +0000</pubDate>
		<dc:creator>Mathias</dc:creator>
				<category><![CDATA[DrJava]]></category>

		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=2349</guid>
		<description><![CDATA[I found another university that uses DrJava in its CS curriculum: The University of Western Ontario teaches CS 1026: Computer Science Fundamentals I using DrJava. The course is based on Mark Guzdial&#8217;s and Barbara Ericson&#8217;s Media Computation textbook. Having had &#8230; <a href="http://www.concurrentaffair.org/2010/10/17/another-drjava-user-site-uwo/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I found another university that uses DrJava in its CS curriculum: The <a href="http://www.csd.uwo.ca/">University of Western Ontario</a> teaches <a href="http://www.csd.uwo.ca/courses/CS1026a/">CS 1026: Computer Science Fundamentals I</a> using DrJava.</p>

<p>The course is based on Mark Guzdial&#8217;s and Barbara Ericson&#8217;s <a href="http://www.pearsonhighered.com/educator/academic/product?ISBN=0131496980">Media Computation textbook</a>. Having had Georgia Tech as clients has certainly been most beneficial for DrJava.</p>

<p>I have added UWO to the list of <a href="http://drjava.org/index.php?page=usersites.shtml">DrJava user sites</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.concurrentaffair.org/2010/10/17/another-drjava-user-site-uwo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

