Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311302

Summary: NPE getting address of a Relation
Product: [Eclipse Project] Platform Reporter: Carolyn MacLeod <carolynmacleod4>
Component: SWTAssignee: Carolyn MacLeod <carolynmacleod4>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Silenio_Quarti
Version: 3.6Flags: Silenio_Quarti: review+
Target Milestone: 3.6 RC1   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
patch none

Description Carolyn MacLeod CLA 2010-05-01 23:37:04 EDT
Set Accessible.DEBUG = true, then run LiveRegionExample and then run JAWS.
NPE in Accessible.get_relation on the statement relation.objIAccessibleRelation.getAddress() because relation.objIAccessibleRelation is null. This is because relation.objIAccessibleRelation is created when AddRef is called, and it doesn't get called until the next line of code.

It should not matter whether Relation's AddRef or getAddress is called first. The object should be created in getAddress if it was not created yet.
Because of this bug, I noticed that some QueryInterface/getAddress() cleanup did not get done in the Relation class. The patch fixes both of these problems, and makes the code in Relation class consistent with the code in Accessible class.
Comment 1 Carolyn MacLeod CLA 2010-05-01 23:37:54 EDT
Created attachment 166726 [details]
patch
Comment 2 Carolyn MacLeod CLA 2010-05-03 22:40:08 EDT
Fixed > 20100503