projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
🚚 Rename Album helper file
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
template
/
SubstringFilter.java
diff --git
a/src/main/java/net/pterodactylus/sone/template/SubstringFilter.java
b/src/main/java/net/pterodactylus/sone/template/SubstringFilter.java
index
005eb1f
..
2a2e526
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/template/SubstringFilter.java
+++ b/
src/main/java/net/pterodactylus/sone/template/SubstringFilter.java
@@
-1,5
+1,5
@@
/*
/*
- * Sone - SubstringFilter.java - Copyright © 2010–20
12
David Roden
+ * Sone - SubstringFilter.java - Copyright © 2010–20
20
David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-28,8
+28,6
@@
import net.pterodactylus.util.template.TemplateContext;
* “start” and “length.” “length” is optional and defaults to “the rest of the
* string.” “start” starts at {@code 0} and can be negative to denote starting
* at the end of the string.
* “start” and “length.” “length” is optional and defaults to “the rest of the
* string.” “start” starts at {@code 0} and can be negative to denote starting
* at the end of the string.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class SubstringFilter implements Filter {
*/
public class SubstringFilter implements Filter {
@@
-48,13
+46,7
@@
public class SubstringFilter implements Filter {
}
String dataString = String.valueOf(data);
int dataLength = dataString.length();
}
String dataString = String.valueOf(data);
int dataLength = dataString.length();
- if (lengthString == null) {
- if (start < 0) {
- return dataString.substring(dataLength + start);
- }
- return dataString.substring(start);
- }
- int length = Integer.MAX_VALUE;
+ int length = dataLength;
try {
length = Integer.parseInt(lengthString);
} catch (NumberFormatException nfe1) {
try {
length = Integer.parseInt(lengthString);
} catch (NumberFormatException nfe1) {