Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2806959

Browse files
Fixed bug parsing Java parameters with spread operators
1 parent 11f631c commit 2806959

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎src/javaxt/utils/src/Parser.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,19 @@ private static Method parseMethod(String fn, String comments, String ext){
869869
if (!parameters.isEmpty()){
870870
for (String param : parameters.split(",")){
871871
param = param.trim();
872+
872873
idx = param.lastIndexOf(" ");
874+
if (idx==-1){
875+
//Check if we have a spread operator
876+
idx = param.indexOf("...");
877+
if (idx>-1){
878+
String t = param.substring(0, idx);
879+
String n = param.substring(idx+3);
880+
param = t + "... " + n;
881+
idx = param.indexOf(" ");
882+
}
883+
}
884+
873885
String paramName = param.substring(idx).trim();
874886
String paramType = param.substring(0, idx).trim();
875887
idx = paramType.lastIndexOf(" ");

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /