When I heard the JavaPosse interview about Groovy I became really interested in it. The fact that it offers a scripting language based on the JVM and that it can be seamlessly integrated with Java fascinated me.
So I decided to buy the Groovy in Action book and try it out.
This is my first attempt at something that might become useful later:
def foundtypes = [:]
def sum = 0
def stats = ""
bugs = new XmlSlurper().parse(new File("/home/ds/findbugs.xml"));
bugs.BugInstance.findAll { instance ->
instance.-AT-category =~ 'CORRECTNESS|BAD_PRACTICE|MT_CORRECTNESS'
}.each { instance ->
type = instance.@type-DOT-toString()
foundtypes[type] = foundtypes.get(type,0) + 1
}
foundtypes.each { sum += it.value }
println "Found ${foundtypes.size()} …[Read more]