<?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>(blog-of &#34;Alex Shabanov&#34;)</title>
	<atom:link href="http://alexshabanov.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexshabanov.com</link>
	<description>Geek&#039;s blog about software and other stuff</description>
	<lastBuildDate>Fri, 18 May 2012 08:03:22 +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>Code Refactoring</title>
		<link>http://alexshabanov.com/2012/05/18/code-refactoring/</link>
		<comments>http://alexshabanov.com/2012/05/18/code-refactoring/#comments</comments>
		<pubDate>Fri, 18 May 2012 08:03:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[humour]]></category>

		<guid isPermaLink="false">http://alexshabanov.com/?p=259</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://alexshabanov.com/wp-content/uploads/2012/05/refactoring.gif"><img src="http://alexshabanov.com/wp-content/uploads/2012/05/refactoring.gif" alt="" title="refactoring" width="322" height="281" class="alignnone size-full wp-image-260" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://alexshabanov.com/2012/05/18/code-refactoring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Functional programming patterns: Currying</title>
		<link>http://alexshabanov.com/2012/04/08/functional-programming-patterns-currying/</link>
		<comments>http://alexshabanov.com/2012/04/08/functional-programming-patterns-currying/#comments</comments>
		<pubDate>Sun, 08 Apr 2012 11:09:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://alexshabanov.com/?p=238</guid>
		<description><![CDATA[In this post I would like to tell about the highly underrated functional programming pattern named "<a href="http://en.wikipedia.org/wiki/Currying" title="Currying" target="_blank"><em>Currying</em></a>". In this article I'll concentrate on the practical application of this pattern.]]></description>
			<content:encoded><![CDATA[<p>In this post I would like to tell about the highly underrated functional programming pattern named &#8220;<a href="http://en.wikipedia.org/wiki/Currying" title="Currying" target="_blank"><em>Currying</em></a>&#8220;. I would emphasize that this pattern shines in the languages with the <a href="http://en.wikipedia.org/wiki/First-class_function" title="First Class Function" target="_blank">first class functions</a> and you might find it tedious to use the pattern in the languages like java or C++.</p>
<p>In this article I&#8217;ll concentrate on the practical application of the <em>currying</em>.</p>
<p>Let&#8217;s start with the quick rough definition: <strong>F</strong> is a <em>curried</em> function with <strong>N</strong> arguments when an invokation of it can be transformed to N function invokations and each  invokation takes exactly one argument and returns function for the next subsequent call. For those who interested in the formal definition of it here is the <a href="http://en.wikipedia.org/wiki/Currying" title="Currying" target="_blank">wikipedia article</a>.</p>
<p>For instance in javascript a function that computes a sum of two arguments in a <em>curried</em> form can be written as follows:</p>
<pre name="code" class="javascript">
function add(x) {
    return function (y) {
        return x + y
    }
}

// x + y ==> add(x)(y)
</pre>
<p>On the first glance the pattern may look disappointing and too artificial to be used in real world applications (at least for the novices in functional programming).</p>
<p>But in fact this powerful pattern can help you to deal with certain problems for what OOP is used before in more elegant way.<br />
For instance you need a printing function that is capable to print something on the output stream.<br />
The usual approach would be to introduce a Printer class that accepts output stream in the constructor and provides the prospective clients with the public print method.<br />
The other functional approach that uses currying may help you to get rid of the excessive printer entity but still provide the prospective clients with the similar print function.</p>
<p>Here is how these approach may look in javascript:</p>
<pre name="code" class="javascript">
// OOP-alike approach:
Printer = function(stream) {
    this._stream = stream
}

Printer.prototype = {
    _stream: null,

    print: function(message) {
        // implementation omitted for clarity
    }
}

// usage:
//   var p = new Printer(s);
//   p.print("Hello");
//   p.print("World");
</pre>
<p>and</p>
<pre name="code" class="javascript">
// Currying-driven approach:
function print(stream) {
    return function (message) {
        // implementation omitted for clarity.
    }
}

// usage:
//   var p = print(stream);
//   p("Hello");
//   p("World");
</pre>
<p>You may find the latter approach much cleaner and more readable as I did <img src='http://alexshabanov.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I would notice that currying was not emerged to replace OOP and this pattern is good when it fits the problem you want to solve (as any other design pattern does).</p>
<p>[To be continued]</p>
]]></content:encoded>
			<wfw:commentRss>http://alexshabanov.com/2012/04/08/functional-programming-patterns-currying/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Print assembly for Java</title>
		<link>http://alexshabanov.com/2011/12/29/print-assembly-for-java/</link>
		<comments>http://alexshabanov.com/2011/12/29/print-assembly-for-java/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 13:56:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[openjdk]]></category>

		<guid isPermaLink="false">http://alexshabanov.com/?p=234</guid>
		<description><![CDATA[The modern openjdk&#8217;s JVM is able to print assembly for generated machine code &#8211; see Oracle&#8217;s blog post. To start working with this option you need hsdis plugin, available here. Then put the downloaded library to the location your OS aware of. E.g. if you&#8217;re using linux all you need is to update LD_LIBRARY_PATH: export [...]]]></description>
			<content:encoded><![CDATA[<p>The modern openjdk&#8217;s JVM is able to print assembly for generated machine code &#8211; see <a href="https://wikis.oracle.com/display/HotSpotInternals/PrintAssembly" title="Oracle Blog: PrintAssembly" target="_blank">Oracle&#8217;s  blog post</a>.</p>
<p>To start working with this option you need hsdis plugin, available <a href="http://kenai.com/projects/base-hsdis/downloads" title="Kenai Disassembler Binaries" target="_blank">here</a>.</p>
<p>Then put the downloaded library to the location your OS aware of.<br />
E.g. if you&#8217;re using linux all you need is to update LD_LIBRARY_PATH:</p>
<p><code>export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/alex/bin/hsdis"</code></p>
<p>Then you must be able to start java with the PrintAssembly flag:</p>
<p><code>/usr/lib/jvm/java-6-sun/bin/java -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly -server -cp . App</code></p>
<p>The dissassembled output might look as follows:<br />
<code><br />
  0xb3a15f0f: jmp    0xb3a15f1b         ;*invokespecial RangeCheck<br />
                                        ; - java.util.ArrayList::get@2 (line 322)<br />
                                        ; - App$Finder::findSolution@33 (line 243)<br />
                                        ; - App$Finder::findSolution@182 (line 263)<br />
                                        ; - App$Finder::findSolution@182 (line 263)<br />
  0xb3a15f11: mov    %eax,%ecx<br />
  0xb3a15f13: jmp    0xb3a15f1b         ;*invokespecial RangeCheck<br />
        Total: 13211984ns<br />
                                ; - java.util.ArrayList::get@2 (line 322)<br />
                                        ; - App$Finder::findSolution@33 (line 243)<br />
                                        ; - App$Finder::findSolution@182 (line 263)<br />
  0xb3a15f15: mov    %eax,%ecx<br />
  0xb3a15f17: jmp    0xb3a15f1b         ;*invokespecial RangeCheck<br />
                                        ; - java.util.ArrayList::get@2 (line 322)<br />
                                        ; - App$Finder::findSolution@33 (line 243)<br />
  0xb3a15f19: mov    %eax,%ecx          ;*synchronization entry<br />
                                        ; - App$Finder::findSolution@-1 (line 236)<br />
  0xb3a15f1b: add    $0x68,%esp<br />
  0xb3a15f1e: pop    %ebp<br />
  0xb3a15f1f: jmp    0xb3a11da0         ;*return<br />
                                        ; - App$Finder::findSolution@27 (line 240)<br />
                                        ;   {runtime_call}<br />
  0xb3a15f24: hlt<br />
  0xb3a15f25: hlt<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://alexshabanov.com/2011/12/29/print-assembly-for-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tuning Intellij Idea</title>
		<link>http://alexshabanov.com/2011/12/12/idea-vmoptions/</link>
		<comments>http://alexshabanov.com/2011/12/12/idea-vmoptions/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 09:17:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IDE]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://alexshabanov.com/?p=220</guid>
		<description><![CDATA[First of all consider changing idea.vmoptions. idea.vmoptions is a text file with a list of JVM settings, it&#8217;s usually found in the bin folder in the Idea installation folder. This file can be open in any text editor. The following settings increase performance drastically on Sun JVM 1.6: -server -Xms128m -Xmx512m -XX:MaxPermSize=250m -XX:ReservedCodeCacheSize=64m -XX:+UseConcMarkSweepGC -XX:+AggressiveOpts [...]]]></description>
			<content:encoded><![CDATA[<p>First of all consider changing <strong>idea.vmoptions</strong>.<br />
idea.vmoptions is a text file with a list of JVM settings, it&#8217;s usually found in the bin folder in the Idea installation folder. This file can be open in any text editor.</p>
<p>The following settings increase performance drastically on Sun JVM 1.6:</p>
<p><code>-server<br />
-Xms128m<br />
-Xmx512m<br />
-XX:MaxPermSize=250m<br />
-XX:ReservedCodeCacheSize=64m<br />
-XX:+UseConcMarkSweepGC<br />
-XX:+AggressiveOpts<br />
-XX:+CMSClassUnloadingEnabled<br />
-XX:+CMSIncrementalMode<br />
-XX:+CMSIncrementalPacing<br />
-XX:CMSIncrementalDutyCycleMin=0<br />
-XX:-TraceClassUnloading<br />
</code></p>
<p>Notice, that I enabled concurrent mark-sweep GC (in theory it&#8217;d be faster than others on 1.6) and aggressive optimizations as well as server JVM and I don&#8217;t use assertions (no `-ea&#8217; switch).</p>
<p>I tested these on x86 linux with Idea Community edition of build 111.69</p>
<p>As for appearance I&#8217;d suggest using <strong>Nimbus</strong> theme (Settings -> Appearance -> Look and Feel).</p>
<p>That&#8217;s how idea looks on my Ubuntu:</p>
<p><img src="https://lh3.googleusercontent.com/-zg24w97RFMQ/TuXdkKIgLpI/AAAAAAAABTk/7JKijUR9oy4/s912/Idea_Community_on_Linux_11.png" alt="Idea 11 Community Edition on Ubuntu" /></p>
<p>Full screenshot is available <a href="https://picasaweb.google.com/109939719053081561603/Public#5685193717890166418" title="Idea Community 11 on Ubuntu" target="_blank">here</a>.</p>
<p><strong>P.S.: For Mac OS X users:</strong><br />
There is no idea.vmoptions file on Mac OS X.<br />
In order to modify the mentioned JVM settings, you&#8217;d go to the application&#8217;s package contents, then open the inner &#8220;Contents&#8221; folder and then open Info.plist (just click on it and the standard plist editor will be opened). In the opened plist editor consider changing Java > VMOptions key as given above.<br />
You may copy-and-paste the following value I use on my Mac laptop:</p>
<p><code>-Xverify:none -XX:+UseConcMarkSweepGC -XX:+AggressiveOpts -XX:+CMSClassUnloadingEnabled -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0 -XX:-TraceClassUnloading -Xbootclasspath/a:../lib/boot.jar<br />
</code></p>
<p>Note, that you may want to make Idea start in 32-bit mode to reduce the memory consumption and increase the overall IDE performance. Just ctrl-click on the application icon in the &#8220;Applications&#8221; folder and click on the checkbox &#8220;Open in 32-bit mode&#8221;.</p>
<p>After doing so Idea starts in 1 (ONE) second or so on my Mac Book Pro!</p>
]]></content:encoded>
			<wfw:commentRss>http://alexshabanov.com/2011/12/12/idea-vmoptions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>instanceof vs Visitor</title>
		<link>http://alexshabanov.com/2011/12/03/instanceof-vs-visitor/</link>
		<comments>http://alexshabanov.com/2011/12/03/instanceof-vs-visitor/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 20:59:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://alexshabanov.com/?p=214</guid>
		<description><![CDATA[I always was curious on how effective is visitor pattern vs instanceof when it comes to detect whether the given base implements certain interface or not. I had 7 interface classes and visitor for all of these, and 7 concrete implementations, then I tested instanceof and visitor pattern on a large collection of randomly picked [...]]]></description>
			<content:encoded><![CDATA[<p>I always was curious on how effective is visitor pattern vs instanceof when it comes to detect whether the given base implements certain interface or not.</p>
<p>I had 7 interface classes and visitor for all of these, and 7 concrete implementations, then I tested instanceof and visitor pattern on a large collection of randomly picked instances of these classes, the timing for 100000 objects was as follows on my machine (best value is taken for several interations of both benchmarks, the less is of course the better):</p>
<pre>
instanceof: 5.055 sec
visitor: 3.511 sec
</pre>
<p>The testing code snippets are as follows:</p>
<pre name="code" class="java">
// for instanceof:
    public static int measureInstanceOf(Node[] nodes) {
        int litCount = 0;

        for (int i = 0; i < N; ++i) {
            if (nodes[i] instanceof Literal) {
                ++litCount;
            }
        }

        return litCount;
    }

// for visitor:
    public static final class LiteralCheckerVisitor implements NodeVisitor {
        boolean isLiteral = false;

        public void visitMarker(Marker marker) {}
        // other methods are similar to the given above and skipped

        public void visitLiteral(Literal literal) { isLiteral = true; }
    }

    public static int measureVisitor(Node[] nodes) {
        int litCount = 0;
        final LiteralCheckerVisitor visitor = new LiteralCheckerVisitor();

        for (int i = 0; i < N; ++i) {
            // equivalent of instanceof Literal
            visitor.isLiteral = false;
            nodes[i].accept(visitor);
            if (visitor.isLiteral) {
                ++litCount;
            }
        }

        return litCount;
    }
</pre>
<p>As for java version:</p>
<pre>
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)
</pre>
<p>The resolution is quite simple - try to avoid instanceof, at least in time-critical code. It's usage often indicates a misunderstanding of the OOP principles and often may result in bad design (and bad performance as well as higher maintenance costs).</p>
]]></content:encoded>
			<wfw:commentRss>http://alexshabanov.com/2011/12/03/instanceof-vs-visitor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create self-sufficient JAR with maven</title>
		<link>http://alexshabanov.com/2011/11/30/create-self-sufficient-jar-with-maven/</link>
		<comments>http://alexshabanov.com/2011/11/30/create-self-sufficient-jar-with-maven/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 09:50:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[jar]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://alexshabanov.com/?p=206</guid>
		<description><![CDATA[After getting stuck several times with maven assembly plugin I decided to make a note on how to create self-sufficient jar with maven. Self-sufficiency implies jar to include all the required dependencies so it can be started with java without specifying extra classpaths. &#60;build&#62; &#60;plugins&#62; &#60;!-- Packaging configuration --&#62; &#60;plugin&#62; &#60;artifactId&#62;maven-assembly-plugin&#60;/artifactId&#62; &#60;configuration&#62; &#60;archive&#62; &#60;manifest&#62; &#60;addClasspath&#62;true&#60;/addClasspath&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>After getting stuck several times with maven assembly plugin I decided to make a note on how to create self-sufficient jar with maven. Self-sufficiency implies jar to include all the required dependencies so it can be started with java without specifying extra classpaths.</p>
<pre name="code" class="xml">
&lt;build&gt;
    &lt;plugins&gt;
        &lt;!-- Packaging configuration --&gt;
        &lt;plugin&gt;
            &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
            &lt;configuration&gt;
                &lt;archive&gt;
                    &lt;manifest&gt;
                        &lt;addClasspath&gt;true&lt;/addClasspath&gt;
                        &lt;mainClass&gt;com.mysite.App&lt;/mainClass&gt;
                    &lt;/manifest&gt;
                &lt;/archive&gt;
                &lt;descriptorRefs&gt;
                    &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                &lt;/descriptorRefs&gt;
            &lt;/configuration&gt;
        &lt;/plugin&gt;
    &lt;/plugins&gt;
&lt;/build&gt;
</pre>
<p>Then you&#8217;ll be able to create self-sufficient jar:</p>
<pre>
mvn clean package assembly:assembly
</pre>
]]></content:encoded>
			<wfw:commentRss>http://alexshabanov.com/2011/11/30/create-self-sufficient-jar-with-maven/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>context:annotation-config for StaticApplicationContext</title>
		<link>http://alexshabanov.com/2011/11/08/for-staticapplicationcontext/</link>
		<comments>http://alexshabanov.com/2011/11/08/for-staticapplicationcontext/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 08:10:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://alexshabanov.com/?p=198</guid>
		<description><![CDATA[For some reason I&#8217;m unable to use XML configuration for spring in the current project (and thus ClassPathXmlApplicationContext) &#8211; don&#8217;t ask me why So I&#8217;ve to specify the entire configuration in code (by using StaticApplicationContext.registerSingleton). The question is &#8211; how to make StaticApplicationContext work as if &#8220;annotation-config&#8221; is specified to make application context process annotated [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason I&#8217;m unable to use XML configuration for spring in the current project (and thus ClassPathXmlApplicationContext) &#8211; don&#8217;t ask me why <img src='http://alexshabanov.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
So I&#8217;ve to specify the entire configuration in code (by using StaticApplicationContext.registerSingleton).</p>
<p>The question is &#8211; how to make StaticApplicationContext work as if &#8220;annotation-config&#8221; is specified to make application context process annotated fields, methods (e.g. @Resource, @PostConstruct, etc.)?</p>
<p>After digging in spring javadocs it turns out to be very simple:</p>
<pre name="code" class="java">
final StaticApplicationContext context = new StaticApplicationContext();

context.registerSingleton("beanPostProcessor", CommonAnnotationBeanPostProcessor.class);
context.registerSingleton("superior", SuperiorImpl.class);
context.registerSingleton("inferior", InferiorImpl.class);

context.refresh(); // Refresh is mandatory before any getBean invocation, otherwise bean processors won't work

final Superior superior = context.getBean(Superior.class);
</pre>
<p>The most important line is where CommonAnnotationBeanPostProcessor is registered in the DI context.</p>
<p>The spring documentation <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.html">states</a> regarding this class:</p>
<blockquote><p>
<strong>NOTE:</strong> A default CommonAnnotationBeanPostProcessor will be registered by the &#8220;context:annotation-config&#8221; and &#8220;context:component-scan&#8221; XML tags. Remove or turn off the default annotation configuration there if you intend to specify a custom CommonAnnotationBeanPostProcessor bean definition!<br />
<br/><br />
<strong>NOTE:</strong> Annotation injection will be performed before XML injection; thus the latter configuration will override the former for properties wired through both approaches.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://alexshabanov.com/2011/11/08/for-staticapplicationcontext/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to write and debug your own annotations processor.</title>
		<link>http://alexshabanov.com/2011/09/06/how-to-write-and-debug-your-own-annotations-processor/</link>
		<comments>http://alexshabanov.com/2011/09/06/how-to-write-and-debug-your-own-annotations-processor/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 09:29:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[annotations]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[processing]]></category>

		<guid isPermaLink="false">http://alexshabanov.com/?p=185</guid>
		<description><![CDATA[This is a short but comprehensive guide on how to write and debug your own annotations processor (assuming you are using Java 6, should work on Java 7 as well). Create jar where your annotations processor will reside, say ann-proc.jar (Just define annotation processor class).You may want to add dependency to the JDK&#8217;s tools.jar in [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short but comprehensive guide on how to write and debug your own annotations processor (assuming you are using Java 6, should work on Java 7 as well).</p>
<ul>
<li>Create jar where your annotations processor will reside, say ann-proc.jar (Just define annotation processor class).You may want to add dependency to the JDK&#8217;s tools.jar in case you wanna use sun-specific code model entities:<br />
<code><br />
&lt;dependency&gt;<br />
&lt;groupId&gt;com.sun&lt;/groupId&gt;<br />
&lt;artifactId&gt;tools&lt;/artifactId&gt;<br />
&lt;version&gt;1.6.0&lt;/version&gt;<br />
&lt;scope&gt;system&lt;/scope&gt;<br />
&lt;systemPath&gt;${java.home}/../lib/tools.jar&lt;/systemPath&gt;<br />
&lt;/dependency&gt;<br />
</code><br />

</li>
<li>Create (or proceed to) <em><strong>another</strong></em> jar (say my.jar) you want to process with annotations processor, add annotations you want to process.</li>
<li>Add the following file (which in fact is a <a href="http://download.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html">SPI configuration file</a>) to my.jar resources folder<br />
<code><br />
resources<br />
|<br />
+ /META-INF/services<br />
|<br />
+ javax.annotation.processing.Processor<br />
</code><br />
The contents of this file would look as follows:<br />
<code><br />
com.ann.proc.processor.MyAnnotationProcessor<br />
</code><br />

</li>
<li>That&#8217;s it, do mvn clean install on the my.jar package having installed ann-proc.jar and see the effect.If you want to debug your annotations processor, you may use mvnDebug, say do mvnDebug clean compile in the my.jar root folder and attach your IDE to the 8000 debug port.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://alexshabanov.com/2011/09/06/how-to-write-and-debug-your-own-annotations-processor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ugly Netbeans font rendering on Ubuntu Linux</title>
		<link>http://alexshabanov.com/2011/09/01/182/</link>
		<comments>http://alexshabanov.com/2011/09/01/182/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 07:46:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IDE]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://alexshabanov.com/?p=182</guid>
		<description><![CDATA[Netbeans fonts rendering may look ugly on the latest Ubuntu. The following configuration does the trick for me (file $netbeans/etc/netbeans.conf, see part in bold): # Options used by NetBeans launcher by default, can be overridden by explicit # command line switches: netbeans_default_options=&#8221;-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd_hrgb&#8221; Checked with openjdk, it probably [...]]]></description>
			<content:encoded><![CDATA[<p>Netbeans fonts rendering may look ugly on the latest Ubuntu.<br />
The following configuration does the trick for me (file $netbeans/etc/netbeans.conf, see part in bold):</p>
<p># Options used by NetBeans launcher by default, can be overridden by explicit<br />
# command line switches:<br />
netbeans_default_options=&#8221;-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true <strong>-J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd_hrgb</strong>&#8221;</p>
<p>Checked with openjdk, it probably won&#8217;t work for &#8220;older&#8221; sun JDK.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexshabanov.com/2011/09/01/182/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring and AspectJ</title>
		<link>http://alexshabanov.com/2011/06/29/spring-and-aspectj/</link>
		<comments>http://alexshabanov.com/2011/06/29/spring-and-aspectj/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 14:19:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[aspectj]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://alexshabanov.com/?p=180</guid>
		<description><![CDATA[For those who uses Spring 3.0.5: Spring 3.0.5 doesn&#8217;t work with aspectjweaver 1.6.10+ due to AssertionError at org.aspectj.weaver.UnresolvedType.nameToSignature! E.g. if you use aspects in your spring config with, say, jdbc:initalize-database configuration clause, most likely you&#8217;ll get assertion error in your JUnit test what uses such a config. The possible workaround would be to switch to [...]]]></description>
			<content:encoded><![CDATA[<p>For those who uses Spring 3.0.5: </p>
<p><strong>Spring 3.0.5 doesn&#8217;t work with aspectjweaver 1.6.10+ due to AssertionError at org.aspectj.weaver.UnresolvedType.nameToSignature!</strong></p>
<p>E.g. if you use aspects in your spring config with, say, jdbc:initalize-database configuration clause, most likely you&#8217;ll get assertion error in your JUnit test what uses such a config.</p>
<p>The possible workaround would be to switch to aspectjweaver of version 1.6.9.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexshabanov.com/2011/06/29/spring-and-aspectj/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

