<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DkAFRno5cCp7ImA9WhBUE0Q.&quot;"><id>tag:blogger.com,1999:blog-3234207576654915154</id><updated>2013-05-01T00:51:57.428-07:00</updated><category term="xsl:template" /><category term="Elastic MapReduce" /><category term="xsl" /><category term="FindBug" /><category term="Weak" /><category term="arguments" /><category term="MapReduce" /><category term="bugs" /><category term="Amazon" /><category term="sugarcrm" /><category term="map" /><category term="quality code" /><category term="executor" /><category term="pass-by-value" /><category term="crm" /><category term="Interface" /><category term="jdk1.6" /><category term="XSL DTMNodeIterator" /><category term="reference object" /><category term="osTicket" /><category term="Jakarta Commons" /><category term="Kayako" /><category term="phantomreference" /><category term="commons" /><category term="opensource" /><category term="finalization" /><category term="amazon emr" /><category term="metrics" /><category term="java 7 automatic resource management" /><category term="xsl:value-of" /><category term="java.lang.ref" /><category term="Intellij Debug" /><category term="Hadoop" /><category term="eclipse-juno" /><category term="xsl:import" /><category term="wordcount" /><category term="Annotation" /><category term="email" /><category term="Build Automation" /><category term="hashCode" /><category term="issuetracking" /><category term="eclipse" /><category term="Apache" /><category term="Remote Debug" /><category term="vtiger" /><category term="jdk 1.6" /><category term="ExecutorService" /><category term="EC2" /><category term="elastic-mapreduce" /><category term="java libraries" /><category term="java 7" /><category term="cloud computing" /><category term="php" /><category term="reduce" /><category term="Marker Interface" /><category term="parameters" /><category term="xslt" /><category term="Hashing" /><category term="Code Quality" /><category term="Request Tracker" /><category term="Eclipse Debug" /><category term="label interface" /><category term="S3" /><category term="Java" /><category term="concurrency" /><category term="xalan" /><category term="effective" /><category term="thread" /><category term="java 7 features" /><category term="improve code" /><category term="HashCodeBuilder" /><category term="quality metrics" /><category term="AWS" /><category term="ExecutorCompletionService" /><category term="finalizer" /><category term="java 6" /><category term="helpdesk" /><category term="iterator" /><category term="garbage collection" /><category term="FindBugs" /><category term="errors" /><category term="automatic resource management" /><category term="features" /><category term="Soft" /><category term="customer relationship" /><category term="project management" /><category term="Bugzilla" /><category term="references" /><category term="ticket-system" /><category term="multithreaded" /><category term="pass-by-reference" /><category term="Ant" /><category term="Trellis Desk" /><category term="Amazon-emr" /><category term="Class Design" /><title>Muhammad Khojaye's Blog</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://muhammadkhojaye.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://muhammadkhojaye.blogspot.com/" /><author><name>Muhammad Khojaye</name><uri>http://www.blogger.com/profile/00894488663979159734</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="21" src="http://1.bp.blogspot.com/_ozAUGbBR948/S8np6kmXerI/AAAAAAAAABE/I9goBiE4tT4/S220/(22).JPG" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/MuhammadKhojayesBlog" /><feedburner:info uri="muhammadkhojayesblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>MuhammadKhojayesBlog</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><entry gd:etag="W/&quot;C08FQnk7fCp7ImA9WhJSF0o.&quot;"><id>tag:blogger.com,1999:blog-3234207576654915154.post-7127404470252657117</id><published>2012-07-08T11:15:00.002-07:00</published><updated>2012-07-08T11:23:33.704-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-07-08T11:23:33.704-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="features" /><category scheme="http://www.blogger.com/atom/ns#" term="eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="eclipse-juno" /><title>Eclipse Juno release new Features</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Eclipse has recently announced the release of Eclipse Juno which brings new features such as  Detecting resource leaks for both Java7 and Java6 etc.

&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;

&lt;a href="http://www.blogger.com/blogger.g?blogID=3234207576654915154" name="N12078"&gt;Previous Plugins to Install&lt;/a&gt;&lt;/h3&gt;
I firstly install all my plugins from previous eclipse version. The process is quite simple 

&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;import and install from existing installation&lt;/li&gt;
&lt;li&gt;refer to old eclipse location&lt;/li&gt;
&lt;li&gt;Eclipse will show the list of plugins available and then asked for installation&lt;/li&gt;
&lt;li&gt;After accepting license, installation should complete smoothly.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;


&lt;a href="http://www.blogger.com/blogger.g?blogID=3234207576654915154" name="N12079"&gt;New Features available&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;Java 7 coding support in an IDE&lt;/i&gt;. Since Java 7 contains many new feature including  dynamically-typed languages support and other small enhancements from Coin project, eclipse Java development tooling will include support for these features of Java 7. &lt;/li&gt;
&lt;br /&gt;
&lt;li&gt;&lt;i&gt;Detecting resource leaks of Closeable/Autocloseable resources&lt;/i&gt;. This feature is really cool and it also works with “old code”. The common IO and JDBC resources now implement the relevant interfaces and the warnings are good enough to be shown on these.
&lt;br /&gt;
Resource leaks can be occurred in the following situations:
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1. A resource opened but not closed
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2. A resource may not closed on all control flows
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3. A resource may not closed at a method exit point
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4. In a Java 7 program a resource is closed but the code could still be improved by using a try-with-resources statement.
&lt;br /&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;The new version include the global search bar that gives user quick access to almost any Eclipse feature.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-Ru4uzZwxzAU/T_nHUL_NK1I/AAAAAAAAAD4/fT9mOkh4PhY/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="214" src="http://1.bp.blogspot.com/-Ru4uzZwxzAU/T_nHUL_NK1I/AAAAAAAAAD4/fT9mOkh4PhY/s320/Untitled.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Code Recommenders&lt;/i&gt; This is amazing feature that analyzes code of existing applications and extracts common patterns of how other developers have used. It helps deal with the complexity of large APIs using intelligent code completion attribute.
&lt;br /&gt;&lt;br /&gt;
More examples can be found from below links,
&lt;br /&gt;&lt;br /&gt;
&lt;a href="http://eclipsesource.com/blogs/2012/06/26/code-recommenders-top-eclipse-juno-feature-2/" name="N12079"&gt;http://eclipsesource.com/blogs/2012/06/26/code-recommenders-top-eclipse-juno-feature-2/&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://code-recommenders.blogspot.com/" name="N12079"&gt;http://code-recommenders.blogspot.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;The addition of integrated debugging of JVM-based domain specific languages in the Xtext development framework, The below link provide extensive examples regarding the mentioned feature,
&lt;a href="http://eclipsesource.com/blogs/2012/06/25/xtext-xtend-top-eclipse-juno-feature-3/" name="N12079"&gt;http://eclipsesource.com/blogs/2012/06/25/xtext-xtend-top-eclipse-juno-feature-3/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Eclipse for Mobile Developers&lt;/i&gt; - now developers can use eclipse more easily with a variety of mobile SDKs, including the Google Android SDK
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://muhammadkhojaye.blogspot.com/feeds/7127404470252657117/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://muhammadkhojaye.blogspot.com/2012/07/eclipse-juno-release-new-features.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/7127404470252657117?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/7127404470252657117?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MuhammadKhojayesBlog/~3/hgWBnjgOjYc/eclipse-juno-release-new-features.html" title="Eclipse Juno release new Features" /><author><name>Muhammad Khojaye</name><uri>http://www.blogger.com/profile/00894488663979159734</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="21" src="http://1.bp.blogspot.com/_ozAUGbBR948/S8np6kmXerI/AAAAAAAAABE/I9goBiE4tT4/S220/(22).JPG" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-Ru4uzZwxzAU/T_nHUL_NK1I/AAAAAAAAAD4/fT9mOkh4PhY/s72-c/Untitled.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://muhammadkhojaye.blogspot.com/2012/07/eclipse-juno-release-new-features.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UARX07eSp7ImA9WhVWFUQ.&quot;"><id>tag:blogger.com,1999:blog-3234207576654915154.post-4473536994765206162</id><published>2012-04-21T13:18:00.000-07:00</published><updated>2012-04-28T00:47:24.301-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-28T00:47:24.301-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Amazon-emr" /><category scheme="http://www.blogger.com/atom/ns#" term="map" /><category scheme="http://www.blogger.com/atom/ns#" term="S3" /><category scheme="http://www.blogger.com/atom/ns#" term="wordcount" /><category scheme="http://www.blogger.com/atom/ns#" term="Amazon" /><category scheme="http://www.blogger.com/atom/ns#" term="cloud computing" /><category scheme="http://www.blogger.com/atom/ns#" term="EC2" /><category scheme="http://www.blogger.com/atom/ns#" term="Hadoop" /><category scheme="http://www.blogger.com/atom/ns#" term="amazon emr" /><category scheme="http://www.blogger.com/atom/ns#" term="MapReduce" /><category scheme="http://www.blogger.com/atom/ns#" term="reduce" /><category scheme="http://www.blogger.com/atom/ns#" term="elastic-mapreduce" /><category scheme="http://www.blogger.com/atom/ns#" term="Elastic MapReduce" /><category scheme="http://www.blogger.com/atom/ns#" term="AWS" /><title>How to Run Elastic MapReduce Job Using Custom Jar - Amazon EMR Tutorial</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
Amazon EMR is a &lt;code&gt;web service&lt;/code&gt; using which developers can easily and efficiently process enormous amounts of data. It uses an hosted &lt;code&gt;Hadoop&lt;/code&gt; framework running on the web-scale infrastructure of &lt;code&gt;Amazon EC2&lt;/code&gt; and &lt;code&gt;Amazon S3&lt;/code&gt;.&lt;br /&gt;
&lt;code&gt;Amazon EMR&lt;/code&gt; removes most of the cumbersome details of &lt;code&gt;Hadoop&lt;/code&gt;, while take care for provisioning of &lt;code&gt;Hadoop&lt;/code&gt;, running the job flow, terminating the job flow, moving the data between &lt;code&gt;Amazon EC2&lt;/code&gt; and &lt;code&gt;Amazon S3&lt;/code&gt;, and optimizing &lt;code&gt;Hadoop&lt;/code&gt;. &lt;br /&gt;
In this tutorial, we will first going to developed &lt;code&gt;WordCount&lt;/code&gt; &lt;code&gt;java&lt;/code&gt; example using &lt;code&gt;MapReduce&lt;/code&gt; framework &lt;code&gt;Hadoop&lt;/code&gt; and thereafter, we execute our program on &lt;code&gt;Amazon Elastic MapReduce&lt;/code&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;





&lt;a href="http://www.blogger.com/blogger.g?blogID=3234207576654915154" name="N10078"&gt;Prerequisites&lt;/a&gt;&lt;/h3&gt;
You must have valid AWS account credentials.You should also have a general familiarity with using the &lt;code&gt;Eclipse&lt;/code&gt; IDE before you begin. The reader can also use any other IDE of their choice.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;





&lt;a href="http://www.blogger.com/blogger.g?blogID=3234207576654915154" name="N10078"&gt;Step 1 – Develop MapReduce WordCount Java Program&lt;/a&gt;&lt;/h3&gt;
In this section, we will first going to develop &lt;code&gt;WordCount&lt;/code&gt; application. A &lt;code&gt;WordCount&lt;/code&gt; program will determine how many times different words appear in a set of files.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;1. In &lt;code&gt;Eclipse&lt;/code&gt; (or whatever the IDE you are using), Create simple Java Project with name "WordCount".&lt;/li&gt;
&lt;li&gt;2. Create a &lt;code&gt;java&lt;/code&gt; class name &lt;code&gt;Map&lt;/code&gt; and override the map method as follow,
&lt;br /&gt;
&lt;pre class="brush: java"&gt;public class Map extends Mapper&lt;longwritable, intwritable="" text,=""&gt; {
 private final static IntWritable one = new IntWritable(1);
 private Text word = new Text();

 @Override
 public void map(LongWritable key, Text value, Context context)
   throws IOException, InterruptedException {
  String line = value.toString();
  StringTokenizer tokenizer = new StringTokenizer(line);
  while (tokenizer.hasMoreTokens()) {
   word.set(tokenizer.nextToken());
   context.write(word, one);
  }
 }
}
&lt;/longwritable,&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;3.Create a &lt;code&gt;java&lt;/code&gt; class name &lt;code&gt;Reduce&lt;/code&gt; and override the reduce method as below,
&lt;br /&gt;
&lt;pre class="brush: java"&gt;public class Reduce extends Reducer&lt;text, intwritable,="" intwritable="" text,=""&gt; {
 @Override
 protected void reduce(
   Text key,
   java.lang.Iterable&lt;intwritable&gt; values,
   org.apache.hadoop.mapreduce.Reducer&lt;text, intwritable,="" intwritable="" text,=""&gt;.Context context)
   throws IOException, InterruptedException {
  int sum = 0;
  for (IntWritable value : values) {
   sum += value.get();
  }
  context.write(key, new IntWritable(sum));
 }
}
&lt;/text,&gt;&lt;/intwritable&gt;&lt;/text,&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;4. Create a &lt;code&gt;java&lt;/code&gt; class name &lt;code&gt;WordCount&lt;/code&gt; and defined the main method as below,
&lt;br /&gt;
&lt;pre class="brush: java"&gt;public static void main(String[] args) throws Exception {
  Configuration conf = new Configuration();

  Job job = new Job(conf, "wordcount");
  job.setJarByClass(WordCount.class);

  job.setOutputKeyClass(Text.class);
  job.setOutputValueClass(IntWritable.class);

  job.setMapperClass(Map.class);
  job.setReducerClass(Reduce.class);

  job.setInputFormatClass(TextInputFormat.class);
  job.setOutputFormatClass(TextOutputFormat.class);

  FileInputFormat.addInputPath(job, new Path(args[0]));
  FileOutputFormat.setOutputPath(job, new Path(args[1]));

  job.waitForCompletion(true);
}
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;5. Export the &lt;code&gt;WordCount&lt;/code&gt; program in a jar using &lt;code&gt;eclipse&lt;/code&gt; and save it to some location on disk. Make sure that you have provided the Main Class (&lt;code&gt;WordCount.jar&lt;/code&gt;) during extracting the jar file as shown below. &lt;/li&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-Alclf1SbpwM/T5Lwu6_WkbI/AAAAAAAAACs/1H4YERa2Oog/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-Alclf1SbpwM/T5Lwu6_WkbI/AAAAAAAAACs/1H4YERa2Oog/s320/Untitled.png" width="278" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/ul&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-fVrwOGnklzk/T5ufvjbb6zI/AAAAAAAAAC0/pk8Q0vEZPgc/s1600/Cat+in+a+JAR.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="212" src="http://4.bp.blogspot.com/-fVrwOGnklzk/T5ufvjbb6zI/AAAAAAAAAC0/pk8Q0vEZPgc/s320/Cat+in+a+JAR.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ur jar is ready!!&lt;br /&gt;
&lt;h3&gt;
&lt;br /&gt;




&lt;a href="http://www.blogger.com/blogger.g?blogID=3234207576654915154" name="N10078"&gt;Step 2 – Upload the WordCount JAR and Input Files to Amazon S3&lt;/a&gt;&lt;/h3&gt;
Now we are going to upload the &lt;code&gt;WordCount&lt;/code&gt; jar to Amazon S3. 
First, go to the following URL:
&lt;a href="https://console.aws.amazon.com/s3/home"&gt;https://console.aws.amazon.com/s3/home&lt;/a&gt;
Next, click “Create Bucket”, give your bucket a name, and click the “Create” button. Select your new S3 bucket in the left-hand pane. Upload the WordCount JAR and sample input file for counting the words.
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;





&lt;a href="http://www.blogger.com/blogger.g?blogID=3234207576654915154" name="N10078"&gt;Step 3 – Running an Elastic MapReduce job&lt;/a&gt;&lt;/h3&gt;
Now that the JAR is uploaded into S3, all we need to do is to create a new Job flow. let's execute the below steps. 
(I encourage reader to check out the following link for details regarding each step, 
&lt;a href="http://docs.amazonwebservices.com/ElasticMapReduce/latest/DeveloperGuide/CLI_JobFlowUsingCustomJAR.html"&gt;How to Create a Job Flow Using a Custom JAR&lt;/a&gt;
)
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;1. Sign in to the AWS Management Console and open the Amazon Elastic MapReduce console at &lt;a href="https://console.aws.amazon.com/elasticmapreduce/"&gt;https://console.aws.amazon.com/elasticmapreduce/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2. Click Create New Job Flow.&lt;/li&gt;
&lt;li&gt;3. In the DEFINE JOB FLOW page, enter the following details,
&lt;br /&gt;
&lt;br /&gt;
a. Job Flow Name = WordCountJob
&lt;br /&gt;
b. Select Run your own application
&lt;br /&gt;
c. Select Custom JAR in the drop-down list
&lt;br /&gt;
d. Click Continue
&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;4. In the SPECIFY PARAMETERS page, enter values in the boxes using the following table as a guide, and then click Continue.
&lt;br /&gt;
JAR Location = bucketName/jarFileLocation
&lt;br /&gt;
JAR Arguments = &lt;br /&gt;s3n://bucketName/inputFileLocation
                &lt;br /&gt;s3n://bucketName/outputpath
&lt;br /&gt;
&lt;br /&gt;
Please note that the output path must be unique each time we execute the job. The &lt;code&gt;Hadoop&lt;/code&gt; always create folder with same name specify here.
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
After executing job, just wait and monitor your job that runs through the Hadoop flow. You can also look for errors by using the Debug button. The job should be complete within 10 to 15 minutes (can also depend on the size of input). After completing job, You can view results in the S3 Browser panel. You can also download the files from S3 and can analyze the outcome of the job.
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;





&lt;a href="http://www.blogger.com/blogger.g?blogID=3234207576654915154" name="N10078"&gt;Amazon Elastic MapReduce Resources&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Amazon Elastic MapReduce Documentation,&lt;a href="http://aws.amazon.com/documentation/elasticmapreduce/"&gt;http://aws.amazon.com/documentation/elasticmapreduce/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Amazon Elastic MapReduce Getting Started Guide,&lt;a href="http://docs.amazonwebservices.com/ElasticMapReduce/latest%0A/GettingStartedGuide/"&gt;http://docs.amazonwebservices.com/ElasticMapReduce/latest/GettingStartedGuide/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Amazon Elastic MapReduce Developer Guide,&lt;a href="http://docs.amazonwebservices.com/ElasticMapReduce/latest/DeveloperGuide%0A/"&gt;http://docs.amazonwebservices.com/ElasticMapReduce/latest/DeveloperGuide/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Apache Hadoop,&lt;a href="http://hadoop.apache.org/"&gt;http://hadoop.apache.org/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://muhammadkhojaye.blogspot.com/feeds/4473536994765206162/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://muhammadkhojaye.blogspot.com/2012/04/how-to-run-amazon-elastic-mapreduce-job.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/4473536994765206162?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/4473536994765206162?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MuhammadKhojayesBlog/~3/ON6CY5KRysY/how-to-run-amazon-elastic-mapreduce-job.html" title="How to Run Elastic MapReduce Job Using Custom Jar - Amazon EMR Tutorial" /><author><name>Muhammad Khojaye</name><uri>http://www.blogger.com/profile/00894488663979159734</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="21" src="http://1.bp.blogspot.com/_ozAUGbBR948/S8np6kmXerI/AAAAAAAAABE/I9goBiE4tT4/S220/(22).JPG" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-Alclf1SbpwM/T5Lwu6_WkbI/AAAAAAAAACs/1H4YERa2Oog/s72-c/Untitled.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://muhammadkhojaye.blogspot.com/2012/04/how-to-run-amazon-elastic-mapreduce-job.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QDSX06eip7ImA9WhZRFk4.&quot;"><id>tag:blogger.com,1999:blog-3234207576654915154.post-8741089381725303650</id><published>2011-03-22T14:41:00.000-07:00</published><updated>2011-04-12T12:09:38.312-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-12T12:09:38.312-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Request Tracker" /><category scheme="http://www.blogger.com/atom/ns#" term="crm" /><category scheme="http://www.blogger.com/atom/ns#" term="vtiger" /><category scheme="http://www.blogger.com/atom/ns#" term="project management" /><category scheme="http://www.blogger.com/atom/ns#" term="sugarcrm" /><category scheme="http://www.blogger.com/atom/ns#" term="osTicket" /><category scheme="http://www.blogger.com/atom/ns#" term="issuetracking" /><category scheme="http://www.blogger.com/atom/ns#" term="helpdesk" /><category scheme="http://www.blogger.com/atom/ns#" term="Kayako" /><category scheme="http://www.blogger.com/atom/ns#" term="customer relationship" /><category scheme="http://www.blogger.com/atom/ns#" term="email" /><category scheme="http://www.blogger.com/atom/ns#" term="Trellis Desk" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><category scheme="http://www.blogger.com/atom/ns#" term="ticket-system" /><category scheme="http://www.blogger.com/atom/ns#" term="opensource" /><title>Free Open Source CRM and Helpdesk Software</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="font-family: Arial,Helvetica,sans-serif; text-align: left;" trbidi="on"&gt;&lt;div dir= "ltr" style="text-align: left;" trbidi="on"&gt;Last week, I was surfing on web to search for an free &lt;em&gt;open source&lt;/em&gt; &lt;em&gt;CRM&lt;/em&gt; and &lt;em&gt;help desk&lt;/em&gt; solution. This post will share the experience and recommend some free &lt;em&gt;open source&lt;/em&gt; &lt;em&gt;CRM&lt;/em&gt; and &lt;em&gt;Help Desk&lt;/em&gt; solution.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Help desk&lt;/em&gt; and &lt;em&gt;CRM&lt;/em&gt; software's are always essential for any company to provide best customer support. This tools not only helps companies in increasing the customer satisfaction but also customer retention as well. In this post, we'll examine and recommend some free and open source &lt;em&gt;CRM&lt;/em&gt; and &lt;em&gt;Help desk&lt;/em&gt; solution. &lt;br /&gt;
&lt;h3&gt;&lt;p&gt;&lt;a name="N10078"&gt;&lt;span&gt;&lt;em&gt;SugarCRM&lt;/em&gt; and &lt;em&gt;vtiger&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;In my opinion, &lt;em&gt;vtiger&lt;/em&gt; is the best option as free &lt;em&gt;CRM&lt;/em&gt; and &lt;em&gt;helpdesk&lt;/em&gt; software. It will work both as an &lt;em&gt;Help desk&lt;/em&gt; and &lt;em&gt;CRM&lt;/em&gt;. &lt;br /&gt;
&lt;br /&gt;
Comparing &lt;em&gt;SugarCRM&lt;/em&gt; and &lt;em&gt;vtiger&lt;/em&gt;, both are providing the following major functionalities,&lt;br /&gt;
&lt;br /&gt;
&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: medium none; width: 619px;"&gt;&lt;tbody&gt;
&lt;tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0;"&gt;   &lt;td style="border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 1.2in;" valign="top" width="115"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 12pt;"&gt;SugarCRM&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-left: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 58.5pt;" valign="top" width="78"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;Marketing&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-left: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 45.0pt;" valign="top" width="60"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;Sales&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-left: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 63.0pt;" valign="top" width="84"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;Support&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-left: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 58.5pt;" valign="top" width="78"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;Activities&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-left: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;" valign="top" width="114"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;Collaboration&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-left: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 67.5pt;" valign="top" width="90"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;Reports&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style="mso-yfti-irow: 1; mso-yfti-lastrow: yes;"&gt;   &lt;td style="border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 1.2in;" valign="top" width="115"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 12pt;"&gt;Vtiger&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 58.5pt;" valign="top" width="78"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;Marketing&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 45.0pt;" valign="top" width="60"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;Sales&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 63.0pt;" valign="top" width="84"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;Support&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 58.5pt;" valign="top" width="78"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;Quick Create&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;" valign="top" width="114"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;Tools&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 67.5pt;" valign="top" width="90"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;Analytics&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&amp;nbsp; &lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;br /&gt;
There are many different sub actions defined within these categories which include Accounts, Contracts, Leads, Documents etc. Therefore, after getting some picture of &lt;em&gt;CRM&lt;/em&gt;, the overall interface of vtiger seems to be good for me now.&lt;br /&gt;
&lt;br /&gt;
There are also many positive feedbacks available for vtiger on the web. You can find the links in 'more information' section.&lt;br /&gt;
&lt;br /&gt;
There is also community version available for &lt;em&gt;SugarCRM&lt;/em&gt; [6] however, it does not contain reporting feature.&amp;nbsp; We might able to add some plug-ins for that [5] but it might need to explore more regarding how much work would need for this.&lt;/div&gt;&lt;h3&gt;&lt;p&gt;&lt;a name="N10078"&gt;&lt;span&gt;&lt;em&gt;Kayako&lt;/em&gt; and &lt;em&gt;SugarCRM&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;These are both awesome and renowned tools, however they are commercial and not free.Also for registered charities and open-source projects, &lt;a href="http://www.kayako.com/products/fusion/"&gt;Kayako Fusion&lt;/a&gt;, &lt;a href="http://www.kayako.com/products/resolve/"&gt;Kayako Resolve&lt;/a&gt; and &lt;a href="http://www.kayako.com/products/live-chat-software/"&gt;Kayako Engage&lt;/a&gt; licenses are available free of cost.&lt;blockquote&gt;Kayako Download licenses for &lt;em&gt;Kayako Fusion&lt;/em&gt;, &lt;em&gt;Kayako Resolve&lt;/em&gt; and &lt;em&gt;Kayako Engage&lt;/em&gt; are available free of charge to registered charities and open-source projects. Free, perpetual licenses with unlimited users and  no strings attached. Finally; some viable, business-class, free &lt;em&gt;help desk&lt;/em&gt; software!&lt;/blockquote&gt;&lt;/div&gt;&lt;h3&gt;&lt;p&gt;&lt;a name="N10078"&gt;&lt;span&gt;Other &lt;em&gt;CRM&lt;/em&gt; and &lt;em&gt;helpdesk&lt;/em&gt; option&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;Since vtiger will fulfill the requirement for both &lt;em&gt;help desk&lt;/em&gt; and &lt;em&gt;CRM&lt;/em&gt; feature, therefore you might not require any free separate &lt;em&gt;help desk&lt;/em&gt; software. However, if you still would like to explore, I will highly recommend the below two tools.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Trellis Desk, &lt;a href="http://www.accord5.com/trellis"&gt;http://www.accord5.com/trellis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;osTicket, &lt;a href="http://osticket.com/"&gt;http://osticket.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;
Both software are available free and source code can also be downloadable. The source code is in PHP.&lt;br /&gt;
&lt;br /&gt;
I find &lt;em&gt;Trellis Desk&lt;/em&gt; awesome as its interface is good and it also provide good functionalities for &lt;em&gt;help desk&lt;/em&gt; management systems.&lt;br /&gt;
&lt;br /&gt;
Other tools include (not in PHP)&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;RT: Request Tracker, &lt;a href="http://www.bestpractical.com/rt/"&gt;http://www.bestpractical.com/rt/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;CiviCRM, &lt;a href="http://civicrm.org/"&gt;http://civicrm.org/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Liberum &lt;em&gt;Help Desk&lt;/em&gt;, &lt;a href="http://www.liberum.org/Default.aspx"&gt;http://www.liberum.org/Default.aspx&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;h3&gt;&lt;p&gt;&lt;a name="N10078"&gt;&lt;span&gt;References and More Information&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;ul&gt;&lt;li&gt;1. vtiger demo,&lt;a href="http://demo.vtiger.com/"&gt;http://demo.vtiger.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2. vtiger download, &lt;a href="http://www.vtiger.com/index.php?option=com_content&amp;amp;task=view&amp;amp;id=30&amp;amp;Itemid=57"&gt;http://www.vtiger.com/index.php?option=com_content&amp;amp;task=view&amp;amp;id=30&amp;amp;Itemid=57&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;3. Vtiger CRM 5.0.3 - Installation Manual for Windows&lt;br /&gt;
&lt;a href="http://wiki.vtiger.com/index.php/Vtiger_CRM_5.0.3__Installation_Manual_for_Windows#System_Requirements"&gt;http://wiki.vtiger.com/index.php/Vtiger_CRM_5.0.3__Installation_Manual_for_Windows#System_Requirements&amp;nbsp;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;4. SugarCRM VS Vtiger&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;a href="http://stackoverflow.com/questions/3271656/sugarcrm-or-vtiger"&gt;http://stackoverflow.com/questions/3271656/sugarcrm-or-vtiger&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; &lt;a href="http://stackoverflow.com/questions/98018/which-php-open-source-crm-should-i-use"&gt;http://stackoverflow.com/questions/98018/php-open-source-crm&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; &lt;a href="http://ostatic.com/question/how-does-vtiger-stack-up-against-sugarcrm"&gt;http://ostatic.com/question/how-does-vtiger-stack-up-against-sugarcrm&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; &lt;a href="http://www.siteground.com/sugarcrm_vtiger.htm"&gt;http://www.siteground.com/sugarcrm_vtiger.htm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;5. Sugar CRM reporting plugin, &lt;a href="http://stackoverflow.com/questions/3271656/sugarcrm-or-vtiger"&gt;http://stackoverflow.com/questions/3271656/sugarcrm-or-vtiger&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;6. Sugar Editions comparison, &lt;a href="http://www.sugarcrm.com/crm/products/editions.html"&gt;http://www.sugarcrm.com/crm/products/editions.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;7. osTicket download, &lt;a href="http://osticket.com/downloads.php"&gt;http://osticket.com/downloads.php&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;8. osTicket forum, &lt;a href="http://osticket.com/forums/"&gt;http://osticket.com/forums/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;9. osTicket demo, &lt;a href="http://www.ostickethacks.com/demo/demo_info.php"&gt;http://www.ostickethacks.com/demo/demo_info.php&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;10. Trellis Desk download, &lt;a href="http://www.accord5.com/trellis/download"&gt;http://www.accord5.com/trellis/download&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;11. Trellis Desk demo, &lt;a href="http://www.accord5.com/trellis/demo"&gt;http://www.accord5.com/trellis/demo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;12. Trellis Desk forum, &lt;a href="http://forums.accord5.com/"&gt;http://forums.accord5.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;13. Trellis Desk Single Sign on Integration,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://forums.accord5.com/topic/link-user-table-to-cubecart-user-table?replies=3#post-4997"&gt;http://forums.accord5.com/link-user-table-to-cubecart-user-table&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;14. Kayako editions comparision, &lt;a href="http://www.kayako.com/signup/"&gt;http://www.kayako.com/signup/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;15. Kayako free for Charity organization, &lt;a href="http://www.kayako.com/free-help-desk-software/"&gt;http://www.kayako.com/free-help-desk-software/ &lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://muhammadkhojaye.blogspot.com/feeds/8741089381725303650/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://muhammadkhojaye.blogspot.com/2011/03/free-open-source-crm-and-helpdesk.html#comment-form" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/8741089381725303650?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/8741089381725303650?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MuhammadKhojayesBlog/~3/gurVUJyLIIQ/free-open-source-crm-and-helpdesk.html" title="Free Open Source CRM and Helpdesk Software" /><author><name>Muhammad Khojaye</name><uri>http://www.blogger.com/profile/00894488663979159734</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="21" src="http://1.bp.blogspot.com/_ozAUGbBR948/S8np6kmXerI/AAAAAAAAABE/I9goBiE4tT4/S220/(22).JPG" /></author><thr:total>6</thr:total><feedburner:origLink>http://muhammadkhojaye.blogspot.com/2011/03/free-open-source-crm-and-helpdesk.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQERXs7fip7ImA9WhZSFkk.&quot;"><id>tag:blogger.com,1999:blog-3234207576654915154.post-6635820079683050715</id><published>2010-10-18T11:49:00.000-07:00</published><updated>2011-04-01T00:51:44.506-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-01T00:51:44.506-07:00</app:edited><title>Getter Setter: To use or not to use</title><content type="html">&lt;blockquote&gt;Why do we keep instance variables &lt;code&gt;private&lt;/code&gt;? We don’t want other classes to depend on them. Moreover it gives the flexibility to change a variable’s type or implementation on a whim or an impulse. Why, then programmers automatically add &lt;code&gt;getters&lt;/code&gt; and &lt;code&gt;setters&lt;/code&gt; to their objects, exposing their &lt;code&gt;private&lt;/code&gt; variables as if they were &lt;code&gt;public&lt;/code&gt;?&lt;/blockquote&gt;&lt;br /&gt;
&lt;h3&gt;&lt;p&gt;&lt;a name="N10078"&gt;&lt;span&gt;Accessor methods&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;code&gt;Accessors&lt;/code&gt; (also known as &lt;code&gt;getters&lt;/code&gt; and &lt;code&gt;setters&lt;/code&gt;) are methods that let you read and write the value of an instance variable of an object.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java"&gt;public class AccessorExample {
private String attribute;

public String getAttribute() {
return attribute;
}

public void setAttribute(String attribute) {
this.attribute = attribute;
}
}
&lt;/pre&gt;&lt;br /&gt;
&lt;h3&gt;&lt;p&gt;&lt;a name="N10079"&gt;Why Accessors?&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;&lt;br /&gt;
There are actually many good reasons to consider using &lt;code&gt;accessors&lt;/code&gt; rather than directly exposing fields of a &lt;code&gt;class&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;Getter&lt;/code&gt; and &lt;code&gt;Setter&lt;/code&gt; make API more stable. For instance, consider a field &lt;code&gt;public&lt;/code&gt; in a class which is accessed by other classes. Now later on, you want to add any extra logic while getting and setting the variable. This will impact the existing client that uses the &lt;code&gt;API&lt;/code&gt;. So any changes to this &lt;code&gt;public&lt;/code&gt; field will require change to each class that refers it. On the contrary, with &lt;code&gt;accessor&lt;/code&gt; methods, one can easily add some logic like cache some data, lazily initialize it later. Moreover, one can fire a property changed event if the new value is different from the previous value. All this will be seamless to the class that gets value using &lt;code&gt;accessor&lt;/code&gt; method.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;&lt;p&gt;&lt;a name="N10080"&gt;&lt;span&gt;Should I have Accessor Methods for all my fields?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;&lt;br /&gt;
Fields can be declared public for package-private or private nested class. Exposing fields in these classes produces less visual clutter compare to accessor-method approach, both in the class definition and in the client code that uses it.&lt;br /&gt;
&lt;br /&gt;
If a class is package-private or is a private nested class, there is nothing inherently wrong with exposing its data fields—assuming they do an adequate job of describing the abstraction provided by the class.&lt;br /&gt;
&lt;br /&gt;
Such code is restricted to the package where the class is declared, while the client code is tied to class internal representation. We can change it without modifying any code outside that package. Moreover, in the case of a private nested class, the scope of the change is further restricted to the enclosing class.&lt;br /&gt;
&lt;br /&gt;
Another example of a design that uses public fields is JavaSpace entry objects. Ken Arnold described the process they went through to decide to make those fields public instead of private with get and set methods &lt;a href="http://www.artima.com/intv/sway2.html"&gt;here&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now this sometimes makes people uncomfortable because they've been told not to have public fields; that public fields are bad. And often, people interpret those things religiously. But we're not a very religious bunch. Rules have reasons. And the reason for the private data rule doesn't apply in this particular case. It is a rare exception to the rule. I also tell people not to put public fields in their objects, but exceptions exist. This is an exception to the rule, because it is simpler and safer to just say it is a field. We sat back and asked: Why is the rule thus? Does it apply? In this case it doesn't.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;&lt;p&gt;&lt;a name="N10078"&gt;&lt;span&gt;Private fields + Public accessors == encapsulation&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;&lt;br /&gt;
Consider the example below&lt;br /&gt;
&lt;pre class="brush: java"&gt;public class A {
public int a;
}
&lt;/pre&gt;&lt;br /&gt;
Usually this is considered bad coding practice as it violates encapsulation. The alternate approach is&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java"&gt;public class A {
private int a;

public void setA(int a) {
this.a =a;
}

public int getA() {
return this.a;
}
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
It is argued that this encapsulate the attribute. Now is this really encapsulation?&lt;br /&gt;
&lt;br /&gt;
Fact is, Getters/setters have nothing to do with encapsulation. Here the data isn't more hidden or encapsulated than it was in a public field. Other objects still have intimate knowledge of the internals of the class. Changes made to the class might ripple out and enforce changes in dependent classes. Getter and setter in this way are generally break encapsulation. A truly well-encapsulated class has no setters and preferably no getters either. Rather than asking a class for some data and then compute something with it, the class should be responsible to compute something with its data and then return the result.&lt;br /&gt;
&lt;br /&gt;
Consider an example below,&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java"&gt;public class Screens {
private Map screens = new HashMap();

public Map getScreens() {
return screens;
}

public void setScreens(Map screens) {
this.screens = screens;
}
// remaining code here
}
&lt;/pre&gt;&lt;br /&gt;
If we need to get a particular screen, we do code like below,&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java"&gt;Screen s = (Screen)screens.get(screenId);
&lt;/pre&gt;&lt;br /&gt;
There are things worth noticing here....&lt;br /&gt;
&lt;br /&gt;
The client needs to get an Object from the Map and casting it to the right type. Moreover, the worst is that any client of the Map has the power to clear it which may not be the case we usually want.&lt;br /&gt;
&lt;br /&gt;
Alternative implementation of the same logic is:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java"&gt;public class Screens {
private Map screens = new HashMap();

public Screen getById(String id) {
return (Screen) screens.get(id);
}
// remaining code here
}
&lt;/pre&gt;&lt;br /&gt;
Here the Map instance and the interface at the boundary (Map) are hidden.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;&lt;p&gt;&lt;a name="N10078"&gt;&lt;span&gt;Getters and Setters are highly Overused&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;&lt;br /&gt;
Creating private fields and then using the IDE to automatically generate getters and setters&lt;br /&gt;
for all these fields is almost as bad as using public fields.&lt;br /&gt;
&lt;br /&gt;
One reason for the overuse is that in an IDE it’s just now a matter of few clicks to create these accessors. The completely meaningless getter/setter code is at times longer than the real logic in a class and you will read these functions many times even if you don't want to.&lt;br /&gt;
&lt;br /&gt;
All fields should be kept private, but with setters only when they make sense which makes object Immutable. Adding an unnecessary getter reveals internal structure, which is an opportunity for increased coupling. To avoid this, every time before adding the accessor, we should analyze if we can encapsulate the behavior instead.&lt;br /&gt;
&lt;br /&gt;
Let’s take another example,&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java"&gt;public class Money {
private double amount;

public double getAmount() {
return amount;
}

public void setAmount(double amount) {
this.amount = amount;
}

//client
Money pocketMoney = new Money();
pocketMoney.setAmount(15d);
double amount = pocketMoney.getAmount();  // we know its double
pocketMoney.setAmount(amount + 10d);
}
&lt;/pre&gt;&lt;br /&gt;
With the above logic, later on, if we assume that double is not a right type to use and should use BigDecimal instead, then the existing client that uses this class also breaks.&lt;br /&gt;
&lt;br /&gt;
Let’s restructure the above example,&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java"&gt;public class Money {
private BigDecimal amount;

public Money(String amount) {
this.amount = new BigDecimal(amount);
}

public void add(Money toAdd) {
amount = amount.add(toAdd.amount);
}

// client
Money balance1 = new Money("10.0");
Money balance2 = new Money("6.0");
balance1.add(balance2);

}
&lt;/pre&gt;&lt;br /&gt;
Now instead of asking for a value, the class has responsibility to increase its own value. With this approach, the change request for any other datatype in future requires no change in the client code. Here not only the data is encapsulated but also the data which is stored, or even the fact that it exist at all.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;&lt;p&gt;&lt;a name="N10078"&gt;&lt;span&gt;Conclusions&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;&lt;br /&gt;
Use of accessors to restrict direct access to field variable is preferred over the use of public fields, however, making getters and setter for each and every field is overkill. It also depends on the situation though, sometimes you just want a dumb data object. Accessors should be added for field where they're really required. A class should expose larger behavior which happens to use its state, rather than a repository of state to be manipulated by other classes.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;&lt;p&gt;&lt;a name="N10078"&gt;&lt;span&gt;More Reading&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;&lt;a href="http://c2.com/cgi/wiki?TellDontAsk"&gt;&lt;br /&gt;
&lt;br /&gt;
http://c2.com/cgi/wiki?TellDontAsk&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://c2.com/cgi/wiki?AccessorsAreEvil"&gt;http://c2.com/cgi/wiki?AccessorsAreEvil&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://java.sun.com/docs/books/effective/"&gt;Effective Java&lt;/a&gt;</content><link rel="replies" type="application/atom+xml" href="http://muhammadkhojaye.blogspot.com/feeds/6635820079683050715/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://muhammadkhojaye.blogspot.com/2010/10/getter-setter-to-use-or-not-to-use.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/6635820079683050715?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/6635820079683050715?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MuhammadKhojayesBlog/~3/pdiJe5AEAqw/getter-setter-to-use-or-not-to-use.html" title="Getter Setter: To use or not to use" /><author><name>Muhammad Khojaye</name><uri>http://www.blogger.com/profile/00894488663979159734</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="21" src="http://1.bp.blogspot.com/_ozAUGbBR948/S8np6kmXerI/AAAAAAAAABE/I9goBiE4tT4/S220/(22).JPG" /></author><thr:total>1</thr:total><feedburner:origLink>http://muhammadkhojaye.blogspot.com/2010/10/getter-setter-to-use-or-not-to-use.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4MQHY8fSp7ImA9WhZSGU8.&quot;"><id>tag:blogger.com,1999:blog-3234207576654915154.post-392598882560098717</id><published>2010-08-29T10:54:00.000-07:00</published><updated>2011-04-04T06:49:41.875-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-04T06:49:41.875-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java 7" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="java 7 automatic resource management" /><category scheme="http://www.blogger.com/atom/ns#" term="java 7 features" /><category scheme="http://www.blogger.com/atom/ns#" term="automatic resource management" /><title>Java 7 Automatic Resource Management</title><content type="html">One of the features in Java 7 is &lt;a href="https://docs.google.com/Doc?id=ddv8ts74_0vnstdfdh"&gt;Automatic Resource Management&lt;/a&gt;. The idea was presented by &lt;a href="http://mail.openjdk.java.net/pipermail/coin-dev/2009-February/000011.html"&gt;Josh Bloch&lt;/a&gt;. The IO resources in &lt;code&gt;Java&lt;/code&gt; need to close manually like &lt;code&gt;FileInputStream&lt;/code&gt;, &lt;code&gt;java.io.InputStream&lt;/code&gt;, &lt;code&gt;OutputStream&lt;/code&gt;, &lt;code&gt;Reader&lt;/code&gt;, &lt;code&gt;Writer&lt;/code&gt; etc. The idea with this proposal is that it should not be the responsibility of the developer for disposing out these resources much like automatic garbage collection concept.&lt;br /&gt;
&lt;br /&gt;
We usually write this kind of code for IO resources as below. &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java"&gt;FileInputStream input = null;            
try {              
    input = new FileInputStream(configResource);               
    wfConfiguration = wfConfiguration.parseInputStream(input);           
} catch (IOException ioe) {               
      throw new RuntimeException(ioe);           
} finally {               
      if (input != null) {                   
           try {                       
             input.close();                   
           } catch (IOException ioe2) {                       
             throw new RuntimeException(ioe2);                   
           }               
      }           
}
&lt;/pre&gt;&lt;br /&gt;
The same code can be written in Java 7 as&lt;br /&gt;
&lt;pre class="brush: java"&gt;FileInputStream input = null;            
try (input = new FileInputStream(configResource)) {         
      wfConfiguration = wfConfiguration.parseInputStream(input);     
} catch (IOException ioe) {               
      throw new RuntimeException(ioe);       
}
&lt;/pre&gt;&lt;br /&gt;
Hope you like the new syntax.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://blogs.sun.com/darcy/entry/project_coin_updated_arm_spec"&gt;Project Coin: Updated ARM Spec&lt;br /&gt;
&lt;/a&gt;</content><link rel="replies" type="application/atom+xml" href="http://muhammadkhojaye.blogspot.com/feeds/392598882560098717/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://muhammadkhojaye.blogspot.com/2010/08/automatic-resource-management.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/392598882560098717?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/392598882560098717?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MuhammadKhojayesBlog/~3/p-yfVqGPzWY/automatic-resource-management.html" title="Java 7 Automatic Resource Management" /><author><name>Muhammad Khojaye</name><uri>http://www.blogger.com/profile/00894488663979159734</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="21" src="http://1.bp.blogspot.com/_ozAUGbBR948/S8np6kmXerI/AAAAAAAAABE/I9goBiE4tT4/S220/(22).JPG" /></author><thr:total>3</thr:total><feedburner:origLink>http://muhammadkhojaye.blogspot.com/2010/08/automatic-resource-management.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcHQ344eSp7ImA9WhVWGEw.&quot;"><id>tag:blogger.com,1999:blog-3234207576654915154.post-3568737354108522693</id><published>2010-07-23T04:04:00.000-07:00</published><updated>2012-04-30T13:33:52.031-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-30T13:33:52.031-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="pass-by-reference" /><category scheme="http://www.blogger.com/atom/ns#" term="parameters" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="references" /><category scheme="http://www.blogger.com/atom/ns#" term="arguments" /><category scheme="http://www.blogger.com/atom/ns#" term="pass-by-value" /><title>Java pass by reference or pass by value?</title><content type="html">&lt;h3&gt;
&lt;a href="" name="N10079"&gt;Does Java pass by reference or pass by value?&lt;/a&gt;&lt;/h3&gt;
In &lt;code&gt;Java&lt;/code&gt; everything is &lt;code&gt;passed by value&lt;/code&gt;. Sometime this is confusing but the point to understand is that in &lt;code&gt;Java&lt;/code&gt;, when we pass an &lt;code&gt;parameter&lt;/code&gt; to the method, a copy of the &lt;code&gt;parameter&lt;/code&gt; is made.&lt;br /&gt;
&lt;br /&gt;
If the &lt;code&gt;argument&lt;/code&gt; is the &lt;code&gt;primitive&lt;/code&gt; type, then a copy of the value of the &lt;code&gt;primitive&lt;/code&gt; is passed. If the &lt;code&gt;argument&lt;/code&gt; being passed is an &lt;code&gt;object reference&lt;/code&gt;, then a copy of the value of the &lt;code&gt;reference&lt;/code&gt; is passed. i.e., the object &lt;code&gt;reference&lt;/code&gt; is &lt;code&gt;passed by value&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
Consider the example below,&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java"&gt;public static void main(String[] args) {
   A a = new A();
   A b = new A();
   a.attribute = 5;
   b.attribute = 7;
   System.out.println(a.attribute);
   System.out.println(b.attribute);
   changeAttribute(a,b);
   System.out.println(a.attribute);
   System.out.println(b.attribute);
}

public static void changeAttribute(A a, A b) {
   a = b;
   System.out.println(a.attribute);
}   
&lt;/pre&gt;&lt;br /&gt;
Since Java is &lt;code&gt;pass by value&lt;/code&gt;, the caller still does not see the change, even after calling the method.&lt;br /&gt;
&lt;br /&gt;
In short, Java is &lt;code&gt;pass by value&lt;/code&gt; for all data types. Non-primitive type variables are &lt;code&gt;references&lt;/code&gt; to objects. They are not the &lt;code&gt;objects&lt;/code&gt; themselves. Because variables are not the objects themselves, the &lt;code&gt;objects&lt;/code&gt; never passed to a method; only a &lt;code&gt;reference&lt;/code&gt; to the object is passed.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;&lt;p&gt;&lt;a name="N10078"&gt;&lt;span&gt;More Readings&lt;br /&gt;
&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.coderanch.com/how-to/java/CallByReferenceVsCallByValue"&gt;Call By Reference Vs Call By Value &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/40480/is-java-pass-by-reference"&gt;Is Java pass by reference?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel="replies" type="application/atom+xml" href="http://muhammadkhojaye.blogspot.com/feeds/3568737354108522693/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://muhammadkhojaye.blogspot.com/2010/07/java-is-pass-by-value.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/3568737354108522693?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/3568737354108522693?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MuhammadKhojayesBlog/~3/hSc63GErGtw/java-is-pass-by-value.html" title="Java pass by reference or pass by value?" /><author><name>Muhammad Khojaye</name><uri>http://www.blogger.com/profile/00894488663979159734</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="21" src="http://1.bp.blogspot.com/_ozAUGbBR948/S8np6kmXerI/AAAAAAAAABE/I9goBiE4tT4/S220/(22).JPG" /></author><thr:total>2</thr:total><feedburner:origLink>http://muhammadkhojaye.blogspot.com/2010/07/java-is-pass-by-value.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAERXo5eSp7ImA9WxFUGU8.&quot;"><id>tag:blogger.com,1999:blog-3234207576654915154.post-7052582018244363393</id><published>2010-06-26T00:54:00.000-07:00</published><updated>2010-06-30T11:48:24.421-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-30T11:48:24.421-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="FindBugs" /><category scheme="http://www.blogger.com/atom/ns#" term="Code Quality" /><category scheme="http://www.blogger.com/atom/ns#" term="bugs" /><category scheme="http://www.blogger.com/atom/ns#" term="improve code" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="metrics" /><category scheme="http://www.blogger.com/atom/ns#" term="quality metrics" /><category scheme="http://www.blogger.com/atom/ns#" term="quality code" /><category scheme="http://www.blogger.com/atom/ns#" term="FindBug" /><title>Find the Java Bugs with FindBugs</title><content type="html">This post is regarding the static analysis tool that finds defects in Java programs. Static analysis tools can find real bugs and real issues in the code. We can effectively incorporate static analysis into our software development process.&lt;br /&gt;&lt;br /&gt;&lt;font size="5"&gt;FindBugs&lt;/font&gt;&lt;br /&gt;FindBugs is an open source static analysis tool that analyzes Java class files, looking for programming defects. The analysis engine reports nearly 300 different bug patterns. Each bug pattern is grouped into a category (e.g., correctness, bad practice, performance and internationalization), and each report of a bug pattern is assigned a priority, high, medium or low.&lt;br /&gt;&lt;br /&gt;Let’s start with some of the selected bug categories with the examples.&lt;br /&gt;&lt;br /&gt;&lt;font size="5"&gt;Correctness&lt;/font&gt;&lt;br /&gt;&lt;font size="4"&gt;Comparing incompatable types for equality&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Consider the following code,&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;&lt;br /&gt;if ((!value.equals(null)) &amp;amp;&amp;amp; (!value.equals(""))) {&lt;br /&gt;      Map spaces =&lt;br /&gt;         (Map) vm.get(SpaceConstants.AVAILABLESPACEMAP);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;One would expect that the condition would true, when value is not null and is not empty. However, value.equals(null) according to the contract of the &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#equals%28java.lang.Object%29"&gt;equals()&lt;/a&gt; method, would always return false.&lt;br /&gt;&lt;br /&gt;Consider the another similar example,&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;&lt;br /&gt;if ((bean.getNoteRate() != null) &amp;amp;&amp;amp;&lt;br /&gt;           !bean.getNoteRate().equals("") &amp;amp;&amp;amp;&lt;br /&gt;           (bean.getNoteRate() &gt; 0)) {&lt;br /&gt;     item.setNoteRate(bean.getNoteRate());&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;We might expect that the condition would true, when noteRate is not null, not empty and is greater than 0. However, the condition would never be true.&lt;br /&gt;&lt;br /&gt;The reason is that bean.getNoteRate().equals("") would always return false regardless of being equal value. According to the contract of &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#equals%28java.lang.Object%29"&gt;equals()&lt;/a&gt;, objects of different classes should always compare as unequal; therefore, according to the contract defined by &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#equals%28java.lang.Object%29"&gt;java.lang.Object.equals(Object)&lt;/a&gt;, the result of this comparison will always be false at runtime.&lt;br /&gt;&lt;br /&gt;&lt;font size="4"&gt;Null pointer dereference&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Consider the following code,&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;&lt;br /&gt;if ((list == null) &amp;amp;&amp;amp; (list.size() == 0)) {&lt;br /&gt;     return null;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This will lead to a &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/NullPointerException.html"&gt;NullPointerException &lt;/a&gt;when the code is executed when list is null.&lt;br /&gt;&lt;br /&gt;&lt;font size="4"&gt;Suspicious reference comparison&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Consider the following code,&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;&lt;br /&gt;if (bean.getPaymentAmount() != null&lt;br /&gt;    &amp;amp;&amp;amp; bean.getPaymentAmount() != &lt;br /&gt;       currBean.getPrincipalPaid()) {&lt;br /&gt;          // code to execute&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;This code compares two reference values (Double paymentAmount) using the != operator, where the correct way to compare instances of this type is generally with the &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#equals%28java.lang.Object%29"&gt;equals()&lt;/a&gt; method. It is possible to create distinct instances that are equal but do not compare as == since they are different objects.&lt;br /&gt;&lt;br /&gt;&lt;font size="4"&gt;Doomed test for equality to NaN&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Consider the following code,&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;&lt;br /&gt;if ((newValue == Double.NaN) || (newValue &lt; 0d)) {&lt;br /&gt;            // the code to execute&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;This code checks to see if a floating point value is equal to the special &lt;span style="font-weight: bold;"&gt;Not A Number&lt;/span&gt; value. However, because of the special semantics of &lt;span style="font-weight: bold;"&gt;NaN&lt;/span&gt;, no value is equal to Nan, including &lt;span style="font-weight: bold;"&gt;NaN&lt;/span&gt;. Thus, x == Double.NaN always evaluates to false. To check to see if a value contained in x is the special &lt;span style="font-weight: bold;"&gt;Not A Number&lt;/span&gt; value, use &lt;span style="font-weight: bold;"&gt;Double.isNaN(x) &lt;/span&gt;(or &lt;span style="font-weight: bold;"&gt;Float.isNaN(x)&lt;/span&gt; if x is floating point precision).  &lt;br /&gt;&lt;br /&gt;Also see &lt;a href="http://faq.javaranch.com/java/ScjpFaq#nanComparisons"&gt;&lt;b&gt;How can you compare NaN values?&lt;/b&gt;&lt;/a&gt; &lt;a name="nanComparisons"&gt;&lt;/a&gt;.   &lt;br /&gt;&lt;br /&gt;&lt;font size="4"&gt;Method whose return value should not ignore&lt;/font&gt;&lt;br /&gt;string is immutable object. So ignoring the return value of the method would consider as bug.&lt;br /&gt;&lt;pre class="brush: java"&gt;String name = "Muhammad";&lt;br /&gt;name.toUpper();&lt;br /&gt;if (name.equals("MUHAMMAD"))&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;font size="5"&gt;Performance &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font size="4"&gt;Method invokes inefficient Boolean constructor;use Boolean.valueOf(...) instead  &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Consider the following code,    &lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;&lt;br /&gt;if ((record.getAmount() != null)&lt;br /&gt;    &amp;amp;&amp;amp; !record.getAmount().equals(&lt;br /&gt;        new Boolean(bean.isCapitalizing()))) {&lt;br /&gt;            // code to execute&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Creating new instances of &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/Boolean.html"&gt;&lt;em&gt;java.lang.Boolean&lt;/em&gt;&lt;/a&gt; wastes memory,  since &lt;em&gt;Boolean&lt;/em&gt; objects are immutable and there are only two  useful values of this type.  Use the &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/Boolean.html#valueOf%28boolean%29"&gt;&lt;em&gt;Boolean.valueOf()&lt;/em&gt; &lt;/a&gt;method  (or Java 1.5 autoboxing) to create Boolean objects instead.&lt;br /&gt;&lt;br /&gt;&lt;font size="4"&gt;Inefficient use of keySet iterator instead of entrySet iterator&lt;/font&gt;&lt;br /&gt;Consider the following code,&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;&lt;br /&gt;Iterator iter = balances.keySet().iterator();&lt;br /&gt;        while (iter.hasNext()) {&lt;br /&gt;            // code to execute&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;This method accesses the value of a Map entry, using a key that was  retrieved from a &lt;a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html#keySet%28%29"&gt;&lt;em&gt;keySet &lt;/em&gt;&lt;/a&gt;iterator. It is more efficient to use  an iterator on the &lt;a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html#entrySet%28%29"&gt;&lt;em&gt;entrySet &lt;/em&gt;&lt;/a&gt;of the map, to avoid the &lt;em&gt;Map.get(key)&lt;/em&gt;  lookup.&lt;p&gt;&lt;font size="4"&gt;Method invokes inefficient Number constructor; use static valueOf instead&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Consider the following code,&lt;/p&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;&lt;br /&gt;Integer number1 = new Integer(123);&lt;br /&gt;Integer number2 = Integer.valueOf(123);&lt;br /&gt;&lt;br /&gt;System.out.println("number1 =  " + number1);&lt;br /&gt;System.out.println("number2 =  " + number2);&lt;/pre&gt;&lt;br /&gt;Using new Integer(int) is guaranteed to always result in a new object whereas Integer.valueOf(int) allows caching of values to be done by the class library, or JVM. Using of cached values avoids object allocation and the code will be faster.&lt;br /&gt;&lt;br /&gt;Also see: &lt;a href="http://faq.javaranch.com/java/JavaIntermediateFaq#integerAutoBoxing"&gt;http://faq.javaranch.com/java/JavaIntermediateFaq#integerAutoBoxing&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Method concatenates strings using + in a loop&lt;/strong&gt;  &lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;&lt;br /&gt;for (int x = 0; x &lt; exceptions.size(); x++) {&lt;br /&gt;    errorMessage += getStackTrace(&lt;br /&gt;         exceptions.get(x) + "\n");&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;In each iteration, the &lt;em&gt;String &lt;/em&gt;is converted to a &lt;em&gt;StringBuffer/StringBuilder&lt;/em&gt;,  appended to, and converted back to a String. This can lead to a cost  quadratic in the number of iterations, as the growing string is recopied  in each iteration.&lt;p&gt;Better performance can be obtained by using a &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/StringBuilder.html"&gt;&lt;em&gt;StringBuilder  &lt;/em&gt;&lt;/a&gt;explicitly.&lt;/p&gt;&lt;p&gt;&lt;font size="5"&gt;Dodgy&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Code that is confusing, anomalous, or written in a way that leads itself to errors. Examples include dead local stores, switch fall through, unconfirmed casts, and redundant null check of value known to be null.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="4"&gt;instanceof will always return true&lt;/font&gt;&lt;/p&gt;&lt;p&gt;The instanceof test will always return true (unless the value being  tested is null)&lt;/p&gt;&lt;pre class="brush: java"&gt;NodeList nodeList = root.getElementsByTagName("node");&lt;br /&gt;&lt;br /&gt;int nodeListLength = nodeList.getLength();&lt;br /&gt;&lt;br /&gt;for (int i = 0; i &lt; nodeListLength; i++) {&lt;br /&gt;   Node node = nodeList.item(i);&lt;br /&gt;   if (node instanceof Node &amp;amp;&amp;amp; &lt;br /&gt;       node.getParentNode() == root) {&lt;br /&gt;       //do code&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="4"&gt;Test for floating point equality&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Consider the following code,&lt;/p&gt;&lt;p&gt;&lt;pre class="brush: java"&gt;private double value = 0d;&lt;br /&gt;&lt;br /&gt;if (value &gt; diff) {     &lt;br /&gt;     // code to excute&lt;br /&gt;} else if (value == diff) {     &lt;br /&gt;    // code to excute&lt;br /&gt;}&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;The above code compares two floating point values for equality. Because floating point calculations may involve rounding, calculated float and double values may not be accurate. For values that must be precise, such as monetary values, &lt;a href="http://java.sun.com/javase/6/docs/api/java/math/BigDecimal.html"&gt;BigDecimal&lt;/a&gt; would be more appropriate.&lt;/p&gt;&lt;p&gt;See &lt;a href="http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#4.2.4"&gt;Floating-Point Operations&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Also see Effective Java 2nd Ed, &lt;span style="font-style: italic;"&gt;Item 48:Avoid float and double if exact answers are required&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="4"&gt;Integral division result cast to double or float &lt;/font&gt;&lt;/p&gt;&lt;p&gt;Consider the code,&lt;/p&gt;&lt;p&gt;&lt;pre class="brush: java"&gt;int x = 2;&lt;br /&gt;int y = 5;&lt;br /&gt;&lt;br /&gt;// Wrong: yields result 0.0&lt;br /&gt;double value1 =  x / y;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;This code casts the result of an integral division operation to &lt;em&gt;double&lt;/em&gt;  or &lt;em&gt;float&lt;/em&gt;.  Doing division on integers truncates the result to  the integer value closest to zero. The fact that the result was cast to  double suggests that this precision should have been retained.  We  should cast one or both of the operands to double before performing the  division like&lt;/p&gt;&lt;p&gt;&lt;pre class="brush: java"&gt;// Right: yields result 0.4&lt;br /&gt;double value2 =  x / (double) y;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="5"&gt;References:&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Download the  latest version of &lt;a class="jive-link-external-small" href="http://findbugs.sourceforge.net/"&gt;FindBugs&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Visit the &lt;a class="jive-link-external-small" href="http://findbugs.blogspot.com/"&gt;blog&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Using  the &lt;a class="jive-link-external-small" href="http://findbugs.sourceforge.net/manual/anttask.html"&gt;FindBugs Ant  task&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Using the &lt;a class="jive-link-external-small" href="http://findbugs.sourceforge.net/manual/eclipse.html"&gt;FindBugs  Eclipse plugin&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="http://pmd.sourceforge.net/rules/design.html"&gt;PMD&lt;/a&gt;&lt;/p&gt;</content><link rel="replies" type="application/atom+xml" href="http://muhammadkhojaye.blogspot.com/feeds/7052582018244363393/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://muhammadkhojaye.blogspot.com/2010/06/find-java-bugs-with-findbugs.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/7052582018244363393?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/7052582018244363393?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MuhammadKhojayesBlog/~3/0GG09ewqnms/find-java-bugs-with-findbugs.html" title="Find the Java Bugs with FindBugs" /><author><name>Muhammad Khojaye</name><uri>http://www.blogger.com/profile/00894488663979159734</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="21" src="http://1.bp.blogspot.com/_ozAUGbBR948/S8np6kmXerI/AAAAAAAAABE/I9goBiE4tT4/S220/(22).JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://muhammadkhojaye.blogspot.com/2010/06/find-java-bugs-with-findbugs.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMDSXw_cCp7ImA9WxFQGEk.&quot;"><id>tag:blogger.com,1999:blog-3234207576654915154.post-4810061060891662894</id><published>2010-05-13T23:16:00.000-07:00</published><updated>2010-05-14T06:07:58.248-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-14T06:07:58.248-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java.lang.ref" /><category scheme="http://www.blogger.com/atom/ns#" term="Weak" /><category scheme="http://www.blogger.com/atom/ns#" term="phantomreference" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Soft" /><category scheme="http://www.blogger.com/atom/ns#" term="garbage collection" /><category scheme="http://www.blogger.com/atom/ns#" term="finalization" /><category scheme="http://www.blogger.com/atom/ns#" term="finalizer" /><category scheme="http://www.blogger.com/atom/ns#" term="reference object" /><title>Phantom References in Java</title><content type="html">Memory management is done automatically in Java. The programmer doesn't need to worry about reference objects that have been released. One downside to this approach is that the programmer cannot know when a particular object will be collected. Moreover, the programmer has no control over memory management. However, the &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/ref/package-summary.html"&gt;java.lang.ref&lt;/a&gt; package defines classes that provide a limited degree of interaction with the garbage collector. The concrete classes &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/ref/SoftReference.html"&gt;SoftReference&lt;/a&gt;, &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/ref/WeakReference.html"&gt;WeakReference&lt;/a&gt; and &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/ref/PhantomReference.html"&gt;PhantomReference&lt;/a&gt; are subclasses of Reference that interact with the garbage collector in different ways. In this article we will discuss the functionality and behavior of the PhantomReference classes and see how it can be used.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Problem with Finalization&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To perform some postmortem cleanup on objects that garbage collector consider as unreachable, one can use finalization. This feature can be utilized to reclaim native resources associated with an object. However, finalizers have many problems associated.&lt;br /&gt;&lt;br /&gt;Firstly, we can’t foresee the call of &lt;span style="font-style:italic;"&gt;finalize()&lt;/span&gt;. Since the Garbage Collection is unpredictable, the calling of &lt;span style="font-style:italic;"&gt;finalize()&lt;/span&gt; cannot be predicted. There is no guarantee that the object will be garbage collected. The object might never become eligible for GC because it could be reachable through the entire lifetime of the JVM. It is also possible that no garbage collection actually runs from the time the object became eligible and before JVM stops.&lt;br /&gt;&lt;br /&gt;Secondly, Finalization can slowdown an application. Managing objects with a &lt;span style="font-style:italic;"&gt;finalize()&lt;/span&gt; method takes more resources from the JVM than normal objects.&lt;br /&gt;&lt;br /&gt;As per doc,&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;You should also use finalization only when it is absolutely necessary. Finalization is a nondeterministic -- and sometimes unpredictable -- process. The less you rely on it, the smaller the impact it will have on the JVM and your application&lt;/blockquote&gt;&lt;br /&gt;In Effective Java, 2nd ed., Joshua Bloch says,&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;there is a severe performance penalty for using finalizers... So what should you do instead of writing a finalizer for a class whose objects encapsulate resources that require termination, such as files or threads? Just provide an explicit termination method, and require clients of the class to invoke this method on each instance when it is no longer needed.&lt;/blockquote&gt;&lt;br /&gt;In short, &lt;span style="font-style:italic;"&gt;Finalize()&lt;/span&gt; isn't used often, and also there is no much reason to use it. If we have a class with methods like &lt;span style="font-style:italic;"&gt;close()&lt;/span&gt; or &lt;span style="font-style:italic;"&gt;cleanup()&lt;/span&gt; and that should be called once user done with the object then placing these methods call in &lt;span style="font-style:italic;"&gt;finalize()&lt;/span&gt; can be used as a safety measure, but not necessary.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Phantom Reference&lt;br /&gt;phantom reachable, phantomly reachable&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;An object is phantom reachable if it is neither strongly nor softly nor weakly reachable and has been finalized and there is a path from the roots to it that contains at least one phantom reference.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/ref/PhantomReference.html"&gt;PhantomReference&lt;/a&gt; constructor accepts two arguments:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;referent&lt;/span&gt; - the object the new phantom reference will refer to&lt;br /&gt;&lt;span style="font-style:italic;"&gt;q&lt;/span&gt; - the reference is registered with the given queue.&lt;br /&gt;&lt;br /&gt;The argument q represents the instance of the &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/ref/ReferenceQueue.html"&gt;ReferenceQueue&lt;/a&gt; class. If the garbage collector determines that the referent of a phantom reference is phantom reachable, then the PhantomReference will be added to this ReferenceQueue. You can then retrieve the PhantomReference by using the &lt;span style="font-style:italic;"&gt;remove()&lt;/span&gt; methods of the ReferenceQueue class.&lt;br /&gt;&lt;br /&gt;Consider the following example,&lt;br /&gt;&lt;pre class="brush: java"&gt;&lt;br /&gt;ReferenceQueue q = new ReferenceQueue();&lt;br /&gt;PhantomReference pr = new PhantomReference(object, referenceQueue);&lt;br /&gt;&lt;br /&gt;// Later on another point&lt;br /&gt;Reference r = q.remove();&lt;br /&gt;&lt;br /&gt;// Now, clear up any thing you want&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;PhantomReference, when to use?&lt;/span&gt;&lt;br /&gt;Phantom Reference can be used in situations, where sometime using &lt;span style="font-style:italic;"&gt;finalize()&lt;/span&gt; is not  sensible thing to do.This reference type differs from the other types defined in &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/ref/package-summary.html"&gt;java.lang.ref&lt;/a&gt; Package because it isn't meant to be used to access the object, but as a signal that the object has already been finalized, and the garbage collector is ready to reclaim its memory.&lt;br /&gt;&lt;br /&gt;As per API doc,&lt;br /&gt;&lt;blockquote&gt;Phantom reference objects, which are enqueued after the collector determines that their referents may otherwise be reclaimed. Phantom references are most often used for scheduling pre-mortem cleanup actions in a more flexible way than is possible with the Java finalization mechanism.&lt;/blockquote&gt;&lt;br /&gt;People usually attempt to use &lt;span style="font-style:italic;"&gt;finalize()&lt;/span&gt; method to perform postmortem cleanup on objects which usually not advisable. As mentioned earlier, Finalizers have an impact on the performance of the garbage collector since Objects with finalizers are slow to garbage collect.&lt;br /&gt;&lt;br /&gt;Phantom references are safe way to know an object has been removed from memory. For instance, consider an application that deals with large images. Suppose that we want to load a big image in to memory when large image is already in memory which is ready for garbage collected. In such case, we want to wait until the old image is collected before loading a new one. Here, the phantom reference is flexible and safely option to choose. The reference of the old image will be enqueued in the &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/ref/ReferenceQueue.html"&gt;ReferenceQueue&lt;/a&gt; once the old image object is finalized. After receiving that reference, we can load the new image in to memory.&lt;br /&gt;&lt;br /&gt;Similarly we can use Phantom References to implement a Connection Pool. We can easily gain control over the number of open connections, and can block until one becomes available.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Reference Objects and Garbage Collection&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Soft Reference can be garbage collected after there are no strong references to the referent. However, it typically retained until memory is low. All softly reachable objects will be reclaimed before an OutOfMemoryException is thrown. Therefore, it can be used to implement caches of objects that can be recreated if needed. &lt;br /&gt;&lt;br /&gt;Weak Reference can be garbage collected when there are no strong or soft references to the referent. However, unlike Soft Reference, they are garbage collected on a gc even when memory is abundant. They often can be used for “canonical mappings” where each object has a unique identifier (one-to-one), and in collections of “listeners”&lt;br /&gt;&lt;br /&gt;On the other hand, Phantom Reference, can be garbage collected once there are no strong, soft or weak references to the referent. When object is phantomly reachable, it means the object is already finalized but not yet reclaimed, so the GC enqueues it in a ReferenceQueue for post-finalization processing.&lt;br /&gt;&lt;br /&gt;As per Java Doc,&lt;br /&gt;&lt;blockquote&gt;    Unlike soft and weak references, phantom references are not automatically cleared by the garbage collector as they are enqueued. An object that is reachable via phantom references will remain so until all such references are cleared or themselves become unreachable.&lt;/blockquote&gt;&lt;br /&gt;A PhantomReference is not automatically cleared when it is enqueued, so when we remove a PhantomReference from a ReferenceQueue, we must call its &lt;span style="font-style:italic;"&gt;clear()&lt;/span&gt; method or allow the PhantomReference object itself to be garbage-collected.  &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Summary&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In short, we should avoid &lt;span style="font-style:italic;"&gt;finalize()&lt;/span&gt; as much as possible. There is no guarantee if the &lt;span style="font-style:italic;"&gt;finalize()&lt;/span&gt; method will be called promptly following garbage collection, or even it will be called. If the finalize method runs for a long time, it can delay execution of finalize methods of other objects. Instead of relying on &lt;span style="font-style:italic;"&gt;finalize()&lt;/span&gt;, we can use reference types define in &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/ref/package-summary.html"&gt;java.lang.ref&lt;/a&gt; package.&lt;br /&gt;&lt;br /&gt;Beside &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/ref/package-summary.html"&gt;java.lang.ref&lt;/a&gt; package, Google collection library also provide some alternatives. For example, &lt;a href="http://google-collections.googlecode.com/svn/trunk/javadoc/com/google/common/base/FinalizablePhantomReference.html"&gt;FinalizablePhantomReference&lt;/a&gt; extends &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/ref/PhantomReference.html"&gt;java.lang.ref.PhantomReference&lt;/a&gt;, deals with processing the &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/ref/ReferenceQueue.html"&gt;ReferenceQueue&lt;/a&gt; and call back a convenient method &lt;span style="font-style:italic;"&gt;finalizeReferent()&lt;/span&gt;. So if we want to do some cleanup operation when an object is claimed by the garbage collector (GC) then we just need to override the &lt;span style="font-style:italic;"&gt;finalizeReferent()&lt;/span&gt; method. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Resources&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.artima.com/insidejvm/ed2/gcP.html"&gt;Garbage Collection&lt;/a&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/ref/PhantomReference.html"&gt;PhantomReference&lt;/a&gt;&lt;br /&gt;&lt;a href="http://docstore.mik.ua/orelly/java-ent/jnut/ch13_01.htm"&gt;The java.lang.ref Package (Java in a Nutshell)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://weblogs.java.net/blog/enicholas/archive/2006/05/understanding_w.html"&gt;Understanding Weak References&lt;/a&gt;</content><link rel="replies" type="application/atom+xml" href="http://muhammadkhojaye.blogspot.com/feeds/4810061060891662894/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://muhammadkhojaye.blogspot.com/2010/05/understanding-phantom-references.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/4810061060891662894?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/4810061060891662894?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MuhammadKhojayesBlog/~3/WEKif3KsCLU/understanding-phantom-references.html" title="Phantom References in Java" /><author><name>Muhammad Khojaye</name><uri>http://www.blogger.com/profile/00894488663979159734</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="21" src="http://1.bp.blogspot.com/_ozAUGbBR948/S8np6kmXerI/AAAAAAAAABE/I9goBiE4tT4/S220/(22).JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://muhammadkhojaye.blogspot.com/2010/05/understanding-phantom-references.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QBSXs9fCp7ImA9WhVWF08.&quot;"><id>tag:blogger.com,1999:blog-3234207576654915154.post-1635355756495982226</id><published>2010-03-14T13:24:00.000-07:00</published><updated>2012-04-29T11:49:18.564-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-29T11:49:18.564-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="multithreaded" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="thread" /><category scheme="http://www.blogger.com/atom/ns#" term="executor" /><category scheme="http://www.blogger.com/atom/ns#" term="iterator" /><category scheme="http://www.blogger.com/atom/ns#" term="ExecutorCompletionService" /><category scheme="http://www.blogger.com/atom/ns#" term="ExecutorService" /><category scheme="http://www.blogger.com/atom/ns#" term="java libraries" /><category scheme="http://www.blogger.com/atom/ns#" term="concurrency" /><title>Playing with Executor - The Executor framework</title><content type="html">&lt;h3&gt;
&lt;a href="" name="N10078"&gt;Transform sequential loop into a parallel&lt;/a&gt;&lt;/h3&gt;
If the iterations of the loop are independent and we don’t need to wait for all of them to complete before proceeding, we can use an &lt;a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Executor.html"&gt;Executor &lt;/a&gt;to transform a sequential loop into a parallel one as shown below.
&lt;br /&gt;
&lt;br /&gt;&lt;pre class="brush: java"&gt;
&lt;br /&gt;Public void SequentialLoop(List elements) {
&lt;br /&gt;  for (Element e : elements)
&lt;br /&gt;      process(e);
&lt;br /&gt;}&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;pre class="brush: java"&gt;
&lt;br /&gt;public void processLoopInParallel(Executor exec, List elements) {
&lt;br /&gt;  for (final Element e : elements)
&lt;br /&gt;      exec.execute(new Runnable() {
&lt;br /&gt;          public void run() { process(e); }
&lt;br /&gt;      });
&lt;br /&gt;}&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;The second loop will return more quickly, since all the task are &lt;code&gt;queued&lt;/code&gt; to the &lt;a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Executor.html"&gt;Executor&lt;/a&gt;, rather than waiting for them all to complete.
&lt;br /&gt;
&lt;br /&gt;If you want to submit a set of &lt;code&gt;tasks&lt;/code&gt; and you want to retrieve the results as they become available, you can use a &lt;a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/CompletionService.html"&gt;CompletionService&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;pre class="brush: java"&gt;
&lt;br /&gt;void solve(Executor e, Collection&lt;callable&lt;result&gt;&gt; solvers)
&lt;br /&gt;     throws InterruptedException, ExecutionException {
&lt;br /&gt;       CompletionService&lt;result&gt; ecs
&lt;br /&gt;           = new ExecutorCompletionService&lt;result&gt;(e);
&lt;br /&gt;       for (Callable&lt;result&gt; s : solvers)
&lt;br /&gt;           ecs.submit(s);
&lt;br /&gt;       //retrieve completed task results and use them  
&lt;br /&gt;       int n = solvers.size();
&lt;br /&gt;       for (int i = 0; i &lt; n; ++i) {
&lt;br /&gt;           Result r = ecs.take().get();
&lt;br /&gt;           if (r != null)
&lt;br /&gt;               use(r);
&lt;br /&gt;       }
&lt;br /&gt;   }&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;The advantage of using &lt;a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/CompletionService.html"&gt;CompletionService &lt;/a&gt;is that it always returns the first completed result. In this way, we ensure that we are not waiting for tasks to complete and those uncompleted tasks are running in the background
&lt;br /&gt;
&lt;br /&gt;If you want to submit a set of tasks and wait for them all to complete, you can use &lt;a href="http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/util/concurrent/ExecutorService.html"&gt;ExecutorService.invokeAll&lt;/a&gt;
&lt;br /&gt;</content><link rel="replies" type="application/atom+xml" href="http://muhammadkhojaye.blogspot.com/feeds/1635355756495982226/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://muhammadkhojaye.blogspot.com/2010/03/playing-with-executor.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/1635355756495982226?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/1635355756495982226?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MuhammadKhojayesBlog/~3/3bdmin7QKiA/playing-with-executor.html" title="Playing with Executor - The Executor framework" /><author><name>Muhammad Khojaye</name><uri>http://www.blogger.com/profile/00894488663979159734</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="21" src="http://1.bp.blogspot.com/_ozAUGbBR948/S8np6kmXerI/AAAAAAAAABE/I9goBiE4tT4/S220/(22).JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://muhammadkhojaye.blogspot.com/2010/03/playing-with-executor.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkENR3s_fCp7ImA9WhVWF08.&quot;"><id>tag:blogger.com,1999:blog-3234207576654915154.post-8221522538485352633</id><published>2010-03-07T11:09:00.000-08:00</published><updated>2012-04-29T11:38:16.544-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-29T11:38:16.544-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="xalan" /><category scheme="http://www.blogger.com/atom/ns#" term="jdk1.6" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="jdk 1.6" /><category scheme="http://www.blogger.com/atom/ns#" term="XSL DTMNodeIterator" /><category scheme="http://www.blogger.com/atom/ns#" term="java 6" /><category scheme="http://www.blogger.com/atom/ns#" term="xsl:value-of" /><category scheme="http://www.blogger.com/atom/ns#" term="xsl" /><category scheme="http://www.blogger.com/atom/ns#" term="xsl:import" /><category scheme="http://www.blogger.com/atom/ns#" term="xslt" /><category scheme="http://www.blogger.com/atom/ns#" term="xsl:template" /><title>XSLT Processing with JDK 1.6 and Xalan 2_7_1</title><content type="html">This small post is regarding the changes that is require, if we want to upgarde &lt;code&gt;xalan-java&lt;/code&gt; version to &lt;code&gt;2.7.1&lt;/code&gt; to work compatible with &lt;code&gt;JDK1.6&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Xalan-Java&lt;/code&gt; is an XSLT processor for transforming XML documents into HTML, text, or other XML document types.&lt;br /&gt;&lt;br /&gt;The issues that need to fix while upgrade XSL to work with JDK 1.6 and Xalan 2.7.1 will be discussed here and in this post we will look in to sample examples that help us to create XSL’s to work compatible with these new version.&lt;br /&gt; &lt;br /&gt;Please note that the problems identified here work well with JDK 1.5. Therefore, these changes require only, if we want our XSL to parse successfully with JDK 1.6.&lt;br /&gt;&lt;br /&gt;

&lt;h3&gt;
&lt;a href="" name="N10078"&gt;xsl:import&lt;/a&gt;&lt;/h3&gt;
This element must appear as the first child node of &lt;code&gt;xsl:stylesheet&lt;/code&gt; or &lt;code&gt;xsl:transform&lt;/code&gt;. It should not appear in the end or middle of the stylesheet. Otherwise it throws exception&lt;br /&gt;&lt;br /&gt;&lt;code&gt;“Error! xsl:import is not allowed in this position in the stylesheet!” &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;

&lt;h3&gt;
&lt;a href="" name="N10079"&gt;xsl:template&lt;/a&gt;&lt;/h3&gt;
xsl:template must either have name or match attribute. If the name attribute is omitted then there must be a match attribute.&lt;br /&gt;&lt;br /&gt;For example, the code&lt;br /&gt;
&lt;pre class="brush: xml"&gt;&lt;br /&gt;&lt;xsl:template &gt;&lt;br /&gt;     &lt;xsl:text&gt;&lt;br /&gt;     -- &lt;/xsl:text&gt;&lt;br /&gt;&lt;/xsl:template&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;throw exceptions&lt;br /&gt;&lt;br /&gt;&lt;code&gt;“Fatal Error! java.lang.RuntimeException: ElemTemplateElement error: xsl:template requires either a name or a match attribute.”&lt;/code&gt;&lt;br /&gt; &lt;br /&gt;The below code will execute successfully.&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&lt;xsl:template name="main"&gt;&lt;br /&gt;     &lt;xsl:text&gt;&lt;br /&gt;     -- &lt;/xsl:text&gt;&lt;br /&gt;&lt;/xsl:template&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;

&lt;h3&gt;
&lt;a href="" name="N10080"&gt;xsl:value-of&lt;/a&gt;&lt;/h3&gt;
xsl:value-of cannot be enclosed under xsl:text.&lt;br /&gt;&lt;br /&gt;For example, the code&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&lt;xsl:text&gt;&lt;br /&gt;     &lt;xsl:value-of select="@name"/&gt;&lt;br /&gt;&lt;/xsl:text&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;will throw exception&lt;br /&gt;&lt;br /&gt;&lt;code&gt;“Error! xsl:value-of is not allowed in this position in the stylesheet!”&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The code &lt;xsl:value-of select="@name"/&gt;  can directly used to extract the value to output stream.&lt;br /&gt;&lt;br /&gt;

&lt;h3&gt;
&lt;a href="" name="N10081"&gt;Use StringBuffer/StringBuilder in XSL&lt;/a&gt;&lt;/h3&gt;
Use StringBuffer/StringBuilder in XSL&lt;br /&gt;XSL Code such as&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&lt;xsl:variable name="allTableNames" select="java:java.lang.StringBuffer.new()" /&gt;&lt;br /&gt;&lt;xsl:variable name="void0" select="java:append($allTableNames, concat('', $toAppend))" /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;throw exception&lt;br /&gt;&lt;br /&gt;&lt;code&gt;java.lang.IllegalArgumentException: argument type mismatch and&lt;br /&gt;&lt;br /&gt;java.lang.NullPointerException&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;The reason is that the &lt;br /&gt;&lt;code&gt;org.apache.xalan.extensions.MethodResolver&lt;/code&gt; picks a method whose argument types are not converted properly. This was noticed in the new versions of JVM due to the order at which they return all methods available for a given class and the issue is still not resolved yet.&lt;br /&gt;Further information can be refer to&lt;br /&gt;&lt;br /&gt;&lt;a href="http://issues.apache.org/jira/browse/XALANJ-2374"&gt;http://issues.apache.org/jira/browse/XALANJ-2374&lt;/a&gt;&lt;br /&gt;&lt;a href="http://issues.apache.org/jira/browse/XALANJ-2315"&gt;http://issues.apache.org/jira/browse/XALANJ-2315&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I have replaced StringBuilder with Map to correctly transform the XSL.&lt;br /&gt;&lt;br /&gt;

&lt;h3&gt;
&lt;a href="" name="N10082"&gt;XSL DTMNodeIterator&lt;/a&gt;&lt;/h3&gt;
Consider the following XSL.&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&lt;xsl:variable name="temp_core_alias_value"&gt;&lt;br /&gt;&lt;xsl:choose&gt;&lt;br /&gt;   &lt;xsl:when test="'true'"&gt;&lt;br /&gt;      &lt;xsl:text&gt;, CASE WHEN &lt;/xsl:text&gt;&lt;xsl:text&gt;. &lt;br /&gt;      &lt;/xsl:text&gt;                          &lt;br /&gt;      &lt;xsl:text&gt; IS NULL THEN &lt;/xsl:text&gt;                          &lt;br /&gt;   &lt;/xsl:when&gt;&lt;br /&gt;   &lt;xsl:otherwise&gt;&lt;br /&gt;      &lt;xsl:text&gt;,&lt;/xsl:text&gt;&lt;br /&gt;      &lt;xsl:text&gt;.&lt;/xsl:text&gt;&lt;br /&gt;   &lt;/xsl:otherwise&gt;&lt;br /&gt;&lt;/xsl:choose&gt;&lt;br /&gt;&lt;/xsl:variable&gt;                                      &lt;br /&gt;&lt;br /&gt;&lt;xsl:variable name="temp_core_alias" select="java:put($processedMap,   &lt;br /&gt;   $temp_core_alias_value, 'Test Value')"/&gt;  &lt;br /&gt;   &lt;xsl:variable name="hasValue"&lt;br /&gt;      select="java:containsKey($processedMap, $temp_core_alias_value)"/&gt;&lt;br /&gt;      &lt;xsl:if test="$hasValue = 'true'"&gt;&lt;br /&gt;         &lt;xsl:text&gt;Value exist in Map = &lt;/xsl:text&gt;          &lt;br /&gt;         &lt;xsl:value-of select="java:get($processedMap, $temp_core_alias_value)"/&gt; &lt;br /&gt;      &lt;/xsl:if&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;At this point, we might expect &lt;code&gt;java:containsKey($processedMap,$temp_core_alias_value)&lt;/code&gt; to return true and the output of the above as &lt;code&gt;“Value exist in Map = Test Value”&lt;/code&gt; But when transform using Xalan-Java 2.7.1, the Map return false and therefore no output appear. &lt;br /&gt;&lt;br /&gt;The reason is that the evaluating expression for the &lt;code&gt;temp_core_alias_value&lt;/code&gt; variable would return &lt;br /&gt;&lt;a href="http://xml.apache.org/xalan-j/apidocs/org/apache/xml/dtm/ref/DTMNodeIterator.html"&gt;org.apache.xml.dtm.ref.DTMNodeIterator@e020c9&lt;/a&gt; and therefore, the &lt;code&gt;contains &lt;/code&gt;method of the &lt;code&gt;Map &lt;/code&gt;would always return false regardless of the key present.&lt;br /&gt;&lt;br /&gt;We can transform &lt;code&gt;DTMNodeIterator &lt;/code&gt;to normal String form by concatenate an empty string with &lt;code&gt;temp_core_alias_value&lt;/code&gt; variable like the following&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&lt;xsl:variable name="temp_core_alias_value" select="concat('', $temp_core_alias_value)" /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Adding this line right before put in to the Map would result in the normal expected output.</content><link rel="replies" type="application/atom+xml" href="http://muhammadkhojaye.blogspot.com/feeds/8221522538485352633/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://muhammadkhojaye.blogspot.com/2010/03/xslt-processing-with-jdk-16-and-xalan.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/8221522538485352633?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/8221522538485352633?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MuhammadKhojayesBlog/~3/OWUIeMXJ6PQ/xslt-processing-with-jdk-16-and-xalan.html" title="XSLT Processing with JDK 1.6 and Xalan 2_7_1" /><author><name>Muhammad Khojaye</name><uri>http://www.blogger.com/profile/00894488663979159734</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="21" src="http://1.bp.blogspot.com/_ozAUGbBR948/S8np6kmXerI/AAAAAAAAABE/I9goBiE4tT4/S220/(22).JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://muhammadkhojaye.blogspot.com/2010/03/xslt-processing-with-jdk-16-and-xalan.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkANSX09eyp7ImA9WhVWF08.&quot;"><id>tag:blogger.com,1999:blog-3234207576654915154.post-8812843837208904672</id><published>2010-02-25T02:29:00.000-08:00</published><updated>2012-04-29T11:39:58.363-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-29T11:39:58.363-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Intellij Debug" /><category scheme="http://www.blogger.com/atom/ns#" term="Remote Debug" /><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse Debug" /><title>Java Remote Debugging</title><content type="html">&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CMAKHOJ%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CDOCUME%7E1%5CMAKHOJ%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5CMAKHOJ%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="--"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;![endif]--&gt;&lt;span style="font-size: 11pt; line-height: 115%; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Start the application and tell the JVM that it will be debugged remotely
&lt;br /&gt;For this, add the following options to the JVM args for remote debugging:
&lt;br /&gt;
&lt;br /&gt;&lt;/span&gt;&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;blockquote&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CMAKHOJ%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CDOCUME%7E1%5CMAKHOJ%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5CMAKHOJ%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="--"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Cambria; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073741899 0 0 159 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} h2 	{mso-style-priority:9; 	mso-style-qformat:yes; 	mso-style-link:"Heading 2 Char"; 	mso-style-next:Normal; 	margin-top:10.0pt; 	margin-right:0in; 	margin-bottom:0in; 	margin-left:0in; 	margin-bottom:.0001pt; 	line-height:115%; 	mso-pagination:widow-orphan lines-together; 	page-break-after:avoid; 	mso-outline-level:2; 	font-size:13.0pt; 	font-family:"Cambria","serif"; 	mso-ascii-font-family:Cambria; 	mso-ascii-theme-font:major-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:major-fareast; 	mso-hansi-font-family:Cambria; 	mso-hansi-theme-font:major-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:major-bidi; 	color:#4F81BD; 	mso-themecolor:accent1;} span.Heading2Char 	{mso-style-name:"Heading 2 Char"; 	mso-style-priority:9; 	mso-style-unhide:no; 	mso-style-locked:yes; 	mso-style-link:"Heading 2"; 	mso-ansi-font-size:13.0pt; 	mso-bidi-font-size:13.0pt; 	font-family:"Cambria","serif"; 	mso-ascii-font-family:Cambria; 	mso-ascii-theme-font:major-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:major-fareast; 	mso-hansi-font-family:Cambria; 	mso-hansi-theme-font:major-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:major-bidi; 	color:#4F81BD; 	mso-themecolor:accent1; 	font-weight:bold;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;![endif]--&gt;java -Xdebug -Xrunjdwp:transport=dt_socket,address=8998,server=y,suspend=n&lt;/blockquote&gt;&lt;span style="font-size: 11pt; line-height: 115%; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;
&lt;br /&gt;And then just start IDE's remote debugger to listening on &lt;span style="font-weight:bold;"&gt;port 8998&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;transport=dt_socket&lt;/span&gt; tells that the debugger connections will be made through a socket while the &lt;span style="font-weight:bold;"&gt;address=8998&lt;/span&gt; parameter informs it that the port number will be 8998. For &lt;span style="font-weight:bold;"&gt;suspend=y&lt;/span&gt; , the JVM starts in suspended mode and stays suspended until a debugger is attached to it.
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;a href="" name="N10079"&gt;Configuring Eclipse to Debug a Remotely Running Application&lt;/a&gt;&lt;/h3&gt;
&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: 11pt; line-height: 115%; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;span style="font-weight: bold;"&gt;Start Eclipse&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 11pt; line-height: 115%; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;span style="font-weight: bold;"&gt;Navigate to Run -&gt; Debug Configurations&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 11pt; line-height: 115%; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;span style="font-weight: bold;"&gt;Create a new Remote Java Application configuration&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 11pt; line-height: 115%; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;span style="font-weight: bold;"&gt;Configure the remote application's details&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 11pt; line-height: 115%; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;span style="font-weight: bold;"&gt;click Apply&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;See Also
&lt;br /&gt;&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;a href="http://java.sun.com/javase/technologies/core/toolsapis/jpda/"&gt;&lt;span style="font-size: 11pt; line-height: 115%; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;/span&gt;JPDA&lt;/a&gt;
&lt;br /&gt;&lt;a href="http://java.sun.com/j2ee/1.4/docs/devguide/dgdebug.html"&gt;Debugging J2EE Applications&lt;/a&gt;
&lt;br /&gt;&lt;a href="https://www.ibm.com/developerworks/opensource/library/os-ecbug/"&gt;Debugging with the Eclipse Platform&lt;/a&gt;
&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://muhammadkhojaye.blogspot.com/feeds/8812843837208904672/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://muhammadkhojaye.blogspot.com/2010/02/java-remote-debugging.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/8812843837208904672?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/8812843837208904672?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MuhammadKhojayesBlog/~3/hlu6A1g3khs/java-remote-debugging.html" title="Java Remote Debugging" /><author><name>Muhammad Khojaye</name><uri>http://www.blogger.com/profile/00894488663979159734</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="21" src="http://1.bp.blogspot.com/_ozAUGbBR948/S8np6kmXerI/AAAAAAAAABE/I9goBiE4tT4/S220/(22).JPG" /></author><thr:total>1</thr:total><feedburner:origLink>http://muhammadkhojaye.blogspot.com/2010/02/java-remote-debugging.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcNQ3s-fip7ImA9WxBUEEQ.&quot;"><id>tag:blogger.com,1999:blog-3234207576654915154.post-6751573638567644306</id><published>2010-02-15T23:03:00.000-08:00</published><updated>2010-02-25T03:24:52.556-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-25T03:24:52.556-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Ant" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Build Automation" /><category scheme="http://www.blogger.com/atom/ns#" term="Bugzilla" /><category scheme="http://www.blogger.com/atom/ns#" term="Apache" /><title>Ant 1.8 with Enhancements and Bug fixes</title><content type="html">&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Some key points include&lt;/p&gt;&lt;p style="padding: 0px; min-height: 8pt; height: 8pt;"&gt; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Ant 1.8 has improved directory scanning performance and better symbolic link cycle handling&lt;/li&gt;&lt;li&gt;Brings enhancements and bug fixes to many tasks and types (a strong point for Ant) as well as some core changes.&lt;/li&gt;&lt;li&gt;With more than &lt;a class="jive-link-external-small" href="https://issues.apache.org/bugzilla/buglist.cgi?query_format=advanced&amp;amp;bug_status=RESOLVED&amp;amp;bug_status=CLOSED&amp;amp;component=Build%20Process&amp;amp;component=Core&amp;amp;component=Core%20tasks&amp;amp;component=Documentation&amp;amp;component=Optional%20SCM%20tasks&amp;amp;component=Optional%20Tasks&amp;amp;component=Other&amp;amp;component=Wrapper%20scripts&amp;amp;resolution=FIXED&amp;amp;target_milestone=1.8.0&amp;amp;product=Ant"&gt;275 fixed Bugzilla issues&lt;/a&gt;, Ant 1.8 flaunts some new performance improvements.  A large directory scan, which would have taken 14 minutes in Ant 1.7.1, now takes as little as 22 seconds with Ant 1.8.&lt;/li&gt;&lt;li&gt;Ant 1.8 includes a handful of new elements including &lt;extension-point&gt;,  a new top-level element that assists in writing reusable build files that are meant to be imported.Its name and dependency-list are similar to &lt;target&gt; and it can be used like a &lt;target&gt; from the command line or a dependency-list but in addition, the importing build file can add targets to the &lt;extension-point&gt;'s depends list.&lt;/extension-point&gt;&lt;/target&gt;&lt;/target&gt;&lt;/extension-point&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style="padding: 0px; min-height: 8pt; height: 8pt;"&gt; &lt;/p&gt;Other additions include:&lt;ul&gt;&lt;li&gt;New lexically scoped local properties.&lt;/li&gt;&lt;li&gt;An enhanced &lt;import&gt; that can import from any file or URL resource.&lt;/import&gt;&lt;/li&gt;&lt;li&gt;An easier mechanism for extending Ant's property expansion.&lt;/li&gt;&lt;li&gt;A new task called &lt;em&gt;include&lt;/em&gt; that provides a preferred alternative to &lt;import&gt; when you don't want to override any targets.&lt;/import&gt;&lt;/li&gt;&lt;li&gt;Rewritten&lt;em&gt; if &lt;/em&gt;and &lt;em&gt;unless&lt;/em&gt; attributes that do what is expected when applied to a property expansion (i.e. if="${foo}" means "yes, do it" if ${foo} expands to true.  In Ant 1.7.1 it would mean "no" unless a property named "true" existed).  This adds "testing conditions" to property expansion as a new use-case.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Ant 1.8 now requires at least Java 1.4 or later.&lt;br /&gt;&lt;br /&gt;Other References&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="http://ant.apache.org/bindownload.cgi"&gt;http://ant.apache.org/bindownload.cgi&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="http://apache.mirror.rbftpnetworks.com/ant/README.html"&gt;Release notes&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="http://java.dzone.com/news/ant-18-scanning-leaves-171"&gt;http://java.dzone.com/news/ant-18-scanning-leaves-171&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://muhammadkhojaye.blogspot.com/feeds/6751573638567644306/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://muhammadkhojaye.blogspot.com/2010/02/ant-18-with-enhancements-and-bug-fixes.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/6751573638567644306?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/6751573638567644306?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MuhammadKhojayesBlog/~3/pD-8Hz7PxUg/ant-18-with-enhancements-and-bug-fixes.html" title="Ant 1.8 with Enhancements and Bug fixes" /><author><name>Muhammad Khojaye</name><uri>http://www.blogger.com/profile/00894488663979159734</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="21" src="http://1.bp.blogspot.com/_ozAUGbBR948/S8np6kmXerI/AAAAAAAAABE/I9goBiE4tT4/S220/(22).JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://muhammadkhojaye.blogspot.com/2010/02/ant-18-with-enhancements-and-bug-fixes.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MEQ3g-fip7ImA9WhZTGU0.&quot;"><id>tag:blogger.com,1999:blog-3234207576654915154.post-2357191812819801497</id><published>2010-02-05T20:20:00.000-08:00</published><updated>2011-03-23T11:36:42.656-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-23T11:36:42.656-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="hashCode" /><category scheme="http://www.blogger.com/atom/ns#" term="Jakarta Commons" /><category scheme="http://www.blogger.com/atom/ns#" term="commons" /><category scheme="http://www.blogger.com/atom/ns#" term="HashCodeBuilder" /><category scheme="http://www.blogger.com/atom/ns#" term="errors" /><category scheme="http://www.blogger.com/atom/ns#" term="Apache" /><category scheme="http://www.blogger.com/atom/ns#" term="Hashing" /><category scheme="http://www.blogger.com/atom/ns#" term="effective" /><title>Java HashCode</title><content type="html">Every Java object has two very important methods i.e. &lt;code&gt;hashCode()&lt;/code&gt; and an &lt;code&gt;equals()&lt;/code&gt; method. These methods are designed to be overridden according to their specific general contract. This article describes why and how to override the &lt;code&gt;hashCode()&lt;/code&gt; method that preserves the contract of HashCode. &lt;br /&gt;
&lt;h3&gt;&lt;p&gt;&lt;a name="N10078"&gt;&lt;span&gt;Contract For HashCode&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;The contract for hashCode says&lt;br /&gt;
&lt;div align="center"&gt;&lt;b&gt;“If two objects are equal, then calling hashCode() on both objects must return the same value”.&lt;/b&gt; &lt;/div&gt;Now the question that should come into your mind is that; is it necessary that the above statement should always be true?&lt;br /&gt;
Consider the fact that we have provided a correct implementation of &lt;code&gt;equal &lt;/code&gt;method for our class, then what would happen if we do not obey the above contract. &lt;br /&gt;
To answer the above question, let us consider the two situations,&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Objects that are equal but return different &lt;code&gt;hashCodes&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Objects that are not equal but return the same &lt;code&gt;hashCode&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;em&gt;&lt;b&gt;Objects that are equal but return different hashCodes&lt;/b&gt;&lt;/em&gt;&lt;br /&gt;
What would happen if the two objects are &lt;code&gt;equal&lt;/code&gt; but return different &lt;code&gt;hashCodes&lt;/code&gt;?  Your code would run perfectly fine. You will never come in trouble unless and until you have not stored your object in a collection like &lt;code&gt;HashSet&lt;/code&gt; or &lt;code&gt;HashMap&lt;/code&gt;. But when you do that, you might get strange problems at runtime.  &lt;br /&gt;
To understand this better, you have to first understand how collection classes such as &lt;code&gt;HashMap&lt;/code&gt; and &lt;code&gt;HashSet&lt;/code&gt; work. These collections classes depend on the fact that the objects that you put as a key in them must obey the above contract. You will get strange and unpredictable results at runtime if you do not obey the contract and try to store them in a collection.&lt;br /&gt;
Consider an example of &lt;code&gt;HashMap&lt;/code&gt;. When you store the values in &lt;code&gt;HashMap&lt;/code&gt;, the values are actually stored in a set of buckets. Each of those buckets has been assigned a number which is use to identify it. When you put a value in the &lt;code&gt;HashMap&lt;/code&gt;, it stores the data in one of those buckets. Which bucket is used depends on the &lt;code&gt;hashCode &lt;/code&gt;that will return by your object. Let’s say, if &lt;code&gt;hashCode()&lt;/code&gt; method return &lt;b&gt;49&lt;/b&gt; for an object, then it gets stored into the bucket &lt;b&gt;49&lt;/b&gt; in the &lt;code&gt;HashMap&lt;/code&gt;.&lt;br /&gt;
Later when you try to check whether that collection contains element or not by invoking &lt;b&gt;&lt;code&gt;Contains(element)&lt;/code&gt; &lt;/b&gt;method, the &lt;code&gt;HashMap &lt;/code&gt;first gets the &lt;code&gt;hashCode &lt;/code&gt;of that “element “. Afterwards it will look into the bucket that corresponds with the &lt;code&gt;hashCode&lt;/code&gt;. If the bucket is empty, then it means we are done and its return false which means the &lt;code&gt;HashMap &lt;/code&gt;does not contain the element.&lt;br /&gt;
If there are one or more objects in the bucket, then it will compare “element” with all other elements in that bucket using your defined &lt;b&gt;&lt;code&gt;equal()&lt;/code&gt; &lt;/b&gt;function.&lt;br /&gt;
&lt;em&gt;&lt;b&gt;Objects that are not equal but return the same hashCode &lt;/b&gt;&lt;/em&gt;&lt;br /&gt;
The &lt;code&gt;hashCode &lt;/code&gt;contract does not say anything about the above statement. Therefore different objects might return the same &lt;code&gt;hashCode &lt;/code&gt;value, but collections like &lt;code&gt;HashMap &lt;/code&gt;will work inefficiently if different objects return the same &lt;code&gt;hashCode &lt;/code&gt;value.&lt;br /&gt;
&lt;h3&gt;&lt;p&gt;&lt;a name="N10079"&gt;&lt;span&gt;Why Buckets&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;The reason why bucket mechanism is used is its efficiency. You can imagine that if all the objects you put in the &lt;code&gt;HashMap &lt;/code&gt;would be stored in to one big list, then you have to compare your input with all the objects in the list when you want to check if a particular element is in the &lt;code&gt;Map&lt;/code&gt;. With the use of buckets, you will now campare only the elements of specific bucket and any bucket usually holds only a small portion of all the elements in the &lt;code&gt;HashMap&lt;/code&gt;.&lt;br /&gt;
&lt;h3&gt;&lt;p&gt;&lt;a name="N10080"&gt;&lt;span&gt;Overriding hashCode Method &lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;Writing a good &lt;code&gt;hashCode()&lt;/code&gt; method is always a tricky task for a new class.&lt;br /&gt;
&lt;em&gt;&lt;b&gt;Return Fixed Value &lt;/b&gt;&lt;/em&gt;&lt;br /&gt;
You can implement your &lt;code&gt;hashCode()&lt;/code&gt; method such that you always return a fix value, for example like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java"&gt;//bad performance
@Override
public int hashCode() {
return 1;
}
&lt;/pre&gt;The above method satisfies all the requirements and is considered legal according to the &lt;code&gt;hash code&lt;/code&gt; contract but it would not be very efficient. If this method is used, all objects will be stored in the same bucket i.e. bucket 1 and when you try to ensure whether the specific object is present in the collection, then it will always have to check the entire content of the collection.  &lt;br /&gt;
On the other hand if you override the &lt;code&gt;hashCode()&lt;/code&gt; method for your class and if the method breaks the contract then calling &lt;code&gt;contains()&lt;/code&gt; method may return false for the element which is present in the collection but in a different bucket.&lt;br /&gt;
&lt;em&gt;&lt;b&gt;Method From Effective Java &lt;/b&gt;&lt;/em&gt;&lt;br /&gt;
Joshua Bloch in Effective Java provides an good guidelines for generating an &lt;code&gt;hashCode()&lt;/code&gt; value&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;1. Store some constant nonzero value; say &lt;b&gt;17&lt;/b&gt;, in an int variable called &lt;b&gt;result&lt;/b&gt;.&lt;/li&gt;

&lt;li&gt;2. For each significant field f in your object (each field taken into account by the &lt;code&gt;equals()&lt;/code&gt;), do the following&lt;/li&gt;
&lt;li&gt;a.  Compute an int &lt;code&gt;hashCode &lt;/code&gt;c for the field:&lt;/li&gt;
&lt;li&gt;i.      If the field is a &lt;code&gt;boolean&lt;/code&gt;, compute &lt;b&gt;c = (f ? 1 : 0).&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;ii.     If the field is a &lt;code&gt;byte&lt;/code&gt;, &lt;code&gt;char&lt;/code&gt;, &lt;code&gt;short&lt;/code&gt;, or &lt;code&gt;int&lt;/code&gt;, compute &lt;b&gt;c = (int) f&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;iii.    If the field is a &lt;code&gt;long&lt;/code&gt;, compute &lt;b&gt;c = (int) (f ^ (f &amp;gt;&amp;gt;&amp;gt; 32))&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;iv.    If the field is a &lt;code&gt;float&lt;/code&gt;, compute &lt;b&gt;c = Float.floatToIntBits(f)&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;v.     If the field is a &lt;code&gt;double&lt;/code&gt;,compute                                                                                                           &lt;b&gt;long l = Double.doubleToLongBits(f)&lt;/b&gt;,&lt;br /&gt;
&lt;b&gt;c = (int)(l ^ (l &amp;gt;&amp;gt;&amp;gt; 32))&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;vi.    If the field is an object reference then &lt;code&gt;equals( )&lt;/code&gt; calls &lt;code&gt;equals( )&lt;/code&gt; for this field. compute&lt;br /&gt;
&lt;b&gt;c =  f.hashCode() &lt;/b&gt;&lt;/li&gt;
&lt;li&gt;vii.   If the field is an &lt;code&gt;array&lt;/code&gt;, treat it as if each element were a separate field.&lt;br /&gt;
That is, compute a &lt;code&gt;hashCode &lt;/code&gt;for each significant element by applying above rules to  each&lt;br /&gt;
element&lt;/li&gt;                            
&lt;li&gt;b.  Combine the &lt;code&gt;hashCode &lt;/code&gt;c computed in step 2.a into result as follows:&lt;b&gt;result = 37 * result + c;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;3. Return result.&lt;/li&gt;

&lt;li&gt;4. Look at the resulting &lt;code&gt;hashCode()&lt;/code&gt; and make sure that &lt;code&gt;equal &lt;/code&gt;instances have equal hash codes.&lt;/li&gt;&lt;/ul&gt;Here is an example of a class that follows the above guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java"&gt;public class HashTest {
private String field1;
private short  field2;
----

@Override
public int hashCode() {
int result = 17;
result = 37*result + field1.hashCode();
result = 37*result + (int)field2;
return result;
}
}
&lt;/pre&gt;You can see that a constant &lt;b&gt;37 &lt;/b&gt;is chosen. The purpose to choose this number is that it is a &lt;b&gt;prime number&lt;/b&gt;. We can choose any other prime number. Using prime number the objects will be distributed better over the buckets. I encourage user to explore the topic further by checking out other resources.&lt;br /&gt;
&lt;em&gt;&lt;b&gt;Apache HashCodeBuilder &lt;/b&gt;&lt;/em&gt;&lt;br /&gt;
Writing a good &lt;code&gt;hashCode()&lt;/code&gt; method is not always easy. Since it can be difficult to implement &lt;code&gt;hashCode()&lt;/code&gt; correctly, it would be helpful if we have some reusable implementations of these.  &lt;br /&gt;
The &lt;b&gt;Jakarta-Commons&lt;/b&gt; &lt;code&gt;org.apache.commons.lang.builder &lt;/code&gt;package is providing a class named &lt;code&gt;HashCodeBuilder&lt;/code&gt; which is designed to help implementing &lt;code&gt;hashCode()&lt;/code&gt; method. Usually developers struggle hard with implementing &lt;code&gt;hashCode()&lt;/code&gt; method and this class aims to simplify the process.&lt;br /&gt;
Here is how you would implement a &lt;code&gt;hashCode &lt;/code&gt;algorithm for our above class&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java"&gt;public class HashTest {
private String field1;
private short  field2;
----

@Override
public int hashCode() {
return new HashCodeBuilder(83, 7)
.append(field1)
.append(field2)
.toHashCode();
}
}
&lt;/pre&gt;Note that the two numbers for the constructor are simply two different, non-zero, odd numbers - these numbers help to avoid collisions in the &lt;code"&gt;hashCode &lt;/code&gt;value across objects.&lt;br /&gt;
If required, the superclass &lt;code&gt;hashCode()&lt;/code&gt; can be added using &lt;b&gt;&lt;code&gt;appendSuper(int)&lt;/code&gt;&lt;/b&gt;.&lt;br /&gt;
You can see how easy it is to override &lt;code&gt;HashCode()&lt;/code&gt; using Apache &lt;code&gt;HashCodeBuilder&lt;/code&gt;.&lt;br /&gt;
&lt;h3&gt;&lt;p&gt;&lt;a name="N10081"&gt;&lt;span&gt;Mutable Object As Key&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;It is a general advice that you should use &lt;code&gt;immutable object&lt;/code&gt; as a key in a Collection. &lt;code&gt;HashCode &lt;/code&gt;work best when calculated from immutable data. If you use &lt;code&gt;Mutable object&lt;/code&gt; as key and change the state of the object so that the &lt;code&gt;hashCode &lt;/code&gt;changes, then the store object will be in the wrong bucket in the Collection  &lt;br /&gt;
The most important thing you should consider while implementing &lt;code&gt;hashCode()&lt;/code&gt; is that regardless of when this method is called, it should produces the same value for a particular object every time when it is called. If you have a scenario like the object produces one &lt;code&gt;hashCode()&lt;/code&gt; value when  it is &lt;b&gt;&lt;code&gt;put()&lt;/code&gt;&lt;/b&gt; in to a &lt;code&gt;HaspMap &lt;/code&gt;and produces another value during a &lt;b&gt;&lt;code&gt;get()&lt;/code&gt;&lt;/b&gt;, in that case you would not be able to retrieve that object. Therefore, if you &lt;code&gt;hashCode()&lt;/code&gt; depends on mutable data in the object, then made changing those data will surely produce a different key by generating a different &lt;code&gt;hashCode()&lt;/code&gt;.&lt;br /&gt;
Look at the example below&lt;br /&gt;
&lt;pre class="brush: java"&gt;public class Employee {

private String name;
private int age;

public Employee() {
}

public Employee(String name, int age) {
this.name = name;
this.age = age;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public int getAge() {
return age;
}

public void setAge(int age) {
this.age = age;
}

@Override
public boolean equals(Object obj) {
//Remember: Some Java gurus recommend you avoid using instanceof
if (obj instanceof Employee) {
Employee emp = (Employee)obj;
return (emp.name == name &amp;amp;&amp;amp; emp.age == age);
}
return false;
}

@Override
public int hashCode() {
return name.length() + age;
}

public static void main(String[] args) {
Employee e = new Employee("muhammad", 24);
Map&lt;object,&gt; m = new HashMap&lt;object,&gt;(); m.put(e, "Muhammad Ali Khojaye");  // getting output System.out.println(m.get(e));  e.name = "abid";  // it fails to get System.out.println(m.get(e));  e.name = "amirrana";  // it fails again System.out.println(m.get(new Employee("muhammad", 24))); } } &lt;/object,&gt;&lt;/object,&gt;&lt;/pre&gt;So you can see in the above examples that how we are getting some unpredictable results.&lt;br /&gt;
You can easily fix the above by overriding the &lt;code&gt;hashCode()&lt;/code&gt; using either &lt;b&gt;Joshu Recipe&lt;/b&gt; or using&lt;code&gt; HashCodeBuilder &lt;/code&gt;class.&lt;br /&gt;
Here is an example,&lt;br /&gt;
&lt;em&gt;&lt;b&gt;Joshu Recommendation &lt;/b&gt;&lt;/em&gt;&lt;br /&gt;
&lt;pre class="brush: java"&gt;@Override
public int hashCode() {
int result = 17;
result = 37*result + name.hashCode();
result = 37*result + age;
return result;
}
&lt;/pre&gt;&lt;br /&gt;
&lt;em&gt;&lt;b&gt;Using HashCodeBuilder&lt;br /&gt;
&lt;/b&gt;&lt;/em&gt;&lt;br /&gt;
&lt;pre class="brush: java"&gt;@Override
public int hashCode() {
return new HashCodeBuilder(83, 7)
.append(name)
.append(age)
.toHashCode();
}
&lt;/pre&gt;&lt;h3&gt;&lt;p&gt;&lt;a name="N10082"&gt;&lt;span&gt;Another Example of Mutable Field as Key&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;Let consider the example&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java"&gt;public class HashTest {
private int mutableField;
private final int immutableField;

public HashTest(int mutableField, int immutableField) {
this.mutableField = mutableField;
this.immutableField = immutableField;
}

public void setMutableField(int mutableField) {
this.mutableField = mutableField;
}

@Override
public boolean equals(Object o) {
if(o instanceof HashTest) {
return (mutableField == ((HashTest)o).mutableField)
&amp;amp;&amp;amp; (immutableField ==  ((HashTest)o).immutableField);
}else {
return false;
}              
}

@Override
public int hashCode() {
int result = 17;
result = 37 * result + this.mutableField;
result = 37 * result + this.immutableField;
return result;
}

public static void main(String[] args) {
Set&lt;hashtest&gt; set = new HashSet&lt;hashtest&gt;();
HashTest obj = new HashTest(6622458, 626304);
set.add(obj);                 
System.out.println(set.contains(obj));     
obj.setMutableField(3867602);        
System.out.println(set.contains(obj));
}
}
&lt;/hashtest&gt;&lt;/hashtest&gt;&lt;/pre&gt;After changing mutableField, the computed &lt;code&gt;hashCode &lt;/code&gt;is no longer pointing to the old bucket and the &lt;code&gt;contains()&lt;/code&gt; returns false.  &lt;br /&gt;
We can tackle such situation using either of these methods&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;code&gt;Hashcode &lt;/code&gt;is best when calculated from &lt;code&gt;immutable data&lt;/code&gt;; therefore ensure that only immutable object would be used as key with Collections.&lt;/li&gt;
&lt;li&gt;Implement the &lt;code&gt;hashCode()&lt;/code&gt; using our first technique i.e. return a constant value but you must aware that it would kills all those advantage of bucket mechanism.&lt;/li&gt;
&lt;li&gt;If you need mutable fields included in the &lt;code&gt;hashCode &lt;/code&gt;method then you can calculate and store the hash value when the object is created and whenever you update mutable field, you must first remove it from the collection(set/map) and then add it back to the collection after updating it. &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;&lt;p&gt;&lt;a name="N10085"&gt;&lt;span&gt;References and More Information&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://java.sun.com/docs/books/effective/"&gt;Effective Java&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html"&gt;Object Class&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://commons.apache.org/lang/apidocs/org/apache/commons/lang/builder/HashCodeBuilder.html" title="JDK 6 API"&gt;HashCodeBuilder&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.javaranch.com/"&gt;http://www.javaranch.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel="replies" type="application/atom+xml" href="http://muhammadkhojaye.blogspot.com/feeds/2357191812819801497/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://muhammadkhojaye.blogspot.com/2010/02/java-hashing.html#comment-form" title="15 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/2357191812819801497?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/2357191812819801497?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MuhammadKhojayesBlog/~3/aLH1n2YjxX8/java-hashing.html" title="Java HashCode" /><author><name>Muhammad Khojaye</name><uri>http://www.blogger.com/profile/00894488663979159734</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="21" src="http://1.bp.blogspot.com/_ozAUGbBR948/S8np6kmXerI/AAAAAAAAABE/I9goBiE4tT4/S220/(22).JPG" /></author><thr:total>15</thr:total><feedburner:origLink>http://muhammadkhojaye.blogspot.com/2010/02/java-hashing.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YNSHY_eSp7ImA9WxBUEko.&quot;"><id>tag:blogger.com,1999:blog-3234207576654915154.post-9093781297242427786</id><published>2010-02-04T22:51:00.000-08:00</published><updated>2010-02-27T04:53:19.841-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-27T04:53:19.841-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Class Design" /><category scheme="http://www.blogger.com/atom/ns#" term="Marker Interface" /><category scheme="http://www.blogger.com/atom/ns#" term="Annotation" /><category scheme="http://www.blogger.com/atom/ns#" term="Interface" /><category scheme="http://www.blogger.com/atom/ns#" term="label interface" /><title>Are Marker Interfaces Dead?</title><content type="html">&lt;p style="font-family: arial;"&gt;In earlier versions of Java, &lt;a href="http://en.wikipedia.org/wiki/Marker_interface_pattern"&gt;Marker Interfaces&lt;/a&gt; were the only way to declare metadata about a class. With the advent of &lt;a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html"&gt;annotation&lt;/a&gt; in Java 5, it is consider that marker interfaces have now no place. They can be completely replaced by Annotations, which allow for a very flexible metadata capability. Everything that can be done with marker interfaces can be done instead with annotations. In fact, it's now recommended that the &lt;em&gt;marker interface pattern&lt;/em&gt; should not be used anymore. Annotations can have parameters of various kinds, and they're much more flexible. We can also see that the examples used in Sun API’s are rather old and that no new ones have been added since after introduce of Annotation. In this post, we will see whether Marker Interfaces can still be used for any reasons.&lt;/p&gt;&lt;h2 style="font-family: arial;"&gt;Marker Interface&lt;/h2&gt;&lt;p style="font-family: arial;"&gt;A marker interface is an interface with no method declarations. They just tell the compiler that the objects of the classes implementing the interfaces with no defined methods need to be treated differently. These Marker interfaces are used by other code to test for permission to do something.&lt;/p&gt;&lt;p style="font-family: arial;"&gt;Some well-known examples are&lt;/p&gt;&lt;p style="font-family: arial;"&gt;&lt;em&gt;java.io.Serializable&lt;/em&gt; - object implement it can be serialized using ObjectOutputStream.&lt;br /&gt;&lt;em&gt;java.lang.Clonable&lt;/em&gt; - objects clone method may be called&lt;br /&gt;&lt;em&gt;java.util.RandomAccess&lt;/em&gt;- support fast (generally constant time) random access &lt;/p&gt;&lt;p style="font-family: arial;"&gt;They are also known as &lt;strong&gt;tag interfaces&lt;/strong&gt; since they tag all the derived classes into a category based on their purpose&lt;/p&gt;&lt;h2 style="font-family: arial;"&gt;Interface and Marker Interfaces&lt;/h2&gt;&lt;p style="font-family: arial;"&gt;Interface in general defines a contract. They represent a public commitment and when implement form a contract between the class and the outside world. On the other hand, an empty interface does not define any members, and as such, does not define a contract that can be implemented.&lt;/p&gt;&lt;p style="font-family: arial;"&gt;Normally, when a class implements an interface, it tells something about the instances of the class.  It represent an &lt;em&gt;"is a"&lt;/em&gt; relationship that exist in inheritance. For example, when a class implements List, then object &lt;strong&gt;is a&lt;/strong&gt; List.&lt;/p&gt;&lt;p style="font-family: arial;"&gt;With marker interfaces, this inheritance mechanism usually does not obey. For example, if class implements the marker interface &lt;em&gt;Serializable&lt;/em&gt;, then instead of saying that the object is a Serializable, we say that the object has a property i.e. it is Serializable.&lt;/p&gt;&lt;h2 style="font-family: arial;"&gt;Should Avoid Marker Interfaces?&lt;/h2&gt;&lt;p style="font-family: arial;"&gt;One common problem occurs while using marker interfaces is that when a class implements them, all of its subclasses inherit them as well.  Since you cannot unimplement an interface in Java, therefore a subclass that does not want to treat differently will still be marked as Marker. For example, Foo implements &lt;em&gt;Serializable&lt;/em&gt;, any subclass Bar etc does too as well.&lt;/p&gt;&lt;p style="font-family: arial;"&gt;Moreover, there are places in the Sun API’s where such interfaces have been used for messy and varying purposes. Consider &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/Cloneable.html"&gt;Cloneable&lt;/a&gt;  Marker Interface. If the operation is not supported by an object, it can throw an exception when such operation is attempted, like &lt;em&gt;Collection.remove&lt;/em&gt; does when the collection does not support the remove operation (eg, unmodifiable collection) but a class claiming to implement &lt;em&gt;Cloneable&lt;/em&gt; and throwing &lt;em&gt;CloneNotSupportedException&lt;/em&gt; from the &lt;em&gt;clone()&lt;/em&gt; method wouldn't be a very friendly thing to do.&lt;/p&gt;&lt;p style="font-family: arial;"&gt;Many developers consider it as broken interface. Ken Arnold and Bill Venners also discussed it in &lt;a href="http://www.artima.com/intv/issues3.html"&gt;Java Design Issues.&lt;/a&gt; As Ken Arnold said,&lt;/p&gt;&lt;p style="font-family: arial;"&gt;&lt;/p&gt;&lt;blockquote&gt;If I were to be God at this point, and many people are probably glad I am not, I would say deprecate Cloneable and have a Copyable, because Cloneable has problems. Besides the fact that it's misspelled, Cloneable doesn't contain the clone method. That means you can't test if something is an instance of Cloneable, cast it to Cloneable, and invoke clone. You have to use reflection again, which is awful. That is only one problem, but one I'd certainly solve.&lt;/blockquote&gt;&lt;br /&gt;Sun has also reported it as Bug which can refer at &lt;a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4098033"&gt;http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4098033&lt;/a&gt;&lt;p&gt;&lt;/p&gt;&lt;h2 style="font-family: arial;"&gt;Are Marker Interfaces end?&lt;/h2&gt;&lt;p style="font-family: arial;"&gt;We usually hear that Marker Interface is now obsolete and it has no place. But, there are situations where they can be handy over using annotations.&lt;/p&gt;&lt;p style="font-family: arial;"&gt;Annotations have to be checked at runtime using reflection. Empty interfaces can be checked at compile-time using the type-system in the compiler. Compile-time checking can be one of convincing reason to use such interfaces.&lt;/p&gt;&lt;p style="font-family: arial;"&gt;Consider the example below,&lt;/p&gt;&lt;pre class="brush: java"&gt;@interface&lt;br /&gt;HasTag {&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@HasTag&lt;br /&gt;public class ClasswithTag {&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void performAction(Object obj){&lt;br /&gt;    if (!obj.getClass().&lt;br /&gt;              isAnnotationPresent(HasTag.class)) {&lt;br /&gt;        throw new IllegalArgumentException(&lt;br /&gt;           "cannot perform action...");&lt;br /&gt;    }&lt;br /&gt;    else {&lt;br /&gt;     //do stuff as require&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;p style="font-family: arial;"&gt;One problem with this approach is that the check for the custom attribute can occur only at runtime. Sometimes, it is very important that the check for the marker be done at compile-time. Let me refine the above example to use Marker.&lt;/p&gt;&lt;pre class="brush: java"&gt;interface HasTag {&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class ClassWithTag implements HasTag {&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void performAction(HasTag ct){&lt;br /&gt; //do stuff as require&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p style="font-family: arial;"&gt;Similarly, in the case of the &lt;em&gt;Serializable&lt;/em&gt; marker interface, the &lt;em&gt;ObjectOutputStream.write(Object) &lt;/em&gt;method would fail at runtime if its argument does not implement the Interface which would not be the case, if ObjectOutputStream had a writeObject(Serializable) method instead.&lt;/p&gt;&lt;p style="font-family: arial;"&gt;Marker Interfaces can also be well integrated in javadoc where one can promptly see who implements &lt;em&gt;&lt;marker&gt;&lt;/marker&gt;&lt;/em&gt; or not by just look it up and see the list of implementing classes.&lt;/p&gt;&lt;p style="font-family: arial;"&gt;Moreover, Joshua in Effective Java also recommends using Marker interface to define type which can result in the very real benefit of compile-time type checking.&lt;/p&gt;&lt;pre style="font-family: arial;"&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p style="font-family: arial;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel="replies" type="application/atom+xml" href="http://muhammadkhojaye.blogspot.com/feeds/9093781297242427786/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://muhammadkhojaye.blogspot.com/2010/02/are-marker-interfaces-dead.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/9093781297242427786?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3234207576654915154/posts/default/9093781297242427786?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MuhammadKhojayesBlog/~3/QWeBiUIqnNA/are-marker-interfaces-dead.html" title="Are Marker Interfaces Dead?" /><author><name>Muhammad Khojaye</name><uri>http://www.blogger.com/profile/00894488663979159734</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="21" src="http://1.bp.blogspot.com/_ozAUGbBR948/S8np6kmXerI/AAAAAAAAABE/I9goBiE4tT4/S220/(22).JPG" /></author><thr:total>1</thr:total><feedburner:origLink>http://muhammadkhojaye.blogspot.com/2010/02/are-marker-interfaces-dead.html</feedburner:origLink></entry></feed>
