Skip redundant initialization.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 25 Jun 2014 18:20:48 +0000 (20:20 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 25 Jun 2014 18:20:48 +0000 (20:20 +0200)
src/main/java/net/pterodactylus/sone/template/IdentityAccessor.java
src/main/java/net/pterodactylus/sone/web/SearchPage.java

index c08a0a2..efb4d16 100644 (file)
@@ -55,9 +55,8 @@ public class IdentityAccessor extends ReflectionAccessor {
                Identity identity = (Identity) object;
                if ("uniqueNickname".equals(member)) {
                        int minLength = -1;
-                       boolean found = false;
-                       Set<OwnIdentity> ownIdentities = null;
-                       ownIdentities = core.getIdentityManager().getAllOwnIdentities();
+                       boolean found;
+                       Set<OwnIdentity> ownIdentities = core.getIdentityManager().getAllOwnIdentities();
                        do {
                                boolean unique = true;
                                String abbreviatedWantedNickname = getAbbreviatedNickname(identity, ++minLength);
index 45773ca..3f6d065 100644 (file)
@@ -201,7 +201,7 @@ public class SearchPage extends SoneTemplatePage {
         * @return The parsed phrases
         */
        private static List<Phrase> parseSearchPhrases(String query) {
-               List<String> parsedPhrases = null;
+               List<String> parsedPhrases;
                try {
                        parsedPhrases = StringEscaper.parseLine(query);
                } catch (TextException te1) {