Conversation
Jokser
left a comment
There was a problem hiding this comment.
Overall fix looks good. Please resolve minor code style issues I've addressed in PR.
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
Outdated
Show resolved
Hide resolved
| */ | ||
| public static void validateCacheName(String name) throws IllegalArgumentException { | ||
| A.ensure(name != null && !name.isEmpty(), "Cache name must not be null or empty."); | ||
| A.ensure(name.length() <= MAX_FILE_NAME_LENGTH, "Length of cache name can not exceed "+ MAX_FILE_NAME_LENGTH +"."); |
There was a problem hiding this comment.
Code style issue - there should be whitespace between " and +
| */ | ||
| public static void validateCacheGroupName(String name) throws IllegalArgumentException { | ||
| if (name != null) | ||
| A.ensure(name.length() <= MAX_FILE_NAME_LENGTH, "Length of cache group name can not exceed "+ MAX_FILE_NAME_LENGTH +"."); |
There was a problem hiding this comment.
Code style issue - there should be whitespace between " and +
| * @throws Exception If failed | ||
| */ | ||
| @Test | ||
| public void testGetorCreateLongCacheNameExceed235() throws Exception{ |
There was a problem hiding this comment.
I suggest renaming the test to smth. like testCreateLongCacheName and move it to org.apache.ignite.internal.processors.cache.GridCacheConfigurationConsistencySelfTest test class.
| * @throws Exception If failed | ||
| */ | ||
| @Test | ||
| public void testGetorCreateLongCacheGroupNameExceed235() throws Exception{ |
There was a problem hiding this comment.
I suggest renaming the test to smth. like testCreateLongCacheGroupName and move it to org.apache.ignite.internal.processors.cache.GridCacheConfigurationConsistencySelfTest test class.
| * @throws Exception If failed | ||
| */ | ||
| @Test | ||
| public void testGetorCreateLongCacheNameLessThan235() throws Exception{ |
|
|
||
| /** */ | ||
| @Test | ||
| public void testGetorCreateLongCacheNameExceed235() throws Exception { |
There was a problem hiding this comment.
The following 2 tests duplicate others. Should be removed.
|
fixed the review comments. |
Cache or template name should be validated before attempt to start, max valid name length is 235 characters (20 is reserved for internal prefixes, suffixes or extensions).