11

我有这段 Java 代码:

/**
 * Initializes the Levenshtein Object with the two given words.
 * 
 * @param word1 first word
 * @param word2 second word
 */
public Levenshtein(String word1, String word2) {
    this.word1 = "." + word1.toLowerCase();
    this.word2 = "." + word2.toLowerCase();
    this.distance = new int[this.word2.length()][this.word1
            .length()];
}

如果我按 Ctrl + Shift + F,我会得到:

/**
 * Initializes the Levenshtein Object with the two given words.
 * 
 * @param word1
 *            first word
 * @param word2
 *            second word
 */
public Levenshtein(String word1, String word2) {
    this.word1 = "." + word1.toLowerCase();
    this.word2 = "." + word2.toLowerCase();
    this.distance = new int[this.word2.length()][this.word1
            .length()];
}

为什么 eclipse 做这个婴儿车换行?我如何切换它(而不是完全为 JavaDoc 切换它)?

这些是我目前在 eclipse 3.5.2 (Galileo) 中使用的格式化程序设置。

4

1 回答 1

17

Window > Preferences > Java > Code style > Formatter
(Edit) > Comments
复选框:@param 标记后的新行

见于朱诺 (4.2)。

于 2012-12-04T12:14:23.323 回答