diff options
author | Paul Phillips <paulp@improving.org> | 2012-09-04 14:51:05 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-09-04 20:11:06 -0700 |
commit | 5b9b394d99bd7e4446e0f15475b34ec287d91685 (patch) | |
tree | 3f4d0f74f0ebd341fb453fd6a07d31e17423b4d2 /test/files/pos/t5957 | |
parent | 9556dfbf9dbb1b129b5eaab577d90cf09206ed4d (diff) | |
download | scala-5b9b394d99bd7e4446e0f15475b34ec287d91685.tar.gz scala-5b9b394d99bd7e4446e0f15475b34ec287d91685.tar.bz2 scala-5b9b394d99bd7e4446e0f15475b34ec287d91685.zip |
Removing duplication from Duration.
I don't know what good it is to have code review if we are checking
in code like this. We must raise the bar, people. When the
justification for code being in the standard library is borderline
at best - as it is here - then the code must be of exceptional
quality. This code is not of exceptional quality.
Mostly these are not behavioral changes, but:
- I removed finite_? as it is a gratuitous deviation from
every isXXX method in the world. This isn't ruby.
- I removed all the regexps, which only made things complicated
- I removed all the unnecessary casts, which is to say, all of them
- I made more things final, sealed, and private
- The unapply structure was all wrong; returning Option[Duration]
on the string unapply meant you'd have to say
case Duration(Duration(x, y)) => ...
So I fixed apply and unapply to be symmetric.
- And I removed the "parse" method, since it was doing what
apply is supposed to do.
There's a test case to exercise accessing it from java,
which also reveals what I hope are bugs.
Thanks to viktor klang for DurationConversions.
Diffstat (limited to 'test/files/pos/t5957')
0 files changed, 0 insertions, 0 deletions