亚洲成人精品影院,av大大超碰在线,欧美人体大胆444wwwhttp://www.aygfsteel.com/sway/category/35106.html彪悍的人生不需要解釋,彪悍的代碼不需要注釋。zh-cnFri, 07 Nov 2008 08:54:30 GMTFri, 07 Nov 2008 08:54:30 GMT60checkstyle常用的輸出結果解釋http://www.aygfsteel.com/sway/archive/2008/11/06/238983.htmlKevin.ZhongKevin.ZhongThu, 06 Nov 2008 03:27:00 GMThttp://www.aygfsteel.com/sway/archive/2008/11/06/238983.htmlhttp://www.aygfsteel.com/sway/comments/238983.htmlhttp://www.aygfsteel.com/sway/archive/2008/11/06/238983.html#Feedback0http://www.aygfsteel.com/sway/comments/commentRss/238983.htmlhttp://www.aygfsteel.com/sway/services/trackbacks/238983.html 2“{” should be on the previous line “{” 應該位于前一行
3Methos is missing a javadoc comment方法前面缺少javadoc注釋
4Expected @throws tag for “Exception”在注釋中希望有@throws的說明
5“.” Is preceeded with whitespace “.” 前面不能有空格
6“.” Is followed by whitespace“.” 后面不能有空格
7“=” is not preceeded with whitespace“=” 前面缺少空格
8“=” is not followed with whitespace“=” 后面缺少空格
9“}” should be on the same line“}” 應該與下條語句位于同一行
10Unused @param tag for “unused”沒有參數“unused”,不需注釋
11Variable “CA” missing javadoc變量“CA”缺少javadoc注釋
12Line longer than 80characters行長度超過80
13Line contains a tab character行含有”tab” 字符
14Redundant “Public” modifier冗余的“public” modifier
15Final modifier out of order with the JSL suggestionFinal modifier的順序錯誤
16Avoid using the “.*” form of importImport格式避免使用“.*”
17Redundant import from the same package從同一個包中Import內容
18Unused import-java.util.listImport進來的java.util.list沒有被使用
19Duplicate import to line 13重復Import同一個內容
20Import from illegal package從非法包中 Import內容
21“while” construct must use “{}”“while” 語句缺少“{}”
22Variable “sTest1” must be private and have accessor method變量“sTest1”應該是private的,并且有調用它的方法
23Variable “ABC” must match pattern “^[a-z][a-zA-Z0-9]*$”變量“ABC”不符合命名規則“^[a-z][a-zA-Z0-9]*$”
24“(” is followed by whitespace“(” 后面不能有空格 25“)” is proceeded by whitespace“)” 前面不能有空格

Kevin.Zhong 2008-11-06 11:27 發表評論
]]>
利用Ecipse生成Javadoc亂碼解決方法http://www.aygfsteel.com/sway/archive/2008/11/05/238822.htmlKevin.ZhongKevin.ZhongWed, 05 Nov 2008 06:53:00 GMThttp://www.aygfsteel.com/sway/archive/2008/11/05/238822.htmlhttp://www.aygfsteel.com/sway/comments/238822.htmlhttp://www.aygfsteel.com/sway/archive/2008/11/05/238822.html#Feedback0http://www.aygfsteel.com/sway/comments/commentRss/238822.htmlhttp://www.aygfsteel.com/sway/services/trackbacks/238822.html 1)  -encoding charsetName
2) -charset charsetName

第一個參數表示javadoc 程序讀取java源文件時候應該采用什么編碼
第二個參數表示javadoc 程序寫html文件時采用的編碼形式,并會在HTML中加入如下標簽

 網管下載dl.bitscn.com

1 <! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" >
2 <!-- NewPage -->
3 < HTML >
4 < HEAD >
5 <!--  Generated by javadoc (build 1.5.0) on Thu Feb 01 21:10:10 CST 2007  --> 
6 <!-- -這下面的charset隨編碼的不同而不同,這里面為utf-8編碼-- -->
7 < META  http-equiv ="Content-Type"  content ="text/html; charset=utf-8" >

如果文件格式為UTF8格式的,可以采用如下形式進行Generate Javadoc:
javadoc  -encoding UTF-8 -charset UTF-8 <other params>

Kevin.Zhong 2008-11-05 14:53 發表評論
]]>
ArrayList 使用默認構造函數時,其預設置的數組大小是多少?http://www.aygfsteel.com/sway/archive/2008/10/10/233538.htmlKevin.ZhongKevin.ZhongFri, 10 Oct 2008 03:15:00 GMThttp://www.aygfsteel.com/sway/archive/2008/10/10/233538.htmlhttp://www.aygfsteel.com/sway/comments/233538.htmlhttp://www.aygfsteel.com/sway/archive/2008/10/10/233538.html#Feedback0http://www.aygfsteel.com/sway/comments/commentRss/233538.htmlhttp://www.aygfsteel.com/sway/services/trackbacks/233538.html
ArrayList 默認的大小為 10

ArrayList源代碼:

/**
* Constructs an empty list with an initial capacity of ten.
*/

public ArrayList() {

this(10);

}
HashSet默認大小與HashMap一樣 為 16 (因為HashSet就是使用HashMap的key來保存對象)

HashMap源代碼:

static final int DEFAULT_INITIAL_CAPACITY = 16;

/**
* Constructs an empty <tt>HashMap</tt> with the default initial capacity
* (16) and the default load factor (0.75).
*/

public HashMap() {

this.loadFactor = DEFAULT_LOAD_FACTOR;

threshold 
= (int)(DEFAULT_INITIAL_CAPACITY * DEFAULT_LOAD_FACTOR);

table 
= new Entry[DEFAULT_INITIAL_CAPACITY];

init();

}



Kevin.Zhong 2008-10-10 11:15 發表評論
]]>
使用Eclipse 3.3插件生成hashCode方法的陷阱 http://www.aygfsteel.com/sway/archive/2008/10/10/233528.htmlKevin.ZhongKevin.ZhongFri, 10 Oct 2008 02:52:00 GMThttp://www.aygfsteel.com/sway/archive/2008/10/10/233528.htmlhttp://www.aygfsteel.com/sway/comments/233528.htmlhttp://www.aygfsteel.com/sway/archive/2008/10/10/233528.html#Feedback0http://www.aygfsteel.com/sway/comments/commentRss/233528.htmlhttp://www.aygfsteel.com/sway/services/trackbacks/233528.html先來解釋一下hashCode這個方法的作用: - (摘自JDK docs)
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.
從注釋上可以知道,hashCode可用于如Hashtable,HashMap這些集合對象,它通過hashCode對集合中的元素進行
散列處理,這樣在查找時,通過hashCode可以很迅速的進行對象的查找操作。

However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables.
但是每位PG需要知道,如果不對Object的hashCode對象復寫,則其它生成規則是根據內部的指針地址來算出hashCode。(這一點大家得特別注意)

下面是eclipse生成代碼的一個示例:

public int hashCode() {

final int prime = 31;

int result = super.hashCode();

result 
= prime * result + ((name == null? 0 : name.hashCode());

return result;

}

它的問題就是,result中調用了 *super.hashCode()。*這么一來,同一個類被實例化多次后,雖然它們的名稱都相同
但生成的hashCode都不同,當然在那些集合類中使用返回的也會有問題了。



Kevin.Zhong 2008-10-10 10:52 發表評論
]]>
主站蜘蛛池模板: 龙南县| 托里县| 巴中市| 离岛区| 承德市| 昔阳县| 安阳县| 中卫市| 普兰县| 东台市| 芜湖县| 资溪县| 大邑县| 大洼县| 应城市| 酒泉市| 抚宁县| 芷江| 奉贤区| 赣榆县| 临江市| 遂昌县| 龙南县| 安平县| 高邑县| 中卫市| 郴州市| 林甸县| 定西市| 界首市| 孟连| 广元市| 旌德县| 高清| 灵川县| 华池县| 菏泽市| 中卫市| 宽城| 永安市| 龙游县|