| Summary: | [ZoomManager] StringIndexOutOfBoundsException when zoomString is empty | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Karsten Thoms <karsten.thoms> | ||||
| Component: | GEF-Legacy GEF (MVC) | Assignee: | gef-inbox <gef-inbox> | ||||
| Status: | RESOLVED WORKSFORME | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | nyssen | ||||
| Version: | 3.6.2 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
It seems the code was designed this way. All checks related to the validity of the zoom string are handled by having the parsing surrounded with a try/catch block that catches any Exception. The StringIndexOutOfBoundsException is thus never exposed to a client, instead a Display#beep() is issued in such I case (happens within the catch block). As such, resolving this as WORKSFORME. |
Created attachment 194553 [details] Screenshot: Debugger I just catched StringIndexOutOfBoundException in ZoomManager#setZoomAsText(). The passed in zoomString is empty, which causes a StringIndexOutOfBoundsException in this line: if (zoomString.charAt(zoomString.length() - 1) == '%') It might be already an error that an empty string comes in, but here I had no chance influence this. It happened when I initialize an UML class diagram with Topcased. However, the code in ZoomManager should handle this situation more gracefully, e.g. returning fast when the argument is null or empty.