Buggy code:
private static final String ATTR_VERSION_CODE = "android:versionCode" ; private static final String ATTR_SHARED_USER_ID = "android:sharedUserId" ; private static final String ATTR_DEBUGGABLE = "android:debuggable" ; private static final String ELEM_APPLICATION = "application" ; private Manifest manifest ; protected String manifestVersionName ; protected Integer manifestVersionCode ; private boolean manifestVersionCodeAutoIncrement = false ; protected Boolean manifestVersionCodeUpdateFromVersion = false ; protected String manifestSharedUserId ; protected Boolean manifestDebuggable ; private String parsedVersionName ; private Integer parsedVersionCode ; private boolean parsedVersionCodeAutoIncrement ; private Boolean parsedVersionCodeUpdateFromVersion ; private String parsedSharedUserId ; private Boolean parsedDebuggable ; public void execute ( ) throws MojoExecutionException , MojoFailureException { } private void parseConfiguration ( ) { } private Document readManifest ( File manifestFile ) throws IOException , ParserConfigurationException , SAXException { } private void writeManifest ( File manifestFile , Document doc ) throws IOException , TransformerException { } public void updateManifest ( File manifestFile ) throws IOException , ParserConfigurationException , TransformerException , MojoFailureException , SAXException { Document doc = readManifest ( manifestFile ) ; Element manifestElement = doc . getDocumentElement ( ) ; boolean dirty = false ; if ( StringUtils . isEmpty ( parsedVersionName ) ) { parsedVersionName = project . getVersion ( ) ; } Attr versionNameAttrib = manifestElement . getAttributeNode ( ManifestUpdateMojo . ATTR_VERSION_NAME ) ; if ( ( versionNameAttrib == null ) || ( ! ( StringUtils . equals ( parsedVersionName , versionNameAttrib . getValue ( ) ) ) ) ) { getLog ( ) . info ( ( ( ( "Setting<seq2seq4repair_space>" + ( ManifestUpdateMojo . ATTR_VERSION_NAME ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( parsedVersionName ) ) ) ; manifestElement . setAttribute ( ManifestUpdateMojo . ATTR_VERSION_NAME , parsedVersionName ) ; dirty = true ; } if ( ( ( ( parsedVersionCodeAutoIncrement ) && ( ( parsedVersionCode ) != null ) ) || ( ( parsedVersionCodeUpdateFromVersion ) && ( ( parsedVersionCode ) != null ) ) ) || ( ( parsedVersionCodeAutoIncrement ) && ( parsedVersionCodeUpdateFromVersion ) ) ) { throw new MojoFailureException ( ( "versionCodeAutoIncrement,<seq2seq4repair_space>versionCodeUpdateFromVersion<seq2seq4repair_space>and<seq2seq4repair_space>versionCode<seq2seq4repair_space>" + ( "are<seq2seq4repair_space>mutual<seq2seq4repair_space>exclusive.<seq2seq4repair_space>They<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>specified<seq2seq4repair_space>at<seq2seq4repair_space>the<seq2seq4repair_space>same<seq2seq4repair_space>time.<seq2seq4repair_space>" + "Please<seq2seq4repair_space>specify<seq2seq4repair_space>either<seq2seq4repair_space>versionCodeAutoIncrement,<seq2seq4repair_space>versionCodeUpdateFromVersion<seq2seq4repair_space>or<seq2seq4repair_space>versionCode!" ) ) ) ; } if ( parsedVersionCodeAutoIncrement ) { Attr versionCode = manifestElement . getAttributeNode ( ManifestUpdateMojo . ATTR_VERSION_CODE ) ; int currentVersionCode = 0 ; if ( versionCode != null ) { currentVersionCode = NumberUtils . toInt ( versionCode . getValue ( ) , 0 ) ; } currentVersionCode ++ ; manifestElement . setAttribute ( ManifestUpdateMojo . ATTR_VERSION_CODE , String . valueOf ( currentVersionCode ) ) ; dirty = true ; } if ( parsedVersionCodeUpdateFromVersion ) { String verString = project . getVersion ( ) ; getLog ( ) . debug ( ( "Generating<seq2seq4repair_space>versionCode<seq2seq4repair_space>for<seq2seq4repair_space>" + verString ) ) ; ArtifactVersion artifactVersion = new DefaultArtifactVersion ( verString ) ; String verCode = ( ( Integer . toString ( artifactVersion . getMajorVersion ( ) ) ) + ( Integer . toString ( artifactVersion . getMinorVersion ( ) ) ) ) + ( Integer . toString ( artifactVersion . getIncrementalVersion ( ) ) ) ; getLog ( ) . info ( ( ( ( "Setting<seq2seq4repair_space>" + ( ManifestUpdateMojo . ATTR_VERSION_CODE ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + verCode ) ) ; manifestElement . setAttribute ( ManifestUpdateMojo . ATTR_VERSION_CODE , verCode ) ; dirty = true ; } if ( ( parsedVersionCode ) != null ) { Attr versionCodeAttr = manifestElement . getAttributeNode ( ManifestUpdateMojo . ATTR_VERSION_CODE ) ; int currentVersionCode = 0 ; if ( versionCodeAttr != null ) { currentVersionCode = NumberUtils . toInt ( versionCodeAttr . getValue ( ) , 0 ) ; } if ( currentVersionCode != ( parsedVersionCode ) ) { getLog ( ) . info ( ( ( ( "Setting<seq2seq4repair_space>" + ( ManifestUpdateMojo . ATTR_VERSION_CODE ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( parsedVersionCode ) ) ) ; manifestElement . setAttribute ( ManifestUpdateMojo . ATTR_VERSION_CODE , String . valueOf ( parsedVersionCode ) ) ; dirty = true ; } } if ( ! ( StringUtils . isEmpty ( parsedSharedUserId ) ) ) { Attr sharedUserIdAttrib = manifestElement . getAttributeNode ( ManifestUpdateMojo . ATTR_SHARED_USER_ID ) ; if ( ( sharedUserIdAttrib == null ) || ( ! ( StringUtils . equals ( parsedSharedUserId , sharedUserIdAttrib . getValue ( ) ) ) ) ) { getLog ( ) . info ( ( ( ( "Setting<seq2seq4repair_space>" + ( ManifestUpdateMojo . ATTR_SHARED_USER_ID ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( parsedSharedUserId ) ) ) ; manifestElement . setAttribute ( ManifestUpdateMojo . ATTR_SHARED_USER_ID , parsedSharedUserId ) ; dirty = true ; } } if ( ( parsedDebuggable ) != null ) { NodeList appElems = manifestElement . getElementsByTagName ( ManifestUpdateMojo . ELEM_APPLICATION ) ; for ( int i = 0 ; i < ( appElems . getLength ( ) ) ; ++ i ) { Node node = appElems . item ( i ) ; getLog ( ) . info ( ( ( "Testing<seq2seq4repair_space>if<seq2seq4repair_space>node<seq2seq4repair_space>" + ( node . getNodeName ( ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>application" ) ) ; if ( ( node . getNodeType ( ) ) == ( Node . ELEMENT_NODE ) ) { Element element = ( ( Element ) ( node ) ) ; Attr debuggableAttrib = element . getAttributeNode ( ManifestUpdateMojo . ATTR_DEBUGGABLE ) ; <START_BUG> if ( ( debuggableAttrib == null ) || ( ( manifestDebuggable ) != ( BooleanUtils . toBoolean ( debuggableAttrib . getValue ( ) ) ) ) ) { <END_BUG> getLog ( ) . info ( ( ( ( "Setting<seq2seq4repair_space>" + ( ManifestUpdateMojo . ATTR_DEBUGGABLE ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( parsedDebuggable ) ) ) ; element . setAttribute ( ManifestUpdateMojo . ATTR_DEBUGGABLE , String . valueOf ( parsedDebuggable ) ) ; dirty = true ; } } } } if ( dirty ) { if ( ! ( manifestFile . delete ( ) ) ) { getLog ( ) . warn ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>remove<seq2seq4repair_space>old<seq2seq4repair_space>" + manifestFile ) ) ; } getLog ( ) . info ( ( "Made<seq2seq4repair_space>changes<seq2seq4repair_space>to<seq2seq4repair_space>manifest<seq2seq4repair_space>file,<seq2seq4repair_space>updating<seq2seq4repair_space>" + manifestFile ) ) ; writeManifest ( manifestFile , doc ) ; } else { getLog ( ) . info ( "No<seq2seq4repair_space>changes<seq2seq4repair_space>found<seq2seq4repair_space>to<seq2seq4repair_space>write<seq2seq4repair_space>to<seq2seq4repair_space>manifest<seq2seq4repair_space>file" ) ; } } }

Fix:
if ( ( debuggableAttrib == null ) || ( ( parsedDebuggable ) != ( BooleanUtils . toBoolean ( debuggableAttrib . getValue ( ) ) ) ) ) {