Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void setLink(final String link) {
* "rss_0.92", "rss_0.93", "rss_0.94", "rss_1.0", "rss_2.0", "atom_0.3", "atom_1.0"</code>.
*
* @param type the feed type to check. May be null.
* @return true if if the given type is supported by the rome library, false otherwise.
* @return true if the given type is supported by the rome library, false otherwise
*/
public boolean isSupportedFeedType(final String type) {
return getSupportedFeedTypes().contains(type);
Expand Down Expand Up @@ -177,8 +177,6 @@ public void export(final List<Release> releases, final String feedType, final Wr
feed.setLink(link);
feed.setDescription(rbundle.getString("report.changes.text.rssfeed.description"));
feed.setLanguage(rbundle.getLocale().getLanguage());
// feed.setCopyright( );
// feed.setEncoding();
feed.setEntries(getEntries(releases));

try {
Expand All @@ -191,7 +189,7 @@ public void export(final List<Release> releases, final String feedType, final Wr
private List<SyndEntry> getEntries(final List<Release> releases) {
final List<SyndEntry> entries = new ArrayList<>(1);

if (releases.size() > 0) {
if (!releases.isEmpty()) {
final Release release = releases.get(0); // TODO: is this guaranteed to be the latest?

final SyndEntry entry = new SyndEntryImpl();
Expand All @@ -214,7 +212,7 @@ private static SyndContent getSyndContent(final Release release) {

final String description = release.getDescription();

if (description != null && description.trim().length() > 0) {
if (description != null && !description.trim().isEmpty()) {
sb.append("<p>").append(description).append("</p>");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static String validateIssueManagement(
if (project.getIssueManagement() == null) {
return "No Issue Management set. No " + mojoResult + " will be generated.";
} else if ((project.getIssueManagement().getUrl() == null)
|| (project.getIssueManagement().getUrl().trim().equals(""))) {
|| (project.getIssueManagement().getUrl().trim().isEmpty())) {
return "No URL set in Issue Management. No " + mojoResult + " will be generated.";
} else if ((project.getIssueManagement().getSystem() != null)
&& !(project.getIssueManagement().getSystem().equalsIgnoreCase(issueManagementSystem))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ protected void sendMessage() throws MojoExecutionException {
final MailSender ms = getActualMailSender();
final String fromName = ms.getName();
final String fromAddress = ms.getEmail();
if (fromAddress == null || fromAddress.equals("")) {
if (fromAddress == null || fromAddress.isEmpty()) {
throw new MojoExecutionException("Invalid mail sender: name and email is mandatory (" + ms + ").");
}
getLog().info("Using this sender for email announcement: " + fromAddress + " < " + fromName + " > ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ protected void doGenerate(List<Release> releases, Release release) throws MojoEx
ToolManager toolManager = new ToolManager(true);
Context context = toolManager.createContext();

if (getIntroduction() == null || getIntroduction().equals("")) {
if (getIntroduction() == null || getIntroduction().isEmpty()) {
setIntroduction(getUrl());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public JqlQueryBuilder(Log log) {
public String build() {
try {
String jqlQuery;
// If the user has defined a filter - use that
if ((this.filter != null) && (this.filter.length() > 0)) {
// If the user has defined a filter, use that
if (filter != null && !filter.isEmpty()) {
jqlQuery = filter;
} else {
jqlQuery = query.toString() + orderBy.toString();
Expand Down Expand Up @@ -221,7 +221,7 @@ private void addCommaSeparatedValues(String key, String values) {
}

private void addValues(String key, List<String> values) {
if (values != null && values.size() > 0) {
if (values != null && !values.isEmpty()) {
if (query.length() > 0) {
query.append(" AND ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ public void testExport() throws Exception {
for (String type : generator.getSupportedFeedTypes()) {
try (Writer writer = new StringWriter(512)) {
generator.export(releases, type, writer);
String result = writer.toString(); // TODO: save for inspection?
String result = writer.toString();
assertNotNull(result);
assertTrue(result.length() > 0);
assertFalse(result.isEmpty());
}
}
}
Expand Down