nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Main { public static void main ( String [ ] args ) { } public static void run ( ) { FileRW . processTheFile ( ) ; int numberOfCases = Integer . parseInt ( FileRW . read ( ) ) ; <START_BUG> long [ ] cases = new long [ numberOfCases ] ; <END_BUG> for ( int testCase = 0 ; testCase < numberOfCases ; testCase ++ ) { int numberOfCoordinates = Integer . parseInt ( FileRW . read ( ) ) ; Vector v1 = new Vector ( FileRW . read ( ) , numberOfCoordinates ) ; Vector v2 = new Vector ( FileRW . read ( ) , numberOfCoordinates ) ; v1 . sortAscendingOrder ( ) ; v2 . sortDescendingOrder ( ) ; cases [ testCase ] = v1 . minScalarProduct ( v2 ) ; } FileRW . printResults ( cases ) ; } }

Fix:
String [ ] cases = new String [ numberOfCases ] ;
Buggy code:
public class ToggleSwitches extends Subsystem { private boolean indexerHasGoneUpSinceLastBottomPress ; private long lastIndexerBottomOn ; private Set < String > warnedFor = new HashSet < > ( ) ; private AnalogInput indexerBottom = new AnalogInput ( AnalogIoPorts . BOTTOM_INDEXER_SWITCH ) ; @ Override protected void initDefaultCommand ( ) { } private boolean proccessAnalogInput ( String name , AnalogInput input ) { } public boolean getIndexerTop ( ) { } public void indexerHasGoneUp ( ) { } public boolean getIndexerBottom ( ) { <START_BUG> boolean current = ! ( proccessAnalogInput ( "indexer-bottom" , indexerBottom ) ) ; <END_BUG> long now = System . currentTimeMillis ( ) ; if ( current ) { lastIndexerBottomOn = now ; indexerHasGoneUpSinceLastBottomPress = false ; } if ( ( ( lastIndexerBottomOn ) + 200 ) >= now ) { return true ; } else { return ! ( indexerHasGoneUpSinceLastBottomPress ) ; } } public boolean getVerticalClawTop ( ) { } }

Fix:
boolean current = proccessAnalogInput ( "indexer-bottom" , indexerBottom ) ;
Buggy code:
@ Component public class UserMgmtServerCommands implements CommandMarker { @ Autowired private UserMgmtServerRestClient userMgmtServerRestClient ; @ Autowired private MgmtVMCfgClient mgmtCfgOnMgmtVMClient ; <START_BUG> @ CliAvailabilityIndicator ( { "usermgmt<seq2seq4repair_space>help" } ) <END_BUG> public boolean isCommandAvailable ( ) { return true ; } @ CliCommand ( value = "usermgmtserver<seq2seq4repair_space>get" , help = "get<seq2seq4repair_space>the<seq2seq4repair_space>default<seq2seq4repair_space>AD//LDAP<seq2seq4repair_space>server<seq2seq4repair_space>info." ) public void modifyUserMgmtServer ( ) { } @ CliCommand ( value = "usermgmtserver<seq2seq4repair_space>modify" , help = "Change<seq2seq4repair_space>the<seq2seq4repair_space>default<seq2seq4repair_space>AD//LDAP<seq2seq4repair_space>server<seq2seq4repair_space>info." ) public void modifyUserMgmtServer ( @ CliOption ( key = { "cfgfile" } , mandatory = true , help = "The<seq2seq4repair_space>AD//LDAP<seq2seq4repair_space>server<seq2seq4repair_space>configuration<seq2seq4repair_space>JSON<seq2seq4repair_space>file<seq2seq4repair_space>path." ) final String cfgFilePath , @ CliOption ( key = { "trustCertificate" } , mandatory = false , help = "Trust<seq2seq4repair_space>the<seq2seq4repair_space>server<seq2seq4repair_space>certificate." ) final Boolean trustCertificateFlag ) { } @ CliCommand ( value = "usermgmtserver<seq2seq4repair_space>add" , help = "Add<seq2seq4repair_space>an<seq2seq4repair_space>AD//LDAP<seq2seq4repair_space>server<seq2seq4repair_space>as<seq2seq4repair_space>the<seq2seq4repair_space>default<seq2seq4repair_space>user<seq2seq4repair_space>management<seq2seq4repair_space>server<seq2seq4repair_space>for<seq2seq4repair_space>VMs." ) public void addUserMgmtServer ( @ CliOption ( key = { "cfgfile" } , mandatory = true , help = "The<seq2seq4repair_space>AD//LDAP<seq2seq4repair_space>server<seq2seq4repair_space>configuration<seq2seq4repair_space>JSON<seq2seq4repair_space>file<seq2seq4repair_space>path." ) final String cfgFilePath , @ CliOption ( key = { "trustCertificate" } , mandatory = false , help = "Trust<seq2seq4repair_space>the<seq2seq4repair_space>server<seq2seq4repair_space>certificate." ) final Boolean trustCertificateFlag ) { } private boolean handleUntrustedCertificate ( UntrustedCertificateException e , CommandOutputHelper commandOutputHelper , Runnable runnable ) { } private void handleValidationErrors ( ValidationException validationEx , CommandOutputHelper outputHelper ) { } private UserMgmtServer parseUserMgmtServer ( String cfgFilePath , CommandOutputHelper MODIFY_LDAP_OUTPUT ) { } }

Fix:
@ CliAvailabilityIndicator ( { "usermgmtserver<seq2seq4repair_space>help" } )
Buggy code:
public class XATestUtil { public static Xid getXid ( int xid , int b1 , int b2 ) { } public static void dumpXAException ( String tag , XAException xae ) { } public static void createXATransactionView ( Statement s ) throws SQLException { } public static void checkXATransactionView ( Connection conn , String [ ] [ ] expectedRows ) throws SQLException { Statement s = conn . createStatement ( ) ; ResultSet rs = s . executeQuery ( "select<seq2seq4repair_space>*<seq2seq4repair_space>from<seq2seq4repair_space>XATESTUTIL.global_xactTable<seq2seq4repair_space>where<seq2seq4repair_space>gxid<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>null<seq2seq4repair_space>order<seq2seq4repair_space>by<seq2seq4repair_space>gxid" ) ; if ( expectedRows == null ) JDBC . assertEmpty ( rs ) ; else <START_BUG> JDBC . assertFullResultSet ( rs , expectedRows ) ; <END_BUG> rs . close ( ) ; } public static String errorCode ( XAException e ) { } }

Fix:
JDBC . assertUnorderedResultSet ( rs , expectedRows ) ;
Buggy code:
public class Player { private String name ; private int balance ; private int limit ; public Player ( String name , int balance ) { } public String getName ( ) { } public int getBalance ( ) { } public int getLimit ( ) { } public void setLimit ( int limit ) { } public boolean balanceExceedsLimit ( ) { } public boolean balanceExceedsLimitBy ( int amount ) { <START_BUG> return ( ( balance ) - amount ) > ( limit ) ; <END_BUG> } public void takeBet ( int bet ) { } public void receiveWinnings ( int winnings ) { } public String toString ( ) { } }

Fix:
return ( ( balance ) - amount ) >= ( limit ) ;
Buggy code:
public class FloatDictCardWindow extends StandOutWindow { private static final String TAG = FloatDictCardWindow . class . getSimpleName ( ) ; private FloatDictCard mCard ; @ Override public String getAppName ( ) { <START_BUG> return "VAA<seq2seq4repair_space>Lookup<seq2seq4repair_space>Copied" ; <END_BUG> } @ Override public int getAppIcon ( ) { } @ Override public void createAndAttachView ( int id , FrameLayout frame ) { } @ Override public StandOutLayoutParams getParams ( int id , Window window ) { } @ Override public int getFlags ( int id ) { } @ Override public Animation getShowAnimation ( int id ) { } @ Override public Animation getCloseAnimation ( int id ) { } @ Override public void onReceiveData ( int id , int requestCode , Bundle data , Class < ? extends StandOutWindow > fromCls , int fromId ) { } }

Fix:
return getString ( share_lookup_name ) ;
Buggy code:
public class FloydWarshall implements ShortestPaths { private Path [ ] [ ] mat ; public FloydWarshall ( Graph g ) { } private void initMat ( Graph g ) { } private void allPairsShortestPaths ( ) { int v = mat . length ; for ( int k = 0 ; k < v ; k ++ ) for ( int i = 0 ; i < v ; i ++ ) for ( int j = 0 ; j < v ; j ++ ) { if ( ( ( mat [ i ] [ k ] ) == null ) || ( ( mat [ k ] [ j ] ) == null ) ) continue ; int alternatePath = ( mat [ i ] [ k ] . weight ) + ( mat [ k ] [ j ] . weight ) ; <START_BUG> if ( alternatePath < ( mat [ i ] [ j ] . weight ) ) { <END_BUG> mat [ i ] [ j ] = Path . concat ( mat [ i ] [ k ] , mat [ k ] [ j ] ) ; } } } @ Override public Path shortestPath ( int src , int dst ) { } }

Fix:
if ( ( ( mat [ i ] [ j ] ) == null ) || ( alternatePath < ( mat [ i ] [ j ] . weight ) ) ) {
Buggy code:
public class Bee { private float x ; private float y ; private float xHome ; private float yHome ; private double ang ; private double angHome ; public Bee ( float x , float y , double ang ) { } public void update ( float x , float y ) { } public Boolean atHome ( ) { } public void fly ( float x , float y ) { float stepX ; float stepY ; <START_BUG> int vel = 20 ; <END_BUG> if ( ( getX ( ) ) > x ) { if ( ( ( getX ( ) ) - x ) < vel ) { stepX = x - ( getX ( ) ) ; } else { stepX = - vel ; } } else { if ( ( x - ( getX ( ) ) ) < vel ) { stepX = x - ( getX ( ) ) ; } else { stepX = + vel ; } } if ( ( getY ( ) ) > y ) { if ( ( ( getY ( ) ) - y ) < vel ) { stepY = y - ( getY ( ) ) ; } else { stepY = - vel ; } } else { if ( ( y - ( getY ( ) ) ) < vel ) { stepY = y - ( getY ( ) ) ; } else { stepY = + vel ; } } update ( ( ( getX ( ) ) + stepX ) , ( ( getY ( ) ) + stepY ) ) ; float dx = x - ( getX ( ) ) ; float dy = y - ( getY ( ) ) ; this . ang = ( ( Math . atan2 ( dx , dy ) ) * 360 ) + 180 ; if ( atHome ( ) ) ang = this . angHome ; } public float getX ( ) { } public float getY ( ) { } public float getxHome ( ) { } public float getyHome ( ) { } public double getAng ( ) { } }

Fix:
int vel = 40 ;
Buggy code:
public class StorageLoadBalancer implements IEndpointStateChangeSubscriber { class LoadBalancer implements Runnable { LoadBalancer ( ) { } public void run ( ) { } } class MoveMessageVerbHandler implements IVerbHandler { public void doVerb ( Message message ) { <START_BUG> Message reply = message . getInternalReply ( new byte [ ] { ( ( byte ) ( isMoveable_ . get ( ) ? 1 : 0 ) ) } ) ; <END_BUG> MessagingService . instance ( ) . sendOneWay ( reply , message . getFrom ( ) ) ; if ( isMoveable_ . get ( ) ) { isMoveable_ . set ( false ) ; } } } private static final int BROADCAST_INTERVAL = 60 * 1000 ; public static final StorageLoadBalancer instance = new StorageLoadBalancer ( ) ; private static final Logger logger_ = LoggerFactory . getLogger ( StorageLoadBalancer . class ) ; private static final int delay_ = 5 ; private static final double TOPHEAVY_RATIO = 1.5 ; private AtomicBoolean isMoveable_ = new AtomicBoolean ( false ) ; private Map < InetAddress , Double > loadInfo_ = new HashMap < InetAddress , Double > ( ) ; private Map < InetAddress , Double > loadInfo2_ = new HashMap < InetAddress , Double > ( ) ; private StorageLoadBalancer ( ) { } public void onChange ( InetAddress endpoint , ApplicationState state , VersionedValue value ) { } public void onJoin ( InetAddress endpoint , EndpointState epState ) { } public void onAlive ( InetAddress endpoint , EndpointState state ) { } public void onDead ( InetAddress endpoint , EndpointState state ) { } public void onRemove ( InetAddress endpoint ) { } private double localLoad ( ) { } private double averageSystemLoad ( ) { } private boolean isHeavyNode ( ) { } private boolean isMoveable ( InetAddress target ) { } private boolean isANeighbour ( InetAddress neighbour ) { } private InetAddress findARandomLightNode ( ) { } public Map < InetAddress , Double > getLoadInfo ( ) { } public void startBroadcasting ( ) { } public void waitForLoadInfo ( ) { } }

Fix:
Message reply = message . getInternalReply ( new byte [ ] { ( ( byte ) ( isMoveable_ . get ( ) ? 1 : 0 ) ) } , message . getVersion ( ) ) ;
Buggy code:
public class Enquirer implements IEnquirer { IObjetoConhecimento obj ; public Enquirer ( ) { } private String isAsked ( ArrayList < IDeclaracao > old , IDeclaracao decl ) { } @ Override public void connect ( IResponder responder ) { IBaseConhecimento bc = new BaseConhecimento ( ) ; String [ ] animals = bc . listaNomes ( ) ; int animal_number = 0 ; boolean acertei ; obj = bc . recuperaObjeto ( animals [ animal_number ] ) ; IDeclaracao decl = obj . primeira ( ) ; ArrayList < IDeclaracao > old = new ArrayList < IDeclaracao > ( ) ; <START_BUG> while ( ( decl != null ) && ( animal_number < ( ( animals . length ) - 1 ) ) ) { <END_BUG> String pergunta = decl . getPropriedade ( ) ; String respostaEsperada = decl . getValor ( ) ; String resposta = isAsked ( old , decl ) ; if ( resposta . equalsIgnoreCase ( "!asked" ) ) { resposta = responder . ask ( pergunta ) ; decl = new Declaracao ( pergunta , resposta ) ; old . add ( decl ) ; } if ( resposta . equalsIgnoreCase ( respostaEsperada ) ) { decl = obj . proxima ( ) ; } else { animal_number ++ ; obj = bc . recuperaObjeto ( animals [ animal_number ] ) ; decl = obj . primeira ( ) ; } } if ( animal_number == ( animals . length ) ) acertei = responder . finalAnswer ( "nao<seq2seq4repair_space>sei" ) ; else acertei = responder . finalAnswer ( animals [ animal_number ] ) ; if ( acertei ) System . out . println ( "Oba!<seq2seq4repair_space>Acertei!" ) ; else System . out . println ( "fuem!<seq2seq4repair_space>fuem!<seq2seq4repair_space>fuem!" ) ; } No newline ; at end ; of file ; }

Fix:
while ( ( decl != null ) && ( animal_number < ( animals . length ) ) ) {
Buggy code:
@ RunWith ( Arquillian . class ) public class EnvEntryInjectionTestCase { @ Deployment public static WebArchive deployment ( ) { WebArchive war = ShrinkWrap . create ( WebArchive . class , "war-example.war" ) ; war . addPackage ( HttpRequest . class . getPackage ( ) ) ; war . addClasses ( EnvEntryInjectionTestCase . class , EnvEntryInjectionServlet . class ) ; <START_BUG> war . addAsWebResource ( EnvEntryInjectionTestCase . getWebXml ( ) , "web.xml" ) ; <END_BUG> return war ; } private static String performCall ( String urlPattern ) throws Exception { } @ Test public void testEcho ( ) throws Exception { } private static StringAsset getWebXml ( ) { } }

Fix:
war . addAsWebInfResource ( EnvEntryInjectionTestCase . getWebXml ( ) , "web.xml" ) ;
Buggy code:
public interface EventBatchListener extends EventListener { public String getInterestedIdentifier ( ) { } <START_BUG> public void receiveEventBatch ( String identifier , List eventBatchEntrys ) ; <END_BUG> }

Fix:
public void receiveEventBatch ( String identifier , List eventBatchEntries ) ;
Buggy code:
public class ClassNameDiscriminatorStrategy extends InValueDiscriminatorStrategy { private static final Localizer _loc = Localizer . forPackage ( ClassNameDiscriminatorStrategy . class ) ; public static final String ALIAS = "class-name" ; public String getAlias ( ) { } protected int getJavaType ( ) { } protected Object getDiscriminatorValue ( ClassMapping cls ) { } protected Class getClass ( Object val , JDBCStore store ) throws ClassNotFoundException { } public void loadSubclasses ( JDBCStore store ) throws ClassNotFoundException , SQLException { if ( isFinal ) { disc . setSubclassesLoaded ( true ) ; return ; } Column col = disc . getColumns ( ) [ 0 ] ; DBDictionary dict = store . getDBDictionary ( ) ; SQLBuffer select = dict . toSelect ( new SQLBuffer ( dict ) . append ( col ) , store . getFetchConfiguration ( ) , new SQLBuffer ( dict ) . append ( col . getTable ( ) ) , null , null , null , null , true , false , 0 , Long . MAX_VALUE ) ; Log log = disc . getMappingRepository ( ) . getLog ( ) ; if ( log . isTraceEnabled ( ) ) log . trace ( ClassNameDiscriminatorStrategy . _loc . get ( "load-subs" , col . getTable ( ) . getFullName ( ) ) ) ; ClassLoader loader = getClassLoader ( store ) ; Connection conn = store . getConnection ( ) ; PreparedStatement stmnt = null ; ResultSet rs = null ; try { stmnt = select . prepareStatement ( conn ) ; rs = stmnt . executeQuery ( ) ; String className ; while ( rs . next ( ) ) { className = dict . getString ( rs , 1 ) ; if ( ( className == null ) || ( ( className . length ( ) ) == 0 ) ) <START_BUG> throw new ClassNotFoundException ( ClassNameDiscriminatorStrategy . _loc . get ( "no-class-name" , disc . getClassMapping ( ) , col ) ) ; <END_BUG> Class . forName ( className , true , loader ) ; } disc . setSubclassesLoaded ( true ) ; } finally { if ( rs != null ) try { rs . close ( ) ; } catch ( SQLException se ) { } if ( stmnt != null ) try { stmnt . close ( ) ; } catch ( SQLException se ) { } try { conn . close ( ) ; } catch ( SQLException se ) { } } } private ClassLoader getClassLoader ( JDBCStore store ) { } }

Fix:
throw new ClassNotFoundException ( ClassNameDiscriminatorStrategy . _loc . get ( "no-class-name" , disc . getClassMapping ( ) , col ) . getMessage ( ) ) ;
Buggy code:
public class Button extends UIElement implements IUIElemntLogic { public Button ( float x , float y , int width , int height ) { } public Button ( float x , float y , Size size ) { } @ Override public void initializeMesh ( ) { } @ Override public void initializePhysics ( ) { } @ Override public void initializeListeners ( ) { <START_BUG> addMouseEnterListener ( ( ) -> ElementRenderers . getElementRenderer ( . class ) . material . color = Color . WHITE ) ; <END_BUG> addMouseLeaveListener ( ( ) -> ElementRenderers . getElementRenderer ( . class ) . material . color = Color . BLUE ) ; } }

Fix:
addMouseEnterListener ( ( ) -> ElementRenderers . getElementRenderer ( . class ) . material . color = Color . RED ) ;
Buggy code:
public class BoxFolderTest { @ Rule public final WireMockRule wireMockRule = new WireMockRule ( 8080 ) ; @ Test @ Category ( UnitTest . class ) public void foldersWithSameIDAreEqual ( ) { } @ Test @ Category ( UnitTest . class ) public void createFolderSendsRequestWithRequiredFields ( ) { } @ Test @ Category ( UnitTest . class ) public void infoParsesMixedPermissionsCorrectly ( ) { } @ Test @ Category ( UnitTest . class ) public void getChildrenRangeRequestsCorrectOffsetLimitAndFields ( ) { } @ Test @ Category ( IntegrationTest . class ) public void creatingAndDeletingFolderSucceeds ( ) { BoxAPIConnection api = new BoxAPIConnection ( TestConfig . getAccessToken ( ) ) ; BoxFolder rootFolder = BoxFolder . getRootFolder ( api ) ; <START_BUG> BoxFolder childFolder = rootFolder . createFolder ( "[creatingAndDeletingFolderSucceeds]<seq2seq4repair_space>Child<seq2seq4repair_space>Folder" ) . getResource ( ) ; <END_BUG> assertThat ( rootFolder , hasItem ( Matchers . < BoxItem . Info > hasProperty ( "ID" , equalTo ( childFolder . getID ( ) ) ) ) ) ; childFolder . delete ( false ) ; assertThat ( rootFolder , not ( hasItem ( Matchers . < BoxItem . Info > hasProperty ( "ID" , equalTo ( childFolder . getID ( ) ) ) ) ) ) ; } @ Test @ Category ( IntegrationTest . class ) public void getFolderInfoReturnsCorrectInfo ( ) { } @ Test @ Category ( IntegrationTest . class ) public void getInfoWithOnlyTheNameField ( ) { } @ Test @ Category ( IntegrationTest . class ) public void iterateWithOnlyTheNameField ( ) { } @ Test @ Category ( IntegrationTest . class ) public void uploadFileSucceeds ( ) { } @ Test @ Category ( IntegrationTest . class ) public void uploadFileWithCreatedAndModifiedDatesSucceeds ( ) { } @ Test @ Category ( IntegrationTest . class ) public void updateFolderInfoSucceeds ( ) { } @ Test @ Category ( IntegrationTest . class ) public void copyFolderToSameDestinationWithNewNameSucceeds ( ) { } @ Test @ Category ( IntegrationTest . class ) public void moveFolderSucceeds ( ) { } @ Test @ Category ( IntegrationTest . class ) public void renameFolderSucceeds ( ) { } @ Test @ Category ( IntegrationTest . class ) public void addCollaboratorSucceeds ( ) { } @ Test @ Category ( IntegrationTest . class ) public void getCollaborationsHasCorrectCollaborations ( ) { } @ Test @ Category ( IntegrationTest . class ) public void setFolderUploadEmailSucceeds ( ) { } @ Test @ Category ( IntegrationTest . class ) public void getSharedItemAndItsChildrenSucceeds ( ) { } }

Fix:
BoxFolder childFolder = rootFolder . createFolder ( "[creatingAndDeletingFolderSucceeds]<seq2seq4repair_space>Ĥȅľľő<seq2seq4repair_space>Ƒŕőďő" ) . getResource ( ) ;
Buggy code:
final class WSEndpointMetrics implements OperationStepHandler { static final WSEndpointMetrics INSTANCE = new WSEndpointMetrics ( ) ; static final String [ ] ATTRIBUTES ; static final String MIN_PROCESSING_TIME = "min-processing-time" ; static final String MAX_PROCESSING_TIME = "max-processing-time" ; static final String AVERAGE_PROCESSING_TIME = "average-processing-time" ; static final String TOTAL_PROCESSING_TIME = "total-processing-time" ; static final String REQUEST_COUNT = "request-count" ; static final String RESPONSE_COUNT = "response-count" ; static final String FAULT_COUNT = "fault-count" ; private WSEndpointMetrics ( ) { } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( REGISTRY_SERVICE ) ; if ( controller != null ) { try { context . getResult ( ) . set ( getEndpointMetricsFragment ( operation , controller ) ) ; } catch ( Exception e ) { throw new OperationFailedException ( new ModelNode ( ) . set ( ( ( ( WSEndpointMetrics . getFallbackMessage ( ) ) + ":<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ) ) ) ; } } else { context . getResult ( ) . set ( WSEndpointMetrics . getFallbackMessage ( ) ) ; } context . completeStep ( ) ; } } , RUNTIME ) ; } else { context . getResult ( ) . set ( WSEndpointMetrics . getFallbackMessage ( ) ) ; } context . completeStep ( ) ; } private ModelNode getEndpointMetricsFragment ( final ModelNode operation , final ServiceController < ? > controller ) throws OperationFailedException { } private static String getFallbackMessage ( ) { } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public class SshConnectionImpl implements SshConnection { private static final Logger logger = LoggerFactory . getLogger ( SshConnectionImpl . class ) ; private static final int ALIVE_INTERVAL = 30 * 1000 ; private static final int CLOSURE_WAIT_TIMEOUT = 200 ; private static final int CLOSURE_WAIT_INTERVAL = 50 ; protected static final String CMD_EXEC = "exec" ; protected static final int PROTO_HOST_DELIM_LENGTH = 3 ; private JSch client ; private Session connectSession ; private String host ; private int port ; private String proxy ; private Authentication authentication ; private AuthenticationUpdater updater ; protected SshConnectionImpl ( String host , int port , Authentication authentication ) { } protected SshConnectionImpl ( String host , int port , String proxy , Authentication authentication ) { } protected SshConnectionImpl ( String host , int port , String proxy , Authentication authentication , AuthenticationUpdater updater ) { } @ Override public synchronized void connect ( ) throws IOException { } @ Override public synchronized boolean isConnected ( ) { } @ Override public synchronized boolean isAuthenticated ( ) { } @ Override public synchronized String executeCommand ( String command ) throws SshException { } private static void waitForChannelClosure ( Channel channel , long timoutInMs ) { } @ Override public synchronized Reader executeCommandReader ( String command ) throws SshException , IOException { if ( ! ( isConnected ( ) ) ) { throw new IllegalStateException ( "Not<seq2seq4repair_space>connected!" ) ; } try { Channel channel = connectSession . openChannel ( "exec" ) ; ( ( ChannelExec ) ( channel ) ) . setCommand ( command ) ; <START_BUG> InputStreamReader reader = new InputStreamReader ( channel . getInputStream ( ) ) ; <END_BUG> channel . connect ( ) ; return reader ; } catch ( JSchException ex ) { throw new SshException ( ex ) ; } } @ Override public synchronized ChannelExec executeCommandChannel ( String command ) throws SshException , IOException { } @ Override public synchronized void disconnect ( ) { } static class BlindHostKeyRepository implements HostKeyRepository { private static final HostKey [ ] EMPTY = new HostKey [ 0 ] ; @ Override public int check ( String host , byte [ ] key ) { } @ Override public void add ( HostKey hostkey , UserInfo ui ) { } @ Override public void remove ( String host , String type ) { } @ Override public void remove ( String host , String type , byte [ ] key ) { } @ Override public String getKnownHostsRepositoryID ( ) { } @ Override public HostKey [ ] getHostKey ( ) { } @ Override public HostKey [ ] getHostKey ( String host , String type ) { } } }

Fix:
InputStreamReader reader = new InputStreamReader ( channel . getInputStream ( ) , "utf-8" ) ;
Buggy code:
public class GetSeasonDetailUseCaseImpl implements GetSeasonDetailUseCase { @ Inject SeasonRepository mSeasonRepository ; Callback mCallback ; Handler mHandler ; public GetSeasonDetailUseCaseImpl ( ) { } @ Override public void execute ( final String serie , final int seasonNumber , final GetSeasonDetailUseCase . Callback callback ) { this . mCallback = callback ; new Thread ( new Runnable ( ) { @ Override public void run ( ) { try { final Season season = mSeasonRepository . retrieve ( serie , seasonNumber ) ; mHandler . postDelayed ( new GetSeasonDetailUseCaseImpl . RunOnSuccess ( season ) , 5000 ) ; } catch ( Exception e ) { Log . e ( "GetEpisodesUseCase" , e . getMessage ( ) , e ) ; <START_BUG> mHandler . post ( new GetSeasonDetailUseCaseImpl . RunOnException ( e ) ) ; <END_BUG> } } } ) . start ( ) ; } class RunOnSuccess implements Runnable { Season season ; public RunOnSuccess ( Season season ) { } @ Override public void run ( ) { } } class RunOnException implements Runnable { Exception exception ; public RunOnException ( Exception exception ) { } @ Override public void run ( ) { } } }

Fix:
mHandler . postDelayed ( new GetSeasonDetailUseCaseImpl . RunOnException ( e ) , 5000 ) ;
Buggy code:
public class CyclicBarrierMain { public static void main ( String [ ] args ) throws InterruptedException { final Random r = new Random ( ) ; final CyclicBarrier barrier = new CyclicBarrier ( 4 ) ; ArrayList < Thread > threads = new ArrayList < Thread > ( ) ; <START_BUG> for ( int i = 0 ; i < 15 ; i ++ ) { <END_BUG> Thread t = new Thread ( new Runnable ( ) { @ Override public void run ( ) { System . out . println ( "starting..." ) ; try { Thread . sleep ( r . nextInt ( 20 ) ) ; System . out . println ( barrier . await ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } System . out . println ( "got<seq2seq4repair_space>it" ) ; } } ) ; threads . add ( t ) ; } for ( Thread t : threads ) { Thread . sleep ( r . nextInt ( 20 ) ) ; t . start ( ) ; } } }

Fix:
for ( int i = 0 ; i < 16 ; i ++ ) {
Buggy code:
public class Smoke { private double smoke ; public double getSmoke ( ) { } public void setSmoke ( double smoke ) { } @ Override public String toString ( ) { <START_BUG> return String . format ( "S=%f" , smoke ) ; <END_BUG> } }

Fix:
return String . format ( "%f" , smoke ) ;
Buggy code:
public class GroupAwareCacheFactory < K extends Serializable , V extends Cacheable < K > > implements CacheFactory < K , V > , BackingCacheLifecycleListener { private final AtomicReference < SerializationGroupContainer < K , V > > groupContainerRef = new AtomicReference < SerializationGroupContainer < K , V > > ( ) ; private final AtomicInteger memberCounter = new AtomicInteger ( ) ; private final BackingCacheEntryStoreSource < K , V , UUID > storeSource ; public GroupAwareCacheFactory ( BackingCacheEntryStoreSource < K , V , UUID > storeSource ) { } @ Override public Cache < K , V > createCache ( String beanName , StatefulObjectFactory < V > factory , PassivationManager < K , V > passivationManager , StatefulTimeoutInfo timeout ) { SerializationGroupContainer < K , V > groupContainer = this . groupContainerRef . get ( ) ; if ( groupContainer == null ) { groupContainer = this . createGroupContainer ( passivationManager , timeout ) ; if ( ! ( this . groupContainerRef . compareAndSet ( null , groupContainer ) ) ) { groupContainer = this . groupContainerRef . get ( ) ; } } groupContainer . addMemberPassivationManager ( passivationManager ) ; PassivatingBackingCache < UUID , Cacheable < UUID > , SerializationGroup < K , V , UUID > > groupCache = groupContainer . getGroupCache ( ) ; SerializationGroupMemberContainer < K , V , UUID > container = new SerializationGroupMemberContainer < K , V , UUID > ( passivationManager , groupCache , this . storeSource ) ; BackingCacheEntryStore < K , V , SerializationGroupMember < K , V , UUID > > store = storeSource . createIntegratedObjectStore ( beanName , container , timeout ) ; container . setBackingCacheEntryStore ( store ) ; <START_BUG> GroupAwareBackingCache < K , V , UUID , SerializationGroupMember < K , V , UUID > > backingCache = new org . jboss . as . ejb3 . cache . impl . backing . GroupAwareBackingCacheImpl < K , V , UUID > ( factory , container , groupCache , Executors . newScheduledThreadPool ( 1 , Executors . defaultThreadFactory ( ) ) ) ; <END_BUG> backingCache . addLifecycleListener ( this ) ; return new org . jboss . as . ejb3 . cache . impl . GroupAwareCache < K , V , UUID , SerializationGroupMember < K , V , UUID > > ( backingCache , true ) ; } private SerializationGroupContainer < K , V > createGroupContainer ( PassivationManager < K , V > passivationManager , StatefulTimeoutInfo timeout ) { } @ Override public void lifecycleChange ( LifecycleState newState ) { } }

Fix:
GroupAwareBackingCache < K , V , UUID , SerializationGroupMember < K , V , UUID > > backingCache = new org . jboss . as . ejb3 . cache . impl . backing . GroupAwareBackingCacheImpl < K , V , UUID > ( factory , container , groupCache , Executors . defaultThreadFactory ( ) ) ;
Buggy code:
public class DefaultExecutor extends AbstractLogEnabled implements Serviceable , Executor { private static final Resources REZ = ResourceManager . getPackageResources ( DefaultExecutor . class ) ; private Configurer m_configurer ; public void service ( final ServiceManager serviceManager ) throws ServiceException { } public void execute ( final Configuration taskModel , final ExecutionFrame frame ) throws TaskException { } protected final void debug ( final String key , final String taskName ) { } protected final Task doCreateTask ( final String name , final ExecutionFrame frame ) throws TaskException { } protected final void doConfigure ( final Task task , final Configuration taskModel , final TaskContext taskContext ) throws ConfigurationException { <START_BUG> m_configurer . configure ( task , taskModel , taskContext ) ; <END_BUG> } protected final void doContextualize ( final Task task , final Configuration taskModel , final TaskContext context ) throws TaskException { } }

Fix:
m_configurer . configureElement ( task , taskModel , taskContext ) ;
Buggy code:
public final class BeanNamePointcutTests { private ITestBean testBean1 ; private ITestBean testBean2 ; private ITestBean testBeanContainingNestedBean ; private Map < ? , ? > testFactoryBean1 ; private Map < ? , ? > testFactoryBean2 ; private Counter counterAspect ; private ITestBean interceptThis ; private ITestBean dontInterceptThis ; private BeanNamePointcutTests . TestInterceptor testInterceptor ; private ClassPathXmlApplicationContext ctx ; @ Before public void setUp ( ) { <START_BUG> ctx = new ClassPathXmlApplicationContext ( "bean-name-pointcut-tests.xml" , getClass ( ) ) ; <END_BUG> testBean1 = ( ( ITestBean ) ( ctx . getBean ( "testBean1" ) ) ) ; testBean2 = ( ( ITestBean ) ( ctx . getBean ( "testBean2" ) ) ) ; testBeanContainingNestedBean = ( ( ITestBean ) ( ctx . getBean ( "testBeanContainingNestedBean" ) ) ) ; testFactoryBean1 = ( ( Map < ? , ? > ) ( ctx . getBean ( "testFactoryBean1" ) ) ) ; testFactoryBean2 = ( ( Map < ? , ? > ) ( ctx . getBean ( "testFactoryBean2" ) ) ) ; counterAspect = ( ( Counter ) ( ctx . getBean ( "counterAspect" ) ) ) ; interceptThis = ( ( ITestBean ) ( ctx . getBean ( "interceptThis" ) ) ) ; dontInterceptThis = ( ( ITestBean ) ( ctx . getBean ( "dontInterceptThis" ) ) ) ; testInterceptor = ( ( BeanNamePointcutTests . TestInterceptor ) ( ctx . getBean ( "testInterceptor" ) ) ) ; counterAspect . reset ( ) ; } @ Test public void testMatchingBeanName ( ) { } @ Test public void testNonMatchingBeanName ( ) { } @ Test public void testNonMatchingNestedBeanName ( ) { } @ Test public void testMatchingFactoryBeanObject ( ) { } @ Test public void testMatchingFactoryBeanItself ( ) { } @ Test public void testPointcutAdvisorCombination ( ) { } public static class TestInterceptor implements MethodBeforeAdvice { private int interceptionCount ; public void before ( Method method , Object [ ] args , Object target ) throws Throwable { } } }

Fix:
ctx = new ClassPathXmlApplicationContext ( ( ( getClass ( ) . getSimpleName ( ) ) + ".xml" ) , getClass ( ) ) ;
Buggy code:
public class Server extends AbstractServer { private ServerCommunicationHandler serverCommunicationHandler ; private final MessageHandler messageHandler = new MessageHandler ( this ) ; public Server ( ServerEnvironment environment ) { } public void start ( ) { } public void start ( Standalone config ) throws ServerStartException { } public void stop ( ) { } Callback createListenerCallback ( ) { } private void launchCommunicationHandler ( ) { } private void sendMessage ( ServerManagerProtocolCommand command ) { try { byte [ ] bytes = command . createCommandBytes ( null ) ; <START_BUG> serverCommunicationHandler . sendMessage ( bytes , StreamUtils . calculateChecksum ( bytes ) ) ; <END_BUG> } catch ( IOException e ) { log . error ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>send<seq2seq4repair_space>message<seq2seq4repair_space>to<seq2seq4repair_space>Server<seq2seq4repair_space>Manager<seq2seq4repair_space>[" + command ) + "]" ) , e ) ; } } }

Fix:
serverCommunicationHandler . sendMessage ( bytes ) ;
Buggy code:
public class MockTokenizer extends Tokenizer { public static final int WHITESPACE = 0 ; public static final int KEYWORD = 1 ; public static final int SIMPLE = 2 ; private final int pattern ; private final boolean lowerCase ; private final CharTermAttribute termAtt = addAttribute ( CharTermAttribute . class ) ; private final OffsetAttribute offsetAtt = addAttribute ( OffsetAttribute . class ) ; int off = 0 ; private static enum State { SETREADER , RESET , INCREMENT , INCREMENT_FALSE , END , CLOSE ; } private MockTokenizer . State streamState = MockTokenizer . State . CLOSE ; private boolean enableChecks = true ; public MockTokenizer ( AttributeFactory factory , Reader input , int pattern , boolean lowerCase ) { } public MockTokenizer ( Reader input , int pattern , boolean lowerCase ) { } @ Override public final boolean incrementToken ( ) throws IOException { assert ( ! ( enableChecks ) ) || ( ( ( streamState ) == ( MockTokenizer . State . RESET ) ) || ( ( streamState ) == ( MockTokenizer . State . INCREMENT ) ) ) : "incrementToken()<seq2seq4repair_space>called<seq2seq4repair_space>while<seq2seq4repair_space>in<seq2seq4repair_space>wrong<seq2seq4repair_space>state:<seq2seq4repair_space>" + ( streamState ) ; clearAttributes ( ) ; for ( ; ; ) { int startOffset = off ; int cp = readCodePoint ( ) ; if ( cp < 0 ) { break ; } else if ( isTokenChar ( cp ) ) { int endOffset ; do { char [ ] chars = Character . toChars ( normalize ( cp ) ) ; for ( int i = 0 ; i < ( chars . length ) ; i ++ ) termAtt . append ( chars [ i ] ) ; endOffset = off ; cp = readCodePoint ( ) ; } while ( ( cp >= 0 ) && ( isTokenChar ( cp ) ) ) ; <START_BUG> offsetAtt . setOffset ( startOffset , endOffset ) ; <END_BUG> streamState = MockTokenizer . State . INCREMENT ; return true ; } } streamState = MockTokenizer . State . INCREMENT_FALSE ; return false ; } protected int readCodePoint ( ) throws IOException { } protected boolean isTokenChar ( int c ) { } protected int normalize ( int c ) { } @ Override public void reset ( ) throws IOException { } @ Override public void close ( ) throws IOException { } @ Override public void reset ( Reader input ) throws IOException { } @ Override public void end ( ) throws IOException { } public void setEnableChecks ( boolean enableChecks ) { } }

Fix:
offsetAtt . setOffset ( correctOffset ( startOffset ) , correctOffset ( endOffset ) ) ;
Buggy code:
public class ContainerMetallurgicInfuser extends Container { private TileEntityMetallurgicInfuser tileEntity ; public ContainerMetallurgicInfuser ( InventoryPlayer inventory , TileEntityMetallurgicInfuser tentity ) { } @ Override public void onContainerClosed ( EntityPlayer entityplayer ) { } @ Override public boolean canInteractWith ( EntityPlayer entityplayer ) { } @ Override public ItemStack transferStackInSlot ( EntityPlayer player , int slotID ) { ItemStack stack = null ; Slot currentSlot = ( ( Slot ) ( inventorySlots . get ( slotID ) ) ) ; if ( ( currentSlot != null ) && ( currentSlot . getHasStack ( ) ) ) { ItemStack slotStack = currentSlot . getStack ( ) ; stack = slotStack . copy ( ) ; if ( ( ( ( slotID != 0 ) && ( slotID != 1 ) ) && ( slotID != 2 ) ) && ( slotID != 3 ) ) { if ( ( ( InfuseRegistry . getObject ( slotStack ) ) != null ) && ( ( ( tileEntity . infuseStored . type ) == null ) || ( ( tileEntity . infuseStored . type ) == ( InfuseRegistry . getObject ( slotStack ) . type ) ) ) ) { if ( ! ( mergeItemStack ( slotStack , 1 , 2 , false ) ) ) { return null ; } } else if ( ChargeUtils . canBeDischarged ( slotStack ) ) { <START_BUG> if ( ! ( mergeItemStack ( slotStack , 4 , 5 , false ) ) ) { <END_BUG> return null ; } } else if ( isInputItem ( slotStack ) ) { if ( ! ( mergeItemStack ( slotStack , 2 , 3 , false ) ) ) { return null ; } } else { if ( ( slotID >= 4 ) && ( slotID <= 30 ) ) { if ( ! ( mergeItemStack ( slotStack , 31 , inventorySlots . size ( ) , false ) ) ) { return null ; } } else if ( slotID > 30 ) { if ( ! ( mergeItemStack ( slotStack , 4 , 30 , false ) ) ) { return null ; } } else { if ( ! ( mergeItemStack ( slotStack , 4 , inventorySlots . size ( ) , true ) ) ) { return null ; } } } } else { if ( ! ( mergeItemStack ( slotStack , 4 , inventorySlots . size ( ) , true ) ) ) { return null ; } } if ( ( slotStack . stackSize ) == 0 ) { currentSlot . putStack ( ( ( ItemStack ) ( null ) ) ) ; } else { currentSlot . onSlotChanged ( ) ; } if ( ( slotStack . stackSize ) == ( stack . stackSize ) ) { return null ; } currentSlot . onPickupFromSlot ( player , slotStack ) ; } return stack ; } public boolean isInputItem ( ItemStack itemStack ) { } }

Fix:
if ( ! ( mergeItemStack ( slotStack , 0 , 1 , false ) ) ) {
Buggy code:
public class CSVParser implements Iterable < CSVRecord > { private final CSVLexer lexer ; private Map < String , Integer > headerMapping ; private final List < String > record = new ArrayList < String > ( ) ; private final Token reusableToken = new Token ( ) ; public CSVParser ( Reader input ) throws IOException { } public CSVParser ( Reader input , CSVFormat format ) throws IOException { } public CSVParser ( String input , CSVFormat format ) throws IOException { } public List < CSVRecord > getRecords ( ) throws IOException { } CSVRecord getRecord ( ) throws IOException { } private void initializeHeader ( CSVFormat format ) throws IOException { if ( ( format . getHeader ( ) ) != null ) { headerMapping = new HashMap < String , Integer > ( ) ; String [ ] header = null ; if ( ( format . getHeader ( ) . length ) == 0 ) { CSVRecord record = getRecord ( ) ; if ( record != null ) { header = record . values ( ) ; } } else { header = format . getHeader ( ) ; } if ( header != null ) { for ( int i = 0 ; i < ( header . length ) ; i ++ ) { <START_BUG> headerMapping . put ( header [ i ] , i ) ; <END_BUG> } } } } public Iterator < CSVRecord > iterator ( ) { } public int getLineNumber ( ) { } }

Fix:
headerMapping . put ( header [ i ] , Integer . valueOf ( i ) ) ;
Buggy code:
public class CovMerge extends Task { private File home = null ; private File tofile = null ; private Vector filesets = new Vector ( ) ; private boolean verbose ; public void setHome ( File value ) { } public void setTofile ( File value ) { } public void setVerbose ( boolean flag ) { } public void addFileset ( FileSet fs ) { } public CovMerge ( ) { } public void execute ( ) throws BuildException { checkOptions ( ) ; File paramfile = createParamFile ( ) ; try { Commandline cmdl = new Commandline ( ) ; cmdl . setExecutable ( new File ( home , "jpcovmerge" ) . getAbsolutePath ( ) ) ; if ( verbose ) { cmdl . createArgument ( ) . setValue ( "-v" ) ; } cmdl . createArgument ( ) . setValue ( ( "-jp_paramfile=" + ( paramfile . getAbsolutePath ( ) ) ) ) ; LogStreamHandler handler = new LogStreamHandler ( this , Project . MSG_INFO , Project . MSG_WARN ) ; Execute exec = new Execute ( handler ) ; <START_BUG> log ( cmdl . toString ( ) , MSG_VERBOSE ) ; <END_BUG> exec . setCommandline ( cmdl . getCommandline ( ) ) ; int exitValue = exec . execute ( ) ; if ( exitValue != 0 ) { throw new BuildException ( ( ( "JProbe<seq2seq4repair_space>Coverage<seq2seq4repair_space>Merging<seq2seq4repair_space>failed<seq2seq4repair_space>(" + exitValue ) + ")" ) ) ; } } catch ( IOException e ) { throw new BuildException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>run<seq2seq4repair_space>JProbe<seq2seq4repair_space>Coverage<seq2seq4repair_space>Merge:<seq2seq4repair_space>" + e ) ) ; } finally { paramfile . delete ( ) ; } } protected void checkOptions ( ) throws BuildException { } protected File [ ] getSnapshots ( ) { } protected File createParamFile ( ) throws BuildException { } protected File createTmpFile ( ) { } }

Fix:
log ( cmdl . describeCommand ( ) , MSG_VERBOSE ) ;
Buggy code:
public class File extends java . io . File implements IModifiable { private static final long serialVersionUID = 1L ; public File ( final File parent , final String child ) { } public File ( final java . io . File parent , final String child ) { } public File ( final java . io . File file ) { } public File ( final String pathname ) { } public File ( final String parent , final String child ) { } public File ( final URI uri ) { } public File file ( final String name ) { } public String getExtension ( ) { } public Folder getParentFolder ( ) { } public InputStream inputStream ( ) throws FileNotFoundException { } public Time lastModifiedTime ( ) { <START_BUG> return Time . milliseconds ( lastModified ( ) ) ; <END_BUG> } public OutputStream outputStream ( ) throws FileNotFoundException { } public String readString ( ) throws IOException { } public Object readObject ( ) throws IOException , ClassNotFoundException { } public void writeObject ( final Serializable object ) throws IOException { } public boolean remove ( ) { } public void sync ( ) throws IOException { } public String toQuotedString ( ) { } public int write ( final File file ) throws IOException { } public int write ( final InputStream input ) throws IOException { } public void write ( final String string ) throws IOException { } }

Fix:
return Time . valueOf ( lastModified ( ) ) ;
Buggy code:
public final class ExtensionCommandRegistry extends AbstractCommandRegistry { private List activeKeyConfigurationDefinitions ; private List activityBindingDefinitions ; private List categoryDefinitions ; private List commandDefinitions ; private IExtensionRegistry extensionRegistry ; private List imageBindingDefinitions ; private List keyConfigurationDefinitions ; private List keySequenceBindingDefinitions ; public ExtensionCommandRegistry ( IExtensionRegistry extensionRegistry ) { } private String getPluginId ( IConfigurationElement configurationElement ) { } private void load ( ) throws IOException { } private void readActiveKeyConfigurationDefinition ( IConfigurationElement configurationElement ) { } private void readActivityBindingDefinition ( IConfigurationElement configurationElement ) { <START_BUG> IActivityBindingDefinition activityBindingDefinition = Persistence . readActivityBindingDefinition ( new org . eclipse . ui . internal . util . ConfigurationElementMemento ( configurationElement ) , getPluginId ( configurationElement ) ) ; <END_BUG> if ( activityBindingDefinition != null ) activityBindingDefinitions . add ( activityBindingDefinition ) ; } private void readCategoryDefinition ( IConfigurationElement configurationElement ) { } private void readCommandDefinition ( IConfigurationElement configurationElement ) { } private void readImageBindingDefinition ( IConfigurationElement configurationElement ) { } private void readKeyConfigurationDefinition ( IConfigurationElement configurationElement ) { } private void readKeySequenceBindingDefinition ( IConfigurationElement configurationElement ) { } }

Fix:
IContextBindingDefinition activityBindingDefinition = Persistence . readActivityBindingDefinition ( new org . eclipse . ui . internal . util . ConfigurationElementMemento ( configurationElement ) , getPluginId ( configurationElement ) ) ;
Buggy code:
public class BaseCommodity implements Commodity { private int id ; private COMMODITY_DATA commodity ; private COMMODITY_CATEGORY category ; private String name ; private int averagePrice ; private Boolean sold = false ; private Boolean bought = true ; private Boolean illegal = false ; private int sellingPrice ; private int buyingPrice ; public BaseCommodity ( int id ) { } public BaseCommodity ( COMMODITY_DATA data ) { } protected void setId ( int id ) { } public int getId ( ) { } public void setCommodity ( COMMODITY_DATA commodity ) { } public COMMODITY_DATA getCommodity ( ) { } public void setName ( String name ) { } public String getName ( ) { } public void setSold ( Boolean sold ) { } public Boolean isSold ( ) { } public void setBought ( Boolean bought ) { } public Boolean isBought ( ) { } protected void setIllegal ( Boolean illegal ) { } public Boolean isIllegal ( ) { } public int getAveragePrice ( ) { } public void setSellingPrice ( int sellingPrice ) { } public int getSellingPrice ( ) { } public void setBuyingPrice ( int buyingPrice ) { } public int getBuyingPrice ( ) { } public XmlNode generateXmlRepresentation ( ) { } public static BaseCommodity generateFromXmlNode ( XmlNode node ) { if ( ! ( node . getName ( ) . equalsIgnoreCase ( "commodity" ) ) ) { throw new IllegalArgumentException ( "Node<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>commodity<seq2seq4repair_space>-<seq2seq4repair_space>verify<seq2seq4repair_space>logic." ) ; } BaseCommodity toReturn = new BaseCommodity ( new Integer ( node . getAttributeValue ( "id" ) ) . intValue ( ) ) ; if ( ( toReturn . getCommodity ( ) ) != ( COMMODITY_DATA . NOT_DEFINED ) ) { if ( ! ( node . getChildByName ( "name" ) . getTextValue ( ) . equalsIgnoreCase ( toReturn . getName ( ) ) ) ) { throw new IllegalArgumentException ( ( ( ( ( "Node<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>match<seq2seq4repair_space>in<seq2seq4repair_space>name.<seq2seq4repair_space>Got<seq2seq4repair_space>'" + ( node . getChildByName ( "name" ) . getTextValue ( ) ) ) + "',<seq2seq4repair_space>expected<seq2seq4repair_space>'" ) + ( toReturn . getName ( ) ) ) + "'." ) ) ; } } toReturn . setBought ( new Boolean ( node . getChildByName ( "buyingPrice" ) . getAttributeValue ( "bought" ) ) ) ; toReturn . setBuyingPrice ( new Integer ( node . getChildByName ( "buyingPrice" ) . getTextValue ( ) ) . intValue ( ) ) ; toReturn . setSold ( new Boolean ( node . getChildByName ( "sellingPrice" ) . getAttributeValue ( "sold" ) ) ) ; toReturn . setSellingPrice ( new Integer ( node . getChildByName ( "sellingPrice" ) . getTextValue ( ) ) . intValue ( ) ) ; <START_BUG> toReturn . setIllegal ( node . getAttributeValue ( "illegal" ) ) ; <END_BUG> return toReturn ; } }

Fix:
toReturn . setIllegal ( new Boolean ( node . getAttributeValue ( "illegal" ) ) ) ;
Buggy code:
class CheckTask extends BukkitRunnable { private final DimRestrictor plugin ; public CheckTask ( DimRestrictor plugin ) { } @ Override public void run ( ) { synchronized ( this . plugin . playersToCheck ) { for ( Player player : this . plugin . playersToCheck ) { <START_BUG> if ( ! ( this . plugin . checkWorld ( player . getWorld ( ) . getName ( ) ) ) ) { <END_BUG> player . sendMessage ( ( "This<seq2seq4repair_space>world<seq2seq4repair_space>is<seq2seq4repair_space>currently<seq2seq4repair_space>restricted.\n" + ( DimRestrictor . plugin . info ( player . getWorld ( ) . getName ( ) ) ) ) ) ; DimRestrictor . teleportPlayer ( player , player . getLocation ( ) ) ; } this . plugin . playersToCheck . remove ( player ) ; } } } }

Fix:
if ( ( ! ( player . hasPermission ( "dimrestrictor.bypass" ) ) ) && ( ! ( this . plugin . isWorldAccessible ( player . getWorld ( ) . getName ( ) ) ) ) ) {