Skip to content

Commit

Permalink
🎨 Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Apr 3, 2018
1 parent 3ce73fc commit 68e76a1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/java/org/b3log/symphony/cache/TagCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* Tag cache.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.5.6.3, Jul 23, 2017
* @version 1.5.6.4, Apr 3, 2018
* @since 1.4.0
*/
@Named
Expand Down Expand Up @@ -159,7 +159,7 @@ public List<JSONObject> getIconTags(final int fetchSize) {

final int end = fetchSize >= ICON_TAGS.size() ? ICON_TAGS.size() : fetchSize;

return new ArrayList(ICON_TAGS.subList(0, end));
return new ArrayList<>(ICON_TAGS.subList(0, end));
}

/**
Expand Down Expand Up @@ -187,7 +187,7 @@ public void loadTags() {
/**
* Loads new tags.
*/
public void loadNewTags() {
private void loadNewTags() {
final LatkeBeanManager beanManager = LatkeBeanManagerImpl.getInstance();
final TagRepository tagRepository = beanManager.getReference(TagRepository.class);

Expand All @@ -199,7 +199,7 @@ public void loadNewTags() {
try {
final JSONObject result = tagRepository.get(query);
NEW_TAGS.clear();
NEW_TAGS.addAll(CollectionUtils.<JSONObject>jsonArrayToList(result.optJSONArray(Keys.RESULTS)));
NEW_TAGS.addAll(CollectionUtils.jsonArrayToList(result.optJSONArray(Keys.RESULTS)));
} catch (final RepositoryException e) {
LOGGER.log(Level.ERROR, "Gets new tags failed", e);
}
Expand All @@ -208,7 +208,7 @@ public void loadNewTags() {
/**
* Loads icon tags.
*/
public void loadIconTags() {
private void loadIconTags() {
final LatkeBeanManager beanManager = LatkeBeanManagerImpl.getInstance();
final TagRepository tagRepository = beanManager.getReference(TagRepository.class);

Expand All @@ -221,7 +221,7 @@ public void loadIconTags() {
try {
final JSONObject result = tagRepository.get(query);
final List<JSONObject> tags = CollectionUtils.jsonArrayToList(result.optJSONArray(Keys.RESULTS));
final List<JSONObject> toUpdateTags = new ArrayList();
final List<JSONObject> toUpdateTags = new ArrayList<>();
for (final JSONObject tag : tags) {
toUpdateTags.add(JSONs.clone(tag));
}
Expand Down Expand Up @@ -311,7 +311,7 @@ public void loadAllTags() {
tag.put(Tag.TAG_T_TITLE_LOWER_CASE, tag.optString(Tag.TAG_TITLE).toLowerCase());
}

Collections.sort(tags, (t1, t2) -> {
tags.sort((t1, t2) -> {
final String u1Title = t1.optString(Tag.TAG_T_TITLE_LOWER_CASE);
final String u2Title = t2.optString(Tag.TAG_T_TITLE_LOWER_CASE);

Expand Down

0 comments on commit 68e76a1

Please sign in to comment.