Making MemorySection much more efficient; Addresses BUKKIT-1454
This commit is contained in:
@@ -7,6 +7,7 @@ import java.io.InputStream;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.Configuration;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
@@ -44,9 +45,7 @@ public class YamlConfiguration extends FileConfiguration {
|
||||
|
||||
@Override
|
||||
public void loadFromString(String contents) throws InvalidConfigurationException {
|
||||
if (contents == null) {
|
||||
throw new IllegalArgumentException("Contents cannot be null");
|
||||
}
|
||||
Validate.notNull(contents, "Contents cannot be null");
|
||||
|
||||
Map<?, ?> input;
|
||||
try {
|
||||
@@ -167,9 +166,7 @@ public class YamlConfiguration extends FileConfiguration {
|
||||
* @throws IllegalArgumentException Thrown is file is null
|
||||
*/
|
||||
public static YamlConfiguration loadConfiguration(File file) {
|
||||
if (file == null) {
|
||||
throw new IllegalArgumentException("File cannot be null");
|
||||
}
|
||||
Validate.notNull(file, "File cannot be null");
|
||||
|
||||
YamlConfiguration config = new YamlConfiguration();
|
||||
|
||||
@@ -196,9 +193,7 @@ public class YamlConfiguration extends FileConfiguration {
|
||||
* @throws IllegalArgumentException Thrown is stream is null
|
||||
*/
|
||||
public static YamlConfiguration loadConfiguration(InputStream stream) {
|
||||
if (stream == null) {
|
||||
throw new IllegalArgumentException("Stream cannot be null");
|
||||
}
|
||||
Validate.notNull(stream, "Stream cannot be null");
|
||||
|
||||
YamlConfiguration config = new YamlConfiguration();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user