Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STORM-3446: storm-maven-plugins: fix all checkstyle warnings #3061

Merged
merged 1 commit into from Jul 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion storm-buildtools/storm-maven-plugins/pom.xml
Expand Up @@ -75,7 +75,7 @@
<artifactId>maven-checkstyle-plugin</artifactId>
<!--Note - the version would be inherited-->
<configuration>
<maxAllowedViolations>11</maxAllowedViolations>
<maxAllowedViolations>0</maxAllowedViolations>
</configuration>
</plugin>
<plugin>
Expand Down
Expand Up @@ -89,7 +89,7 @@ public static List<File> convertFileSetToFiles(FileSet source)
@Override
public void execute() throws MojoExecutionException {
try {
SCM scm = determineSCM();
SCM scm = determineScm();
project.getProperties().setProperty(buildTimeProperty, getBuildTime());
project.getProperties().setProperty(scmUriProperty, getSCMUri(scm));
project.getProperties().setProperty(scmBranchProperty, getSCMBranch(scm));
Expand All @@ -113,7 +113,7 @@ private String getBuildTime() {
* @return SCM in use for this build
* @throws Exception if any error occurs attempting to determine SCM
*/
private SCM determineSCM() throws Exception {
private SCM determineScm() throws Exception {
CommandExec exec = new CommandExec(this);
SCM scm = SCM.NONE;
scmOut = new ArrayList<String>();
Expand Down Expand Up @@ -172,6 +172,7 @@ private String[] getSvnUriInfo(String str) {
return res;
}

@SuppressWarnings("checkstyle:AbbreviationAsWordInName")
private String getSCMUri(SCM scm) {
String uri = "Unknown";
switch (scm) {
Expand All @@ -193,10 +194,14 @@ private String getSCMUri(SCM scm) {
}
}
break;
default:
throw new IllegalArgumentException(String.format("SCM %s is not supported",
scm));
}
return uri.trim();
}

@SuppressWarnings("checkstyle:AbbreviationAsWordInName")
private String getSCMCommit(SCM scm) {
String commit = "Unknown";
switch (scm) {
Expand All @@ -216,10 +221,14 @@ private String getSCMCommit(SCM scm) {
}
}
break;
default:
throw new IllegalArgumentException(String.format("SCM %s is not supported",
scm));
}
return commit.trim();
}

@SuppressWarnings("checkstyle:AbbreviationAsWordInName")
private String getSCMBranch(SCM scm) {
String branch = "Unknown";
switch (scm) {
Expand All @@ -240,6 +249,9 @@ private String getSCMBranch(SCM scm) {
}
}
break;
default:
throw new IllegalArgumentException(String.format("SCM %s is not supported",
scm));
}
return branch.trim();
}
Expand All @@ -262,14 +274,6 @@ private byte[] computeMD5(List<File> files) throws IOException,
return md5.digest();
}

private String byteArrayToString(byte[] array) {
StringBuilder sb = new StringBuilder();
for (byte b : array) {
sb.append(Integer.toHexString(0xff & b));
}
return sb.toString();
}

private String computeMD5() throws Exception {
List<File> files = convertFileSetToFiles(source);
// File order of MD5 calculation is significant. Sorting is done on
Expand All @@ -291,6 +295,15 @@ private String normalizePath(File file) {
return md5str;
}

private String byteArrayToString(byte[] array) {
StringBuilder sb = new StringBuilder();
for (byte b : array) {
sb.append(Integer.toHexString(0xff & b));
}
return sb.toString();
}

@SuppressWarnings("checkstyle:AbbreviationAsWordInName")
private enum SCM {
NONE, SVN, GIT
}
Expand Down