From: David ‘Bombe’ Roden Date: Sat, 25 Jun 2016 20:14:45 +0000 (+0200) Subject: Remove unnecessary casts X-Git-Tag: 0.9.5^2~21 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=5e353316cbd48c7272d41356021edb19d4410894;p=Sone.git Remove unnecessary casts --- diff --git a/src/main/java/net/pterodactylus/sone/template/ParserFilter.java b/src/main/java/net/pterodactylus/sone/template/ParserFilter.java index 6c74f0b..53862e3 100644 --- a/src/main/java/net/pterodactylus/sone/template/ParserFilter.java +++ b/src/main/java/net/pterodactylus/sone/template/ParserFilter.java @@ -108,7 +108,7 @@ public class ParserFilter implements Filter { List shortenedParts = new ArrayList(); for (Part part : parts) { if (part instanceof PlainTextPart) { - String longText = ((PlainTextPart) part).getText(); + String longText = part.getText(); if (allPartsLength < cutOffLength) { if ((allPartsLength + longText.length()) > cutOffLength) { shortenedParts.add(new PlainTextPart(longText.substring(0, cutOffLength - allPartsLength) + "…")); @@ -121,7 +121,7 @@ public class ParserFilter implements Filter { if (allPartsLength < cutOffLength) { shortenedParts.add(part); } - allPartsLength += ((LinkPart) part).getText().length(); + allPartsLength += part.getText().length(); } else { if (allPartsLength < cutOffLength) { shortenedParts.add(part);