| Summary: | NullPointerException when calling Shape constructor thru Polygon default constructor | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Jose M Beleta <jose> | ||||||
| Component: | GEF-Legacy Draw2d | Assignee: | Marc Gobeil <mgobeil> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | critical | ||||||||
| Priority: | P3 | CC: | ahunter.eclipse, mgobeil | ||||||
| Version: | 3.5 | ||||||||
| Target Milestone: | 3.5.0 (Galileo SR2) | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows Vista | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Jose M Beleta
Created attachment 141535 [details]
proposed patch
comitted to HEAD and R3_5_maintenance The proposed patch does not work because it throws the NullPointerException too, now in Polyline.getBounds(). The problem happens because a repaint is done in the shape constructor. The repaint() is called by setOpaque(). setOpaque() cannot be called in the Shape constructor. Perhaps you should build some tests that include PolyLines. Here is the new stack: Thread [main] (Suspended (exception NullPointerException)) PolygonFigure(Polyline).getBounds() line: 69 PolygonFigure(Figure).repaint() line: 1328 PolygonFigure(Polyline).repaint() line: 141 PolygonFigure(Figure).setOpaque(boolean) line: 1579 PolygonFigure(Shape).<init>() line: 73 PolygonFigure(AbstractPointListShape).<init>() line: 23 PolygonFigure(Polyline).<init>() line: 28 PolygonFigure(Polygon).<init>() line: 23 PolygonFigure.<init>(PointList) line: 42 ... Created attachment 142325 [details] revised patch Sorry about that. As discussed in bug 267397, setOpaque()'s functionality is being ignored by Shape anyway, so it's safe to simply remove it from the constructor. Seems fine on my end, does it work for you? (In reply to comment #4) > Seems fine on my end, does it work for you? Jose? Does this work for you? (In reply to comment #5) > (In reply to comment #4) > > Seems fine on my end, does it work for you? > > Jose? Does this work for you? I am so sorry for answering so late. Yes it works for me thank you. Committed to HEAD and R3_5_maintenance. |