Skip to content

Instantly share code, notes, and snippets.

@djleeds
Created January 7, 2013 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save djleeds/4477712 to your computer and use it in GitHub Desktop.
Save djleeds/4477712 to your computer and use it in GitHub Desktop.
Demonstrates suboptimal variable and method names. Copyright (c) 2012 Lampo Licensing, LLC and released under the MIT license
public Address processData(String city) {
Address ret = null;
List<Address> list = getAddresses();
for(Address obj : list) {
if(obj.getCity().equals(city)) {
if(ret == null) {
ret = obj;
} else {
throw new RuntimeException("Found multiple matching addresses.");
}
}
}
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment