Skip to content

Commit 80d071c

Browse files
committed
7904080: APIDiff does not detect javadoc (and changes to javadoc) for methods with varargs
Reviewed-by: cstein, iris
1 parent 7b0a1ee commit 80d071c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/share/classes/jdk/codetools/apidiff/model/APIReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ protected void startElement(String name, Map<String, String> attrs, boolean isSe
325325
blockDepth = 0;
326326
}
327327
debugPrintln(() -> "!! set id for TYPE member " + id);
328-
descriptionId = id;
328+
descriptionId = id.replace("...)", "[])");
329329
}
330330
break;
331331
}

test/junit/apitest/APIReaderTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ public void m1() { }
237237
* @see "See Text"
238238
*/
239239
public void m2() { }
240+
/**
241+
* This is first method with varagrs.
242+
*/
243+
public void varargs1(Integer i, String... texts) { }
244+
/**
245+
* This is second method with varagrs.
246+
*/
247+
public void varargs2(Integer i, int... texts) { }
240248
/**
241249
* This is nested class N. This is more test for N.
242250
* @see "See Text"
@@ -367,7 +375,7 @@ private void checkFile(Log log, Path file) {
367375

368376
case "C.html" -> {
369377
checkDescription(docs.getDescription(), null, null, "This is class C. This is more");
370-
checkMemberDescriptions(docs.getMemberDescriptions(), "<init>()", "<init>(int)", "f1", "f2", "m1()", "m2()");
378+
checkMemberDescriptions(docs.getMemberDescriptions(), "<init>()", "<init>(int)", "f1", "f2", "m1()", "m2()", "varargs1(java.lang.Integer,java.lang.String[])", "varargs2(java.lang.Integer,int[])");
371379
checkDescription(docs.getDescription("<init>()"),
372380
"<init>()", "C", "This is the no-args constructor. This is more");
373381
}

0 commit comments

Comments
 (0)