KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Possible Duplicate: Is Java “pass-by-reference”? I found an unusual Java method today: private void addShortenedName(ArrayList<String> voiceSetList, String vsName) { if (null == vsName) vsName = ""; else vsName = vsName.trim(); String shortenedVoiceSetName = vsName.substring(0, Math.min(8, vsName.length())); //SCR10638 - Prevent export of empty rows. if (shortenedVoiceSetName.length() > 0) { if (!voiceSetList.contains("#" + shortenedVoiceSetName)) voiceSetList.add("#" + shortenedVoiceSetName); } } According to everything I've read about Java's behavior for passing variables, complex objects or not, this code should do exactly nothing. So um...am I missing something here? Is there some subtlety that was lost on me, or does this code belong on thedailywtf?
Tags (comma-separated)
Save Edits
Cancel