A good guide to handle such things is in the book from Uncle Bob, called "Clean Code". In your case I'd say:
- put the string concatenations into a method (and use
StringBuilder
) - convert an
else { if (condition) }
to anelse if (condition)
- consider to put the
companyType == CompanyBean.PP_TYPE && !realTraffic.isSkipOther()
in a separate method, since it appears to be some kind of business logic, which might be clearer for the reader if being put in a method calledif (isCompanySkippedOver(companyType, realTraffic)
consider to invert
if(realTraffic.getPvkp() != null)
toif(realTraffic.getPvkp() == null) {return;}
to reduce block indentation.