From ce7040be4bc2584f4d4a23c82148eac73c66039f Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Mon, 7 May 2012 12:33:24 +0200 Subject: Refactoring: Collections.emptyList() is cheap and needs no caching --- main/src/cgeo/geocaching/LogEntry.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/main/src/cgeo/geocaching/LogEntry.java b/main/src/cgeo/geocaching/LogEntry.java index e0e2e13..ceec732 100644 --- a/main/src/cgeo/geocaching/LogEntry.java +++ b/main/src/cgeo/geocaching/LogEntry.java @@ -11,11 +11,6 @@ import java.util.Collections; import java.util.List; public final class LogEntry { - /** - * avoid creating new empty lists all the time using this constant. We could also return Collections.EMPTY_LIST - * using a cast, but that might trigger static code analysis tools. - */ - private static final List EMPTY_LIST = Collections.emptyList(); public int id = 0; public LogType type = LogType.NOTE; // note @@ -76,7 +71,7 @@ public final class LogEntry { */ public List getLogImages() { if (logImages == null) { - return EMPTY_LIST; + return Collections.emptyList(); } return logImages; } -- cgit v1.1