nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Jikes extends DefaultCompilerAdapter { public boolean execute ( ) throws TaskException { getLogger ( ) . debug ( "Using<seq2seq4repair_space>jikes<seq2seq4repair_space>compiler" ) ; Path classpath = new Path ( ) ; if ( ( m_bootclasspath ) != null ) { classpath . append ( m_bootclasspath ) ; } <START_BUG> classpath . addExtdirs ( m_extdirs ) ; <END_BUG> if ( ( ( m_bootclasspath ) == null ) || ( ( m_bootclasspath . size ( ) ) == 0 ) ) { m_includeJavaRuntime = true ; } else { } classpath . append ( getCompileClasspath ( ) ) ; classpath . append ( src ) ; String jikesPath = System . getProperty ( "jikes.class.path" ) ; if ( jikesPath != null ) { classpath . append ( new Path ( jikesPath ) ) ; } Commandline cmd = new Commandline ( ) ; cmd . setExecutable ( "jikes" ) ; if ( ( m_deprecation ) == true ) cmd . createArgument ( ) . setValue ( "-deprecation" ) ; if ( ( m_destDir ) != null ) { cmd . createArgument ( ) . setValue ( "-d" ) ; cmd . createArgument ( ) . setFile ( m_destDir ) ; } cmd . createArgument ( ) . setValue ( "-classpath" ) ; cmd . createArgument ( ) . setPath ( classpath ) ; if ( ( m_encoding ) != null ) { cmd . createArgument ( ) . setValue ( "-encoding" ) ; cmd . createArgument ( ) . setValue ( m_encoding ) ; } if ( m_debug ) { cmd . createArgument ( ) . setValue ( "-g" ) ; } if ( m_optimize ) { cmd . createArgument ( ) . setValue ( "-O" ) ; } if ( m_verbose ) { cmd . createArgument ( ) . setValue ( "-verbose" ) ; } if ( m_depend ) { cmd . createArgument ( ) . setValue ( "-depend" ) ; } if ( m_attributes . getNowarn ( ) ) { cmd . createArgument ( ) . setValue ( "-nowarn" ) ; } addCurrentCompilerArgs ( cmd ) ; int firstFileName = cmd . size ( ) ; logAndAddFilesToCompile ( cmd ) ; return ( executeExternalCompile ( cmd . getCommandline ( ) , firstFileName ) ) == 0 ; } }

Fix:
addExtdirs ( classpath ) ;
Buggy code:
public class TestWhileController extends JMeterTestCase { public TestWhileController ( String name ) { } private JMeterContext jmctx ; private JMeterVariables jmvars ; public void setUp ( ) { } private void setLastSampleStatus ( boolean status ) { } private void setRunning ( TestElement el ) { } private String nextName ( GenericController c ) { Sampler s = c . next ( ) ; if ( s == null ) { return null ; } else { <START_BUG> return s . getPropertyAsString ( NAME ) ; <END_BUG> } } public void testBlankPrevOK ( ) throws Exception { } public void testLastPrevOK ( ) throws Exception { } private static final String OTHER = "X" ; public void testOtherPrevOK ( ) throws Exception { } private void runtestPrevOK ( String type ) throws Exception { } public void testBlankPrevFailed ( ) throws Exception { } public void testVariable1 ( ) throws Exception { } public void testVariable2 ( ) throws Exception { } public void testLASTPrevFailed ( ) throws Exception { } public void testfalsePrevFailed ( ) throws Exception { } private void runTestPrevFailed ( String s ) throws Exception { } public void testLastFailedBlank ( ) throws Exception { } public void testLastFailedLast ( ) throws Exception { } private void runTestLastFailed ( String s ) throws Exception { } public void testAlwaysFailOK ( ) throws Exception { } public void testAlwaysFailBAD ( ) throws Exception { } private void runTestAlwaysFail ( boolean other ) { } }

Fix:
return s . getName ( ) ;
Buggy code:
public class WordLevelFeatureManager extends FeatureManager { public WordLevelFeatureManager ( String featureArgs , String featureFile ) { } public WordLevelFeatureManager ( String featureArgs ) { } @ Override public String runFeatures ( Sentence source , Sentence target ) { String result = "" ; Set < String > fIndeces = features . keySet ( ) ; ArrayList < String > featureIndeces = new ArrayList < String > ( fIndeces ) ; Collections . sort ( featureIndeces ) ; Iterator < String > it = featureIndeces . iterator ( ) ; WordLevelFeature f ; String [ ] output = new String [ target . getNoTokens ( ) ] ; for ( int i = 0 ; i < ( output . length ) ; i ++ ) { output [ i ] = "" ; } while ( it . hasNext ( ) ) { String index = it . next ( ) ; f = ( ( WordLevelFeature ) ( features . get ( index ) ) ) ; f . reset ( ) ; if ( f . isComputable ( ) ) { try { f . run ( source , target ) ; String [ ] values = f . getValues ( ) ; <START_BUG> for ( int i = 1 ; i < ( values . length ) ; i ++ ) { <END_BUG> output [ i ] += ( values [ i ] ) + '\t' ; } } catch ( Exception e ) { System . out . println ( ( ( "ERROR:<seq2seq4repair_space>Failed<seq2seq4repair_space>to<seq2seq4repair_space>run<seq2seq4repair_space>feature<seq2seq4repair_space>" + ( f . getIndex ( ) ) ) + ".<seq2seq4repair_space>Feature<seq2seq4repair_space>omitted." ) ) ; } } else { Logger . log ( ( ( "Feature<seq2seq4repair_space>" + ( f . getIndex ( ) ) ) + "<seq2seq4repair_space>cannot<seq2seq4repair_space>run<seq2seq4repair_space>because<seq2seq4repair_space>some<seq2seq4repair_space>of<seq2seq4repair_space>its<seq2seq4repair_space>dependencies<seq2seq4repair_space>are<seq2seq4repair_space>missing." ) ) ; System . out . println ( ( ( "Feature<seq2seq4repair_space>" + ( f . getIndex ( ) ) ) + "<seq2seq4repair_space>cannot<seq2seq4repair_space>run<seq2seq4repair_space>because<seq2seq4repair_space>some<seq2seq4repair_space>of<seq2seq4repair_space>its<seq2seq4repair_space>dependencies<seq2seq4repair_space>are<seq2seq4repair_space>missing." ) ) ; features . remove ( index ) ; } } for ( int i = 0 ; i < ( output . length ) ; i ++ ) { result += ( output [ i ] ) + '\n' ; } return result ; } }

Fix:
for ( int i = 0 ; i < ( values . length ) ; i ++ ) {
Buggy code:
public class MIPlayerGiveCache { long restrictlimit = 0 ; UUID playerID ; ArrayList < InventoryChangeEvent > inventorychanges = new ArrayList < InventoryChangeEvent > ( ) ; public MIPlayerGiveCache ( long timeout , UUID playerID ) { } public long getTime ( ) { } public UUID getPlayerID ( ) { } public void addInventoryChangeEvent ( InventoryChangeEvent event ) { } public void ExecuteStoredInventoryChanges ( ) { Player player = Bukkit . getPlayer ( playerID ) ; if ( ( player != null ) && ( player . isOnline ( ) ) ) { for ( InventoryChangeEvent event : inventorychanges ) { if ( event . isArmor ( ) ) { if ( ( event . getItems ( ) . length ) > 1 ) { player . getInventory ( ) . setArmorContents ( event . getItems ( ) ) ; } else { switch ( event . getSlot ( ) ) { case 0 : player . getInventory ( ) . setBoots ( event . getItems ( ) [ 0 ] ) ; break ; case 1 : player . getInventory ( ) . setLeggings ( event . getItems ( ) [ 0 ] ) ; break ; case 2 : player . getInventory ( ) . setChestplate ( event . getItems ( ) [ 0 ] ) ; break ; case 3 : player . getInventory ( ) . setHelmet ( event . getItems ( ) [ 0 ] ) ; break ; } } } else { <START_BUG> if ( ( event . getSlot ( ) ) < 0 ) { <END_BUG> player . getInventory ( ) . addItem ( event . getItems ( ) ) ; } else { player . getInventory ( ) . setItem ( event . getSlot ( ) , event . getItems ( ) [ 0 ] ) ; } } } } } }

Fix:
if ( ( ( event . getSlot ( ) ) < 0 ) || ( ( event . getItems ( ) . length ) > 1 ) ) {
Buggy code:
public class FilesManager extends AbstractImportResourcesManager { @ Override public InputStream getStream ( IPath path ) throws IOException { } @ Override public boolean collectPath2Object ( Object root ) { } public boolean collectPath2Object ( Object root , boolean interruptable ) { } private boolean doCollectItemFiles ( File directory , boolean interruptable ) { File [ ] contents = directory . listFiles ( ) ; Thread currentThread = Thread . currentThread ( ) ; if ( contents != null ) { for ( File content : contents ) { if ( interruptable && ( currentThread . isInterrupted ( ) ) ) { return false ; } File file = content ; if ( file . isFile ( ) ) { add ( file . getAbsolutePath ( ) , file ) ; } if ( file . isDirectory ( ) ) { if ( ! ( FilesUtils . isSVNFolder ( file ) ) ) { <START_BUG> collectPath2Object ( content ) ; <END_BUG> } } } } return true ; } @ Override public IImportStructureProvider getProvider ( ) { } @ Override public void closeResource ( ) { } }

Fix:
collectPath2Object ( content , interruptable ) ;
Buggy code:
public class DynamicMount implements IMount { public static final String MOUNT_DIRECTORY = ( PeripheralsPlusPlus . BASE_PPP_DIR ) + "ppp_mount" ; public static final String DIRECTORY = "//ppp" ; public static final String JSON_VER = "1.0" ; private IPeripheral peripheral ; public DynamicMount ( IPeripheral peripheral ) { } public static void prepareMount ( ) throws Exception { } @ Override public boolean exists ( String path ) throws IOException { } @ Override public boolean isDirectory ( String path ) throws IOException { } @ Override public void list ( String path , List < String > contents ) throws IOException { File file = new File ( ( ( ( DynamicMount . MOUNT_DIRECTORY ) + "//" ) + path ) ) ; for ( File f : file . listFiles ( ) ) { String type = getSafeType ( ) ; if ( ( f . getName ( ) . equals ( type ) ) || ( file . getAbsolutePath ( ) . contains ( type ) ) ) <START_BUG> if ( ! ( path . contains ( "json" ) ) ) <END_BUG> contents . add ( f . getName ( ) ) ; } } @ Override public long getSize ( String path ) throws IOException { } @ Override public InputStream openForRead ( String path ) throws IOException { } private String getSafeType ( ) { } }

Fix:
if ( ! ( path . contains ( "index" ) ) )
Buggy code:
public class HavingDateComparatorsTest extends AbstractHavingTest { @ BeforeClass public static void setUpBeforeClass ( ) throws Exception { } @ AfterClass public static void tearDownAfterClass ( ) { } @ Test public void should_validate_equal ( ) throws Exception { } @ Test public void should_validate_unequal ( ) throws Exception { } @ Test public void should_validate_in ( ) throws Exception { } @ Test public void should_validate_greather_than ( ) throws Exception { } @ Test public void should_validate_greather_than_or_equal ( ) throws Exception { } @ Test public void should_validate_less_than ( ) throws Exception { } @ Test public void should_validate_less_than_or_equal ( ) throws Exception { } @ Test public void should_validate_between ( ) throws Exception { String dateQueryString = ( "get<seq2seq4repair_space>2<seq2seq4repair_space>distinct<seq2seq4repair_space>creation_date<seq2seq4repair_space>in<seq2seq4repair_space>('" + ( directory ) ) + "')<seq2seq4repair_space>sort<seq2seq4repair_space>by<seq2seq4repair_space>creation_date<seq2seq4repair_space>ascending;" ; Query dateQuery = QueryFactory . newQuery ( dateQueryString ) ; List < Comparable > dateResuls = dateQuery . execute ( ) ; assertThat ( dateResuls ) . hasOnlyElementsOfType ( String . class ) ; <START_BUG> String queryString = ( ( ( ( ( "get<seq2seq4repair_space>file<seq2seq4repair_space>in<seq2seq4repair_space>('" + ( directory ) ) + "')<seq2seq4repair_space>having<seq2seq4repair_space>creation_date<seq2seq4repair_space>between<seq2seq4repair_space>'" ) + ( dateResuls . get ( 0 ) ) ) + "'<seq2seq4repair_space>and<seq2seq4repair_space>'" ) + ( dateResuls . get ( 1 ) ) ) + "';" ; <END_BUG> Query query = QueryFactory . newQuery ( queryString ) ; List < Comparable > results = query . execute ( ) ; assertThat ( results ) . hasOnlyElementsOfType ( File . class ) ; assertThat ( results ) . isNotNull ( ) ; } @ Test ( expected = Exception . class ) public void should_unvalidate_like ( ) throws Exception { } @ Test ( expected = Exception . class ) public void should_unvalidate_match ( ) throws Exception { } }

Fix:
String queryString = ( ( ( ( ( "get<seq2seq4repair_space>file<seq2seq4repair_space>in<seq2seq4repair_space>('" + ( directory ) ) + "')<seq2seq4repair_space>having<seq2seq4repair_space>creation_date<seq2seq4repair_space>between<seq2seq4repair_space>'" ) + ( dateResuls . get ( 0 ) ) ) + "'<seq2seq4repair_space>and<seq2seq4repair_space>'" ) + ( dateResuls . get ( 0 ) ) ) + "';" ;
Buggy code:
public class TableItem extends Item { Table parent ; String [ ] strings ; Image [ ] images ; boolean checked ; boolean grayed ; boolean cached ; Color foreground ; Color background ; Color [ ] cellForeground ; Color [ ] cellBackground ; Font font ; Font [ ] cellFont ; int width = - 1 ; static final int IMAGETEXT_MARGIN = 2 ; public TableItem ( Table parent , int style ) { } public TableItem ( Table parent , int style , int index ) { } TableItem ( Table parent , int style , int index , boolean create ) { } static Table checkNull ( Table control ) { } int calculateWidth ( int index , GC gc ) { } protected void checkSubclass ( ) { } void clear ( ) { } NSObject createString ( int index ) { } void destroyWidget ( ) { } public Color getBackground ( ) { } public Color getBackground ( int index ) { } public Rectangle getBounds ( ) { } public Rectangle getBounds ( int index ) { } public boolean getChecked ( ) { } public Font getFont ( ) { } public Font getFont ( int index ) { } public Color getForeground ( ) { } public Color getForeground ( int index ) { } public boolean getGrayed ( ) { } public Image getImage ( ) { } public Image getImage ( int index ) { } public Rectangle getImageBounds ( int index ) { } public int getImageIndent ( ) { } String getNameText ( ) { } public Table getParent ( ) { } public String getText ( ) { } public String getText ( int index ) { } public Rectangle getTextBounds ( int index ) { } void redraw ( int columnIndex ) { <START_BUG> if ( ( ( parent . currentItem ) == ( this ) ) || ( ( parent . drawCount ) != 0 ) ) <END_BUG> return ; NSTableView tableView = ( ( NSTableView ) ( parent . view ) ) ; NSRect rect = null ; if ( ( ( ( columnIndex == ( - 1 ) ) || ( parent . hooks ( MeasureItem ) ) ) || ( parent . hooks ( EraseItem ) ) ) || ( parent . hooks ( PaintItem ) ) ) { rect = tableView . rectOfRow ( parent . indexOf ( this ) ) ; } else { int index ; if ( ( parent . columnCount ) == 0 ) { index = ( ( ( parent . style ) & ( SWT . CHECK ) ) != 0 ) ? 1 : 0 ; } else { TableColumn column = parent . getColumn ( columnIndex ) ; index = ( ( int ) ( tableView . columnWithIdentifier ( column . nsColumn ) ) ) ; } rect = tableView . frameOfCellAtColumn ( index , parent . indexOf ( this ) ) ; } tableView . setNeedsDisplayInRect ( rect ) ; } void releaseHandle ( ) { } void releaseParent ( ) { } void releaseWidget ( ) { } public void setBackground ( Color color ) { } public void setBackground ( int index , Color color ) { } public void setChecked ( boolean checked ) { } public void setFont ( Font font ) { } public void setFont ( int index , Font font ) { } public void setForeground ( Color color ) { } public void setForeground ( int index , Color color ) { } public void setGrayed ( boolean grayed ) { } public void setImage ( Image [ ] images ) { } public void setImage ( int index , Image image ) { } public void setImage ( Image image ) { } public void setImageIndent ( int indent ) { } public void setText ( String [ ] strings ) { } public void setText ( int index , String string ) { } public void setText ( String string ) { } }

Fix:
if ( ( ( parent . currentItem ) == ( this ) ) || ( ! ( isDrawing ( ) ) ) )
Buggy code:
public class Quadrangle extends Polygon { public Quadrangle ( Point p1 , Point p2 , Point p3 , Point p4 ) { } public Quadrangle ( Quadrangle q ) { } public Point getP1 ( ) { } public Point getP2 ( ) { } public Point getP3 ( ) { } public Point getP4 ( ) { <START_BUG> return new Point ( this . points [ 4 ] ) ; <END_BUG> } public boolean equals ( Object o ) { } public double getArea ( ) { } public boolean contains ( Point p ) { } }

Fix:
return new Point ( this . points [ 3 ] ) ;
Buggy code:
public class Planning { private List < String > allLines = new ArrayList < > ( ) ; private List < Worker > allWorkers = new ArrayList < > ( ) ; private List < Integer > allDays = new ArrayList < > ( ) ; private int mandatoryAllowedHolidays ; public Planning ( int mandatoryHolidays , List < String > allLines , List < Worker > allWorkers , List < Integer > allDays ) { } public List < String > getAllLines ( ) { } public int getMandatoryHolidays ( ) { } public List < Worker > getAllWorkers ( ) { } public List < Integer > getAllDays ( ) { } public void setNewShift ( String workerName , int day , String line , ShiftType shiftType ) { } private Worker getWorkerByName ( String workerName ) { } public List < WorkerDay > getAllWorkingShifts ( int day ) { } private Stream < WorkerDay > getAllWorkingShiftsSameDay ( int day ) { } public List < WorkerDay > getAllWorkingShiftsRequired ( int day ) { } public List < Worker > getWorkersThatCanWorkOn ( WorkerDay workerDay ) { } public Planning duplicate ( ) { } @ Override public String toString ( ) { <START_BUG> StringBuffer sb = new StringBuffer ( ) ; <END_BUG> for ( Worker worker : allWorkers ) { sb . append ( worker ) . append ( "\n" ) ; } return sb . toString ( ) ; } }

Fix:
StringBuilder sb = new StringBuilder ( ) ;
Buggy code:
@ Api ( value = "//technology" , hidden = true ) @ Consumes ( MediaType . APPLICATION_JSON ) @ Produces ( MediaType . APPLICATION_JSON ) public class TechnologyMetadataSubResource { private final TechnologyService technologyService ; private final TechnologyMechanics technologyMechanics ; @ Inject public TechnologyMetadataSubResource ( TechnologyService technologyService , TechnologyMechanics technologyMechanics ) { } @ GET @ ApiOperation ( "Lists<seq2seq4repair_space>all<seq2seq4repair_space>technologies" ) public TechnologiesMetadataResponse all ( @ QueryParam ( "level" ) @ ApiParam ( value = "Building<seq2seq4repair_space>level" , defaultValue = "1" ) int level ) { int sanitizedLevel = Math . max ( level , 1 ) ; <START_BUG> return new TechnologiesMetadataResponse ( Stream . of ( TechnologyType . values ( ) ) . map ( ( t ) -> new TechnologyMetadataResponse ( t . name ( ) , sanitizedLevel , technologyService . calculateResearchTimeWithoutBonuses ( t , sanitizedLevel ) , ResourcesMapper . fromResources ( technologyService . calculateResearchCost ( t , sanitizedLevel ) ) , t . getDescription ( ) , PrerequisitesMapper . fromPrerequisites ( technologyMechanics . getPrerequisites ( t ) ) , getBuildCostReduction ( t , level ) , getFlightCostReduction ( t , level ) ) ) . collect ( Collectors . toList ( ) ) ) ; <END_BUG> } @ Nullable private Double getFlightCostReduction ( TechnologyType type , int level ) { } @ Nullable private Double getBuildCostReduction ( TechnologyType type , int level ) { } }

Fix:
return new TechnologiesMetadataResponse ( Stream . of ( TechnologyType . values ( ) ) . map ( ( t ) -> new TechnologyMetadataResponse ( t . name ( ) , sanitizedLevel , technologyService . calculateResearchTimeWithoutBonuses ( t , sanitizedLevel ) , ResourcesMapper . fromResources ( technologyService . calculateResearchCost ( t , sanitizedLevel ) ) , t . getDescription ( ) , PrerequisitesMapper . fromPrerequisites ( technologyMechanics . getPrerequisites ( t ) ) , getBuildCostReduction ( t , sanitizedLevel ) , getFlightCostReduction ( t , sanitizedLevel ) ) ) . collect ( Collectors . toList ( ) ) ) ;
Buggy code:
public class TestSupplies extends SupplyAbstract { @ Override protected void execute ( ExecutionContext executionContext ) { executeChild ( new TestPersons ( ) , executionContext ) ; createSupply ( "PERSON_SUPPLY_OF" , 10 , PERSON_DEMANDSUPPLY , persons . findPersons ( "Hals" ) . get ( 0 ) , "frans" , executionContext ) ; createSupply ( "PERSON_SUPPLY_OF" , 10 , PERSON_DEMANDSUPPLY , persons . findPersons ( "Dou" ) . get ( 0 ) , "gerard" , executionContext ) ; createSupply ( "PERSON_SUPPLY_OF" , 10 , PERSON_DEMANDSUPPLY , persons . findPersons ( "Rijn" ) . get ( 0 ) , "rembrandt" , executionContext ) ; createSupply ( "PERSON_SUPPLY_OF" , 10 , PERSON_DEMANDSUPPLY , persons . findPersons ( "Ruyter" ) . get ( 0 ) , "michiel" , executionContext ) ; <START_BUG> createSupply ( "PERSON_SUPPLY_OFi" , 10 , PERSON_DEMANDSUPPLY , persons . findPersons ( "Leeuw" ) . get ( 0 ) , "antoni" , executionContext ) ; <END_BUG> } @ Inject private Persons persons ; }

Fix:
createSupply ( "PERSON_SUPPLY_OF" , 10 , PERSON_DEMANDSUPPLY , persons . findPersons ( "Leeuw" ) . get ( 0 ) , "antoni" , executionContext ) ;
Buggy code:
public abstract class ListView < T > extends AbstractRepeater { private static final long serialVersionUID = 1L ; private int firstIndex = 0 ; private boolean reuseItems = false ; private int viewSize = Integer . MAX_VALUE ; public ListView ( final String id ) { } public ListView ( final String id , final IModel < ? extends List < ? extends T > > model ) { } public ListView ( final String id , final List < ? extends T > list ) { } @ SuppressWarnings ( "unchecked" ) public final List < ? extends T > getList ( ) { } public boolean getReuseItems ( ) { } public final int getStartIndex ( ) { } public int getViewSize ( ) { } public final Link < Void > moveDownLink ( final String id , final ListItem < T > item ) { } public final Link < Void > moveUpLink ( final String id , final ListItem < T > item ) { } public final Link < Void > removeLink ( final String id , final ListItem < T > item ) { } public ListView < T > setList ( List < ? extends T > list ) { } public ListView < T > setReuseItems ( boolean reuseItems ) { } public ListView < T > setStartIndex ( final int startIndex ) { } public ListView < T > setViewSize ( final int size ) { } protected IModel < T > getListItemModel ( final IModel < ? extends List < T > > listViewModel , final int index ) { } protected ListItem < T > newItem ( final int index ) { } @ SuppressWarnings ( "unchecked" ) @ Override protected final void onPopulate ( ) { } protected void onBeginPopulateItem ( final ListItem < T > item ) { } protected abstract void populateItem ( final ListItem < T > item ) { } @ Override protected final void renderChild ( Component child ) { } protected void renderItem ( final ListItem < ? > item ) { <START_BUG> item . render ( ListView . getMarkupStream ( ) ) ; <END_BUG> } @ Override protected Iterator < Component > renderIterator ( ) { } @ SuppressWarnings ( { "unchecked" } ) @ Override public Iterator < ? extends ListItem < T > > iterator ( ) { } @ SuppressWarnings ( "unchecked" ) public final IModel < ? extends List < T > > getModel ( ) { } public final void setModel ( IModel < ? extends List < T > > model ) { } @ SuppressWarnings ( "unchecked" ) public final List < T > getModelObject ( ) { } public final void setModelObject ( List < T > object ) { } }

Fix:
item . render ( ) ;
Buggy code:
public class PathCollector extends IndexQueryRequestor { public HashSet paths = new HashSet ( 5 ) ; public boolean acceptIndexMatch ( String documentPath , SearchPattern indexRecord , SearchParticipant participant , AccessRuleSet access ) { <START_BUG> paths . add ( documentPath ) ; <END_BUG> return true ; } public String [ ] getPaths ( ) { } }

Fix:
this . paths . add ( documentPath ) ;
Buggy code:
public class ChromeCastService extends DConnectMessageService implements ChromeCastDiscovery . Callbacks , ChromeCastMediaPlayer . Callbacks , ChromeCastMessage . Callbacks { private static final int SERVER_PORT = 38088 ; private ChromeCastDiscovery mDiscovery ; private ChromeCastApplication mApplication ; private ChromeCastMediaPlayer mMediaPlayer ; private ChromeCastMessage mMessage ; private ChromeCastHttpServer mServer ; private ChromeCastMediaPlayerProfile mMediaPlayerProfile ; private String mServiceIdOnStatusChange = null ; private String mSessionKeyOnStatusChange = null ; private boolean mEnableCastMediaPlayerStatusUpdate = false ; @ Override public void onCreate ( ) { } @ Override public void onDestroy ( ) { } @ Override protected SystemProfile getSystemProfile ( ) { } @ Override protected ServiceDiscoveryProfile getServiceDiscoveryProfile ( ) { } @ Override public void onCastDeviceUpdate ( final ArrayList < String > devices ) { } @ Override public void onCastDeviceSelected ( final CastDevice selectedDevice ) { CastDevice currentDevice = mApplication . getSelectedDevice ( ) ; if ( currentDevice != null ) { <START_BUG> if ( ! ( currentDevice . getServiceId ( ) . equals ( selectedDevice . getServiceId ( ) ) ) ) { <END_BUG> mApplication . setSelectedDevice ( selectedDevice ) ; mApplication . reconnect ( ) ; } else { mApplication . connect ( ) ; } } else { mApplication . setSelectedDevice ( selectedDevice ) ; mApplication . connect ( ) ; } } @ Override public void onCastDeviceUnselected ( ) { } public ChromeCastDiscovery getChromeCastDiscovery ( ) { } public ChromeCastApplication getChromeCastApplication ( ) { } public ChromeCastMediaPlayer getChromeCastMediaPlayer ( ) { } public ChromeCastMessage getChromeCastMessage ( ) { } public ChromeCastHttpServer getChromeCastHttpServer ( ) { } public void registerOnStatusChange ( final Intent response , final String serviceId , final String sessionKey ) { } public void unregisterOnStatusChange ( final Intent response ) { } @ Override public void onChromeCastMediaPlayerStatusUpdate ( final MediaStatus status ) { } private void onChromeCastResult ( final Intent response , final Status result , final String message ) { } @ Override public void onChromeCastMediaPlayerResult ( final Intent response , final MediaChannelResult result , final String message ) { } @ Override public void onChromeCastMessageResult ( final Intent response , final Status result , final String message ) { } }

Fix:
if ( ! ( currentDevice . getDeviceId ( ) . equals ( selectedDevice . getDeviceId ( ) ) ) ) {
Buggy code:
public final class ThreadFactoryAdd extends AbstractThreadsSubsystemUpdate < Void > { private static final long serialVersionUID = 1935521612404501853L ; private final Map < String , String > properties = new HashMap < String , String > ( ) ; private final String name ; private String groupName ; private String threadNamePattern ; private Integer priority ; public ThreadFactoryAdd ( final String name ) { } public ThreadFactoryRemove getCompensatingUpdate ( final ThreadsSubsystemElement original ) { } protected < P > void applyUpdate ( final UpdateContext updateContext , final UpdateResultHandler < ? super Void , P > handler , final P param ) { final ThreadFactoryService service = new ThreadFactoryService ( ) ; service . setNamePattern ( threadNamePattern ) ; service . setPriority ( priority ) ; service . setThreadGroupName ( groupName ) ; final UpdateResultHandler . ServiceStartListener < P > listener = new UpdateResultHandler . ServiceStartListener < P > ( handler , param ) ; final BatchBuilder batchBuilder = updateContext . getBatchBuilder ( ) ; final BatchServiceBuilder < ThreadFactory > builder = batchBuilder . addService ( ThreadsServices . threadFactoryName ( name ) , service ) ; builder . addListener ( listener ) ; <START_BUG> builder . setInitialMode ( IMMEDIATE ) ; <END_BUG> try { batchBuilder . install ( ) ; } catch ( ServiceRegistryException e ) { handler . handleFailure ( e , param ) ; } } protected void applyUpdate ( final ThreadsSubsystemElement element ) throws UpdateFailedException { } public String getGroupName ( ) { } public void setGroupName ( final String groupName ) { } public String getThreadNamePattern ( ) { } public void setThreadNamePattern ( final String threadNamePattern ) { } public Integer getPriority ( ) { } public void setPriority ( final Integer priority ) { } public Map < String , String > getProperties ( ) { } }

Fix:
builder . setInitialMode ( ACTIVE ) ;
Buggy code:
public class GitLocalPlugin implements VersionControlPlugin { private static final Logger LOG = Logger . getLogger ( GitLocalPlugin . class ) ; private File cacheDirectory = new File ( "//tmp//codesearch//git//" ) ; private File branchDirectory ; private RepositoryDto currentRepository ; private final String GIT_BINARY_LOCATION = "//usr//bin//git" ; private final String GIT_DEFAULT_ARGUMENTS = "--no-pager" ; private ProcessBuilder processBuilder = new ProcessBuilder ( ) ; public GitLocalPlugin ( ) { } @ Override public void setRepository ( RepositoryDto repo ) throws VersionControlPluginException { } @ Override public FileDto getFileDtoForFileIdentifierAtRevision ( FileIdentifier fileIdentifier , String revision ) throws VersionControlPluginException { } @ Override public Set < FileIdentifier > getChangedFilesSinceRevision ( String revision ) throws VersionControlPluginException { Set < FileIdentifier > files = new HashSet < FileIdentifier > ( ) ; if ( revision . equals ( UNDEFINED_VERSION ) ) { List < String > output = bytesToStringList ( executeGitCommand ( "ls-files" ) ) ; GitLocalPlugin . LOG . debug ( ( ( ( output . size ( ) ) + "<seq2seq4repair_space>changed<seq2seq4repair_space>files<seq2seq4repair_space>since<seq2seq4repair_space>commit<seq2seq4repair_space>" ) + revision ) ) ; FileIdentifier fileIdentifier = null ; for ( String line : output ) { fileIdentifier = new FileIdentifier ( ) ; fileIdentifier . setFilePath ( line ) ; fileIdentifier . setRepository ( currentRepository ) ; files . add ( fileIdentifier ) ; } } else { <START_BUG> List < String > output = bytesToStringList ( executeGitCommand ( "diff" , "--name-status" ) ) ; <END_BUG> GitLocalPlugin . LOG . debug ( ( ( ( output . size ( ) ) + "<seq2seq4repair_space>changed<seq2seq4repair_space>files<seq2seq4repair_space>since<seq2seq4repair_space>commit<seq2seq4repair_space>" ) + revision ) ) ; FileIdentifier fileIdentifier = null ; for ( String line : output ) { char status = line . charAt ( 0 ) ; String path = line . substring ( 2 ) ; fileIdentifier = new FileIdentifier ( ) ; fileIdentifier . setRepository ( currentRepository ) ; fileIdentifier . setFilePath ( path ) ; if ( status == 'D' ) { fileIdentifier . setDeleted ( true ) ; } files . add ( fileIdentifier ) ; } } return files ; } @ Override public String getRepositoryRevision ( ) throws VersionControlPluginException { } @ Override public List < String > getFilesInDirectory ( String directoryPath , String revision ) throws VersionControlPluginException { } @ Override public String getPurposes ( ) { } @ Override public void setCacheDirectory ( String directoryPath ) throws VersionControlPluginException { } @ Override public void validate ( ) throws ValidationException { } private byte [ ] executeGitCommand ( String ... arguments ) throws VersionControlPluginException { } private void cleanupProcess ( Process p ) { } private List < String > bytesToStringList ( byte [ ] bytes ) { } }

Fix:
List < String > output = bytesToStringList ( executeGitCommand ( "diff" , revision , "--name-status" ) ) ;
Buggy code:
public class ButtonTest extends WicketTestCase { public ButtonTest ( ) { } public void testRender ( ) { } public void testRender_2 ( ) { application . startPage ( MockFormAndButtonPage . class ) ; application . assertContains ( "<input<seq2seq4repair_space>name=\"button\"<seq2seq4repair_space>type=\"submit\"<seq2seq4repair_space>wicket:id=\"button\"//>" ) ; String doc = application . getServletResponse ( ) . getDocument ( ) ; <START_BUG> boolean contains = doc . contains ( "<input<seq2seq4repair_space>onclick=\"var<seq2seq4repair_space>e=document.getElementById(\'form:hf:fs\');<seq2seq4repair_space>e.name=\'button2\';<seq2seq4repair_space>e.value=\'x\';var<seq2seq4repair_space>f=document.getElementById(\'form\');if<seq2seq4repair_space>(f.onsubmit<seq2seq4repair_space>!=<seq2seq4repair_space>undefined)<seq2seq4repair_space>{<seq2seq4repair_space>if<seq2seq4repair_space>(f.onsubmit()==false)<seq2seq4repair_space>return<seq2seq4repair_space>false;<seq2seq4repair_space>}f.submit();e.value=\'\';e.name=\'\';return<seq2seq4repair_space>false;\"<seq2seq4repair_space>type=\"submit\"<seq2seq4repair_space>name=\"button2\"<seq2seq4repair_space>wicket:id=\"button2\"//>" ) ; <END_BUG> assertTrue ( contains ) ; } }

Fix:
boolean contains = doc . contains ( "<input<seq2seq4repair_space>onclick=\"var<seq2seq4repair_space>e=document.getElementById(\'form:hf:fs\');<seq2seq4repair_space>e.name=\'button2\';<seq2seq4repair_space>e.value=\'x\';var<seq2seq4repair_space>f=document.getElementById(\'form\');var<seq2seq4repair_space>ff=f;if<seq2seq4repair_space>(ff.onsubmit<seq2seq4repair_space>!=<seq2seq4repair_space>undefined)<seq2seq4repair_space>{<seq2seq4repair_space>if<seq2seq4repair_space>(ff.onsubmit()==false)<seq2seq4repair_space>return<seq2seq4repair_space>false;<seq2seq4repair_space>}f.submit();e.value=\'\';e.name=\'\';return<seq2seq4repair_space>false;\"<seq2seq4repair_space>type=\"submit\"<seq2seq4repair_space>name=\"button2\"<seq2seq4repair_space>wicket:id=\"button2\"//>" ) ;
Buggy code:
public class menu3_Fragment extends Fragment { View rootview ; @ Override public View onCreateView ( LayoutInflater inflater , @ Nullable ViewGroup container , @ Nullable Bundle savedInstanceState ) { <START_BUG> rootview = inflater . inflate ( menu4_layout , container , false ) ; <END_BUG> return rootview ; } }

Fix:
rootview = inflater . inflate ( menu3_layout , container , false ) ;
Buggy code:
public class ServletDeploymentStats { public static final DescriptionProvider provider = new DescriptionProvider ( ) { @ Override public ModelNode getModelDescription ( Locale locale ) { } } ; public static void register ( final ManagementResourceRegistration registration ) { } abstract static class AbstractMetricsHandler implements OperationStepHandler { abstract void handle ( ModelNode response , String name , Wrapper wrapper ) { } @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final PathAddress address = PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ; <START_BUG> final Resource web = context . getRootResource ( ) . navigate ( address . subAddress ( 0 , ( ( address . size ( ) ) - 1 ) ) ) ; <END_BUG> final ModelNode subModel = web . getModel ( ) ; final String host = subModel . require ( "virtual-host" ) . asString ( ) ; final String path = subModel . require ( "context-root" ) . asString ( ) ; final ModelNode node = web . requireChild ( address . getLastElement ( ) ) . getModel ( ) ; context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( WebSubsystemServices . deploymentServiceName ( host , path ) ) ; if ( controller != null ) { final String name = node . get ( "servlet-name" ) . asString ( ) ; final Context webContext = Context . class . cast ( controller . getValue ( ) ) ; final Wrapper wrapper = Wrapper . class . cast ( webContext . findChild ( name ) ) ; final ModelNode response = new ModelNode ( ) ; handle ( response , address . getLastElement ( ) . getValue ( ) , wrapper ) ; context . getResult ( ) . set ( response ) ; } context . completeStep ( ) ; } } , RUNTIME ) ; context . completeStep ( ) ; } } }

Fix:
final Resource web = context . readResourceFromRoot ( address . subAddress ( 0 , ( ( address . size ( ) ) - 1 ) ) , false ) ;
Buggy code:
public class ImageLoaderConfig { public BitmapCache bitmapCache = new MemoryCache ( ) ; public DisplayConfig displayConfig = new DisplayConfig ( ) ; public LoadPolicy loadPolicy = new SerialPolicy ( ) ; public int threadCount = ( Runtime . getRuntime ( ) . availableProcessors ( ) ) + 1 ; public ImageLoaderConfig setThreadCount ( int count ) { <START_BUG> threadCount = Math . max ( 1 , threadCount ) ; <END_BUG> return this ; } public ImageLoaderConfig setCache ( BitmapCache cache ) { } public ImageLoaderConfig setLoadingPlaceholder ( int resId ) { } public ImageLoaderConfig setNotFoundPlaceholder ( int resId ) { } public ImageLoaderConfig setLoadPolicy ( LoadPolicy policy ) { } }

Fix:
threadCount = Math . max ( 1 , count ) ;
Buggy code:
public class ConfigArea extends AbstractArea { private ConfigurationLexer lexer ; private ConfigurationParser parser ; public boolean hasErrors ( ) { <START_BUG> return lexer . hasErrors ( ) ; <END_BUG> } public void doCompilation ( ) { } public void resetArea ( ) { } public void resetErrors ( ) { } public void resetSymbols ( ) { } }

Fix:
return ( ( lexer ) == null ) || ( lexer . hasErrors ( ) ) ;
Buggy code:
public class Wapplet implements IAppletInitializer { public void init ( Container container , Object model ) { container . setBackground ( Color . white ) ; container . setLayout ( new FlowLayout ( ) ) ; <START_BUG> container . add ( new JButton ( "Button<seq2seq4repair_space>1" ) ) ; <END_BUG> container . add ( new JButton ( "Button<seq2seq4repair_space>2" ) ) ; container . add ( new JButton ( "Button<seq2seq4repair_space>3" ) ) ; } }

Fix:
container . add ( new JButton ( model . toString ( ) ) ) ;
Buggy code:
@ Controller public class HomeController { private static final Logger logger = LoggerFactory . getLogger ( HomeController . class ) ; private ServletContext servletContext ; @ Autowired ( required = true ) @ Qualifier ( "servletContext" ) public void setServletContext ( ServletContext servletContext ) { } private UserService userService ; private BlogService blogService ; @ Autowired ( required = true ) @ Qualifier ( "userService" ) public void setUserService ( UserService us ) { } @ Autowired ( required = true ) @ Qualifier ( "blogService" ) public void setBlogService ( BlogService bs ) { } @ RequestMapping ( value = "//" , method = RequestMethod . GET ) public String home ( Locale locale , Model model ) { } @ RequestMapping ( value = "//login" , method = RequestMethod . GET ) public String login ( Locale locale , Model model ) { } @ RequestMapping ( value = "//login" , method = RequestMethod . POST ) public String login ( @ ModelAttribute ( "User" ) User p , Model model , HttpServletRequest request ) { } @ RequestMapping ( value = "//logout" , method = RequestMethod . GET ) public String logout ( Locale locale , Model model , HttpServletRequest request ) { } @ RequestMapping ( value = "//users" , method = RequestMethod . GET ) public String listUsers ( Model model ) { } @ RequestMapping ( value = "//user//add" , method = RequestMethod . POST ) public String addUser ( @ ModelAttribute ( "userinfo" ) User p , Model model , @ RequestParam ( value = "imagelink" , required = false ) MultipartFile image , HttpServletRequest request ) { String username = p . getUsername ( ) ; User user = this . userService . findByUserName ( username ) ; if ( user == null ) { this . userService . addUser ( p ) ; } else { if ( ! ( user . getImage ( ) . equals ( image . getOriginalFilename ( ) ) ) ) { if ( ( image . getSize ( ) ) < 5000000 ) { try { String nameImageNew = ( user . getUsername ( ) ) + ( image . getOriginalFilename ( ) ) ; saveImage ( nameImageNew , image ) ; user . setImage ( nameImageNew ) ; } catch ( IOException e ) { model . addAttribute ( "error" , "true" ) ; return "updateUserInfo" ; } } else { model . addAttribute ( "error" , "Size<seq2seq4repair_space>of<seq2seq4repair_space>image<seq2seq4repair_space>should<seq2seq4repair_space><<seq2seq4repair_space>5000000<seq2seq4repair_space>byte" ) ; return "updateUserInfo" ; } } user . setAddress ( p . getAddress ( ) ) ; user . setEmail ( p . getEmail ( ) ) ; user . setFirstname ( p . getFirstname ( ) ) ; user . setLastname ( p . getLastname ( ) ) ; this . userService . updateUser ( user ) ; model . addAttribute ( "userinfo" , user ) ; <START_BUG> model . addAttribute ( "error" , "fasle" ) ; <END_BUG> } return "updateUserInfo" ; } private void saveImage ( String filename , MultipartFile image ) throws IOException , RuntimeException { } @ RequestMapping ( "//remove//{id}" ) public String removeUser ( @ PathVariable ( "id" ) int id ) { } @ RequestMapping ( "//edit//{username}" ) public String editUser ( @ PathVariable ( "username" ) String username , Model model , HttpServletRequest request ) { } }

Fix:
model . addAttribute ( "error" , "false" ) ;
Buggy code:
public class MainController { private Config config ; private Date currentDate ; public MainController ( ) { } public Config getConfig ( ) { } public void setConfig ( Config config ) { } public boolean rename ( ) throws UnsupportedOperationException { boolean resultat = true ; String name ; SimpleDateFormat dateFormat = new SimpleDateFormat ( "yyyy.MM.dd-HH.mm.ss" ) ; File newFile ; File folder = new File ( this . config . getPath ( ) ) ; File [ ] listOfFiles = folder . listFiles ( ) ; for ( File file : listOfFiles ) { int index = 1 ; if ( file . isFile ( ) ) { int endIndex = file . getName ( ) . lastIndexOf ( "." ) ; String extention = "" ; if ( endIndex != ( - 1 ) ) { extention = file . getName ( ) . substring ( ( endIndex + 1 ) , file . getName ( ) . length ( ) ) . toLowerCase ( ) ; } if ( extention . equals ( "jpg" ) ) { try { Metadata metadata = ImageMetadataReader . readMetadata ( file ) ; ExifSubIFDDirectory directory = metadata . getDirectory ( ExifSubIFDDirectory . class ) ; Date date = directory . getDate ( TAG_DATETIME_ORIGINAL ) ; date = this . addShift ( date ) ; do { <START_BUG> name = ( ( file . getParent ( ) ) + "\\" ) + ( this . config . getName ( dateFormat . format ( date ) ) ) ; <END_BUG> if ( index > 1 ) { name += "-" + index ; } newFile = new File ( ( ( name + "." ) + extention ) ) ; index ++ ; } while ( ! ( file . renameTo ( newFile ) ) ) ; } catch ( Exception e ) { resultat = false ; } } } } return resultat ; } public Date addShift ( Date date ) { } public boolean shiftValidity ( String value ) { } public void setDefaultValue ( ) { } public String formatCurrentDate ( ) { } public String formatDate ( Date date ) { } }

Fix:
name = ( ( file . getParent ( ) ) + "//" ) + ( this . config . getName ( dateFormat . format ( date ) ) ) ;
Buggy code:
@ Documented @ Constraint ( validatedBy = DuplicateEntityConstraintValidator . class ) @ Target ( { ElementType . METHOD , ElementType . FIELD } ) @ Retention ( RetentionPolicy . RUNTIME ) public @ interface DuplicateEntity { <START_BUG> String message ( ) default "{DuplicateEntity}" ; <END_BUG> Class < ? > [ ] groups ( ) default { } ; Class < ? extends Payload > [ ] payload ( ) default { } ; }

Fix:
String message ( ) default "Entity<seq2seq4repair_space>with<seq2seq4repair_space>this<seq2seq4repair_space>name<seq2seq4repair_space>already<seq2seq4repair_space>exist!" ;
Buggy code:
public class ImgPlayzone { public static void main ( String [ ] args ) { BufferedImage bi = null ; try { bi = ImgHelper . toBufferedImage ( "shirts//shirt1-1.jpg" ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } Imshow . show ( bi , "BuffImage" ) ; Mat catMat = null ; try { catMat = ImgHelper . toMatrix ( "shirts//shirt1-1.jpg" ) ; } catch ( MalformedURLException e ) { e . printStackTrace ( ) ; } catch ( IllegalArgumentException e ) { e . printStackTrace ( ) ; } Imshow . show ( catMat , "Cat<seq2seq4repair_space>Mat" ) ; int rgb = bi . getRGB ( 0 , 0 ) ; double [ ] rgb2 = catMat . get ( 0 , 0 ) ; System . out . println ( ( "Rgb:" + rgb ) ) ; <START_BUG> System . out . println ( ( ( ( ( ( ( ( ( "[" + ( ImgPlayzone . getRed ( rgb ) ) ) + "," ) + ( ImgPlayzone . getGreen ( rgb ) ) ) + "," ) + ( ImgPlayzone . getBlue ( rgb ) ) ) + "Alpha:" ) + ( ImgPlayzone . getAlpha ( rgb ) ) ) + "]" ) ) ; <END_BUG> System . out . println ( Arrays . toString ( rgb2 ) ) ; } public static Mat emptyMat ( Mat fromMat ) { } public static void thresholdOnRange ( Mat toThreshold , int rowLoc , int colLoc , int pixelRange ) { } public static void showThresholds ( Mat toThreshold , double value , double max ) { } private static int getRed ( int argb ) { } private static int getGreen ( int argb ) { } private static int getBlue ( int argb ) { } private static int getAlpha ( int argb ) { } }

Fix:
System . out . println ( ( ( ( ( ( ( ( ( "[" + ( ImgPlayzone . getRed ( rgb ) ) ) + "," ) + ( ImgPlayzone . getGreen ( rgb ) ) ) + "," ) + ( ImgPlayzone . getBlue ( rgb ) ) ) + "<seq2seq4repair_space>a:" ) + ( ImgPlayzone . getAlpha ( rgb ) ) ) + "]" ) ) ;
Buggy code:
public class TestTimeoutException extends SingleEMFTestCase { private final Class < ? > entityClass = PObject . class ; public void setUp ( ) { OpenJPAEntityManagerFactorySPI tempEMF = emf ; if ( tempEMF == null ) { tempEMF = createEMF ( ) ; } assertNotNull ( tempEMF ) ; DBDictionary dict = ( ( org . apache . openjpa . jdbc . conf . JDBCConfiguration ) ( tempEMF . getConfiguration ( ) ) ) . getDBDictionaryInstance ( ) ; assertNotNull ( dict ) ; <START_BUG> if ( ! ( dict . supportsSelectForUpdate ) ) <END_BUG> setTestsDisabled ( true ) ; if ( ( emf ) == null ) { closeEMF ( tempEMF ) ; } if ( isTestsDisabled ( ) ) return ; super . setUp ( entityClass , CLEAR_TABLES ) ; } public void testQueryTimeOutExceptionWhileQueryingWithLocksOnAlreadyLockedEntities ( ) { } public void testLockTimeOutExceptionWhileLockingAlreadyLockedEntities ( ) { } public void testQueryTimeOutExceptionWhileFindWithLocksOnAlreadyLockedEntities ( ) { } public Object createEntity ( EntityManager em ) { } void assertError ( Throwable actual , Class < ? extends Throwable > expected ) { } Object getFailedObject ( Throwable e ) { } void print ( Throwable t , int tab ) { } }

Fix:
if ( ( ! ( dict . supportsSelectForUpdate ) ) || ( ! ( dict . supportsQueryTimeout ) ) )
Buggy code:
public class ZombieDisguise extends MobDisguise { private static final long serialVersionUID = 3233813531511391233L ; private boolean isVillager ; public ZombieDisguise ( ) { } public ZombieDisguise ( boolean adult ) { } public ZombieDisguise ( boolean adult , boolean isVillager ) { } public boolean isVillager ( ) { } public void setVillager ( boolean isVillager ) { } public ZombieDisguise clone ( ) { } public boolean equals ( Object object ) { } public EntityZombie getEntity ( World world , Location location , int id ) { <START_BUG> EntityZombie zombie = ( ( EntityZombie ) ( getEntity ( world , location , id ) ) ) ; <END_BUG> zombie . setVillager ( isVillager ) ; return zombie ; } No newline ; at end ; of file ; }

Fix:
EntityZombie zombie = ( ( EntityZombie ) ( super . getEntity ( world , location , id ) ) ) ;
Buggy code:
public class PyraminxScrambler extends Scrambler { private static final int pieceSize = 30 ; private static final int gap = 5 ; private static String regexp = "^[ULRBulrb]'?$" ; private int [ ] [ ] validateScramble ( String scramble ) { } static int [ ] g = new int [ 720 ] ; static int [ ] f = new int [ 2592 ] ; static int [ ] [ ] d = new int [ 720 ] [ ] ; static int [ ] [ ] e = new int [ 2592 ] [ ] ; private static final String TIPS = "lrbu" ; private static final String SIDES = "ULRB" ; private static final String [ ] DIR_TO_STR = new String [ ] { "" , "'" } ; protected String generateScramble ( Random r ) { } private boolean v ( int q , int t , int l , int c , ArrayList < Integer > turns ) { } private static int w ( int p , int m ) { } private static int x ( int p , int m ) { } private static void y ( int [ ] p , int a , int c , int t ) { } private void turn ( int side , int dir , int [ ] [ ] image ) { } private void turnTip ( int side , int dir , int [ ] [ ] image ) { } private void turn ( int s , int [ ] [ ] image ) { } private void turnTip ( int s , int [ ] [ ] image ) { } private void swap ( int f1 , int s1 , int f2 , int s2 , int f3 , int s3 , int [ ] [ ] image ) { } public static Dimension getImageSize ( int gap , int pieceSize ) { } private void drawMinx ( Graphics2D g , int gap , int pieceSize , Color [ ] colorScheme , int [ ] [ ] image ) { } private void drawTriangle ( Graphics2D g , double x , double y , boolean up , int [ ] state , int pieceSize , Color [ ] colorScheme ) { } private static GeneralPath triangle ( boolean pointup , int pieceSize ) { } public static Point2D . Double getLineIntersection ( double x1 , double y1 , double x2 , double y2 , double x3 , double y3 , double x4 , double y4 ) { } public static double det ( double a , double b , double c , double d ) { } private static int getPyraminxViewWidth ( int gap , int pieceSize ) { } private static int getPyraminxViewHeight ( int gap , int pieceSize ) { } public static int getNewUnitSize ( int width , int height , int gap , String variation ) { } private static GeneralPath getTriangle ( double x , double y , int pieceSize , boolean up ) { } @ Override protected void drawScramble ( Graphics2D g , String scramble , HashMap < String , Color > colorScheme ) throws InvalidScrambleException { } private static final HashMap < String , Color > defaultColorScheme = new HashMap < String , Color > ( ) ; @ Override public HashMap < String , Color > getDefaultColorScheme ( ) { } @ Override public HashMap < String , GeneralPath > getDefaultFaceBoundaries ( ) { } @ Override protected Dimension getPreferredSize ( ) { } @ Override public String getLongName ( ) { } @ Override public String getShortName ( ) { <START_BUG> return "pyro" ; <END_BUG> } }

Fix:
return "pyram" ;