<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2germanfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Java Blog | Javainsel-Blog</title>
	
	<link>http://www.tutego.de/blog/javainsel</link>
	<description>Java-Insel Blog</description>
	<lastBuildDate>Sat, 21 Jan 2012 20:58:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/javainsel" /><feedburner:info uri="javainsel" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:feedFlare href="http://add.my.yahoo.com/content?lg=de&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://us.i1.yimg.com/us.yimg.com/i/de/my/addtomyyahoo4.gif">Subscribe with Mein Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/javainsel" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsalloy.com/?rss=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://www.newsalloy.com/subrss3.gif">Subscribe with NewsAlloy</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://www.yourminis.com/subscribe.aspx?u=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://www.yourminis.com/images/addtoyourminisbadge.gif">Subscribe with Yourminis.com</feedburner:feedFlare><feedburner:feedFlare href="http://download.attensa.com/app/get_attensa.html?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://www.attensa.com/blogs/attensa/WindowsLiveWriter/BadgeredintoBadges_10C02/attensa_feed_button5.gif">Subscribe with Attensa for Outlook</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://hub.netomat.net/account/account.autoSubscribe.jspa?urls=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://www.netomat.net/blogger/images/icon_netomat_feedbutton.gif">Subscribe with netomat Hub</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.flurry.com/pushRssFeed.do?r=fb&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://www.flurry.com/images/flurry_rss_logo2.gif">Subscribe with Flurry</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2Fjavainsel" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><item>
		<title>unsigned integer arithmetic in Java 8</title>
		<link>http://feedproxy.google.com/~r/javainsel/~3/uSIY90zBtHE/</link>
		<comments>http://www.tutego.de/blog/javainsel/2012/01/unsigned-integer-arithmetic-in-java-8/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 20:58:53 +0000</pubDate>
		<dc:creator>Christian Ullenboom</dc:creator>
				<category><![CDATA[Java 8]]></category>

		<guid isPermaLink="false">http://www.tutego.de/blog/javainsel/?p=1203</guid>
		<description><![CDATA[Siehe http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-January/008926.html und die Quellen hier http://hg.openjdk.java.net/jdk8/tl/jdk/rev/71200c517524. Neue Methoden in Byte: static int toUnsignedInt(byte x) static long toUnsignedLong(byte x) In Integer: static String toUnsignedString(int i, int radix) static String toUnsignedString(int i) static int parseUnsignedInt(String s, int radix) static int compareUnsigned(int x, int y) static long toUnsignedLong(int x) static int divideUnsigned(int dividend, int divisor) static int [...]]]></description>
			<content:encoded><![CDATA[<p>Siehe <a href="http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-January/008926.html">http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-January/008926.html</a> und die Quellen hier <a href="http://hg.openjdk.java.net/jdk8/tl/jdk/rev/71200c517524">http://hg.openjdk.java.net/jdk8/tl/jdk/rev/71200c517524</a>.</p>
<p>Neue Methoden in Byte:</p>
<ul>
<li>static int toUnsignedInt(byte x) </li>
<li>static long toUnsignedLong(byte x) </li>
</ul>
<p>In Integer:</p>
<ul>
<li>static String toUnsignedString(int i, int radix) </li>
<li>static String toUnsignedString(int i)</li>
<li>static int parseUnsignedInt(String s, int radix)</li>
<li>static int compareUnsigned(int x, int y) </li>
<li>static long toUnsignedLong(int x)</li>
<li>static int divideUnsigned(int dividend, int divisor)</li>
<li>static int remainderUnsigned(int dividend, int divisor)</li>
</ul>
<p>In Long:</p>
<ul>
<li>String toUnsignedString(long i, int radix)</li>
<li>static String toUnsignedString(long i)</li>
<li>static long parseUnsignedLong(String s, int radix)</li>
<li>static int compareUnsigned(long x, long y) </li>
<li>static long divideUnsigned(long dividend, long divisor) </li>
<li>static long remainderUnsigned(long dividend, long divisor)</li>
</ul>
<p>In Short:</p>
<ul>
<li>static int toUnsignedInt(short x)</li>
<li>static long toUnsignedLong(short x) </li>
</ul>
<img src="http://feeds.feedburner.com/~r/javainsel/~4/uSIY90zBtHE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tutego.de/blog/javainsel/2012/01/unsigned-integer-arithmetic-in-java-8/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.tutego.de/blog/javainsel/2012/01/unsigned-integer-arithmetic-in-java-8/</feedburner:origLink></item>
		<item>
		<title>Sehr schön gemachte Seite über das Design von Android-Apps</title>
		<link>http://feedproxy.google.com/~r/javainsel/~3/yEZRcqV4lTg/</link>
		<comments>http://www.tutego.de/blog/javainsel/2012/01/sehr-schn-gemachte-seite-ber-das-design-von-android-apps/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 07:47:31 +0000</pubDate>
		<dc:creator>Christian Ullenboom</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://www.tutego.de/blog/javainsel/?p=1201</guid>
		<description><![CDATA[http://developer.android.com/design/index.html]]></description>
			<content:encoded><![CDATA[<p><a href="http://developer.android.com/design/index.html">http://developer.android.com/design/index.html</a></p>
<img src="http://feeds.feedburner.com/~r/javainsel/~4/yEZRcqV4lTg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tutego.de/blog/javainsel/2012/01/sehr-schn-gemachte-seite-ber-das-design-von-android-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tutego.de/blog/javainsel/2012/01/sehr-schn-gemachte-seite-ber-das-design-von-android-apps/</feedburner:origLink></item>
		<item>
		<title>Update der Hibernate Version 4.0.1</title>
		<link>http://feedproxy.google.com/~r/javainsel/~3/ZkY0nX4-8Sw/</link>
		<comments>http://www.tutego.de/blog/javainsel/2012/01/update-auf-version-4-0-1/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 12:55:16 +0000</pubDate>
		<dc:creator>Christian Ullenboom</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.tutego.de/blog/javainsel/?p=1198</guid>
		<description><![CDATA[Erst ein paar Tage ist es her, da kam Hibernate 4 heraus. Nun gibt es auch schon das erste Update. Die Änderungen: https://hibernate.onjira.com/secure/ReleaseNote.jspa?projectId=10031&#38;version=11754]]></description>
			<content:encoded><![CDATA[<p>Erst ein paar Tage ist es her, da kam Hibernate 4 heraus. Nun gibt es auch schon das erste Update. Die Änderungen: <a href="https://hibernate.onjira.com/secure/ReleaseNote.jspa?projectId=10031&amp;version=11754">https://hibernate.onjira.com/secure/ReleaseNote.jspa?projectId=10031&amp;version=11754</a></p>
<img src="http://feeds.feedburner.com/~r/javainsel/~4/ZkY0nX4-8Sw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tutego.de/blog/javainsel/2012/01/update-auf-version-4-0-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tutego.de/blog/javainsel/2012/01/update-auf-version-4-0-1/</feedburner:origLink></item>
		<item>
		<title>Diagnose Kommandos kommen in Java 8 und Java 7u4</title>
		<link>http://feedproxy.google.com/~r/javainsel/~3/Mn2dfW-QPDM/</link>
		<comments>http://www.tutego.de/blog/javainsel/2012/01/diagnose-kommandos-kommen-in-java-8-und-java-7u4/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 10:20:59 +0000</pubDate>
		<dc:creator>Christian Ullenboom</dc:creator>
				<category><![CDATA[Java 7]]></category>
		<category><![CDATA[Java 8]]></category>

		<guid isPermaLink="false">http://www.tutego.de/blog/javainsel/?p=1196</guid>
		<description><![CDATA[Das werden wir im nächsten Build bekommen, Quellen schon mal hier: http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/0194fe5ca404. A diagnostic command is an action that can be invoked dynamically mainly for troubleshooting and diagnosis. Die Idee ist also, das man ein Kommandozeilentool jcmd hat, mit dem man Kommandos an die JVM schicken kann. Dabei sind unterschiedliche Kommandos vordefiniert. Mit dem Argument [...]]]></description>
			<content:encoded><![CDATA[<p>Das werden wir im nächsten Build bekommen, Quellen schon mal hier: <a href="http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/0194fe5ca404">http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/0194fe5ca404</a>. </p>
<blockquote><p>A diagnostic command is an action that can be invoked dynamically mainly for troubleshooting and diagnosis.</p>
</blockquote>
<p>Die Idee ist also, das man ein Kommandozeilentool jcmd hat, mit dem man Kommandos an die JVM schicken kann. Dabei sind unterschiedliche Kommandos vordefiniert. Mit dem Argument PerfCounter.perf werden Performance-Kenngrößen ausgegeben.</p>
<img src="http://feeds.feedburner.com/~r/javainsel/~4/Mn2dfW-QPDM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tutego.de/blog/javainsel/2012/01/diagnose-kommandos-kommen-in-java-8-und-java-7u4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tutego.de/blog/javainsel/2012/01/diagnose-kommandos-kommen-in-java-8-und-java-7u4/</feedburner:origLink></item>
		<item>
		<title>Kleine Korrekturen im Java 7 Update 2</title>
		<link>http://feedproxy.google.com/~r/javainsel/~3/op373JiMLWI/</link>
		<comments>http://www.tutego.de/blog/javainsel/2012/01/kleine-korrekturen-im-java-7-update-2/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 08:19:24 +0000</pubDate>
		<dc:creator>Christian Ullenboom</dc:creator>
				<category><![CDATA[Java 7]]></category>

		<guid isPermaLink="false">http://www.tutego.de/blog/javainsel/?p=1194</guid>
		<description><![CDATA[http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u2-download-1377129.html. Der Blog-Eintrag http://blogs.oracle.com/darcy/entry/project_coin_7u2_fixes gibt zwei Beispiele für Fehler aus den neuen Sprachfeatures, die gefixt sind.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u2-download-1377129.html">http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u2-download-1377129.html</a>. Der Blog-Eintrag <a href="http://blogs.oracle.com/darcy/entry/project_coin_7u2_fixes">http://blogs.oracle.com/darcy/entry/project_coin_7u2_fixes</a> gibt zwei Beispiele für Fehler aus den neuen Sprachfeatures, die gefixt sind.</p>
<img src="http://feeds.feedburner.com/~r/javainsel/~4/op373JiMLWI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tutego.de/blog/javainsel/2012/01/kleine-korrekturen-im-java-7-update-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tutego.de/blog/javainsel/2012/01/kleine-korrekturen-im-java-7-update-2/</feedburner:origLink></item>
		<item>
		<title>NetBeans 7.1 Code-Transformation nach Java 7</title>
		<link>http://feedproxy.google.com/~r/javainsel/~3/6AbB05VU2EU/</link>
		<comments>http://www.tutego.de/blog/javainsel/2012/01/netbeans-7-1-code-transformation-nach-java-7/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 17:26:16 +0000</pubDate>
		<dc:creator>Christian Ullenboom</dc:creator>
				<category><![CDATA[Entwicklungsumgebung]]></category>
		<category><![CDATA[Insel]]></category>
		<category><![CDATA[Java 7]]></category>

		<guid isPermaLink="false">http://www.tutego.de/blog/javainsel/?p=1191</guid>
		<description><![CDATA[Wähle im Menü Refactor &#62; Inspect and Transform … und dann im Dialog bei Use:/Configuration: den Eintrag Convert to Java 7 aus. Ein Klick auf Inspect startet die Suche und listet Änderungsmöglichkeiten auf und bietet an, die Stellen automatisch zu beheben. Ich habe das Tool auf den Beispielen meines Buches angewendet und die meisten Hinweise [...]]]></description>
			<content:encoded><![CDATA[<p>Wähle im Menü <strong>Refactor</strong> &gt; <strong>Inspect and Transform …</strong> und dann im Dialog bei <strong>Use:</strong>/<strong>Configuration:</strong> den Eintrag <strong>Convert to Java 7</strong> aus. Ein Klick auf <strong>Inspect</strong> startet die Suche und listet Änderungsmöglichkeiten auf und bietet an, die Stellen automatisch zu beheben.</p>
<p>Ich habe das Tool auf den Beispielen meines Buches angewendet und die meisten Hinweise beziehen sich auf Diamond und natürlich im IO-Kapitel auf auf try-mit-Ressourcen. Damit habe ich heute den ganzen Tag verbracht und auch noch ein paar kleine Fehler gefunden. Eine Stelle ist interessant:</p>
<p>XMLOutputFactory factory = XMLOutputFactory.newInstance();   <br />XMLStreamWriter writer = factory.createXMLStreamWriter( new FileOutputStream( &quot;writenParty.xml&quot; ) );</p>
<p>XMLStreamWriter hat close() aber kein AutoCloseable. Kann man als Fehler ansehen.</p>
<p>Das hier formt der Konverter nicht um, er beginnt erst bei “fett” mit dem switch, das liegt am zweiten if, was nicht als if else formuliert ist.</p>
<p>if ( &quot;Ende&quot;.equals(e.getActionCommand()) )   <br />&#160; System.exit( 0 );    <br />if ( &quot;fett&quot;.equals(e.getActionCommand()) )    <br />&#160; t.setFont( font = font.deriveFont( font.getStyle() ^ Font.BOLD ) );    <br />else if ( &quot;kursiv&quot;.equals(e.getActionCommand()) )    <br />&#160; t.setFont( font = font.deriveFont( font.getStyle() ^ Font.ITALIC ) );</p>
<img src="http://feeds.feedburner.com/~r/javainsel/~4/6AbB05VU2EU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tutego.de/blog/javainsel/2012/01/netbeans-7-1-code-transformation-nach-java-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.tutego.de/blog/javainsel/2012/01/netbeans-7-1-code-transformation-nach-java-7/</feedburner:origLink></item>
		<item>
		<title>Inselupdate: Vererbung und Überschattung von statischen Variablen</title>
		<link>http://feedproxy.google.com/~r/javainsel/~3/HS0vb9XZgDE/</link>
		<comments>http://www.tutego.de/blog/javainsel/2012/01/inselupdate-vererbung-und-berschattung-von-statischen-variablen/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 10:55:53 +0000</pubDate>
		<dc:creator>Christian Ullenboom</dc:creator>
				<category><![CDATA[Insel]]></category>

		<guid isPermaLink="false">http://www.tutego.de/blog/javainsel/?p=1189</guid>
		<description><![CDATA[Die Konstanten einer Schnittstelle können einer anderen Schnittstelle vererbt werden. Dabei gibt es einige kleine Einschränkungen. Wir wollen an einem Beispiel sehen, wie sich die Vererbung auswirkt, wenn gleiche Bezeichner in den Unterschnittstellen erneut verwendet werden. Als Basis unseres Beispiels steht eine Schnittstelle BaseColors mit ein paar Deklarationen von Farben. Zwei Unterschnittstellen erweiterten BaseColor, einmal [...]]]></description>
			<content:encoded><![CDATA[<p>Die Konstanten einer Schnittstelle können einer anderen Schnittstelle vererbt werden. Dabei gibt es einige kleine Einschränkungen. Wir wollen an einem Beispiel sehen, wie sich die Vererbung auswirkt, wenn gleiche Bezeichner in den Unterschnittstellen erneut verwendet werden. Als Basis unseres Beispiels steht eine Schnittstelle BaseColors mit ein paar Deklarationen von Farben. Zwei Unterschnittstellen erweiterten BaseColor, einmal CarColors und PlaneColors, die für Farbdeklarationen für Autos und Flugzeuge stehen. Eine besondere Schnittstelle FlyingCarColors erweitert die beiden Schnittstelen CarColors und PlaneColors, denn es gibt auch fliegende Autos, die eine Farbe haben können. </p>
<pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px"><span style="color: #0000ff">interface</span> BaseColors
</pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">{
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">  <span style="color: #0000ff">int</span> WHITE   = 0;
</pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">  <span style="color: #0000ff">int</span> BLACK   = 1;
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">  <span style="color: #0000ff">int</span> GREY    = 2;
</pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">}
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px"></pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px"><span style="color: #0000ff">interface</span> CarColors <span style="color: #0000ff">extends</span> BaseColors
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">{
</pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">  <span style="color: #0000ff">int</span> WHITE   = 1;
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">  <span style="color: #0000ff">int</span> BLACK   = 0;
</pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">}
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px"></pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px"><span style="color: #0000ff">interface</span> PlaneColors <span style="color: #0000ff">extends</span> BaseColors
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">{
</pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">  <span style="color: #0000ff">int</span> WHITE   = 0;
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">  <span style="color: #0000ff">int</span> GREY    = 2;
</pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">}
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px"></pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px"><span style="color: #0000ff">interface</span> FlyingCarColors <span style="color: #0000ff">extends</span> CarColors, PlaneColors
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">{
</pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">}
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px"></pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> Colors
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">{
</pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">  <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> main( String[] args )
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">  {
</pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">    System.out.println( BaseColors.GREY );      <span style="color: #008000">// 2</span>
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">    System.out.println( CarColors.GREY );       <span style="color: #008000">// 2</span>
</pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">    System.out.println( BaseColors.BLACK );     <span style="color: #008000">// 1</span>
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">    System.out.println( CarColors.BLACK );      <span style="color: #008000">// 0</span>
</pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">    System.out.println( PlaneColors.BLACK );    <span style="color: #008000">// 1</span>
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px"></pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">    System.out.println( FlyingCarColors.WHITE );<span style="color: #008000">//  The field FlyingCarColors.WHITE is ambiguous</span>
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">    System.out.println( FlyingCarColors.GREY ); <span style="color: #008000">//  The field FlyingCarColors.GREY is ambiguous</span>
</pre>
<pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">  }
</pre>
<pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 13px">}</pre>
</pre>
<p>Die erste wichtige Tatsache ist, dass unsere drei Schnittstellen ohne Fehler übersetzt werden können, aber nicht die Klasse Colors. Das Programm und der Compiler zeigen folgendes Verhalten:</p>
<ul>
<li>Schnittstellen vererben ihre Eigenschaften an die Unterschnittstellen. CarColors und auch PlaneColors erbten die Farbe WHITE, BLACK und GREY aus BaseColors.</li>
<li>Konstanten dürfen überschattet werden. CarColors vertauscht die Farbdeklarationen von WHITE und BLACK und gibt ihnen neue Werte. Wird jetzt der Wert CarColors.BLACK verlangt, liefert die Umgebung den Wert 0, während CarColors.BLACK 1 ergibt. Auch PlaneColor überdeckt die Konstanten WHITE und GREY obwohl sie Farbe mit dem gleichen Wert belegt sind.</li>
<li>Erbt eine Schnittstelle von mehreren Oberschnittstellen, so ist es zulässig, wenn die Oberschnittstellen jeweils ein gleichlautendes Attribut haben. So erbt etwa FlyingCarColors von CarColors und PlaneColors den Eintrag WHITE, BLACK und GREY.</li>
<li>Unterschnittstellen können aus zwei Oberschnittstellen die Attribute gleichen Namens übernehmen, auch wenn sie einen unterschiedlichen Wert haben. Das testet der Compiler nicht. FlyingCarColors bekommt aus CarColors ein WHITE mit 1 aber aus PlaneColors das Weiß mit 0. Daher ist auch der Zugriff FlyingCarColors.WHITE in dem Beispiel Colors auch nicht möglich und führt zu einem Compilerfehler. Bei der Benutzung muss ein unmissverständlicher qualifizierter Name verwendet werden, der deutlich macht, welches Attribut gemeint ist, also zum Beispiel CarColors.WHITE oder PlaneColors.WHITE. Ähnliches gilt für die Farbe GREY. Obwohl Grau durch die ursprüngliche Deklaration bei BaseColor und auch bei der Überschattung in PlaneColors immer Zwei ist, ist die Nutzung durch FlyingCarColors.GREY nicht zulässig. Das ist ein guter Schutz gegen Fehler, denn wenn der Compiler dies durchließe, könnte sich im Nachhinein die Belegung von GREY in BaseColors oder PlaneColors ohne Neuübersetzung aller Klassen ändern, und zu Schwierigkeiten führen. Diesen Fehler – die Oberschnittstellen haben für eine Konstante unterschiedliche Werte – müsste die Laufzeitumgebung erkennen. Doch das ist nicht möglich und in der Regel setzt der Compiler die Werte auch direkt in die Aufrufstelle ein und ein Zugriff auf die Konstantenwerte der Schnittstelle findet nicht mehr statt.</li>
</ul>
<img src="http://feeds.feedburner.com/~r/javainsel/~4/HS0vb9XZgDE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tutego.de/blog/javainsel/2012/01/inselupdate-vererbung-und-berschattung-von-statischen-variablen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tutego.de/blog/javainsel/2012/01/inselupdate-vererbung-und-berschattung-von-statischen-variablen/</feedburner:origLink></item>
		<item>
		<title>Google Guava: Delete all files in a directory (now deprecated)</title>
		<link>http://feedproxy.google.com/~r/javainsel/~3/F1_jhJXkFMI/</link>
		<comments>http://www.tutego.de/blog/javainsel/2012/01/google-guava-delete-all-files-in-a-directory-now-deprecated/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 11:19:02 +0000</pubDate>
		<dc:creator>Christian Ullenboom</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://www.tutego.de/blog/javainsel/?p=1187</guid>
		<description><![CDATA[The java.io.File class can delete a file but not a collection of files or a whole directory including its containing files. com.google.common.io.Files declares two methods to do this job: static void deleteDirectoryContents(File directory) Delete all the files within a directory but not the directory itself. If the contents of this or any subdirectory can’t be [...]]]></description>
			<content:encoded><![CDATA[<p>The java.io.File class can delete a file but not a collection of files or a whole directory including its containing files. com.google.common.io.Files declares two methods to do this job:</p>
<ul>
<li>static void deleteDirectoryContents(File directory)     <br />Delete all the files within a directory but not the directory itself. If the contents of this or any subdirectory can’t be listed an IOException(&quot;Error listing files for &quot; + directory) will be thrown.</li>
<li>static void deleteRecursively(File file) throws IOException     <br />Delete a file or directory and all contents recursively. This methods calls deleteDirectoryContents() first and then file.delete(). If this directory can’t be deleted an IOException(&quot;Failed to delete &quot; + file) will be thrown.</li>
</ul>
<p>Because a file can be a symbolic link it is important to understand the semantics of these methods. If a containing file or directory is a symbolic link will the symbolic link itself be deleted or will the method follow the link and delete the target? None of the methods follow symbolic links because it’s simply not possible with the JDK. If these methods find a symbolic link then just the link will be deleted. But what if the methods are called on a directory which is itself a symbolic link?</p>
<p>If deleteDirectoryContents() is called on a File object which is a symbolic link to a directory nothing will happen at all because as already mentioned symbolic links are not followed; so deleteDirectoryContents() will not delete the directory the method was called on. If on the other site deleteRecursively() is called on a symbolic link then just the symbolic link to this directory is deleted but not the target directory itself. That’s just how symbolic links works in Java and has nothing to do with the actual deleteXXX()-methods.</p>
<p>&#160;</p>
<p>Alternative: Use NIO.2 from Java 7 or copy the old source code to your project.</p>
<img src="http://feeds.feedburner.com/~r/javainsel/~4/F1_jhJXkFMI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tutego.de/blog/javainsel/2012/01/google-guava-delete-all-files-in-a-directory-now-deprecated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tutego.de/blog/javainsel/2012/01/google-guava-delete-all-files-in-a-directory-now-deprecated/</feedburner:origLink></item>
		<item>
		<title>Google Guava 11</title>
		<link>http://feedproxy.google.com/~r/javainsel/~3/MsOP8qSwWkI/</link>
		<comments>http://www.tutego.de/blog/javainsel/2012/01/google-guava-11/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 11:07:48 +0000</pubDate>
		<dc:creator>Christian Ullenboom</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.tutego.de/blog/javainsel/?p=1185</guid>
		<description><![CDATA[Neues unter http://code.google.com/p/guava-libraries/wiki/Release11, genauer http://docs.guava-libraries.googlecode.com/git-history/v11.0/jdiff/changes.html. 2 neue Pakete sind: http://docs.guava-libraries.googlecode.com/git-history/v11.0/javadoc/com/google/common/hash/package-summary.html und http://docs.guava-libraries.googlecode.com/git-history/v11.0/javadoc/com/google/common/math/package-summary.html Mit der neuen MathInt Klasse beschäftigt sich ausführlicher der Blogpost http://marxsoftware.blogspot.com/2011/12/guava-release-11s-intmath.html.]]></description>
			<content:encoded><![CDATA[<p>Neues unter <a href="http://code.google.com/p/guava-libraries/wiki/Release11">http://code.google.com/p/guava-libraries/wiki/Release11</a>, genauer <a href="http://docs.guava-libraries.googlecode.com/git-history/v11.0/jdiff/changes.html">http://docs.guava-libraries.googlecode.com/git-history/v11.0/jdiff/changes.html</a>. 2 neue Pakete sind:</p>
<ul>
<li><a href="http://docs.guava-libraries.googlecode.com/git-history/v11.0/javadoc/com/google/common/hash/package-summary.html">http://docs.guava-libraries.googlecode.com/git-history/v11.0/javadoc/com/google/common/hash/package-summary.html</a> und</li>
<li><a href="http://docs.guava-libraries.googlecode.com/git-history/v11.0/javadoc/com/google/common/math/package-summary.html">http://docs.guava-libraries.googlecode.com/git-history/v11.0/javadoc/com/google/common/math/package-summary.html</a></li>
</ul>
<p>Mit der neuen MathInt Klasse beschäftigt sich ausführlicher der Blogpost <a href="http://marxsoftware.blogspot.com/2011/12/guava-release-11s-intmath.html">http://marxsoftware.blogspot.com/2011/12/guava-release-11s-intmath.html</a>.</p>
<img src="http://feeds.feedburner.com/~r/javainsel/~4/MsOP8qSwWkI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tutego.de/blog/javainsel/2012/01/google-guava-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tutego.de/blog/javainsel/2012/01/google-guava-11/</feedburner:origLink></item>
		<item>
		<title>NetBeans 7.1 ist raus</title>
		<link>http://feedproxy.google.com/~r/javainsel/~3/4KA8zE2dLig/</link>
		<comments>http://www.tutego.de/blog/javainsel/2012/01/netbeans-7-1-ist-raus/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 19:21:46 +0000</pubDate>
		<dc:creator>Christian Ullenboom</dc:creator>
				<category><![CDATA[Entwicklungsumgebung]]></category>

		<guid isPermaLink="false">http://www.tutego.de/blog/javainsel/?p=1183</guid>
		<description><![CDATA[http://wiki.netbeans.org/NewAndNoteworthyNB71]]></description>
			<content:encoded><![CDATA[<p><a href="http://wiki.netbeans.org/NewAndNoteworthyNB71">http://wiki.netbeans.org/NewAndNoteworthyNB71</a></p>
<img src="http://feeds.feedburner.com/~r/javainsel/~4/4KA8zE2dLig" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tutego.de/blog/javainsel/2012/01/netbeans-7-1-ist-raus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tutego.de/blog/javainsel/2012/01/netbeans-7-1-ist-raus/</feedburner:origLink></item>
	</channel>
</rss>

