Skip to content

Commit 16ae41d

Browse files
committed
eliminate SpotBugs/PMD warnings
1 parent b45936a commit 16ae41d

8 files changed

Lines changed: 19 additions & 11 deletions

File tree

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,19 @@ npm-debug.log
1616
.settings
1717
.externalToolBuilders
1818
.pmd
19+
.eclipse-pmd
1920
.checkstyle
2021
.idea
2122
.vagrant
2223
*.iml
2324
.DS_Store
25+
*.retry
2426
.rubygems
2527
.sass-cache
2628
.rubygems-gem-maven-plugin
2729
*.sublime-*
2830
*nbactions*.xml
2931
.temp/
32+
.vlt
33+
.vlt-sync*
34+
.brackets.json

conga-aem-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/handlebars/helper/AbstractFilter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ protected final String getValue(Map<String, Object> map, String key) {
5151
* @param key Key
5252
* @return Value or null if not set
5353
*/
54+
@SuppressWarnings("PMD.PreserveStackTrace")
5455
protected final String getRegexValue(Map<String, Object> map, String key) {
5556
String value = getValue(map, key);
5657

conga-aem-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/handlebars/helper/AbstractFilterHelper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
abstract class AbstractFilterHelper implements HelperPlugin<Object> {
3434

3535
@Override
36+
@SuppressWarnings("PMD.PreserveStackTrace")
3637
public final Object apply(Object context, Options options, HelperContext pluginContext) throws IOException {
3738
if (!(context instanceof Map)) {
3839
throw new IllegalArgumentException("Excpected map object for filter rule.");

conga-aem-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/handlebars/helper/AemDispatcherFilterHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ public String getName() {
4545
protected String generateFilter(Map<String, Object> filterMap, Options options) {
4646
DispatcherFilter filter = new DispatcherFilter(filterMap);
4747

48-
StringBuilder sb = new StringBuilder();
49-
sb.append("{ ");
50-
sb.append("/type \"").append(filter.getType()).append("\" ");
48+
StringBuilder sb = new StringBuilder()
49+
.append("{ ")
50+
.append("/type \"").append(filter.getType()).append("\" ");
5151

5252
if (StringUtils.isNotEmpty(filter.getMethod())) {
5353
sb.append("/method '").append(filter.getMethod()).append("' ");

conga-aem-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/handlebars/helper/WebConsolePasswordHashHelper.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,25 +103,25 @@ private String hashPassword(String password, final String hashAlgorithm, final S
103103
try {
104104
bytePassword = password.getBytes(encoding);
105105
}
106-
catch (UnsupportedEncodingException e) {
107-
throw new IOException("Cannot hash the password: " + e);
106+
catch (UnsupportedEncodingException ex) {
107+
throw new IOException("Cannot hash the password.", ex);
108108
}
109109

110110
// create password hash
111111
try {
112112
final MessageDigest md = MessageDigest.getInstance(hashAlgorithm);
113113
hashedPassword = md.digest(bytePassword);
114114
}
115-
catch (NoSuchAlgorithmException e) {
116-
throw new IOException("Cannot hash the password: " + e);
115+
catch (NoSuchAlgorithmException ex) {
116+
throw new IOException("Cannot hash the password.", ex);
117117
}
118118

119119
// encode hashed password to utf8
120120
try {
121121
hashedPasswordBase64 = new String(Base64.getEncoder().encode(hashedPassword), encoding);
122122
}
123-
catch (UnsupportedEncodingException e) {
124-
throw new IOException("Invalid Encoding: " + e);
123+
catch (UnsupportedEncodingException ex) {
124+
throw new IOException("Invalid Encoding.", ex);
125125
}
126126

127127
return String.format("{%s}%s", hashAlgorithm.toLowerCase(), hashedPasswordBase64);

conga-aem-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/postprocessor/ContentPackageOsgiConfigPostProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public List<FileContext> apply(FileContext fileContext, PostProcessorContext con
9090

9191
// create AEM content package with configurations
9292
File zipFile = new File(file.getParentFile(), FilenameUtils.getBaseName(file.getName()) + ".zip");
93-
logger.info("Generate " + zipFile.getCanonicalPath());
93+
logger.info("Generate {}", zipFile.getCanonicalPath());
9494

9595
String rootPath = ContentPackageUtil.getMandatoryProp(options, PROPERTY_PACKAGE_ROOT_PATH);
9696

conga-aem-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/postprocessor/ContentPackagePostProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public List<FileContext> apply(FileContext fileContext, PostProcessorContext con
8383

8484
// create AEM content package with configurations
8585
File zipFile = new File(file.getParentFile(), FilenameUtils.getBaseName(file.getName()) + ".zip");
86-
logger.info("Generate " + zipFile.getCanonicalPath());
86+
logger.info("Generate {}", zipFile.getCanonicalPath());
8787

8888
String rootPath = ContentPackageUtil.getMandatoryProp(options, PROPERTY_PACKAGE_ROOT_PATH);
8989

tooling/conga-aem-crypto-cli/src/main/java/io/wcm/devops/conga/plugins/aem/tooling/crypto/cli/AemCryptoCli.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ private AemCryptoCli() {
6868
* @throws Exception Exception
6969
*/
7070
//CHECKSTYLE:OFF
71+
@SuppressWarnings({ "PMD.SignatureDeclareThrowsException", "PMD.SystemPrintln" })
7172
public static void main(String[] args) throws Exception {
7273
//CHECKSTYLE:ON
7374
CommandLine commandLine = new DefaultParser().parse(CLI_OPTIONS, args, true);

0 commit comments

Comments
 (0)