Java代码检测工具PMD规则集翻译
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:536871559 0 0 0 415 0;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:42.55pt;
mso-footer-margin:49.6pt;
mso-paper-source:0;
layout-grid:15.6pt;}
div.Section1
{page:Section1;}
-->
Basic Rules
·
EmptyCatchBlock: Empty Catch Block
finds instances where an exception is caught, but nothing is done. In most
circumstances, this swallows an exception which should either be acted on or
reported.
·
EmptyIfStmt: Empty If Statement
finds instances where a condition is checked but nothing is done about it.
·
EmptyWhileStmt: Empty While
Statement finds all instances where a while statement does nothing. If it is a
timing loop, then you should use Thread.sleep() for it; if it's a while loop that
does a lot in the exit expression, rewrite it to make it cl
相关文档:
很多人都知道在swing中加入jPopupMenu组件后可以在鼠标的驱动下探出一个菜单,但是,如果用一般做法,在界面上单击左键也会弹出菜单,那么有没有办法在只有单击右键才弹出菜单呢?其实只是用到了一个小技巧。 你的弹出鼠标菜单鼠标驱动选择 MouseReleased 然后再在监听事件的方法中加入下面的代码就可以了: if(evt.isPop ......
1. 声明(Declarations)
5.1 每行声明变量的数量(Number Per Line)
推荐一行一个声明,因为这样以利于写注释。亦即,
int level; // indentation level
int size; // size of table
要优于,
int level, size;
不要将不同类型变量的声明放在同一行,例如:
int foo, foo ......
Java线程是Java语言中一个非常重要的部分,Java5之前,多线程的语言支持还是比较弱的,内容也较少,写一个复杂的多线程程序是相当有挑战性的。
在Java5以后,Java对多线程做了很多扩展,扩展部分称之为并发包。这部分内容大大增强了Java多线程编程的能力,通过使用Java5线程新特征的API,可以很容易的做出复杂的 ......
java 代码
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList; ......