new Check: NumericLiteralNeedUnderscoreCheck #187

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

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 cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Aug 25, 2015
@cypai cypai Numeric literal needs underscore check #187 87868b6
@cypai cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Sep 17, 2015
@cypai cypai Numeric literal needs underscore check #187 c9d9cf9
@cypai cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Sep 17, 2015
@cypai cypai Numeric literal needs underscore check #187 72f1228
@cypai cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Sep 17, 2015
@cypai cypai Numeric literal needs underscore check #187 6095fba
@cypai cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Sep 17, 2015
@cypai cypai Numeric literal needs underscore check #187 4cac1c8
@cypai cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Oct 15, 2015
@cypai @cypai cypai + cypai Numeric literal needs underscore check #187 c2c7d1c
@cypai cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Oct 19, 2015
@cypai @cypai cypai + cypai Numeric literal needs underscore check #187 df6e25b
@romani romani changed the title from new Check: Numeric Literal Need Underscore Check to new Check: NumericLiteralNeedUnderscoreCheck Oct 23, 2015
@cypai cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Nov 8, 2015
@cypai cypai Numeric literal needs underscore check #187 f11d0aa
@cypai cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Nov 8, 2015
@cypai @cypai cypai + cypai Numeric literal needs underscore check #187 516d18e
@cypai cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Nov 8, 2015
@cypai @cypai cypai + cypai Issue #187: new Check - NumericLiteralNeedUnderscoreCheck 54f9240
@cypai cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Nov 9, 2015
@cypai @cypai cypai + cypai Issue #187: new Check - NumericLiteralNeedUnderscoreCheck 1186199
@cypai cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Dec 5, 2015
@cypai cypai Issue #187: new Check - NumericLiteralNeedUnderscoreCheck c719eaa
@cypai cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Jan 1, 2016
@cypai cypai Issue #187: new Check - NumericLiteralNeedUnderscoreCheck c7b68c4
@cypai cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Jan 1, 2016
@cypai cypai Issue #187: new Check - NumericLiteralNeedUnderscoreCheck 162593f
@romani romani added this to the 1.18 milestone Jan 16, 2016
@romani
Member
romani commented Jan 16, 2016

merged

@romani romani closed this Jan 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment