Skip to content

Commit

Permalink
Merge pull request #556 from testng-team/bug/issue-555
Browse files Browse the repository at this point in the history
fixed #555
  • Loading branch information
missedone committed Aug 6, 2023
2 parents df44769 + 548b7e7 commit f7a1515
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.eclipse.jdt.core.dom.MemberValuePair;
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.NormalAnnotation;
import org.eclipse.jdt.core.dom.SimpleName;
import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
import org.eclipse.jdt.core.dom.StringLiteral;
Expand Down Expand Up @@ -148,9 +149,15 @@ protected void record(MethodDeclaration method, StringLiteral value){
protected void record(MethodDeclaration method, ArrayInitializer values) {
List<?> literals = values.expressions();
List<String> paramNames = new ArrayList<String>(literals.size());
for(int i= 0; i < literals.size(); i++) {
StringLiteral str = (StringLiteral) literals.get(i);
paramNames.add(str.getLiteralValue());
for(Object expr : literals) {
if (expr instanceof StringLiteral) {
StringLiteral str = (StringLiteral) expr;
paramNames.add(str.getLiteralValue());
} else if (expr instanceof SimpleName) {
SimpleName sn = (SimpleName) expr;
paramNames.add(sn.getIdentifier());
}

}

record(method, paramNames);
Expand Down

0 comments on commit f7a1515

Please sign in to comment.