Skip to content

Conversation

@AlexFalessi
Copy link
Member

No description provided.

@activeeon-bot
Copy link

Can one of the admins verify this patch?

}

private String[] splitAndExtractNameAndParamsFromDescription(String input) {
String[] elements = input.split(",");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not ideal, this suppose you have a comma after the infrastructure or policy name.
you should extract the first word of the input instead.
String[] elements = input.split("[,\s]+");

}

private String[] splitAndExtractNameAndParamsFromDescription(String input) {
String[] elements = input.split("[,\\s]+");
Copy link
Member

@fviale fviale Aug 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can make this code much simpler

return input.trim().split("[,\\s]+", 2);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants