| Summary: | Excessive garbage collection on Layer.containsPoint | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | John Swanke <jswanke> |
| Component: | GEF-Legacy Draw2d | Assignee: | Anthony Hunter <ahunter.eclipse> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ahunter.eclipse, danberg, mdelder |
| Version: | 3.4 | ||
| Target Milestone: | 3.5.0 (Galileo) M5 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Committed to HEAD |
YourKit pinpoints this method in Layer as having excessive garbage collection. This: Point pt = new Point(x, y); should probably be replaced with (as it is in other similar GEF methods) Point pt = Point.SINGLETON; pt.setLocation(x, y); The method is: public boolean containsPoint(int x, int y) { if (isOpaque()) return super.containsPoint(x, y); Point pt = new Point(x, y); translateFromParent(pt); for (int i = 0; i < getChildren().size(); i++) { IFigure child = (IFigure)getChildren().get(i); if (child.containsPoint(pt.x, pt.y)) return true; } return false; }