mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-28 13:45:14 +01:00
Arrays can stream directly.
This commit is contained in:
parent
60eac8e54e
commit
3404fac8f2
@ -141,7 +141,7 @@ public class Flags {
|
||||
* @return List of all the flags in this class
|
||||
*/
|
||||
public static List<Flag> values() {
|
||||
return Arrays.asList(Flags.class.getFields()).stream().map(field -> {
|
||||
return Arrays.stream(Flags.class.getFields()).map(field -> {
|
||||
try {
|
||||
return (Flag)field.get(null);
|
||||
} catch (IllegalArgumentException | IllegalAccessException e) {
|
||||
|
@ -21,7 +21,7 @@ public class Placeholders {
|
||||
* @return List of all the flags in this class
|
||||
*/
|
||||
public static List<Placeholder> values() {
|
||||
return Arrays.asList(Placeholders.class.getFields()).stream().map(field -> {
|
||||
return Arrays.stream(Placeholders.class.getFields()).map(field -> {
|
||||
try {
|
||||
return (Placeholder)field.get(null);
|
||||
} catch (IllegalArgumentException | IllegalAccessException e) {
|
||||
|
@ -54,7 +54,7 @@ public class AddonsManager {
|
||||
if (!f.exists()) {
|
||||
f.mkdirs();
|
||||
}
|
||||
Arrays.asList(f.listFiles()).stream().filter(x -> !x.isDirectory() && x.getName().endsWith(".jar")).forEach(t -> {
|
||||
Arrays.stream(f.listFiles()).filter(x -> !x.isDirectory() && x.getName().endsWith(".jar")).forEach(t -> {
|
||||
plugin.log("Loading " + t.getName());
|
||||
try {
|
||||
loadAddon(t);
|
||||
|
@ -316,7 +316,7 @@ public class IslandsManagerTest {
|
||||
@Test
|
||||
public void testBadBlocks() {
|
||||
// Fences
|
||||
Arrays.asList(Material.values()).stream().filter(m -> m.toString().contains("FENCE")).forEach(m -> {
|
||||
Arrays.stream(Material.values()).filter(m -> m.toString().contains("FENCE")).forEach(m -> {
|
||||
when(ground.getType()).thenReturn(m);
|
||||
assertFalse("Fence :" + m.toString(), manager.isSafeLocation(location));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user