I had an opportunity to take a look at this book in a different way – I was a Java and Drools developer for years already and wanted to see what I was missing. When I found this book, like all other books, I just turned over the pages quickly to find out what was in it or is it even worth spending your time in. I was surprised to see the amount of real world coding examples this book contained – something most developers would be happy to just copy and run as a part of their quick learning. It had a nicely structured chapters, clean format, explanations as needed, charts and diagrams to make your learning easy.As I started cruising through the chapters, I saw many alternate styles that I could have used while writing the rules.
I must tell you The content in this book is huge – it has over 300 pages – but the reading flows very well. You could be reading 3,4,5 chapters in one seating and feel that pride of having learnt something. Apparently the author has done a great job in presenting the book in a style that would definitely lower the learning curve. I bet the new developers or the developers who have had used this Drools with JBoss in the past would equally find this book worth looking at.
There are 12 chapters in this book. Most developers would be able to learn in a short amount of time what Drools is, how to write the basic rules, how business rules are validated, ho you can do a transformation of complex data using Drools. There is even a chapter that focuses on making the rules Human Readable. I was surprised with this chapter, because most of the coding book don’t normally talk about coding in a way business people can understand if they had opportunity to look at.
The following is a list of most of the valid @suppresswarning annotation parameters in Java for Eclipse and IBM RAD IDE. The right column shows what those java annotation parameters are used for.
interface non-inherited method compatibility
local variable hiding another variable
hidden catch block
to suppress warnings relative to non-nls string literals
assignment with no effect
to suppress warnings relative to null analysis
missing null check
missing @Override annotation
assignment to a parameter
attempt to override package-default method
usage a of raw type (instead of a parametrized type)
to suppress warnings relative to usage of discouraged or forbidden references
unnecessary semicolon or empty statement
to suppress warnings relative to missing serialVersionUID field for a serializable class
constructor or setter parameter hiding another field
to suppress warnings relative to incorrect static access
if a non static receiver is used to get a static field or call a static method
overriding a method without making a super invocation
to suppress warnings relative to unoptimized access from inner classes
enable support for tasks tags in source code
type parameter hiding another type
to suppress warnings relative to unchecked operations
unnecessary else clause
to suppress warnings relative to field access unqualified
to suppress warnings relative to unused code
unused method argument
unused import reference
unused local variable
unused private member declaration
unused declared thrown exception
unnecessary cast/instanceof operation
varargs argument need explicit cast
unhandled warning token in @SuppressWarnings
Here is an usage example. As you can see, the piece of code below does not use any annotations and the code has a yellow underline in the method signature. If you hover around the icon on the left bar of the IDE where there will be warning sign, you will notice that the Eclipse IDE has issued warning saying that this method is never called in the class.
But if you put the annotation @SuppressWarning(“unused”), we specifically tell the IDE to ignore the usused methods by suppressing the warnigns. Here is the code after the annotation has been added. Code looks clean, no more annoying warning underline !