nus-yam/ex-repair huggingface dataset:
Buggy code:
public class SubProtocolWebSocketHandlerTests { private SubProtocolWebSocketHandler webSocketHandler ; private TestWebSocketSession session ; @ Mock SubProtocolHandler stompHandler ; @ Mock SubProtocolHandler mqttHandler ; @ Mock SubProtocolHandler defaultHandler ; @ Mock MessageChannel inClientChannel ; @ Mock SubscribableChannel outClientChannel ; @ Before public void setup ( ) { } @ Test public void subProtocolMatch ( ) throws Exception { } @ Test public void subProtocolDefaultHandlerOnly ( ) throws Exception { } @ Test ( expected = IllegalStateException . class ) public void subProtocolNoMatch ( ) throws Exception { } @ Test public void nullSubProtocol ( ) throws Exception { } @ Test public void emptySubProtocol ( ) throws Exception { } @ Test public void noSubProtocolOneHandler ( ) throws Exception { } @ Test ( expected = IllegalStateException . class ) public void noSubProtocolTwoHandlers ( ) throws Exception { } @ Test ( expected = IllegalStateException . class ) public void noSubProtocolNoDefaultHandler ( ) throws Exception { } @ Test public void checkSession ( ) throws Exception { TestWebSocketSession session1 = new TestWebSocketSession ( "id1" ) ; TestWebSocketSession session2 = new TestWebSocketSession ( "id2" ) ; session1 . setAcceptedProtocol ( "v12.stomp" ) ; session2 . setAcceptedProtocol ( "v12.stomp" ) ; this . webSocketHandler . setProtocolHandlers ( Arrays . asList ( this . stompHandler ) ) ; this . webSocketHandler . afterConnectionEstablished ( session1 ) ; this . webSocketHandler . afterConnectionEstablished ( session2 ) ; session1 . setOpen ( true ) ; session2 . setOpen ( true ) ; long sixtyOneSecondsAgo = ( System . currentTimeMillis ( ) ) - ( 61 * 1000 ) ; new DirectFieldAccessor ( this . webSocketHandler ) . setPropertyValue ( "lastSessionCheckTime" , sixtyOneSecondsAgo ) ; Map < String , ? > sessions = ( ( Map < String , ? > ) ( new DirectFieldAccessor ( this . webSocketHandler ) . getPropertyValue ( "sessions" ) ) ) ; new DirectFieldAccessor ( sessions . get ( "id1" ) ) . setPropertyValue ( "createTime" , sixtyOneSecondsAgo ) ; new DirectFieldAccessor ( sessions . get ( "id2" ) ) . setPropertyValue ( "createTime" , sixtyOneSecondsAgo ) ; this . webSocketHandler . handleMessage ( session1 , new TextMessage ( "foo" ) ) ; assertTrue ( session1 . isOpen ( ) ) ; assertFalse ( session2 . isOpen ( ) ) ; assertNull ( session1 . getCloseStatus ( ) ) ; <START_BUG> assertEquals ( PROTOCOL_ERROR , session2 . getCloseStatus ( ) ) ; <END_BUG> } }

Fix:
assertEquals ( SESSION_NOT_RELIABLE , session2 . getCloseStatus ( ) ) ;
Buggy code:
public class ScatterZipOutputStream implements Closeable { private final Queue < ScatterZipOutputStream . CompressedEntry > items = new ConcurrentLinkedQueue < ScatterZipOutputStream . CompressedEntry > ( ) ; private final ScatterGatherBackingStore backingStore ; private final StreamCompressor streamCompressor ; private static class CompressedEntry { final ZipArchiveEntry entry ; final long crc ; final long compressedSize ; final int method ; final long size ; public CompressedEntry ( ZipArchiveEntry entry , long crc , long compressedSize , int method , long size ) { } public ZipArchiveEntry transferToArchiveEntry ( ) { } } public ScatterZipOutputStream ( ScatterGatherBackingStore backingStore , StreamCompressor streamCompressor ) { } public void addArchiveEntry ( ZipArchiveEntry zipArchiveEntry , InputStream payload , int method ) throws IOException { streamCompressor . deflate ( payload , method ) ; <START_BUG> items . add ( new ScatterZipOutputStream . CompressedEntry ( zipArchiveEntry , streamCompressor . getCrc32 ( ) , streamCompressor . getBytesWritten ( ) , method , streamCompressor . getBytesRead ( ) ) ) ; <END_BUG> } public void writeTo ( ZipArchiveOutputStream target ) throws IOException { } public void close ( ) throws IOException { } public static ScatterZipOutputStream fileBased ( File file ) throws FileNotFoundException { } public static ScatterZipOutputStream fileBased ( File file , int compressionLevel ) throws FileNotFoundException { } }

Fix:
items . add ( new ScatterZipOutputStream . CompressedEntry ( zipArchiveEntry , streamCompressor . getCrc32 ( ) , streamCompressor . getBytesWrittenForLastEntry ( ) , method , streamCompressor . getBytesRead ( ) ) ) ;
Buggy code:
public class CSVPrinter { private final Appendable out ; private final CSVFormat format ; private boolean newLine = true ; public CSVPrinter ( final Appendable out , final CSVFormat format ) { } public void println ( ) throws IOException { } public void flush ( ) throws IOException { } public void println ( final Object ... values ) throws IOException { } public void printComment ( final String comment ) throws IOException { } private void print ( final CharSequence value , final int offset , final int len ) throws IOException { } void printDelimiter ( ) throws IOException { } void printAndEscape ( final CharSequence value , final int offset , final int len ) throws IOException { } void printAndEncapsulate ( final CharSequence value , final int offset , final int len ) throws IOException { final boolean first = newLine ; boolean quote = false ; int start = offset ; int pos = offset ; final int end = offset + len ; printDelimiter ( ) ; final char delim = format . getDelimiter ( ) ; <START_BUG> final char encapsulator = format . getEncapsulator ( ) ; <END_BUG> if ( len <= 0 ) { if ( first ) { quote = true ; } } else { char c = value . charAt ( pos ) ; if ( first && ( ( ( ( c < '0' ) || ( ( c > '9' ) && ( c < 'A' ) ) ) || ( ( c > 'Z' ) && ( c < 'a' ) ) ) || ( c > 'z' ) ) ) { quote = true ; } else if ( c <= ( Constants . COMMENT ) ) { quote = true ; } else { while ( pos < end ) { c = value . charAt ( pos ) ; if ( ( ( ( c == ( Constants . LF ) ) || ( c == ( Constants . CR ) ) ) || ( c == encapsulator ) ) || ( c == delim ) ) { quote = true ; break ; } pos ++ ; } if ( ! quote ) { pos = end - 1 ; c = value . charAt ( pos ) ; if ( c <= ( Constants . SP ) ) { quote = true ; } } } } if ( ! quote ) { out . append ( value , start , end ) ; return ; } out . append ( encapsulator ) ; while ( pos < end ) { final char c = value . charAt ( pos ) ; if ( c == encapsulator ) { out . append ( value , start , ( pos + 1 ) ) ; start = pos ; } pos ++ ; } out . append ( value , start , pos ) ; out . append ( encapsulator ) ; } public void print ( Object object , final boolean checkForEscape ) throws IOException { } public void print ( final Object value ) throws IOException { } }

Fix:
final char encapsulator = format . getQuoteChar ( ) ;
Buggy code:
public class MainActivity extends AppCompatActivity implements ActivityCompat . OnRequestPermissionsResultCallback , ResultCallback < Status > { public static RecyclerView recyclerView ; public static RecyclerAdapter recyclerAdapter ; private boolean fabMenuShown = false ; private int [ ] fabMenuItems = new int [ ] { id . timeReminderFab , id . fab_2 } ; private double [ ] [ ] fabMenuOffsetRatio = new double [ ] [ ] { new double [ ] { 1.7 , 0.25 } , new double [ ] { 1.5 , 1.5 } } ; private int [ ] fabMenuShowAnimation = new int [ ] { anim . fab1_show , anim . fab2_show } ; private int [ ] fabMenuHideAnimation = new int [ ] { anim . fab1_hide , anim . fab2_hide } ; public static final String TAG = "Main<seq2seq4repair_space>Activity" ; private static final String [ ] PERMISSION_REQUESTS = new String [ ] { permission . ACCESS_FINE_LOCATION , permission . ACCESS_COARSE_LOCATION , permission . READ_PHONE_STATE , permission . WRITE_EXTERNAL_STORAGE , permission . READ_EXTERNAL_STORAGE } ; private static final int ACCESS_TIME_REMINDER_ACTIVITY = 0 ; private static final int ACCESS_LOCATION_REMINDER_ACTIVITY = 1 ; private static boolean canUse = false ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public boolean canUse ( ) { <START_BUG> return MainActivity . canUse ; <END_BUG> } private boolean isAllPermissionsGranted ( ) { } @ TargetApi ( VERSION_CODES . M ) private void checkAndRequestPermissions ( int code ) { } private void showFabMenu ( ) { } private void hideFabMenu ( ) { } @ Override protected void onResume ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onCreateContextMenu ( ContextMenu menu , View v , ContextMenu . ContextMenuInfo menuInfo ) { } @ Override public boolean onContextItemSelected ( MenuItem item ) { } @ Override public void onResult ( @ NonNull Status status ) { } @ Override public void onRequestPermissionsResult ( int requestCode , @ NonNull String [ ] permissions , @ NonNull int [ ] grantResults ) { } }

Fix:
return isAllPermissionsGranted ( ) ;
Buggy code:
public class ParserHelper { public static Document loadDocument ( InputStream inputStream ) throws RundeckApiException { SAXReader reader = new SAXReader ( ) ; reader . setEncoding ( "UTF-8" ) ; Document document ; try { document = reader . read ( inputStream ) ; } catch ( DocumentException e ) { <START_BUG> throw new RundeckApiException ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>read<seq2seq4repair_space>RunDeck<seq2seq4repair_space>reponse" , e ) ; <END_BUG> } document . setXMLEncoding ( "UTF-8" ) ; Node result = document . selectSingleNode ( "result" ) ; if ( result != null ) { Boolean failure = Boolean . valueOf ( result . valueOf ( "@error" ) ) ; if ( failure ) { throw new RundeckApiException ( result . valueOf ( "error//message" ) ) ; } } return document ; } }

Fix:
throw new RundeckApiException ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>read<seq2seq4repair_space>RunDeck<seq2seq4repair_space>response" , e ) ;
Buggy code:
public class ModModelManager { public static ModModelManager INSTANCE = new ModModelManager ( ) ; private ModModelManager ( ) { } public void registerAllModels ( ) { } private void registerBlockItemModel ( Block block ) { } private void registerItemModel ( Item item ) { } private void registerItemModel ( Item item , String modelLocation ) { final ModelResourceLocation fullModelLocation = new ModelResourceLocation ( modelLocation , "inventory" ) ; ModelBakery . addVariantName ( item , modelLocation ) ; <START_BUG> ModelLoader . setCustomMeshDefinition ( item , ( stack ) -> fullModelLocation ) ; <END_BUG> } }

Fix:
ModelLoader . setCustomMeshDefinition ( item , MeshDefinitionFix . create ( ( stack ) -> fullModelLocation ) ) ;
Buggy code:
public class TemperatureStringAdapter implements IStringAdapter { @ Override public String extractData ( String rawData ) { <START_BUG> return rawData . substring ( 13 ) ; <END_BUG> } }

Fix:
return rawData . substring ( 13 ) . replace ( System . getProperty ( "line.separator" ) , "" ) ;
Buggy code:
public class CacheContainerReadAttributeHandler implements OperationStepHandler { private static final Logger log = Logger . getLogger ( CacheContainerReadAttributeHandler . class . getPackage ( ) . getName ( ) ) ; public static final CacheContainerReadAttributeHandler INSTANCE = new CacheContainerReadAttributeHandler ( ) ; private final ParametersValidator nameValidator = new ParametersValidator ( ) ; private final Map < String , AttributeDefinition > attributeDefinitions ; private CacheContainerReadAttributeHandler ( ) { } private CacheContainerReadAttributeHandler ( final AttributeDefinition ... definitions ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { nameValidator . validate ( operation ) ; final String attributeName = operation . require ( NAME ) . asString ( ) ; final ModelNode submodel = context . readResource ( EMPTY_ADDRESS ) . getModel ( ) ; final ModelNode currentValue = submodel . get ( attributeName ) . clone ( ) ; final AttributeDefinition attributeDefinition = getAttributeDefinition ( attributeName ) ; if ( attributeDefinition . getName ( ) . equals ( ALIAS . getName ( ) ) ) { String listAsString = convertListToString ( attributeDefinition . getName ( ) , currentValue ) ; context . getResult ( ) . set ( listAsString ) ; } else { context . getResult ( ) . set ( currentValue ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } public void registerAttributes ( final ManagementResourceRegistration registry ) { } protected AttributeDefinition getAttributeDefinition ( final String attributeName ) { } private String convertListToString ( String name , ModelNode value ) { } }

Fix:
context . completeStep ( NOOP_ROLLBACK_HANDLER ) ;
Buggy code:
public class Snippet126 { public static void main ( String [ ] args ) { Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; shell . setLayout ( new FillLayout ( ) ) ; Table table = new Table ( shell , ( ( SWT . BORDER ) | ( SWT . MULTI ) ) ) ; table . setLinesVisible ( true ) ; for ( int i = 0 ; i < 3 ; i ++ ) { TableColumn column = new TableColumn ( table , SWT . NONE ) ; column . setWidth ( 100 ) ; } for ( int i = 0 ; i < 12 ; i ++ ) { <START_BUG> TableItem item = new TableItem ( table , SWT . NONE ) ; <END_BUG> } TableItem [ ] items = table . getItems ( ) ; for ( int i = 0 ; i < ( items . length ) ; i ++ ) { TableEditor editor = new TableEditor ( table ) ; CCombo combo = new CCombo ( table , SWT . NONE ) ; editor . grabHorizontal = true ; editor . setEditor ( combo , items [ i ] , 0 ) ; editor = new TableEditor ( table ) ; Text text = new Text ( table , SWT . NONE ) ; editor . grabHorizontal = true ; editor . setEditor ( text , items [ i ] , 1 ) ; editor = new TableEditor ( table ) ; Button button = new Button ( table , SWT . CHECK ) ; button . pack ( ) ; editor . minimumWidth = button . getSize ( ) . x ; editor . horizontalAlignment = SWT . LEFT ; editor . setEditor ( button , items [ i ] , 2 ) ; } shell . pack ( ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
new TableItem ( table , SWT . NONE ) ;
Buggy code:
public class ViewFileTxt { public void printViewState ( ) { } public static String ViewState ( ) { } public static String playerGeneralInfo ( ArrayList < Player > players ) { } public static String minionGeneralInfo ( ArrayList < Minion > minions ) { } public static String troubleMakerGeneralInfo ( ArrayList < TroubleMaker > troubleMakers ) { } public static String buildingGeneralInfo ( ArrayList < Building > buildings ) { } public static String trollGeneralInfo ( ArrayList < Troll > trolls ) { } public static String demonGeneralInfo ( ArrayList < Demon > demons ) { } public static String playerDetailsMinBuildDollar ( Integer playerId ) { String playerDetailsMinBuildDollarStr = "\n\t" ; <START_BUG> playerDetailsMinBuildDollarStr += ( ( ( ( ( "-<seq2seq4repair_space>" + ( 12 - ( Game . GetMinionsOnBoardByPlayerID ( playerId ) . size ( ) ) ) ) + "<seq2seq4repair_space>minion(s)<seq2seq4repair_space>" ) + ( 6 - ( Game . GetBuildingsByPlayerIDAndActiveAndOnBoard ( playerId ) . size ( ) ) ) ) + "<seq2seq4repair_space>building(s)<seq2seq4repair_space>" ) + ( Game . GetPlayer ( playerId ) . getPlayerAmount ( ) ) ) + "<seq2seq4repair_space>Ankh-Morpork<seq2seq4repair_space>dollars" ; <END_BUG> return playerDetailsMinBuildDollarStr ; } public static String playerDetailsCityAreaCards ( Integer playerId ) { } public static String playerDetailsGreenCards ( Integer playerId ) { } public static String currentAndNextPlayerTurn ( ArrayList < Player > players ) { } public static String currentPlayerPlaying ( ArrayList < Player > players ) { } public static String areaDetails ( ) { } public static String paddingToMakeSixteen ( String areaName ) { } public static String playerDetails ( ArrayList < Player > players ) { } public static String totalAmountBankOwns ( ) { } }

Fix:
playerDetailsMinBuildDollarStr += ( ( ( ( ( "-<seq2seq4repair_space>" + ( 12 - ( Game . GetMinionsOnBoardByPlayerID ( playerId ) . size ( ) ) ) ) + "<seq2seq4repair_space>minion(s)<seq2seq4repair_space>" ) + ( 6 - ( Game . GetBuildingsByPlayerIDAndActiveAndOnBoard ( playerId ) . size ( ) ) ) ) + "<seq2seq4repair_space>building(s)<seq2seq4repair_space>" ) + ( Game . GetPlayer ( playerId ) . getPlayer_amount ( ) ) ) + "<seq2seq4repair_space>Ankh-Morpork<seq2seq4repair_space>dollars" ;
Buggy code:
class StuplaControl { public static final String URL_ABOUT_BLANK = "about:blank" ; private final StuplaActivity ui ; private final int chosenElementId ; private int chosenWeek ; private int [ ] availableWeeks = null ; private String chosenElementName ; public StuplaControl ( StuplaActivity stuplaActivity , int chosenElementId ) { } private void initialize ( ) { Calendar c = Calendar . getInstance ( ) ; this . chosenWeek = c . get ( Calendar . WEEK_OF_YEAR ) ; if ( ( c . get ( Calendar . DAY_OF_WEEK ) ) == ( Calendar . SUNDAY ) ) { if ( ( c . getFirstDayOfWeek ( ) ) == ( Calendar . MONDAY ) ) { <START_BUG> incrementChosenWeek ( ) ; <END_BUG> } this . ui . showToast ( showing_next_week ) ; } updateWebView ( ) ; updateTaskBarElementName ( ) ; downloadAvailableWeeks ( ) ; } public void downloadAvailableWeeks ( ) { } public void updateTaskBarElementName ( ) { } public void updateWebView ( ) { } public boolean incrementChosenWeek ( ) { } public boolean decrementChosenWeek ( ) { } public boolean incrementWeekAvailable ( ) { } private boolean incrementWeekAvailable ( int newWeek ) { } public boolean decrementWeekAvailable ( ) { } private boolean decrementWeekAvailable ( int newWeek ) { } private boolean weekAvailable ( int week ) { } private static int incrementWeek ( int week ) { } private static int decrementWeek ( int week ) { } }

Fix:
this . chosenWeek = StuplaControl . incrementWeek ( this . chosenWeek ) ;
Buggy code:
public abstract class MarkupElement { public MarkupElement ( ) { } <START_BUG> public boolean closes ( final ComponentTag open ) { <END_BUG> return false ; } public abstract String toUserDebugString ( ) { } }

Fix:
public boolean closes ( final MarkupElement open ) {
Buggy code:
public final class JDBCCustomFinderQuery implements JDBCQueryCommand { private final Logger log ; private final Method finderMethod ; private final JDBCReadAheadMetaData readAheadMetaData ; private final ReadAheadCache readAheadCache ; private final JDBCStoreManager manager ; public JDBCCustomFinderQuery ( JDBCStoreManager manager , Method finderMethod ) { } public JDBCStoreManager getSelectManager ( ) { } public Collection execute ( Method unused , Object [ ] args , CmpEntityBeanContext ctx , EntityProxyFactory factory ) throws FinderException { try { Object value ; <START_BUG> final EntityBeanComponentInstance componentInstance = ctx . getComponent ( ) . getCache ( ) . get ( ctx . getPrimaryKey ( ) ) ; <END_BUG> try { value = finderMethod . invoke ( componentInstance , args ) ; } finally { ctx . getComponent ( ) . getCache ( ) . release ( componentInstance , true ) ; } if ( value instanceof Enumeration ) { Enumeration enumeration = ( ( Enumeration ) ( value ) ) ; List result = new ArrayList ( ) ; while ( enumeration . hasMoreElements ( ) ) { result . add ( enumeration . nextElement ( ) ) ; } cacheResults ( result ) ; return Util . getEntityCollection ( factory , result ) ; } else if ( value instanceof Collection ) { List result ; if ( value instanceof List ) result = ( ( List ) ( value ) ) ; else result = new ArrayList ( ( ( Collection ) ( value ) ) ) ; cacheResults ( result ) ; return Util . getEntityCollection ( factory , result ) ; } else { return Collections . singleton ( ( value != null ? factory . getEntityObject ( value ) : null ) ) ; } } catch ( IllegalAccessException e ) { throw MESSAGES . unableToAccessFinder ( finderMethod . getName ( ) ) ; } catch ( IllegalArgumentException e ) { throw MESSAGES . illegalFinderArgument ( finderMethod . getName ( ) ) ; } catch ( InvocationTargetException e ) { Throwable ex = e . getTargetException ( ) ; if ( ex instanceof FinderException ) { throw ( ( FinderException ) ( ex ) ) ; } else { throw MESSAGES . errorInvokingFinder ( finderMethod . getName ( ) , e ) ; } } } private void cacheResults ( List listOfPKs ) { } }

Fix:
final EntityBeanComponentInstance componentInstance = ctx . getComponent ( ) . getCache ( ) . get ( ctx . getPrimaryKeyUnchecked ( ) ) ;
Buggy code:
public class ClientModuleTwoActivator implements ServiceActivator { public static final ServiceName INVOKER_SERVICE_NAME = JBOSS . append ( "osgi" , "example" , "invoker" , "service" ) ; private static final Logger log = Logger . getLogger ( ClientModuleTwoActivator . class ) ; @ Override public void activate ( ServiceActivatorContext context ) { } static class EchoInvokerService extends AbstractService < Void > { private static final Logger log = Logger . getLogger ( ClientModuleTwoActivator . EchoInvokerService . class ) ; private final InjectedValue < BundleContext > injectedBundleContext = new InjectedValue < BundleContext > ( ) ; static void addService ( ServiceTarget serviceTarget ) { ClientModuleTwoActivator . EchoInvokerService service = new ClientModuleTwoActivator . EchoInvokerService ( ) ; ServiceBuilder < ? > serviceBuilder = serviceTarget . addService ( ClientModuleTwoActivator . INVOKER_SERVICE_NAME , service ) ; <START_BUG> serviceBuilder . addDependency ( SYSTEM_CONTEXT , BundleContext . class , service . injectedBundleContext ) ; <END_BUG> serviceBuilder . setInitialMode ( ACTIVE ) ; serviceBuilder . install ( ) ; ClientModuleTwoActivator . EchoInvokerService . log . infof ( "Service<seq2seq4repair_space>added:<seq2seq4repair_space>%s" , ClientModuleTwoActivator . INVOKER_SERVICE_NAME ) ; ClientModuleTwoActivator . EchoInvokerService . log . infof ( "Echo<seq2seq4repair_space>Loader:<seq2seq4repair_space>%s" , Echo . class . getClassLoader ( ) ) ; } @ Override public void start ( StartContext context ) throws StartException { } } }

Fix:
serviceBuilder . addDependency ( FRAMEWORK_ACTIVE , BundleContext . class , service . injectedBundleContext ) ;
Buggy code:
public class ObjCClass extends ObjCObject { public native < T extends ObjCObject > Pointer < T > alloc ( ) { } <START_BUG> @ Selector ( "new:" ) <END_BUG> public native < T extends ObjCObject > Pointer < T > new$ ( ) ; public native boolean instancesRespondTo ( SEL sel ) { } public native IMP instanceMethodFor ( SEL aSelector ) { } }

Fix:
@ Selector ( "new" )
Buggy code:
public abstract class FileReader { public void readFile ( File directory , String pattern , Boolean recursive ) { File [ ] fileList = directory . listFiles ( ) ; if ( fileList != null ) { for ( File file : fileList ) { if ( ( file . isDirectory ( ) ) && recursive ) { <START_BUG> readFile ( directory , pattern , recursive ) ; <END_BUG> } else if ( ( file . isFile ( ) ) && ( file . getName ( ) . matches ( pattern ) ) ) { Scanner in = null ; try { in = new Scanner ( file ) ; process ( file , in ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } } } } } abstract void process ( File file , Scanner in ) { } }

Fix:
readFile ( file , pattern , recursive ) ;
Buggy code:
public class StrandedByNavigationError extends IncidentType { public StrandedByNavigationError ( Metoc metoc , RiskTarget vessel ) { } @ Override public double getAgeFactorParam ( ) { } @ Override public double getExposure ( ) { <START_BUG> double t = getTimeToGrounding ( vessel . getCog ( ) , vessel . getSog ( ) ) ; <END_BUG> if ( t < 3600 ) { return Math . exp ( ( ( - ( Math . abs ( ( t // 60.0 ) ) ) ) * 0.1 ) ) ; } return 0.0 ; } public double getVisibilityFactor_ ( ) { } @ Override public AccidentType getAccidentType ( ) { } @ Override public double getWindcurrentFactor ( ) { } }

Fix:
double t = getTimeToGrounding ( vessel . getSog ( ) , vessel . getCog ( ) ) ;
Buggy code:
public class DecisionTree { static class Node { private String value ; private int index ; private List < DecisionTree . Node > children ; Node ( int index , String value ) { } public void addChild ( DecisionTree . Node child ) { } public DecisionTree . Node getChild ( int idx ) { } } private static Map < String , String > ops = new HashMap < > ( ) ; private static boolean header ; private static String delim = "<seq2seq4repair_space>" ; private static int where = 0 ; private static boolean timeThis ; private static File trainingSet ; private static File testingSet ; private static DecisionTree . Node root ; private static final int ROOT = - 2 ; public static void train ( ) throws IOException { } public static void generateTree ( List < ArrayList < String > > D , DecisionTree . Node parent ) { } public static void test ( File outFile ) throws IOException { } public static String expectedClass ( List < ArrayList < String > > D ) { } public static double entropy ( List < ArrayList < String > > D ) { } public static double information ( List < ArrayList < String > > D , int featureIdx ) { } public static Map < String , Double > calcPriorProbs ( List < ArrayList < String > > D ) { } public static double log ( double x , int base ) { <START_BUG> return ( ( Math . log ( x ) ) // ( Math . log ( base ) ) ) + 1.0E-11 ; <END_BUG> } public static void setUpOps ( ) { } public static void parseOps ( String [ ] args ) { } public static void main ( String [ ] args ) throws IOException { } }

Fix:
return ( Math . log ( x ) ) // ( Math . log ( base ) ) ;
Buggy code:
public class ListOneListGen extends ActionBarActivity { protected ItemListAdapterGen adapter ; protected ListView itemsView ; protected Spinner categorySpinner ; protected long shoppingListId ; protected ListGroceryDAO listGroceryDb ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } protected void setInstructions ( ) { } protected void setTitle ( ) { <START_BUG> String title = "Obi<seq2seq4repair_space>Grocery<seq2seq4repair_space>-<seq2seq4repair_space>Show<seq2seq4repair_space>List<seq2seq4repair_space>" + ( shoppingListId ) ; <END_BUG> this . setTitle ( title ) ; } protected void populateList ( ) { } protected void populateCategories ( ) { } protected void categoryShift ( String category ) { } public void editList ( View view ) { } public static final int EDIT_ITEM_LIST = 1 ; @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } public void letsGoShopping ( View view ) { } public void deleteList ( final View view ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void onBackPressed ( ) { } public void returnToLists ( View view ) { } }

Fix:
String title = "Smart<seq2seq4repair_space>Grocery<seq2seq4repair_space>-<seq2seq4repair_space>Show<seq2seq4repair_space>List<seq2seq4repair_space>" + ( shoppingListId ) ;
Buggy code:
public final class PageView < T > extends Panel < T > { private static final long serialVersionUID = 1L ; public PageView ( MarkupContainer parent , final String id , final Page page ) { } private List < PageView < T > . ComponentData > getComponentData ( final Page < ? > page ) { final List < PageView < T > . ComponentData > data = new ArrayList < PageView < T > . ComponentData > ( ) ; <START_BUG> page . visitChildren ( new IVisitor < Component > ( ) { <END_BUG> public Object component ( final Component component ) { if ( ! ( component . getPath ( ) . startsWith ( PageView . this . getPath ( ) ) ) ) { final PageView < T > . ComponentData componentData = new ComponentData ( ) ; String name = component . getClass ( ) . getName ( ) ; if ( ( name . indexOf ( "$" ) ) > 0 ) { name = component . getClass ( ) . getSuperclass ( ) . getName ( ) ; } name = Strings . lastPathComponent ( name , PATH_SEPARATOR ) ; componentData . path = component . getPageRelativePath ( ) ; componentData . size = component . getSizeInBytes ( ) ; componentData . type = name ; try { componentData . value = component . getModelObjectAsString ( ) ; } catch ( Exception e ) { componentData . value = e . getMessage ( ) ; } data . add ( componentData ) ; } return IVisitor . CONTINUE_TRAVERSAL ; } } ) ; return data ; } private class ComponentData implements Serializable { private static final long serialVersionUID = 1L ; public String path ; public String type ; public String value ; public long size ; } }

Fix:
page . visitChildren ( new IVisitor ( ) {
Buggy code:
public class GuiKeybindsMenu extends GuiScreen { public GuiKeybindsScrollPanel scroll ; @ Override public void initGui ( ) { } @ Override public void drawScreen ( int par1 , int par2 , float par3 ) { } @ Override protected void actionPerformed ( GuiButton par1GuiButton ) { super . actionPerformed ( par1GuiButton ) ; switch ( par1GuiButton . id ) { case 1337 : Minecraft . getMinecraft ( ) . displayGuiScreen ( new net . minecraft . client . gui . GuiOptions ( null , Minecraft . getMinecraft ( ) . gameSettings ) ) ; break ; case 0 : Minecraft . getMinecraft ( ) . displayGuiScreen ( new GuiControlsOverride ( this , Minecraft . getMinecraft ( ) . gameSettings ) ) ; break ; case 1 : KeyHelper . updateConflictCategory ( ) ; Minecraft . getMinecraft ( ) . displayGuiScreen ( new GuiSubKeybindsMenu ( this , "Conflicting" , conflictingKeys . toArray ( new String [ 0 ] ) , Minecraft . getMinecraft ( ) . gameSettings ) ) ; break ; case 2 : try { <START_BUG> Files . write ( KeyHelper . getExportFile ( ) . getBytes ( ) , new File ( Minecraft . getMinecraft ( ) . mcDataDir , ( ( "NotEnoughKeys_" + ( new SimpleDateFormat ( "MM-dd-yyyy_HH-mm-ss" ) . format ( new Date ( ) ) ) ) + ".json" ) ) ) ; <END_BUG> } catch ( IOException e ) { e . printStackTrace ( ) ; } break ; case 3 : EventQueue . invokeLater ( new Runnable ( ) { @ Override public void run ( ) { JFileChooser chooser = new JFileChooser ( ) ; chooser . setCurrentDirectory ( Minecraft . getMinecraft ( ) . mcDataDir ) ; chooser . setDialogTitle ( "Choose<seq2seq4repair_space>an<seq2seq4repair_space>import" ) ; chooser . setFileSelectionMode ( JFileChooser . FILES_ONLY ) ; chooser . setAcceptAllFileFilterUsed ( false ) ; chooser . addChoosableFileFilter ( new FileNameExtensionFilter ( "JSON<seq2seq4repair_space>file" , "json" ) ) ; if ( ( chooser . showOpenDialog ( null ) ) == ( JFileChooser . APPROVE_OPTION ) ) { KeyHelper . importFile ( chooser . getSelectedFile ( ) ) ; } } } ) ; break ; default : break ; } KeyHelper . updateConflictCategory ( ) ; } @ Override public void onGuiClosed ( ) { } }

Fix:
Files . write ( KeyHelper . getExportFile ( ) . getBytes ( ) , new File ( KeyHelper . configDir , ( ( "NotEnoughKeys_" + ( new SimpleDateFormat ( "MM-dd-yyyy_HH-mm-ss" ) . format ( new Date ( ) ) ) ) + ".json" ) ) ) ;
Buggy code:
public interface DistributedVectorSimilarity { double weight ( Vector v ) { } <START_BUG> double similarity ( int rowA , int rowB , Iterable < Cooccurrence > cooccurrences , double weightOfVectorA , double weightOfVectorB , int numberOfColumns ) ; <END_BUG> }

Fix:
double similarity ( int rowA , int rowB , Iterable < Cooccurrence > cooccurrences , double weightOfVectorA , double weightOfVectorB , long numberOfColumns ) ;
Buggy code:
public class DropSpell extends BlockSpell { private static final int DEFAULT_MAX_RECURSION = 16 ; @ Override public SpellResult onCast ( ConfigurationSection parameters ) { } protected void drop ( Block block , Set < Material > dropTypes , Collection < ItemStack > drops , int maxRecursion ) { } protected void drop ( Block block , Set < Material > dropTypes , Collection < ItemStack > drops , int maxRecursion , int rDepth ) { <START_BUG> registerForUndo ( block , false ) ; <END_BUG> drops . addAll ( block . getDrops ( ) ) ; block . setType ( AIR ) ; if ( rDepth < maxRecursion ) { tryDrop ( block . getRelative ( NORTH ) , dropTypes , drops , maxRecursion , ( rDepth + 1 ) ) ; tryDrop ( block . getRelative ( WEST ) , dropTypes , drops , maxRecursion , ( rDepth + 1 ) ) ; tryDrop ( block . getRelative ( SOUTH ) , dropTypes , drops , maxRecursion , ( rDepth + 1 ) ) ; tryDrop ( block . getRelative ( EAST ) , dropTypes , drops , maxRecursion , ( rDepth + 1 ) ) ; tryDrop ( block . getRelative ( UP ) , dropTypes , drops , maxRecursion , ( rDepth + 1 ) ) ; tryDrop ( block . getRelative ( DOWN ) , dropTypes , drops , maxRecursion , ( rDepth + 1 ) ) ; } } protected void tryDrop ( Block target , Set < Material > dropTypes , Collection < ItemStack > drops , int maxRecursion , int rDepth ) { } }

Fix:
registerForUndo ( block ) ;
Buggy code:
@ SuppressLint ( "WorldReadableFiles" ) @ SuppressWarnings ( "deprecation" ) public class Utils extends BroadcastReceiver { public Context ctx ; public Resources resources ; @ Override public void onReceive ( Context context , Intent intent ) { } public void backupApkFile ( String apkFile ) { PackageManager pm = ctx . getPackageManager ( ) ; try { PackageInfo pi = pm . getPackageArchiveInfo ( apkFile , 0 ) ; pi . applicationInfo . publicSourceDir = apkFile ; pi . applicationInfo . sourceDir = apkFile ; ApplicationInfo ai = pi . applicationInfo ; String appName = ( ( String ) ( pm . getApplicationLabel ( ai ) ) ) ; String versionName = pi . versionName ; String fileName = ( ( appName + "<seq2seq4repair_space>" ) + versionName ) + ".apk" ; String backupApkFile = ( Common . APP_DIR ) + fileName ; File src = new File ( apkFile ) ; File dst = new File ( backupApkFile ) ; <START_BUG> if ( ! ( dst . exists ( ) ) ) { <END_BUG> copyFile ( src , dst ) ; } } catch ( Exception e ) { } } public void deleteApkFile ( String apkFile ) { } public void uninstallSystemApp ( String packageName ) { } public void copyFile ( File src , File dst ) throws IOException { } public void backupPreferences ( ) { } public void restorePreferences ( ) { } public void resetPreferences ( ) { } }

Fix:
if ( ! ( dst . equals ( src ) ) ) {
Buggy code:
public class SynchronizedRandomGenerator implements RandomGenerator { private final RandomGenerator wrapped ; public SynchronizedRandomGenerator ( RandomGenerator rng ) { } public synchronized void setSeed ( int seed ) { } public synchronized void setSeed ( int [ ] seed ) { } public synchronized void setSeed ( long seed ) { } public synchronized void nextBytes ( byte [ ] bytes ) { } public synchronized int nextInt ( ) { } public synchronized int nextInt ( int n ) { <START_BUG> return wrapped . nextInt ( ) ; <END_BUG> } public synchronized long nextLong ( ) { } public synchronized boolean nextBoolean ( ) { } public synchronized float nextFloat ( ) { } public synchronized double nextDouble ( ) { } public synchronized double nextGaussian ( ) { } }

Fix:
return wrapped . nextInt ( n ) ;
Buggy code:
public class HelloConsumerApplication implements IDistributionConstants , IApplication , ServiceTrackerCustomizer { public static final String CONSUMER_NAME = "org.eclipse.ecf.examples.remoteservices.hello.consumer" ; private BundleContext bundleContext ; private ServiceTracker containerFactoryServiceTracker ; private String containerType = "ecf.r_osgi.peer" ; private final Object appLock = new Object ( ) ; private boolean done = false ; private ServiceTracker helloServiceTracker ; private ServiceRegistration discoveryListenerRegistration ; private ServiceRegistration distributionListenerRegistration ; public Object start ( IApplicationContext appContext ) throws Exception { bundleContext = Activator . getContext ( ) ; processArgs ( appContext ) ; getContainerFactory ( ) . createContainer ( containerType ) ; helloServiceTracker = new ServiceTracker ( bundleContext , createRemoteFilter ( ) , this ) ; <START_BUG> helloServiceTracker . open ( true ) ; <END_BUG> waitForDone ( ) ; return IApplication . EXIT_OK ; } private Filter createRemoteFilter ( ) throws InvalidSyntaxException { } public void stop ( ) { } private IContainerFactory getContainerFactory ( ) { } private void processArgs ( IApplicationContext appContext ) { } private void waitForDone ( ) { } public Object addingService ( ServiceReference reference ) { } public void modifiedService ( ServiceReference reference , Object service ) { } public void removedService ( ServiceReference reference , Object service ) { } }

Fix:
helloServiceTracker . open ( ) ;
Buggy code:
public abstract class AbstractTrialHandler extends AbstractHandler < Trial > { @ ManagedProperty ( "#{loginHandler}" ) @ Getter @ Setter protected LoginHandler loginHandler ; @ Getter @ Setter protected List < TreatmentArmWrapper > listArmsWrapper = new ArrayList < TreatmentArmWrapper > ( ) ; private int armWrapperIdSequence = 0 ; @ ManagedProperty ( "#{popups}" ) @ Setter @ Getter private Popups popups ; protected ArrayList < AbstractCriterion < ? extends Serializable , ? extends AbstractConstraint < ? extends Serializable > > > criteriaList = null ; @ SuppressWarnings ( "unchecked" ) public AbstractTrialHandler ( ) { } @ Override protected Trial createPlainObject ( ) { } @ Override public String refreshShowedObject ( ) { } @ Override public String saveObject ( ) { } protected ArrayList < AbstractCriterion < ? extends Serializable , ? extends AbstractConstraint < ? extends Serializable > > > configureCriteriaStep4 ( ) { } @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) protected ArrayList < AbstractCriterion < ? extends Serializable , ? extends AbstractConstraint < ? extends Serializable > > > addAllConfiguredCriteria ( ArrayList < CriterionWrapper < ? extends Serializable > > criteriaList ) { } protected DichotomousCriterion configureResponse ( ) { ValueExpression ve1 = FacesContext . getCurrentInstance ( ) . getApplication ( ) . getExpressionFactory ( ) . createValueExpression ( FacesContext . getCurrentInstance ( ) . getELContext ( ) , "#{responsePropertyConfig}" , ResponsePropertyConfig . class ) ; ResponsePropertyConfig response = ( ( ResponsePropertyConfig ) ( ve1 . getValue ( FacesContext . getCurrentInstance ( ) . getELContext ( ) ) ) ) ; for ( CriterionWrapper < ? extends Serializable > cr : response . getCriteria ( ) ) { if ( cr . isStrataFactor ( ) ) { if ( DichotomousCriterion . class . isInstance ( cr . getWrappedCriterion ( ) ) ) { DichotomousCriterion temp = DichotomousCriterion . class . cast ( cr . getWrappedCriterion ( ) ) ; temp . setStrata ( new ArrayList < DichotomousConstraint > ( ) ) ; try { temp . addStrata ( new DichotomousConstraint ( Arrays . asList ( new String [ ] { temp . getConfiguredValues ( ) . get ( 0 ) } ) ) ) ; temp . addStrata ( new DichotomousConstraint ( Arrays . asList ( new String [ ] { temp . getConfiguredValues ( ) . get ( 1 ) } ) ) ) ; <START_BUG> } catch ( ContraintViolatedException e ) { <END_BUG> e . printStackTrace ( ) ; } } } return ( ( DichotomousCriterion ) ( cr . getWrappedCriterion ( ) ) ) ; } return null ; } public void addArm ( ActionEvent event ) { } public int getTreatmentArmsCount ( ) { } public ArrayList < AbstractCriterion < ? extends Serializable , ? extends AbstractConstraint < ? extends Serializable > > > getCriteriaList ( ) { } protected Set < TreatmentArm > getTreatmentArms ( ) { } public void cleanTreatmentArms ( ) { } }

Fix:
} catch ( ConstraintViolatedException e ) {
Buggy code:
public class OSGiDeploymentService implements Service < Deployment > { private static final Logger log = Logger . getLogger ( "org.jboss.as.osgi" ) ; private static final OSGiDeploymentService . OSGiDeploymentListener listener = new OSGiDeploymentService . OSGiDeploymentListener ( ) ; public static final ServiceName SERVICE_NAME_BASE = JBOSS . append ( "osgi" , "deployment" ) ; private final Deployment deployment ; private InjectedValue < BundleContext > injectedBundleContext = new InjectedValue < BundleContext > ( ) ; private InjectedValue < BundleManager > injectedBundleManager = new InjectedValue < BundleManager > ( ) ; private OSGiDeploymentService ( Deployment deployment ) { } public static void addService ( DeploymentPhaseContext context ) { <START_BUG> final DeploymentUnit deploymentUnitContext = context . getDeploymentUnitContext ( ) ; <END_BUG> OSGiDeploymentService . addService ( context . getServiceTarget ( ) , OSGiDeploymentAttachment . getAttachment ( deploymentUnitContext ) , deploymentUnitContext . getName ( ) ) ; } public static void removeService ( DeploymentUnit context ) { } public static void addService ( ServiceTarget serviceTarget , Deployment deployment , String contextName ) { } public static ServiceName getServiceName ( String contextName ) { } public synchronized void start ( StartContext context ) throws StartException { } public synchronized void stop ( StopContext context ) { } @ Override public Deployment getValue ( ) throws IllegalStateException { } static class OSGiDeploymentListener extends AbstractServiceListener < Deployment > { private final Set < Deployment > startedDeployments = new CopyOnWriteArraySet < Deployment > ( ) ; private final Set < Deployment > pendingDeployments = new CopyOnWriteArraySet < Deployment > ( ) ; @ Override public void listenerAdded ( ServiceController < ? extends Deployment > controller ) { } @ Override public void serviceStarted ( ServiceController < ? extends Deployment > controller ) { } @ Override public void serviceFailed ( ServiceController < ? extends Deployment > controller , StartException reason ) { } private void processDeployment ( ServiceController < ? extends Deployment > controller ) { } } }

Fix:
final DeploymentUnit deploymentUnitContext = context . getDeploymentUnit ( ) ;
Buggy code:
public class PartialTextMatchRule extends AbstractRule { private static final LoggingEventFieldResolver resolver = LoggingEventFieldResolver . getInstance ( ) ; private final String field ; private final String value ; private PartialTextMatchRule ( String field , String value ) { } public static Rule getRule ( String field , String value ) { } public static Rule getRule ( Stack stack ) { if ( ( stack . size ( ) ) < 2 ) { <START_BUG> throw new IllegalArgumentException ( ( ( "partial<seq2seq4repair_space>text<seq2seq4repair_space>rule<seq2seq4repair_space>-<seq2seq4repair_space>expected<seq2seq4repair_space>two<seq2seq4repair_space>entries<seq2seq4repair_space>but<seq2seq4repair_space>" + ( stack . size ( ) ) ) + "<seq2seq4repair_space>were<seq2seq4repair_space>provided" ) ) ; <END_BUG> } String p2 = stack . pop ( ) . toString ( ) ; String p1 = stack . pop ( ) . toString ( ) ; return new PartialTextMatchRule ( p1 , p2 ) ; } public boolean evaluate ( LoggingEvent event ) { } }

Fix:
throw new IllegalArgumentException ( ( ( "invalid<seq2seq4repair_space>partial<seq2seq4repair_space>text<seq2seq4repair_space>rule<seq2seq4repair_space>-<seq2seq4repair_space>expected<seq2seq4repair_space>two<seq2seq4repair_space>entries<seq2seq4repair_space>but<seq2seq4repair_space>" + ( stack . size ( ) ) ) + "<seq2seq4repair_space>were<seq2seq4repair_space>provided" ) ) ;
Buggy code:
public abstract class AbstractWebSocketMessageBrokerConfigurer implements WebSocketMessageBrokerConfigurer { @ Override <START_BUG> public void configureWebSocketTransport ( WebSocketTransportRegistration registry ) { <END_BUG> } @ Override public void configureClientInboundChannel ( ChannelRegistration registration ) { } @ Override public void configureClientOutboundChannel ( ChannelRegistration registration ) { } @ Override public boolean configureMessageConverters ( List < MessageConverter > messageConverters ) { } @ Override public void configureMessageBroker ( MessageBrokerRegistry registry ) { } }

Fix:
public void configureWebSocketTransport ( WebSocketTransportRegistration registration ) {
Buggy code:
public final class PageView extends Panel { private static final long serialVersionUID = 1L ; public PageView ( final String id , final Page page ) { } private List getComponentData ( final Page page ) { final List data = new ArrayList ( ) ; page . visitChildren ( new IVisitor ( ) { public Object component ( final Component component ) { if ( ! ( component . getPath ( ) . startsWith ( PageView . this . getPath ( ) ) ) ) { final PageView . ComponentData componentData = new PageView . ComponentData ( ) ; String name = component . getClass ( ) . getName ( ) ; if ( ( name . indexOf ( "$" ) ) > 0 ) { name = component . getClass ( ) . getSuperclass ( ) . getName ( ) ; } name = Strings . lastPathComponent ( name , PATH_SEPARATOR ) ; componentData . path = component . getPageRelativePath ( ) ; <START_BUG> componentData . size = component . getSize ( ) ; <END_BUG> componentData . type = name ; try { componentData . value = component . getModelObjectAsString ( ) ; } catch ( Exception e ) { componentData . value = e . getMessage ( ) ; } data . add ( componentData ) ; } return IVisitor . CONTINUE_TRAVERSAL ; } } ) ; return data ; } private class ComponentData implements Serializable { private static final long serialVersionUID = 1L ; public String path ; public String type ; public String value ; public int size ; } }

Fix:
componentData . size = component . getSizeInBytes ( ) ;
Buggy code:
public class AttrNSImpl extends AttrImpl { static final long serialVersionUID = - 781906615369795414L ; static final String xmlnsURI = "http:////www.w3.org//2000//xmlns//" ; static final String xmlURI = "http:////www.w3.org//XML//1998//namespace" ; protected String namespaceURI ; protected String localName ; public AttrNSImpl ( ) { } protected AttrNSImpl ( CoreDocumentImpl ownerDocument , String namespaceURI , String qualifiedName ) { } private void setName ( String namespaceURI , String qname ) { String prefix ; this . namespaceURI = namespaceURI ; if ( namespaceURI != null ) { this . namespaceURI = ( ( namespaceURI . length ( ) ) == 0 ) ? null : namespaceURI ; } int colon1 = qname . indexOf ( ':' ) ; int colon2 = qname . lastIndexOf ( ':' ) ; ownerDocument ( ) . checkNamespaceWF ( qname , colon1 , colon2 ) ; if ( colon1 < 0 ) { localName = qname ; ownerDocument ( ) . checkQName ( null , localName ) ; if ( ownerDocument ( ) . errorChecking ) { <START_BUG> if ( ( ( qname . equals ( "xmlns" ) ) && ( ( namespaceURI == null ) || ( ! ( namespaceURI . equals ( XMLNS_URI ) ) ) ) ) || ( ( namespaceURI . equals ( XMLNS_URI ) ) && ( ! ( qname . equals ( "xmlns" ) ) ) ) ) { <END_BUG> String msg = DOMMessageFormatter . formatMessage ( DOM_DOMAIN , "NAMESPACE_ERR" , null ) ; throw new DOMException ( DOMException . NAMESPACE_ERR , msg ) ; } } } else { prefix = qname . substring ( 0 , colon1 ) ; localName = qname . substring ( ( colon2 + 1 ) ) ; ownerDocument ( ) . checkQName ( prefix , localName ) ; ownerDocument ( ) . checkDOMNSErr ( prefix , namespaceURI ) ; } } public AttrNSImpl ( CoreDocumentImpl ownerDocument , String namespaceURI , String qualifiedName , String localName ) { } protected AttrNSImpl ( CoreDocumentImpl ownerDocument , String value ) { } void rename ( String namespaceURI , String qualifiedName ) { } public void setValues ( CoreDocumentImpl ownerDocument , String namespaceURI , String qualifiedName , String localName ) { } public String getNamespaceURI ( ) { } public String getPrefix ( ) { } public void setPrefix ( String prefix ) throws DOMException { } public String getLocalName ( ) { } public String getTypeName ( ) { } public String getTypeNamespace ( ) { } }

Fix:
if ( ( ( qname . equals ( "xmlns" ) ) && ( ( namespaceURI == null ) || ( ! ( namespaceURI . equals ( XMLNS_URI ) ) ) ) ) || ( ( ( namespaceURI != null ) && ( namespaceURI . equals ( XMLNS_URI ) ) ) && ( ! ( qname . equals ( "xmlns" ) ) ) ) ) {