From eea381e7143aac4b2a0dd63878bce769078e3bed Mon Sep 17 00:00:00 2001 From: ElgarL Date: Thu, 24 Nov 2011 16:34:05 +0000 Subject: optimize getPermissionList --- .../src/org/anjocaido/groupmanager/data/DataUnit.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'EssentialsGroupManager/src') diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java index 25546a0ea..a35b5aeee 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java @@ -6,6 +6,8 @@ package org.anjocaido.groupmanager.data; import java.util.ArrayList; import java.util.Collections; +import java.util.List; + import org.anjocaido.groupmanager.GroupManager; import org.anjocaido.groupmanager.dataholder.WorldDataHolder; import org.anjocaido.groupmanager.utils.StringPermissionComparator; @@ -133,8 +135,8 @@ public abstract class DataUnit { * You can't edit the permissions using the returned ArrayList instance * @return a copy of the permission list */ - public ArrayList getPermissionList() { - return new ArrayList(permissions); + public List getPermissionList() { + return Collections.unmodifiableList(permissions); } public boolean isSorted() { -- cgit v1.2.3