projects
/
rhynodge.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
edf0639
)
🔥 Remove unused parameter
author
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Mon, 21 Sep 2020 18:52:56 +0000
(20:52 +0200)
committer
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Mon, 21 Sep 2020 18:52:56 +0000
(20:52 +0200)
src/main/java/net/pterodactylus/rhynodge/actions/EmailAction.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/rhynodge/output/DefaultOutput.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/rhynodge/output/Output.java
patch
|
blob
|
history
src/test/kotlin/net/pterodactylus/rhynodge/webpages/weather/WeatherTriggerTest.kt
patch
|
blob
|
history
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
(file)
--- 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 {
}
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();
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 {
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();
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);
}
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
(file)
--- 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
* {@inheritDoc}
*/
@Override
- public String text(String mimeType
, int maxLength
) {
+ public String text(String mimeType) {
return mimeTypeTexts.get(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
(file)
--- 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
/**
* 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 <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
* an argument the MIME type of the desired output.
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
@@
-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 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
*/
* @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
(file)
--- 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)
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"))
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)
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"))
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)
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")))
assertThat(htmlText, containsString("Time"))
assertThat(htmlText, containsString("Temperature"))
assertThat(htmlText, not(containsString("feels like")))