提交 5e0d2afd authored 作者: Thomas Mueller's avatar Thomas Mueller

The compare method was wrong (detected by Java 7).

上级 b970c4ab
...@@ -231,11 +231,14 @@ public class Doclet { ...@@ -231,11 +231,14 @@ public class Doclet {
Arrays.sort(fields, new Comparator<FieldDoc>() { Arrays.sort(fields, new Comparator<FieldDoc>() {
public int compare(FieldDoc a, FieldDoc b) { public int compare(FieldDoc a, FieldDoc b) {
String ca = a.constantValueExpression(); String ca = a.constantValueExpression();
if (ca == null) {
ca = a.name();
}
String cb = b.constantValueExpression(); String cb = b.constantValueExpression();
if (ca != null && cb != null) { if (cb == null) {
return ca.compareTo(cb); cb = b.name();
} }
return a.name().compareTo(b.name()); return ca.compareTo(cb);
} }
}); });
for (FieldDoc field : fields) { for (FieldDoc field : fields) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论