2
0
Fork 0
mirror of https://github.com/ethauvin/bld.git synced 2025-04-26 00:37:10 -07:00

Replaced all append("x") with append('x')

This commit is contained in:
Erik C. Thauvin 2023-09-15 06:24:12 -07:00
parent 102d3d3586
commit 60deb1906a
11 changed files with 27 additions and 27 deletions

View file

@ -1546,22 +1546,22 @@ public class BaseProject extends BuildExecutor {
var finger_print = new StringBuilder();
for (var repository : repositories()) {
finger_print.append(repository.toString());
finger_print.append("\n");
finger_print.append('\n');
}
for (var entry : dependencies().entrySet()) {
finger_print.append(entry.getKey());
finger_print.append("\n");
finger_print.append('\n');
if (entry.getValue() != null) {
for (var dependency : entry.getValue()) {
finger_print.append(dependency.toString());
finger_print.append("\n");
finger_print.append('\n');
}
}
}
finger_print.append(downloadSources());
finger_print.append("\n");
finger_print.append('\n');
finger_print.append(downloadJavadoc());
finger_print.append("\n");
finger_print.append('\n');
try {
var digest = MessageDigest.getInstance("SHA-1");

View file

@ -399,7 +399,7 @@ public class BuildExecutor {
fuzzy_regexp.append(ch);
fuzzy_regexp.append("\\E.*");
}
fuzzy_regexp.append("$");
fuzzy_regexp.append('$');
var fuzzy_pattern = Pattern.compile(fuzzy_regexp.toString());
matches.addAll(buildCommands().keySet().stream()
.filter(c -> fuzzy_pattern.matcher(c.toLowerCase()).matches())

View file

@ -130,9 +130,9 @@ public record Dependency(String groupId, String artifactId, VersionNumber versio
*/
public String toFileName() {
var result = new StringBuilder(artifactId());
result.append("-").append(version());
result.append('-').append(version());
if (!classifier().isEmpty()) {
result.append("-").append(classifier());
result.append('-').append(classifier());
}
result.append(".").append(type());
return result.toString();
@ -142,13 +142,13 @@ public record Dependency(String groupId, String artifactId, VersionNumber versio
public String toString() {
var result = new StringBuilder(groupId).append(":").append(artifactId);
if (!version.equals(VersionNumber.UNKNOWN)) {
result.append(":").append(version);
result.append(':').append(version);
}
if (!classifier.isEmpty()) {
result.append(":").append(classifier);
result.append(':').append(classifier);
}
if (!type.isEmpty() && !"jar".equals(type)) {
result.append("@").append(type);
result.append('@').append(type);
}
return result.toString();
}

View file

@ -315,15 +315,15 @@ public class DependencyResolver {
return getArtifactLocations().stream().map(a -> {
var result = new StringBuilder();
result.append(version).append("/").append(dependency_.artifactId()).append("-").append(pom_version);
result.append(version).append('/').append(dependency_.artifactId()).append('-').append(pom_version);
if (!dependency_.classifier().isEmpty()) {
result.append("-").append(dependency_.classifier());
result.append('-').append(dependency_.classifier());
}
var type = dependency_.type();
if (type == null) {
type = "jar";
}
result.append(".").append(type);
result.append('.').append(type);
return a.appendPath(result.toString());
}).toList();

View file

@ -159,9 +159,9 @@ public record Repository(String location, String username, String password) {
result.append(location());
}
if (!location().endsWith("/")) {
result.append("/");
result.append('/');
}
return result.append(group_path).append("/").append(artifactId).append("/").toString();
return result.append(group_path).append('/').append(artifactId).append('/').toString();
}
/**
@ -181,11 +181,11 @@ public record Repository(String location, String username, String password) {
public String toString() {
var result = new StringBuilder(location);
if (username() != null) {
result.append(":");
result.append(':');
try {
result.append(StringEncryptor.MD5HLO.performEncryption(username(), null));
if (password() != null) {
result.append(":");
result.append(':');
result.append(StringEncryptor.MD5HLO.performEncryption(password(), null));
}
} catch (NoSuchAlgorithmException e) {

View file

@ -223,7 +223,7 @@ public record VersionNumber(Integer major, Integer minor, Integer revision, Stri
version.append(minorInt());
}
if (revision != null) {
version.append(".");
version.append('.');
version.append(revisionInt());
}
if (qualifier != null && !qualifier.isEmpty()) {

View file

@ -165,15 +165,15 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
protected void executePublishArtifacts(Repository repository, VersionNumber actualVersion) {
// upload artifacts
for (var artifact : artifacts()) {
var artifact_name = new StringBuilder(info().artifactId()).append("-").append(actualVersion);
var artifact_name = new StringBuilder(info().artifactId()).append('-').append(actualVersion);
if (!artifact.classifier().isEmpty()) {
artifact_name.append("-").append(artifact.classifier());
artifact_name.append('-').append(artifact.classifier());
}
var type = artifact.type();
if (type == null) {
type = "jar";
}
artifact_name.append(".").append(type);
artifact_name.append('.').append(type);
executePublishFileArtifact(repository, artifact.file(), info().version() + "/" + artifact_name);
}

View file

@ -364,7 +364,7 @@ public class Wrapper {
var location = getWrapperDownloadLocation(version);
var result = new StringBuilder(location);
if (!location.endsWith("/")) {
result.append("/");
result.append('/');
}
result.append(fileName);
return result.toString();

View file

@ -134,7 +134,7 @@ public class WrapperExtensionResolver {
contents.append(fingerPrintHash_);
for (var file : localArtifacts_) {
if (file.exists() && file.canRead()) {
contents.append("\n").append(file.lastModified()).append(":").append(file.getAbsolutePath());
contents.append("\n").append(file.lastModified()).append(':').append(file.getAbsolutePath());
}
}

View file

@ -161,7 +161,7 @@ public class TestJarOperation {
while (e.hasMoreElements()) {
var jar_entry = e.nextElement();
content.append(jar_entry.getName());
content.append("\n");
content.append('\n');
}
}
@ -203,7 +203,7 @@ public class TestJarOperation {
while (e.hasMoreElements()) {
var jar_entry = e.nextElement();
content.append(jar_entry.getName());
content.append("\n");
content.append('\n');
}
}

View file

@ -138,7 +138,7 @@ public class TestWarOperation {
while (e.hasMoreElements()) {
var jar_entry = e.nextElement();
content.append(jar_entry.getName());
content.append("\n");
content.append('\n');
}
}