Created
July 19, 2011 17:36
-
-
Save amuino/1093206 to your computer and use it in GitHub Desktop.
The wrong mindset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int numberOfThingsThatAreSorted = getCustomComparatorNumberOfKnownThingsForSorting(); | |
int numberOfActualThings = getAllThings().size(); | |
if (numberOfThingsThatAreSorted < numberOfActualThings) | |
throw new IllegalStateException( | |
"An implementation of ThisClass (whose abstract subclasses are ThatOtherClass and YetAnotherClass) " | |
+ "must ensure that all the Things it specifies are also passed in for custom sorting. Instead found only " | |
+ numberOfThingsThatAreSorted | |
+ " Things to be sorted, as implemented by getCustomComparatorNumberOfKnownThingsForSorting, but " | |
+ numberOfActualThings + " actual Things."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment