| Summary: | InlineFlow.setBorder not accepting null argument | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Andrew Eisenberg <ade> |
| Component: | GEF-Legacy Draw2d | Assignee: | Pratik Shah <ppshah> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | ppshah |
| Version: | 3.1.1 | ||
| Target Milestone: | 3.4.0 (Ganymede) M5 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
sounds like a bug to me...
Depends on what assumptions in the code of InlineFlow depend on FlowBorder existing.
public void setBorder(Border border) {
if (border == null || border instanceof FlowBorder)
super.setBorder(border);
else
throw new RuntimeException("Border must be an instance of FlowBorder");
}
There are assumptions in the paint routine on the border being a FlowBorder. If you need to change this assumption, then I suggest you create a subclass of InlineFlow to allow for a null border. Both paintBorder and setBorder are protected and public methods respectively. Reopening. You should be able to set the border to null. |
The comment for the method InlineFlow.setBorder says that passing in a null value for the new border is valid. However the code for that method is: public void setBorder(Border border) { if (border instanceof FlowBorder) super.setBorder(border); else throw new RuntimeException("Border must be an instance of FlowBorder"); } This code throws an error when passed a null argument. Is this a bug? I would really like to remove a border of a TextFlow, but I can't do this as it currently stands. thanks, --a