Project: Eclipse_Platform_UI
Bug 13476 fragile code in WorkbenchActionBuilder.propertyChange
Reported: 2002-04-10 20:25:14 | Status: resolved fixed

The code in WorkbenchActionBuilder.propertyChange assumes that the new value in the change event is (a) always non-null, and (b) always of the expected type. While both condition may hold in the current world, this assumption might lead to breakage in the future. The problem will occur if the property store is changed by some other party. In particular, if the other party uses setToDefault() instead of setValue, the new value will either be null or a string (regardless of its usual type). (N.B. This behavior is true of the older JFace preference store as well as the newer Core preferences.) General rule: listeners for property change events should be written in an unassuming manner.

Files changed in fix:
bundles/org.eclipse.ui/Eclipse UI/org/eclipse/ui/internal/WorkbenchActionBuilder.java