timtebeek commented on code in PR #124:
URL: https://github.com/apache/maven-pmd-plugin/pull/124#discussion_r1171202445
##########
src/main/java/org/apache/maven/plugins/pmd/PmdViolationCheckMojo.java:
##########
@@ -143,7 +142,7 @@ protected ViolationDetails<Violation>
newViolationDetailsInstance() {
private String getFilename(String fullpath, String pkg) {
int index = fullpath.lastIndexOf(File.separatorChar);
- while (StringUtils.isNotEmpty(pkg)) {
+ while ((pkg != null && !pkg.isEmpty())) {
Review Comment:
```suggestion
while (pkg != null && !pkg.isEmpty()) {
```
##########
src/main/java/org/apache/maven/plugins/pmd/ExcludeViolationsFromFile.java:
##########
@@ -107,9 +106,9 @@ private boolean isExcludedFromFailure(String className,
String ruleName) {
private String extractClassName(String packageName, String className,
String fullPath) {
// for some reason, some violations don't contain the package name, so
we have to guess the full class name
// this looks like a bug in PMD - at least for UnusedImport rule.
- if (StringUtils.isNotEmpty(packageName) &&
StringUtils.isNotEmpty(className)) {
+ if ((packageName != null && !packageName.isEmpty()) && (className !=
null && !className.isEmpty())) {
Review Comment:
```suggestion
if (packageName != null && !packageName.isEmpty() && className !=
null && !className.isEmpty()) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]