-
Notifications
You must be signed in to change notification settings - Fork 827
JAV-211 APPLICTION_ID & microservice name can not use any java packag… #95
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it valid to use true, false, null in package name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, it's invalid, let me fix it. and maybe lost other scenes also......
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this case covered in test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 _