Created
September 20, 2011 08:46
-
-
Save skuro/1228666 to your computer and use it in GitHub Desktop.
Perf issue
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
// just to show the calls in the wtf.java file | |
public String getId() { | |
return id; | |
} |
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
// How come this sucks 100% CPU time? | |
/** | |
* Adds an object info. | |
*/ | |
public void addObjectInfo(ObjectInfo objectInfo) { | |
if (!addObjectInfos) { | |
return; | |
} | |
if (objectInfo != null && objectInfo.getId() != null) { | |
getObjectInfoMap().put(objectInfo.getId(), objectInfo); | |
} | |
} | |
/** | |
* Returns the object info map. | |
*/ | |
private Map<String, ObjectInfo> getObjectInfoMap() { | |
if (objectInfoMap == null) { | |
objectInfoMap = new HashMap<String, ObjectInfo>(); | |
} | |
return objectInfoMap; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment