PMD Results

The following document contains the results of PMD 4.2.5.

Files

javax/jmdns/JmmDNS.java

ViolationLine
Avoid if (x != y) ..; else ..;91
Singleton is not thread safe100 - 106

javax/jmdns/NetworkTopologyDiscovery.java

ViolationLine
Avoid if (x != y) ..; else ..;114
Singleton is not thread safe123 - 129

javax/jmdns/impl/DNSCache.java

ViolationLine
Avoid if (x != y) ..; else ..;163
Overridable method 'getKey' called during object construction173
Overridable method 'getValue' called during object construction174
Avoid if (x != y) ..; else ..;183
Use block level rather than method level synchronization236 - 250
Avoid if (x != y) ..; else ..;241 - 248
Avoid if (x != y) ..; else ..;264
Avoid if (x != y) ..; else ..;300
Avoid if (x != y) ..; else ..;302 - 310
Avoid if (x != y) ..; else ..;323 - 327
Use block level rather than method level synchronization347 - 355
Use block level rather than method level synchronization363 - 371
Avoid if (x != y) ..; else ..;365 - 369
When doing a String.toLowerCase()/toUpperCase() call, use a Locale374
Avoid if (x != y) ..; else ..;374
Use block level rather than method level synchronization383 - 397
Use block level rather than method level synchronization407 - 419
Use block level rather than method level synchronization429 - 443
Avoid if (x != y) ..; else ..;431 - 441
Use block level rather than method level synchronization451 - 473
Avoid if (x != y) ..; else ..;457 - 461
Avoid if (x != y) ..; else ..;464 - 468
Use block level rather than method level synchronization481 - 494
Use block level rather than method level synchronization504 - 527
Avoid if (x != y) ..; else ..;510 - 514
Avoid if (x != y) ..; else ..;518 - 522
Use block level rather than method level synchronization533 - 541

javax/jmdns/impl/DNSEntry.java

ViolationLine
Overridable method 'getName' called during object construction47
Avoid if (x != y) ..; else ..;97
Avoid if (x != y) ..; else ..;106
Avoid if (x != y) ..; else ..;113
Avoid if (x != y) ..; else ..;122
Avoid if (x != y) ..; else ..;129
Avoid if (x != y) ..; else ..;136
New exception is thrown in catch block, original stack trace may be lost241
An empty method in an abstract class should be abstract instead292 - 294

javax/jmdns/impl/DNSIncoming.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers29
The Logger variable declaration does not contain the static and final modifiers36
Use block level rather than method level synchronization110 - 112
New exception is thrown in catch block, original stack trace may be lost241
Avoid if (x != y) ..; else ..;404
Avoid if (x != y) ..; else ..;404
The String literal "\n\t" appears 4 times in this file; the first occurrence is on line 498498

javax/jmdns/impl/DNSMessage.java

ViolationLine
This abstract class does not have any abstract methods19 - 307
Avoid appending characters as strings in StringBuffer.append.226
Avoid appending characters as strings in StringBuffer.append.230
Avoid appending characters as strings in StringBuffer.append.235
Avoid appending characters as strings in StringBuffer.append.240
Avoid appending characters as strings in StringBuffer.append.245

javax/jmdns/impl/DNSOutgoing.java

ViolationLine
The String literal "message full" appears 4 times in this file; the first occurrence is on line 250250
These nested if statements could be combined276 - 286
StringBuffer constructor is initialized with size 16, but has at least 18 characters appended.377
The String literal "\n\t" appears 4 times in this file; the first occurrence is on line 413413
Avoid appending characters as strings in StringBuffer.append.440

javax/jmdns/impl/DNSQuestion.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers25
Avoid if (x != y) ..; else ..;107
Deeply nested if..then statements are hard to read109 - 111
Deeply nested if..then statements are hard to read112 - 114
Avoid empty if statements117 - 119

javax/jmdns/impl/DNSRecord.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers33
Ensure you override both equals() and hashCode()56
Avoid empty if statements188 - 190
The Logger variable declaration does not contain the static and final modifiers264
An empty method in an abstract class should be abstract instead306 - 308
Avoid if (x != y) ..; else ..;417
Avoid if (x != y) ..; else ..;529
Avoid calling toString() on String objects; this is unnecessary.529
The Logger variable declaration does not contain the static and final modifiers640
Avoid empty catch blocks679 - 681
These nested if statements could be combined797 - 800

javax/jmdns/impl/DNSStatefulObject.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers33
The Logger variable declaration does not contain the static and final modifiers105
Avoid if (x != y) ..; else ..;412

javax/jmdns/impl/DNSTaskStarter.java

ViolationLine
Avoid if (x != y) ..; else ..;101
Singleton is not thread safe110 - 116
Use block level rather than method level synchronization195 - 199
Use block level rather than method level synchronization206 - 209
Use block level rather than method level synchronization216 - 219
Use block level rather than method level synchronization226 - 229
Use block level rather than method level synchronization236 - 239
Use block level rather than method level synchronization246 - 249
Use block level rather than method level synchronization256 - 259

javax/jmdns/impl/HostInfo.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers33
Avoid if (x != y) ..; else ..;73 - 84
Use block level rather than method level synchronization169 - 175
A switch statement does not contain a break199 - 206
A switch statement does not contain a break225 - 232
Avoid if (x != y) ..; else ..;259
Avoid if (x != y) ..; else ..;261
Avoid if (x != y) ..; else ..;263

javax/jmdns/impl/JmDNSImpl.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers57
Avoid if (x != y) ..; else ..;127
When doing a String.toLowerCase()/toUpperCase() call, use a Locale128
When doing a String.toLowerCase()/toUpperCase() call, use a Locale233
System.out.print is used373
System.out.print is used374
System.out.print is used376
System.out.print is used378
System.out.print is used380
Avoid if (x != y) ..; else ..;408
Overridable method 'getLocalHost' called during object construction420
Overridable method 'startProber' called during object construction421
Overridable method 'startReaper' called during object construction423
Avoid empty catch blocks477 - 479
When doing a String.toLowerCase()/toUpperCase() call, use a Locale733
These nested if statements could be combined862 - 876
When doing a String.toLowerCase()/toUpperCase() call, use a Locale915
These nested if statements could be combined919 - 922
These nested if statements could be combined939 - 943
When doing a String.toLowerCase()/toUpperCase() call, use a Locale959
Avoid if (x != y) ..; else ..;983 - 987
Avoid if (x != y) ..; else ..;1021 - 1032
When doing a String.toLowerCase()/toUpperCase() call, use a Locale1081
When doing a String.toLowerCase()/toUpperCase() call, use a Locale1085
When doing a String.toLowerCase()/toUpperCase() call, use a Locale1085
When doing a String.toLowerCase()/toUpperCase() call, use a Locale1085
Using equalsIgnoreCase() is cleaner than using toUpperCase/toLowerCase().equals().1085
Use equals() to compare object references.1156
Avoid if (x != y) ..; else ..;1267 - 1273
Avoid if (x != y) ..; else ..;1341 - 1373
Avoid if (x != y) ..; else ..;1449 - 1457
Use equals() to compare object references.1476
System.out.print is used1670
System.out.print is used1845
When doing a String.toLowerCase()/toUpperCase() call, use a Locale1916
Avoid if (x != y) ..; else ..;1935
Avoid if (x != y) ..; else ..;2036
Avoid if (x != y) ..; else ..;2038 - 2042
When doing a String.toLowerCase()/toUpperCase() call, use a Locale2138
When doing a String.toLowerCase()/toUpperCase() call, use a Locale2139

javax/jmdns/impl/JmmDNSImpl.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers42
Avoid empty catch blocks98 - 100
Avoid if (x != y) ..; else ..;308 - 312
The Logger variable declaration does not contain the static and final modifiers537

javax/jmdns/impl/ListenerStatus.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers27
Use block level rather than method level synchronization92 - 114
Avoid if (x != y) ..; else ..;97 - 109
The Logger variable declaration does not contain the static and final modifiers154

javax/jmdns/impl/NameRegister.java

ViolationLine
All methods are static. Consider using Singleton instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.95 - 128
Singleton is not thread safe122 - 124

javax/jmdns/impl/NetworkTopologyDiscoveryImpl.java

ViolationLine
Avoid empty catch blocks92 - 94
Avoid empty catch blocks101 - 103

javax/jmdns/impl/ServiceInfoImpl.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers43
Deeply nested if..then statements are hard to read95 - 100
Overriding method merely calls super110 - 112
Overridable method 'setNeedTextAnnouncing' called during object construction198
When doing a String.toLowerCase()/toUpperCase() call, use a Locale250
Deeply nested if..then statements are hard to read274 - 277
When doing a String.toLowerCase()/toUpperCase() call, use a Locale288
When doing a String.toLowerCase()/toUpperCase() call, use a Locale294
When doing a String.toLowerCase()/toUpperCase() call, use a Locale389
Avoid if (x != y) ..; else ..;397
Avoid if (x != y) ..; else ..;442
Use block level rather than method level synchronization671 - 673
Use block level rather than method level synchronization679 - 688
Avoid if (x != y) ..; else ..;696
Avoid if (x != y) ..; else ..;705
Avoid if (x != y) ..; else ..;713
Avoid if (x != y) ..; else ..;721
Avoid if (x != y) ..; else ..;729
Use block level rather than method level synchronization815 - 855
Avoid if (x != y) ..; else ..;854
Use block level rather than method level synchronization941 - 944
Substitute calls to size() == 0 (or size() != 0) with calls to isEmpty()947
Substitute calls to size() == 0 (or size() != 0) with calls to isEmpty()947
Avoid if (x != y) ..; else ..;1176 - 1183
Avoid empty if statements1239 - 1241
Avoid if (x != y) ..; else ..;1257

javax/jmdns/impl/SocketListener.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers18
Avoid if (x != y) ..; else ..;29

javax/jmdns/impl/constants/DNSConstants.java

ViolationLine
Do not hard code IPv4 or IPv6 addresses, even 127.0.0.1 !16

javax/jmdns/impl/constants/DNSRecordClass.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers44
When doing a String.toLowerCase()/toUpperCase() call, use a Locale111

javax/jmdns/impl/constants/DNSRecordType.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers251
When doing a String.toLowerCase()/toUpperCase() call, use a Locale286

javax/jmdns/impl/constants/DNSState.java

ViolationLine
A switch statement does not contain a break128 - 149

javax/jmdns/impl/tasks/RecordReaper.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers18
Avoid if (x != y) ..; else ..;33

javax/jmdns/impl/tasks/Responder.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers24
Avoid if (x != y) ..; else ..;48
Deeply nested if..then statements are hard to read124 - 126
Deeply nested if..then statements are hard to read132 - 134
Deeply nested if..then statements are hard to read138 - 140
Deeply nested if..then statements are hard to read143 - 146
Deeply nested if..then statements are hard to read148

javax/jmdns/impl/tasks/resolver/DNSResolverTask.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers20

javax/jmdns/impl/tasks/resolver/ServiceInfoResolver.java

ViolationLine
Avoid if (x != y) ..; else ..;39
Avoid if (x != y) ..; else ..;99

javax/jmdns/impl/tasks/resolver/ServiceResolver.java

ViolationLine
Avoid if (x != y) ..; else ..;38

javax/jmdns/impl/tasks/resolver/TypeResolver.java

ViolationLine
Avoid if (x != y) ..; else ..;40

javax/jmdns/impl/tasks/state/Announcer.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers25
Avoid if (x != y) ..; else ..;40

javax/jmdns/impl/tasks/state/Canceler.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers23
Avoid if (x != y) ..; else ..;38

javax/jmdns/impl/tasks/state/DNSStateTask.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers25
Avoid if (x != y) ..; else ..;129 - 142

javax/jmdns/impl/tasks/state/Prober.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers28
Avoid if (x != y) ..; else ..;43

javax/jmdns/impl/tasks/state/Renewer.java

ViolationLine
The Logger variable declaration does not contain the static and final modifiers23
Avoid if (x != y) ..; else ..;38