Lists Instead of Sets

I’m currently being anti-social and sitting in the public library of San Diego. I decided not to go to ComicCon this morning. What I was interested in was getting an autograph from Ray Bradbury, perhaps my favorite author, but I would have had to stand in line to participate in a raffle whether I’d be allowed to stand in line for the autograph. I think I’ll just continue appreciate Bradbury unsigned. I may go later to to a Futurama panel.

Instead, I walked around in San Diego a bit. I visited the Maritime Museum, looked at the USS Midway carrier, then walked inland to a sandwich shop with WiFi that I had picked out for breakfast. It was closed. I then walked to the library, which was nearby and also had free WiFi, with the plan of picking out another place for food. I’d walked over two miles by then and was getting a bit toasty, though, so I stayed and flipped through the book on graph enumeration and Polya’s theorem. So far I’ve preferred the nice temperature inside the library over food, and I still haven’t eaten.

I continued writing the unit test for the implication operation that I couldn’t finish yesterday night. I wanted to do something like

1
2
3
4
5
6
@Combine(Combine.Mode.IMPLIES)
@interface ImpliesTest {
  @IsNonZeroAnnotation[] value() default {
    @IsNonZeroAnnotation(0),
    @IsNonZeroAnnotation(0)};
}

but my program told me I couldn’t do that. For optimization reasons, I had used sets of annotations to be combined, not lists. I figured there was no reason to specify exactly the same annotation twice, so a set was more appropriate than a list. I still think it’s not strictly necessary to have the same annotation twice, but it can definitely be convenient. So now I’m changing my code from sets to lists, a pretty big change for a short stay at the library.

I think I should go eat soon, though. I can hear my stomach growl, even though I’m listening to the Rolling Stones with earphones.

Share

About Mathias

Software development engineer. Principal developer of DrJava. Recent Ph.D. graduate from the Department of Computer Science at Rice University.
This entry was posted in Concurrent Unit Testing. Bookmark the permalink.

Leave a Reply