Skip to content

How to suppress violations in PMD?

When I run a PMD analysis I receive violation: Each class should declare at least one constructor This violation is on a Spring controller. This controller is instantiated by Spring, so I shouldn’t need to invoke this class. What is recommended way of ignoring this violation? According to this doc can u…

Logging JSON-RPC calls using jsonrpc4j

I’m sure that if you have used jsonrpc4j (outside a spring container) you will recognise the following standard pattern. I am trying to create a log file containing all the JSON requests and JSON responses. i.e. I’d like to log the incoming JSON RPC request before it is deserialised and log the ou…

Java “”(” expected” compiler error

I’m a beginner in Java and after a few time of studying this language by books, I decided to write a simple program that “encrypts” a string by replacing numbers with letters and vice versa. It is not finished yet and has some considerable restrictions, but it should work as is. The code: It…

Java 8: Lambda with variable arguments

I am looking for a way to invoke multiple argument methods but using a lambda construct. In the documentation it is said that lambda is only usable if it can map to a functional interface. I want to do something like: Is there any way one can do this elegantly without defining 10 interfaces, one for each argu…