易截截图软件、单文件、免安装、纯绿色、仅160KB

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


相关文档:

如何用javaAPI取得java进程的PID?

没有一个平台独立的方法能够在所有的JVM上实现。一个最简单、最接近取得PID的办法是使用:
ManagementFactory.getRuntimeMXBean().getName() 。
取得到的字符窜的格式为[PROCESS_ID]@[MACHINE_NAME],通过解析这个字符串就可以得到java进程的PID。
在以下平台上测试通过:
1、Windows、Linux上的Sun JDK1.5、JDK6
2、H ......

java的两种多态

     1. Java中除了static和final方法外,其他所有的方法都是运行时绑定的。private方法都被隐式指定为final的,因此final的方法不会在运行时绑定。当在派生类中重写基类中static、final、或private方法时,实质上是创建了一个新的方法。
     2.在派生类中,对于基类中的pr ......

java编码规范_缩进和注释

1.       缩进排版(Indentation)
4个空格常被作为缩进排版的一个单位。缩进的确切解释并未详细指定(空格 vs. 制表符)。一个制表符等于n个空格(视具体的编辑器而定,Eclipse默认一个制表符为4个字符)。
3.1    行长度(Line Length)
尽量避免一行的长度超过80个字符,因为很 ......

java编码规范_声明和语句

1.       声明(Declarations)
5.1  每行声明变量的数量(Number Per Line)
推荐一行一个声明,因为这样以利于写注释。亦即,
int level; // indentation level
int size; // size of table
要优于,
int level, size;
不要将不同类型变量的声明放在同一行,例如:
int foo, foo ......

java多线程学习

package thread;
public class ThreadTest {

public static void main(String args[])
{
//new TestThread ().start();
TestThread tt= new TestThread();//创建TestThread类的一个实例
Thread t= new Thread(tt);//创建一个Thread类的实例
t.start();//使线程进入Runnable状态
new Thread(tt).star ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号