Created
January 7, 2013 19:35
-
-
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
This file contains 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
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