Buggy code:
public class DTest { public static Element testElementNode ; public static Attr testAttributeNode ; public static Text testTextNode ; public static CDATASection testCDATASectionNode ; public static EntityReference testEntityReferenceNode ; public static Entity testEntityNode ; public static ProcessingInstruction testProcessingInstructionNode ; public static Comment testCommentNode ; public static Document testDocumentNode ; public static DocumentType testDocumentTypeNode ; public static DocumentFragment testDocumentFragmentNode ; public static Notation testNotationNode ; public DTest ( ) { } public Document createDocument ( ) { } public DocumentType createDocumentType ( Document doc , String name ) { } public Entity createEntity ( Document doc , String name ) { } public Notation createNotation ( Document doc , String name ) { } public void docBuilder ( Document document , String name ) { } public static boolean DOMExceptionsTest ( Object node , String methodName , Class [ ] methodSignature , Object [ ] parameters , short code ) { } public void findTestNodes ( Document document ) { } public void findTestNodes ( Node node ) { } public static void main ( String [ ] args ) { } public void testAttr ( Document document ) { Node node ; Attr attributeNode ; Attr attribute2 ; String compare ; boolean T = true ; boolean F = false ; boolean OK = true ; Attr testAttribute = document . createAttribute ( "testAttribute" ) ; testAttribute . setValue ( "testAttribute's<seq2seq4repair_space>value" ) ; node = document . getDocumentElement ( ) ; ( ( Element ) ( node ) ) . setAttributeNode ( testAttribute ) ; attributeNode = ( ( Element ) ( node ) ) . getAttributeNode ( "testAttribute" ) ; compare = "testAttribute" ; if ( ! ( compare . equals ( attributeNode . getName ( ) ) ) ) { System . out . println ( "Warning!!!<seq2seq4repair_space>Attr's<seq2seq4repair_space>'getName'<seq2seq4repair_space>method<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>work<seq2seq4repair_space>properly!" ) ; OK = false ; } compare = "testAttribute's<seq2seq4repair_space>value" ; if ( ! ( compare . equals ( attributeNode . getNodeValue ( ) ) ) ) { System . out . println ( "Warning!!!<seq2seq4repair_space>Attr's<seq2seq4repair_space>'getNodeValue'<seq2seq4repair_space>method<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>work<seq2seq4repair_space>properly!" ) ; OK = false ; } if ( ( ! T ) == ( attributeNode . getSpecified ( ) ) ) { System . out . println ( "Warning!!!<seq2seq4repair_space>Attr's<seq2seq4repair_space>'getSpecified'<seq2seq4repair_space>method<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>work<seq2seq4repair_space>properly!" ) ; OK = false ; } if ( ! ( compare . equals ( attributeNode . getValue ( ) ) ) ) { System . out . println ( "Warning!!!<seq2seq4repair_space>Attr's<seq2seq4repair_space>'getValue'<seq2seq4repair_space>method<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>work<seq2seq4repair_space>properly!" ) ; OK = false ; } attributeNode . setNodeValue ( "Reset<seq2seq4repair_space>Value" ) ; compare = "Reset<seq2seq4repair_space>Value" ; if ( ! ( compare . equals ( attributeNode . getNodeValue ( ) ) ) ) { System . out . println ( "Warning!!!<seq2seq4repair_space>Attr's<seq2seq4repair_space>'setNodeValue'<seq2seq4repair_space>method<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>work<seq2seq4repair_space>properly!" ) ; OK = false ; } ( ( org . apache . xerces . dom . AttrImpl ) ( attributeNode ) ) . setSpecified ( F ) ; if ( ( ! F ) == ( attributeNode . getSpecified ( ) ) ) { System . out . println ( "Warning!!!<seq2seq4repair_space>Attr's<seq2seq4repair_space>'setSpecified'<seq2seq4repair_space>method<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>work<seq2seq4repair_space>properly!" ) ; OK = false ; } attributeNode . setValue ( null ) ; <START_BUG> if ( ! ( attributeNode . getValue ( ) . equals ( "" ) ) ) { <END_BUG> System . out . println ( "Warning!!!<seq2seq4repair_space>Attr's<seq2seq4repair_space>'setValue'<seq2seq4repair_space>to<seq2seq4repair_space>'null'<seq2seq4repair_space>method<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>work<seq2seq4repair_space>properly!" ) ; OK = false ; } attributeNode . setValue ( "Another<seq2seq4repair_space>value<seq2seq4repair_space>" ) ; compare = "Another<seq2seq4repair_space>value<seq2seq4repair_space>" ; if ( ! ( compare . equals ( attributeNode . getValue ( ) ) ) ) { System . out . println ( "Warning!!!<seq2seq4repair_space>Attr's<seq2seq4repair_space>'setValue'<seq2seq4repair_space>method<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>work<seq2seq4repair_space>properly!" ) ; OK = false ; } node = attributeNode . cloneNode ( T ) ; if ( ! ( ( node . getNodeName ( ) . equals ( attributeNode . getNodeName ( ) ) ) && ( ( ( node . getNodeValue ( ) ) != null ) && ( ( attributeNode . getNodeValue ( ) ) != null ) ) ? node . getNodeValue ( ) . equals ( attributeNode . getNodeValue ( ) ) : ( ( node . getNodeValue ( ) ) == null ) && ( ( attributeNode . getNodeValue ( ) ) == null ) ) ) { System . out . println ( "'cloneNode'<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>clone<seq2seq4repair_space>the<seq2seq4repair_space>Attribute<seq2seq4repair_space>node<seq2seq4repair_space>correctly" ) ; OK = false ; } DTest tests = new DTest ( ) ; Assertion . verify ( DTest . DOMExceptionsTest ( document . getDocumentElement ( ) , "appendChild" , new Class [ ] { Node . class } , new Object [ ] { attributeNode } , DOMException . HIERARCHY_REQUEST_ERR ) ) ; attribute2 = document . createAttribute ( "testAttribute2" ) ; Assertion . verify ( DTest . DOMExceptionsTest ( document . getDocumentElement ( ) , "removeAttributeNode" , new Class [ ] { Attr . class } , new Object [ ] { attribute2 } , DOMException . NOT_FOUND_ERR ) ) ; Element element = ( ( Element ) ( document . getLastChild ( ) . getLastChild ( ) ) ) ; Assertion . verify ( DTest . DOMExceptionsTest ( element , "setAttributeNode" , new Class [ ] { Attr . class } , new Object [ ] { testAttribute } , DOMException . INUSE_ATTRIBUTE_ERR ) ) ; if ( ! OK ) System . out . println ( "\n*****The<seq2seq4repair_space>Attr<seq2seq4repair_space>method<seq2seq4repair_space>calls<seq2seq4repair_space>listed<seq2seq4repair_space>above<seq2seq4repair_space>failed,<seq2seq4repair_space>all<seq2seq4repair_space>others<seq2seq4repair_space>worked<seq2seq4repair_space>correctly.*****" ) ; } public void testCDATASection ( Document document ) { } public void testCharacterData ( Document document ) { } public void testChildNodeList ( Document document ) { } public void testComment ( Document document ) { } public void testDeepNodeList ( Document document ) { } public void testDocument ( Document document ) { } public void testDocumentFragment ( Document document ) { } public void testDocumentType ( Document document ) { } public void testDOMerrors ( Document document ) { } public void testDOMImplementation ( Document document ) { } public void testElement ( Document document ) { } public void testEntity ( Document document ) { } public void testEntityReference ( Document document ) { } public void testNode ( Document document ) { } public void testNotation ( Document document ) { }

Fix:
if ( ( attributeNode . getValue ( ) . length ( ) ) != 0 ) {