nus-yam/ex-repair huggingface dataset:
Buggy code:
public class TimestampAppender implements FileNameHandler { private DateFormat dateFormat ; public TimestampAppender ( String dateFormatStr , String timeZoneStr ) { } private String getTimeStamp ( ) { } @ Override public String buildName ( String rawFileName ) { String [ ] fileParts = rawFileName . split ( "\\." ) ; if ( ( fileParts . length ) != 2 ) { <START_BUG> throw new FileNameException ( ( ( "File<seq2seq4repair_space>name:<seq2seq4repair_space>" + rawFileName ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>expected<seq2seq4repair_space>format:<seq2seq4repair_space><raw<seq2seq4repair_space>util<seq2seq4repair_space>name>.<util<seq2seq4repair_space>extension>" ) ) ; <END_BUG> } return String . format ( "%s-%s.%s" , fileParts [ 0 ] , getTimeStamp ( ) , fileParts [ 1 ] ) ; } @ Override public String buildName ( String rawFileName , String fileExtension ) { } }

Fix:
throw new FileNameException ( ( ( "File<seq2seq4repair_space>name:<seq2seq4repair_space>" + rawFileName ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>expected<seq2seq4repair_space>format:<seq2seq4repair_space><raw<seq2seq4repair_space>file<seq2seq4repair_space>name>.<file<seq2seq4repair_space>extension>" ) ) ;
Buggy code:
public class SettingsTabUser extends SettingsTabHelper implements SettingsTabPanel { JTextField _fullname = null ; JTextField _email = null ; public SettingsTabUser ( ) { } public void handleSettingsTabRefresh ( ) { } public void handleSettingsTabSave ( ) { } public void handleSettingsTabCancel ( ) { } public String getModuleName ( ) { } public String getModuleDescription ( ) { } public String getModuleAuthor ( ) { } public String getModuleVersion ( ) { <START_BUG> return ArgoVersion . VERSION ; <END_BUG> } public String getModuleKey ( ) { } public String getTabKey ( ) { } }

Fix:
return ArgoVersion . getVersion ( ) ;
Buggy code:
public interface FeatureSpecification { boolean validate ( ProblemReporter problemReporter ) { } <START_BUG> void execute ( ExecutorContext executorContext ) ; <END_BUG> }

Fix:
void execute ( SpecificationContext specificationContext ) ;
Buggy code:
public class GossipDigestAckVerbHandler implements IVerbHandler { private static Logger logger_ = LoggerFactory . getLogger ( GossipDigestAckVerbHandler . class ) ; public void doVerb ( Message message ) { InetAddress from = message . getFrom ( ) ; if ( GossipDigestAckVerbHandler . logger_ . isTraceEnabled ( ) ) GossipDigestAckVerbHandler . logger_ . trace ( "Received<seq2seq4repair_space>a<seq2seq4repair_space>GossipDigestAckMessage<seq2seq4repair_space>from<seq2seq4repair_space>{}" , from ) ; if ( ! ( instance . isEnabled ( ) ) ) { if ( GossipDigestAckVerbHandler . logger_ . isTraceEnabled ( ) ) GossipDigestAckVerbHandler . logger_ . trace ( "Ignoring<seq2seq4repair_space>GossipDigestAckMessage<seq2seq4repair_space>because<seq2seq4repair_space>gossip<seq2seq4repair_space>is<seq2seq4repair_space>disabled" ) ; return ; } byte [ ] bytes = message . getMessageBody ( ) ; DataInputStream dis = new DataInputStream ( new ByteArrayInputStream ( bytes ) ) ; try { <START_BUG> GossipDigestAckMessage gDigestAckMessage = GossipDigestAckMessage . serializer ( ) . deserialize ( dis ) ; <END_BUG> List < GossipDigest > gDigestList = gDigestAckMessage . getGossipDigestList ( ) ; Map < InetAddress , EndpointState > epStateMap = gDigestAckMessage . getEndpointStateMap ( ) ; if ( ( epStateMap . size ( ) ) > 0 ) { instance . notifyFailureDetector ( epStateMap ) ; instance . applyStateLocally ( epStateMap ) ; } Map < InetAddress , EndpointState > deltaEpStateMap = new HashMap < InetAddress , EndpointState > ( ) ; for ( GossipDigest gDigest : gDigestList ) { InetAddress addr = gDigest . getEndpoint ( ) ; EndpointState localEpStatePtr = instance . getStateForVersionBiggerThan ( addr , gDigest . getMaxVersion ( ) ) ; if ( localEpStatePtr != null ) deltaEpStateMap . put ( addr , localEpStatePtr ) ; } GossipDigestAck2Message gDigestAck2 = new GossipDigestAck2Message ( deltaEpStateMap ) ; Message gDigestAck2Message = instance . makeGossipDigestAck2Message ( gDigestAck2 , message . getVersion ( ) ) ; if ( GossipDigestAckVerbHandler . logger_ . isTraceEnabled ( ) ) GossipDigestAckVerbHandler . logger_ . trace ( "Sending<seq2seq4repair_space>a<seq2seq4repair_space>GossipDigestAck2Message<seq2seq4repair_space>to<seq2seq4repair_space>{}" , from ) ; MessagingService . instance ( ) . sendOneWay ( gDigestAck2Message , from ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } }

Fix:
GossipDigestAckMessage gDigestAckMessage = GossipDigestAckMessage . serializer ( ) . deserialize ( dis , message . getVersion ( ) ) ;
Buggy code:
public class HoldSampleSender extends AbstractSampleSender implements Serializable { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final long serialVersionUID = 240L ; private final List < SampleEvent > sampleStore = new ArrayList < SampleEvent > ( ) ; private final RemoteSampleListener listener ; @ Deprecated public HoldSampleSender ( ) { } HoldSampleSender ( RemoteSampleListener listener ) { } @ Override public void testEnded ( String host ) { } @ Override public void sampleOccurred ( SampleEvent e ) { } private Object readResolve ( ) throws ObjectStreamException { <START_BUG> HoldSampleSender . log . info ( "Using<seq2seq4repair_space>HoldSampleSender<seq2seq4repair_space>for<seq2seq4repair_space>this<seq2seq4repair_space>test<seq2seq4repair_space>run,<seq2seq4repair_space>ensure<seq2seq4repair_space>you<seq2seq4repair_space>have<seq2seq4repair_space>configured<seq2seq4repair_space>enough<seq2seq4repair_space>memory<seq2seq4repair_space>(-Xmx)<seq2seq4repair_space>for<seq2seq4repair_space>your<seq2seq4repair_space>test" ) ; <END_BUG> return this ; } }

Fix:
HoldSampleSender . log . warn ( "Using<seq2seq4repair_space>HoldSampleSender<seq2seq4repair_space>for<seq2seq4repair_space>this<seq2seq4repair_space>test<seq2seq4repair_space>run,<seq2seq4repair_space>ensure<seq2seq4repair_space>you<seq2seq4repair_space>have<seq2seq4repair_space>configured<seq2seq4repair_space>enough<seq2seq4repair_space>memory<seq2seq4repair_space>(-Xmx)<seq2seq4repair_space>for<seq2seq4repair_space>your<seq2seq4repair_space>test" ) ;
Buggy code:
public abstract class NS_CNAME_PTRRecord extends Record { protected Name target ; protected NS_CNAME_PTRRecord ( ) { } protected NS_CNAME_PTRRecord ( Name name , short type , short dclass , int ttl ) { } public NS_CNAME_PTRRecord ( Name name , short type , short dclass , int ttl , Name target ) { } protected static Record rrFromWire ( NS_CNAME_PTRRecord rec , DataByteInputStream in ) throws IOException { } protected static Record rdataFromString ( NS_CNAME_PTRRecord rec , MyStringTokenizer st , Name origin ) throws TextParseException { <START_BUG> rec . target = Name . fromString ( st . nextToken ( ) , origin ) ; <END_BUG> rec . target . checkAbsolute ( "read<seq2seq4repair_space>an<seq2seq4repair_space>NS,<seq2seq4repair_space>CNAME,<seq2seq4repair_space>PTR,<seq2seq4repair_space>or<seq2seq4repair_space>similar<seq2seq4repair_space>record" ) ; return rec ; } public String rdataToString ( ) { } public Name getTarget ( ) { } void rrToWire ( DataByteOutputStream out , Compression c , boolean canonical ) { } }

Fix:
rec . target = Name . fromString ( nextString ( st ) , origin ) ;
Buggy code:
public class FlashlightActivity extends FragmentActivity implements TorchSettingsCoordinator { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; <START_BUG> setContentView ( activity_main ) ; <END_BUG> } @ Override public void onSelectedSettingChanged ( ) { } }

Fix:
setContentView ( activity_flashlight ) ;
Buggy code:
public class TypeLiteral extends Expression { public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor ( TypeLiteral . class , "type" , Type . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Type type = null ; TypeLiteral ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Type getType ( ) { if ( ( this . type ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . type ) == null ) { preLazyInit ( ) ; this . type = this . ast . newPrimitiveType ( PrimitiveType . INT ) ; postLazyInit ( this . type , TypeLiteral . TYPE_PROPERTY ) ; } } } return this . type ; } public void setType ( Type type ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
synchronized ( this ) {
Buggy code:
public class CodeSnippetTypeDeclaration extends TypeDeclaration { public CodeSnippetTypeDeclaration ( CompilationResult compilationResult ) { } public void generateCode ( ClassFile enclosingClassFile ) { if ( this . hasBeenGenerated ) return ; this . hasBeenGenerated = true ; if ( this . ignoreFurtherInvestigation ) { if ( ( this . binding ) == null ) return ; CodeSnippetClassFile . createProblemType ( this , this . scope . referenceCompilationUnit ( ) . compilationResult ) ; return ; } try { ClassFile classFile = new CodeSnippetClassFile ( this . binding , enclosingClassFile , false ) ; classFile . addFieldInfos ( ) ; if ( this . binding . isMemberType ( ) ) classFile . recordEnclosingTypeAttributes ( this . binding ) ; if ( this . binding . isLocalType ( ) ) { enclosingClassFile . recordNestedLocalAttribute ( this . binding ) ; classFile . recordNestedLocalAttribute ( this . binding ) ; } if ( ( this . memberTypes ) != null ) { for ( int i = 0 , max = this . memberTypes . length ; i < max ; i ++ ) { classFile . recordNestedMemberAttribute ( this . memberTypes [ i ] . binding ) ; this . memberTypes [ i ] . generateCode ( this . scope , classFile ) ; } } classFile . setForMethodInfos ( ) ; if ( ( this . methods ) != null ) { for ( int i = 0 , max = this . methods . length ; i < max ; i ++ ) { this . methods [ i ] . generateCode ( this . scope , classFile ) ; } } classFile . addSpecialMethods ( ) ; if ( this . ignoreFurtherInvestigation ) { <START_BUG> throw new org . eclipse . jdt . internal . compiler . problem . AbortType ( this . scope . referenceCompilationUnit ( ) . compilationResult ) ; <END_BUG> } classFile . addAttributes ( ) ; this . scope . referenceCompilationUnit ( ) . compilationResult . record ( this . binding . constantPoolName ( ) , classFile ) ; } catch ( org . eclipse . jdt . internal . compiler . problem . AbortType e ) { if ( ( this . binding ) == null ) return ; CodeSnippetClassFile . createProblemType ( this , this . scope . referenceCompilationUnit ( ) . compilationResult ) ; } } }

Fix:
throw new org . eclipse . jdt . internal . compiler . problem . AbortType ( this . scope . referenceCompilationUnit ( ) . compilationResult , null ) ;
Buggy code:
public class MySQLMetaData extends MetaData { public MySQLMetaData ( Properties databaseProperties , Connection connection ) { } @ Override protected ResultSet getTableRS ( DatabaseMetaData md ) throws SQLException { <START_BUG> return md . getTables ( null , null , "%" , null ) ; <END_BUG> } @ Override protected ResultSet getPKRS ( DatabaseMetaData md , String tableName ) throws SQLException { } @ Override protected ResultSet getColumnRS ( DatabaseMetaData md , String tableName ) throws SQLException { } @ Override protected String getColumnName ( ResultSet columnRS ) throws SQLException { } No newline ; at end ; of file ; }

Fix:
return md . getTables ( null , null , "%" , new String [ ] { "TABLE" } ) ;
Buggy code:
public class HelloWorldTransformerPresenter extends TransformerComponentBuilderPanel implements TransformerComponentBuilderPresenter { private static final long serialVersionUID = 1L ; public HelloWorldTransformerPresenter ( TransformerComponentBuilder < ? > transformerJobBuilder , WindowContext windowContext , PropertyWidgetFactory propertyWidgetFactory , AnalyzerBeansConfiguration configuration ) { } @ Override protected JComponent decorateMainPanel ( final DCPanel panel ) { <START_BUG> JComponent result = super . decorate ( panel ) ; <END_BUG> JPanel outerPanel = new JPanel ( new BorderLayout ( ) ) ; JLabel label = new JLabel ( "Hello<seq2seq4repair_space>DataCleaner<seq2seq4repair_space>users!<seq2seq4repair_space>This<seq2seq4repair_space>label<seq2seq4repair_space>was<seq2seq4repair_space>drawn<seq2seq4repair_space>by<seq2seq4repair_space>our<seq2seq4repair_space>extension!" ) ; label . setOpaque ( false ) ; label . setBorder ( new EmptyBorder ( 20 , 20 , 20 , 20 ) ) ; outerPanel . add ( label , BorderLayout . NORTH ) ; outerPanel . add ( result , BorderLayout . CENTER ) ; return outerPanel ; } }

Fix:
JComponent result = super . decorateMainPanel ( panel ) ;
Buggy code:
public abstract class Roll extends Command { Config config = Robot . config ; DBugLogger logger = Robot . logger ; protected double speedLeft ; protected double speedRight ; public Roll ( ) { } protected void initialize ( ) { } protected void execute ( ) { setSpeed ( ) ; <START_BUG> rollerGripper . set ( speedLeft , speedLeft ) ; <END_BUG> } protected boolean isFinished ( ) { } protected void end ( ) { } protected void interrupted ( ) { } protected abstract void setSpeed ( ) { } }

Fix:
rollerGripper . set ( speedLeft , speedRight ) ;
Buggy code:
public class Gun extends Sprite { private String name ; private int damage ; private int accuracy ; private int price ; private int range ; private int roundsPerMinute ; private int cooldown ; private int clipSize ; private int reloadTime ; private int bulletsInClip ; private BulletData bulletData ; private Random random ; public Gun ( GunData data ) { } public void shoot ( int shooter ) { } private Bullet newBullet ( int shooter ) { int newDamage = ( damage ) - ( random . nextInt ( ( ( damage ) // 2 ) ) ) ; int direction = ( ( int ) ( ( getFacingDirection ( ) ) + ( ( ( ( random . nextInt ( 91 ) ) - 45 ) * ( 100.0 - ( accuracy ) ) ) // 100.0 ) ) ) ; <START_BUG> Bullet bullet = new Bullet ( newDamage , direction , range , bulletData , getX ( ) , getY ( ) ) ; <END_BUG> bullet . setShooter ( shooter ) ; bullet . setHitbox ( new Hitbox ( Hitbox . TYPE_CIRCLE , 2 ) ) ; return bullet ; } private void initializeCooldown ( ) { } private void initializeReload ( ) { } public void cool ( ) { } public String getName ( ) { } public void setName ( String name ) { } public int getDamage ( ) { } public void setDamage ( int damage ) { } public int getAccuracy ( ) { } public void setAccuracy ( int accuracy ) { } public int getPrice ( ) { } public void setPrice ( int price ) { } public int getRange ( ) { } public void setRange ( int range ) { } public int getRoundsPerMinute ( ) { } public void setRoundsPerMinute ( int roundsPerMinute ) { } public int getClipSize ( ) { } public void setClipSize ( int clipSize ) { } public int getReloadTime ( ) { } public void setReloadTime ( int reloadTime ) { } public BulletData getBulletData ( ) { } public void setBulletData ( BulletData bulletData ) { } }

Fix:
Bullet bullet = new Bullet ( newDamage , direction , range , bulletData , getAnchorX ( ) , getAnchorY ( ) ) ;
Buggy code:
public class ScreenLocker extends CordovaPlugin { public static final String TAG = "ScreenLocker" ; public static final String ACTION_UNLOCK = "unlock" ; public static final String ACTION_LOCK = "lock" ; public ScreenLocker ( ) { } public void initialize ( CordovaInterface cordova , CordovaWebView webView ) { } @ Override public boolean execute ( final String action , JSONArray args , final CallbackContext callbackContext ) throws JSONException { boolean result = false ; Log . v ( ScreenLocker . TAG , ( "ScreenLocker<seq2seq4repair_space>received:" + action ) ) ; try { JSONObject arg_object = args . getJSONObject ( 0 ) ; if ( ScreenLocker . ACTION_LOCK . equals ( action ) ) { Log . v ( ScreenLocker . TAG , "Lock<seq2seq4repair_space>action<seq2seq4repair_space>not<seq2seq4repair_space>implemented,<seq2seq4repair_space>please<seq2seq4repair_space>wait<seq2seq4repair_space>for<seq2seq4repair_space>a<seq2seq4repair_space>new<seq2seq4repair_space>plugin<seq2seq4repair_space>version" ) ; callbackContext . error ( "Not<seq2seq4repair_space>implemented" ) ; result = false ; } else if ( ScreenLocker . ACTION_UNLOCK . equals ( action ) ) { cordova . getActivity ( ) . runOnUiThread ( new Runnable ( ) { @ Override public void run ( ) { <START_BUG> Window window = this . cordova . getActivity ( ) . getWindow ( ) ; <END_BUG> window . addFlags ( FLAG_DISMISS_KEYGUARD ) ; window . addFlags ( FLAG_SHOW_WHEN_LOCKED ) ; window . addFlags ( FLAG_TURN_SCREEN_ON ) ; Log . v ( ScreenLocker . TAG , ( "ScreenLocker<seq2seq4repair_space>received<seq2seq4repair_space>SUCCESS:" + action ) ) ; callbackContext . success ( ) ; } } ) ; result = true ; } else { callbackContext . error ( "Invalid<seq2seq4repair_space>action" ) ; result = false ; } } catch ( Exception e ) { System . err . println ( ( "Exception:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; callbackContext . error ( e . getMessage ( ) ) ; result = false ; } return result ; } No newline ; at end ; of file ; }

Fix:
Window window = cordova . getActivity ( ) . getWindow ( ) ;
Buggy code:
class AppsBlock extends HtmlBlock { final AppsList list ; @ Inject AppsBlock ( AppsList list , ViewContext ctx ) { } @ Override public void render ( Block html ) { TBODY < TABLE < Hamlet > > tbody = html . table ( "#apps" ) . thead ( ) . tr ( ) . th ( ".id" , "ID" ) . th ( ".user" , "User" ) . th ( ".name" , "Name" ) . th ( ".queue" , "Queue" ) . th ( ".starttime" , "StartTime" ) . th ( ".finishtime" , "FinishTime" ) . th ( ".state" , "State" ) . th ( ".finalstatus" , "FinalStatus" ) . th ( ".progress" , "Progress" ) . th ( ".ui" , "Tracking<seq2seq4repair_space>UI" ) . _ ( ) . _ ( ) . tbody ( ) ; int i = 0 ; String reqState = $ ( APP_STATE ) ; reqState = ( reqState == null ) ? "" : reqState ; for ( RMApp app : list . apps . values ( ) ) { if ( ( ! ( reqState . isEmpty ( ) ) ) && ( ( app . getState ( ) ) != ( RMAppState . valueOf ( reqState ) ) ) ) { continue ; } AppInfo appInfo = new AppInfo ( app , true ) ; String percent = String . format ( "%.1f" , appInfo . getProgress ( ) ) ; String startTime = Times . format ( appInfo . getStartTime ( ) ) ; String finishTime = Times . format ( appInfo . getFinishTime ( ) ) ; <START_BUG> tbody . tr ( ) . td ( ) . br ( ) . $title ( appInfo . getAppIdNum ( ) ) . _ ( ) . a ( url ( "app" , appInfo . getAppId ( ) ) , appInfo . getAppId ( ) ) . _ ( ) . td ( appInfo . getUser ( ) ) . td ( appInfo . getName ( ) ) . td ( appInfo . getQueue ( ) ) . td ( ) . br ( ) . $title ( startTime ) . _ ( ) . _ ( startTime ) . _ ( ) . td ( ) . br ( ) . $title ( startTime ) . _ ( ) . _ ( finishTime ) . _ ( ) . td ( appInfo . getState ( ) ) . td ( appInfo . getFinalStatus ( ) ) . td ( ) . br ( ) . $title ( percent ) . _ ( ) . div ( _PROGRESSBAR ) . $title ( join ( percent , '%' ) ) . div ( _PROGRESSBAR_VALUE ) . $style ( join ( "width:" , percent , '%' ) ) . _ ( ) . _ ( ) . _ ( ) . td ( ) . a ( ( ! ( appInfo . isTrackingUrlReady ( ) ) ? "#" : appInfo . getTrackingUrlPretty ( ) ) , appInfo . getTrackingUI ( ) ) . _ ( ) . _ ( ) ; <END_BUG> if ( ( ( list . rendering ) != ( Render . HTML ) ) && ( ( ++ i ) >= 20 ) ) break ; } tbody . _ ( ) . _ ( ) ; if ( ( list . rendering ) == ( Render . JS_ARRAY ) ) { echo ( "<script<seq2seq4repair_space>type=\'text//javascript\'>\n" , "var<seq2seq4repair_space>appsData=" ) ; list . toDataTableArrays ( reqState , writer ( ) ) ; echo ( "\n<//script>\n" ) ; } } }

Fix:
tbody . tr ( ) . td ( ) . br ( ) . $title ( appInfo . getAppIdNum ( ) ) . _ ( ) . a ( url ( "app" , appInfo . getAppId ( ) ) , appInfo . getAppId ( ) ) . _ ( ) . td ( appInfo . getUser ( ) ) . td ( appInfo . getName ( ) ) . td ( appInfo . getQueue ( ) ) . td ( ) . br ( ) . $title ( startTime ) . _ ( ) . _ ( startTime ) . _ ( ) . td ( ) . br ( ) . $title ( finishTime ) . _ ( ) . _ ( finishTime ) . _ ( ) . td ( appInfo . getState ( ) ) . td ( appInfo . getFinalStatus ( ) ) . td ( ) . br ( ) . $title ( percent ) . _ ( ) . div ( _PROGRESSBAR ) . $title ( join ( percent , '%' ) ) . div ( _PROGRESSBAR_VALUE ) . $style ( join ( "width:" , percent , '%' ) ) . _ ( ) . _ ( ) . _ ( ) . td ( ) . a ( ( ! ( appInfo . isTrackingUrlReady ( ) ) ? "#" : appInfo . getTrackingUrlPretty ( ) ) , appInfo . getTrackingUI ( ) ) . _ ( ) . _ ( ) ;
Buggy code:
@ Interface ( modid = "Thaumcraft" , iface = "thaumcraft.api.research.ResearchCatagories" , striprefs = true ) public class ThaumcraftCompat { public static void init ( ) { log . log ( INFO , "Initializing<seq2seq4repair_space>Thaumcraft<seq2seq4repair_space>Research<seq2seq4repair_space>Module" ) ; ResearchCategories . registerCategory ( "HAMMERZ" , new ResourceLocation ( "hammerz" , "textures//misc//hammerzTab.png" ) , new ResourceLocation ( "thaumcraft" , "textures//gui//gui_researchback.png" ) ) ; if ( ( ConfigOptions . ThaumcraftHammerEnabling [ 0 ] ) == true ) { AspectList list = new AspectList ( ) . add ( TOOL , 3 ) . add ( METAL , 2 ) . add ( MAGIC , 2 ) ; ResearchCategories . addResearch ( ThaumcraftCompat . getResearchItem ( "THAUMIUM_HAMMER" , list , ( - 2 ) , 0 , 0 , new ItemStack ( HZ_Items . ThaumiumHammer ) , recipes . get ( ThaumiumHammer ) , null , new String [ ] { "THAUMIUM" } ) ) ; } if ( ( ConfigOptions . ThaumcraftHammerEnabling [ 1 ] ) == true ) { AspectList list = new AspectList ( ) . add ( TOOL , 3 ) . add ( VOID , 3 ) . add ( DARKNESS , 2 ) ; ResearchCategories . addResearch ( ThaumcraftCompat . getResearchItem ( "VOID_HAMMER" , list , 0 , 0 , 0 , new ItemStack ( HZ_Items . VoidHammer ) , recipes . get ( VoidHammer ) , null , new String [ ] { "VOIDMETAL" } ) ) ; } if ( ( ConfigOptions . ThaumcraftHammerEnabling [ 2 ] ) == true ) { InfusionRecipe infusionRecipe = ThaumcraftCompat . addElementalHammerRecipe ( ) ; AspectList list = new AspectList ( ) . add ( TOOL , 4 ) . add ( FIRE , 2 ) . add ( SENSES , 3 ) ; ResearchCategories . addResearch ( ThaumcraftCompat . getResearchItem ( "ELEMENTAL_HAMMER" , list , 2 , 0 , 3 , new ItemStack ( HZ_Items . ElementalHammer ) , null , infusionRecipe , new String [ ] { "ELEMENTALPICK" } ) ) ; } <START_BUG> if ( ( ( ConfigOptions . ForbiddenMagicHammerEnabling [ 0 ] ) == true ) && ( Loader . isModLoaded ( "ForbiddenMagic" ) ) ) { <END_BUG> InfusionRecipe infusionRecipe = ThaumcraftCompat . addChameleonHammerRecipe ( ) ; AspectList list = new AspectList ( ) . add ( TOOL , 4 ) . add ( BEAST , 3 ) . add ( ELDRITCH , 2 ) ; ResearchCategories . addResearch ( ThaumcraftCompat . getResearchItem ( "CHAMELEON_HAMMER" , list , 0 , 2 , 3 , new ItemStack ( HZ_Items . ChameleonHammer ) , null , infusionRecipe , new String [ ] { "MORPHTOOLS" } ) ) ; } } public static ResearchItem getResearchItem ( String key , AspectList aspects , int column , int row , int complexity , ItemStack displayStack , IRecipe recipe , InfusionRecipe infusionRecipe , String [ ] relations ) { } public static InfusionRecipe addElementalHammerRecipe ( ) { } public static InfusionRecipe addChameleonHammerRecipe ( ) { } }

Fix:
if ( ( Loader . isModLoaded ( "ForbiddenMagic" ) ) && ( ( ConfigOptions . ForbiddenMagicHammerEnabling [ 0 ] ) == true ) ) {
Buggy code:
public class FileUtilsListFilesTestCase extends FileBasedTestCase { public FileUtilsListFilesTestCase ( String name ) { } private File getLocalTestDirectory ( ) { } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } private Collection filesToFilenames ( Collection files ) { } public void testListFilesByExtension ( ) throws Exception { <START_BUG> final String [ ] extensions = new String [ ] { "xml" , "txt" } ; <END_BUG> Collection files = FileUtils . listFiles ( getLocalTestDirectory ( ) , extensions , false ) ; assertEquals ( 1 , files . size ( ) ) ; Collection filenames = filesToFilenames ( files ) ; assertTrue ( filenames . contains ( "dummy-build.xml" ) ) ; assertFalse ( filenames . contains ( "README" ) ) ; assertFalse ( filenames . contains ( "dummy-file.txt" ) ) ; files = FileUtils . listFiles ( getLocalTestDirectory ( ) , extensions , true ) ; filenames = filesToFilenames ( files ) ; assertEquals ( 4 , filenames . size ( ) ) ; assertTrue ( filenames . contains ( "dummy-file.txt" ) ) ; assertFalse ( filenames . contains ( "dummy-index.html" ) ) ; files = FileUtils . listFiles ( getLocalTestDirectory ( ) , null , false ) ; assertEquals ( 2 , files . size ( ) ) ; filenames = filesToFilenames ( files ) ; assertTrue ( filenames . contains ( "dummy-build.xml" ) ) ; assertTrue ( filenames . contains ( "README" ) ) ; assertFalse ( filenames . contains ( "dummy-file.txt" ) ) ; } public void testListFiles ( ) throws Exception { } }

Fix:
String [ ] extensions = new String [ ] { "xml" , "txt" } ;
Buggy code:
public class UnmodifiableVarSet implements VarSet , Serializable { private static final long serialVersionUID = 1L ; private static final int SERIAL_VERSION = 1 ; private transient VarSet subVarSet ; public UnmodifiableVarSet ( VarSet subVarSet ) { } public Variable get ( int idx ) { } public Set vertices ( ) { } public Variable [ ] toVariableArray ( ) { } public int weight ( ) { } public AssignmentIterator assignmentIterator ( ) { } public VarSet intersection ( VarSet c ) { } public int size ( ) { } public boolean isEmpty ( ) { } public boolean contains ( Object o ) { } public Iterator iterator ( ) { } public Object [ ] toArray ( ) { } public Object [ ] toArray ( Object [ ] objects ) { } <START_BUG> public boolean add ( Object o ) { <END_BUG> throw new UnsupportedOperationException ( ( "Attempt<seq2seq4repair_space>to<seq2seq4repair_space>modify<seq2seq4repair_space>unmodifiable<seq2seq4repair_space>clique:<seq2seq4repair_space>" + ( this ) ) ) ; } public boolean remove ( Object o ) { } public boolean containsAll ( Collection collection ) { } public boolean addAll ( Collection collection ) { } public boolean retainAll ( Collection collection ) { } public boolean removeAll ( Collection collection ) { } public void clear ( ) { } public boolean equals ( Object o ) { } public int hashCode ( ) { } public String toString ( ) { } private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { } private void writeObject ( ObjectOutputStream out ) throws IOException { } }

Fix:
public boolean add ( Variable o ) {
Buggy code:
public class RankEntity { public static void main ( String [ ] args ) throws Exception { <START_BUG> public class MyWrapper { <END_BUG> private Map < String , Map < String , Integer > > hashX ; public void doublePut ( String one , String two ) { Integer value = 1 ; if ( ( hashX . get ( one ) ) == null ) { hashX . put ( one , new HashMap < String , Integer > ( ) ) ; } if ( ( hashX . get ( one ) . get ( two ) ) != null ) { value = ( hashX . get ( one ) . get ( two ) ) + 1 ; } hashX . get ( one ) . put ( two , value ) ; } public void show ( ) { Iterator it = hashX . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Map . Entry pair = ( ( Map . Entry ) ( it . next ( ) ) ) ; String tag = pair . getKey ( ) ; Iterator inner_it = pair . getValue ( ) . entrySet ( ) . iterator ( ) ; System . out . println ( ( tag + ":" ) ) ; while ( inner_it . hasNext ) { Map . Entry inner_pair = ( ( Map . Entry ) ( inner_it . next ( ) ) ) ; String phrase = inner_pair . getKey ( ) ; Integer count = inner_pair . getValue ( ) ; System . out . println ( ( ( ( "\t" + phrase ) + ":" ) + count ) ) ; inner_it . remove ( ) ; } it . remove ( ) ; } } public Map < String , Map < String , Integer > > get_hash ( ) { return hashX ; } } String serializedClassifier = "//home//1546//source//stanford-ner-2015-12-09//classifiers//english.all.3class.distsim.crf.ser.gz" ; AbstractSequenceClassifier < CoreLabel > classifier = CRFClassifier . getClassifier ( serializedClassifier ) ; String source_dir = args [ 0 ] ; String dest_dir = args [ 1 ] ; MyWrapper counts = new MyWrapper ( ) ; File [ ] directories = new File ( source_dir ) . listFiles ( File :: isDirectory ) ; for ( File path : directories ) { System . out . println ( path . getAbsolutePath ( ) ) ; File [ ] files = path . listFiles ( File :: isFile ) ; for ( File file_path : files ) { String abspath = file_path . getAbsolutePath ( ) ; System . out . println ( ( "\t" + abspath ) ) ; String fileContents = IOUtils . slurpFile ( abspath ) ; List < Triple < String , Integer , Integer > > list = classifier . classifyToCharacterOffsets ( fileContents ) ; for ( Triple < String , Integer , Integer > item : list ) { String tag = item . first ( ) ; String phrase = fileContents . substring ( item . second ( ) , item . third ( ) ) ; System . out . println ( ( ( tag + ":<seq2seq4repair_space>" ) + phrase ) ) ; counts . doublePut ( tag , phrase ) ; } System . out . println ( "---" ) ; break ; } System . out . println ( "---" ) ; } counts . show ( ) ; } No newline ; at end ; of file ; }

Fix:
private class MyWrapper {
Buggy code:
public class Main { public static void main ( String [ ] args ) { RestWarsClient client = new RestWarsClient ( "http:////localhost:8080" ) ; <START_BUG> client . setCredentials ( "foo" , "foo" ) ; <END_BUG> List < PlanetResponse > planets = client . getPlanetResource ( ) . allPlanets ( ) ; for ( PlanetResponse planet : planets ) { System . out . println ( ( "Planet<seq2seq4repair_space>" + planet ) ) ; System . out . println ( client . getBuildingResource ( ) . getBuildings ( planet . getLocation ( ) ) ) ; } } No newline ; at end ; of file ; }

Fix:
client . setCredentials ( "moe" , "moe" ) ;
Buggy code:
public class DebugTomcat { public static void main ( String [ ] args ) throws Exception { <START_BUG> int port = 80 ; <END_BUG> if ( ( args . length ) >= 1 ) { port = Integer . parseInt ( args [ 0 ] ) ; } ClasspathUtil . addClasspath ( new File ( "..//examples//test_case_data" ) . getAbsolutePath ( ) ) ; ClasspathUtil . addClasspath ( new File ( "..//examples//test_case_data//hadoop-site" ) . getAbsolutePath ( ) ) ; String webBase = new File ( "..//webapp//app" ) . getAbsolutePath ( ) ; String apiBase = new File ( "src//main//webapp" ) . getAbsolutePath ( ) ; Tomcat tomcat = new Tomcat ( ) ; tomcat . setPort ( port ) ; tomcat . setBaseDir ( "." ) ; StandardServer server = ( ( StandardServer ) ( tomcat . getServer ( ) ) ) ; AprLifecycleListener listener = new AprLifecycleListener ( ) ; server . addLifecycleListener ( listener ) ; tomcat . addWebapp ( "//kylin" , apiBase ) ; Context webContext = tomcat . addWebapp ( "//" , webBase ) ; ErrorPage notFound = new ErrorPage ( ) ; notFound . setErrorCode ( 404 ) ; notFound . setLocation ( "//index.html" ) ; webContext . addErrorPage ( notFound ) ; webContext . addWelcomeFile ( "index.html" ) ; tomcat . start ( ) ; tomcat . getServer ( ) . await ( ) ; } }

Fix:
int port = 9080 ;
Buggy code:
public abstract class SignInPanel extends Panel { private TextField username ; private PasswordTextField password ; public SignInPanel ( String componentName ) { } public String getUsername ( ) { } public String getPassword ( ) { } public void setPersistent ( boolean enable ) { } public abstract String signIn ( final String username , final String password ) { } public final class SignInForm extends Form { private static final long serialVersionUID = 303695648327317416L ; private final ValueMap properties = new ValueMap ( ) ; public SignInForm ( final String componentName , final IValidationErrorHandler feedback ) { } public final void handleSubmit ( ) { final String error = signIn ( getUsername ( ) , getPassword ( ) ) ; if ( error == null ) { final RequestCycle cycle = getRequestCycle ( ) ; if ( cycle . continueToOriginalDestination ( ) ) { cycle . setPage ( ( ( Page ) ( null ) ) ) ; } else { <START_BUG> cycle . setPage ( getApplicationSettings ( ) . getDefaultPageFactory ( ) . newPage ( getApplicationSettings ( ) . getHomePage ( ) ) ) ; <END_BUG> } } else { handleError ( new ValidationErrorMessage ( this , error ) ) ; } } } }

Fix:
cycle . setPage ( getApplicationSettings ( ) . getDefaultPageFactory ( ) . newPage ( getApplicationPages ( ) . getHomePage ( ) ) ) ;
Buggy code:
public class FavoriteDAO extends BaseDAO { DbHelper mDbHelper ; public FavoriteDAO ( Context context ) { } public ArrayList < SentenceItem > getAllFavorite ( ) { } public long countFav ( ) { } public void addToFavorite ( String sentences_id ) { } public void removeFromFavorite ( String id ) { SQLiteDatabase db = mDbHelper . getWritableDatabase ( ) ; <START_BUG> db . delete ( DB_TABLE_FAVORITE , ( ( ( DbHelper . DB_FAVORITE_SENTENCES_ID ) + "='" ) + id ) , null ) ; <END_BUG> db . close ( ) ; } }

Fix:
db . delete ( DB_TABLE_FAVORITE , ( ( ( ( DbHelper . DB_FAVORITE_SENTENCES_ID ) + "='" ) + id ) + "'" ) , null ) ;
Buggy code:
public class AnnotationScopeMetadataResolver implements ScopeMetadataResolver { protected Class < ? extends Annotation > scopeAnnotationType = Scope . class ; private final ScopedProxyMode defaultProxyMode ; public AnnotationScopeMetadataResolver ( ) { } public AnnotationScopeMetadataResolver ( ScopedProxyMode defaultProxyMode ) { } public void setScopeAnnotationType ( Class < ? extends Annotation > scopeAnnotationType ) { } public ScopeMetadata resolveScopeMetadata ( BeanDefinition definition ) { ScopeMetadata metadata = new ScopeMetadata ( ) ; if ( definition instanceof AnnotatedBeanDefinition ) { AnnotatedBeanDefinition annDef = ( ( AnnotatedBeanDefinition ) ( definition ) ) ; AnnotationAttributes attributes = MetadataUtils . attributesFor ( annDef . getMetadata ( ) , this . scopeAnnotationType ) ; if ( attributes != null ) { metadata . setScopeName ( attributes . getString ( "value" ) ) ; <START_BUG> ScopedProxyMode proxyMode = attributes . getEnum ( "proxyMode" , ScopedProxyMode . class ) ; <END_BUG> if ( ( proxyMode == null ) || ( proxyMode == ( ScopedProxyMode . DEFAULT ) ) ) { proxyMode = this . defaultProxyMode ; } metadata . setScopedProxyMode ( proxyMode ) ; } } return metadata ; } }

Fix:
ScopedProxyMode proxyMode = attributes . getEnum ( "proxyMode" ) ;
Buggy code:
public class CSVRecord implements Serializable , Iterable < String > { private static final long serialVersionUID = 1L ; private static final String [ ] EMPTY_STRING_ARRAY = new String [ 0 ] ; private final String [ ] values ; private final Map < String , Integer > mapping ; private final String comment ; private final long recordNumber ; CSVRecord ( final String [ ] values , final Map < String , Integer > mapping , final String comment , final long recordNumber ) { } public String get ( final int i ) { } public String get ( final String name ) { if ( ( mapping ) == null ) { throw new IllegalStateException ( "No<seq2seq4repair_space>header<seq2seq4repair_space>mapping<seq2seq4repair_space>was<seq2seq4repair_space>specified,<seq2seq4repair_space>the<seq2seq4repair_space>record<seq2seq4repair_space>values<seq2seq4repair_space>can't<seq2seq4repair_space>be<seq2seq4repair_space>accessed<seq2seq4repair_space>by<seq2seq4repair_space>name" ) ; } final Integer index = mapping . get ( name ) ; try { return index != null ? values [ index . intValue ( ) ] : null ; } catch ( final ArrayIndexOutOfBoundsException e ) { <START_BUG> throw new IllegalArgumentException ( String . format ( "Index<seq2seq4repair_space>for<seq2seq4repair_space>header<seq2seq4repair_space>'%s'<seq2seq4repair_space>is<seq2seq4repair_space>%d<seq2seq4repair_space>but<seq2seq4repair_space>CSVRecord<seq2seq4repair_space>only<seq2seq4repair_space>has<seq2seq4repair_space>%d<seq2seq4repair_space>values!" , name , index . intValue ( ) , values . length ) ) ; <END_BUG> } } public boolean isConsistent ( ) { } public boolean isMapped ( final String name ) { } public boolean isSet ( final String name ) { } public Iterator < String > iterator ( ) { } String [ ] values ( ) { } public String getComment ( ) { } public long getRecordNumber ( ) { } public int size ( ) { } @ Override public String toString ( ) { } }

Fix:
throw new IllegalArgumentException ( String . format ( "Index<seq2seq4repair_space>for<seq2seq4repair_space>header<seq2seq4repair_space>'%s'<seq2seq4repair_space>is<seq2seq4repair_space>%d<seq2seq4repair_space>but<seq2seq4repair_space>CSVRecord<seq2seq4repair_space>only<seq2seq4repair_space>has<seq2seq4repair_space>%d<seq2seq4repair_space>values!" , name , index , Integer . valueOf ( values . length ) ) ) ;
Buggy code:
public class Mkdir extends Task { private File dir ; public void execute ( ) throws BuildException { if ( ( dir ) == null ) { throw new BuildException ( "dir<seq2seq4repair_space>attribute<seq2seq4repair_space>is<seq2seq4repair_space>required" , location ) ; } if ( dir . isFile ( ) ) { throw new BuildException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>directory<seq2seq4repair_space>as<seq2seq4repair_space>a<seq2seq4repair_space>file<seq2seq4repair_space>already<seq2seq4repair_space>exists<seq2seq4repair_space>with<seq2seq4repair_space>that<seq2seq4repair_space>name:<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ; } if ( ! ( dir . exists ( ) ) ) { boolean result = dir . mkdirs ( ) ; if ( result == false ) { <START_BUG> String msg = ( ( "Directory<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>creation<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>" ) + "succesful<seq2seq4repair_space>for<seq2seq4repair_space>an<seq2seq4repair_space>unknown<seq2seq4repair_space>reason" ; <END_BUG> throw new BuildException ( msg , location ) ; } log ( ( "Created<seq2seq4repair_space>dir:<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ; } } public void setDir ( File dir ) { } }

Fix:
String msg = ( ( "Directory<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>creation<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>" ) + "succesfull<seq2seq4repair_space>for<seq2seq4repair_space>an<seq2seq4repair_space>unknown<seq2seq4repair_space>reason" ;
Buggy code:
public class Break extends BranchStatement { public Break ( char [ ] label , int sourceStart , int e ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { FlowContext targetContext = ( ( label ) == null ) ? flowContext . getTargetContextForDefaultBreak ( ) : flowContext . getTargetContextForBreakLabel ( label ) ; if ( targetContext == null ) { if ( ( label ) == null ) { currentScope . problemReporter ( ) . invalidBreak ( this ) ; } else { currentScope . problemReporter ( ) . undefinedLabel ( this ) ; } return flowInfo ; } targetLabel = targetContext . breakLabel ( ) ; targetContext . recordBreakFrom ( flowInfo ) ; FlowContext traversedContext = flowContext ; int subIndex = 0 ; int maxSub = 5 ; subroutines = new AstNode [ maxSub ] ; while ( true ) { AstNode sub ; if ( ( sub = traversedContext . subRoutine ( ) ) != null ) { if ( subIndex == maxSub ) { System . arraycopy ( subroutines , 0 , ( subroutines = new AstNode [ maxSub *= 2 ] ) , 0 , subIndex ) ; } subroutines [ ( subIndex ++ ) ] = sub ; if ( sub . cannotReturn ( ) ) { break ; } } traversedContext . recordReturnFrom ( flowInfo . unconditionalInits ( ) ) ; if ( traversedContext == targetContext ) { break ; } else { traversedContext = traversedContext . parent ; } } if ( subIndex != maxSub ) { System . arraycopy ( subroutines , 0 , ( subroutines = new AstNode [ subIndex ] ) , 0 , subIndex ) ; } <START_BUG> return DeadEnd ; <END_BUG> } public String toString ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockscope ) { } }

Fix:
return FlowInfo . DEAD_END ;
Buggy code:
public class EditStundeninhalt implements Command { private Stundeninhalt urspruenglich ; private Stundeninhalt bearbeitet ; @ Override public void execute ( ) { } public void execute ( String pKuerzel , Stundeninhalt inhalt ) { } @ Override public void undo ( ) { <START_BUG> DataStundeninhalt . editStundeninhalt ( bearbeitet . getName ( ) , urspruenglich ) ; <END_BUG> } }

Fix:
DataStundeninhalt . editStundeninhalt ( bearbeitet . getKuerzel ( ) , urspruenglich ) ;
Buggy code:
public class CaseTest extends BuildFileTest { public CaseTest ( String name ) { } public void setUp ( ) { } public void testCaseSensitivity ( ) { } public void testTaskCase ( ) { <START_BUG> expectBuildExceptionContaining ( "taskcase" , "Task<seq2seq4repair_space>names<seq2seq4repair_space>are<seq2seq4repair_space>case<seq2seq4repair_space>sensitive" , "Could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>task<seq2seq4repair_space>or<seq2seq4repair_space>type<seq2seq4repair_space>of<seq2seq4repair_space>type:<seq2seq4repair_space>ecHO" ) ; <END_BUG> } }

Fix:
expectBuildExceptionContaining ( "taskcase" , "Task<seq2seq4repair_space>names<seq2seq4repair_space>are<seq2seq4repair_space>case<seq2seq4repair_space>sensitive" , "Problem:<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>task<seq2seq4repair_space>or<seq2seq4repair_space>type<seq2seq4repair_space>ecHO" ) ;
Buggy code:
public class MessageListDaoTest extends DaoTestFixtures { protected MessageListDao dao = SpringUtils . getBean ( MessageListDao . class ) ; @ Before public void before ( ) throws Exception { <START_BUG> SchemaUtils . restoreTable ( "messagelisttbl" ) ; <END_BUG> } @ Test public void testFindByProviderNoAndMessageNo ( ) throws Exception { } No newline ; at end ; of file ; }

Fix:
SchemaUtils . restoreTable ( "messagelisttbl" , "msgDemoMap" ) ;
Buggy code:
public class TabFolder extends Composite { TabItem [ ] items ; int lastSelected = - 1 ; public TabFolder ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } int callPaintEventHandler ( int control , int damageRgn , int visibleRgn , int theEvent , int nextHandler ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { checkWidget ( ) ; CGRect oldBounds = new CGRect ( ) ; CGRect bounds = oldBounds ; OS . HIViewGetFrame ( handle , oldBounds ) ; int MIN_SIZE = 100 ; if ( ( ( oldBounds . width ) < MIN_SIZE ) || ( ( oldBounds . height ) < MIN_SIZE ) ) { OS . HIViewSetDrawingEnabled ( handle , false ) ; bounds = new CGRect ( ) ; bounds . width = bounds . height = 100 ; OS . HIViewSetFrame ( handle , bounds ) ; } Rect client = new Rect ( ) ; OS . GetTabContentRect ( handle , client ) ; if ( ( ( oldBounds . width ) < MIN_SIZE ) || ( ( oldBounds . height ) < MIN_SIZE ) ) { OS . HIViewSetFrame ( handle , oldBounds ) ; <START_BUG> OS . HIViewSetDrawingEnabled ( handle , ( ( drawCount ) == 0 ) ) ; <END_BUG> } x -= client . left ; y -= client . top ; width += ( ( int ) ( bounds . width ) ) - ( ( client . right ) - ( client . left ) ) ; height += ( ( int ) ( bounds . height ) ) - ( ( client . bottom ) - ( client . top ) ) ; Rect inset = getInset ( ) ; x -= inset . left ; y -= inset . top ; width += ( inset . left ) + ( inset . right ) ; height += ( inset . top ) + ( inset . bottom ) ; return new Rectangle ( ( - ( client . left ) ) , ( - ( client . top ) ) , width , height ) ; } void createHandle ( ) { } void createItem ( TabItem item , int index ) { } void createWidget ( ) { } void destroyItem ( TabItem item ) { } public Rectangle getClientArea ( ) { } public TabItem getItem ( int index ) { } public TabItem getItem ( Point point ) { } public int getItemCount ( ) { } public TabItem [ ] getItems ( ) { } public TabItem [ ] getSelection ( ) { } public int getSelectionIndex ( ) { } float getThemeAlpha ( ) { } public int indexOf ( TabItem item ) { } Point minimumSize ( int wHint , int hHint , boolean flushCache ) { } Rect getInset ( ) { } int kEventControlApplyBackground ( int nextHandler , int theEvent , int userData ) { } int kEventControlHit ( int nextHandler , int theEvent , int userData ) { } int kEventControlSetFocusPart ( int nextHandler , int theEvent , int userData ) { } void releaseChildren ( boolean destroy ) { } void removeControl ( Control control ) { } public void removeSelectionListener ( SelectionListener listener ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize , boolean events ) { } public void setSelection ( TabItem item ) { } public void setSelection ( TabItem [ ] items ) { } public void setSelection ( int index ) { } void setSelection ( int index , boolean notify , boolean force ) { } boolean traversePage ( boolean next ) { } }

Fix:
OS . HIViewSetDrawingEnabled ( handle , getDrawing ( ) ) ;
Buggy code:
public class XMLFormatterWithCDATAOnSystemOut extends BuildFileTest { private static String DIR = "src//etc//testcases//taskdefs//optional//junit" ; private static String REPORT = ( "TEST-" + ( XMLFormatterWithCDATAOnSystemOut . class . getName ( ) ) ) + ".xml" ; private static String TESTDATA = "<ERROR>" + ( ( ( ( ( ( ( ( ( ( ( ( "<![CDATA[<?xml<seq2seq4repair_space>version=\"1.0\"<seq2seq4repair_space>encoding=\"UTF-8\"?>" + "<seq2seq4repair_space><RESPONSE>" ) + "<seq2seq4repair_space><GDS//>" ) + "<seq2seq4repair_space><ERROR>" ) + "<seq2seq4repair_space><ID//>" ) + "<seq2seq4repair_space><MESSAGE//>" ) + "<seq2seq4repair_space><REQUEST_TYPE//>" ) + "<seq2seq4repair_space><RESEND//>" ) + "<seq2seq4repair_space><RAW_RESPONSE//>" ) + "<seq2seq4repair_space><//ERROR>" ) + "<seq2seq4repair_space><//RESPONSE>" ) + "]]>" ) + "<//ERROR>" ) ; public XMLFormatterWithCDATAOnSystemOut ( String name ) { } public void testOutput ( ) { } public void testBuildfile ( ) throws IOException { configureProject ( ( ( XMLFormatterWithCDATAOnSystemOut . DIR ) + "//cdataoutput.xml" ) ) ; if ( ( getProject ( ) . getProperty ( "cdata.inner" ) ) == null ) { executeTarget ( "run-junit" ) ; File f = getProject ( ) . resolveFile ( XMLFormatterWithCDATAOnSystemOut . REPORT ) ; FileReader reader = null ; try { reader = new FileReader ( f ) ; <START_BUG> String content = FileUtils . newFileUtils ( ) . readFully ( reader ) ; <END_BUG> assertTrue ( ( ( content . indexOf ( ( "<//RESPONSE>&#x5d;&#x5d;&gt;" + "<//ERROR>" ) ) ) > 0 ) ) ; } finally { if ( reader != null ) { reader . close ( ) ; } f . delete ( ) ; } } } }

Fix:
String content = FileUtils . readFully ( reader ) ;
Buggy code:
public class PlaylistOverviewActivity extends Activity implements OnBansheeCommandHandle { static int mActivePlaylistIdChange ; private static final int REQUEST_PLAYLIST = 1 ; private OnBansheeCommandHandle mOldCommandHandler ; private List < PlaylistOverviewActivity . PlaylistEntry > mPlaylists = new ArrayList < PlaylistOverviewActivity . PlaylistEntry > ( ) ; private int mActivePlaylistId ; private boolean mLoadingDismissed ; private PlaylistOverviewActivity . PlaylistsAdapter mAdapter ; @ SuppressWarnings ( "unchecked" ) @ Override public void onCreate ( Bundle bundle ) { } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } @ Override public void onDestroy ( ) { } @ Override public Object onRetainNonConfigurationInstance ( ) { } @ Override public boolean dispatchKeyEvent ( KeyEvent e ) { <START_BUG> return CurrentSongActivity . handleKeyEvent ( e ) ; <END_BUG> } @ Override public void onBansheeCommandHandled ( Command command , byte [ ] params , byte [ ] result ) { } private void refreshLoading ( ) { } private static class PlaylistEntry { public int id ; public String name ; public int count ; } private static class ViewHolder { public TextView title ; public TextView count ; public ImageView playing ; } private class PlaylistsAdapter extends BaseAdapter { @ Override public int getCount ( ) { } @ Override public Object getItem ( int position ) { } @ Override public long getItemId ( int position ) { } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { } } }

Fix:
return CurrentSongActivity . handleKeyEvent ( e ) ? true : super . dispatchKeyEvent ( e ) ;