Program: 64994
Project: 64994
Buggy source:
/** 
 * Test the properties of the image. These properties are well defined in the design file.
 * @throws Exception if errors occur when reads the design file
 */
public void testReadProperties() throws Exception {
  openDesign("String_Node_Str");
  image=findImageItemByName("String_Node_Str");
  double scale=handle.getScale();
  assertTrue(scale == 0.8);
  assertEquals("String_Node_Str",handle.getRole());
  String size=handle.getSize();
  assertEquals(DesignChoiceConstants.IMAGE_SIZE_SCALE_TO_ITEM,size);
  String helpText=handle.getAltText();
  assertEquals("String_Node_Str",helpText);
  String refType=handle.getSource();
  assertEquals(DesignChoiceConstants.IMAGE_REF_TYPE_URL,refType);
  String url=handle.getURI();
  assertEquals("String_Node_Str",url);
  assertEquals(DesignChoiceConstants.ACTION_LINK_TYPE_HYPERLINK,handle.getActionHandle().getLinkType());
  assertFalse(handle.fitToContainer());
  assertTrue(handle.isProportionalScale());
  image=findImageItemByName("String_Node_Str");
  refType=handle.getSource();
  assertEquals(DesignChoiceConstants.IMAGE_REF_TYPE_EMBED,refType);
  String imageName=handle.getImageName();
  assertEquals("String_Node_Str",imageName);
  helpText=handle.getHelpText();
  assertEquals("String_Node_Str",helpText);
  image=findImageItemByName("String_Node_Str");
  refType=handle.getSource();
  assertEquals(DesignChoiceConstants.IMAGE_REF_TYPE_EXPR,refType);
  String typeExpression=handle.getTypeExpression();
  assertEquals("String_Node_Str",typeExpression);
  String valueExpression=handle.getValueExpression();
  assertEquals("String_Node_Str",valueExpression);
  helpText=handle.getHelpText();
  assertEquals("String_Node_Str",helpText);
  image=findImageItemByName("String_Node_Str");
  ActionHandle actionHandle=image.handle(design).getActionHandle();
  assertNull(actionHandle);
  image=findImageItemByName("String_Node_Str");
  handle=image.handle(design);
  assertEquals(ReportDesign.BODY_SLOT,handle.getContainer().findContentSlot(handle));
  assertEquals("String_Node_Str",handle.getImageName());
  assertEquals("String_Node_Str",handle.getHelpText());
  assertEquals("String_Node_Str",handle.getHelpTextKey());
  actionHandle=handle.getActionHandle();
  assertNotNull(actionHandle);
  assertEquals("String_Node_Str",actionHandle.getURI());
  assertTrue(handle.fitToContainer());
  assertEquals("String_Node_Str",handle.getRole());
  assertEquals("String_Node_Str",handle.getLanguage());
  assertEquals(1,handle.getOrder());
}

Fixed version (ground truth):
/** 
 * Test the properties of the image. These properties are well defined in the design file.
 * @throws Exception if errors occur when reads the design file
 */
public void testReadProperties() throws Exception {
  openDesign("String_Node_Str");
  image=findImageItemByName("String_Node_Str");
  double scale=handle.getScale();
  assertTrue(scale == 0.8);
  assertEquals("String_Node_Str",handle.getTagType());
  String size=handle.getSize();
  assertEquals(DesignChoiceConstants.IMAGE_SIZE_SCALE_TO_ITEM,size);
  String helpText=handle.getAltText();
  assertEquals("String_Node_Str",helpText);
  String refType=handle.getSource();
  assertEquals(DesignChoiceConstants.IMAGE_REF_TYPE_URL,refType);
  String url=handle.getURI();
  assertEquals("String_Node_Str",url);
  assertEquals(DesignChoiceConstants.ACTION_LINK_TYPE_HYPERLINK,handle.getActionHandle().getLinkType());
  assertFalse(handle.fitToContainer());
  assertTrue(handle.isProportionalScale());
  image=findImageItemByName("String_Node_Str");
  refType=handle.getSource();
  assertEquals(DesignChoiceConstants.IMAGE_REF_TYPE_EMBED,refType);
  String imageName=handle.getImageName();
  assertEquals("String_Node_Str",imageName);
  helpText=handle.getHelpText();
  assertEquals("String_Node_Str",helpText);
  image=findImageItemByName("String_Node_Str");
  refType=handle.getSource();
  assertEquals(DesignChoiceConstants.IMAGE_REF_TYPE_EXPR,refType);
  String typeExpression=handle.getTypeExpression();
  assertEquals("String_Node_Str",typeExpression);
  String valueExpression=handle.getValueExpression();
  assertEquals("String_Node_Str",valueExpression);
  helpText=handle.getHelpText();
  assertEquals("String_Node_Str",helpText);
  image=findImageItemByName("String_Node_Str");
  ActionHandle actionHandle=image.handle(design).getActionHandle();
  assertNull(actionHandle);
  image=findImageItemByName("String_Node_Str");
  handle=image.handle(design);
  assertEquals(ReportDesign.BODY_SLOT,handle.getContainer().findContentSlot(handle));
  assertEquals("String_Node_Str",handle.getImageName());
  assertEquals("String_Node_Str",handle.getHelpText());
  assertEquals("String_Node_Str",handle.getHelpTextKey());
  actionHandle=handle.getActionHandle();
  assertNotNull(actionHandle);
  assertEquals("String_Node_Str",actionHandle.getURI());
  assertTrue(handle.fitToContainer());
  assertEquals("String_Node_Str",handle.getTagType());
  assertEquals("String_Node_Str",handle.getLanguage());
  assertEquals(1,handle.getOrder());
}