Skip to content

Conversation

wujimin
Copy link
Contributor

@wujimin wujimin commented Jul 21, 2017

1.add prefix _ to numbers
2.add prefix _ to java keyword
3.change - to _

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 85.253% when pulling 6d9dd8c on wujimin:appid-microservice-name-java-keyword into 2afb8c2 on ServiceComb:master.

private static final Set<String> JAVA_KEYWORDS = new HashSet<>();
static {
JAVA_KEYWORDS.addAll(Arrays.asList("abstract",
"continue",
Copy link
Member

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?

Copy link
Contributor Author

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......

Copy link
Contributor Author

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] = "_";
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

@wujimin wujimin force-pushed the appid-microservice-name-java-keyword branch from 6d9dd8c to 5eaba74 Compare July 24, 2017 02:01
@wujimin wujimin force-pushed the appid-microservice-name-java-keyword branch from 5eaba74 to 175af8a Compare July 24, 2017 02:15
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 175af8a on wujimin:appid-microservice-name-java-keyword into ** on ServiceComb:master**.

@seanyinx seanyinx merged commit e183927 into apache:master Jul 24, 2017
@wujimin wujimin deleted the appid-microservice-name-java-keyword branch August 11, 2017 09:18
@WillemJiang WillemJiang added this to the 0.2.0 milestone Aug 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants