提交 a7274d19 编写于 作者: K Kohsuke Kawaguchi

better type-safety

上级 cdfdb177
...@@ -56,7 +56,7 @@ import java.util.Map; ...@@ -56,7 +56,7 @@ import java.util.Map;
* *
* @author Kohsuke Kawaguchi * @author Kohsuke Kawaguchi
*/ */
public class MatrixConfiguration extends Project<MatrixConfiguration,MatrixRun> implements SCMedItem, NonBlockingTask, Comparable { public class MatrixConfiguration extends Project<MatrixConfiguration,MatrixRun> implements SCMedItem, NonBlockingTask, Comparable<MatrixConfiguration> {
/** /**
* The actual value combination. * The actual value combination.
*/ */
...@@ -289,20 +289,18 @@ public class MatrixConfiguration extends Project<MatrixConfiguration,MatrixRun> ...@@ -289,20 +289,18 @@ public class MatrixConfiguration extends Project<MatrixConfiguration,MatrixRun>
public void setLogRotator(LogRotator logRotator) { public void setLogRotator(LogRotator logRotator) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
public int compareTo(Object object){ public int compareTo(MatrixConfiguration that) {
MatrixConfigurationSorter sorter = getParent().getSorter(); MatrixConfigurationSorter sorter = getParent().getSorter();
try{ try {
if(sorter!=null){ if (sorter != null) {
return getParent().getSorter().compare(this, (MatrixConfiguration)object); return getParent().getSorter().compare(this, that);
} } else {
else{ return getDisplayName().compareTo(((MatrixConfiguration) that).getDisplayName());
return getDisplayName().compareTo(((MatrixConfiguration)object).getDisplayName());
}
}
catch(Exception e){
throw new IllegalArgumentException(e);
} }
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册