Standardize the development process of programmers through plug-ins (4) (Eclipse code assistant new function release)

The assistant continues to be updated. For other functions of the plugin, please refer to the first and second logs of the blog

There is no related QuickFix function on the JSP page, please refer to the prompt to modify

 

 

The plugin is tested under the Eclipse IDE for Java EE Developers version of Eclipse kepler SR1

 

The plugin is tested under the Eclipse IDE for Java EE Developers version of Eclipse Luna (4.4)

 

Modify BUG

1: Amend the new String() character set suggestion, only for one parameter, and the parameter is a byte array, the amendment will be proposed

new features

2: Fix the problem that <c:out cannot correctly prompt cross-site in html tags.

 

1: Adding a space after   in a JSP page will cause IE8, 9, 10 to wrap, prompting to remove the space

2: Write the absolute path in Java and make suggestions for modification

3: Please do not use wildcard * for import, please import specific class name

4: Please define the Java Field field as private (except static). If you need external access, please provide a method in the class to facilitate other classes to call

5: Fix the problem of small Chinese fonts under eclipse kepler-SR1

6: Force Eclipse to display line numbers

 

 

function previously

Add the following hints to the Java code

1: java.net.URLEncoder.encode adds a prompt without encoding

2: getBytes adds a prompt without encoding

3: System.out.println prompts the following content. This method will cause the log to be too large in the production environment, but the out log cannot generate files according to the date, which will cause the log to be too large and difficult to operate and maintain.

4: System.exit prompts the following content This method will cause the program to exit abnormally, please delete this statement

5: System.err.println prompts the following: This method will cause the log to be too large in the production environment, but the out log cannot generate files according to the date, which will cause the log to be too large and difficult to operate and maintain

6:java.net.URLDecoder.decode The following content method is not recommended. This method will obtain the system variable as the character set. There will be potential problems in the system connection, etc. The character set needs to be specified.

7: The printStackTrace method of Exception prompts the following content. This method will cause the log to be too large in the production environment, but the out log cannot generate files according to the date, which will cause the log to be too large and difficult to operate and maintain.

8: java.util.Locale.getDefault prompts the following: java.util.Locale.getDefault() is to obtain the value of the system environment variable, this method is not recommended, it is recommended to use Locale.SIMPLIFIED_CHINESE, the output value is zh_CN, or ask from the top and bottom , the program will read the properties file ending with zh_CN

9: If the class in the source file is the same as the class of the Jar package, the prompt package has the same package path and class name. In different environments, the loading order will cause the production to call the classes of different packages, which will lead to production exceptions. , please modify the Java class name

10: Prompt the following for java.lang.Double: java.lang.Double is an inexact numeric type, please use java.math.BigDecimal() instead

11:java.lang.Float prompts the following: java.lang.Float is an inexact numeric type, please use java.math.BigDecimal() instead

12:float prompts the following: float is an inexact numeric type, please use java.math.BigDecimal() instead

13: double prompts the following: double is an inexact number type, please use java.math.BigDecimal() instead

14: java.util.Random prompts the following: java.util.Random type is not secure enough, please use java.security.SecureRandom instead

15: Use startBatch and executeBatch in the doInSqlMapClient method to prompt the following:

In the doInSqlMapClient method, the batch submission method has been used, and there is no need to use startBatch again. At the same time, this will cause the execution process to be in a suspended state in the Oracle database and cannot be automatically terminated. Just remove this code.

16: Prompt the following for new String(): The new String(byte[]) method is not recommended, it will get the system default character set, you need to specify the character set corresponding to the byte[] array, the character set in the system is UTF-8, Other system character set is GBK, please select the corresponding character set to fill in

17: At present, most of them are using the spring framework. Generally, singleton methods are used in classes to prompt the code that is prone to memory confusion.

This class is a singleton. In the case of concurrency, there will be memory confusion, so this variable cannot be assigned a value in the class. If you confirm that this method is indeed called only once during the entire system operation, please add Method_Once_Invoke in the method annotation, The solution needs to be confirmed by the project manager or team leader

 

 

 

 Here's how to use this plugin for version comparison

1: Set the SVN URL, user name and password



2: Select the file and right-click the production version comparison in the compare, you can compare the production code with the native code

 



 



The function that has been implemented so far is to check some development specifications
of Ibatis 1: Chinese codes cannot be inserted in Ibatis's select, update, delete, and insert, especially for some implicit ones such as Chinese half-width and full-width commas. It can be discovered in time during editing.
2: Some programmers in Oracle will use to_char and to_date methods in where. This method will cause low performance of database execution statements when the amount of data is relatively large, and corresponding modification suggestions are proposed.
3: The execution statement in Ibatis in the Web project contains the $ symbol, generally there is a risk of SQL injection in this category, prompt and give suggestions for modification
4: It is not recommended to use wildcards such as * in ibatis, which is easy to cause maintenance difficulties.

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326606978&siteId=291194637