projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
📄 Update year in file headers
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
template
/
CollectionAccessor.java
diff --git
a/src/main/java/net/pterodactylus/sone/template/CollectionAccessor.java
b/src/main/java/net/pterodactylus/sone/template/CollectionAccessor.java
index
afa22ec
..
f170701
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/template/CollectionAccessor.java
+++ b/
src/main/java/net/pterodactylus/sone/template/CollectionAccessor.java
@@
-1,5
+1,5
@@
/*
/*
- * Sone - CollectionAccessor.java - Copyright © 2010–20
12
David Roden
+ * Sone - CollectionAccessor.java - Copyright © 2010–20
20
David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-35,8
+35,6
@@
import net.pterodactylus.util.template.TemplateContext;
* <dt>Returns the nice names of all {@link Sone}s in the collection, sorted
* ascending by their nice names.</dt>
* </dl>
* <dt>Returns the nice names of all {@link Sone}s in the collection, sorted
* ascending by their nice names.</dt>
* </dl>
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class CollectionAccessor extends ReflectionAccessor {
*/
public class CollectionAccessor extends ReflectionAccessor {
@@
-45,12
+43,9
@@
public class CollectionAccessor extends ReflectionAccessor {
*/
@Override
public Object get(TemplateContext templateContext, Object object, String member) {
*/
@Override
public Object get(TemplateContext templateContext, Object object, String member) {
- if (object == null) {
- return null;
- }
Collection<?> collection = (Collection<?>) object;
if (member.equals("soneNames")) {
Collection<?> collection = (Collection<?>) object;
if (member.equals("soneNames")) {
- List<Sone> sones = new ArrayList<
Sone
>();
+ List<Sone> sones = new ArrayList<>();
for (Object sone : collection) {
if (!(sone instanceof Sone)) {
continue;
for (Object sone : collection) {
if (!(sone instanceof Sone)) {
continue;