While working on #3251 an equals method was added to TabletMetadata.Location which caused this test to break.
The cause of the breakage in the test was this code that ends up looking up a TabletMetadata.Location object in a set of TServerInstance objects. This works because TabletMetadata.Location extends TServerInstance and does not override equals or hashcode. Overriding the equals method caused the test to break.
It would be much cleaner and less error prone if TabletMetadata.Location encapsulated TServerInstance instead of extending it. If something wanted to compare to the TServerInstance then it could call getTServerInstance() on location and compare to that. Encapsulation instead of extension would allow TabletMetadata.Location to have its own sensible equals and hashcode methods also.
While working on #3251 an equals method was added to TabletMetadata.Location which caused this test to break.
The cause of the breakage in the test was this code that ends up looking up a TabletMetadata.Location object in a set of TServerInstance objects. This works because TabletMetadata.Location extends TServerInstance and does not override equals or hashcode. Overriding the equals method caused the test to break.
It would be much cleaner and less error prone if TabletMetadata.Location encapsulated TServerInstance instead of extending it. If something wanted to compare to the TServerInstance then it could call getTServerInstance() on location and compare to that. Encapsulation instead of extension would allow TabletMetadata.Location to have its own sensible equals and hashcode methods also.