JAV-211 APPLICTION_ID & microservice name can not use any java packag…#95
Conversation
| private static final Set<String> JAVA_KEYWORDS = new HashSet<>(); | ||
| static { | ||
| JAVA_KEYWORDS.addAll(Arrays.asList("abstract", | ||
| "continue", |
There was a problem hiding this comment.
is it valid to use true, false, null in package name?
There was a problem hiding this comment.
oh, it's invalid, let me fix it. and maybe lost other scenes also......
There was a problem hiding this comment.
add true/false/null, and change JAVA_KEYWORDS to JAVA_RESERVED_WORDS
| for (int idx = 0; idx < parts.length; idx++) { | ||
| String part = parts[idx]; | ||
| if (part.isEmpty()) { | ||
| parts[idx] = "_"; |
There was a problem hiding this comment.
at first, i don't think anyone will use a name like "1..."
and add "part.isEmpty()" is because "part.charAt(0)" in the next block.
but, ok, i will add test case for this.
There was a problem hiding this comment.
change string.split(regex) to string.split(regex, -1) to remains empty part
and add test case
6d9dd8c to
5eaba74
Compare
5eaba74 to
175af8a
Compare
|
Changes Unknown when pulling 175af8a on wujimin:appid-microservice-name-java-keyword into ** on ServiceComb:master**. |
1.add prefix _ to numbers
2.add prefix _ to java keyword
3.change - to _