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

<channel>
	<title>Lusta.hu &#187; java</title>
	<atom:link href="http://www.lusta.hu/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lusta.hu</link>
	<description>Amíg a test renyhe, az elme dolgozik</description>
	<lastBuildDate>Mon, 23 Jan 2012 00:28:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Securing NIO &#8211; Java SSL tutorial</title>
		<link>http://www.lusta.hu/2011/07/25/securing-nio-java-ssl-tutorial/</link>
		<comments>http://www.lusta.hu/2011/07/25/securing-nio-java-ssl-tutorial/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 14:18:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Szakmai]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.lusta.hu/?p=1160</guid>
		<description><![CDATA[Basic socket communication Writing a client/server application communicating over sockets is pretty easy in Java. The server creates an instance of the aptly named ServerSocket class, which waits for incoming connections. The client creates a Socket instance, which then connects to the server (thus creating another Socket on the server side via the accept method [...]]]></description>
			<content:encoded><![CDATA[<h2>Basic socket communication</h2>
<p>Writing a client/server application communicating over sockets is <a href="http://download.oracle.com/javase/tutorial/networking/sockets/clientServer.html">pretty easy</a> in Java. The server creates an instance of the aptly named ServerSocket class, which waits for incoming connections. The client creates a Socket instance, which then connects to the server (thus creating another Socket on the server side via the accept method of the ServerSocket), and that&#8217;s it. Although Sockets are normally blocking read operations, it is easy to emulate a single threaded non-blocking communication with simply checking the available bytes on the socket, and reading only that much.</p>
<h2>Blocking secure socket communication, the problem</h2>
<p>Switching to a secure socket connection is <a href="https://www.ibm.com/developerworks/java/tutorials/j-jsse/">very easy</a>: First, you need to <a href="http://code.google.com/p/keytool-iui/">create some keystores</a>, then some initialization in the code and then you can use some factory classes to create the secure sockets instead of the original constructor calls. Everything else is almost the same.. except..</p>
<p>Getting the number of available bytes are not reliable any more. The reason is simple: As your security and application data arrives in the same stream, the security engine is not able to tell the amount of available application bytes without trying to decrypt everything, but that is a complex operation. Probably more complex and requires more effort than you would like to have in an infinite loop.</p>
<p>Because of this, our workaround for blocking communication is not usable anymore. For a simple application with just one or a handful of clients it is acceptable to have a separate thread for all of the connected clients on the server side, but we need another solution for high user counts.</p>
<h2>SocketChannels</h2>
<p>Java NIO has a nonblocking socket solution. SocketChannels are designed for this. Because of the fundamentally different usage and the additional classes, such as Selectors, most people never uses them, but they are not overly complex, and with a little practice can be used easily. For beginners, I&#8217;d recommend reading this article: <a href="http://rox-xmlrpc.sourceforge.net/niotut/">Rox Java NIO Tutorial</a>. It&#8217;s probably not the easiest to understand, but contains very useful tips and explains typical pitfalls.</p>
<p>Using this, we solve the issue with the blocking channels, but security is still lacking. The bad news is: It is pretty hard to make SocketChannels secure. This is your second chance to turn back, and use the blocking solution, they say<a href="http://java.dzone.com/news/how-get-c-performance-java"> a few thousand threads are not really a problem</a> for a good server <img src='http://www.lusta.hu/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<h2>Securing SocketChannels</h2>
<p>Ok, you are desperate. You want &#8216;em non-blocking channels communicate securely. Here is what you need to add to the code:</p>
<ol>
<li>You don&#8217;t need to do anything with the ServerSocketChannel, and the way it accepts connections.</li>
<li>I prefer doing the reading and writing in a separate class, which &#8220;owns&#8221; the connection and the SSLEngine. (See Below)</li>
<li>Initialize your security.</li>
<li>On the server side, for every new socketchannel, create a new SSLEngine.</li>
<li>On the client side, do the same for your one channel.</li>
<li>Initiate the handshake.</li>
<li>After the handshake, wrap everything you want to send and unwrap everything that you receive on both sides.</li>
</ol>
<p>So far it is not too complex, right? Let&#8217;s dig deeper.</p>
<p>Initializing security:</p>
<pre>private void setupSecurity() {
	SecureRandom secureRandom = new SecureRandom();
	secureRandom.nextInt();

	KeyStore clientKeyStore = KeyStore.getInstance("JKS");
	clientKeyStore.load(new FileInputStream("client.jks"), "KeyStorePassword".toCharArray()); 

	TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
	tmf.init(clientKeyStore);

	KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
	kmf.init(clientKeyStore, "KeyInKeystorePassword".toCharArray());

	sslContext = SSLContext.getInstance("TLS");
	sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), secureRandom);
}</pre>
<p>Couldn&#8217;t be more straightforward. Creating an SSLEngine is just as easy:</p>
<pre>SSLEngine engine = sslContext.createSSLEngine();</pre>
<p>And now the handshake.. You can find a lot of explanations <a href="http://download.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#SSLENG">here</a> (it&#8217;s a bit dry, but very useful). The scaffolding for the code can be found in the same article, but you are better off if you check the code here: <em>[jdk home]\sample\nio\server\ChannelIOSecure.java</em></p>
<p>It is very complicated, and there is a hidden &#8220;flaw&#8221;: It&#8217;s meant to be used with blocking channels. (See below). Also, some structures are a bit more complex than I&#8217;d usually like it, for example the 3 levels deep switch constructs. Anyway, for now you should just try to copy it as closely as you can, and if you can make it work, then you can improve the code as much as you want.</p>
<h2>The problems I faced</h2>
<p>Obviously, it didn&#8217;t work for me the first time I tried. Here are some tips:</p>
<ul>
<li>Don&#8217;t give up. It&#8217;s complex and ugly, but it can be done.</li>
<li>If the handshake doesn&#8217;t start, and/or the server complains about plaintext connection, insert the engine.beginHandshake() line before the handshake process. Sometimes the only issue that you see is that the clients sends the messages and the server simply absorbs them without any apparent effect.</li>
<li>If you get repeated buffer underflow errors on the server side, and using non-blocking communication, it&#8217;s time to add a new check for zero length reads. Trying to unwrap zero length ByteBuffers can cause this issue.</li>
<li>In case of unsupported record version problems or sequence violation (during the handshake) try to empty your buffers before you read/unwrap into them and after you have sent them to the other party. Leftover bytes can cause this issue. (<em>Unsupported record version Unknown</em>) (<em>Handshake message sequence violation</em>)</li>
<li>If the server/client complains about invalid handshake mac, check your flushing code. You may loose some important bytes. (<em>bad handshake record MAC</em>)</li>
<li>Google is your friend: There are a lot of people out there who solved the same issues and wrote an article about it.</li>
<li>It&#8217;s a good idea to add some logging to the code to see what is happening. It helps you to see the sequence of events on both sides.</li>
<li>There are some issues and solutions <a href="http://download.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#Troubleshooting">here</a> I didn&#8217;t face. Still, you may see them.</li>
</ul>
<p>I hope this will help some of you to develop some great, secure applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lusta.hu/2011/07/25/securing-nio-java-ssl-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Static Dependency Injection &amp; AOP</title>
		<link>http://www.lusta.hu/2011/06/02/static-dependency-injection-aop/</link>
		<comments>http://www.lusta.hu/2011/06/02/static-dependency-injection-aop/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 13:04:28 +0000</pubDate>
		<dc:creator>Vagabond</dc:creator>
				<category><![CDATA[Szakmai]]></category>
		<category><![CDATA[annotation]]></category>
		<category><![CDATA[aop]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[dependency injection]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.lusta.hu/?p=1139</guid>
		<description><![CDATA[Alapvetően két problémám van a DI-t és AOP-t megvalósító framework-ökkel: Hozzá kell adni egy extra jar-t a classpathhoz, amitől sokkal combosabb lesz az egész alkalmazás, és ha esetleg webstartozol, akkor még sign-olni is kell, valamint van egy performance hit &#8211; A DI a startupnál, az AOP pedig folyamatosan jelentkezik. Vannak ugyanakkor olyan problémák, amit így [...]]]></description>
			<content:encoded><![CDATA[<p>Alapvetően két problémám van a <a href="http://en.wikipedia.org/wiki/Dependency_injection">DI</a>-t és <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">AOP</a>-t megvalósító framework-ökkel: Hozzá kell adni egy extra jar-t a classpathhoz, amitől sokkal combosabb lesz az egész alkalmazás, és ha esetleg webstartozol, akkor még sign-olni is kell, valamint van egy performance hit &#8211; A DI a startupnál, az AOP pedig folyamatosan jelentkezik.<br />
Vannak ugyanakkor olyan problémák, amit így lehet a legszebben megoldani, például a logolás elválasztása a függvényeinktől, vagy egy Chain of Command pattern esetén a Command osztályok inicializálása és a chain-be rakása. </p>
<p>A minap, amikor a javas Annotation-ökről olvastam, belefutottam az általam korábban még soha (tudatosan) nem használt <a href="http://download.oracle.com/javase/1.5.0/docs/guide/apt/GettingStarted.html">apt (Annotation Processing Tool)</a> nevű eszközbe. Ahogy olvasgattam a képességeiről, felmerült bennem, hogy ezzel meg lehetne oldani azt, amit én statikus DI-nak és statikus AOP-nek hívok.</p>
<p>Az apt lényege, hogy &#8211; főként az annotációkat használva, de generálisan is &#8211; fordítás előtt átszalad az egész kódon, és meghív bizonyos, a felhasználó által specifikált feldolgozó egységeket, amik átalakíthatják a kódot, vagy hozzáadhatnak új osztályokat, etc. Gyakorlatilag beteszünk egy extra lépést a kód elkészítése és lefordítása közé.<br />
Valami ilyesmi a statikus AOP lényege: Bár kód szinten elszeparáljuk a különböző dolgokat, például a logolást, és pusztán egy annotationnel jelöljük, hogy ez a metódus kellene, hogy logoljon (@LoggingMethod, pl.), a lefordított osztályokban már megjelenik az a kód. Hasonlóan működik a DI is.</p>
<p>Például: Össze akarom gyűjteni az összes Command osztályt egy List<Command> -ba.<br />
Csinálok két annotációt és egy statikus függvényt, mondjuk <em>registerCommand(Command c)</em>. A függvény feladata mindössze annyi, hogy a fenti listába belerakja a Command osztályt (és csinál vele minden egyebet, amit csak akarunk), az annotációk pedig kb. így néznek ki:</p>
<p><code>
<pre>
@Target(ElementType.TYPE)
public @interface CollectionMarker {
    String collection();
    String enabled() default true; // erről meg ejtek pár szót
}</pre>
<p></code></p>
<p><code>
<pre>
@Target(ElementType.METHOD)
public @interface CollectionMethod {
    String collection();
}</pre>
<p></code></p>
<p>Az utóbbit elhelyezem a fenti függvényen, az előbbit pedig minden egyes Command osztályon, amit megírok.</p>
<p>Ezután a processzorok úgy működnek, hogy az egyik összegyűjt egy listát az összes CollectionMarkerrel megjelölt osztályról, a másik megjegyzi, hogy hol a CollectionMethod, majd a feldolgozás végén a megjegyzett osztályba berakunk egy static initializer blokkot, amibe belekerül egy csomó <em>registerCommand(new AkarmilyenCommand());</em>. S lőn, kész is van a chain.</p>
<p>Amit vesztünk ezzel, az<br />
- A dinamikusság: Nem elég átírni egy XML-t és újraindítani az alkalmazást, mint a Spring-nél, ha változtatni akarunk valamit a dependencián. Mindenképpen újra kell fordítanunk az alkalmazást.<br />
- Fordítási sebesség: A fordítás valamivel lassabb lesz<br />
- Rugalmasság: Nyilvánvalóan van egy csomó olyan DI alkalmazás, amit nem lehet megoldani statikus módon.</p>
<p>Amit nyerünk vele:<br />
- Némi performancia<br />
- Átlátható kód extra frameworkok nélkül<br />
- A Spring XML-hez viszonyítva: compile time ellenőrzés a dependenciákra<br />
- Automatizált taszk végrehajtás (Az új command hozzáadása esetén csak az osztály kell létrehoznunk és ellátnunk a megfelelő annotációval, nem kell még különböző ponton beszúrni listákba)</p>
<p>Említettem fent, hogy az enabled attribútumról még ejtek pár szót: ha a gyűjtő egység figyeli ennek is az értékét, és nem gyűjti be azokat, ahol az enabled értéke false, akkor ennek a kapcsolónak az átbillentésével ki-be kapcsolhatjuk a gyűjtését. Akár még azt is megtehetjük, hogy a true-false helyett szinteket definiálunk, és bizonyos osztályokat csak debug módban használunk, productionben nem (ezeket, ha jól sejtem, akár ki is törölhetjük a feldolgozás során..).<br />
Ez így magában még nem is annyira érdekes, de van még egy ennél is fontosabb szerepe: ha a fenti annotation definiciót (a Markert) megfejeljük egy @Inherited annotációval, akkor a leszármazottak is öröklik. Innentől elvileg minden leszármazottat begyűjtünk.. kivéve, ahol specifikusan kitesszük a markert a az enabled attribútum értékét false-ra állítva. </p>
<p>Akik az IDE integráció miatt aggódnak, azoknak sem kell igazából. Az Eclipse-t biztosan tudom, hogy támogatja ezt, a Netbeans és IDEA esetén pedig csak sejtem, hogy támogatják ezt a dolgot (vsz. 5 perc lenne kideríteni a google-lel).</p>
<p>Egyelőre csak a fejemben született meg ez a dolog, nem valósítottam meg, de a horizonton van. Ha lesz konkrétum, vsz kirakom valami elérhető helyre, mondjuk google code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lusta.hu/2011/06/02/static-dependency-injection-aop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Feltetelezes</title>
		<link>http://www.lusta.hu/2010/11/05/feltetelezes/</link>
		<comments>http://www.lusta.hu/2010/11/05/feltetelezes/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 14:07:14 +0000</pubDate>
		<dc:creator>Vagabond</dc:creator>
				<category><![CDATA[Szakmai]]></category>
		<category><![CDATA[assert]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.lusta.hu/?p=959</guid>
		<description><![CDATA[A munkam kapcsan most kicsit utana kellett olvasnom az assertion-oknek, es az Oracle-os assert doksiban talaltam egy vicces reszt: static { boolean assertsEnabled = false; assert assertsEnabled = true; // Intentional side effect!!! if (!assertsEnabled) throw new RuntimeException("Asserts must be enabled!!!"); } Zsenialisan 1xu.]]></description>
			<content:encoded><![CDATA[<p>A munkam kapcsan most kicsit utana kellett olvasnom az assertion-oknek, es az <a href="http://download.oracle.com/javase/1.4.2/docs/guide/lang/assert.html">Oracle-os assert doksiban</a> talaltam egy vicces reszt:</p>
<p><code>
<pre>
    static {
        boolean assertsEnabled = false;
        assert assertsEnabled = true; // Intentional side effect!!!
        if (!assertsEnabled)
            throw new RuntimeException("Asserts must be enabled!!!");
    }
</pre>
<p></code></p>
<p>Zsenialisan 1xu. <img src='http://www.lusta.hu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.lusta.hu/2010/11/05/feltetelezes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Client Login For GAE</title>
		<link>http://www.lusta.hu/2010/11/02/client-login-for-gae/</link>
		<comments>http://www.lusta.hu/2010/11/02/client-login-for-gae/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 22:08:31 +0000</pubDate>
		<dc:creator>Vagabond</dc:creator>
				<category><![CDATA[Hobbi]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[app engine]]></category>
		<category><![CDATA[client login]]></category>
		<category><![CDATA[clientlogin]]></category>
		<category><![CDATA[gae]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.lusta.hu/?p=950</guid>
		<description><![CDATA[In the last three days (or I should probably say evenings) I was working on an app for Android, specifically the part which logs in to my Google App Engine app with Client Login. It was an interesting journey, and I thought that other people may be able to learn from my mistakes, so here [...]]]></description>
			<content:encoded><![CDATA[<p>In the last three days (or I should probably say evenings) I was working on an app for Android, specifically the part which logs in to my <a href="https://appengine.google.com/">Google App Engine</a> app with Client Login. It was an interesting journey, and I thought that other people may be able to learn from my mistakes, so here it is:</p>
<p>For GAE, Client Login works like this:<br />
- Get the Auth string from &#8220;https://www.google.com/accounts/ClientLogin&#8221; with a post<br />
- Using the Auth string, get the cookie from &#8220;http://myapp.appspot.com/_ah/login&#8221; using the abovementioned auth string as a get param, (and add a &#8220;continue&#8221; param too)<br />
- Use the cookie for subsequent calls</p>
<p>When I tried the second part, I got this:</p>
<pre>500 Server Error
<h2>Error: Server Error</h2>
<h3>The server encountered an error and could not complete your request.

If the problem persists, please <a href="http://code.google.com/appengine/community.html">report</a> your problem and mention this error message and the query that caused it.</h3>
</pre>
<p>The solution:<br />
Someone showed me this: <a href="http://code.google.com/p/gwt-syncproxy/source/browse/trunk/src/com/gdevelop/gwt/syncrpc/SyncProxy.java">SyncProxy.java</a></p>
<p>So I inlined the get parameters, like in the code above, or this:<br />
<code>HttpGet get = new HttpGet("http://yourapp.appspot.com/_ah/login?continue=" + URLEncoder.encode("http://yourapp.appspot.com/") + "&amp;auth="+auth.substring(5));</code><br />
(Where auth is the String from the first request, starting with: &#8220;Auth:&#8221;)<br />
And it was working.</p>
<p>A few other possible pitfalls I&#8217;ve seen:<br />
- If the first url is wrong (should be: https://www.google.com/accounts/ClientLogin) you will get cookies in the reply, a well known one is &#8220;PREF=ID=..&#8221;<br />
- The information that you send in should be the body of the &#8220;post&#8221; call for the first request, and &#8220;get&#8221; parameters in the second.<br />
- The Auth string from the first call comes back as content (in the body), not as header/cookie<br />
- For the second call, it&#8217;s better to turn off redirect following<br />
- You don&#8217;t need a CookieManager to capture the cookie. You can just look for &#8220;Set-Cookie&#8221; in the headers<br />
- You can send the cookie as a &#8220;Cookie&#8221; header field, containing the same content.<br />
- The expiry date of the cookie depends on your GAE app settings. The default is one day, you can change it to 1 or 2 weeks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lusta.hu/2010/11/02/client-login-for-gae/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The most unbelievable fix ever (Java XPath)</title>
		<link>http://www.lusta.hu/2009/11/27/the-most-unbelievable-fix-ever-java-xpath/</link>
		<comments>http://www.lusta.hu/2009/11/27/the-most-unbelievable-fix-ever-java-xpath/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 15:48:08 +0000</pubDate>
		<dc:creator>Vagabond</dc:creator>
				<category><![CDATA[Hobbi]]></category>
		<category><![CDATA[Szakmai]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[xpath]]></category>

		<guid isPermaLink="false">http://www.lusta.hu/?p=171</guid>
		<description><![CDATA[A post in English, because I believe there are a lot of people out there who can use this &#8220;fix&#8221;. Let&#8217;s start with an example: You have a moderately large library. You have different sections, each section has some subsections and each subsection has a handful of books in it. You want to make a [...]]]></description>
			<content:encoded><![CDATA[<p>A post in English, because I believe there are a lot of people out there who can use this &#8220;fix&#8221;.</p>
<p>Let&#8217;s start with an example: You have a moderately large library. You have different sections, each section has some subsections and each subsection has a handful of books in it.<br />
You want to make a catalogue from your books. Today is the day when you will process the books in the nature section, animals subsection. You want to get the name of the author, the title and the number of pages in each books.<br />
You work hard, and in five hours, you are finished with all of the 81 books in that section.</p>
<p>Your manager is not satisfied with this, so he thinks for a while, and tell you to change the process. There is one additional step to make: you need to make copy of the whole book, collect the required data from it and then you trash it. He insists that you must do this, so you start working again. As an experiment, you create the same catalogue from the same 81 books.<br />
How long did it take? Let&#8217;s see..</p>
<p>In programming terms, the first solution looks like this:</p>
<p><span style="font-family: 'Courier New', monospace; line-height: 18px; font-size: 12px; white-space: pre;"> NodeList nl = (NodeList) bookPath.evaluate(doc, XPathConstants.NODESET);</span></p>
<pre>        for(int i = 0;i&lt;nl.getLength();i++) {

            Node n = nl.item(i);

            String str = (String)title.evaluate(n, XPathConstants.STRING);

            str = (String)author.evaluate(n, XPathConstants.STRING);

            str = (String)numberOfPages.evaluate(n, XPathConstants.STRING);

        }</pre>
<p>Running this piece of code took <strong>5406ms</strong> alltogether. 5 seconds seems to be a bit long, so let&#8217;s put in some copying:</p>
<pre>        NodeList nl = (NodeList) bookPath.evaluate(doc, XPathConstants.NODESET);

        for(int i = 0;i&lt;nl.getLength();i++) {

            Node n = nl.item(i);

            <strong>Node n2 = n.cloneNode(true);</strong>

            String str = (String)title.evaluate(<strong>n2</strong>, XPathConstants.STRING);

            str = (String)author.evaluate(<strong>n2</strong>, XPathConstants.STRING);

            str = (String)numberOfPages.evaluate(<strong>n2</strong>, XPathConstants.STRING);

        }</pre>
<p>Running this piece (remember, there is one extra step in it for each and every one of the &#8220;book&#8221; nodes) took:<strong> 688ms</strong>. It is 8 times faster.</p>
<p>I&#8217;ve run this example on a 200kB XML using the built-in XPath library of Java 5 (which is to my best knowledge Xalan).</p>
<p>Something is definitely wrong here. I&#8217;ve tried to find out on Google what others think about this, and it seems that there are a lot of people who were running into this problem. I hope it will be fixed in the close future, because this workaround is not at all obvious.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lusta.hu/2009/11/27/the-most-unbelievable-fix-ever-java-xpath/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kaleidoszkóp</title>
		<link>http://www.lusta.hu/2009/09/16/kaleidoszkop/</link>
		<comments>http://www.lusta.hu/2009/09/16/kaleidoszkop/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 09:35:20 +0000</pubDate>
		<dc:creator>Vagabond</dc:creator>
				<category><![CDATA[Hobbi]]></category>
		<category><![CDATA[Szakmai]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[java me]]></category>
		<category><![CDATA[javacsript]]></category>
		<category><![CDATA[javafx]]></category>

		<guid isPermaLink="false">http://www.lusta.hu/2009/09/16/kaleidoszkop/</guid>
		<description><![CDATA[Az elmúlt napokban a következő dolgokkal foglalkoztam szabadidőmben: - JavaFx (hobbiból) - Java ME (telefonra akarok írni egy alkalmazást..) - JavaScript (A google wave miatt) Kezdek kicsit szétdarabolódni..]]></description>
			<content:encoded><![CDATA[<p>Az elmúlt napokban a következő dolgokkal foglalkoztam szabadidőmben:<br />
- JavaFx (hobbiból)<br />
- Java ME (telefonra akarok írni egy alkalmazást..)<br />
- JavaScript (A google wave miatt)</p>
<p>Kezdek kicsit szétdarabolódni..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lusta.hu/2009/09/16/kaleidoszkop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JDK 7</title>
		<link>http://www.lusta.hu/2009/09/01/jdk-7/</link>
		<comments>http://www.lusta.hu/2009/09/01/jdk-7/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 09:30:20 +0000</pubDate>
		<dc:creator>Vagabond</dc:creator>
				<category><![CDATA[Szakmai]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.lusta.hu/2009/09/01/jdk-7/</guid>
		<description><![CDATA[Pár éve már java-ban dolgozom, és bár lassan kezdek más irányokba orientálódni, azért még szeretem és érdekel, hogy mik történnek ezzel a nyelvvel. A java egyre több kritikát kap, hogy mennyire bőbeszédű, és ennek megfelelően eléggé alkalmatlan arra, hogy gyorsan fejlesszünk benne. Tagadhatatlan, ám úgy látszik, a nyelv fejlesztői is látják ezt, mert a következő [...]]]></description>
			<content:encoded><![CDATA[<p>Pár éve már java-ban dolgozom, és bár lassan kezdek más irányokba orientálódni, azért még szeretem és érdekel, hogy mik történnek ezzel a nyelvvel.<br />
A java egyre több kritikát kap, hogy mennyire bőbeszédű, és ennek megfelelően eléggé alkalmatlan arra, hogy gyorsan fejlesszünk benne. Tagadhatatlan, ám úgy látszik, a nyelv fejlesztői is látják ezt, mert a következő kiadásban főként olyan változtatások lesznek, amik a tömörebb megfogalmazást fogják elősegíteni (eredeti link <a href="http://java.dzone.com/articles/jdk7-tackles-java-verbosity">itt</a>):<br />
- Nem kell duplán deklarálni a generics-eket a listák és map-ek esetén<br />
- Egy új, Disposable nevű interface bevezetésével el lehet hagyni egy csomó erőforrás lezáró/felszabadító kódot<br />
- Lehet végre stringeket használni a switch elágazásokban<br />
etc.</p>
<p>Nagyon örülök neki.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lusta.hu/2009/09/01/jdk-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

