📄 Update year in file headers
[Sone.git] / src / main / java / net / pterodactylus / sone / database / memory / MemoryPost.java
index 75eae49..451b6b5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - MemoryPost.java - Copyright Â© 2010–2016 David Roden
+ * Sone - MemoryPost.java - Copyright Â© 2010–2020 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
@@ -21,13 +21,10 @@ import static com.google.common.base.Optional.fromNullable;
 
 import java.util.UUID;
 
-import javax.annotation.Nullable;
-
 import net.pterodactylus.sone.data.Post;
 import net.pterodactylus.sone.data.Sone;
 import net.pterodactylus.sone.database.SoneProvider;
 
-import com.google.common.base.Function;
 import com.google.common.base.Optional;
 
 /**
@@ -123,13 +120,7 @@ class MemoryPost implements Post {
         */
        @Override
        public Optional<Sone> getRecipient() {
-               return Optional.fromNullable(recipientId).transform(new Function<String, Sone>() {
-                       @Nullable
-                       @Override
-                       public Sone apply(String input) {
-                               return soneProvider.getSone(input);
-                       }
-               });
+               return recipientId == null ? Optional.<Sone>absent() : fromNullable(soneProvider.getSone(recipientId));
        }
 
        /**