From: David ‘Bombe’ Roden Date: Mon, 21 Sep 2020 18:52:56 +0000 (+0200) Subject: 🔥 Remove unused parameter X-Git-Tag: v2~77 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=bc384cab6e0242753c4e74252529d5cfd9c6d982;p=rhynodge.git 🔥 Remove unused parameter --- diff --git a/src/main/java/net/pterodactylus/rhynodge/actions/EmailAction.java b/src/main/java/net/pterodactylus/rhynodge/actions/EmailAction.java index 4dfece0..e1441f3 100644 --- a/src/main/java/net/pterodactylus/rhynodge/actions/EmailAction.java +++ b/src/main/java/net/pterodactylus/rhynodge/actions/EmailAction.java @@ -118,20 +118,20 @@ public class EmailAction implements Action { } private void addPlainTextPart(Output output, MimeMultipart multipart) throws MessagingException { - if (output.text("text/plain", -1) == null) { + if (output.text("text/plain") == null) { return; } MimeBodyPart textPart = new MimeBodyPart(); - textPart.setContent(output.text("text/plain", -1), "text/plain;charset=utf-8"); + textPart.setContent(output.text("text/plain"), "text/plain;charset=utf-8"); multipart.addBodyPart(textPart); } private void addHtmlPart(Output output, MimeMultipart multipart) throws MessagingException { - if (output.text("text/html", -1) == null) { + if (output.text("text/html") == null) { return; } MimeBodyPart htmlPart = new MimeBodyPart(); - htmlPart.setContent(output.text("text/html", -1), "text/html;charset=utf-8"); + htmlPart.setContent(output.text("text/html"), "text/html;charset=utf-8"); multipart.addBodyPart(htmlPart); } diff --git a/src/main/java/net/pterodactylus/rhynodge/output/DefaultOutput.java b/src/main/java/net/pterodactylus/rhynodge/output/DefaultOutput.java index bf77aff..3426769 100644 --- a/src/main/java/net/pterodactylus/rhynodge/output/DefaultOutput.java +++ b/src/main/java/net/pterodactylus/rhynodge/output/DefaultOutput.java @@ -78,7 +78,7 @@ public class DefaultOutput implements Output { * {@inheritDoc} */ @Override - public String text(String mimeType, int maxLength) { + public String text(String mimeType) { return mimeTypeTexts.get(mimeType); } diff --git a/src/main/java/net/pterodactylus/rhynodge/output/Output.java b/src/main/java/net/pterodactylus/rhynodge/output/Output.java index dc058bb..853c9ce 100644 --- a/src/main/java/net/pterodactylus/rhynodge/output/Output.java +++ b/src/main/java/net/pterodactylus/rhynodge/output/Output.java @@ -21,7 +21,7 @@ import net.pterodactylus.rhynodge.Trigger; /** * Defines the output of a {@link Trigger}. As different output has to be - * generated for different media, the {@link #text(String, int)} method takes as + * generated for different media, the {@link #text(String)} method takes as * an argument the MIME type of the desired output. * * @author David ‘Bombe’ Roden @@ -45,12 +45,9 @@ public interface Output { * @param mimeType * The MIME type of the text (“text/plain” and “text/html” should * be supported by all {@link Trigger}s) - * @param maxLength - * The maximum length of the returned text (may be < {@code 0} - * to indicate no length restriction) * @return The text for the given MIME type, or {@code null} if there is no * text defined for the given MIME type */ - String text(String mimeType, int maxLength); + String text(String mimeType); } diff --git a/src/test/kotlin/net/pterodactylus/rhynodge/webpages/weather/WeatherTriggerTest.kt b/src/test/kotlin/net/pterodactylus/rhynodge/webpages/weather/WeatherTriggerTest.kt index ee4b53b..ca140c0 100644 --- a/src/test/kotlin/net/pterodactylus/rhynodge/webpages/weather/WeatherTriggerTest.kt +++ b/src/test/kotlin/net/pterodactylus/rhynodge/webpages/weather/WeatherTriggerTest.kt @@ -60,7 +60,7 @@ class WeatherTriggerTest { trigger.mergeStates(previousState, currentState) val reaction = mock(Reaction::class.java) val output = trigger.output(reaction) - val htmlText = output.text("text/html", -1) + val htmlText = output.text("text/html") File("/tmp/wetter.html").writer().use { it.write(htmlText) } assertThat(htmlText, containsString("00:00")) assertThat(htmlText, containsString("10 °C")) @@ -94,7 +94,7 @@ class WeatherTriggerTest { trigger.mergeStates(previousState, currentState) val reaction = mock(Reaction::class.java) val output = trigger.output(reaction) - val htmlText = output.text("text/html", -1) + val htmlText = output.text("text/html") assertThat(htmlText, containsString("Time")) assertThat(htmlText, containsString("Temperature")) assertThat(htmlText, containsString("feels like")) @@ -116,7 +116,7 @@ class WeatherTriggerTest { trigger.mergeStates(previousState, currentState) val reaction = mock(Reaction::class.java) val output = trigger.output(reaction) - val htmlText = output.text("text/html", -1) + val htmlText = output.text("text/html") assertThat(htmlText, containsString("Time")) assertThat(htmlText, containsString("Temperature")) assertThat(htmlText, not(containsString("feels like")))