<?xml version="1.0"?>
<rss version="2.0">
<channel>
	<title>Planet Classpath</title>
	<link>http://planet.classpath.org/</link>
	<language>en</language>
	<description>Planet Classpath - http://planet.classpath.org/</description>
	<ttl>30</ttl>

<item>
	<title>Xerxes Rånby: How to get Shark LLVM JIT CodeGen crash bugs fixed!</title>
	<guid>http://labb.zafena.se/?p=362</guid>
	<link>http://labb.zafena.se/?p=362</link>
	<description>&lt;p&gt;When making a programming tool or a virtual machine getting the tool running perfectly stable without any crash bugs are always on a higher priority than gaining more speed. A crashing tool are a broken tool so I will share some tricks that I have practised to find and fix Shark LLVM JIT CodeGen crash bugs. The main trick are to be able generate reproducable testcases that can be reported to the LLVM developers bugzilla bugtracker by using what you can extract from the Shark LLVM JIT CodeGen crashes. Here is how I do it, enjoy!&lt;/p&gt;
&lt;p&gt;&lt;b&gt; How to provoke hard to find Shark LLVM JIT bugs &lt;/b&gt;&lt;br /&gt;
Some Shark LLVM JIT bugs are hard to find because they only occour after the Shark JIT enabled JVM have been running for a long time, this are because the Shark Hotspot JVM takes advantage of the fact that a given running application spends about 90% of its time running only 10% of the applications code. Hotspot profiles the running code and only JITs the most frequently used methods of the program. Hotspot uses a threshold to determine which methods to JIT. When a method have been used more than 100000 times then it are scheduled to be optimized by the JIT. JIT bugs can stay undetected if they are located in unfrequently executed methods, those methods that makes up the 90%, of the unfrequently executed application code.&lt;/p&gt;
&lt;p&gt;A easy trick to provoke unfrequently executed JIT bugs are to lower the JIT threshold in Hotspot so that Hotspot JITs everything. The JIT threshold can be controlled by using the -XX:CompileThreshold=1 option and -Xbatch option. -Xbatch prevents the hotspot from running the JIT in background and will make hotspot reproduce JIT bugs more determistic. &lt;/p&gt;
&lt;p&gt;Using a low JIT threshold will of course make the program startup magnitudes slower but it will also eventually find and hit all JIT bugs for a given application. Try pass -XX:+PrintCompilation to Hotspot as well so that you can observe all the java methods that Hotspot are JITting and find out which method that failed to JIT if Hotspot hits a JIT crash bug.&lt;br /&gt;
&lt;code&gt;java -XX:CompileThreshold=1 -Xbatch -XX:+PrintCompilation JavaApplication&lt;br /&gt;
 1  b   java.lang.Thread:: (49 bytes)&lt;br /&gt;
&amp;#8230;&lt;br /&gt;
 10  b   java.lang.String::getChars (66 bytes)&lt;br /&gt;
*crash*&lt;br /&gt;
/home/xerxes/llvm/include/llvm/CodeGen/MachineFrameInfo.h:289: int64_t&lt;br /&gt;
llvm::MachineFrameInfo::getObjectOffset(int) const: Assertion&lt;br /&gt;
`!isDeadObjectIndex(ObjectIdx) &amp;#038;&amp;#038; &amp;#8220;Getting frame offset for a dead object?&amp;#8221;&amp;#8216;&lt;br /&gt;
failed.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Huh.. no logfile??&lt;br /&gt;
Most Shark LLVM JIT CodeGen crash bugs makes the JVM instantainiously exit without producting a hs_err_pid*.log file. Whats usefull are that the JVM output will contain a Assertion, Unreachable or Unimplemented keyword and a LLVM code line numer.&lt;/p&gt;
&lt;p&gt;So what do we do now?&lt;br /&gt;
Thanks by using -XX:+PrintCompilation makes us aware that the last method JITed was the java.lang.String::getChars method and that caused the Assertion in the LLVM CodeGen when running the Shark JIT so the next step are to dump the LLVM IR that Shark have generated for the method.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt; Extract the LLVM IR for the java method that makes the Shark JIT crash.&lt;/b&gt;&lt;br /&gt;
Ok so we got a crash and we know that it was JITing of java.lang.String::getChars that caused it.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;a)&lt;/b&gt; shark debug build -XX:SharkPrintBitcodeOf= method:&lt;br /&gt;
If you have built a &lt;a href=&quot;http://gbenson.net/?p=100&quot;&gt;debuggable &amp;#8220;Mixtech&amp;#8221; Shark build&lt;/a&gt; then Shark will contain some extra usefull debug runtimeoptions where one of the more usefull are&lt;br /&gt;
-XX:SharkPrintBitcodeOf=java.package.name::MethodName&lt;br /&gt;
use it and Shark will dump the LLVM IR bitcode to stdout just before jitting it.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;b)&lt;/b&gt; gdb call F-&gt;dump() method:&lt;br /&gt;
I personally prefer dumping LLVM IR from inside the gnu gdb debugger since this method can be used using release Shark build in combination with release llvm builds so lets jump into the gdb debugger!&lt;/p&gt;
&lt;p&gt;Start gdb and attach it to the java application with all the options that triggered the JIT CodeGen bug!&lt;br /&gt;
&lt;code&gt;$ gdb -args java -XX:CompileThreshold=1 -Xbatch -XX:+PrintCompilation JavaApplication&lt;br /&gt;
(gdb) run&lt;br /&gt;
...&lt;br /&gt;
Segmentation fault&lt;br /&gt;
$ &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Ick gdb crashed why? This are because the JVM launcher &amp;#8220;java&amp;#8221; first sets up the system environment and then forks off in a new process using execve(). gdb gets killed by the linux kernel when it are trying to read memory across process boundarys so we must stop java from forking!&lt;/p&gt;
&lt;p&gt;The easiest way to prevent java from forking are to setup the system environments before launching the application. And all this can be done from inside gdb so lets try again!&lt;br /&gt;
&lt;code&gt;$ gdb -args java -XX:CompileThreshold=1 -Xbatch -XX:+PrintCompilation JavaApplication&lt;br /&gt;
(gdb) break execve&lt;br /&gt;
Breakpoint 1 at 0x93b8&lt;br /&gt;
(gdb) run&lt;br /&gt;
(gdb) call puts(getenv(&quot;LD_LIBRARY_PATH&quot;))&lt;br /&gt;
/media/disk/4mar-shark-1.8pre-b18-llvm-2.7svn.so-npplugin/jre/lib/arm/server:/media/disk/4mar-shark-1.8pre-b18-llvm-2.7svn.so-npplugin/jre/lib/arm:/media/disk/4mar-shark-1.8pre-b18-llvm-2.7svn.so-npplugin/jre/../lib/arm&lt;br /&gt;
$1 = 220&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Ok now we know what the LD_LIBRARY_PATH should look like and if we set it before running the java launcher will prevent java from forking using execve, this &lt;a href=&quot;http://blogs.sun.com/darcy/entry/purging_ld_library_path&quot;&gt;LD_LIBRARY_PATH and execve madness are thankfully gone in JDK7&lt;/a&gt;!&lt;br /&gt;
&lt;code&gt;(gdb) set env LD_LIBRARY_PATH=/media/disk/4mar-shark-1.8pre-b18-llvm-2.7svn.so-npplugin/jre/lib/arm/server:/media/disk/4mar-shark-1.8pre-b18-llvm-2.7svn.so-npplugin/jre/lib/arm:/media/disk/4mar-shark-1.8pre-b18-llvm-2.7svn.so-npplugin/jre/../lib/arm&lt;/code&gt;&lt;br /&gt;
I will do one more thing namely set a gdb breakpoint inside java_md.c:652 right after the hotspot library libjvm.so have been loaded by the java launcher.&lt;br /&gt;
&lt;code&gt;(gdb) break java_md.c:652&lt;br /&gt;
(gdb) run&lt;br /&gt;
The program being debugged has been started already.&lt;br /&gt;
Start it from the beginning? (y or n) y&lt;br /&gt;
...&lt;br /&gt;
Breakpoint 2, LoadJavaVM ... java_md.c:652&lt;br /&gt;
652        if (libjvm == NULL) {&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This are a good spot to setup new gdb breakpoints inside the loaded libjvm.so that contains the Shark JIT. Finally we are able to place a breakpoint on the line where the Shark JIT failed inside LLVM.&lt;br /&gt;
&lt;code&gt;(gdb) break MachineFrameInfo.h:289&lt;br /&gt;
(gdb) continue&lt;br /&gt;
Continuing.&lt;br /&gt;
...&lt;br /&gt;
 10  b   java.lang.String::getChars (66 bytes)&lt;br /&gt;
 [Switching to Thread 0x67ed96a490 (LWP 21127)]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Breakpoint 3, &amp;#8230; at &amp;#8230; MachineFrameInfo.h:289&lt;/p&gt;
&lt;p&gt;Get a backtrace and try to locate the frame where Shark calls getPointerToFunction&lt;br /&gt;
&lt;code&gt;(gdb) bt&lt;br /&gt;
...&lt;br /&gt;
#9  0x40d4ee68 in llvm::JIT::getPointerToFunction (this=0x9e138, F=0xda6f0)&lt;br /&gt;
...&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Switch to the getPointerToFunction stack frame&lt;br /&gt;
&lt;code&gt;(gdb) frame 9&lt;/code&gt;&lt;br /&gt;
and finnaly dump the LLVM IR for the function by calling the functions own method dump() !&lt;br /&gt;
&lt;code&gt;(gdb) call F-&gt;dump()&lt;br /&gt;
define internal void @&quot;java.lang.String::getChars&quot;([84 x i8]* %method, i32 %base_pc, [788 x i8]* %thread) {&lt;br /&gt;
  %1 = getelementptr inbounds [788 x i8]* %thread, i32 0, i32 756 ;  [#uses=1]&lt;br /&gt;
  %zero_stack = bitcast i8* %1 to [12 x i8]*      ; [12 x i8]*&gt; [#uses=1]&lt;br /&gt;
  %2 = getelementptr inbounds [12 x i8]* %zero_stack, i32 0, i32 8 ;  [#uses=1]&lt;br /&gt;
  %stack_pointer_addr = bitcast i8* %2 to i32*    ;  [#uses=1]&lt;br /&gt;
  %3 = load i32* %stack_pointer_addr              ;  [#uses=1]&lt;br /&gt;
&amp;#8230;&lt;br /&gt;
  %142 = getelementptr inbounds [17 x i32]* %frame, i32 0, i32 12 ;  [#uses=1]&lt;br /&gt;
  store i32 %31, i32* %142&lt;br /&gt;
  call void inttoptr (i32 13839116 to void ([788 x i8]*, i32)*)([788 x i8]* %thread, i32 7)&lt;br /&gt;
  ret void&lt;br /&gt;
}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Horray! we have successfully dumped the Shark generated LLVM IR for the problematic method-call. Now simply copy the dump output from the terminal into a file named bug.ll and continue reading.&lt;/p&gt;
&lt;p&gt;
&lt;b&gt; Check for LLVM CodeGen bugs by testing if the dumped LLVM IR bug.ll file can reproduce the bug using llc&lt;/b&gt;&lt;br /&gt;
After you have extracted LLVM IR for the problematic method check if you can reproduce the bug  using llc..&lt;br /&gt;
&lt;code&gt;$ llvm-as &amp;lt; bug.ll | llc&lt;br /&gt;
    .syntax unified&lt;br /&gt;
    .eabi_attribute 20, 1&lt;br /&gt;
    .eabi_attribute 21, 1&lt;br /&gt;
    .eabi_attribute 23, 3&lt;br /&gt;
    .eabi_attribute 24, 1&lt;br /&gt;
    .eabi_attribute 25, 1&lt;br /&gt;
    .file    &quot;&amp;#8221;&lt;br /&gt;
llc:&lt;br /&gt;
/wd/buildbot/llvm-arm-linux/llvm/include/llvm/CodeGen/MachineFrameInfo.h:289:&lt;br /&gt;
int64_t llvm::MachineFrameInfo::getObjectOffset(int) const: Assertion&lt;br /&gt;
`!isDeadObjectIndex(ObjectIdx) &amp;#038;&amp;#038; &amp;#8220;Getting frame offset for a dead object?&amp;#8221;&amp;#8216;&lt;br /&gt;
failed.&lt;br /&gt;
0  llc       0&amp;#215;01368414&lt;br /&gt;
1  llc       0&amp;#215;01368ccc&lt;br /&gt;
2  libc.so.6 0&amp;#215;4021cc10 __default_sa_restorer_v2 + 0&lt;br /&gt;
Stack dump:&lt;br /&gt;
0.    Program arguments: /wd/r96575/Debug/bin/llc -march=arm&lt;br /&gt;
1.    Running pass &amp;#8216;Prolog/Epilog Insertion &amp;#038; Frame Finalization&amp;#8217; on function&lt;br /&gt;
&amp;#8216;@&amp;#8221;java.lang.String::getChars&amp;#8221;&amp;#8216;&lt;br /&gt;
Aborted&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If it crashes using llc then cheer up because you now got a reproducable CodeGen bug and thats great! These kind of crash bugs are on LLVM developers top wanted list because they can fire on any tool that uses LLVM code generation. The best way to report this kind of bugs are to first generate a compact testcase for LLVM that triggers the bug that can be used by the LLVM developers to fix it. It can also be run by the LLVM developers daily regression testing to make sure this bug never hits again.&lt;/p&gt;
&lt;p&gt;If it fails to crash with an Aborted like above then you are probably observing a JIT CodeEmitter runtime bug, stay tuned and look forward to my next blog post on &amp;#8220;How to fix Shark LLVM JIT CodeEmitter bugs&amp;#8221;!&lt;br /&gt;
&lt;br /&gt;&lt;b&gt;How to generate a &lt;b&gt;bugpoint-reduced-simplified.bc&lt;/b&gt; from the bug.ll using &lt;b&gt;bugpoint&lt;/b&gt; for CodeGen crash bugs&lt;/b&gt;&lt;br /&gt;
LLVM ships with a clever tool called &lt;a href=&quot;http://llvm.org/docs/Bugpoint.html&quot;&gt;bugpoint&lt;/a&gt; that are designed to convert dumped blocks of LLVM IR into a compact bugpoint-reduced-simplified.bc LLVM bitcode testcase file that only contains the instructions needed to reproduce the bug.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$ bugpoint -run-llc bug.ll --tool-args -march=arm&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Bugpoint work by using deductive logic to break down and remove parts of the bug.ll file and automatically narrow down the LLVM IR lines needed to reproduce the bug. It can take some minutes so be patient but bugpoint will eventually stop and give you a bugpoint-reduced-simplified.bc and print some information on how to reproduce the bug.&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;File a LLVM bugreport containing the bugpoint-reduced-simplified.bc file&lt;/b&gt;&lt;br /&gt;
An example of a Shark JIT LLVM bug that have been fixed after submitting a bugpoint-reduced-simplified.bc produced from a dumped Shark metod are :&lt;br /&gt;
&lt;a href=&quot;http://llvm.org/bugs/show_bug.cgi?id=6478&quot;&gt;LLVM PR6478 ARM CodeGen Running pass &amp;#8216;Prolog/Epilog Insertion &amp;#038; Frame Finalization&amp;#8217; on function &amp;#8216;@&amp;#8221;java.lang.String::getChars&amp;#8221;&amp;#8216; &lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I hope this post have given you some inspiration on how to get Shark LLVM JIT CodeGen crash bugs fixed!&lt;br /&gt;
If you want to know more about how bugpoint works and how to officially prepare LLVM bugreports then take a peek at the LLVM documentation: &lt;a href=&quot;http://llvm.org/docs/HowToSubmitABug.html&quot;&gt;http://llvm.org/docs/HowToSubmitABug.html&lt;/a&gt; its great.&lt;/p&gt;
&lt;p&gt;Xerxes&lt;/p&gt;</description>
	<pubDate>Wed, 10 Mar 2010 16:57:10 +0000</pubDate>
</item>
<item>
	<title>Xerxes Rånby: LLVM JIT CPU autotuner patch in limbo</title>
	<guid>http://labb.zafena.se/?p=337</guid>
	<link>http://labb.zafena.se/?p=337</link>
	<description>&lt;p&gt;&lt;a href=&quot;http://labb.zafena.se/wp-content/uploads/2010/03/sharkjitautocpufeaturesopt.png&quot;&gt;&lt;img class=&quot;alignright size-full wp-image-338&quot; title=&quot;Shark LLVM JIT on ARM Cortex-A8 using automatic CPU features tuning passes CaffeineMark 3.0 2000 points score mark.&quot; src=&quot;http://labb.zafena.se/wp-content/uploads/2010/03/sharkjitautocpufeaturesopt.png&quot; alt=&quot;&quot; width=&quot;435&quot; height=&quot;299&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
I have from time to time been working on a automatic CPU feature tuning code for Shark to make the LLVM JIT generate better code for Cortex-A8 class ARM CPUs. Using it i was able to gain some substantial speed-improvements, all in all it made Shark generate 30% faster code on ARM and the Shark JIT are now able to beat the 2000 point CaffeineMark 3.0 score! I could not resist using CaffeineMark 3.0 for some benchmarking again &lt;img src=&quot;http://labb.zafena.se/wp-includes/images/smilies/icon_smile.gif&quot; alt=&quot;:)&quot; class=&quot;wp-smiley&quot; /&gt; .&lt;/p&gt;
&lt;p&gt;While this looks all great with rainbows and unicorns the patch are sadly in limbo. I have had some trouble merging the code into LLVM 2.7 trunk before the next LLVM release since I got hit by &lt;a href=&quot;http://www.llvm.org/bugs/show_bug.cgi?id=6544&quot;&gt;LLVM problem report 6544&lt;/a&gt; that will force me to redesign the implementation on top of LLVM before it can be commited.&lt;/p&gt;
&lt;p&gt;And a similar optimisation like what i did for ARM Linux  can easily be done for Shark on PPC Linux as well by adopting the ARM CPU features detection code from ARM to PPC!&lt;br /&gt;
For those who are interested the optimising code are submitted and can be fetched from &lt;a href=&quot;http://www.llvm.org/bugs/show_bug.cgi?id=5389&quot;&gt;LLVM PR5389&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Cheers and have a great day!&lt;br /&gt;
Xerxes&lt;/p&gt;</description>
	<pubDate>Tue, 09 Mar 2010 15:28:11 +0000</pubDate>
</item>
<item>
	<title>Mario Torre: Nested functions</title>
	<guid>http://www.jroller.com/neugens/entry/nested_functions5</guid>
	<link>http://www.jroller.com/neugens/entry/nested_functions5</link>
	<description>Funny thing in C that I discovered today and thought I would share.

I found out that is not only possible to declare a function in the scope of another one, but also to define it, at least with GCC (I think this is a language extension, not sure if some &quot;later&quot; standard like c99 officially supports it).

Of course, this uber cool feature just makes code more funny, but it may have it's own uses (other than writing obfuscated code, I mean :)

Here is some code:

&lt;pre&gt;
int main(void)
{
    void testMe(void)
    {
        fprintf(stderr, &quot;b0rk3d!\n&quot;);
    }
    testMe();

    return (EXIT_SUCCESS);
}
&lt;/pre&gt;

without optimisations, gcc creates a regular function call, with optimisation I guess it depends on how often you use it, but this simple test gets (unsurprisingly, I guess) inlined.

Very cool :)</description>
	<pubDate>Fri, 05 Mar 2010 16:04:11 +0000</pubDate>
</item>
<item>
	<title>Roman Kennke: Beatles Review: A Hard Day’s Night</title>
	<guid>http://rkennke.wordpress.com/?p=309</guid>
	<link>http://rkennke.wordpress.com/2010/03/04/beatles-review-a-hard-days-night/</link>
	<description>&lt;p&gt;Now we come to the first peak in The Beatles&amp;#8217; career: their 3rd album &lt;a href=&quot;http://www.lastfm.de/music/The+Beatles/A+Hard+Day%27s+Night&quot;&gt;A Hard Day&amp;#8217;s Night&lt;/a&gt;. Somewhere I&amp;#8217;ve read that this album sounds like somebody opened a bottle of champaign, and this hits the nail on its head. Where the last album &lt;a href=&quot;http://rkennke.wordpress.com/2010/02/24/beatles-review-with-the-beatles/&quot;&gt;With The Beatles&lt;/a&gt; was slightly dark, this here is all bright, hyperactive and full of adrenaline. It starts with the weird opening chord (which &lt;a href=&quot;http://www.scientificblogging.com/news_releases/beatles_unknown_hard_days_night_chord_mystery_solved_using_fourier_transform&quot;&gt;puzzled even scientists&lt;/a&gt; because nobody was able to find out exactly what chord it was until 2008) of the title song, and runs through a set of 13 Beatles originals (yeah right, no cover versions this time). It shows all the good qualities of the early Beatles, their incredible vocal harmonies, their simple-yet-intriguing melodies and rhythms. And it shows the incredible fun and energy that the guys had.&lt;/p&gt;
&lt;p&gt;I remember a fun little story. When I was young (much younger than now at least), I saved myself a lot of money (around 30 DM, approx. 15€ nowadays) to buy this album on CD. That must have been in 1992 or so, I was about 14. I didn&amp;#8217;t even have a CD player! So I went to the closest supermarket, gave away my hard-earned money to get this CD. And when I was home and saw &amp;#8216;Mono&amp;#8217; on the package, I was so disappointed, because I believed that this was a fake thing. In my childish view I assumed that the real thing must be stereo because stereo is obviously better, no? In the end, I went back to the supermarket and returned the CD (that was quite a funny and geeky argument with the salesguy, not wanting the CD because it&amp;#8217;s mono). But not without first going to a friend and making a copy of it to cassette tape. Yay &lt;img src=&quot;http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif&quot; alt=&quot;:-D&quot; class=&quot;wp-smiley&quot; /&gt;  Only much later I realized that the mono version was indeed the official version and bought the CD again. Now I have both, and comparing the versions I must say that the mono version is indeed better, again there are a bunch of glitches on stereo (the start of &amp;#8216;Should Have Known Better&amp;#8217; for example) that have been corrected in mono. It needs to be said that at this time mono was by far the dominant format and the Beatles themselves never really cared for the stereo mixes, leaving them to others, while attending the mono mixes themselves. However, compared to the first two albums, which have this funny extreme left-right panning, the stereo mixes are a bit more sane, which owes to the fact that they used 4 track recording for the first time.&lt;/p&gt;
&lt;p&gt;That was a bit technical this time, I usually try to avoid that because we want to listen to music, not technology, right? I enjoyed listening to this album today anyway. Quite alot even. Next time I will have a look (listen) at the Beatles for Sale.&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/rkennke.wordpress.com/309/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/rkennke.wordpress.com/309/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/rkennke.wordpress.com/309/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/rkennke.wordpress.com/309/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/rkennke.wordpress.com/309/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/rkennke.wordpress.com/309/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/rkennke.wordpress.com/309/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/rkennke.wordpress.com/309/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/rkennke.wordpress.com/309/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/rkennke.wordpress.com/309/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=rkennke.wordpress.com&amp;blog=9951657&amp;post=309&amp;subd=rkennke&amp;ref=&amp;feed=1&quot; /&gt;rkennke</description>
	<pubDate>Thu, 04 Mar 2010 23:18:25 +0000</pubDate>
</item>
<item>
	<title>Andrew Hughes: IcedTea6 1.7.1 Released!</title>
	<guid>http://blog.fuseyism.com/?p=95</guid>
	<link>http://blog.fuseyism.com/index.php/2010/02/26/icedtea6-171-released/</link>
	<description>&lt;p&gt;We are pleased to announce the release of IcedTea6 1.7.1!&lt;/p&gt;
&lt;p&gt;The IcedTea project provides a harness to build the source code from&lt;br /&gt;
OpenJDK6 using Free Software build tools. It also includes the only&lt;br /&gt;
Free Java plugin and Web Start implementation, and support for&lt;br /&gt;
additional architectures over and above x86, x86_64 and SPARC via the&lt;br /&gt;
Zero assembler port.&lt;/p&gt;
&lt;h2&gt;What&amp;#8217;s New?&lt;/h2&gt;
&lt;h3&gt;Bug fixes&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=179&quot;&gt;PR179&lt;/a&gt;: Rhino bootclasspath issue&lt;/li&gt;
&lt;li&gt;Add missing .c file to PulseAudio build&lt;/li&gt;
&lt;li&gt;Zero/Shark
&lt;ul&gt;
&lt;li&gt;Formatting changes and other fixes to match upstream&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=428&quot;&gt;PR428&lt;/a&gt;: Shark on ARM precompiled header incls&lt;/li&gt;
&lt;li&gt;Update Shark for LLVM r95390 API change.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://bugs.sun.com/view_bug.do?bug_id=6927165&quot;&gt;S6927165&lt;/a&gt;: Zero S/390 fixes (from upstream)&lt;/li&gt;
&lt;li&gt;Implemented Shark host CPU feature autotuner using LLVM 2.7 APIs.&lt;/li&gt;
&lt;li&gt;Add s390 support to TCK setup helper script&lt;/li&gt;
&lt;li&gt;Strip stupid options that llvm-config supplies&lt;/li&gt;
&lt;li&gt;Update Shark for LLVM r94686 API change.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://bugs.sun.com/view_bug.do?bug_id=6914622&quot;&gt;S6914622&lt;/a&gt;, &lt;a href=&quot;http://bugs.sun.com/view_bug.do?bug_id=6909153&quot;&gt;S6909153&lt;/a&gt;, &lt;a href=&quot;http://bugs.sun.com/view_bug.do?bug_id=6913869&quot;&gt;S6913869&lt;/a&gt; upstream Zero fixes.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;NPPlugin fixes
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=446&quot;&gt;PR446&lt;/a&gt;: Use JDK_UPDATE_VERSION to set the jpi version.&lt;/li&gt;
&lt;li&gt;Re-designed frame embedding code so that the applet is dynamically packed into given handle. This increases stability and breaks reliance on the assumption that the browser will always provide a handle in a certain sequence.&lt;/li&gt;
&lt;li&gt;Encode new lines, carriage returns, and other special characters before sending them to Java side (de-coding code is already in effect on the Java side).&lt;/li&gt;
&lt;li&gt;Centralised and increased timeouts to give slow-loading applets enough time to load.&lt;/li&gt;
&lt;li&gt;Fix security permissions related to get/set property, based on specifications.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The tarball can be downloaded from:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://icedtea.classpath.org/download/source/icedtea6-1.7.1.tar.gz&quot;&gt;http://icedtea.classpath.org/download/source/icedtea6-1.7.1.tar.gz&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The following people helped with the 1.7 release series:&lt;/p&gt;
&lt;p&gt;Lillian Angel, Gary Benson, Deepak Bhole, Andrew Haley, Andrew John Hughes, Nobuhiro Iwamatsu, Matthias Klose, Martin Matejovic, Edward Nevill, Xerxes Rånby, Robert Schuster,Jon VanAlten, Mark Wielaard and Man Lung Wong.&lt;/p&gt;
&lt;p&gt;We would also like to thank the bug reporters and testers!&lt;/p&gt;
&lt;p&gt;To get started:&lt;/p&gt;
&lt;pre&gt;
$ tar xzf icedtea6-1.7.1.tar.gz
$ cd icedtea6-1.7.1
&lt;/pre&gt;
&lt;p&gt;Full build requirements and instructions are in INSTALL:&lt;/p&gt;
&lt;pre&gt;
$ ./configure [--enable-visualvm --with-openjdk --enable-pulse-java
--enable-systemtap ...]
$ make
&lt;/pre&gt;</description>
	<pubDate>Fri, 26 Feb 2010 17:52:18 +0000</pubDate>
</item>
<item>
	<title>Joe Darcy: Notions of Floating-Point Equality</title>
	<guid>http://blogs.sun.com/darcy/entry/notions_of_floating_point_equality</guid>
	<link>http://blogs.sun.com/darcy/entry/notions_of_floating_point_equality</link>
	<description>&lt;p&gt;

Moving on from 
&lt;a href=&quot;http://blogs.sun.com/darcy/entry/api_design_identity_and_equality&quot; title=&quot;API Design: Identity and Equality&quot;&gt;identity and equality of objects&lt;/a&gt;, different notions of equality are also surprisingly subtle in some numerical realms.

&lt;/p&gt;

&lt;p&gt;

As &lt;a href=&quot;http://mail.openjdk.java.net/pipermail/nio-dev/2009-November/000792.html&quot; title=&quot;Nov. 2009 nio-dev thread on DoubleBuffer.compareTo is not anti-symmetric&quot;&gt;comes up from time to time&lt;/a&gt; and is often surprising, the &quot;&lt;code&gt;==&lt;/code&gt;&quot; operator defined by IEEE 754 and used by Java for comparing floating-point values 
(&lt;a href=&quot;http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.21.1&quot; title=&quot;Numerical Equality Operators == and !=&quot;&gt;JLSv3 &amp;sect;15.21.1&lt;/a&gt;)
is &lt;em&gt;not&lt;/em&gt; an &lt;i&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Equivalence_relation&quot;&gt;equivalence relation&lt;/a&gt;&lt;/i&gt;.  Equivalence relations satisfy three properties, reflexivity (something is equivalent to itself), symmetry (if &lt;i&gt;a&lt;/i&gt; is equivalent to &lt;i&gt;b&lt;/i&gt;, &lt;i&gt;b&lt;/i&gt; is equivalent to &lt;i&gt;a&lt;/i&gt;), and transitivity (if &lt;i&gt;a&lt;/i&gt; is equivalent to &lt;i&gt;b&lt;/i&gt; and &lt;i&gt;b&lt;/i&gt; is equivalent to &lt;i&gt;c&lt;/i&gt;, then &lt;i&gt;a&lt;/i&gt; is equivalent to &lt;i&gt;c&lt;/i&gt;).

&lt;/p&gt;

&lt;p&gt;

The IEEE 754 standard defines four possible mutually exclusive  
ordering relations between floating-point values:&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;equal
&lt;/p&gt;

&lt;li&gt;&lt;p&gt;greater than
&lt;/p&gt;

&lt;li&gt;&lt;p&gt;less than
&lt;/p&gt;

&lt;li&gt;&lt;p&gt;unordered
&lt;/p&gt;

&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;

A NaN (Not a Number) is &lt;em&gt;unordered&lt;/em&gt; with respective to every floating-point value, 
including itself.  This was done so that NaNs would not quietly slip by without due notice.  Since (NaN == NaN) is false, the IEEE 754 &quot;&lt;code&gt;==&lt;/code&gt;&quot; relation is &lt;em&gt;not&lt;/em&gt; an equivalence relation since it is not reflexive.

&lt;/p&gt;

&lt;p&gt;

An equivalence relation partitions a set into equivalence classes; each member of an equivalence classes is &quot;the same&quot; as the other members of the classes for the purposes of that equivalence relation.  In terms of numerics, one would expect equivalent values to result in equivalent numerical results in all cases.  Therefore, the size of the equivalence classes over floating-point values would be expected to be one; a number would only be equivalent to itself.  However, in IEEE 754 there are two zeros, -0.0 and +0.0, and they compare as equal under &lt;code&gt;==&lt;/code&gt;.  For IEEE 754 addition and subtraction, the sign of a zero argument can at most affect the sign of a zero result.  That is, if the sum or difference is not zero, a zero of either sign doesn't change the result.  If the sum or differnece is zero and one of the arguments is zero, the other argument must be zero too:

&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;-0.0 + -0.0 &amp;rArr; -0.0
&lt;/p&gt;

&lt;li&gt;&lt;p&gt;-0.0 + +0.0 &amp;rArr; +0.0
&lt;/p&gt;

&lt;li&gt;&lt;p&gt;+0.0 + -0.0 &amp;rArr; +0.0
&lt;/p&gt;

&lt;li&gt;&lt;p&gt;+0.0 + +0.0 &amp;rArr; +0.0
&lt;/p&gt;

&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;

Therefore, under addition and subtraction, both signed zeros are equivalent.  However, they are &lt;em&gt;not&lt;/em&gt; equivalent under division since 1.0/&lt;b&gt;-&lt;/b&gt;0.0  &amp;rArr; 
-&amp;#8734;  but 1.0/&lt;b&gt;+&lt;/b&gt;0.0 &amp;rArr; +&amp;#8734;  and -&amp;#8734;  and +&amp;#8734; are &lt;em&gt;not&lt;/em&gt; equivalent.&lt;a href=&quot;http://blogs.sun.com/darcy/feed/entries/rss#affine&quot;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;

&lt;/p&gt;

&lt;p&gt;

Despite the rationales for the IEEE 754 specification to not define &lt;code&gt;==&lt;/code&gt; as an equivalence relation, there are legitimate cases where one needs a true equivalence relation over floating-point values, such as when writing test programs, and cases where one needs a total ordering, such as when sorting.  In my numerical tests I use a method 
that returns &lt;code&gt;true&lt;/code&gt; for two floating-point values &lt;i&gt;x&lt;/i&gt; and &lt;i&gt;y&lt;/i&gt; if:&lt;br /&gt;

((&lt;i&gt;x&lt;/i&gt; == &lt;i&gt;y&lt;/i&gt;) &amp;amp;&amp;amp;&lt;br /&gt;
 (if &lt;i&gt;x&lt;/i&gt; and &lt;i&gt;y&lt;/i&gt; are both zero they have the same sign)) || &lt;br /&gt;
(x and y are both NaN)&lt;br /&gt;

Conveniently, this is just computed by using &lt;code&gt;(Double.compare(x, y) == 0)&lt;/code&gt;.  For sorting or a total order, the semantics of &lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/Double.html#compare(double,%20double)&quot;&gt;&lt;code&gt;Double.compare&lt;/code&gt;&lt;/a&gt; are fine; NaN is treated as being the largest floating-point values, greater than positive infinity, and -0.0  +0.0.  That ordering is the total order used by by &lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/util/Arrays.html#sort(double[])&quot;&gt;&lt;code&gt;java.util.Arrays.sort(double[])&lt;/code&gt;&lt;/a&gt;.  In terms of semantics, it doesn't really matter where the NaNs are ordered with respect to ther values to as long as they are consistently ordered that way.&lt;sup&gt;&lt;a href=&quot;http://blogs.sun.com/darcy/feed/entries/rss#bitwise&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;

&lt;/p&gt;

&lt;p&gt;

These subtleties of floating-point comparison were also germane on the Project Coin mailing list last year; the &lt;a href=&quot;http://mail.openjdk.java.net/pipermail/coin-dev/2009-March/000566.html&quot;&gt;definition of floating-point equality was discussed in relation to adding support for relational operations based on a type implementing the &lt;code&gt;Comparable&lt;/code&gt; interface&lt;/a&gt;.  That thread also broached the complexities involved in comparing &lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/math/BigDecimal.html&quot;&gt;BigDecimal&lt;/a&gt;&lt;/p&gt; values.



&lt;p&gt;

The &lt;code&gt;BigDecimal&lt;/code&gt; class has a natural ordering that is &lt;em&gt;inconsistent with equals&lt;/em&gt;; that is for at least some inputs &lt;code&gt;bd1&lt;/code&gt; and &lt;code&gt;bd2&lt;/code&gt;, &lt;br /&gt;
&lt;code&gt;c.compare(bd1, bd2)==0&lt;/code&gt;&lt;br /&gt;
has a different boolean value than&lt;br /&gt;
&lt;code&gt;bd1.equals(bd2)&lt;/code&gt;.&lt;sup&gt;&lt;a href=&quot;http://blogs.sun.com/darcy/feed/entries/rss#consistent&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;br /&gt;

In &lt;code&gt;BigDecimal&lt;/code&gt;, the same numerical value can have multiple representations, such as (100 &amp;times; 10&lt;sup&gt;0&lt;/sup&gt;) versus (10 &amp;times; 10&lt;sup&gt;1&lt;/sup&gt;) versus (1 &amp;times; 10&lt;sup&gt;2&lt;/sup&gt;).  These are all &quot;the same&quot; numerically (&lt;code&gt;compareTo == 0&lt;/code&gt;) but are &lt;em&gt;not&lt;/em&gt; &lt;code&gt;equals&lt;/code&gt; with each other.  Such values are not equivalent under the operations supported by &lt;code&gt;BigDecimal&lt;/code&gt;; for example (100 &amp;times; 10&lt;sup&gt;0&lt;/sup&gt;) has a &lt;i&gt;&lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/math/BigDecimal.html#scale()&quot;&gt;scale&lt;/a&gt;&lt;/i&gt; of 0 while (1 &amp;times; 10&lt;sup&gt;2&lt;/sup&gt;) has a scale of -2.&lt;sup&gt;&lt;a href=&quot;http://blogs.sun.com/darcy/feed/entries/rss#cohort&quot;&gt;4&lt;/a&gt;&lt;/sup&gt;

&lt;/p&gt;

&lt;p&gt;

While subtle, the different notions of numerical equality each serve a useful purpose and knowing which notion is appropriate for a given task is an important factor in writing correct programs.

&lt;/p&gt;

&lt;hr width=&quot;50%&quot; /&gt;

&lt;blockquote&gt;
&lt;p&gt;
&lt;a name=&quot;affine&quot;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt; There are two zeros in IEEE 754 
because there are two infinities.  Another way to extend the real numbers to include infinity is to have a single (unsigned) projective infinity.  In 
such a system, there is only one conceptual zero.  Early x87 chips before IEEE 754 
was standardized had support for both signed (affine) and projective 
infinities.  Each style of infinity is more convenient for some kinds of computations.
&lt;/p&gt;

&lt;p&gt;
&lt;sup&gt;&lt;a name=&quot;bitwise&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;

Besides the equivalence relation offered by &lt;code&gt;Double.compare(x, y)&lt;/code&gt;, another equivalence relation can be induced by either of the bitwise conversion routines, &lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/Double.html#doubleToLongBits(double)&quot;&gt;Double.doubleToLongBits&lt;/a&gt; or &lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/Double.html#doubleToRawLongBits(double)&quot;&gt;Double.doubleToRawLongBits&lt;/a&gt;.  The former collapses all bit patterns that encode a NaN value into a single canonical NaN bit pattern, while the latter can let through a platform-specific NaN value.  Implementation freedoms allowed by the original IEEE 754 standard have allowed different processor families to define different conventions for NaN bit patterns. 

&lt;/p&gt;

&lt;p&gt;
&lt;sup&gt;&lt;a name=&quot;consistent&quot;&gt;3&lt;/a&gt;&lt;/sup&gt; I've at times considered whether it would be worthwhile to include an &quot;&lt;code&gt;@NaturalOrderingInconsistentWithEquals&lt;/code&gt;&quot; annotation in the platform to flag the classes that have this quirk.  Such an annotation could be used by various checkers to find potentially problematic uses of such classes in sets and maps.
&lt;/p&gt;

&lt;p&gt;
&lt;sup&gt;&lt;a name=&quot;cohort&quot;&gt;4&lt;/a&gt;&lt;/sup&gt; Building on wording developed for the &lt;code&gt;BigDecimal&lt;/code&gt; specification under &lt;a href=&quot;http://jcp.org/en/jsr/detail?id=13&quot;&gt;JSR 13&lt;/a&gt;, when I was editor of the &lt;a href=&quot;http://en.wikipedia.org/wiki/IEEE_754-2008&quot;&gt;IEEE 754 revision&lt;/a&gt;, I introduced several pieces of decimal-related terminology into the draft.  Those terms include &lt;i&gt;preferred exponent&lt;/i&gt;, analogous to the preferred scale from &lt;code&gt;BigDecimal&lt;/code&gt;, and &lt;i&gt;cohort&lt;/i&gt;, &quot;The set of all floating-point representations that represent a given floating-point number in a
given floating-point format.&quot;  Put in terms of &lt;code&gt;BigDecimal&lt;/code&gt;, the members of a cohort would be all the &lt;code&gt;BigDecimal&lt;/code&gt; numbers with the same numerical value, but distinct pairs of scale (negation of the exponent) and unscaled value.

&lt;/p&gt;

&lt;/blockquote&gt;</description>
	<pubDate>Fri, 26 Feb 2010 09:00:00 +0000</pubDate>
</item>
<item>
	<title>Xerxes Rånby: Sharks and thumbs sighted in various cool constalations</title>
	<guid>http://labb.zafena.se/?p=316</guid>
	<link>http://labb.zafena.se/?p=316</link>
	<description>&lt;p&gt;During the past months i have seen some really cool stuff done using small powerefficient ARM computers and OpenJDK.&lt;/p&gt;
&lt;div id=&quot;attachment_318&quot; class=&quot;wp-caption alignright&quot; style=&quot;width: 235px&quot;&gt;&lt;a href=&quot;http://labb.zafena.se/wp-content/uploads/2010/02/simplesimon-connects.jpg&quot;&gt;&lt;img class=&quot;size-medium wp-image-318&quot; title=&quot;simplesimon-connects&quot; src=&quot;http://labb.zafena.se/wp-content/uploads/2010/02/simplesimon-connects.jpg&quot; alt=&quot;SimpleSimon connects&quot; width=&quot;225&quot; height=&quot;300&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;Simple Simon PT connected to a hospital laboratory system by using a powerefficient plugcomputer and displaylink usb screen. All powered by OpenJDK&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Simple Simon PT connects:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This project hooks up a battery powered laboratory coagulation device, a Simple Simon PT reader to standard hospital laboratory system using a ASTM-1394-1397 / LIS2-A2 connectivity over ethernet. A small ARM based plugcomputer does all data message processing and communication. User interraction are performed by using the Simon reader and a usb-barcode reader to enter laboratory identification. Optionally can a usb-touch-screen be connected for improved user feedback, by displaying charts using JFreeChart, to show and give a better understanding of the coagulation process.&lt;/p&gt;
&lt;p&gt;Powerconsumption tops at 15W with the USB screen attached and 6W without. All running silent without any moving parts!&lt;/p&gt;
&lt;div id=&quot;attachment_317&quot; class=&quot;wp-caption alignnone&quot; style=&quot;width: 310px&quot;&gt;&lt;a href=&quot;http://labb.zafena.se/wp-content/uploads/2010/02/shark-linked-against-shared-libllvm27svso.jpg&quot;&gt;&lt;img class=&quot;size-medium wp-image-317&quot; title=&quot;shark-linked-against-shared-libllvm27svso&quot; src=&quot;http://labb.zafena.se/wp-content/uploads/2010/02/shark-linked-against-shared-libllvm27svso.jpg&quot; alt=&quot;Shark linked against the shared libLLVM-2.7svn.so&quot; width=&quot;300&quot; height=&quot;225&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;Shark linked against the shared libLLVM-2.7svn.so&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Shark linked against dynamic LLVM .so library&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Earlier today I got Shark linked against a shared libLLVM-2.7svn.so generated by using LLVM 2.7svn trunk. It work by simply building LLVM using configure &amp;#8211;enable-shared &amp;#8211;enable-optimized &amp;#8211;disable-assertions and then tweak the Icedtea6 main Makefiles to use the shared library during liking:&lt;br /&gt;
Replace the line&lt;br /&gt;
&lt;code&gt;LLVM_LIBS = -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMMCParser -lLLVMX86AsmPrinter -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMX86Info -lLLVMJIT -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport -lLLVMSystem&lt;/code&gt;&lt;br /&gt;
with&lt;br /&gt;
&lt;code&gt;LLVM_LIBS = -lLLVM-2.7svn&lt;/code&gt;&lt;br /&gt;
in the main icedtea6/Makefile and then build Icedtea6 normally, Shark currently builds and works right out of the box when using a LLVM release build!&lt;/p&gt;
&lt;p&gt;A cool thing by building shark against the shared library are that you can switch the LLVM JIT that Shark uses from running with or without assertions, debug code, and various extra optimizations by simply replacing the /usr/local/lib/libLLVM-2.7svn.so file with what you want. Linking time during shark builds and shark footprint are impressively smaller as well. Im really happy to see this functionallity in LLVM 2.7!&lt;/p&gt;
&lt;p&gt;The LLVM 2.7 code freeze before the 2.7 release happens in about 1.5 weeks from now and i will stay busy for some days to observe and polish the current LLVM svn trunk to be usable with openjdk-6-shark.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edward Nevill created a ARM Jazelle RTC Thumb2 JIT reference implementation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Meanwhile I have been busy taming Sharks a new kind of Thumb2 JIT have emerged built by Edward Nevill of Cambridge Software Labs! The new Tumb2JIT have been committed into the Icedtea6 trunk and it are a working implementation of Jazelle RTC to be used by ARM Cortex-A8+ class CPUs. It wonderfull that this have been released as free software, Wow!,&lt;/p&gt;
&lt;p&gt;Suddenly we got three different JITs to use on ARM with OpenJDK: Cacao, Shark and T2. An opurtunity has emerged to tier them and so I did. Here comes the raw &amp;#8220;truth&amp;#8221; produced by Caffeine Mark 3! This will probably be the last time i will show off any Caffeine Mark 3 benchmark since it really dont give justice on real world client applications where responsiveness are more crucial than top runtime speed, nevertheless benchmarking using CM30 have always felt fun so here we go: All benchmarks running using a Sharp PC-Z1 Cortex-A8 Mobile internet tool.&lt;/p&gt;
&lt;div id=&quot;attachment_328&quot; class=&quot;wp-caption alignnone&quot; style=&quot;width: 1314px&quot;&gt;&lt;a href=&quot;http://labb.zafena.se/wp-content/uploads/2010/02/tier-t2-shark-cacao.png&quot;&gt;&lt;img class=&quot;size-full wp-image-328&quot; title=&quot;tier-t2-shark-cacao&quot; src=&quot;http://labb.zafena.se/wp-content/uploads/2010/02/tier-t2-shark-cacao.png&quot; alt=&quot;Tier between Edwards Thumb 2 JIT , Shark LLVM JIT and Cacao JIT: All running on OpenJDK 6 ARM&quot; width=&quot;1304&quot; height=&quot;299&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;Tier between Edwards Thumb 2 JIT , Shark LLVM JIT and Cacao JIT: All running on a ARM Sharp PC-Z1 Mobile internet tool smartbook using OpenJDK 6 compiled with Icedtea6.&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;This new T2 JIT&amp;#8217;s main strenght are reduced jitting time, it basically cuts all jtting time to almost zero and client applications on ARM finnaly runs from tick one. This thumb2 jit makes a really nice java applet browser experience with about 15 seconds first applet startuptime on a ARM smartbook and and all usable instantly after being loaded.&lt;br /&gt;
&lt;a href=&quot;http://labb.zafena.se/wp-content/uploads/2010/02/java-applets-on-sharp-pc-z1-featuring-the-new-t2jit.3gp&quot;&gt;A small 1min 12seconds .3gp movie displaying some java applets running on the Sharp PC-Z1 featuring the new thumb2jit from Icedtea6&lt;br /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cheers and have a great day!&lt;br /&gt;
Xerxes&lt;/p&gt;</description>
	<pubDate>Thu, 25 Feb 2010 19:43:26 +0000</pubDate>
</item>
<item>
	<title>Christian Thalinger (Adv): First invokedynamic call on SPARC</title>
	<guid>http://blogs.sun.com/twisti/entry/first_invokedynamic_call_on_sparc</guid>
	<link>http://www.advogato.org/person/twisti/diary.html?start=35</link>
	<description>&lt;p&gt;Today I successfully executed an invokedynamic call on SPARC for the first time.&amp;nbsp; Excellent!&lt;/p&gt; 
  &lt;pre&gt;$ bin/jruby.gamma -J-XX:+UseSerialGC -J-Djruby.compile.invokedynamic=true -J-Xint -J-XX:+UnlockExperimentalVMOptions -J-XX:+EnableMethodHandles -J-XX:+EnableInvokeDynamic bench/bench_fib_recursive.rb 
OpenJDK Server VM (17.0-b08-internal-jvmg) for solaris-sparc JRE (1.7.0), built on Feb 25 2010 04:35:47 by &quot;ct232829&quot; with Workshop 5.9
VM option '+UseSerialGC'
VM option '+UnlockExperimentalVMOptions'
VM option '+EnableMethodHandles'
VM option '+EnableInvokeDynamic'
 52.813000   0.000000  52.813000 ( 52.296000)
 52.824000   0.000000  52.824000 ( 52.823000)
 51.808000   0.000000  51.808000 ( 51.808000)
 49.740000   0.000000  49.740000 ( 49.740000)
 49.450000   0.000000  49.450000 ( 49.450000)
&lt;/pre&gt; 
  &lt;p&gt;MethodHandle calls already work since a couple of days and I can run the JDK &lt;a href=&quot;http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/a9b4fde406d4/test/java/dyn/MethodHandlesTest.java&quot;&gt;MethodHandlesTest&lt;/a&gt; without any errors:&lt;/p&gt; 
  &lt;pre&gt;$ gamma -Xinternalversion
OpenJDK Server VM (17.0-b08-internal-jvmg) for solaris-sparc JRE (1.7.0), built on Feb 25 2010 04:35:47 by &quot;ct232829&quot; with Workshop 5.9
$ gamma -Xint -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles -classpath /java/devtools/share/junit/latest/junit.jar:. org.junit.runner.JUnitCore MethodHandlesTestVM option '+UnlockExperimentalVMOptions'
VM option '+EnableMethodHandles'
JUnit version 4.4
OpenJDK Server VM warning: JSR 292 invokedynamic is disabled in this JVM.  Use -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic to enable.
.IIIIII.findStatic
:::::::::::.findVirtual
:::::::::::::::.findSpecial
::.bind
::::::::::::::::::::::.unreflect
::::::::::::::::::::::::I.unreflectGetter
.unreflectSetter
.arrayElementGetter
.arrayElementSetter
.convertArguments
::::::.permuteArguments
.spreadArguments
.collectArguments
.insertArguments
.filterArguments
.foldArguments
.dropArguments
.exactInvoker, genericInvoker, varargsInvoker, dynamicInvoker
.guardWithTest
.catchException
.throwException
.testCastFailure

Time: 7.984

OK (23 tests)
&lt;/pre&gt; 
  &lt;p&gt;JSR 292 SPARC support is on its way...&lt;br /&gt;&lt;/p&gt;</description>
	<pubDate>Thu, 25 Feb 2010 13:12:45 +0000</pubDate>
</item>
<item>
	<title>Roman Kennke: Beatles review: With The Beatles</title>
	<guid>http://rkennke.wordpress.com/?p=296</guid>
	<link>http://rkennke.wordpress.com/2010/02/24/beatles-review-with-the-beatles/</link>
	<description>&lt;p&gt;Let&amp;#8217;s continue the Beatles reviews that I started with &lt;a href=&quot;http://rkennke.wordpress.com/2010/02/22/beatles-review-please-please-me/&quot;&gt;Please Please Me&lt;/a&gt; with their next album: &lt;a href=&quot;http://www.lastfm.de/music/The+Beatles/With+the+Beatles&quot;&gt;With The Beatles&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I remember quite well when I first listened this album for the first time. It is one of those albums that immediately bring up the mood, smell and details of that particular situation and time in my life. I was about 11 years old (I guess) and visiting my father. He had a czech print of this album, and I listened it over his great headphone. Of course I copied it to cassette (at this point cassette and reel tape was the only source of music for me, no thinking of CDs yet). I listened it over and over again in my walkman and couldn&amp;#8217;t get enough of it. The weird hard-panned stereo mix allowed for fun experiments: if you only listen to one channel, you get voices and drums (for example) and on the other channel guitars and base, etc. Quite fun. I was a bit disappointed when I bought the CD later that it was only available in mono &amp;#8211; now I understand that the mono version is infact much better overall. Like with the first album (and the next albums as well), the stereo mixes have some glitches that were corrected in mono (listen the start of &amp;#8216;Roll Over Beethoven&amp;#8217; as an example). The album blasts off with &amp;#8216;It Won&amp;#8217;t Be Long&amp;#8217; (doing the Yeah shouting that they became famous for with their single She Loves You &amp;#8211; which did not end up on the album) and keeps the energy until the last note of &amp;#8216;Money&amp;#8217;. Compared to their first album it is slightly more complex, they added a piano (and a rumbling piano that is) and refined their sound. Where the first album was sort of a generic beat music thing, this album is definitely Beatles (in full swing of Beatlemania). They also deliver the same basic ingredients that were also present on the first album: love songs, rockers, exotic stuff, cover versions, some George and some Ringo. My favorite is probably the last song &amp;#8216;Money (that&amp;#8217;s what I want)&amp;#8217; (money seems to be a recurring theme in their career, as if they had too little: &amp;#8216;Can&amp;#8217;t Buy Me Love&amp;#8217;, &amp;#8216;Taxman&amp;#8217;, &amp;#8216;Baby You&amp;#8217;re a Rich Man&amp;#8217; and finally &amp;#8216;You Never Give Me Your Money&amp;#8217; and probably some others that I forgot). The cover of the album is also notable: instead of the happy-go-lucky photographs that was to be expected, it shows an arty black and white photo with the four in black polo neck pullovers. To me this is one of my favorite album covers of the Beatles. I really enjoyed listening this album today, it&amp;#8217;s a good album for foggy days, but apparently it also works for sunny spring days like today &lt;img src=&quot;http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif&quot; alt=&quot;:-)&quot; class=&quot;wp-smiley&quot; /&gt;  Please let me know how do you like the album in the comments below, and stay tuned for the next album &lt;a href=&quot;http://rkennke.wordpress.com/2010/03/04/beatles-review-a-hard-days-night/&quot;&gt;A Hard Day&amp;#8217;s Night&lt;/a&gt;.&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/rkennke.wordpress.com/296/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/rkennke.wordpress.com/296/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/rkennke.wordpress.com/296/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/rkennke.wordpress.com/296/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/rkennke.wordpress.com/296/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/rkennke.wordpress.com/296/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/rkennke.wordpress.com/296/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/rkennke.wordpress.com/296/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/rkennke.wordpress.com/296/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/rkennke.wordpress.com/296/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=rkennke.wordpress.com&amp;blog=9951657&amp;post=296&amp;subd=rkennke&amp;ref=&amp;feed=1&quot; /&gt;rkennke</description>
	<pubDate>Wed, 24 Feb 2010 22:05:23 +0000</pubDate>
</item>
<item>
	<title>Joe Darcy: API Design: Identity and Equality</title>
	<guid>http://blogs.sun.com/darcy/entry/api_design_identity_and_equality</guid>
	<link>http://blogs.sun.com/darcy/entry/api_design_identity_and_equality</link>
	<description>&lt;p&gt;

When designing types to be reused by others, there are &lt;a href=&quot;http://blogs.sun.com/darcy/entry/api_design_interfaces_versus_abstract&quot; title=&quot;API Design: Interfaces versus Abstract Classes&quot;&gt;reasons to favor interfaces over abstract classes&lt;/a&gt;.

One complication of using an interface-based approach stems from defining reasonable behavior for the &lt;code&gt;equals&lt;/code&gt; and &lt;code&gt;hashCode&lt;/code&gt; methods, especially if different implementations are intended to play well together when used in data structures like &lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/util/Collection.html&quot;&gt;collections&lt;/a&gt;, in particular if an interface type is meant to serve as the key of a &lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/util/Map.html&quot;&gt;map&lt;/a&gt; or as the element type of a &lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/util/Set.html&quot;&gt;set&lt;/a&gt;.

&lt;/p&gt;

&lt;p&gt;

Some interfaces, like &lt;code&gt;CharSequence&lt;/code&gt;, are designed to &lt;em&gt;not&lt;/em&gt; be a usable type for a map key or an element type of a set:

&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;

&lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/CharSequence.html&quot;&gt;[The &lt;code&gt;CharSequence&lt;/code&gt;] interface&lt;/a&gt; does not refine the general contracts of the &lt;code&gt;equals&lt;/code&gt; and &lt;code&gt;hashCode&lt;/code&gt; methods. The result of comparing two objects that implement &lt;code&gt;CharSequence&lt;/code&gt; is therefore, in general, undefined. Each object may be implemented by a different class, and there is no guarantee that each class will be capable of testing its instances for equality with those of the other. It is therefore inappropriate to use arbitrary &lt;code&gt;CharSequence&lt;/code&gt; instances as elements in a set or as keys in a map. 

&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;

Amongst other problems, &lt;code&gt;CharSequence&lt;/code&gt;s are not required to be immutable so  in general there are always hazards from &lt;a href=&quot;http://en.wikipedia.org/wiki/Time-of-check-to-time-of-use&quot;&gt;time of check to time of use&lt;/a&gt; conditions.  


&lt;/p&gt;

&lt;p&gt;

Even if a type is not suitable as a map key, it can be fine as the type of the &lt;em&gt;value&lt;/em&gt; to which a key gets mapped.  

Likewise, even if type cannot serve as the element type of a set, it can often still be perfectly fine as the element type of a &lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/util/List.html&quot;&gt;list&lt;/a&gt;.

&lt;/p&gt;

&lt;p&gt;

Expanding on a slide from my JavaOne talk 
&lt;a href=&quot;http://blogs.sun.com/darcy/resource/JavaOne/J1_2008-BOF-5874.pdf&quot; title=&quot;Slides for JavaOne 2008 bof: Tips and Tricks...&quot;&gt;&lt;i&gt;Tips and Tricks for Using Language Features in API Design and Implementation&lt;/i&gt;&lt;/a&gt;, for interface types intended to be used as map keys or set elements, equality can be defined in several ways.

First, equality can be defined solely in terms of information retrievable from methods of the interface.  Alternatively, equality can be defined in terms of information retrievable via the interface methods &lt;em&gt;as well as&lt;/em&gt; additional information.  Finally, object identity (the &lt;code&gt;==&lt;/code&gt; relation) is always a valid definition for &lt;code&gt;equals&lt;/code&gt; and often a good implementation choice.

&lt;/p&gt;

&lt;p&gt;

An example of the first kind of equality definition is specified for annotation types:

&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;
&lt;code&gt;&lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/annotation/Annotation.html#equals(java.lang.Object)&quot;&gt;java.lang.annotation.Annotation.equals(Object)&lt;/a&gt;&lt;/code&gt;:&lt;br /&gt;
Returns true if the specified object represents an annotation that is logically equivalent to this one. In other words, returns true if the specified object is an instance of the same annotation type as this instance, all of whose members are equal to the corresponding member of this annotation, as defined below: ...
&lt;/p&gt;

&lt;p&gt;
&lt;code&gt;&lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/annotation/Annotation.html#hashCode()&quot;&gt;java.lang.annotation.Annotation.hashCode()&lt;/a&gt;&lt;/code&gt;:&lt;br /&gt;
Returns the hash code of this annotation, as defined below:&lt;br /&gt;

The hash code of an annotation is the sum of the hash codes of its members (including those with default values), as defined below:...
&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;

A consequence of defining equality in this manner is that the &lt;code&gt;hashCode&lt;/code&gt; algorithm must also be specified.  If it were not specified, the &lt;code&gt;equals&lt;/code&gt;/&lt;code&gt;hashCode&lt;/code&gt;  contract would be violated since &lt;em&gt;equal objects must have equal &lt;code&gt;hashCodes&lt;/code&gt;&lt;/em&gt;.  Therefore, different implementations of this style of interface must have enough information to implement the equals method and have a precise algorithm for &lt;code&gt;hashCode&lt;/code&gt;.

&lt;/p&gt;

&lt;p&gt;

An annotation type is a kind of interface.  At runtime, &lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/reflect/Proxy.html&quot;&gt;dynamic proxies&lt;/a&gt; are used to create  the core reflection objects implementing annotation types, such as the objects returned by the
&lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/reflect/AnnotatedElement.html#getAnnotation(java.lang.Class)&quot;&gt;&lt;code&gt;getAnnotation&lt;/code&gt;&lt;/a&gt; method.  After a quick identity check, the equals algorithm used in the proxy sees if the annotation type of the two annotation objects is the same and then compares the results of the annotation type's methods.  This indirection allows the annotation objects from core reflection to interact properly with other implementations of annotation objects.  The annotation objects generated for annotation processing in &lt;code&gt;apt&lt;/code&gt; and &lt;code&gt;javac&lt;/code&gt; both use the same underlying implementation as core reflection.  However, completely independent annotation implementations are fine too.  For example, the code below

&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
import javax.annotation.processing.*;
import javax.lang.model.SourceVersion;
import java.lang.annotation.*;
import java.lang.reflect.*;
import java.util.*;

/**
 * Demonstrate equality of different annotation implementations.
 */
@SupportedSourceVersion(SourceVersion.RELEASE_6)
public class AnnotationEqualityDemonstration {
    static class MySupportedSourceVersion implements SupportedSourceVersion {
        private final SourceVersion sourceVersion;

        private MySupportedSourceVersion(SourceVersion sourceVersion) {
            this.sourceVersion = sourceVersion;
        }

        public Class annotationType() {
            return SupportedSourceVersion.class;
        }

        public SourceVersion value() {
            return sourceVersion;
        }
           
        public boolean equals(Object o) {
            if (o instanceof SupportedSourceVersion) {
                SupportedSourceVersion ssv = (SupportedSourceVersion) o;
                return ssv.value() == sourceVersion;
            }
            return false;
        }

        public int hashCode() {
            return (127 * &quot;value&quot;.hashCode()) ^ sourceVersion.hashCode();
        }
    }

    public static void main(String... args) {
        SupportedSourceVersion reflectSSV =
            AnnotationEqualityDemonstration.class.getAnnotation(SupportedSourceVersion.class);
        SupportedSourceVersion localSSV = 
            new MySupportedSourceVersion(reflectSSV.value());

        System.out.println(&quot;reflectSSV == localSSV is &quot; +
                           (reflectSSV == localSSV));

        System.out.println(&quot;reflectSSV.equals(localSSV) is &quot; +
                           reflectSSV.equals(localSSV));

        System.out.println(&quot;localSSV.equals(reflectSSV) is &quot; +
                           localSSV.equals(reflectSSV));

        System.out.println(&quot;reflectSSV.getClass()equals(localSSV.getClass()) is &quot; +
                           reflectSSV.getClass().equals(localSSV.getClass()));

        System.out.println(&quot;\nreflectSSV.hashCode() is &quot; +
                           reflectSSV.hashCode());

        System.out.println(&quot;localSSV.hashCode()   is &quot; +
                           localSSV.hashCode());
    }
}

&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;

when run outputs:

&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
reflectSSV == localSSV is false
reflectSSV.equals(localSSV) is true
localSSV.equals(reflectSSV) is true
reflectSSV.getClass()equals(localSSV.getClass()) is false

reflectSSV.hashCode() is 1867635603
localSSV.hashCode()   is 1867635603
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;

The second kind of equality definition is specified for the language modeling interfaces in the &lt;code&gt;javax.lang.model.element&lt;/code&gt; package:

&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;
&lt;code&gt;&lt;a href=&quot;http://java.sun.com/javase/6/docs/api/javax/lang/model/element/Element.html#equals(java.lang.Object)&quot;&gt;javax.lang.model.element.Element.equals(Object)&lt;/a&gt;&lt;/code&gt;:&lt;br /&gt;

Note that the identity of an element involves implicit state not directly accessible from the element's methods, including state about the presence of unrelated types. Element objects created by different implementations of these interfaces should not be expected to be equal even if &quot;the same&quot; element is being modeled; this is analogous to the inequality of &lt;code&gt;Class&lt;/code&gt; objects for the same class file loaded through different class loaders. 

&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;

Inside &lt;code&gt;javac&lt;/code&gt;, instance control is used for the implementation classes for &lt;code&gt;javax.lang.model.element.Element&lt;/code&gt; subtypes. This allows the default pointer equality to be used and allows the hashing algorithm to not be specified.  Just as &lt;a href=&quot;http://en.wikiquote.org/wiki/Heraclitus&quot;&gt;you can't step in the same river twice&lt;/a&gt;,  the identity of an &lt;code&gt;Element&lt;/code&gt; object is tied to the context in which it is created.  Operationally, one consequence of this context sensitivity is that Element objects modeling &quot;the same&quot; type produced during different rounds of annotation processing will &lt;em&gt;not be equal&lt;/em&gt; even if there are equivalent methods, fields, constructors, etc. in both types in both rounds.

&lt;/p&gt;

&lt;p&gt;

When independent implementations of an interface and &lt;em&gt;not&lt;/em&gt; required to be equal to one another, the &lt;code&gt;hashCode&lt;/code&gt; algorithm does &lt;em&gt;not&lt;/em&gt; need to be specified, providing the implementer more flexibility.  This second style of specification allows disjoint islands of implementations to be defined.  

&lt;/p&gt;

&lt;p&gt;

Which style of specification is more appropriate depends on how the interface type is intended to be used.  Defining interoperable implementation is more difficult and limits the ability of the interface to be retrofitted onto existing types.  For example, while the Element interface and other interfaces from &lt;a href=&quot;http://jcp.org/en/jsr/detail?id=269&quot;&gt;JSR 269&lt;/a&gt; were successfully implemented by classes in both &lt;code&gt;javac&lt;/code&gt; and Eclipse, it would be impractical to expect Element objects from those disparate implementations to compare as equal.

&lt;a href=&quot;http://blogs.sun.com/darcy/entry/enums_and_mixins&quot; title=&quot;Mixing-in an Enum&quot;&gt;Mixin interfaces&lt;/a&gt;, like &lt;code&gt;CharSequence&lt;/code&gt; and &lt;code&gt;Closeable&lt;/code&gt;, should be cautious in defining equals behavior if the interface is intended to be widely implemented.  In some cases, a mixin interface can finesse this issue by being limited to an existing type hierarchy with already defined &lt;code&gt;equals&lt;/code&gt; and &lt;code&gt;hashCode&lt;/code&gt; polices.  For example, the &lt;code&gt;Parameterizable&lt;/code&gt; and &lt;code&gt;QualifiedNameable&lt;/code&gt; interfaces added to the &lt;code&gt;javax.lang.model.element&lt;/code&gt; package in JDK 7 
(&lt;a href=&quot;http://bugs.sun.com/view_bug.do?bug_id=6460529&quot; title=&quot;Provide mixin interfaces for getQualifiedName and getTypeParameters&quot;&gt;6460529&lt;/a&gt;) 
are extensions to &lt;code&gt;javax.lang.model.Element&lt;/code&gt; and therefore get to reuse the existing policies quoted above.

&lt;/p&gt;</description>
	<pubDate>Wed, 24 Feb 2010 17:00:00 +0000</pubDate>
</item>
<item>
	<title>David Gilbert: Be The Change</title>
	<guid>http://www.jroller.com/dgilbert/entry/be_the_change</guid>
	<link>http://www.jroller.com/dgilbert/entry/be_the_change</link>
	<description>So, yesterday was the 10 year anniversary of the first release of &lt;a href=&quot;http://www.jfree.org/jfreechart/&quot;&gt;JFreeChart&lt;/a&gt;, and it slipped by without me noticing!  I knew it was coming up, and even checked the exact date a few weeks back, but then on the day I had so much else to do.  Life is like that at the moment.  Anyway, tonight as I walked home from work I decided a small celebration was in order, so I bought a bottle of &lt;a href=&quot;http://www.marcfinewines.com/profile-New_Zealand-47.php&quot;&gt;New Zealand sunshine&lt;/a&gt; and...cheers!  Here's to 10 years, 50+ releases, 984+ bugs, 61,525 forum posts, 1.3 million downloads, and hundreds of millions of charts generated.  
&lt;br /&gt;&lt;br /&gt;</description>
	<pubDate>Tue, 23 Feb 2010 21:43:28 +0000</pubDate>
</item>
<item>
	<title>Roman Kennke: Beatles review: Please Please Me</title>
	<guid>http://rkennke.wordpress.com/?p=294</guid>
	<link>http://rkennke.wordpress.com/2010/02/22/beatles-review-please-please-me/</link>
	<description>&lt;p&gt;At the end of last year, EMI/Apple re-released the whole Beatles catalogue as a series (or box sets) of remastered CDs. The Beatles were more or less my first encounter with pop music when I was 8 or so, my first self-bought CD at the age of 12 was a Beatles CD and of course, I had to go out and buy these excellent remasters, I got both the mono and stereo editions. I had many weeks now listening these CDs and re-discovering some of the stuff was quite fun, and I want to share my impressions in a short series of short reviews intermingled with some personal anecdotes. Let&amp;#8217;s do it in order of the release of the original LPs and start with &amp;#8216;&lt;a href=&quot;http://www.lastfm.de/music/The+Beatles/Please+Please+Me&quot;&gt;Please Please Me&lt;/a&gt;&amp;#8216;.&lt;/p&gt;
&lt;p&gt;I think this is quite a good career starter. Innocent, powerful, inspired, raw, rocking. It has most of the ingredients of their later Beatlemania success albums, i.e. love songs (P.S. I love you and most others), rockers (I Saw Her Standing There,&amp;#8230;), some cover versions , a slightly more exotic song (A Taste of Honey), some Ringo (Boys), some George (Do You Want To Know a Secret), a weird sense of humor (the Beatles covering a girl group talking about &amp;#8216;Boys&amp;#8217;). I really always enjoy this album. It was recorded in one day, and with John having a sore throat, and it shows &amp;#8211; positively. From the first through the last song you can literally feel the energy of those 4 relatively unknown guys, and sense that the Beatlemania is already about to start. It is what the Beatles were at this point: a hard working live band. Interesting the last song: a kamikaze version of Twist and Shout, with John shredding his vocal chords. Hilarious. It could have been a total fail (with no second chance to record it), but instead it became music history. The stereo version is mostly relevant for historical reasons, the sound beeing a bit thin and the mixes having several glitches which were corrected in the mono mixes. These mono mixes on the other hand are just great and solid rocking. All in all the album always makes for a happy-go-lucky listen on sunny afternoons, even if it is not one of the totally essential ones. Also interesting to note is also the album cover: it shows the four guys on the stairs in the EMI building. Several years later they did the exact same scene again, now with long hair, for the planned last album (Get Back, which should become Let it Be). Both pictures would later be used for the red and blue best of double albums.&lt;/p&gt;
&lt;p&gt;Next one up will be &lt;a href=&quot;http://rkennke.wordpress.com/2010/02/24/beatles-review-with-the-beatles/&quot;&gt;With The Beatles&lt;/a&gt;. Stay tuned. Please tell me what you think about the album in the comments.&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/rkennke.wordpress.com/294/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/rkennke.wordpress.com/294/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/rkennke.wordpress.com/294/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/rkennke.wordpress.com/294/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/rkennke.wordpress.com/294/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/rkennke.wordpress.com/294/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/rkennke.wordpress.com/294/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/rkennke.wordpress.com/294/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/rkennke.wordpress.com/294/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/rkennke.wordpress.com/294/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=rkennke.wordpress.com&amp;blog=9951657&amp;post=294&amp;subd=rkennke&amp;ref=&amp;feed=1&quot; /&gt;rkennke</description>
	<pubDate>Mon, 22 Feb 2010 19:28:04 +0000</pubDate>
</item>
<item>
	<title>Joe Darcy: Everything Older is Newer Once Again</title>
	<guid>http://blogs.sun.com/darcy/entry/everything_older_is_newer_once</guid>
	<link>http://blogs.sun.com/darcy/entry/everything_older_is_newer_once</link>
	<description>&lt;p&gt;

Catching up on writing about more numerical work from years past, the &lt;a href=&quot;http://www.ibm.com/developerworks/java/library/j-math2.html&quot; title=&quot;Java's new math, Part 2: Floating-point numbers&quot;&gt;second article&lt;/a&gt; in a two-part series finished last year discusses some low-level floating-point manipulations methods I added to the platform over the course of JDKs 5 and 6.

Previously, I published a 
&lt;a href=&quot;http://blogs.sun.com/darcy/entry/everything_old_is_new_again&quot; title=&quot;Everything Old is New Again&quot;&gt;blog entry reacting to&lt;/a&gt; the 
&lt;a href=&quot;http://www.ibm.com/developerworks/java/library/j-math1/index.html&quot; title=&quot;Java's new math, Part 1: Real numbers&quot;&gt;first part&lt;/a&gt; of the series.

&lt;/p&gt;

&lt;p&gt;

JDK 6 enjoyed several numerics-related library changes.  Constants for &lt;code&gt;MIN_NORMAL&lt;/code&gt;, &lt;code&gt;MIN_EXPONENT&lt;/code&gt;, and &lt;code&gt;MAX_EXPONENT&lt;/code&gt; were added to the &lt;code&gt;Float&lt;/code&gt; and &lt;code&gt;Double&lt;/code&gt; classes.  I also added to the &lt;code&gt;Math&lt;/code&gt; and &lt;code&gt;StrictMath&lt;/code&gt; classes the following methods for low-level manipulation of floating-point values:

&lt;/p&gt;


&lt;ul&gt;

&lt;li&gt;&lt;code&gt;&lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/Math.html#copySign(double,%20double)&quot;&gt;
public static double copySign(double magnitude, double sign)&lt;/a&gt;&lt;/code&gt;

&lt;li&gt;&lt;code&gt;&lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/Math.html#getExponent(double)&quot;&gt;public static int getExponent(double d)&lt;/a&gt;&lt;/code&gt;

&lt;li&gt;&lt;code&gt;&lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/Math.html#nextAfter(double,%20double)&quot;&gt;public static double nextAfter(double start, double direction)&lt;/a&gt;&lt;/code&gt;

&lt;li&gt;&lt;code&gt;&lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/Math.html#nextUp(double)&quot;&gt;public static double nextUp(double d)&lt;/a&gt;&lt;/code&gt;

&lt;li&gt;&lt;code&gt;&lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/Math.html#scalb(double,%20int)&quot;&gt;public static double scalb(double d, int scaleFactor)&lt;/a&gt;&lt;/code&gt;

&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;

There are also overloaded methods for &lt;code&gt;float&lt;/code&gt; arguments.   

In terms of the &lt;a href=&quot;http://en.wikipedia.org/wiki/IEEE_754-1985&quot;&gt;IEEE 754 standard from 1985&lt;/a&gt;, the methods above provide the core functionality of the &lt;i&gt;recommended functions&lt;/i&gt;.  In terms of the &lt;a href=&quot;http://en.wikipedia.org/wiki/IEEE_754-2008&quot;&gt;2008 revision to IEEE 754&lt;/a&gt;, analogous functions are integrated throughout different sections of the document.

&lt;/p&gt;

&lt;p&gt;

While a student at Berkeley, I wrote a 
&lt;a href=&quot;http://www.jddarcy.org/Research/ieeerecd.pdf&quot;&gt;tech report&lt;/a&gt; on algorithms I developed for an earlier implementation of these methods, an implementation written many years ago when I was a summer intern at  Sun.

The &lt;a href=&quot;http://hg.openjdk.java.net/jdk7/tl/jdk/file/84792500750c/src/share/classes/sun/misc/FpUtils.java&quot; title=&quot;sun.misc.FpUtils as of Feb. 20, 2010&quot;&gt;implementation of the recommended functions in the JDK&lt;a&gt; is a refinement of the earlier work, a refinement that simplified code, added &lt;a href=&quot;http://hg.openjdk.java.net/jdk7/tl/jdk/file/84792500750c/test/java/lang/Math/IeeeRecommendedTests.java&quot; title=&quot;IeeeRecommendedTests.java regression test as of Feb. 20, 2010&quot;&gt;extensive&lt;/a&gt; and 
&lt;a href=&quot;http://blogs.sun.com/darcy/entry/test_where_the_failures_are&quot; title=&quot;Test where the failures are likely to be&quot;&gt;effective&lt;/a&gt; unit tests, and sported better performance in some cases.

In part the simplifications came from &lt;em&gt;not&lt;/em&gt; attempting to accommodate IEEE 754 features not natively supported in the Java platform, in particular rounding modes and sticky flags.

&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;

The primary purpose of these methods is to assist in in the development of math libraries in Java, such as the recent 
&lt;a href=&quot;http://hg.openjdk.java.net/jdk7/jdk7/jdk/rev/ad1e30930c6c&quot;&gt;pure Java implementation of floor and ceil&lt;/a&gt;
(&lt;a href=&quot;http://bugs.sun.com/view_bug.do?bug_id=6908131&quot; title=&quot;Pure Java implementations of StrictMath.floor(double) &amp; StrictMath.ceil(double)&quot;&gt;6908131&lt;/a&gt;).  

This expected use-case drove certain API differences with the functions sketched by IEEE 754.  For example, the &lt;code&gt;getExponent&lt;/code&gt; method simply returns the unbiased value stored in the exponent field of a floating-point value rather than doing additional processing, such as computing the exponent needed to normalized a subnormal number, additional processing called for in some flavors of the 754 &lt;code&gt;logb&lt;/code&gt; operation.  Such additional functionality can actually slow down math libraries since libraries may not benefit from the additional filtering and may actually have to undo it.

&lt;/p&gt;

&lt;p&gt;

The &lt;code&gt;Math&lt;/code&gt; and &lt;code&gt;StrictMath&lt;/code&gt; specifications of &lt;code&gt;copySign&lt;/code&gt; have a small difference: the 
&lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/StrictMath.html#copySign(double,%20double)&quot; title=&quot;java.lang.StrictMath.copySign&quot;&gt;&lt;code&gt;StrictMath&lt;/code&gt; version&lt;/a&gt; always treats NaNs as having a positive sign (a sign bit of zero) while the 
&lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/Math.html#copySign(double,%20double)&quot; title=&quot;java.lang.Math.copySign&quot;&gt;&lt;code&gt;Math&lt;/code&gt; version&lt;/a&gt; does not impose this requirement.

The IEEE standard does not ascribe a meaning to the sign bit of a NaN and difference processors have different conventions NaN representations and how they propagate.  However, if the source argument is not a NaN, the two &lt;code&gt;copySign&lt;/code&gt; methods will produce equivalent results.

Therefore, even if being used in a library where the results need to be completely predictable, the faster &lt;code&gt;Math&lt;/code&gt; version of &lt;code&gt;copySign&lt;/code&gt; can be used as long as the source argument is known to be numerical.

&lt;/p&gt;

&lt;p&gt;

The recommended functions can also be used to solve a little floating-point puzzle: generating the interesting limit values of a floating-point format just starting with constants for &lt;code&gt;0.0&lt;/code&gt; and &lt;code&gt;1.0&lt;/code&gt; in that format:

&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;NaN&lt;/code&gt; is &lt;code&gt;0.0/0.0&lt;/code&gt;.
&lt;/p&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;POSITIVE_INFINITY&lt;/code&gt; is &lt;code&gt;1.0/0.0&lt;/code&gt;.
&lt;/p&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;MAX_VALUE&lt;/code&gt; is &lt;code&gt;nextAfter(POSITIVE_INFINITY, 0.0)&lt;/code&gt;.
&lt;/p&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;MIN_VALUE&lt;/code&gt; is &lt;code&gt;nextUp(0.0)&lt;/code&gt;.
&lt;/p&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;MIN_NORMAL&lt;/code&gt; is &lt;code&gt;MIN_VALUE/(nextUp(1.0)-1.0)&lt;/code&gt;.
&lt;/p&gt;

&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;</description>
	<pubDate>Sun, 21 Feb 2010 05:41:48 +0000</pubDate>
</item>
<item>
	<title>Jeroen Frijters: 0.42 Update 1 RC 1</title>
	<guid>http://weblog.ikvm.net/PermaLink.aspx?guid=ac55cc6d-8a72-469b-98c6-84d19ec309b8</guid>
	<link>http://weblog.ikvm.net/PermaLink.aspx?guid=ac55cc6d-8a72-469b-98c6-84d19ec309b8</link>
	<description>&lt;p&gt;
      I fixed a major bug in the automagic .NET serialization support.
   &lt;/p&gt;
        &lt;p&gt;
      Changes:
   &lt;/p&gt;
        &lt;ul&gt;
          &lt;li&gt;
         Updated version to 0.42.0.5.&lt;/li&gt;
          &lt;li&gt;
         Fix for bug #&lt;a href=&quot;https://sourceforge.net/tracker/?func=detail&amp;atid=525264&amp;aid=2946842&amp;group_id=69637&quot;&gt;2946842&lt;/a&gt;.&lt;/li&gt;
        &lt;/ul&gt;
        &lt;p&gt;
      Binaries available here: &lt;a href=&quot;http://www.frijters.net/ikvmbin-0.42.0.5.zip&quot;&gt;ikvmbin-0.42.0.5.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
      Sources: &lt;a href=&quot;http://www.frijters.net/ikvm-0.42.0.5.zip&quot;&gt;ikvm-0.42.0.5.zip&lt;/a&gt;, &lt;a href=&quot;http://www.frijters.net/openjdk6-b16-stripped.zip&quot;&gt;openjdk6-b16-stripped.zip&lt;/a&gt;&lt;/p&gt;
        &lt;img width=&quot;0&quot; height=&quot;0&quot; src=&quot;http://weblog.ikvm.net/aggbug.ashx?id=ac55cc6d-8a72-469b-98c6-84d19ec309b8&quot; /&gt;</description>
	<pubDate>Fri, 19 Feb 2010 08:40:08 +0000</pubDate>
</item>
<item>
	<title>Andrew Hughes: OpenJDK6 b18 Released and in IcedTea6!</title>
	<guid>http://blog.fuseyism.com/?p=94</guid>
	<link>http://blog.fuseyism.com/index.php/2010/02/18/openjdk6-b18-released-and-in-icedtea6/</link>
	<description>&lt;p&gt;Joe Darcy released &lt;a href=&quot;http://blogs.sun.com/darcy/entry/openjdk_6_b18_source_bundle&quot;&gt;OpenJDK6 b18&lt;/a&gt; yesterday evening and this is now integrated with the &lt;a href=&quot;http://icedtea.classpath.org/hg/icedtea6&quot;&gt;latest IcedTea6 from Mercurial&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To build:&lt;/p&gt;
&lt;pre&gt;
$ hg clone http://icedtea.classpath.org/hg/icedtea6
$ mkdir icedtea6-build
$ cd icedtea6-build
$ ../icedtea6/configure
$ make
&lt;/pre&gt;
&lt;p&gt;Then grab a beverage of your choice and wait a while&amp;#8230; I recommend adding &lt;code&gt;--with-parallel-jobs&lt;/code&gt; to the configure invocation if you have a multi-core machine.&lt;/p&gt;
&lt;p&gt;Once built, you will have a build of OpenJDK6 which can use the Nimbus Look and Feel as explained in &lt;a href=&quot;http://blog.fuseyism.com/index.php/2009/04/09/nimbus-arrives/&quot;&gt;my previous blog&lt;/a&gt;&lt;/p&gt;</description>
	<pubDate>Thu, 18 Feb 2010 18:23:52 +0000</pubDate>
</item>
<item>
	<title>Joe Darcy: OpenJDK 6: b18 regression test results</title>
	<guid>http://blogs.sun.com/darcy/entry/openjdk_6_b18_regression_tests</guid>
	<link>http://blogs.sun.com/darcy/entry/openjdk_6_b18_regression_tests</link>
	<description>&lt;p&gt;

Running with the usual &lt;tt&gt;jtreg&lt;/tt&gt; flags, &lt;tt&gt;-a -ignore:quiet&lt;/tt&gt; in all repositories and adding &lt;tt&gt;-s&lt;/tt&gt; for &lt;tt&gt;langtools&lt;/tt&gt;, the basic regression test results on Linux for
&lt;a href=&quot;http://blogs.sun.com/darcy/entry/openjdk_6_b18_source_bundle&quot;&gt;OpenJDK 6 build 18&lt;/a&gt; are:

&lt;/p&gt;


&lt;ul&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://blogs.sun.com/darcy/resource/OpenJDK_6/b18-hotspot-linux-summary.txt&quot;&gt;HotSpot&lt;/a&gt;, 24 tests passed.
&lt;/p&gt;


&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://blogs.sun.com/darcy/resource/OpenJDK_6/b18-langtools-linux-summary.txt&quot;&gt;Langtools&lt;/a&gt;, 1,355 tests passed.
&lt;/p&gt;


&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://blogs.sun.com/darcy/resource/OpenJDK_6/b18-jdk-linux-summary.txt&quot;&gt;JDK&lt;/a&gt;, 3,148 tests pass, 19 fail, and 2 have errors.
&lt;/p&gt;

&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;


&lt;p&gt;


All the HotSpot tests continue to pass:

&lt;/p&gt;

&lt;blockquote&gt;
&lt;pre&gt;
0: b17-hotspot/summary.txt  pass: 24
1: b18-hotspot/summary.txt  pass: 24

No differences
&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;

In &lt;tt&gt;langtools&lt;/tt&gt; all the tests continue to pass and one test was added:

&lt;/p&gt;

&lt;blockquote&gt;
&lt;pre&gt;
0: b17-langtools/summary.txt  pass: 1,354
1: b18-langtools/summary.txt  pass: 1,355

0      1      Test
---    pass   tools/javac/T6855236.java

1 differences
&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;

And in &lt;tt&gt;jdk&lt;/tt&gt;, a few dozen new tests were added in b18 and the existing tests have generally consistent results, with a number of long-standing test failures corrected by Pavel Tisnovsky.

The test run below was executed outside of Sun's and Oracle's wide-area network using the following contents for the testing network configuration file:

&lt;blockquote&gt;&lt;pre&gt;
host=icedtea.classpath.org
refusing_host=ns1.gnu.org
far_host=developer.classpath.org
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;

The file location to use for the networking configuration can be set by passing a &lt;code&gt;-e JTREG_TESTENV=&lt;i&gt;Path to file&lt;/i&gt;&lt;/code&gt; option to &lt;code&gt;jtreg&lt;/code&gt;.

&lt;/p&gt;

&lt;/p&gt;

&lt;blockquote&gt;
&lt;pre&gt;
0: b17-jdk/summary.txt  pass: 3,118; fail: 26
1: b18-jdk/summary.txt  pass: 3,148; fail: 19; error: 2

0      1      Test
---    pass   com/sun/java/swing/plaf/nimbus/Test6741426.java
---    pass   com/sun/java/swing/plaf/nimbus/Test6849805.java
---    pass   com/sun/jdi/BreakpointWithFullGC.sh
---    pass   com/sun/jdi/ResumeOneThreadTest.java
---    pass   com/sun/jdi/SimulResumerTest.java
---    pass   demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java
fail   pass   java/awt/Frame/DynamicLayout/DynamicLayout.java
fail   pass   java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java
fail   pass   java/awt/Frame/ShownOffScreenOnWin98/ShownOffScreenOnWin98Test.java
fail   pass   java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java
---    pass   java/awt/GraphicsDevice/CloneConfigsTest.java
fail   pass   java/awt/GridLayout/LayoutExtraGaps/LayoutExtraGaps.java
fail   pass   java/awt/Insets/CombinedTestApp1.java
fail   pass   java/awt/KeyboardFocusmanager/TypeAhead/ButtonActionKeyTest/ButtonActionKeyTest.html
fail   pass   java/awt/KeyboardFocusmanager/TypeAhead/MenuItemActivatedTest/MenuItemActivatedTest.html
fail   pass   java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.html
fail   pass   java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.html
pass   fail   java/awt/Multiscreen/LocationRelativeToTest/LocationRelativeToTest.java
fail   pass   java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.html
fail   pass   java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java
pass   ---    java/awt/Window/AlwaysOnTop/AlwaysOnTopEvenOfWindow.java
pass   fail   java/awt/Window/GrabSequence/GrabSequence.java
fail   pass   java/awt/grab/EmbeddedFrameTest1/EmbeddedFrameTest1.java
pass   fail   java/awt/print/PrinterJob/ExceptionTest.java
---    pass   java/lang/ClassLoader/UninitializedParent.java
pass   fail   java/net/ipv6tests/TcpTest.java
pass   fail   java/nio/channels/SocketChannel/AdaptSocket.java
pass   fail   java/nio/channels/SocketChannel/LocalAddress.java
pass   fail   java/nio/channels/SocketChannel/Shutdown.java
pass   fail   java/rmi/transport/pinLastArguments/PinLastArguments.java
---    pass   java/util/TimeZone/OldIDMappingTest.sh
---    pass   java/util/TimeZone/TimeZoneDatePermissionCheck.sh
---    pass   javax/swing/JButton/6604281/bug6604281.java
fail   pass   javax/swing/JTextArea/Test6593649.java
---    pass   javax/swing/Security/6657138/ComponentTest.java
---    pass   javax/swing/Security/6657138/bug6657138.java
---    pass   javax/swing/ToolTipManager/Test6657026.java
---    pass   javax/swing/UIManager/Test6657026.java
---    pass   javax/swing/plaf/basic/BasicSplitPaneUI/Test6657026.java
---    pass   javax/swing/plaf/metal/MetalBorders/Test6657026.java
---    pass   javax/swing/plaf/metal/MetalBumps/Test6657026.java
---    pass   javax/swing/plaf/metal/MetalInternalFrameUI/Test6657026.java
---    pass   javax/swing/plaf/metal/MetalSliderUI/Test6657026.java
pass   error  sun/java2d/OpenGL/GradientPaints.java
pass   fail   sun/rmi/transport/proxy/EagerHttpFallback.java
---    pass   sun/security/provider/certpath/DisabledAlgorithms/CPBuilder.java
---    pass   sun/security/provider/certpath/DisabledAlgorithms/CPValidatorEndEntity.java
---    pass   sun/security/provider/certpath/DisabledAlgorithms/CPValidatorIntermediate.java
---    pass   sun/security/provider/certpath/DisabledAlgorithms/CPValidatorTrustAnchor.java
pass   error  sun/security/ssl/javax/net/ssl/NewAPIs/SessionTimeOutTests.java
---    pass   sun/security/tools/jarsigner/emptymanifest.sh
---    pass   sun/security/util/DerValue/BadValue.java
fail   pass   sun/tools/jhat/HatHeapDump1Test.java
fail   pass   sun/tools/native2ascii/NativeErrors.java

54 differences
&lt;/pre&gt;
&lt;/blockquote&gt;</description>
	<pubDate>Wed, 17 Feb 2010 17:35:00 +0000</pubDate>
</item>
<item>
	<title>Joe Darcy: OpenJDK 6: b18 Source Bundle Published</title>
	<guid>http://blogs.sun.com/darcy/entry/openjdk_6_b18_source_bundle</guid>
	<link>http://blogs.sun.com/darcy/entry/openjdk_6_b18_source_bundle</link>
	<description>&lt;p&gt;

On February 16, 2010 the
&lt;a href=&quot;http://download.java.net/openjdk/jdk6/promoted/b18/openjdk-6-src-b18-16_feb_2010.tar.gz&quot;&gt;source bundle&lt;/a&gt; for OpenJDK 6 b18 was published.

&lt;/p&gt;

&lt;p&gt;

Major changes in this build include the latest round of security fixes and, courtesy of Andrew John Hughes, a backport of the Nimbus look and feel from JDK 7.  In addition, a 
&lt;a href=&quot;http://blogs.sun.com/darcy/entry/jdk_7_new_component_delivered&quot; title=&quot;JDK 7: New Component Delivery Model Delivered&quot;&gt;new delivery model&lt;/a&gt; is being used for the &lt;code&gt;jaxp&lt;/code&gt; and &lt;code&gt;jax-ws&lt;/code&gt; components.

&lt;/p&gt;

&lt;p&gt;

A detailed list of all the changes is &lt;a href=&quot;http://blogs.sun.com/darcy/resource/OpenJDK_6/openjdk6-b18-changes-summary.html&quot;&gt;also available&lt;/a&gt;.

&lt;/p&gt;</description>
	<pubDate>Wed, 17 Feb 2010 17:30:00 +0000</pubDate>
</item>
<item>
	<title>Mario Torre: Heavy Rain</title>
	<guid>http://www.jroller.com/neugens/entry/heavy_rain</guid>
	<link>http://www.jroller.com/neugens/entry/heavy_rain</link>
	<description>&lt;p&gt;There&amp;#8216;s a lot of hype around &lt;a href=&quot;http://en.wikipedia.org/wiki/Heavy_Rain&quot;&gt;this title&lt;/a&gt;. I gave a look at the trailers and I had the feeling that the game play was so similar to very old games (1983!) such as Dragon&amp;#8216;s Lair or Space Quest.&lt;/p&gt;

	&lt;p&gt;Today, I finally played the demo and I still have constrasting feelings&amp;#8230; Is it cool? Yeah&amp;#8230; I think it is, really: it&amp;#8216;s like playing a film, full of dark mood, beautiful scenes and colours, and a really intriguing story.&lt;/p&gt;

	&lt;p&gt;The demo shows some funny behaviour, for example, when not triggering a cut scene (that is, 90% of the time &lt;strong&gt;you are&lt;/strong&gt; in a cut scene), the non playing characters (NPEs) look a bit dumb. In fact, you have the feeling that everything is a bit fake, because the interaction takes place only when is supposed to, and you find yourself wandering around the area without knowing what to do when you have no more options left, with the NPCs staring a wall with idiotic espression :)&lt;/p&gt;

	&lt;p&gt;There is a nice system that tries to address this issue and adds even more of a nice movie mood to the game: you can listen to your character&amp;#8216;s thoughts, and they act like an offscreen narrator, very cool I have to say.&lt;/p&gt;

	&lt;p&gt;The game play is almost non existent, though, you press one button or two when some HUDs pops up and inevitably mess with the Sixaxis controller&amp;#8230; On the other hand, is really beautiful to watch. I suggest to wait a full review on Gamespot, but the game is cool so far.&lt;/p&gt;

	&lt;p&gt;I confirm that is the same kind of game as Dragon&amp;#8216;s Lair and Space Ace, be warned if you don&amp;#8216;t like this kind of stuff.&lt;/p&gt;

	&lt;p&gt;&lt;center&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/center&gt;&lt;/p&gt;

	&lt;p&gt;&lt;center&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/center&gt;&lt;/p&gt;

	&lt;p&gt;&lt;center&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/center&gt;&lt;/p&gt;</description>
	<pubDate>Mon, 15 Feb 2010 21:37:25 +0000</pubDate>
</item>
<item>
	<title>Roman Kennke: Glassfish 3 hint</title>
	<guid>http://rkennke.wordpress.com/2010/02/15/glassfish-3-hint/</guid>
	<link>http://rkennke.wordpress.com/2010/02/15/glassfish-3-hint/</link>
	<description>&lt;p&gt;If you ever need to install Glassfish 3, and upon first invocation of its admin console (e.g. http://localhost:4848) get a HTTP 404 /common/index.jsf not found, try accessing it through http://localhost:4848/login.jsf, that should get you into the console.&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/rkennke.wordpress.com/293/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/rkennke.wordpress.com/293/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/rkennke.wordpress.com/293/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/rkennke.wordpress.com/293/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/rkennke.wordpress.com/293/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/rkennke.wordpress.com/293/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/rkennke.wordpress.com/293/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/rkennke.wordpress.com/293/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/rkennke.wordpress.com/293/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/rkennke.wordpress.com/293/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=rkennke.wordpress.com&amp;blog=9951657&amp;post=293&amp;subd=rkennke&amp;ref=&amp;feed=1&quot; /&gt;rkennke</description>
	<pubDate>Mon, 15 Feb 2010 13:34:21 +0000</pubDate>
</item>
<item>
	<title>Mario Torre: Fortune of the day</title>
	<guid>http://www.jroller.com/neugens/entry/fortune_of_the_day5</guid>
	<link>http://www.jroller.com/neugens/entry/fortune_of_the_day5</link>
	<description>&lt;pre&gt;
A master programmer passed a novice programmer one day.  The master
noted the novice's preoccupation with a hand-held computer game.  &quot;Excuse me&quot;,
he said, &quot;may I examine it?&quot;
The novice bolted to attention and handed the device to the master.
&quot;I see that the device claims to have three levels of play: Easy, Medium,
and Hard&quot;, said the master.  &quot;Yet every such device has another level of play,
where the device seeks not to conquer the human, nor to be conquered by the
human.&quot;
&quot;Pray, great master,&quot; implored the novice, &quot;how does one find this
mysterious setting?&quot;
The master dropped the device to the ground and crushed it under foot.
And suddenly the novice was enlightened.
-- Geoffrey James, &quot;The Tao of Programming&quot;
&lt;/pre&gt;</description>
	<pubDate>Mon, 15 Feb 2010 11:29:40 +0000</pubDate>
</item>
<item>
	<title>Joe Darcy: Finding a bug in FDLIBM pow</title>
	<guid>http://blogs.sun.com/darcy/entry/finding_a_bug_in_fdlibm</guid>
	<link>http://blogs.sun.com/darcy/entry/finding_a_bug_in_fdlibm</link>
	<description>&lt;p&gt;

Writing up a piece of old work for some more 
&lt;a href=&quot;http://blogs.sun.com/darcy/entry/regex_for_integral_strings&quot; title=&quot;Recognizing all valid integral strings with regular expressions&quot;&gt;Friday fun&lt;/a&gt;, an example of
&lt;a href=&quot;http://blogs.sun.com/darcy/entry/test_where_the_failures_are&quot; title=&quot;Test where the failures are likely to be&quot;&gt;testing where the failures are likely to be&lt;/a&gt; led to my independent discovery of a bug in the FDLIBM &lt;code&gt;pow&lt;/code&gt; function, one of only two bugs fixed in 
&lt;a href=&quot;http://www.netlib.org/fdlibm/readme&quot;&gt;FDLIBM 5.3&lt;/a&gt;.

Even back when this bug was fixed for Java some time ago 
(&lt;a href=&quot;http://bugs.sun.com/view_bug.do?bug_id=5033578&quot; title=&quot;Java should require use of latest fdlibm 5.3&quot;&gt;5033578&lt;/a&gt;), 
the FDLIBM library was well-established, widely used in the Java platform and elsewhere, and already thoroughly tested so I was quite proud my tests found a new problem.  The next most recent change to the &lt;code&gt;pow&lt;/code&gt; implementation was eleven years prior to the fix in 5.3.

&lt;/p&gt;

&lt;p&gt;

The &lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/Math.html#pow(double,%20double)&quot;&gt;specification for &lt;code&gt;Math.pow&lt;/code&gt;&lt;/a&gt; is involved, with over two dozen special cases listed.  When setting out to write tests for this method, I re-expressed the specification in a tabular form to understand what was going on.  After a few iterations reminiscent of tweaking a &lt;a href=&quot;http://en.wikipedia.org/wiki/Karnaugh_map&quot;&gt;Karnaugh map&lt;/a&gt;, the table below was the result.

&lt;/p&gt;

&lt;table border=&quot;border&quot;&gt;
&lt;caption&gt;Special Cases for FDLIBM &lt;code&gt;pow&lt;/code&gt; and {&lt;code&gt;Math&lt;/code&gt;, &lt;code&gt;StrictMath&lt;/code&gt;}&lt;code&gt;.pow&lt;/code&gt;
&lt;/caption&gt;

&lt;tr&gt;
&lt;th&gt;
&lt;i&gt;x&lt;sup&gt;y&lt;/sup&gt;&lt;/i&gt;
&lt;/th&gt;

  &lt;th colspan=&quot;11&quot;&gt;
  &lt;i&gt;y&lt;/i&gt;
  &lt;/th&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;th&gt;&lt;i&gt;x&lt;/i&gt;&lt;/th&gt;
  &lt;th&gt;&amp;ndash;&amp;#8734;&lt;/th&gt;
    &lt;th&gt;&amp;ndash;&amp;#8734; &amp;lt; &lt;i&gt;y&lt;/i&gt; &amp;lt; 1&lt;/th&gt;
      &lt;th&gt;&amp;ndash;1&lt;/th&gt;
        &lt;th&gt;&amp;ndash;1 &amp;lt; &lt;i&gt;y&lt;/i&gt; &amp;lt; 0&lt;/th&gt;
          &lt;th&gt;&amp;ndash;0.0&lt;/th&gt;
            &lt;th&gt;+0.0&lt;/th&gt;
              &lt;th&gt;0 &amp;lt; &lt;i&gt;y&lt;/i&gt; &amp;lt; 1&lt;/th&gt;
                &lt;th&gt;1&lt;/th&gt;
                  &lt;th&gt;1 &amp;lt; &lt;i&gt;y&lt;/i&gt; &amp;lt; +&amp;#8734;&lt;/th&gt;
                    &lt;th&gt;+&amp;#8734;&lt;/th&gt;
                      &lt;th&gt;NaN&lt;/th&gt;
&lt;/tr&gt;

&lt;tr&gt;
  &lt;th&gt;&amp;ndash;&amp;#8734;&lt;/th&gt;
    &lt;td align=&quot;right&quot;&gt;+0.0&lt;/td&gt;
      &lt;td align=&quot;center&quot; colspan=&quot;3&quot;&gt;f2(&lt;i&gt;y&lt;/i&gt;)&lt;/td&gt;
            &lt;td align=&quot;center&quot; rowspan=&quot;11&quot; colspan=&quot;2&quot;&gt;1.0&lt;/td&gt;
                &lt;td align=&quot;center&quot; colspan=&quot;3&quot;&gt;f1(&lt;i&gt;y&lt;/i&gt;)&lt;/td&gt;
                      &lt;td align=&quot;right&quot;&gt;+&amp;#8734;&lt;/td&gt;
                        &lt;td rowspan=&quot;10&quot;&gt;NaN&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
  &lt;th&gt;&amp;ndash;&amp;#8734; &amp;lt; &lt;i&gt;y&lt;/i&gt; &amp;lt; &amp;ndash;1&lt;/th&gt;
    &lt;td align=&quot;right&quot;&gt;+0.0&lt;/td&gt;
      &lt;td align=&quot;center&quot; colspan=&quot;3&quot; rowspan=&quot;3&quot;&gt;f3(x, y)&lt;/td&gt;
                &lt;td align=&quot;center&quot; colspan=&quot;3&quot; rowspan=&quot;3&quot;&gt;f3(x, y)&lt;/td&gt;
                      &lt;td align=&quot;right&quot;&gt;+&amp;#8734;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
  &lt;th&gt;&amp;ndash;1&lt;/th&gt;
    &lt;td align=&quot;right&quot;&gt;NaN&lt;sup&gt;&lt;a href=&quot;http://blogs.sun.com/darcy/feed/entries/rss#c99_diff&quot;&gt;&amp;dagger;&lt;/a&gt;&lt;/sup&gt;&lt;/td&gt;
                      &lt;td align=&quot;right&quot;&gt;NaN&lt;sup&gt;&lt;a href=&quot;http://blogs.sun.com/darcy/feed/entries/rss#c99_diff&quot;&gt;&amp;dagger;&lt;/a&gt;&lt;/sup&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
  &lt;th&gt;&amp;ndash;1 &amp;lt; &lt;i&gt;y&lt;/i&gt; &amp;lt; 0&lt;/th&gt;
    &lt;td align=&quot;right&quot;&gt;+&amp;#8734;&lt;/td&gt;
                      &lt;td align=&quot;right&quot;&gt;+0.0&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
   &lt;th&gt;&amp;ndash;0.0&lt;/th&gt;
    &lt;td align=&quot;right&quot;&gt;+&amp;#8734;&lt;/td&gt;
      &lt;td align=&quot;center&quot; colspan=&quot;3&quot;&gt;f1(y)&lt;/td&gt;
                &lt;td align=&quot;center&quot; colspan=&quot;3&quot;&gt;f2(y)&lt;/td&gt;
                      &lt;td align=&quot;right&quot;&gt;+0.0&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
   &lt;th&gt;+0.0&lt;/th&gt;
    &lt;td align=&quot;center&quot; colspan=&quot;4&quot;&gt;+&amp;#8734;&lt;/td&gt;
                &lt;td align=&quot;center&quot; colspan=&quot;4&quot;&gt;+0.0&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
   &lt;th&gt;0 &amp;lt; &lt;i&gt;y&lt;/i&gt; &amp;lt; 1&lt;/th&gt;
    &lt;td align=&quot;right&quot;&gt;+&amp;#8734;&lt;/td&gt;
      &lt;td align=&quot;right&quot; colspan=&quot;3&quot; rowspan=&quot;3&quot;&gt;&amp;nbsp;&lt;/td&gt;
                &lt;td align=&quot;right&quot; rowspan=&quot;3&quot;&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;td align=&quot;right&quot;&gt;&lt;i&gt;x&lt;/i&gt;&lt;/td&gt;
                    &lt;td align=&quot;right&quot; rowspan=&quot;3&quot;&gt;&amp;nbsp;&lt;/td&gt;
                      &lt;td align=&quot;right&quot;&gt;+0.0&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
  &lt;th&gt;1&lt;/th&gt;
    &lt;td align=&quot;right&quot;&gt;NaN&lt;sup&gt;&lt;a href=&quot;http://blogs.sun.com/darcy/feed/entries/rss#c99_diff&quot;&gt;&amp;dagger;&lt;/a&gt;&lt;/sup&gt;&lt;/td&gt;
                  &lt;td align=&quot;right&quot;&gt;1.0&lt;/td&gt;
                      &lt;td align=&quot;right&quot;&gt;NaN&lt;sup&gt;&lt;a href=&quot;http://blogs.sun.com/darcy/feed/entries/rss#c99_diff&quot;&gt;&amp;dagger;&lt;/a&gt;&lt;/sup&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
  &lt;th&gt;1 &amp;lt; &lt;i&gt;y&lt;/i&gt; &amp;lt; +&amp;#8734;&lt;/th&gt;
    &lt;td align=&quot;right&quot;&gt;+0.0&lt;/td&gt;
                  &lt;td align=&quot;right&quot;&gt;&lt;i&gt;x&lt;/i&gt;&lt;/td&gt;
                      &lt;td align=&quot;right&quot;&gt;+&amp;#8734;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
  &lt;th&gt;+&amp;#8734;&lt;/th&gt;
    &lt;td align=&quot;center&quot; colspan=&quot;4&quot;&gt;+0.0&lt;/td&gt;
                &lt;td align=&quot;center&quot; colspan=&quot;4&quot;&gt;+&amp;#8734;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
  &lt;th&gt;NaN&lt;/th&gt;
    &lt;td align=&quot;center&quot; colspan=&quot;4&quot;&gt;NaN&lt;/td&gt;
                &lt;td align=&quot;center&quot; colspan=&quot;5&quot;&gt;NaN&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;

&lt;blockquote&gt;
&lt;p&gt;
f1(y) = isOddInt(y) ? &amp;ndash;&amp;#8734; : +&amp;#8734;;&lt;br /&gt;
f2(y) = isOddInt(y) ? &amp;ndash;0.0 : +0.0;&lt;br /&gt;
f3(x, y) = isEvenInt(y) ? |&lt;i&gt;x&lt;/i&gt;|&lt;sup&gt;&lt;i&gt;y&lt;/i&gt;&lt;/sup&gt; : (isOddInt(y) ? &amp;ndash;|&lt;i&gt;x&lt;/i&gt;|&lt;sup&gt;&lt;i&gt;y&lt;/i&gt;&lt;/sup&gt; : NaN);&lt;br /&gt;
&lt;a name=&quot;c99_diff&quot;&gt;&lt;sup&gt;&amp;dagger;&lt;/sup&gt; Defined to be +1.0 in C99, see &amp;sect;F.9.4.4 of the C99 specification&lt;/a&gt;.  

Large magnitude finite floating-point numbers are all even integers (since the precision of a typical floating-point format is much less than its exponent range, a large number will be an integer times the base raised to a power).  Therefore, by the reasoning of the C99 committee, &lt;code&gt;pow(-1.0, &amp;#8734;)&lt;/code&gt; was like &lt;code&gt;pow(-1.0, &lt;i&gt;Unknown large even integer&lt;/i&gt;)&lt;/code&gt; so the result was defined to be &lt;code&gt;1.0&lt;/code&gt; instead of &lt;code&gt;NaN&lt;/code&gt;. 
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;

The range of arguments in each row and column are partitioned into eleven categories, ten categories of finite values together with NaN (Not a Number).  Some combination of &lt;i&gt;x&lt;/i&gt; and &lt;i&gt;y&lt;/i&gt; arguments are covered by multiple clauses of the specification.

A few helper functions are defined to simplify the presentation.  As noted in the table, a cross-platform wrinkle is that the C99 specification, which came out after Java was first released, defined certain special cases differently than in FDLIBM and Java's &lt;code&gt;Math.pow&lt;/code&gt;.  
&lt;/p&gt;

&lt;p&gt;

A regression test based on this tabular representation of &lt;code&gt;pow&lt;/code&gt; special cases is 
&lt;code&gt;&lt;a href=&quot;http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/9027c6b9d7e2/test/java/lang/Math/PowTests.java&quot; title=&quot;Current version as of February 12, 2010&quot;&gt;jdk/test/java/lang/Math/PowTests.java&lt;/a&gt;&lt;/code&gt;.  The test makes sure each interesting combination in the table is probed at least once.  Some combinations receive multiple probes.

When an entry represents a range, the exact endpoints of the range are tested; in addition, other interesting interior points are tested too.  For example, for the range 1 &amp;lt; &lt;i&gt;x&lt;/i&gt;&amp;lt; +&amp;#8734; the individual points tested are:
 
&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
+1.0000000000000002, // nextAfter(+1.0, +oo)
+1.0000000000000004,
+2.0,
+Math.E,
+3.0,
+Math.PI,
-(double)Integer.MIN_VALUE - 1.0,
-(double)Integer.MIN_VALUE,
-(double)Integer.MIN_VALUE + 1.0,
 double)Integer.MAX_VALUE + 4.0,
 (double) ((1L&amp;lt;&amp;lt;53)-1L),
 (double) ((1L&amp;lt;&amp;lt;53)),
 (double) ((1L&amp;lt;&amp;lt;53)+2L),
-(double)Long.MIN_VALUE,
  Double.MAX_VALUE,
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;

Besides the endpoints, the interesting interior points include points worth checking because of transitions either in the IEEE 754 &lt;code&gt;double&lt;/code&gt; format or a 2's complement integer format.

&lt;/p&gt;

&lt;p&gt;

Inputs that used to fail under this testing include a range of severities, from the almost always numerical benign error of returning a wrongly signed zero, to returning a zero when the result should be finite nonzero result, to returning infinity for a finite result, to even returning a wrongly singed infinity!

&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;Selected Failing Inputs&lt;/h3&gt;
&lt;pre&gt;
Failure for StrictMath.pow(double, double):
       For inputs -0.5                   (-0x1.0p-1) and 
                   9.007199254740991E15  (0x1.fffffffffffffp52)
       expected   -0.0                   (-0x0.0p0)
       got         0.0                   (0x0.0p0).

Failure for StrictMath.pow(double, double):
       For inputs -0.9999999999999999    (-0x1.fffffffffffffp-1) and 
                   9.007199254740991E15  (0x1.fffffffffffffp52)
       expected   -0.36787944117144233   (-0x1.78b56362cef38p-2)
       got        -0.0                   (-0x0.0p0).

Failure for StrictMath.pow(double, double):
       For inputs -1.0000000000000004    (-0x1.0000000000002p0) and 
                   9.007199254740994E15  (0x1.0000000000001p53)
       expected  54.598150033144236      (0x1.b4c902e273a58p5)
       got       0.0                     (0x0.0p0).

Failure for StrictMath.pow(double, double):
       For inputs -0.9999999999999998    (-0x1.ffffffffffffep-1) and 
                   9.007199254740992E15  (0x1.0p53)
       expected    0.13533528323661267   (0x1.152aaa3bf81cbp-3)
       got         0.0                   (0x0.0p0).


Failure for StrictMath.pow(double, double):
       For inputs -0.9999999999999998    (-0x1.ffffffffffffep-1) and 
                  -9.007199254740991E15  (-0x1.fffffffffffffp52)
       expected   -7.38905609893065      (-0x1.d8e64b8d4ddaep2)
       got        -Infinity              (-Infinity).


Failure for StrictMath.pow(double, double):
       For inputs -3.0                   (-0x1.8p1) and 
                   9.007199254740991E15  (0x1.fffffffffffffp52)
       expected   -Infinity              (-Infinity)
       got        Infinity               (Infinity).
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;

The &lt;a href=&quot;http://blogs.sun.com/darcy/resource/FdlibmPowPatch.txt&quot;&gt;code changes&lt;/a&gt; to address the bug were fairly simple; corrections were made to extracting components of the floating-point inputs and sign information was propagated properly.

&lt;/p&gt;

&lt;p&gt;

Even expertly written software can have errors and even long-used software can have unexpected problems.  Estimating how often this bug in FDLIBM caused an issue is difficult, while the errors could be egregious, the needed inputs to elicit the problem were arguably unusual (even though perfectly valid mathematically).  Thorough testing is key aspect of assuring the quality of numerical software, it is also helpful for end-users to be able to &lt;a href=&quot;http://www.cs.berkeley.edu/~wkahan/7Oct09.pdf&quot;&gt;examine the output of their programs&lt;/a&gt; to help notice problems.

&lt;/p&gt;</description>
	<pubDate>Fri, 12 Feb 2010 17:25:00 +0000</pubDate>
</item>
<item>
	<title>Andrew Overholt: Bootchart for Eclipse?</title>
	<guid>http://overholt.ca/wp/?p=150</guid>
	<link>http://overholt.ca/wp/?p=150</link>
	<description>&lt;p&gt;Doug &lt;a href=&quot;http://cdtdoug.blogspot.com/2010/02/ok-eclipse-you-have-3-seconds.html#comment-form&quot;&gt;pointed out&lt;/a&gt; yesterday how Eclipse startup performance isn&amp;#8217;t great.  I asked on his blog entry, wouldn&amp;#8217;t it be great if we had something like &lt;a href=&quot;http://www.bootchart.org/&quot;&gt;bootchart&lt;/a&gt; &amp;#8212; or &lt;a href=&quot;http://www.gnome.org/~michael/blog&quot;&gt;Michael Meeks&lt;/a&gt;&amp;#8216; &lt;a href=&quot;http://github.com/mmeeks/bootchart&quot;&gt;work&lt;/a&gt; (&lt;a href=&quot;http://www.gnome.org/~michael/data/2010-02-09-bootchart2.pdf&quot;&gt;FOSDEM presentation&lt;/a&gt;) &amp;#8212; for Eclipse?&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.bootchart.org/images/bootchart.png&quot;&gt;&lt;img src=&quot;http://overholt.ca/wp/wp-content/uploads/2010/02/bootchart-sm1.png&quot; alt=&quot;bootchart-sm&quot; title=&quot;bootchart-snippet&quot; class=&quot;aligncenter size-full wp-image-151&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Would this be a good Eclipse Summer of Code project?&lt;/p&gt;</description>
	<pubDate>Fri, 12 Feb 2010 14:25:51 +0000</pubDate>
</item>
<item>
	<title>Joe Darcy: Project Coin: Taking a Break for Strings in Switch</title>
	<guid>http://blogs.sun.com/darcy/entry/project_coin_string_switch_break</guid>
	<link>http://blogs.sun.com/darcy/entry/project_coin_string_switch_break</link>
	<description>&lt;p&gt;

The 
&lt;a href=&quot;http://blogs.sun.com/darcy/entry/project_coin_string_switch_anatomy&quot; title=&quot;Project Coin: Anatomy of adding strings in switch to javac&quot;&gt;initial way a string switch statement was implemented in JDK 7&lt;/a&gt; was to desugar a string switch into a series of two switch statements, the first switch mapping from the argument string's hash code to the ordinal position of a matching string label followed by a second switch mapping from the computed ordinal position to the code to be executed.

Before this approach was settled on, &lt;a href=&quot;http://blogs.sun.com/jjg&quot;&gt;Jon&lt;/a&gt;, &lt;a href=&quot;http://blogs.sun.com/mcimadamore&quot;&gt;Maurizio&lt;/a&gt;, and I had extensive discussions about alternative implementation techniques.  One approach from Maurizio we seriously considered using employed labeled &lt;code&gt;break&lt;/code&gt; statements (in lieu of unavailable &lt;code&gt;goto&lt;/code&gt; statements) to allow a string switch to be desugared into a single integer switch statement.  In this approach as well, the basis for the integer switch built around the strings' hash codes.

&lt;/p&gt;

&lt;p&gt;

One kind of complication in desugaring string switch statements stems from irregular control flow, such as when control transfers to one label, code is executed, and then control falls through to the code under the next label rather than exiting the switch statement after the initial code execution.  When using hash codes to identify the string being switched on, another class of complications stem from dealing with the possibility of hash collisions, the situation where two distinct strings have the same hash code.  A string 
&lt;a href=&quot;http://blogs.sun.com/darcy/entry/string_unhashing&quot; title=&quot;Unhashing a String&quot;&gt;can be constructed&lt;/a&gt; to have any integer hash code so collisions are always a possibility.  Since many strings have the same hash code, it is not sufficient to verify the string being switched on just has the same hash value as a string case label; the string being switched on must be checked for equality with the case label string.  Furthermore, when two string case labels have the same hash value, a string being switched on with a matching hash code must be checked for equality potentially against both case labels.

&lt;/p&gt;

&lt;p&gt;

While relying on hash codes to implement string switch is &lt;a href=&quot;http://mail.openjdk.java.net/pipermail/coin-dev/2009-December/002646.html&quot;&gt;contentious with some&lt;/a&gt;, the hashing algorithm of &lt;code&gt;java.lang.String&lt;/code&gt; is an extremely stable part of the platform and there would be too much &lt;a href=&quot;http://blogs.sun.com/darcy/entry/release_types_compatibility_regions&quot; title=&quot;JDK Release Types and Compatibility Regions&quot;&gt;behavioral compatibility&lt;/a&gt; risk in changing it.  Therefore, the stability of the algorithm can be relied on as a resource in possible string switch implementations.

Switching on the hash code in the desugaring confers a number of benefits.  First, most immediately the hash code maps the string to an integer value, matching the type required for the existing switch statement.

Second, switching on the hash code of a string bounds the worst case behavior.  The simplest way to see if a chosen string is in a set of other strings, such as the set of string case labels, would be to compare the chosen string to each of the strings in the set.  This could be expensive since the chosen string would need to be traversed many times, potentially once for each case label.  The hash code of a string is typically cached after it is first computed.  Therefore, when switching on the hash code, the chosen string is not expected to be traversed more than twice (once to compute the hash code if not cached, again to compare against strings from the set of strings with the same hash value &amp;mdash; a set usually with only one element).

&lt;/p&gt;

&lt;p&gt;

If instead of a series of two desugared switch statements, only a single switch statement were desired in the desugaring, extra synthetic state variables could be used to contend with hash collisions, fall-through control flows, and default cases, 
&lt;a href=&quot;http://mail.openjdk.java.net/pipermail/coin-dev/2009-February/000001.html&quot;&gt;as described in the Project Coin strings in switch proposal&lt;/a&gt;.  A &lt;code&gt;goto&lt;/code&gt; construct could be used to eliminate state variables, but &lt;code&gt;goto&lt;/code&gt;  is neither available in the source language nor in &lt;code&gt;javac&lt;/code&gt;'s intermediate representation.  However, by a novel use of nested labeled breaks, a single switch statement can be used in the desugaring &lt;em&gt;without&lt;/em&gt; introducing additional synthetic control variables.

&lt;/p&gt;

&lt;p&gt;

Consider the strings switch statement in the method &lt;code&gt;f&lt;/code&gt; below

&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
static void f(String s) { // Original sugared code
  switch (s) {
    case &quot;azvl&quot;:
      System.out.println(&quot;azvl: &quot;+s); // fallthrough
    case &quot;quux&quot;:
      System.out.println(&quot;Quux: &quot;+s); // fallthrough
    case &quot;foo&quot;:
      int i = 5; //fallthrough
    case &quot;bar&quot;:
      System.out.println(&quot;FooOrBar &quot; + (i = 6) + &quot;: &quot;+s);
      break;
    case &quot;bmjrabc&quot;: // same hash as &quot;azvl&quot;
      System.out.println(&quot;bmjrabc: &quot;+s);
      break;
    case &quot;baz&quot;:
       System.out.println(&quot;Baz &quot; + (i = 7) + &quot;: &quot;+s); // fallthrough
    default:
      System.out.println(&quot;default: &quot;+s);
  }
}
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;
and the following desugaring procedure.

Create a labeled block to enclose the entire switch statement.  Within that enclosing block, create a series of nested blocks, one for each case label, including a &lt;code&gt;default&lt;/code&gt; option, if any.  In the innermost block, have a switch statement based on the hash code of the strings in the original case labels.  For each hash value present in the set of case labels, have an if-then-else chain comparing the string being switched on to the cases having that hash value, breaking to the corresponding label if there is a match.  If a match does not occur, if the original switch has a &lt;code&gt;default&lt;/code&gt; option, a break should transfer control to the label for the default case; if the original case does not have a  &lt;code&gt;default&lt;/code&gt; option, a break should occur to the switch exit label.
&lt;/p&gt;

&lt;p&gt;

If a hash value only corresponds to a single case label, the sense of the equality/inequality comparison in the desugared code can be tuned for branch prediction purposes.  After the block for a case label is closed, the code for that alternative appears.  In the original switch code, there are two normal completion paths of interest: the code for an alternative is run and execution falls through to the next alternative or there is an unlabeled break to exit the switch.  In the desugaring, these paths are represented by execution falling through to code for the next alternative and by a labeled break to the label synthesized for the switch statement exit.  The preservation of fall through semantics is possible because the code interspersed in the nested labeled statements appears in the same textual order as in the original &quot;sugared&quot; string switch.  Local variables can be declared in the middle of a switch block.  In desugared code, such variable declarations are hoisted out to reside in the block for the entire switch statement; the declaration of the variable and its uses are then renamed to a synthetic value to avoid changing the meaning of names in other scopes.  Sample results of this procedure are shown below.
&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
static void f(String s) { // Desugared code
  $exit: {
    int i$foo = 0;
    $default_label: {
      $baz: {
        $bmjrabc: {					    
          $bar: {
            $foo: {
              $quux: {
                $azvl: {
                  switch(s.hashCode()) { // cause NPE if s is null
	          case 3010735: // &quot;azvl&quot; and &quot;bmjrabc&quot;.hashCode()
                      if (s.equals(&quot;azvl&quot;))
		        break $azvl;          
                      else if (s.equals(&quot;bmjrabc&quot;))
                        break $bmjrabc;
                      else
                        break $default_label;
                    case 3482567: // &quot;quux&quot;.hashCode()
                      if (!s.equals(&quot;quux&quot;)) // inequality compare
                        break $default_label;
                      break $quux;
                    case 101574: // &quot;foo&quot;.hashCode()
                      if (s.equals(&quot;foo&quot;)) // equality compare
                        break $foo;
                      break $default_label;
                    case 97299:  // &quot;bar&quot;.hashCode()
                      if (!s.equals(&quot;bar&quot;))
                        break $default_label;
                      break $bar;
                    case 97307: // &quot;baz&quot;.hashCode()
                      if (!s.equals(&quot;baz&quot;))
                        break $default_label;
                      break $baz;
                    default:
                      break $default_label;
                  }//switch
                }//azvl
                System.out.println(&quot;azvl: &quot;+s); // fallthrough
              } //quux
              System.out.println(&quot;Quux: &quot;+s); // fallthrough
            } //foo
            i$foo = 5;
          }//bar
          System.out.println(&quot;FooOrBar &quot; + (i$foo = 6) + &quot;: &quot;+s);
          break $exit;
        }//bmjrabc
        System.out.println(&quot;bmjrabc: &quot; + s);
        break $exit;
      } //baz
      System.out.println(&quot;Baz &quot; + (i$foo = 7) + &quot;: &quot;+s); // fallthrough
    }//default_label
    System.out.println(&quot;default: &quot;+s);
  }//exit
}
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;

While the series of two switches and the labeled break-based desugaring were both viable alternatives, we choose the series of two switches since the transformation seemed more localized and straightforward.  The two-switch solution also has simpler interactions with debuggers.  If string switches become widely used, profiling information can be used to guide future engineering efforts to optimize their performance.

&lt;/p&gt;</description>
	<pubDate>Thu, 11 Feb 2010 22:00:00 +0000</pubDate>
</item>
<item>
	<title>Roman Kennke: Berlin Calling</title>
	<guid>http://rkennke.wordpress.com/?p=291</guid>
	<link>http://rkennke.wordpress.com/2010/02/11/berlin-calling/</link>
	<description>&lt;p&gt;A friend gave me a CD from &lt;a title=&quot;Paul Kalkbrenner&quot; href=&quot;http://www.myspace.com/paulkalkbrenner&quot;&gt;Paul Kalkbrenner&lt;/a&gt;, and surprisingly, I really quite like it. Check it out:&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;text-align:center; display: block;&quot;&gt;&lt;a href=&quot;http://rkennke.wordpress.com/2010/02/11/berlin-calling/&quot;&gt;&lt;img src=&quot;http://img.youtube.com/vi/WzdR3zOGVO8/2.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Speaking of Berlin calling, if all goes well, we&amp;#8217;ll be moving to Berlin (area) later this year. Berlin is indeed calling (me) &lt;img src=&quot;http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif&quot; alt=&quot;:-)&quot; class=&quot;wp-smiley&quot; /&gt; .&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/rkennke.wordpress.com/291/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/rkennke.wordpress.com/291/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/rkennke.wordpress.com/291/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/rkennke.wordpress.com/291/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/rkennke.wordpress.com/291/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/rkennke.wordpress.com/291/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/rkennke.wordpress.com/291/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/rkennke.wordpress.com/291/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/rkennke.wordpress.com/291/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/rkennke.wordpress.com/291/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=rkennke.wordpress.com&amp;blog=9951657&amp;post=291&amp;subd=rkennke&amp;ref=&amp;feed=1&quot; /&gt;rkennke</description>
	<pubDate>Thu, 11 Feb 2010 09:09:35 +0000</pubDate>
</item>
<item>
	<title>Andrew Overholt: Mouse pointer</title>
	<guid>http://overholt.ca/wp/?p=143</guid>
	<link>http://overholt.ca/wp/?p=143</link>
	<description>&lt;p&gt;My friend Adam pointed me to Anatoly Zenkov&amp;#8217;s generated graph of his mouse pointer movements during 3 hours using Eclipse:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/anatoliy_zenkov/4160723711&quot;&gt;http://www.flickr.com/photos/anatoliy_zenkov/4160723711&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The previous photo in his stream has a screenshot of his desktop in the background so you can see what lines up where.  It&amp;#8217;s more fun to guess, though &lt;img src=&quot;http://overholt.ca/wp/wp-includes/images/smilies/icon_smile.gif&quot; alt=&quot;:)&quot; class=&quot;wp-smiley&quot; /&gt; &lt;/p&gt;</description>
	<pubDate>Tue, 09 Feb 2010 16:40:23 +0000</pubDate>
</item>
<item>
	<title>Riccardo Mottola: Grr working on windows</title>
	<guid>tag:blogger.com,1999:blog-15746899.post-1869227546707016068</guid>
	<link>http://multixden.blogspot.com/2010/02/grr-working-on-windows.html</link>
	<description>&lt;a href=&quot;http://3.bp.blogspot.com/_4TJfaVrgjAU/S3BAFhtSXwI/AAAAAAAAAI0/QDC_o0J8sHA/s1600-h/Grr_on_windows.png&quot;&gt;&lt;img style=&quot;float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 259px;&quot; src=&quot;http://3.bp.blogspot.com/_4TJfaVrgjAU/S3BAFhtSXwI/AAAAAAAAAI0/QDC_o0J8sHA/s320/Grr_on_windows.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5435915213928029954&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;Grr now works under Windows! Another proof of GNUstep's versatility.&lt;/p&gt;&lt;p&gt;Screenshot attached, with the upcoming native WindowsUXTheme. Note the scrollbars, checkboxes, native in-window menus, native window-decorations for windows and panels...&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/15746899-1869227546707016068?l=multixden.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Mon, 08 Feb 2010 18:04:54 +0000</pubDate>
</item>
<item>
	<title>Joe Darcy: Recognizing all valid integral strings with regular expressions</title>
	<guid>http://blogs.sun.com/darcy/entry/regex_for_integral_strings</guid>
	<link>http://blogs.sun.com/darcy/entry/regex_for_integral_strings</link>
	<description>&lt;p&gt;

For a fun Friday hack, this blog entry describes a program to generate a regular expression to recognize all the valid strings of integers in a given base, that is, a regular expression (regex) which accepts all in-range strings but rejects strings that would cause an overflow if converted.

&lt;/p&gt;

&lt;p&gt;

This sort of regular expression could be used to verify a string won't cause a &lt;code&gt;NumberFormatException&lt;/code&gt; when processed by one of the many text &amp;rarr; number methods in the Java platform, such as &lt;code&gt;Integer.parseInt(String s, int base)&lt;/code&gt;.  However, using a regular expression may be more expensive than attempting the conversion and catching the exception on invalid input; the regular expression discussed is possibly of more academic interest than practical significance!

&lt;/p&gt;

&lt;p&gt;

An analogous regular expression for floating-point strings has been published 
&lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/Double.html#valueOf(java.lang.String)&quot;&gt;in the javadoc&lt;/a&gt; for several releases.

&lt;/p&gt;

&lt;p&gt;

First, is the set of strings in a given base that will convert to a 32-bit or 64-bit integer a &lt;a&gt;&lt;i&gt;regular language&lt;/i&gt;&lt;/a&gt;, a language that can be recognized by a regular expression?  Yes, because ignoring sequences of leading zeros for a moment, there are only a finite number of strings that can be converted to integer values, one string for each of the 2&lt;sup&gt;32&lt;/sup&gt; or 2&lt;sup&gt;64&lt;/sup&gt; values in the &lt;code&gt;int&lt;/code&gt; or &lt;code&gt;long&lt;/code&gt; types, respectively.  All finite languages are regular, strings of zero of more leading zeros are regular, and concatenations of regular languages are regular.  Putting those facts together, the entire set of convertible strings forms a regular language.  This reasoning is not dependent on the base so it holds for all integer bases, including bases &lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/Character.html#MIN_RADIX&quot; title=&quot;Character.MIN_RADIX&quot;&gt;2&lt;/a&gt; 
through 
&lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/Character.html#MAX_RADIX&quot; title=&quot;Character.MIN_RADIX&quot;&gt;36&lt;/a&gt; 
supported by Java's libraries.

&lt;/p&gt;

&lt;p&gt;

A core regular expression of billions of strings offered as alternatives (&quot;1|2|3|...|2147483647&quot;) while fine from a mathematical perspective, would be too slow and awkward to use.  Fortunately, the pattern of valid strings has sufficient structure to yield reasonably short and manageable regular expressions.

&lt;/p&gt;

&lt;p&gt;

To start we will only consider decimal strings;
additionally, we will assume only ASCII digits need to be recognized.  Integer values range from&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;
-2147483648
&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;to&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;
&amp;nbsp;2147483647
&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;

These strings both have 10 digits.  Putting aside leading zeros for the moment, all strings of 9 or fewer digits are valid, with or without a leading minus sign.  A regex to recognize strings with 9 or fewer digits is trivial; less obvious is how to specify the &quot;ragged&quot; 10-digit nonzero strings which are in range.

&lt;/p&gt;

&lt;p&gt;

The core regular expression covering non-ragged inputs is &lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
&quot;(-)?&quot;+			// optional leading minus sign
&quot;0*&quot;+			// leading zeros
&quot;(\p{Digit}{1,9})&quot;	// numbers with 1 to 9 digits
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;

For the 10-digit strings, if the leading digit is less than the
maximum digit, all other digits can have any value:

&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
1(\p{Digit}{9})
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;

If the first digit is at it's maximum, then if the second digit is less than its maximum, the third and subsequent digits can have any value:

&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
20\p{Digit}{8}
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;

Likewise, if the first and second digits are at their maximum, then if the third digit is less than its maximum, the fourth and subsequent digits can have any value.

Continuing this pattern for all the digit positions:

&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
1(\p{Digit}{9})|
20(\p{Digit}{8})|
21[0-3](\p{Digit}{7})|
214[0-6](\p{Digit}{6})|
2147[0-3](\p{Digit}{5})|
21474[0-7](\p{Digit}{4})|
214748[0-2](\p{Digit}{3})|
2147483[0-5](\p{Digit}{2})|
21474836[0-3](\p{Digit}{1})|
214748364[0-7]
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;

This regular expression can be ORed with the regex for strings of 1 to 9 digits listed above.  Finally, a separate case for the most negative value must be added:

&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
-0*2147483648
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;

All together, with  some newlines for readability this yields:

&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
((-)?0*((\p{Digit}){1,9})
|([0-1]\p{Digit}{9})
|(20\p{Digit}{8})
|(21[0-3]\p{Digit}{7})
|(214[0-6]\p{Digit}{6})
|(2147[0-3]\p{Digit}{5})
|(21474[0-7]\p{Digit}{4})
|(214748[0-2]\p{Digit}{3})
|(2147483[0-5]\p{Digit}{2})
|(21474836[0-3]\p{Digit}{1})
|(214748364[0-7])
)|
(-0*2147483648)
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;

The ragged pattern for nonzero strings with maximum possible length will exist for bases that aren't powers of 2, for the Java libraries that includes all conversion radixes other than 2, 4, 8, 16, and 32.  For powers of two, the pattern is more regular.  For example, in base 16 the values range from

&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
-80000000
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;
to
&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
7fffffff
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;

so for base 16 the regular expression can simply be

&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
((-)?0*(\p{XDigit}{1,7}|
	[0-7](\p{XDigit}{7}))|
(-0*80000000)
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;

Generalizing the regular expression generation algorithm to any given base:

&lt;/p&gt;

&lt;ol&gt;


&lt;li&gt;&lt;p&gt;Create a regex for an optional leading minus sign (&quot;&lt;code&gt;-&lt;/code&gt;&quot;) and zero or more leading zeros, &quot;&lt;code&gt;0*&lt;/code&gt;.&quot;
&lt;/p&gt;

&lt;li&gt;&lt;p&gt;For the base in question, generate the strings for &lt;code&gt;MIN_VALUE&lt;/code&gt; and
&lt;code&gt;MAX_VALUE&lt;/code&gt;.
&lt;/p&gt;

&lt;li&gt;&lt;p&gt;Find &lt;i&gt;n&lt;/i&gt;, the length of the &lt;code&gt;MAX_VALUE&lt;/code&gt; string.  Signed strings of that base with (&lt;i&gt;n&lt;/i&gt;-1) or fewer characters are all valid inputs; create a regex recognizing (&lt;i&gt;n&lt;/i&gt;-1) or fewer digits.
&lt;/p&gt;

&lt;li&gt;&lt;p&gt;Create a regex to recognize valid strings of length &lt;i&gt;n&lt;/i&gt;.
&lt;/p&gt;

&lt;li&gt;&lt;p&gt;Combine the above regular expressions.

&lt;li&gt;&lt;p&gt;To the above, concatenate a separate regex for the most negative value,
&lt;/p&gt;
&lt;blockquote&gt;
&lt;code&gt;-(0*)&lt;i&gt;MIN_VALUE_STRING&lt;/i&gt;&lt;/code&gt;
&lt;/blockquote&gt;

&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;

Taken together, this regex will recognize exactly those strings convertible to the base in question.

&lt;/p&gt;

&lt;p&gt;

Untested code implementing this algorithm 
&lt;a href=&quot;http://blogs.sun.com/darcy/resource/IntegralRegex.java&quot; title=&quot;IntegralRegex.java&quot;&gt;is available&lt;/a&gt; for your viewing pleasure.  Any further debugging, tuning, and enhancements are left as &quot;an exercise for the reader,&quot; happy hacking!

&lt;/p&gt;</description>
	<pubDate>Fri, 05 Feb 2010 16:34:00 +0000</pubDate>
</item>
<item>
	<title>David Herron: The iPad, the Flash kerfluffle, Applets and JavaFX</title>
	<guid>http://www.java.net/344671 at http://www.java.net</guid>
	<link>http://www.java.net/blog/robogeek/archive/2010/02/03/ipad-flash-kerfluffle-applets-and-javafx</link>
	<description>&lt;!--  | 0 --&gt;&lt;p&gt;&amp;nbsp;Last week Apple released their latest product destined to change the world (the iPad). &amp;nbsp;At least that's what they want us to believe. &amp;nbsp;Perhaps the biggest controversy over the thing is the lack of Flash capability. &amp;nbsp;However this being java.net I have to wonder out loud, where is Java capability, and more importantly why isn't as much controversy being raised over Java being missing? But I think we all can enumerate some reasons for both being missing. &amp;nbsp;And it's worth it for the Java community to ponder this issue.&lt;/p&gt;
&lt;p&gt;A couple weeks ago I attended a meeting of the Silicon Valley Web JUG (yes: Java User Group). &amp;nbsp;(&lt;a href=&quot;http://www.meetup.com/sv-web-jug/calendar/12028548/&quot;&gt;The Future of the Web According to Dion Almaer and Ben Galbraith&lt;/a&gt;) &amp;nbsp;A very interesting meeting with a great overview of advances in HTML5 with an eye on the great possibilities it holds.&lt;/p&gt;
&lt;p&gt;The interesting thing is they began the evening with a question: &amp;nbsp;&lt;em&gt;How many of you are interested in JavaFX?&lt;/em&gt; &amp;nbsp;A meeting of 100+ geeks in Silicon Valley who are associated with a Java User Group, you'd think a few of them would be interested in JavaFX. &amp;nbsp;One person raised their hand. &amp;nbsp;I think that says a &lt;strong&gt;LOT&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Their presentation said a &lt;strong&gt;LOT&lt;/strong&gt; about why Java and Flash both are missing from the iPad and iPod, and why we shouldn't care about that functionality gap, and indeed should feel liberated at their absence.&lt;/p&gt;
&lt;p&gt;The key is web components built using standardized web technologies&amp;nbsp;(a.k.a. The Open Web). &amp;nbsp;That's HTML, XML, HTTP, JavaScript and that ilk. &amp;nbsp;Flash, not being standardized by anybody, is not part of the Open Web. &amp;nbsp;Despite Java having a standards body behind it and being treated/delivered by Sun as an Open Standard, it was never accepted by the tech/web community as part of the Open Web. &amp;nbsp;And.. uh.. JavaFX.. sheesh, that's nowhere near being treated/delivered by Sun as any kind of Open Standard, instead it's being treated as a proprietary product where Sun is the big gorilla. &amp;nbsp;Oh, wait, that's Oracle now. &amp;nbsp;Sigh. &amp;nbsp;In any case the Open Web should most certainly ignore JavaFX just like it calls for Flash to be eschewed.&lt;/p&gt;
&lt;p&gt;By being based on Open Standards the Open Web has tooling available from many organizations and a rich ecosystem of experience and adoption. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;An issue traditionally with HTML+JavaScript was speed. &amp;nbsp;Javascript has historically been an interpreted only language and anybody who tried Java 1.0 knows how glacial that can be. &amp;nbsp;Lately some Javascript implementations have been developing JIT and bytecode interpretation capabilities that eerily echo the development of Java virtual machines. &amp;nbsp;According to Ben Galbraith some of those teams are staffed with former Java VM&amp;nbsp;developers. &amp;nbsp;In any case it means faster HTML+JavaScript execution with more capability to provide a rich GUI experience using just HTML+JavaScript. &amp;nbsp;(FWIW I'm typing this in Google's Chrome browser)&lt;/p&gt;
&lt;p&gt;This ain't the HTML+JavaScript of yesteryear. &amp;nbsp;This is a brave new world. &amp;nbsp;It seems in retrospect the promise of Flash and Java was speedier UI experience than the HTML+JavaScript of yesteryear, and that if the HTML+JavaScript of the future is good enough, then both Flash and Java will be rendered irrelevant. &amp;nbsp;Yes, sure, of course both Adobe and Sun have over a decade of virtual machine implementation experience. &amp;nbsp;But neither can achieve the tight browser integration that JavaScript can.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://news.cnet.com/8301-30685_3-20000037-264.html?part=rss&amp;subj=news&amp;tag=2547-1_3-0-20&quot;&gt; HTML vs. Flash: Can a turf war be avoided?&lt;/a&gt;&amp;nbsp;That's an interesting article covering the current stance where Adobe is saying &amp;quot;HEY WAIT A MINNIT&amp;quot; about the lack of Flash in the iPad. &amp;nbsp;e.g.&amp;nbsp;&lt;em&gt;&amp;quot;We are now on the verge of delivering Flash Player 10.1 for smartphones with all but one of the top manufacturers,&amp;quot; Lynch said, specifically mentioning the Nexus One as one such device and adding that the software also works on tablets, Netbooks, and Net-enabled TVs. &amp;quot;Flash in the browser provides a competitive advantage to these devices because it will enable their customers to browse the whole Web...We are ready to enable Flash in the browser on these devices if and when Apple chooses to allow that for its users, but to date we have not had the required cooperation from Apple to make this happen.&amp;quot; &lt;/em&gt;&amp;nbsp;I happen to know for certain that Sun could say the very same thing about Java on iPhone/iPod/iPad. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Where is the truth between these possible states:-&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;The Web only has components standardized by standards bodies&lt;/li&gt;
    &lt;li&gt;All the tools and components are completely open source under OSI approved licenses&lt;/li&gt;
    &lt;li&gt;There is a mix of open standardized components, semi-open proprietary components and completely closed components (todays situation)&amp;nbsp;&lt;/li&gt;
    &lt;li&gt;Every web site has its own incompatible standard (the fate we fortunately avoided several years ago)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;??&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;(&lt;em&gt;tangential digression&lt;/em&gt;)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Open Source != Open Standard. &amp;nbsp;For a long time the hue and cry was for Sun to Open Source Java, and that would ensue a brave new era of wonderful harmony across the planet or some such. &amp;nbsp;In practice Sun didn't quite open source Java, instead it created an Open Source project on a specific implementation of Java (OpenJDK) but &amp;quot;Java&amp;quot; (in my mind) was explicitly not open sourced. &amp;nbsp;As a result while the resulting situation was much better than before the wonderful era of harmony did not ensue.&lt;/p&gt;
&lt;p&gt;In any case an Open Standard can be delivered by closed source software so long as it obeys the standard. &amp;nbsp;An Open Standard still allows wide use of the software and a huge amount of freedom in lots of practical forms of freedom. &amp;nbsp;But Open Standards don't allow things like forking that Open Source explicitly allows. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;</description>
	<pubDate>Wed, 03 Feb 2010 21:10:08 +0000</pubDate>
</item>
<item>
	<title>Joe Darcy: java.util.Objects and friends</title>
	<guid>http://blogs.sun.com/darcy/entry/java_util_objects_and_friends</guid>
	<link>http://blogs.sun.com/darcy/entry/java_util_objects_and_friends</link>
	<description>&lt;p&gt;

A small project I worked on during JDK 7 milestones 05 and 06 was the introduction of a &lt;code&gt;java.util.Objects&lt;/code&gt; class to serve as a home for static utility methods operating on general objects 
(&lt;a href=&quot;http://bugs.sun.com/view_bug.do?bug_id=6797535&quot; title=&quot;Add shared two argument static equals method to the platform&quot;&gt;6797535&lt;/a&gt;, 

&lt;a href=&quot;http://bugs.sun.com/view_bug.do?bug_id=6889858&quot; title=&quot;Add nonNull methods to java.util.Objects&quot;&gt;6889858&lt;/a&gt;, 

&lt;a href=&quot;http://bugs.sun.com/view_bug.do?bug_id=6891113&quot; title=&quot;More methods for java.util.Objects: deepEquals, hash, toString with default&quot;&gt;6891113&lt;/a&gt;).

Those utilities include &lt;code&gt;null&lt;/code&gt;-safe or &lt;code&gt;null&lt;/code&gt;-tolerant methods for 
comparing two objects, 
computing the hash code of an object, 
and returning a string for an object, operations generally relating to the methods defined on &lt;code&gt;java.lang.Object&lt;/code&gt;.

&lt;/p&gt;

&lt;p&gt;

The code to implement each of these methods is very short, so short it is &lt;i&gt;tempting&lt;/i&gt; to not write tests when adding such methods to a code base.  But the methods they aren't so simple that mistakes cannot be made; replacing such helper methods with a common, tested version from the JDK would be a fine refactoring.

&lt;/p&gt;

&lt;p&gt;

The current set of public methods in &lt;code&gt;java.util.Objects&lt;/code&gt; is:

&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;static boolean equals(Object a, Object b) 
&lt;/code&gt;&lt;/p&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;static boolean deepEquals(Object a, Object b) 
&lt;/code&gt;&lt;/p&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;
static &amp;lt;T&amp;gt; int compare(T a, T b, Comparator&amp;lt;? super T&amp;gt; c)
&lt;/code&gt;&lt;/p&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;static int hashCode(Object o)
&lt;/code&gt;&lt;/p&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;static int hash(Object... values) 
&lt;/code&gt;&lt;/p&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;static String toString(Object o) 
&lt;/code&gt;&lt;/p&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;static String toString(Object o, String nullDefault) 
&lt;/code&gt;&lt;/p&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;static &amp;lt;T&amp;gt; T nonNull(T obj) 
&lt;/code&gt;&lt;/p&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;static &amp;lt;T&amp;gt; T nonNull(T obj, String message) 
&lt;/code&gt;&lt;/p&gt;

&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;

The first two methods define two &lt;i&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Equivalence_relation&quot;&gt;equivalence relations&lt;/a&gt;&lt;/i&gt; over object references.  Unlike the &lt;code&gt;equals&lt;/code&gt; methods on &lt;code&gt;Object&lt;/code&gt;, the &lt;code&gt;equals(Object a, Object b)&lt;/code&gt; method handles &lt;code&gt;null&lt;/code&gt; values.  That is, &lt;code&gt;true&lt;/code&gt; is returned if both arguments are &lt;code&gt;null&lt;/code&gt; or if the first argument is non-&lt;code&gt;null&lt;/code&gt; and &lt;code&gt;a.equals(b)&lt;/code&gt; returns &lt;code&gt;true&lt;/code&gt;.  A method with this functionality is an especially common utility method to write, there are several versions of it in the JDK, so I expect the two-argument &lt;code&gt;equals&lt;/code&gt; will be one of the most heavily used methods in the &lt;code&gt;Objects&lt;/code&gt; class.

&lt;/p&gt;

&lt;p&gt;

The second equivalence relation is defined by the &lt;code&gt;deepEquals&lt;/code&gt; method.  The &lt;code&gt;equals&lt;/code&gt; and &lt;code&gt;deepEquals&lt;/code&gt; relations can differ for object arrays; see for the javadoc for details.  Equality implies deep equality, but the converse is not true.  For example, in the program below arrays &lt;code&gt;c&lt;/code&gt; and &lt;code&gt;d&lt;/code&gt; are deep-equals but &lt;em&gt;not&lt;/em&gt; equals.

&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
public class Test {
   public static void main(String... args) {
       Object common = &quot;A string in common.&quot;;
       Object[] a = {common};
       Object[] b = {common};
       Object[] c = {a};
       Object[] d = {b};
       // c and d are deepEquals, but not equals
   }
}
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;

A third equivalence relation is the object identity relation defined by the &lt;code&gt;==&lt;/code&gt; operator on references, but since that is already built into the language, no library support is needed.  Identity equality implies &lt;code&gt;equals&lt;/code&gt; equality and &lt;code&gt;deepEquals&lt;/code&gt; equality.

&lt;/p&gt;

&lt;p&gt;

Next, &lt;code&gt;Objects&lt;/code&gt; includes a &lt;code&gt;null&lt;/code&gt;-tolerant &lt;code&gt;Comparator&lt;/code&gt;-style method which first compares for object identity using &lt;code&gt;==&lt;/code&gt; before calling the provided &lt;code&gt;Comparator&lt;/code&gt;.  While &lt;code&gt;Comparable&lt;/code&gt; classes aren't as widely available as the methods inherited from &lt;code&gt;java.lang.Object&lt;/code&gt;, &lt;code&gt;Comparable&lt;/code&gt; is a very useful and frequently implemented interface.

&lt;/p&gt;

&lt;p&gt;

&lt;code&gt;Objects&lt;/code&gt; has two hash-related methods.  The first is a &lt;code&gt;null&lt;/code&gt;-handling hash method which assigns &lt;code&gt;null&lt;/code&gt; a zero hash code and the second is a utility method for implementing a reasonable hash function for a class just by passing in the right list of values.

&lt;/p&gt;


&lt;p&gt;

The &lt;code&gt;toString&lt;/code&gt; methods provide &lt;code&gt;null&lt;/code&gt; handling support, in case of a &lt;code&gt;null&lt;/code&gt; argument either returning &lt;code&gt;&quot;null&quot;&lt;/code&gt; or the provided default string.

&lt;/p&gt;


&lt;p&gt;

Finally, there are two methods to more conveniently handle &lt;code&gt;null&lt;/code&gt; checks, intended to be useful when validating method and constructor parameters.

&lt;/p&gt;

&lt;p&gt;

Taken together, the methods in &lt;code&gt;Objects&lt;/code&gt; should lessen the pain and tedium of &lt;code&gt;null&lt;/code&gt; handling until 
&lt;a href=&quot;http://types.cs.washington.edu/jsr308/&quot;&gt;more systematic&lt;/a&gt; approaches are used.

&lt;/p&gt;

&lt;p&gt;

The &lt;code&gt;Objects&lt;/code&gt; API was shaped by discussion in 
&lt;a href=&quot;http://mail.openjdk.java.net/pipermail/core-libs-dev/2009-September/002572.html&quot;&gt;various&lt;/a&gt;
&lt;a href=&quot;http://mail.openjdk.java.net/pipermail/core-libs-dev/2009-October/002883.html&quot;&gt;threads&lt;/a&gt; on 
&lt;a href=&quot;http://mail.openjdk.java.net/pipermail/core-libs-dev/&quot;&gt;&lt;code&gt;core-libs-dev&lt;/code&gt;&lt;/a&gt; in September and October 2009.

Several other bugs were also fixed as a result of those discussions, one adding a set of &lt;code&gt;compare&lt;/code&gt; methods for primitive types 
(&lt;a href=&quot;http://bugs.sun.com/view_bug.do?bug_id=6582946&quot; title=&quot;Add suite of compare(T, T) methods for ints, longs etc&quot;&gt;6582946&lt;/a&gt;) 
and another to consistently define the hash codes of the wrapper classes
(&lt;a href=&quot;http://bugs.sun.com/view_bug.do?bug_id=4245470&quot; title=&quot;algorithm of java.lang.Byte.hashCode() is not specified&quot;&gt;4245470&lt;/a&gt;).

&lt;/p&gt;</description>
	<pubDate>Wed, 03 Feb 2010 18:58:27 +0000</pubDate>
</item>
<item>
	<title>Joe Darcy: JDK 7: New Component Delivery Model Delivered</title>
	<guid>http://blogs.sun.com/darcy/entry/jdk_7_new_component_delivered</guid>
	<link>http://blogs.sun.com/darcy/entry/jdk_7_new_component_delivered</link>
	<description>&lt;p&gt;

Thanks to &lt;a href=&quot;http://blogs.sun.com/kto/&quot;&gt;Kelly&lt;/a&gt;, 
the new &lt;a href=&quot;http://blogs.sun.com/darcy/entry/jdk7_component_deliver_model&quot; title=&quot;JDK 7: New Component Delivery Model in the Works&quot;&gt;component delivery model&lt;/a&gt;
 for &lt;code&gt;jaxp&lt;/code&gt; and &lt;code&gt;jax-ws&lt;/code&gt; is now available in both JDK 7, as of build 72 of milestone 5, and OpenJDK 6, coming in build 18 
(&lt;a href=&quot;http://bugs.sun.com/view_bug.do?bug_id=6856630&quot; title=&quot;Restructure jaxp/jaxws repositories&quot;&gt;6856630&lt;/a&gt;).

&lt;/p&gt;

&lt;p&gt;

As described previously, the JDK build no longer tracks a copy of the &lt;code&gt;jaxp&lt;/code&gt; and &lt;code&gt;jax-ws&lt;/code&gt; sources under version control.  Instead source bundles from the upstream teams are used.  The &lt;code&gt;jaxp.properties&lt;/code&gt; file in the &lt;code&gt;jaxp&lt;/code&gt; repository contains the default URL from which the source bundle is downloaded as well as the expected checksum for that file.  The analogous setup is used for &lt;code&gt;jax-ws&lt;/code&gt; in its repository. 

To avoid downloading another copy of a bundle or to try out an alternate bundle, several variables can be set in the &lt;code&gt;ant&lt;/code&gt; build of one of the repositories.  For &lt;code&gt;jaxp&lt;/code&gt;, 

&lt;/p&gt;

&lt;blockquote&gt;&lt;code&gt;

jaxp-repo-directory$ ant -f build.xml \ &lt;br /&gt;
-Ddrops.master.copy.base=&lt;i&gt;path-to-drop-directory&lt;/i&gt; \ &lt;br /&gt;
-Djaxp_src.bundle.name=&lt;i&gt;name-of-source-zip-bundle-in-drop-directory&lt;/i&gt; \ &lt;br /&gt;
-Djaxp_src.bundle.md5.checksum=&lt;i&gt;md5-of-source-zip-bundle&lt;/i&gt;


&lt;/code&gt;&lt;/blockquote&gt;

&lt;p&gt;

If changes local to the JDK are needed, patches can be applied from the new &lt;code&gt;patches&lt;/code&gt; directory in the two repositories.  For example, patches are a mechanism that could be used to deploy security fixes until a new source bundle with those fixes was externally available.

&lt;/p&gt;

&lt;p&gt;

With this new delivery model, I look forward to low-overhead and coordinated updates to &lt;code&gt;jaxp&lt;/code&gt; and &lt;code&gt;jax-ws&lt;/code&gt; in OpenJDK 6 and JDK 7.

&lt;/p&gt;

&lt;p&gt;

A possible future consolidation would fold the build logic in the now vestigial &lt;code&gt;jaxp&lt;/code&gt; and &lt;code&gt;jax-ws&lt;/code&gt; repositories into the main &lt;code&gt;jdk&lt;/code&gt; repository.

&lt;/p&gt;</description>
	<pubDate>Wed, 03 Feb 2010 02:03:31 +0000</pubDate>
</item>

</channel>
</rss>
