From 5e353316cbd48c7272d41356021edb19d4410894 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 25 Jun 2016 22:14:45 +0200 Subject: [PATCH] Remove unnecessary casts --- src/main/java/net/pterodactylus/sone/template/ParserFilter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.7.4