This repository was archived by the owner on Dec 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
src/main/java/com/ly/doc/model Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .ly .doc .model ;
22
3- import com .power .common .util .CollectionUtil ;
4-
53import java .io .Serializable ;
64import java .util .ArrayList ;
7- import java .util .Collections ;
85import java .util .List ;
96import java .util .Objects ;
107
118/**
129 * Abstract API Doc.
1310 *
11+ * @author linwumingshi
1412 * @param <T> the type of method doc
1513 */
1614public abstract class AbstractRpcApiDoc <T extends IMethod >
@@ -180,8 +178,8 @@ public String getDocClass() {
180178
181179 @ Override
182180 public List <IMethod > getMethods () {
183- if (CollectionUtil . isEmpty (this .list )) {
184- return Collections . emptyList ();
181+ if (Objects . isNull (this .list )) {
182+ return new ArrayList <> ();
185183 }
186184 return new ArrayList <>(this .list );
187185 }
Original file line number Diff line number Diff line change 2020 */
2121package com .ly .doc .model ;
2222
23- import com .power .common .util .CollectionUtil ;
2423import com .power .common .util .StringUtil ;
2524
2625import java .util .ArrayList ;
@@ -153,8 +152,8 @@ public void setName(String name) {
153152 }
154153
155154 public List <ApiMethodDoc > getList () {
156- if (CollectionUtil . isEmpty (this .list )) {
157- return Collections . emptyList ();
155+ if (Objects . isNull (this .list )) {
156+ return new ArrayList <> ();
158157 }
159158 return list ;
160159 }
@@ -263,8 +262,8 @@ public String getDocClass() {
263262
264263 @ Override
265264 public List <IMethod > getMethods () {
266- if (CollectionUtil . isEmpty (this .list )) {
267- return Collections . emptyList ();
265+ if (Objects . isNull (this .list )) {
266+ return new ArrayList <> ();
268267 }
269268
270269 return new ArrayList <>(this .list );
Original file line number Diff line number Diff line change 2020 */
2121package com .ly .doc .model ;
2222
23- import java .util .Collections ;
23+ import java .util .ArrayList ;
2424import java .util .List ;
25+ import java .util .Objects ;
2526
2627/**
2728 * the webSocket doc
@@ -76,8 +77,8 @@ public void setSubProtocols(String subProtocols) {
7677 }
7778
7879 public List <ApiParam > getPathParams () {
79- if (pathParams == null ) {
80- return Collections . emptyList ();
80+ if (Objects . isNull ( this . pathParams ) ) {
81+ return new ArrayList <> ();
8182 }
8283 return pathParams ;
8384 }
@@ -88,7 +89,7 @@ public void setPathParams(List<ApiParam> pathParams) {
8889
8990 public List <ApiParam > getMessageParams () {
9091 if (messageParams == null ) {
91- return Collections . emptyList ();
92+ return new ArrayList <> ();
9293 }
9394 return messageParams ;
9495 }
Original file line number Diff line number Diff line change 2323import com .ly .doc .model .IDoc ;
2424import com .ly .doc .model .IMethod ;
2525import com .ly .doc .model .JavadocJavaMethod ;
26- import com .power .common .util .CollectionUtil ;
2726
2827import java .util .ArrayList ;
29- import java .util .Collections ;
3028import java .util .List ;
3129import java .util .Objects ;
3230
31+ /**
32+ * Java Doc ApiDoc
33+ *
34+ * @author chenchuxin
35+ * @since 3.0.5
36+ */
3337public class JavadocApiDoc implements IDoc , Comparable <JavadocApiDoc > {
3438
3539 /**
@@ -181,8 +185,8 @@ public String getDocClass() {
181185
182186 @ Override
183187 public List <IMethod > getMethods () {
184- if (CollectionUtil . isEmpty (this .list )) {
185- return Collections . emptyList ();
188+ if (Objects . isNull (this .list )) {
189+ return new ArrayList <> ();
186190 }
187191 return new ArrayList <>(this .list );
188192 }
You can’t perform that action at this time.
0 commit comments