Skip to content

Commit

Permalink
Fix format specifier in logger calls (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwalluck authored Apr 15, 2024
1 parent 1331698 commit 6a7797e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/main/java/de/dentrassi/rpm/builder/PackageEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package de.dentrassi.rpm.builder;

import java.io.File;
import java.util.Arrays;

public class PackageEntry extends EntryDetails {
public static class Collector {
Expand Down Expand Up @@ -66,7 +67,7 @@ public String[] getExcludes() {

@Override
public String toString() {
return String.format("[collector - from: %s, directories: %s, symLinks: %s, includes: %s, excludes: %s]", this.from, this.directories, this.symbolicLinks, this.includes, this.excludes);
return String.format("[collector - from: %s, directories: %s, symLinks: %s, includes: %s, excludes: %s]", this.from, this.directories, this.symbolicLinks, Arrays.toString(this.includes), Arrays.toString(this.excludes));
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/de/dentrassi/rpm/builder/RpmMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
} catch (final FileAlreadyExistsException e) {
// silently ignore
} catch (final IOException ioe) {
this.logger.debug("Unable to create target directory {}", targetDir);
this.logger.debug("Unable to create target directory %s", targetDir);
throw new MojoExecutionException("RPM build failed.", ioe);

}
Expand Down Expand Up @@ -1108,7 +1108,7 @@ protected void fillPayload(final RpmBuilder builder) throws MojoFailureException
if (this.generateIntermediateDirectories.isEmpty()) {
ctx = builder.newContext();
} else {
ctx = new MissingDirectoryGeneratorInterceptor(builder.newContext(), this.generateIntermediateDirectories);;
ctx = new MissingDirectoryGeneratorInterceptor(builder.newContext(), this.generateIntermediateDirectories);
}

this.logger.debug("Building payload:");
Expand All @@ -1130,12 +1130,12 @@ private void customizeHeader(final RpmBuilder builder) {

builder.setHeaderCustomizer(rpmTagHeader -> {
if (this.prefixes != null && !this.prefixes.isEmpty()) {
this.logger.debug("Building relocatable package: {}", this.prefixes);
this.logger.debug("Building relocatable package: %s", this.prefixes);
rpmTagHeader.putStringArray(RpmTag.PREFIXES, this.prefixes.toArray(new String[0]));
}

if (outputTimestampInstant != null) {
this.logger.debug("Overriding build time: {}", outputTimestampInstant);
this.logger.debug("Overriding build time: %s", outputTimestampInstant);
rpmTagHeader.putInt(RpmTag.BUILDTIME, (int) (outputTimestampInstant.toEpochMilli() / 1000));
}
});
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/de/dentrassi/rpm/builder/RulesetEvaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import org.eclipse.packager.rpm.build.FileInformation;
import org.eclipse.packager.rpm.build.PayloadEntryType;
Expand All @@ -41,7 +40,7 @@ public RulesetInstance(final String id, final List<Rule> rules, final String par

private void eval(final Object object, final PayloadEntryType type, final String targetName, final FileInformation info, final Set<String> knownSets) {
if (knownSets.contains(this.id)) {
throw new IllegalStateException(String.format("Recursive calling of rulesets is not allowed- current: %s, previous: %s", this.id, knownSets.stream().collect(Collectors.joining(", "))));
throw new IllegalStateException(String.format("Recursive calling of rulesets is not allowed- current: %s, previous: %s", this.id, String.join(", ", knownSets)));
}

knownSets.add(this.id);
Expand Down

0 comments on commit 6a7797e

Please sign in to comment.