Skip to content

Commit

Permalink
#391: Fixes issue by replacing '%p'->'replace_plural'
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrozanec committed Jul 28, 2019
1 parent 641d2ca commit 4da62c1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/cronutils/descriptor/CronDescriptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public String describeMonth(final Map<CronFieldName, CronField> fields) {
private String addTimeExpressions(final String description, final String singular, final String plural) {
return description
.replaceAll("%s", singular)
.replaceAll("%p", plural);
.replaceAll("replace_plural", plural);
}

/**
Expand All @@ -139,7 +139,7 @@ public String describeDayOfWeek(final Map<CronFieldName, CronField> fields, fina
private String addExpressions(final String description, final String singular, final String plural) {
return description
.replaceAll("%s", singular)
.replaceAll("%p", plural);
.replaceAll("replace_plural", plural);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ protected String describe(final And and) {
final StringBuilder builder = new StringBuilder();
if (!onExpressions.isEmpty()) {
builder.append(bundle.getString("at"));
createAndDescription(builder, onExpressions).append(" %p");
createAndDescription(builder, onExpressions).append(" replace_plural");
}
if (!expressions.isEmpty()) {
createAndDescription(builder, expressions);
Expand Down Expand Up @@ -148,7 +148,7 @@ protected String describe(final Between between, final boolean and) {
protected String describe(final Every every, final boolean and) {
String description;
if (every.getPeriod().getValue() > 1) {
description = String.format("%s %s ", bundle.getString(EVERY), nominalValue(every.getPeriod())) + " %p ";
description = String.format("%s %s ", bundle.getString(EVERY), nominalValue(every.getPeriod())) + " replace_plural ";
} else {
description = bundle.getString(EVERY) + " %s ";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public String describe() {
private String addTimeExpressions(final String description, final String singular, final String plural) {
return description
.replaceAll("%s", singular)
.replaceAll("%p", plural);
.replaceAll("replace_plural", plural);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public Between visit(final Between between) {
public Every visit(final Every every) {
String description;
if (every.getPeriod().getValue() > 1) {
description = String.format("%s %s ", bundle.getString(EVERY), nominalValue(every.getPeriod())) + " %p ";
description = String.format("%s %s ", bundle.getString(EVERY), nominalValue(every.getPeriod())) + " replace_plural ";
} else {
description = bundle.getString(EVERY) + " %s ";
}
Expand Down

0 comments on commit 4da62c1

Please sign in to comment.