PMD Results

The following document contains the results of PMD 4.3.

Files

goldengate/common/command/exception/CommandAbstractException.java

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

goldengate/common/command/ReplyCode.java

ViolationLine
Avoid empty catch blocks324 - 326

goldengate/common/cpu/GgConstraintLimitHandler.java

ViolationLine
These nested if statements could be combined212 - 215
Avoid instantiation through private constructors from outside of the constructor's class.380
Avoid instantiation through private constructors from outside of the constructor's class.406

goldengate/common/crypto/DynamicKeyManager.java

ViolationLine
Avoid empty catch blocks106 - 107
Avoid empty catch blocks143 - 144

goldengate/common/crypto/KeyObject.java

ViolationLine
Document empty constructor75 - 76
Avoid if (x != y) ..; else ..;369 - 372
Avoid empty catch blocks373 - 374

goldengate/common/crypto/ssl/GgSecureKeyStore.java

ViolationLine
Overridable method 'getKeyStorePassword' called during object construction82
Overridable method 'initKeyManagerFactory' called during object construction96
Overridable method 'initKeyStore' called during object construction107
Overridable method 'initKeyStore' called during object construction123
Avoid if (x != y) ..; else ..;125 - 129
Overridable method 'initTrustStore' called during object construction126
Overridable method 'initEmptyTrustStore' called during object construction128
Avoid empty catch blocks168 - 169
Avoid empty catch blocks258 - 259
Avoid empty catch blocks296 - 297
Avoid empty catch blocks410 - 411

goldengate/common/crypto/ssl/GgSslContextFactory.java

ViolationLine
Avoid if (x != y) ..; else ..;187 - 191

goldengate/common/database/data/AbstractDbData.java

ViolationLine
Ensure that resources like this ResultSet object are closed after use497
Ensure that resources like this ResultSet object are closed after use510

goldengate/common/database/data/DbDataModel.java

ViolationLine
Overridable method 'setToArray' called during object construction230
Overridable method 'select' called during object construction243

goldengate/common/database/data/DbValue.java

ViolationLine
A switch statement does not contain a break271 - 289
A switch statement does not contain a break293 - 354

goldengate/common/database/DbAdmin.java

ViolationLine
Overridable method 'validConnection' called during object construction141
Overridable method 'validConnection' called during object construction187
Overridable method 'validConnection' called during object construction203
Overridable method 'validConnection' called during object construction248
Avoid empty catch blocks361 - 362

goldengate/common/database/DbConnectionPool.java

ViolationLine
Private field 'timeOutForceClose' could be made final; it is only initialized in the declaration or constructor.62
No need to check for null before an instanceof88
Use block level rather than method level synchronization154 - 164
Avoid instantiation through private constructors from outside of the constructor's class.202
Use block level rather than method level synchronization278 - 292
Ensure that resources like this Connection object are closed after use328
These nested if statements could be combined333
Use block level rather than method level synchronization338 - 366
Avoid if (x != y) ..; else ..;346 - 350
Ensure that resources like this Connection object are closed after use352
Use block level rather than method level synchronization368 - 389
Use block level rather than method level synchronization391 - 399
Avoid empty catch blocks404 - 406
Use block level rather than method level synchronization442 - 444

goldengate/common/database/DbPreparedStatement.java

ViolationLine
New exception is thrown in catch block, original stack trace may be lost136 - 137
New exception is thrown in catch block, original stack trace may be lost190 - 191
New exception is thrown in catch block, original stack trace may be lost237 - 239
Avoid empty catch blocks339 - 340

goldengate/common/database/DbRequest.java

ViolationLine
New exception is thrown in catch block, original stack trace may be lost100 - 101
Ensure that resources like this ResultSet object are closed after use197

goldengate/common/database/DbSession.java

ViolationLine
Use block level rather than method level synchronization92 - 99

goldengate/common/database/model/DbModelAbstract.java

ViolationLine
Avoid empty catch blocks70 - 71
Avoid empty catch blocks88 - 89
These nested if statements could be combined102 - 105
An instanceof check is being performed on the caught exception. Create a separate catch clause for this exception type.115
New exception is thrown in catch block, original stack trace may be lost135 - 136
Avoid empty catch blocks143 - 145
Ensure that resources like this ResultSet object are closed after use161
Avoid empty catch blocks188 - 190
New exception is thrown in catch block, original stack trace may be lost196 - 197
Ensure that resources like this ResultSet object are closed after use201
New exception is thrown in catch block, original stack trace may be lost208 - 209
Avoid empty catch blocks219 - 220
New exception is thrown in catch block, original stack trace may be lost222 - 223
Avoid empty catch blocks230 - 232
Avoid empty catch blocks240 - 241
Document empty method262 - 263
An empty method in an abstract class should be abstract instead262 - 263

goldengate/common/database/model/DbModelFactory.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.33 - 80

goldengate/common/database/model/DbModelH2.java

ViolationLine
Possible unsafe assignment to a non-final static field in a constructor.57

goldengate/common/database/model/DbModelMysql.java

ViolationLine
Possible unsafe assignment to a non-final static field in a constructor.61
Possible unsafe assignment to a non-final static field in a constructor.62
Avoid empty catch blocks135 - 136
Use block level rather than method level synchronization347 - 395
Avoid empty catch blocks359 - 360
Avoid empty catch blocks391 - 392

goldengate/common/database/model/DbModelOracle.java

ViolationLine
Possible unsafe assignment to a non-final static field in a constructor.60
Possible unsafe assignment to a non-final static field in a constructor.61
Avoid empty catch blocks153 - 154

goldengate/common/file/AbstractDir.java

ViolationLine
Singleton is not thread safe75 - 81
Position literals first in String comparisons195
Position literals first in String comparisons197

goldengate/common/file/DataBlock.java

ViolationLine
Document empty constructor83 - 84

goldengate/common/file/DataBlockSizeEstimator.java

ViolationLine
Private field 'internal' could be made final; it is only initialized in the declaration or constructor.34

goldengate/common/file/filesystembased/FilesystemBasedDirImpl.java

ViolationLine
An empty method in an abstract class should be abstract instead496 - 499
Avoid if (x != y) ..; else ..;514 - 517
Avoid empty catch blocks619 - 620
Avoid if (x != y) ..; else ..;638 - 641
New exception is thrown in catch block, original stack trace may be lost652
New exception is thrown in catch block, original stack trace may be lost683
Avoid empty while statements686 - 687
New exception is thrown in catch block, original stack trace may be lost690
New exception is thrown in catch block, original stack trace may be lost702
New exception is thrown in catch block, original stack trace may be lost714

goldengate/common/file/filesystembased/FilesystemBasedFileImpl.java

ViolationLine
Overridable method 'getFileFromPath' called during object construction111
Overridable method 'setPosition' called during object construction114
Overridable method 'setPosition' called during object construction121
Avoid empty catch blocks122 - 123
Avoid empty catch blocks211 - 212
Avoid empty catch blocks225 - 227
New exception is thrown in catch block, original stack trace may be lost228
New exception is thrown in catch block, original stack trace may be lost360
Avoid empty catch blocks363 - 364
Avoid empty catch blocks520 - 521
New exception is thrown in catch block, original stack trace may be lost524
Avoid if (x != y) ..; else ..;569 - 576
Avoid empty catch blocks594 - 595
New exception is thrown in catch block, original stack trace may be lost596
Avoid empty catch blocks602 - 603
Avoid empty catch blocks614 - 615
Avoid empty catch blocks659 - 660

goldengate/common/file/filesystembased/FilesystemBasedOptsMLSxImpl.java

ViolationLine
Document empty constructor81 - 82

goldengate/common/file/filesystembased/specific/FilesystemBasedCommonsIo.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.36 - 59

goldengate/common/file/passthrough/PassthroughBasedDirImpl.java

ViolationLine
Avoid empty catch blocks77 - 78
New exception is thrown in catch block, original stack trace may be lost111 - 112
New exception is thrown in catch block, original stack trace may be lost117 - 118
Consider simply returning the value vs storing it in local variable 'file'158
New exception is thrown in catch block, original stack trace may be lost187
New exception is thrown in catch block, original stack trace may be lost211
New exception is thrown in catch block, original stack trace may be lost218
New exception is thrown in catch block, original stack trace may be lost237
New exception is thrown in catch block, original stack trace may be lost244
New exception is thrown in catch block, original stack trace may be lost255
New exception is thrown in catch block, original stack trace may be lost266
New exception is thrown in catch block, original stack trace may be lost278
New exception is thrown in catch block, original stack trace may be lost283
New exception is thrown in catch block, original stack trace may be lost293
New exception is thrown in catch block, original stack trace may be lost298
New exception is thrown in catch block, original stack trace may be lost309
New exception is thrown in catch block, original stack trace may be lost314
New exception is thrown in catch block, original stack trace may be lost325
New exception is thrown in catch block, original stack trace may be lost330
An empty method in an abstract class should be abstract instead339 - 342
New exception is thrown in catch block, original stack trace may be lost349
New exception is thrown in catch block, original stack trace may be lost387
New exception is thrown in catch block, original stack trace may be lost392
New exception is thrown in catch block, original stack trace may be lost401
New exception is thrown in catch block, original stack trace may be lost406
New exception is thrown in catch block, original stack trace may be lost415
New exception is thrown in catch block, original stack trace may be lost420

goldengate/common/file/passthrough/PassthroughBasedFileImpl.java

ViolationLine
Overridable method 'getFileFromPath' called during object construction120
New exception is thrown in catch block, original stack trace may be lost124
Overridable method 'setPosition' called during object construction128
Overridable method 'setPosition' called during object construction134
Avoid empty catch blocks135 - 136
New exception is thrown in catch block, original stack trace may be lost204
New exception is thrown in catch block, original stack trace may be lost283
New exception is thrown in catch block, original stack trace may be lost295
New exception is thrown in catch block, original stack trace may be lost311
Avoid empty catch blocks314 - 315
Avoid empty catch blocks404 - 405
New exception is thrown in catch block, original stack trace may be lost432
Avoid empty catch blocks438 - 439
Avoid empty catch blocks461 - 462
New exception is thrown in catch block, original stack trace may be lost487
Avoid empty catch blocks493 - 494

goldengate/common/future/GgCompletedFuture.java

ViolationLine
An empty method in an abstract class should be abstract instead69 - 71
An empty method in an abstract class should be abstract instead74 - 76
An empty method in an abstract class should be abstract instead79 - 81
An empty method in an abstract class should be abstract instead84 - 86
An empty method in an abstract class should be abstract instead89 - 91
An empty method in an abstract class should be abstract instead94 - 96
An empty method in an abstract class should be abstract instead99 - 101

goldengate/common/future/GgFailedFuture.java

ViolationLine
Use block level rather than method level synchronization49 - 51
Use block level rather than method level synchronization54 - 56

goldengate/common/future/GgFuture.java

ViolationLine
Use block level rather than method level synchronization70 - 72
Use block level rather than method level synchronization80 - 82
Use block level rather than method level synchronization90 - 92
Use block level rather than method level synchronization99 - 104
Use equals() to compare object references.100
Use block level rather than method level synchronization112 - 114
Use equals() to compare object references.113
New exception is thrown in catch block, original stack trace may be lost241
New exception is thrown in catch block, original stack trace may be lost259

goldengate/common/future/GgSucceededFuture.java

ViolationLine
Use block level rather than method level synchronization33 - 35
Use block level rather than method level synchronization38 - 40

goldengate/common/logging/GgInternalLogger.java

ViolationLine
Non-static initializers are confusing54 - 56

goldengate/common/lru/SynchronizedLruCache.java

ViolationLine
Use block level rather than method level synchronization88 - 90
Use block level rather than method level synchronization93 - 95
Use block level rather than method level synchronization108 - 110
Use block level rather than method level synchronization112 - 114
Use block level rather than method level synchronization122 - 124
Use block level rather than method level synchronization127 - 137

goldengate/common/state/example/ExampleUsageMachineState.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.39 - 107

goldengate/common/tar/TarUtility.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.43 - 298
Avoid empty catch blocks67 - 69
Avoid empty catch blocks74 - 76
Avoid empty catch blocks79 - 81
Avoid empty catch blocks84 - 86
Avoid empty catch blocks141 - 143
Avoid empty catch blocks149 - 151
Avoid empty catch blocks154 - 156
Avoid empty catch blocks159 - 161
Avoid empty catch blocks186 - 188
Avoid empty catch blocks194 - 196
Avoid empty catch blocks199 - 201
Avoid empty catch blocks204 - 206

goldengate/common/tar/ZipUtility.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.43 - 294
Avoid empty catch blocks67 - 69
Avoid empty catch blocks74 - 76
Avoid empty catch blocks79 - 81
Avoid empty catch blocks84 - 86
Avoid empty catch blocks139 - 141
Avoid empty catch blocks147 - 149
Avoid empty catch blocks152 - 154
Avoid empty catch blocks157 - 159
Avoid empty catch blocks182 - 184
Avoid empty catch blocks190 - 192
Avoid empty catch blocks195 - 197
Avoid empty catch blocks200 - 202

goldengate/common/utility/GgStringUtils.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.47 - 231
When instantiating a SimpleDateFormat object, specify a Locale105
Static DateFormatter objects should be accessed in a synchronized manner120
Static DateFormatter objects should be accessed in a synchronized manner146
Deeply nested if..then statements are hard to read149 - 151
New exception is thrown in catch block, original stack trace may be lost191
Avoid empty while statements217 - 218

goldengate/common/utility/GgThreadFactory.java

ViolationLine
Private field 'GlobalName' could be made final; it is only initialized in the declaration or constructor.31
Private field 'counter' could be made final; it is only initialized in the declaration or constructor.32
Consider simply returning the value vs storing it in local variable 'thread'40

goldengate/common/xml/XmlHash.java

ViolationLine
Overridable method 'put' called during object construction43

goldengate/common/xml/XmlStaticShared.java

ViolationLine
When instantiating a SimpleDateFormat object, specify a Locale38 - 39
When instantiating a SimpleDateFormat object, specify a Locale42 - 43
When instantiating a SimpleDateFormat object, specify a Locale46 - 47
Non-static initializers are confusing48 - 52

goldengate/common/xml/XmlType.java

ViolationLine
Switch statements should have a default label63 - 100

goldengate/common/xml/XmlUtil.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.52 - 1011
These nested if statements could be combined808 - 814
These nested if statements could be combined818 - 824
These nested if statements could be combined933 - 942
These nested if statements could be combined946 - 963
Avoid if (x != y) ..; else ..;998 - 1002
Avoid empty catch blocks1008 - 1009

goldengate/common/xml/XmlValue.java

ViolationLine
Switch statements should have a default label69 - 103
Overridable method 'getType' called during object construction69
Overridable method 'addValue' called during object construction129
Overridable method 'getType' called during object construction129
Overridable method 'setValue' called during object construction136
Avoid empty catch blocks137 - 139
Switch statements should have a default label222 - 274
Avoid using java.lang.ThreadGroup; it is not thread safe318
A switch statement does not contain a break360 - 390
Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.362
Avoid using java.lang.ThreadGroup; it is not thread safe378
Avoid if (x != y) ..; else ..;567 - 576
Avoid if (x != y) ..; else ..;568 - 572
Avoid using java.lang.ThreadGroup; it is not thread safe618
Position literals first in String comparisons675
Avoid using java.lang.ThreadGroup; it is not thread safe743
Avoid using java.lang.ThreadGroup; it is not thread safe761
New exception is thrown in catch block, original stack trace may be lost769 - 770
Avoid if (x != y) ..; else ..;777 - 778
Avoid if (x != y) ..; else ..;778