Finally remove all deprecated methods.

This commit is contained in:
ElgarL 2012-04-13 15:16:08 +01:00
parent 2f74510cce
commit 1e30f23ca6
6 changed files with 7 additions and 179 deletions

View file

@ -178,4 +178,5 @@ v 2.0:
- Fix silly nested throw/catch statements. Errors are now correctly generated when reading yml's.
- Unregister the worldsHolder as a service on a reload/shutdown instead of the whole plugin.
- Update all code formatting to use tabs for indentation.
- Stop using our own deprecated methods as we tell others to do.
- Stop using our own deprecated methods as we tell others to do.
- Finally remove all deprecated methods.

View file

@ -12,7 +12,6 @@ import org.anjocaido.groupmanager.data.Variables;
import org.anjocaido.groupmanager.data.User;
import org.anjocaido.groupmanager.data.Group;
import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder;
import org.anjocaido.groupmanager.dataholder.WorldDataHolder;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@ -295,65 +294,11 @@ public class GroupManager extends JavaPlugin {
}
}
/**
* Use the WorldsHolder saveChanges directly instead Saves the data on file
*/
@Deprecated
public void commit() {
if (worldsHolder != null) {
worldsHolder.saveChanges();
}
}
/**
* Use worlds holder to reload a specific world Reloads the data
*/
@Deprecated
public void reload() {
worldsHolder.reloadAll();
}
public WorldsHolder getWorldsHolder() {
return worldsHolder;
}
/**
* The handler in the interface created by AnjoCaido
*
* @return AnjoPermissionsHandler
*/
@Deprecated
public AnjoPermissionsHandler getPermissionHandler() {
return worldsHolder.getDefaultWorld().getPermissionsHandler();
}
/**
* A simple interface, for ones that don't want to mess with overloading.
* Yet it is affected by overloading. But seamless.
*
* @return the dataholder with all information
*/
@Deprecated
public WorldDataHolder getData() {
return worldsHolder.getDefaultWorld();
}
/**
* Use this if you want to play with overloading.
*
* @return a dataholder with overloading interface
*/
@Deprecated
public OverloadedWorldHolder getOverloadedClassData() {
return worldsHolder.getDefaultWorld();
}
/**
* Called when a command registered by this plugin is received.
*

View file

@ -108,19 +108,6 @@ public class User extends DataUnit implements Cloneable {
return group;
}
/**
* @param group
* the group to set
*/
@Deprecated
public void setGroup(String group) {
this.group = group;
flagAsChanged();
if (GroupManager.isLoaded())
if (!GroupManager.BukkitPermissions.isPlayer_join())
GroupManager.BukkitPermissions.updatePlayer(getBukkitPlayer());
}
/**
* @param group

View file

@ -30,7 +30,6 @@ public class OverloadedWorldHolder extends WorldDataHolder {
super(ph.getName());
this.setGroupsFile(ph.getGroupsFile());
this.setUsersFile(ph.getUsersFile());
//this.setDefaultGroup(ph.getDefaultGroup());
this.groups = ph.groups;
this.users = ph.users;
}

View file

@ -46,7 +46,6 @@ public class WorldsHolder {
private Map<String, String> mirrorsGroup = new HashMap<String, String>();
private Map<String, String> mirrorsUser = new HashMap<String, String>();
//private OverloadedWorldHolder defaultWorld;
private String serverDefaultWorldName;
private GroupManager plugin;
private File worldsFolder;

View file

@ -16,7 +16,6 @@ import org.anjocaido.groupmanager.data.Group;
import org.anjocaido.groupmanager.dataholder.WorldDataHolder;
import org.anjocaido.groupmanager.data.User;
import org.anjocaido.groupmanager.utils.PermissionCheckResult;
import org.anjocaido.groupmanager.utils.PermissionCheckResult.Type;
import org.bukkit.entity.Player;
/**
@ -27,7 +26,7 @@ import org.bukkit.entity.Player;
*
* It holds permissions only for one single world.
*
* @author gabrielcouto
* @author gabrielcouto, ElgarL
*/
public class AnjoPermissionsHandler extends PermissionsReaderInterface {
@ -824,35 +823,14 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
return result;
}
/**
* Verifies if a given group has a variable. Including it's inheritance.
*
* it redirects to the other method now. This one was deprecated, and will
* be gone in a future release.
*
* @param start
* @param variable
* @param alreadyChecked
* @return returns the closest inherited group with the variable.
* @deprecated use now nextGroupWithVariable(Group start, String
* targetVariable)
*/
@Deprecated
public Group nextGroupWithVariable(Group start, String variable, List<Group> alreadyChecked) {
return nextGroupWithVariable(start, variable);
}
/**
* Returns the next group, including inheritance, which contains that
* variable name.
*
* It does Breadth-first search
*
* @param start
* the starting group to look for
* @param targetVariable
* the variable name
* @param start the starting group to look for
* @param targetVariable the variable name
* @return The group if found. Null if not.
*/
public Group nextGroupWithVariable(Group start, String targetVariable) {
@ -880,37 +858,14 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
return null;
}
/**
* Check if given group inherits another group.
*
* redirected to the other method. this is deprecated now. and will be gone
* in the future releases.
*
* @param start
* The group to start the search.
* @param askedGroup
* Name of the group you're looking for
* @param alreadyChecked
* groups to ignore(pass null on it, please)
* @return true if it inherits the group.
* @deprecated prefer using hasGroupInInheritance(Group start, String
* askedGroup)
*/
@Deprecated
public boolean searchGroupInInheritance(Group start, String askedGroup, List<Group> alreadyChecked) {
return hasGroupInInheritance(start, askedGroup);
}
/**
* Check if given group inherits another group.
*
* It does Breadth-first search
*
* @param start
* The group to start the search.
* @param askedGroup
* Name of the group you're looking for
* @param start The group to start the search.
* @param askedGroup Name of the group you're looking for
* @return true if it inherits the group.
*/
public boolean hasGroupInInheritance(Group start, String askedGroup) {
@ -938,26 +893,6 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
return false;
}
/**
* Check if the group has given permission. Including it's inheritance
*
* @param start
* @param permission
* @param alreadyChecked
* @return true if PermissionCheckResult is EXCEPTION or FOUND
* @deprecated use the other checkGroupPermissionWithInheritance for
* everything
*/
@Deprecated
public boolean checkGroupPermissionWithInheritance(Group start, String permission, List<Group> alreadyChecked) {
PermissionCheckResult result = checkGroupPermissionWithInheritance(start, permission);
if (result.resultType.equals(Type.EXCEPTION) || result.resultType.equals(Type.FOUND)) {
return true;
}
return false;
}
/**
* Returns the result of permission check. Including inheritance. If found
* anything, the PermissionCheckResult that retuns will include the Group
@ -1002,44 +937,6 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
return result;
}
/**
* It uses checkGroupPermissionWithInheritance and cast the owner to Group
* type if result type was EXCEPTION or FOUND.
*
* @param start
* @param permission
* @param alreadyChecked
* @return the group that passed on test. null if no group passed.
* @deprecated use checkGroupPermissionWithInheritance for everything now.
*/
@Deprecated
public Group nextGroupWithPermission(Group start, String permission, List<Group> alreadyChecked) {
PermissionCheckResult result = checkGroupPermissionWithInheritance(start, permission);
if (result.resultType.equals(Type.EXCEPTION) || result.resultType.equals(Type.FOUND)) {
return (Group) checkGroupPermissionWithInheritance(start, permission).owner;
}
return null;
}
/**
* Return whole list of names of groups in a inheritance chain. Including a
* starting group.
*
* it now redirects to the other method. but get away from this one, it will
* disappear in a future release.
*
* @param start
* @param alreadyChecked
* @return the group that passed on test. null if no group passed.
* @deprecated use the other method with same name, instead
*/
@Deprecated
public ArrayList<String> listAllGroupsInherited(Group start, ArrayList<String> alreadyChecked) {
return listAllGroupsInherited(start);
}
/**
* Return whole list of names of groups in a inheritance chain. Including a
* starting group.