Monday, August 25, 2014

Java Bean to XML - Encode / Decode

Encoding and decoding Java Bean to XML using java.beans.XMLEncoder and java.beans.XMLDecoder.


Friday, August 22, 2014

CXF code first webservice in Apache Karaf/jBoss Fuse

A CXF Code first web-service in Apache Karaf/jBoss Fuse.


Maven project Structure :





















Interface



Implementation Class



Blueprint


Maven (pom.xml)

Tuesday, August 19, 2014

Tuesday, November 5, 2013

Suppressing PMD & Findbugs rules

PMD 


PMD rules can be suppress by using the @SuppressWarnings("PMD") annotation.
A specific rule can also be set on the annotation @SuppressWarnings("PMD.[rule]").
For ex.


A list of rules supported by PMD can be found at : PMD Rules

Findbugs

To use the Findbugs @SupressWarnings, you've to include the following dependency -

<dependency>
 <groupId>com.google.code.findbugs</groupId>
 <artifactId>annotations</artifactId>
 <version>2.0.2</version>
</dependency>

Note: The @edu.umd.cs.findbugs.annotations.SuppressWarnings annotation is different from @java.lang.SupressWarnings annotation.

Usage :

@SupressWarnings("RULE")
A list of bugs can be found at : Findbugs