nus-yam/ex-repair huggingface dataset:
Buggy code:
public class OvsdbTunnelConfig extends AbstractHandlerBehaviour implements TunnelConfig { private static final String DEFAULT_ADDRESS = "0:0:0:0" ; @ Override public void createTunnel ( TunnelDescription tunnel ) { } @ Override public void removeTunnel ( TunnelDescription tunnel ) { } @ Override public void updateTunnel ( TunnelDescription tunnel ) { } @ Override public Collection < TunnelDescription > getTunnels ( ) { } private OvsdbNodeId changeDeviceIdToNodeId ( DeviceId deviceId ) { int lastColon = deviceId . toString ( ) . lastIndexOf ( ":" ) ; int fistColon = deviceId . toString ( ) . indexOf ( ":" ) ; <START_BUG> String ip = deviceId . toString ( ) . substring ( ( fistColon + 1 ) , ( lastColon - 1 ) ) ; <END_BUG> String port = deviceId . toString ( ) . substring ( ( lastColon + 1 ) ) ; IpAddress ipAddress = IpAddress . valueOf ( ip ) ; long portL = Long . valueOf ( port ) . longValue ( ) ; return new OvsdbNodeId ( ipAddress , portL ) ; } private OvsdbClientService getOvsdbNode ( DriverHandler handler ) { } }

Fix:
String ip = deviceId . toString ( ) . substring ( ( fistColon + 1 ) , lastColon ) ;
Buggy code:
public interface UndoQueue { public void add ( UndoList blocks ) { } public UndoList getLast ( ) { } public UndoList getLast ( Block target ) { } public UndoList undoRecent ( int timeout ) { } public UndoList undoRecent ( Block block , int timeout ) { } public int undoScheduled ( ) { } public int getSize ( ) { } public boolean isEmpty ( ) { } <START_BUG> public void commit ( ) ; <END_BUG> }

Fix:
public boolean commit ( ) ;
Buggy code:
public class FindQuery { String _id ; String query ; String selec ; String sort ; int limit ; int skip ; public FindQuery ( ) { } public FindQuery ( String query , String selec , String sort , int limit , int skip ) { } public String get_id ( ) { } public String getQuery ( ) { } public String getSelec ( ) { } public String getSort ( ) { } public int getLimit ( ) { } public int getSkip ( ) { <START_BUG> return limit ; <END_BUG> } }

Fix:
return skip ;
Buggy code:
public class IfStatement extends Statement { private Expression expression = null ; private Statement thenStatement = null ; private Statement optionalElseStatement = null ; IfStatement ( AST ast ) { } public int getNodeType ( ) { } ASTNode clone ( AST target ) { IfStatement result = new IfStatement ( target ) ; result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <START_BUG> result . setLeadingComment ( getLeadingComment ( ) ) ; <END_BUG> result . setExpression ( ( ( Expression ) ( getExpression ( ) . clone ( target ) ) ) ) ; result . setThenStatement ( ( ( Statement ) ( getThenStatement ( ) . clone ( target ) ) ) ) ; result . setElseStatement ( ( ( Statement ) ( ASTNode . copySubtree ( target , getElseStatement ( ) ) ) ) ) ; return result ; } public boolean subtreeMatch ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Expression getExpression ( ) { } public void setExpression ( Expression expression ) { } public Statement getThenStatement ( ) { } public void setThenStatement ( Statement statement ) { } public Statement getElseStatement ( ) { } public void setElseStatement ( Statement statement ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . copyLeadingComment ( this ) ;
Buggy code:
public class RecoveredLocalVariable extends RecoveredStatement { public LocalDeclaration localDeclaration ; boolean alreadyCompletedLocalInitialization ; public RecoveredLocalVariable ( LocalDeclaration localDeclaration , RecoveredElement parent , int bracketBalance ) { } public RecoveredElement add ( Statement stmt , int bracketBalanceValue ) { } public AstNode parseTree ( ) { } public int sourceEnd ( ) { } public String toString ( int tab ) { <START_BUG> return ( ( tabString ( tab ) ) + "Recovered<seq2seq4repair_space>local<seq2seq4repair_space>variable:\n" ) + ( localDeclaration . toString ( ( tab + 1 ) ) ) ; <END_BUG> } public Statement updatedStatement ( ) { } public RecoveredElement updateOnClosingBrace ( int braceStart , int braceEnd ) { } public RecoveredElement updateOnOpeningBrace ( int currentPosition ) { } public void updateParseTree ( ) { } public void updateSourceEndIfNecessary ( int sourceEnd ) { } }

Fix:
return ( ( tabString ( tab ) ) + "Recovered<seq2seq4repair_space>local<seq2seq4repair_space>variable:\n" ) + ( localDeclaration . print ( ( tab + 1 ) , new StringBuffer ( 10 ) ) ) ;
Buggy code:
public class RedmineClient { protected static Logger log = LoggerFactory . getLogger ( RedmineClient . class ) ; private HttpHost targetHost ; private DefaultHttpClient httpclient ; private String context = null ; public RedmineClient ( String host , int port , String context ) { } public void fillBasicAuth ( String userName , String base64Pwd ) { } public int queryIssue ( String projectId , String fieldId , String keyNo ) throws IOException , ClientProtocolException { HttpGet httpGet = null ; try { int count = 0 ; StringBuilder uri = new StringBuilder ( ) ; <START_BUG> uri . append ( this . context ) . append ( "//issues.json?" ) . append ( "project_id=" ) . append ( projectId ) . append ( "&" ) . append ( fieldId ) . append ( "=" ) . append ( keyNo ) ; <END_BUG> httpGet = new HttpGet ( uri . toString ( ) ) ; RedmineClient . log . debug ( ( "executing<seq2seq4repair_space>get<seq2seq4repair_space>request<seq2seq4repair_space>" + ( httpGet . getURI ( ) ) ) ) ; RedmineClient . RdeminResponse rdeminResponse = getRdeminResponse ( httpGet ) ; if ( rdeminResponse . isResponseOK ( ) ) { Matcher m = Pattern . compile ( ISSUE_COUNT_VALUE_EXP ) . matcher ( rdeminResponse . getContent ( ) ) ; while ( m . find ( ) ) { MatchResult mr = m . toMatchResult ( ) ; count = Integer . valueOf ( mr . group ( 1 ) . trim ( ) ) ; } RedmineClient . log . debug ( ( ( ( "count<seq2seq4repair_space>of<seq2seq4repair_space>issue[" + keyNo ) + "]<seq2seq4repair_space>-><seq2seq4repair_space>" ) + count ) ) ; } return count ; } finally { if ( httpGet != null ) httpGet . abort ( ) ; } } public String createNewIssue ( String newIssue ) throws IOException , ClientProtocolException { } public boolean deleteIssue ( String issueId ) throws IOException , ClientProtocolException { } public int request ( String uri ) throws IOException , ClientProtocolException { } private RedmineClient . RdeminResponse getRdeminResponse ( HttpRequest request ) throws IOException , ClientProtocolException { } public void shutdown ( ) { } class RdeminResponse { private int status ; private String content ; public int getStatus ( ) { } public void setStatus ( int status ) { } public String getContent ( ) { } public void setContent ( String content ) { } public boolean isResponseOK ( ) { } } }

Fix:
uri . append ( this . context ) . append ( "//issues.json?" ) . append ( "project_id=" ) . append ( projectId ) . append ( "&status_id=*&" ) . append ( fieldId ) . append ( "=" ) . append ( keyNo ) ;
Buggy code:
public class ParameterizedGenericMethodBinding extends ParameterizedMethodBinding implements Substitution { public TypeBinding [ ] typeArguments ; private LookupEnvironment environment ; public boolean inferredReturnType ; public boolean wasInferred ; public boolean isRaw ; public MethodBinding tiebreakMethod ; public static MethodBinding computeCompatibleMethod ( MethodBinding originalMethod , TypeBinding [ ] arguments , Scope scope , InvocationSite invocationSite ) { } private static boolean hasUnresolvedTypeArgument ( TypeBinding [ ] substitutes ) { } private static ParameterizedGenericMethodBinding inferFromArgumentTypes ( Scope scope , MethodBinding originalMethod , TypeBinding [ ] arguments , TypeBinding [ ] parameters , Map collectedSubstitutes , TypeBinding [ ] substitutes ) { } private static TypeBinding [ ] resolveSubstituteConstraints ( Scope scope , TypeVariableBinding [ ] typeVariables , TypeBinding [ ] substitutes , boolean considerEXTENDSConstraints , Map collectedSubstitutes ) { } public ParameterizedGenericMethodBinding ( MethodBinding originalMethod , RawTypeBinding rawType , LookupEnvironment environment ) { } public ParameterizedGenericMethodBinding ( MethodBinding originalMethod , TypeBinding [ ] typeArguments , LookupEnvironment environment ) { } public char [ ] computeUniqueKey ( ) { } public LookupEnvironment environment ( ) { } public boolean hasSubstitutedParameters ( ) { } public boolean hasSubstitutedReturnType ( ) { <START_BUG> if ( this . wasInferred ) <END_BUG> return this . originalMethod . hasSubstitutedReturnType ( ) ; return super . hasSubstitutedReturnType ( ) ; } private ParameterizedGenericMethodBinding inferFromExpectedType ( Scope scope , TypeBinding expectedType , Map collectedSubstitutes , TypeBinding [ ] substitutes ) { } public boolean isRawSubstitution ( ) { } public TypeBinding substitute ( TypeVariableBinding originalVariable ) { } public MethodBinding tiebreakMethod ( ) { } }

Fix:
if ( this . inferredReturnType )
Buggy code:
public class FlightModePanel extends ApiListenerFragment { private static final IntentFilter eventFilter = new IntentFilter ( ) ; private final BroadcastReceiver eventReceiver ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onApiConnected ( ) { } @ Override public void onApiDisconnected ( ) { } private void onModeUpdate ( Drone drone ) { drone = getDrone ( ) ; final State droneState = drone . getAttribute ( STATE ) ; Fragment infoPanel ; <START_BUG> if ( ! ( droneState . isConnected ( ) ) ) { <END_BUG> infoPanel = new ModeDisconnectedFragment ( ) ; } else { VehicleMode mode = droneState . getVehicleMode ( ) ; if ( mode == null ) { infoPanel = new ModeDisconnectedFragment ( ) ; } else { switch ( mode ) { case COPTER_RTL : case PLANE_RTL : case ROVER_RTL : infoPanel = new ModeRTLFragment ( ) ; break ; case COPTER_AUTO : case PLANE_AUTO : case ROVER_AUTO : infoPanel = new ModeAutoFragment ( ) ; break ; case COPTER_LAND : infoPanel = new ModeLandFragment ( ) ; break ; case COPTER_LOITER : case PLANE_LOITER : infoPanel = new ModeLoiterFragment ( ) ; break ; case COPTER_STABILIZE : case PLANE_STABILIZE : infoPanel = new ModeStabilizeFragment ( ) ; break ; case COPTER_ACRO : infoPanel = new ModeAcroFragment ( ) ; break ; case COPTER_ALT_HOLD : infoPanel = new ModeAltholdFragment ( ) ; break ; case COPTER_CIRCLE : case PLANE_CIRCLE : infoPanel = new ModeCircleFragment ( ) ; break ; case COPTER_GUIDED : case PLANE_GUIDED : case ROVER_GUIDED : final FollowState followState = drone . getAttribute ( FOLLOW_STATE ) ; if ( followState . isEnabled ( ) ) { infoPanel = new ModeFollowFragment ( ) ; } else { infoPanel = new ModeGuidedFragment ( ) ; } break ; case COPTER_DRIFT : infoPanel = new ModeDriftFragment ( ) ; break ; case COPTER_SPORT : infoPanel = new ModeSportFragment ( ) ; break ; case COPTER_POSHOLD : infoPanel = new ModePosHoldFragment ( ) ; break ; default : infoPanel = new ModeDisconnectedFragment ( ) ; break ; } } } getChildFragmentManager ( ) . beginTransaction ( ) . replace ( modeInfoPanel , infoPanel ) . commit ( ) ; } No newline ; at end ; of file ; }

Fix:
if ( ( droneState == null ) || ( ! ( droneState . isConnected ( ) ) ) ) {
Buggy code:
public interface AddressRepository extends MyRepository < Address , String > { <START_BUG> @ Query ( "from<seq2seq4repair_space>Address<seq2seq4repair_space>a<seq2seq4repair_space>where<seq2seq4repair_space>a.userId=:userId<seq2seq4repair_space>and<seq2seq4repair_space>a.deletedYN='N'" ) <END_BUG> public List < Address > getByUserId ( @ Param ( "userId" ) String userId ) ; }

Fix:
@ Query ( "from<seq2seq4repair_space>Address<seq2seq4repair_space>a<seq2seq4repair_space>where<seq2seq4repair_space>a.userId=:userId<seq2seq4repair_space>and<seq2seq4repair_space>a.deletedYN='N'<seq2seq4repair_space>order<seq2seq4repair_space>by<seq2seq4repair_space>createdTime<seq2seq4repair_space>DESC" )
Buggy code:
@ RestController public class castleDashController { @ Autowired UserRepository users ; @ Autowired SaveRepository saves ; @ Autowired LevelRepository levels ; @ PostConstruct public void init ( ) throws Exception { } @ RequestMapping ( path = "//createUser" , method = RequestMethod . POST ) public String createUser ( String username , String password ) throws NoSuchAlgorithmException , InvalidKeySpecException { } @ RequestMapping ( path = "//login" , method = RequestMethod . POST ) public String login ( HttpSession session , String username , String password ) throws Exception { } @ RequestMapping ( value = "//logout" , method = RequestMethod . POST ) public String logout ( HttpSession session , HttpServletResponse response , HttpSession saveSession ) throws IOException { } @ RequestMapping ( path = "//createSave" , method = RequestMethod . POST ) public Save createSave ( HttpSession session ) throws Exception { } @ RequestMapping ( path = "//saveList" , method = RequestMethod . GET ) public List savesList ( HttpSession session ) { } @ RequestMapping ( path = "//selectSave" , method = RequestMethod . POST ) public String selectSave ( HttpSession saveSession , int id ) { } @ RequestMapping ( path = "//deleteSave" , method = RequestMethod . POST ) public String deleteSave ( int id ) { } @ RequestMapping ( value = "//exitSave" , method = RequestMethod . POST ) public String exitSave ( HttpSession saveSession ) throws IOException { } @ RequestMapping ( path = "//saveGame" , method = RequestMethod . POST ) public String saveGame ( HttpSession saveSession , int level , int score ) { } @ RequestMapping ( path = "//levelData" , method = RequestMethod . GET ) public List < Level > levelList ( ) { List < Level > finalList = new ArrayList < > ( ) ; for ( int i = 1 ; i < 4 ; i ++ ) { Random rn = new Random ( ) ; <START_BUG> int randVersion = ( rn . nextInt ( 2 ) ) + 1 ; <END_BUG> List < Level > tempList = levels . findAllByLevelNumber ( i ) ; Level randomLevel = tempList . get ( randVersion ) ; finalList . add ( randomLevel ) ; } return finalList ; } static String readFile ( String fileName ) { } }

Fix:
int randVersion = rn . nextInt ( 3 ) ;
Buggy code:
public class ModuleClassLoaderProvider extends ClassLoaderProvider { private static final ModuleIdentifier ASIL = ModuleIdentifier . create ( "org.jboss.as.webservices.server.integration" ) ; private WeakReference < ClassLoader > integrationClassLoader ; @ Override public ClassLoader getWebServiceSubsystemClassLoader ( ) { } @ Override public ClassLoader getServerIntegrationClassLoader ( ) { } @ Override public ClassLoader getServerJAXRPCIntegrationClassLoader ( ) { <START_BUG> throw new UnsupportedOperationException ( "JAXRPC<seq2seq4repair_space>not<seq2seq4repair_space>supported" ) ; <END_BUG> } public static void register ( ) { } }

Fix:
throw new UnsupportedOperationException ( ) ;
Buggy code:
class ArquillianConfig implements Service < ArquillianConfig > { static final AttachmentKey < ArquillianConfig > KEY = AttachmentKey . create ( ArquillianConfig . class ) ; private final ArquillianService arqService ; private final DeploymentUnit depUnit ; private final ServiceName serviceName ; private final List < String > testClasses = new ArrayList < String > ( ) ; private final InjectedValue < BundleContext > injectedBundleContext = new InjectedValue < BundleContext > ( ) ; private ServiceTarget serviceTarget ; static ServiceName getServiceName ( DeploymentUnit depUnit ) { } ArquillianConfig ( ArquillianService arqService , DeploymentUnit depUnit , Set < String > testClasses ) { } ServiceBuilder < ArquillianConfig > buildService ( ServiceTarget serviceTarget , ServiceController < ? > depController ) { } void addFrameworkDependency ( ServiceBuilder < ArquillianConfig > builder ) { builder . addDependency ( SYSTEM_CONTEXT , BundleContext . class , injectedBundleContext ) ; <START_BUG> builder . addDependency ( FRAMEWORK_ACTIVATOR ) ; <END_BUG> } ServiceName getServiceName ( ) { } DeploymentUnit getDeploymentUnit ( ) { } List < String > getTestClasses ( ) { } BundleContext getBundleContext ( ) { } Class < ? > loadClass ( String className ) throws ClassNotFoundException { } @ Override public synchronized void start ( StartContext context ) throws StartException { } @ Override public synchronized void stop ( StopContext context ) { } @ Override public synchronized ArquillianConfig getValue ( ) { } @ Override public String toString ( ) { } }

Fix:
builder . addDependency ( FRAMEWORK_ACTIVE ) ;
Buggy code:
public class SchedulingSolverTest { private static Map < String , String > output = new HashMap < String , String > ( ) ; public static boolean test0 ( ) { } public static boolean test1 ( ) { } public static boolean test2 ( ) { } public static boolean test3 ( ) { } public static boolean test4 ( ) { } public static boolean test5 ( ) { } public static void testSchedules ( String [ ] paths , boolean expected ) { } public static void main ( String [ ] args ) throws FileNotFoundException { } private static boolean runTest ( String testName , String json , boolean expectedResult ) { System . out . println ( ( "Running<seq2seq4repair_space>test<seq2seq4repair_space>" + testName ) ) ; try { ScheduleData data = ScheduleData . parseJson ( json ) ; <START_BUG> Schedule schedule = new Schedule ( "" , data . events , data . spaces ) ; <END_BUG> JSONObject solution = new JSONObject ( schedule . getSolution ( true ) ) ; SchedulingSolverTest . output . put ( testName , solution . toString ( ) ) ; boolean result = expectedResult != ( solution . getBoolean ( "wasFailure" ) ) ; if ( ! result ) System . out . println ( ( testName + "<seq2seq4repair_space>failed" ) ) ; else System . out . println ( ( testName + "<seq2seq4repair_space>passed" ) ) ; return result ; } catch ( Exception e ) { System . out . println ( ( "Caught<seq2seq4repair_space>exception<seq2seq4repair_space>in<seq2seq4repair_space>" + testName ) ) ; e . printStackTrace ( ) ; return false ; } } private static boolean runFileTest ( String testName , String fileName , boolean expectedResult ) { } private static void runInteractiveTest ( ) { } }

Fix:
Schedule schedule = new Schedule ( "" , data . events , data . spaces , data . constraints ) ;
Buggy code:
public class TransactionalSpoutCoordinator implements IRichSpout { public static final Logger LOG = Logger . getLogger ( TransactionalSpoutCoordinator . class ) ; public static final BigInteger INIT_TXID = BigInteger . ONE ; public static final String TRANSACTION_BATCH_STREAM_ID = ( TransactionalSpoutCoordinator . class . getName ( ) ) + "//batch" ; public static final String TRANSACTION_COMMIT_STREAM_ID = ( TransactionalSpoutCoordinator . class . getName ( ) ) + "//commit" ; private static final String CURRENT_TX = "currtx" ; private static final String META_DIR = "meta" ; private ITransactionalSpout _spout ; private Coordinator _coordinator ; private TransactionalState _state ; private RotatingTransactionalState _coordinatorState ; TreeMap < BigInteger , TransactionalSpoutCoordinator . TransactionStatus > _activeTx = new TreeMap < BigInteger , TransactionalSpoutCoordinator . TransactionStatus > ( ) ; private SpoutOutputCollector _collector ; BigInteger _currTransaction ; int _maxTransactionActive ; TransactionalSpoutCoordinator . StateInitializer _initializer ; public TransactionalSpoutCoordinator ( ITransactionalSpout spout ) { } public ITransactionalSpout getSpout ( ) { } @ Override public void open ( Map conf , TopologyContext context , SpoutOutputCollector collector ) { } @ Override public void close ( ) { } @ Override public void nextTuple ( ) { } @ Override public void ack ( Object msgId ) { } @ Override public void fail ( Object msgId ) { } @ Override public void declareOutputFields ( OutputFieldsDeclarer declarer ) { <START_BUG> declarer . declareStream ( TransactionalSpoutCoordinator . TRANSACTION_BATCH_STREAM_ID , new Fields ( "tx" , "tx-meta" , "curr-txid" ) ) ; <END_BUG> declarer . declareStream ( TransactionalSpoutCoordinator . TRANSACTION_COMMIT_STREAM_ID , new Fields ( "tx" ) ) ; } private void sync ( ) { } @ Override public Map < String , Object > getComponentConfiguration ( ) { } private static enum AttemptStatus { PROCESSING , PROCESSED , COMMITTING ; } private static class TransactionStatus { TransactionAttempt attempt ; TransactionalSpoutCoordinator . AttemptStatus status ; public TransactionStatus ( TransactionAttempt attempt ) { } @ Override public String toString ( ) { } } private BigInteger nextTransactionId ( BigInteger id ) { } private BigInteger previousTransactionId ( BigInteger id ) { } private BigInteger getStoredCurrTransaction ( TransactionalState state ) { } private class StateInitializer implements RotatingTransactionalState . StateInitializer { @ Override public Object init ( BigInteger txid , Object lastState ) { } } }

Fix:
declarer . declareStream ( TransactionalSpoutCoordinator . TRANSACTION_BATCH_STREAM_ID , new Fields ( "tx" , "tx-meta" , "committed-txid" ) ) ;
Buggy code:
public class IlluminaTransformer implements FileSetTransformer < String , String , File > { protected static final Logger log = LoggerFactory . getLogger ( IlluminaTransformer . class ) ; private Map < String , String > finishedCache = new HashMap < > ( ) ; private final Pattern runCompleteLogPattern = Pattern . compile ( "(\\d{1,2}\\//\\d{1,2}\\//\\d{4},\\d{2}:\\d{2}:\\d{2})\\.\\d{3},\\d+,\\d+,\\d+,Proce[s||e]sing\\s+completed\\.\\s+Run\\s+has\\s+finished\\." ) ; private final Pattern lastDateEntryLogPattern = Pattern . compile ( "(\\d{1,2}\\//\\d{1,2}\\//\\d{4},\\d{2}:\\d{2}:\\d{2})\\.\\d{3},\\d+,\\d+,\\d+,.*" ) ; private final DateFormat logDateFormat = new SimpleDateFormat ( "MM'//'dd'//'yyyy','HH:mm:ss" ) ; public Map < String , String > transform ( Message < Set < File > > message ) { } @ Override public Map < String , String > transform ( Set < File > files ) { } private void checkDates ( File rootFile , JSONObject run ) throws IOException { } private Boolean checkLogs ( File rootFile , JSONObject run ) throws IOException { } private JSONObject parseInterOp ( File rootFile ) throws IOException { MetrixContainer mc = new MetrixContainer ( rootFile . getAbsolutePath ( ) ) ; <START_BUG> return JSONObject . fromObject ( new nki . decorators . MetrixContainerDecorator ( mc ) ) ; <END_BUG> } public JSONArray transformInterOpOnly ( Set < File > files ) { } public byte [ ] transformToJson ( Set < File > files ) { } public Message < Set < String > > runStatusFilesToStringSetMessage ( Message < Set < File > > message ) { } public Message < Set < String > > runCompletedFilesToStringSetMessage ( Message < Set < File > > message ) { } public Set < String > runStatusJobToStringSet ( JobExecution exec ) { } public Set < String > runCompletedJobToStringSet ( JobExecution exec ) { } }

Fix:
return JSONObject . fromObject ( new nki . decorators . MetrixContainerDecorator ( mc ) . toJSON ( ) . toJSONString ( ) ) ;
Buggy code:
public class ACServlet extends HttpServlet { private static final long serialVersionUID = 1L ; public static final String LEGACY_REQUEST_HEADER = "X-VOMS-Legacy" ; public static final Logger log = LoggerFactory . getLogger ( ACServlet . class ) ; private VOMSResponseBuilder responseBuilder ; private ACGenerator acGenerator ; private ACRequestLogger acRequestLogger ; protected void addDebugHeaders ( HttpServletResponse response , RequestContext context ) { } protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override public void init ( ) throws ServletException { } protected boolean isACEndpointEnabled ( ) { } protected boolean isLegacyRequest ( HttpServletRequest request ) { } public void logFailure ( RequestContext context , String errorMessage ) { } public void logSuccess ( RequestContext context ) { } protected AttributeAuthority newAttributeAuthority ( ) { long maximumValidity = VOMSConfiguration . instance ( ) . getLong ( VOMS_AA_X509_MAX_AC_VALIDITY , TimeUnit . HOURS . toSeconds ( 12 ) ) ; boolean legacyFQANEncoding = VOMSConfiguration . instance ( ) . getBoolean ( VOMS_AA_X509_LEGACY_FQAN_ENCODING , true ) ; <START_BUG> return AttributeAuthorityFactory . newAttributeAuthority ( maximumValidity ) ; <END_BUG> } protected RequestContext newRequestContext ( HttpServletRequest request ) { } protected List < String > parseRequestedFQANs ( HttpServletRequest request ) { } private List < String > parseTargetsFromRequest ( HttpServletRequest request ) { } private long parseValidityFromRequest ( HttpServletRequest request ) { } private void populateRequest ( HttpServletRequest request , RequestContext context ) { } protected void prepareResponse ( HttpServletResponse response ) { } protected void writeErrorResponse ( HttpServletRequest request , HttpServletResponse response , VOMSErrorMessage errorMessage , boolean isLegacyClient ) throws IOException , ServletException { } protected void writeResponse ( HttpServletResponse response , byte [ ] ac , RequestContext context ) throws IOException , ServletException { } }

Fix:
return AttributeAuthorityFactory . newAttributeAuthority ( maximumValidity , legacyFQANEncoding ) ;
Buggy code:
public class BlockSettingsManager { private static final String TAG = "RedBox<seq2seq4repair_space>data_blockManaging" ; private TreeMap < Long , BlockSetting > mBlockSettings = new TreeMap < Long , BlockSetting > ( ) ; private ArrayList < BlockSettingsManager . OnBlockSettingChangeListener > mListeners = new ArrayList < BlockSettingsManager . OnBlockSettingChangeListener > ( ) ; public BlockSettingsManager ( ) { } public void setDatas ( TreeMap < Long , BlockSetting > blockSettings ) { } public TreeMap < Long , BlockSetting > getDatas ( ) { } private static Long makeKey ( final BlockSetting setting ) { } private static Long makeKey ( final String parsedNumber ) { } public int getSize ( ) { } private Long getKeyForId ( int id ) { } public BlockSetting get ( int id ) { } public BlockSetting get ( String parsedNumber ) { } public boolean isExist ( BlockSetting setting ) { } public boolean isExist ( String parsedNumber ) { } private boolean isExist ( Long key ) { } public boolean add ( BlockSetting setting ) { } private void remove ( final Long key ) { } public void remove ( final int id ) { } public void remove ( final BlockSetting setting ) { } private void notifyDataChanged ( ) { } private BlockSetting getValueForId ( final int id ) { } public void update ( final int id , final BlockSetting setting ) { final BlockSetting originalSetting = getValueForId ( id ) ; final Long oldKey = BlockSettingsManager . makeKey ( originalSetting . mParsedNumber ) ; mBlockSettings . remove ( oldKey ) ; <START_BUG> Long key = BlockSettingsManager . makeKey ( setting . mNumber ) ; <END_BUG> mBlockSettings . put ( key , setting ) ; notifyDataChanged ( ) ; } public void updateRejectCall ( int id , boolean reject ) { } public void updateDeleteCallLog ( int id , boolean deleteCallLog ) { } public void updateSendAutoSMS ( int id , boolean sendAutoSMS ) { } public void setOnBlockSettingChangeListener ( BlockSettingsManager . OnBlockSettingChangeListener listener ) { } public int getId ( BlockSetting rule ) { } public static interface OnBlockSettingChangeListener { void onBlockSettingsChanged ( ) { } } }

Fix:
Long key = BlockSettingsManager . makeKey ( setting . mParsedNumber ) ;
Buggy code:
public final class MappingConverter implements GenericConverter { private Mapper mapper ; private MappingTargetFactory mappingTargetFactory ; public MappingConverter ( Mapper mapper ) { } public MappingConverter ( Mapper mapper , MappingTargetFactory mappingTargetFactory ) { } public Object convert ( Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) { } private boolean isCopyByReference ( TypeDescriptor sourceType , TypeDescriptor targetType ) { <START_BUG> if ( ( BeanUtils . isSimpleValueType ( targetType . getType ( ) ) ) || ( Enum . class . isAssignableFrom ( targetType . getType ( ) ) ) ) { <END_BUG> return true ; } else { return false ; } } private Object createAndMap ( TypeDescriptor targetType , Object source , TypeDescriptor sourceType ) { } }

Fix:
if ( BeanUtils . isSimpleValueType ( targetType . getType ( ) ) ) {
Buggy code:
public class Identity { private static final String SIGNATURE_FILE = "signature_file" ; private static final String ORGANISATION = "organisation" ; private static final String REPLY_ADDRESS = "reply_address" ; private static final String NAME = "name" ; private static final String ADDRESS = "address" ; protected XmlElement e ; protected Address address ; protected Address replyToAddress ; public Identity ( XmlElement e ) throws ParserException { } public Address getAddress ( ) { } public void setAddress ( Address address ) { } public Address getReplyToAddress ( ) { } public void setReplyToAddress ( Address address ) { } public String getOrganisation ( ) { } public void setOrganisation ( String organisation ) { } public File getSignature ( ) { } public void setSignature ( File signature ) { if ( ( ( signature != null ) && ( signature . exists ( ) ) ) && ( signature . isFile ( ) ) ) { e . addAttribute ( Identity . SIGNATURE_FILE , signature . getPath ( ) ) ; } else { e . getAttributes ( ) . remove ( Identity . SIGNATURE_FILE ) ; } <START_BUG> e . notifyObservers ( signature ) ; <END_BUG> } public void addObserver ( Observer observer ) { } public void removeObserver ( Observer observer ) { } }

Fix:
e . notifyObservers ( ) ;
Buggy code:
public class BootstrapTest extends SchemaLoader { @ Test public void testGetNewNames ( ) throws IOException { Descriptor desc = Descriptor . fromFilename ( new File ( "Keyspace1" , "Standard1-500-Data.db" ) . toString ( ) ) ; <START_BUG> PendingFile inContext = new PendingFile ( null , desc , "Data.db" , Arrays . asList ( new org . apache . cassandra . utils . Pair < Long , Long > ( 0L , 1L ) ) ) ; <END_BUG> PendingFile outContext = StreamIn . getContextMapping ( inContext ) ; assert ! ( inContext . getFilename ( ) . equals ( outContext . getFilename ( ) ) ) ; Assert . assertEquals ( inContext . component , outContext . component ) ; Assert . assertEquals ( inContext . desc . ksname , outContext . desc . ksname ) ; Assert . assertEquals ( inContext . desc . cfname , outContext . desc . cfname ) ; } }

Fix:
PendingFile inContext = new PendingFile ( null , desc , "Data.db" , Arrays . asList ( new org . apache . cassandra . utils . Pair < Long , Long > ( 0L , 1L ) ) , OperationType . BOOTSTRAP ) ;
Buggy code:
class GameBoard { public static final String ANSI_RESET = "[0m" ; public static final String ANSI_BLACK = "[30m" ; public static final String ANSI_RED = "[31m" ; public static final String ANSI_GREEN = "[32m" ; public static final String ANSI_YELLOW = "[33m" ; public static final String ANSI_BLUE = "[34m" ; public static final String ANSI_PURPLE = "[35m" ; public static final String ANSI_CYAN = "[36m" ; public static final String ANSI_WHITE = "[37m" ; private short [ ] asGrid ; private Ship [ ] aShips ; public GameBoard ( ) { } public boolean allShipsSunk ( ) { } public String status ( ) { String strOut = "" ; String strColour = "" ; String strStatus = "" ; for ( Ship ship : aShips ) { switch ( ship . floating ( ) ) { case 0 : strStatus = "SUNK" ; strColour = GameBoard . ANSI_RED ; break ; case 1 : strStatus = "HIT" ; strColour = GameBoard . ANSI_YELLOW ; break ; <START_BUG> case 1 : <END_BUG> strStatus = "FLOATING" ; strColour = GameBoard . ANSI_GREEN ; break ; } if ( Battleship . ansi ) strOut += String . format ( "%-19s<seq2seq4repair_space>-<seq2seq4repair_space>%s%s%s\n" , ship , strColour , strStatus , GameBoard . ANSI_RESET ) ; else strOut += String . format ( "%-19s<seq2seq4repair_space>-<seq2seq4repair_space>%s\n" , ship , strStatus ) ; } return strOut ; } public String getShot ( int nPosX , int nPosY ) { } public String print ( boolean isPlayer ) { } }

Fix:
case 2 :
Buggy code:
public class MachineFragment extends BaseFragment implements IBeaconListView { protected BeaconAdapter adapter ; protected Boolean updatePaused = false ; protected ArrayList < Beacon > selectedBeacons = new ArrayList < > ( ) ; protected Menu menu ; protected Machine machine ; @ Nullable @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onViewCreated ( View view , Bundle savedInstanceState ) { } protected void updateMenuButtons ( ) { } @ Override protected void createActionBarMenu ( Menu menu ) { } @ Override protected boolean handleMenuClick ( int itemId ) { } @ Override public void RefreshList ( ArrayList < Beacon > beacons ) { } protected void updateBeaconListView ( ) { } protected void menuActionDeleteBeacon ( final DatabaseHandler databaseHandler ) { AlertDialog . Builder builder = new AlertDialog . Builder ( activity ) ; builder . setTitle ( alert_title_deleteBeacon ) ; builder . setMessage ( String . format ( activity . getResources ( ) . getString ( alert_message_deleteBeacon ) , selectedBeacons . toString ( ) ) ) ; builder . setNegativeButton ( cancel , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int id ) { } } ) ; builder . setPositiveButton ( delete , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int id ) { <START_BUG> for ( Beacon beacon : selectedBeacons ) { <END_BUG> selectedBeacons . remove ( beacon ) ; databaseHandler . deleteBeacon ( beacon ) ; } updateBeaconListView ( ) ; updateMenuButtons ( ) ; } } ) ; AlertDialog dialog = builder . create ( ) ; dialog . show ( ) ; } protected void menuActionDeleteMachine ( final DatabaseHandler databaseHandler ) { } @ Override protected void disconnectView ( ) { } }

Fix:
for ( Beacon beacon : new ArrayList ( selectedBeacons ) ) {
Buggy code:
public class TestMinHashClustering extends MahoutTestCase { private static final double [ ] [ ] REFERENCE = new double [ ] [ ] { new double [ ] { 1 , 2 , 3 , 4 , 5 } , new double [ ] { 2 , 1 , 3 , 6 , 7 } , new double [ ] { 3 , 7 , 6 , 11 , 8 , 9 } , new double [ ] { 4 , 7 , 8 , 9 , 6 , 1 } , new double [ ] { 5 , 8 , 10 , 4 , 1 } , new double [ ] { 6 , 17 , 14 , 15 } , new double [ ] { 8 , 9 , 11 , 6 , 12 , 1 , 7 } , new double [ ] { 10 , 13 , 9 , 7 , 4 , 6 , 3 } , new double [ ] { 3 , 5 , 7 , 9 , 2 , 11 } , new double [ ] { 13 , 7 , 6 , 8 , 5 } } ; private Path input ; private Path output ; public static List < VectorWritable > getPointsWritable ( double [ ] [ ] raw ) { } @ Override public void setUp ( ) throws Exception { } private String [ ] makeArguments ( int minClusterSize , int minVectorSize , int numHashFunctions , int keyGroups , String hashType ) { <START_BUG> return new String [ ] { optKey ( INPUT_OPTION ) , input . toString ( ) , optKey ( OUTPUT_OPTION ) , output . toString ( ) , optKey ( MIN_CLUSTER_SIZE ) , String . valueOf ( minClusterSize ) , optKey ( MIN_VECTOR_SIZE ) , String . valueOf ( minVectorSize ) , optKey ( HASH_TYPE ) , hashType , optKey ( NUM_HASH_FUNCTIONS ) , String . valueOf ( numHashFunctions ) , optKey ( KEY_GROUPS ) , String . valueOf ( keyGroups ) , optKey ( NUM_REDUCERS ) , "1" , optKey ( DEBUG_OUTPUT ) , "true" } ; <END_BUG> } private static Set < Integer > getValues ( Vector vector ) { } private static void runPairwiseSimilarity ( List < Vector > clusteredItems , double simThreshold , String msg ) { } private static void verify ( Path output , double simThreshold , String msg ) { } @ Test public void testLinearMinHashMRJob ( ) throws Exception { } @ Test public void testPolynomialMinHashMRJob ( ) throws Exception { } @ Test public void testMurmurMinHashMRJob ( ) throws Exception { } @ Test public void testMurmur3MinHashMRJob ( ) throws Exception { } }

Fix:
return new String [ ] { optKey ( INPUT_OPTION ) , input . toString ( ) , optKey ( OUTPUT_OPTION ) , output . toString ( ) , optKey ( MIN_CLUSTER_SIZE ) , String . valueOf ( minClusterSize ) , optKey ( MIN_VECTOR_SIZE ) , String . valueOf ( minVectorSize ) , optKey ( HASH_TYPE ) , hashType , optKey ( NUM_HASH_FUNCTIONS ) , String . valueOf ( numHashFunctions ) , optKey ( KEY_GROUPS ) , String . valueOf ( keyGroups ) , optKey ( NUM_REDUCERS ) , "1" , optKey ( DEBUG_OUTPUT ) } ;
Buggy code:
public class ServerGroupResourceDefinition extends SimpleResourceDefinition { public static final PathElement PATH = PathElement . pathElement ( SERVER_GROUP ) ; public static final SimpleAttributeDefinition PROFILE = SimpleAttributeDefinitionBuilder . create ( ModelDescriptionConstants . PROFILE , STRING ) . setValidator ( new StringLengthValidator ( 1 ) ) . build ( ) ; public static final SimpleAttributeDefinition SOCKET_BINDING_GROUP = SimpleAttributeDefinitionBuilder . create ( ModelDescriptionConstants . SOCKET_BINDING_GROUP , STRING , false ) . setXmlName ( REF . getLocalName ( ) ) . build ( ) ; public static final SimpleAttributeDefinition SOCKET_BINDING_PORT_OFFSET = SimpleAttributeDefinitionBuilder . create ( ModelDescriptionConstants . SOCKET_BINDING_PORT_OFFSET , INT , true ) . setDefaultValue ( new ModelNode ( 0 ) ) . setXmlName ( PORT_OFFSET . getLocalName ( ) ) . setAllowExpression ( true ) . setValidator ( new IntRangeValidator ( ( - 65535 ) , 65535 , true , true ) ) . build ( ) ; public static final SimpleAttributeDefinition MANAGEMENT_SUBSYSTEM_ENDPOINT = SimpleAttributeDefinitionBuilder . create ( ModelDescriptionConstants . MANAGEMENT_SUBSYSTEM_ENDPOINT , BOOLEAN , true ) . setDefaultValue ( new ModelNode ( false ) ) . build ( ) ; public static final AttributeDefinition [ ] ADD_ATTRIBUTES = new AttributeDefinition [ ] { ServerGroupResourceDefinition . PROFILE , ServerGroupResourceDefinition . SOCKET_BINDING_GROUP , ServerGroupResourceDefinition . SOCKET_BINDING_PORT_OFFSET , ServerGroupResourceDefinition . MANAGEMENT_SUBSYSTEM_ENDPOINT } ; private final ContentRepository contentRepo ; private final HostFileRepository fileRepository ; public ServerGroupResourceDefinition ( final ContentRepository contentRepo , final HostFileRepository fileRepository ) { } @ Override public void registerAttributes ( ManagementResourceRegistration resourceRegistration ) { } @ Override public void registerOperations ( ManagementResourceRegistration resourceRegistration ) { } @ Override public void registerChildren ( ManagementResourceRegistration resourceRegistration ) { DomainServerLifecycleHandlers . registerServerGroupHandlers ( resourceRegistration ) ; resourceRegistration . registerSubModel ( GLOBAL ) ; <START_BUG> resourceRegistration . registerSubModel ( DomainDeploymentResourceDescription . createForServerGroup ( contentRepo , fileRepository ) ) ; <END_BUG> resourceRegistration . registerSubModel ( SystemPropertyResourceDefinition . createForDomainOrHost ( Location . SERVER_GROUP ) ) ; resourceRegistration . registerSubModel ( new org . jboss . as . server . deploymentoverlay . DeploymentOverlayDefinition ( DeploymentOverlayPriority . SERVER_GROUP , null , null ) ) ; } }

Fix:
resourceRegistration . registerSubModel ( DomainDeploymentResourceDefinition . createForServerGroup ( contentRepo , fileRepository ) ) ;
Buggy code:
public class Sodoku { private Section [ ] rows = new Section [ 9 ] ; private Section [ ] col = new Section [ 9 ] ; private Section [ ] box = new Section [ 9 ] ; public ArrayList < Action > actionChain = new ArrayList ( ) ; public static byte debugLevel ; public Sodoku ( ) { } public void reset ( ) { } public Cell get ( int x , int y ) { } public Cell get ( int n ) { } public void revert ( ) { } public void revertAll ( ) { } public void Solve ( ) throws OutOfGuessesException { } public void set ( Cell changed , Integer val , boolean guess ) throws UnsolveableException { changed . set ( val ) ; if ( guess ) { actionChain . add ( new Actions . CellGuessAction ( changed ) ) ; } for ( Cell c : rows [ changed . x ] ) { if ( c != changed ) { <START_BUG> c . narrowDown ( val , ( guess ? this : null ) ) ; <END_BUG> } } for ( Cell c : col [ changed . y ] ) { if ( c != changed ) { c . narrowDown ( val , ( guess ? this : null ) ) ; } } for ( Cell c : box [ Section . getBoxNum ( changed . x , changed . y ) ] ) { if ( c != changed ) { c . narrowDown ( val , ( guess ? this : null ) ) ; } } } public void makeGuess ( ) throws OutOfGuessesException , UnsolveableException { } public boolean isDone ( ) { } public void print ( ) { } No newline ; at end ; of file ; }

Fix:
c . narrowDown ( val , this ) ;
Buggy code:
public class Embed extends StegoProcessThread { Activity a ; Bitmap image = null ; FileOutputStream dataOut = null ; File file ; File outFile ; File root_dir ; JpegEncoder jpg ; int i ; int Quality = 90 ; boolean haveInputImage = false ; String inFileName = null ; String outFileName = null ; public String secret_message = null ; String dump_dir = null ; private byte [ ] f5_seed ; public interface EmbedListener { public void onEmbedded ( File outFile ) { } } public Embed ( Activity a , String inFileName , String secret_message , byte [ ] f5_seed ) { } public Embed ( Activity a , String dump_dir , String inFileName , String secret_message , byte [ ] f5_seed ) { } public Embed ( Activity a , String dump_dir , String inFileName , String outFileName , String secret_message , byte [ ] f5_seed ) { } public void run ( ) { super . run ( ) ; if ( isInterrupted ( ) ) { return ; } root_dir = new File ( Environment . getExternalStorageDirectory ( ) , dump_dir ) ; if ( ! ( root_dir . exists ( ) ) ) root_dir . mkdir ( ) ; if ( ( outFileName ) == null ) { String extension = this . file . getName ( ) . substring ( ( ( this . file . getName ( ) . lastIndexOf ( "." ) ) - 1 ) ) ; <START_BUG> this . outFile = new File ( root_dir , this . file . getName ( ) . replace ( extension , "_embed.jpg" ) ) ; <END_BUG> this . outFileName = this . outFile . getAbsolutePath ( ) ; } else { this . outFile = new File ( outFileName ) ; } i = 1 ; while ( outFile . exists ( ) ) { this . outFile = new File ( root_dir , ( ( ( ( outFile . getName ( ) . substring ( 0 , outFile . getName ( ) . lastIndexOf ( "." ) ) ) + "_" ) + ( ( i ) ++ ) ) + ".jpg" ) ) ; if ( ( i ) > 100 ) return ; } if ( isInterrupted ( ) ) { return ; } try { embed ( ) ; } catch ( Exception e ) { Log . e ( LOG , e . toString ( ) ) ; e . printStackTrace ( ) ; ( ( info . guardianproject . f5android . plugins . PluginNotificationListener ) ( a ) ) . onFailure ( ) ; } } private void embed ( ) { } }

Fix:
this . outFile = new File ( root_dir , this . file . getName ( ) . replace ( extension , ".jpg" ) ) ;
Buggy code:
public class LoadProperties extends Task { private Resource src = null ; <START_BUG> private final Vector filterChains = new Vector ( ) ; <END_BUG> private String encoding = null ; private String prefix = null ; private boolean prefixValues = true ; public final void setSrcFile ( final File srcFile ) { } public void setResource ( String resource ) { } public final void setEncoding ( final String encoding ) { } public void setClasspath ( Path classpath ) { } public Path createClasspath ( ) { } public void setClasspathRef ( Reference r ) { } public Path getClasspath ( ) { } public void setPrefix ( String prefix ) { } public void setPrefixValues ( boolean b ) { } public final void execute ( ) throws BuildException { } public final void addFilterChain ( FilterChain filter ) { filterChains . addElement ( filter ) ; } public synchronized void addConfigured ( ResourceCollection a ) { } private synchronized JavaResource getRequiredJavaResource ( ) { } }

Fix:
private final Vector < FilterChain > filterChains = new Vector < FilterChain > ( ) ;
Buggy code:
public class PreferenceHandler { private static final Preferences myPrefs = Preferences . userRoot ( ) . node ( "paxchecker" ) ; private static final List < Preference > prefArray = new ArrayList < > ( ) ; public static synchronized void init ( ) { } protected static synchronized Object loadPreferenceValue ( Preference pref ) { } protected static synchronized Object loadPreferenceValue ( Preference . TYPES pref ) { } public static synchronized boolean getBooleanPreference ( Preference . TYPES type ) { } public static synchronized int getIntegerPreference ( Preference . TYPES type ) { } public static synchronized String getStringPreference ( Preference . TYPES type ) { } protected static synchronized boolean isInPrefs ( Preference . TYPES pref ) { } public static synchronized Preference getPreferenceObject ( Preference . TYPES pref ) { } public static synchronized void savePreferences ( ) { boolean shouldSave = PreferenceHandler . getBooleanPreference ( SAVE_PREFS ) ; System . out . println ( ( "shouldSave<seq2seq4repair_space>=<seq2seq4repair_space>" + shouldSave ) ) ; try { for ( Preference p : PreferenceHandler . prefArray ) { <START_BUG> if ( ( ( p . getValue ( ) ) == null ) || ( ( ! shouldSave ) && ( ! ( p . forceSave ( ) ) ) ) ) { <END_BUG> PreferenceHandler . myPrefs . remove ( p . getPrefType ( ) . name ( ) ) ; } else { PreferenceHandler . myPrefs . put ( p . getPrefType ( ) . name ( ) , String . valueOf ( p . getValue ( ) ) ) ; } } PreferenceHandler . myPrefs . sync ( ) ; } catch ( BackingStoreException bse ) { } } }

Fix:
if ( ( ( p . getValue ( ) ) == null ) || ( ( ( ! shouldSave ) || ( ! ( p . shouldSave ( ) ) ) ) && ( ! ( p . forceSave ( ) ) ) ) ) {
Buggy code:
public final class SimpleNameVector { static int INITIAL_SIZE = 10 ; public int size ; int maxSize ; char [ ] [ ] elements ; public SimpleNameVector ( ) { } public void add ( char [ ] newElement ) { if ( ( this . size ) == ( this . maxSize ) ) System . arraycopy ( this . elements , 0 , ( this . elements = new char [ this . maxSize *= 2 ] [ ] ) , 0 , this . size ) ; <START_BUG> this . elements [ ( ( size ) ++ ) ] = newElement ; <END_BUG> } public void addAll ( char [ ] [ ] newElements ) { } public void copyInto ( Object [ ] targetArray ) { } public boolean contains ( char [ ] element ) { } public char [ ] elementAt ( int index ) { } public char [ ] remove ( char [ ] element ) { } public void removeAll ( ) { } public int size ( ) { } public String toString ( ) { } }

Fix:
this . elements [ ( ( this . size ) ++ ) ] = newElement ;
Buggy code:
public class BcnfNormalizer extends Normalizer { public BcnfNormalizer ( Schema schema ) { } @ Override public Schema normalize ( ) { Schema bcnfSchema = this . schema ; while ( ! ( bcnfSchema . getNotInBcnf ( ) . isEmpty ( ) ) ) { <START_BUG> List < Relation > allNotInBcnf = new java . util . ArrayList ( this . schema . getNotInBcnf ( ) ) ; <END_BUG> Relation notInBcnf = allNotInBcnf . get ( 0 ) ; List < Dependency > allViolations = new java . util . ArrayList ( notInBcnf . violatesBcnf ( ) ) ; Dependency violation = allViolations . get ( 0 ) ; SortedSet < String > r1Attributes = new java . util . TreeSet ( notInBcnf . getAttributes ( ) ) ; r1Attributes . removeAll ( violation . getTo ( ) ) ; Relation r1 = new Relation ( bcnfSchema , ( ( notInBcnf . getName ( ) ) + "a" ) , r1Attributes ) ; SortedSet < String > r2Attributes = new java . util . TreeSet ( violation . getFrom ( ) ) ; r2Attributes . addAll ( violation . getTo ( ) ) ; Relation r2 = new Relation ( bcnfSchema , ( ( notInBcnf . getName ( ) ) + "b" ) , r2Attributes ) ; bcnfSchema . getRelations ( ) . remove ( notInBcnf ) ; bcnfSchema . getRelations ( ) . add ( r1 ) ; bcnfSchema . getRelations ( ) . add ( r2 ) ; } return bcnfSchema ; } }

Fix:
List < Relation > allNotInBcnf = new java . util . ArrayList ( bcnfSchema . getNotInBcnf ( ) ) ;