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

new Check: NumericLiteralNeedUnderscoreCheck #187

Closed
romani opened this Issue May 15, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@romani
Member

romani commented May 15, 2014

http://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html

If literal is more that N symbols, demand "_" on each M symbols in literal. It is up to a user there to put them:

long creditCardNumber = 1234_5678_9012_3456L;
long socialSecurityNumber1  = 999_99_9999_L; 

We need that option for two format separately: Hex, Bytes

Types: Int, Long (L), Float (F)
Looks like no need for special options for types - they are not affect length literal.

More examples:
http://javarevisited.blogspot.sg/2014/03/why-use-underscore-in-numbers-from-java-SE-7-numeric-literals.html
http://javarevisited.blogspot.com/2014/04/10-jdk-7-features-to-revisit-before-you.html "5) Underscore in Numeric literals"

@daniilyar daniilyar added moderate and removed enhancement labels Aug 15, 2014

cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Aug 25, 2015

cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Sep 17, 2015

cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Sep 17, 2015

cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Sep 17, 2015

cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Sep 17, 2015

cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Oct 15, 2015

cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Oct 19, 2015

@romani romani changed the title from new Check: Numeric Literal Need Underscore Check to new Check: NumericLiteralNeedUnderscoreCheck Oct 23, 2015

cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Nov 8, 2015

cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Nov 8, 2015

cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Nov 8, 2015

cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Nov 9, 2015

cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Dec 5, 2015

cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Jan 1, 2016

cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Jan 1, 2016

@romani romani added this to the 1.18 milestone Jan 16, 2016

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jan 16, 2016

Member

merged

Member

romani commented Jan 16, 2016

merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment