-
Notifications
You must be signed in to change notification settings - Fork 9
build!: upgrade vaadin to 24.9.8 AND feat!: replace setClassNameGenerator with setPartNameGenerator AND refactor: avoid use of commons.lang3 AND docs: enhance class documentation in LegacyTwinColGrid AND docs: fix double brace in javadoc in LegacyTwinColGrid AND build: set version to 4.0.0-SNAPSHOT AND chore/ci #205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
72ee37b
docs: enhance class documentation
javier-godoy 102396a
docs: fix double brace in javadoc
javier-godoy 13eaf33
chore: add license headers
javier-godoy 102eed0
ci: add license plugin exclusions
javier-godoy 2ac6cb9
refactor: avoid use of commons.lang3
javier-godoy d8f8a10
build: set version to 4.0.0-SNAPSHOT
javier-godoy 313be6d
build!: upgrade vaadin to 24.9.8
javier-godoy c302071
feat!: replace setClassNameGenerator with setPartNameGenerator
javier-godoy edec196
build(demo): upgrade commons-demo to 5.0.0
javier-godoy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
src/main/java/com/flowingcode/vaadin/addons/twincolgrid/CharSequenceUtils.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| /*- | ||
| * #%L | ||
| * TwinColGrid add-on | ||
| * %% | ||
| * Copyright (C) 2017 - 2025 Flowing Code | ||
| * %% | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * #L% | ||
| */ | ||
| package com.flowingcode.vaadin.addons.twincolgrid; | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| import lombok.experimental.UtilityClass; | ||
|
|
||
| @UtilityClass | ||
| class CharSequenceUtils { | ||
|
|
||
| /** | ||
| * Green implementation of regionMatches. | ||
| * | ||
| * @param cs the {@link CharSequence} to be processed | ||
| * @param ignoreCase whether or not to be case-insensitive | ||
| * @param thisStart the index to start on the {@code cs} CharSequence | ||
| * @param substring the {@link CharSequence} to be looked for | ||
| * @param start the index to start on the {@code substring} CharSequence | ||
| * @param length character length of the region | ||
| * @return whether the region matched | ||
| * @see String#regionMatches(boolean, int, String, int, int) | ||
| */ | ||
| static boolean regionMatches(final CharSequence cs, final boolean ignoreCase, final int thisStart, | ||
| final CharSequence substring, final int start, final int length) { | ||
| if (cs instanceof String && substring instanceof String) { | ||
| return ((String) cs).regionMatches(ignoreCase, thisStart, (String) substring, start, length); | ||
| } | ||
| int index1 = thisStart; | ||
| int index2 = start; | ||
| int tmpLen = length; | ||
|
|
||
| // Extract these first so we detect NPEs the same as the java.lang.String version | ||
| final int srcLen = cs.length() - thisStart; | ||
| final int otherLen = substring.length() - start; | ||
|
|
||
| // Check for invalid parameters | ||
| if (thisStart < 0 || start < 0 || length < 0) { | ||
| return false; | ||
| } | ||
|
|
||
| // Check that the regions are long enough | ||
| if (srcLen < length || otherLen < length) { | ||
| return false; | ||
| } | ||
|
|
||
| while (tmpLen-- > 0) { | ||
| final char c1 = cs.charAt(index1++); | ||
| final char c2 = substring.charAt(index2++); | ||
|
|
||
| if (c1 == c2) { | ||
| continue; | ||
| } | ||
|
|
||
| if (!ignoreCase) { | ||
| return false; | ||
| } | ||
|
|
||
| // The real same check as in String#regionMatches(boolean, int, String, int, int): | ||
| final char u1 = Character.toUpperCase(c1); | ||
| final char u2 = Character.toUpperCase(c2); | ||
| if (u1 != u2 && Character.toLowerCase(u1) != Character.toLowerCase(u2)) { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| return true; | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/main/java/com/flowingcode/vaadin/addons/twincolgrid/StringUtils.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /*- | ||
| * #%L | ||
| * TwinColGrid add-on | ||
| * %% | ||
| * Copyright (C) 2017 - 2025 Flowing Code | ||
| * %% | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * #L% | ||
| */ | ||
| package com.flowingcode.vaadin.addons.twincolgrid; | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| import lombok.experimental.UtilityClass; | ||
|
|
||
| @UtilityClass | ||
| class StringUtils { | ||
|
|
||
| public static boolean containsIgnoreCase(String str, String searchStr) { | ||
| if (str == null || searchStr == null) { | ||
| return false; | ||
| } | ||
| final int len = searchStr.length(); | ||
| final int max = str.length() - len; | ||
| for (int i = 0; i <= max; i++) { | ||
| if (CharSequenceUtils.regionMatches(str, true, i, searchStr, 0, len)) { | ||
| return true; | ||
| } | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.