Skip to content

fix: Handle an extra spaces in class names properly#11861

Merged
caalador merged 5 commits intomasterfrom
fix/empty-class-name
Sep 17, 2021
Merged

fix: Handle an extra spaces in class names properly#11861
caalador merged 5 commits intomasterfrom
fix/empty-class-name

Conversation

@mshabarov
Copy link
Copy Markdown
Contributor

@mshabarov mshabarov commented Sep 15, 2021

Description

Fixes #11709

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

throw new IllegalArgumentException(
"CSS class names cannot include an empty class name");
}
String[] parts = rawClassName.split("\\s+");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

StringSplitter: String.split(String) has surprising behavior
(at-me in a reply with help or ignore)

Copy link
Copy Markdown
Contributor

@caalador caalador left a comment

Choose a reason for hiding this comment

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

2 added tests are broken.

Comment thread flow-server/src/main/java/com/vaadin/flow/component/HasStyle.java Outdated
Comment thread flow-server/src/main/java/com/vaadin/flow/component/HasStyle.java Outdated
Comment thread flow-server/src/main/java/com/vaadin/flow/component/HasStyle.java
@mshabarov mshabarov requested a review from caalador September 16, 2021 07:24
Comment thread flow-server/src/main/java/com/vaadin/flow/component/HasStyle.java
@caalador caalador merged commit d319ea2 into master Sep 17, 2021
@caalador caalador deleted the fix/empty-class-name branch September 17, 2021 03:57
vaadin-bot added a commit that referenced this pull request Sep 17, 2021
Fixes #11709

Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
vaadin-bot added a commit that referenced this pull request Sep 17, 2021
Fixes #11709

Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
vaadin-bot added a commit that referenced this pull request Sep 17, 2021
Fixes #11709

Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
@vaadin-bot
Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with platform 22.0.0.alpha4 and is also targeting the upcoming stable 22.0.0 version.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HasStyle.addClassNames() doesn't handle multiple whitespaces

3 participants