Minor householding

- Remove getter for NewSetting
- Reduce visibility of classes used by DelayedRunner
This commit is contained in:
ljacqu 2016-06-19 16:13:00 +02:00
parent d35005167e
commit a0abe3d19d
5 changed files with 10 additions and 14 deletions

View File

@ -709,14 +709,6 @@ public class AuthMe extends JavaPlugin {
// Service getters (deprecated) // Service getters (deprecated)
// Use @Inject fields instead // Use @Inject fields instead
// ------------- // -------------
/**
* @return NewSetting
* @deprecated should be used in API classes only (temporarily)
*/
@Deprecated
public NewSetting getSettings() {
return newSettings;
}
/** /**
* @return permission manager * @return permission manager

View File

@ -9,6 +9,7 @@ import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.cache.auth.PlayerCache; import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.security.crypts.HashedPassword; import fr.xephi.authme.security.crypts.HashedPassword;
import fr.xephi.authme.settings.NewSetting;
import fr.xephi.authme.settings.properties.SecuritySettings; import fr.xephi.authme.settings.properties.SecuritySettings;
import fr.xephi.authme.util.BukkitService; import fr.xephi.authme.util.BukkitService;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -30,6 +31,9 @@ public class BungeeCordMessage implements PluginMessageListener {
@Inject @Inject
private AuthMe plugin; private AuthMe plugin;
@Inject
private NewSetting settings;
BungeeCordMessage() { } BungeeCordMessage() { }
@ -63,17 +67,17 @@ public class BungeeCordMessage implements PluginMessageListener {
} }
//END //END
if (!plugin.getSettings().getProperty(SecuritySettings.REMOVE_SPAM_FROM_CONSOLE)) { if (!settings.getProperty(SecuritySettings.REMOVE_SPAM_FROM_CONSOLE)) {
ConsoleLogger.info("Player " + auth.getNickname() + " has logged in from one of your server!"); ConsoleLogger.info("Player " + auth.getNickname() + " has logged in from one of your server!");
} }
} else if ("logout".equals(act)) { } else if ("logout".equals(act)) {
playerCache.removePlayer(name); playerCache.removePlayer(name);
dataSource.setUnlogged(name); dataSource.setUnlogged(name);
if (!plugin.getSettings().getProperty(SecuritySettings.REMOVE_SPAM_FROM_CONSOLE)) { if (!settings.getProperty(SecuritySettings.REMOVE_SPAM_FROM_CONSOLE)) {
ConsoleLogger.info("Player " + auth.getNickname() + " has logged out from one of your server!"); ConsoleLogger.info("Player " + auth.getNickname() + " has logged out from one of your server!");
} }
} else if ("register".equals(act)) { } else if ("register".equals(act)) {
if (!plugin.getSettings().getProperty(SecuritySettings.REMOVE_SPAM_FROM_CONSOLE)) { if (!settings.getProperty(SecuritySettings.REMOVE_SPAM_FROM_CONSOLE)) {
ConsoleLogger.info("Player " + auth.getNickname() + " has registered out from one of your server!"); ConsoleLogger.info("Player " + auth.getNickname() + " has registered out from one of your server!");
} }
} else if ("changepassword".equals(act)) { } else if ("changepassword".equals(act)) {

View File

@ -10,7 +10,7 @@ import java.lang.reflect.Method;
/** /**
* Contains all necessary information to initialize a {@link InjectDelayed} field. * Contains all necessary information to initialize a {@link InjectDelayed} field.
*/ */
public class PendingInjection { class PendingInjection {
private Field field; private Field field;
private Object[] dependencies; private Object[] dependencies;

View File

@ -11,7 +11,7 @@ import java.util.List;
* after Mockito's @Mock, @Spy and @InjectMocks have taken effect, * after Mockito's @Mock, @Spy and @InjectMocks have taken effect,
* but before {@link InjectDelayed} fields are handled. * but before {@link InjectDelayed} fields are handled.
*/ */
public class RunBeforeInjectings extends Statement { class RunBeforeInjectings extends Statement {
private final Statement next; private final Statement next;
private final List<FrameworkMethod> beforeInjectings; private final List<FrameworkMethod> beforeInjectings;

View File

@ -9,7 +9,7 @@ import java.util.List;
* Statement for initializing {@link InjectDelayed} fields. These fields are * Statement for initializing {@link InjectDelayed} fields. These fields are
* constructed after {@link BeforeInjecting} and before JUnit's &#064;Before. * constructed after {@link BeforeInjecting} and before JUnit's &#064;Before.
*/ */
public class RunDelayedInjects extends Statement { class RunDelayedInjects extends Statement {
private final Statement next; private final Statement next;
private final Object target; private final Object target;