Description: Do not define in the method body: Pattern pattern = Pattern . compile( rule );
9.4 4. [Mandatory] Note that the Math.random () method returns a double type, pay attention to the range of values 0≤ x < 1 ( zero value can be obtained , pay attention to the exception of division by zero ) , if you want to obtain a random number of integer type , do not magnify x by several times of 10 and then round it, use the nextInt or nextLong method of the Random object directly .
9.5 5. [Mandatory] Get the current milliseconds System . currentTimeMillis(); instead of new Date() . getTime();
Note: If you want to get a more accurate nanosecond time value, use System . nanoTime() . In JDK 8 , the Instant class is recommended for scenarios such as counting time.
9.7 7. [Recommendation] The size of any data structure should be specified when constructing or initializing it to prevent the data structure from growing indefinitely and eating up memory.
9.8 8. [Recommended] For " clearly discontinued code and configuration " , such as methods, variables, classes, configuration files, dynamic configuration properties
, etc., must be resolutely removed from the program to avoid causing too much garbage.