nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Main extends Component { BufferedImage img ; boolean isRunning = true ; int xx = 250 ; int yy = 250 ; public Main ( ) { } public void setBackground ( ) { } public void setOrigin ( int xcoord , int ycoord ) { <START_BUG> Cluster cluster = new Circle ( ) ; <END_BUG> while ( cluster . hasNext ( ) ) { ClusterPoint point = cluster . next ( ) ; img . setRGB ( ( ( point . getX ( ) ) + xcoord ) , ( ( point . getY ( ) ) + xcoord ) , getColour ( 200 , 0 , 255 , 0 ) ) ; } } public void paint ( Graphics g ) { } public Dimension getPreferredSize ( ) { } private int getColour ( int alpha , int red , int green , int blue ) { } public static void main ( String [ ] args ) { } }

Fix:
Cluster cluster = new Diamond ( ) ;
Buggy code:
public class DemoCeSymm { public static void main ( String [ ] args ) throws IOException , StructureException { String name = "1u6d" ; AtomCache cache = new AtomCache ( ) ; Structure s = cache . getStructure ( name ) ; Atom [ ] atoms = StructureTools . getRepresentativeAtomArray ( s ) ; CeSymm ceSymm = new CeSymm ( ) ; CESymmParameters params = ceSymm . getParameters ( ) ; <START_BUG> params . setRefineMethod ( NOT_REFINED ) ; <END_BUG> params . setSymmType ( AUTO ) ; params . setOptimization ( true ) ; params . setSymmLevels ( 0 ) ; params . setSSEThreshold ( 2 ) ; MultipleAlignment symmetry = ceSymm . analyze ( atoms , params ) ; SymmetryDisplay . display ( symmetry , ceSymm . getSymmetryAxes ( ) ) ; } }

Fix:
params . setRefineMethod ( SINGLE ) ;
Buggy code:
public class FilterOptionsPlugin extends AbstractFolderOptionsPlugin { public FilterOptionsPlugin ( MailFrameMediator mediator ) { } public void saveOptionsToXml ( MessageFolder folder ) { } public void loadOptionsFromXml ( MessageFolder folder ) { XmlElement parent = getConfigNode ( folder ) ; DefaultItem item = new DefaultItem ( parent ) ; TableController tableController = ( ( org . columba . mail . gui . frame . TableViewOwner ) ( getMediator ( ) ) ) . getTableController ( ) ; TableModelFilter model = tableController . getTableModelFilteredView ( ) ; <START_BUG> FilterToolbar toolbar = ( ( org . columba . mail . gui . view . AbstractMailView ) ( getMediator ( ) . getBaseView ( ) ) ) . getFilterToolbar ( ) ; <END_BUG> model . setNewFlag ( item . getBoolean ( "new_state" ) ) ; toolbar . enableNew ( item . getBoolean ( "new_state" ) ) ; model . setAnsweredFlag ( item . getBoolean ( "answered_state" ) ) ; toolbar . enableAnswered ( item . getBoolean ( "answered_state" ) ) ; model . setFlaggedFlag ( item . getBoolean ( "flagged_state" ) ) ; toolbar . enableFlagged ( item . getBoolean ( "flagged_state" ) ) ; model . setAttachmentFlag ( item . getBoolean ( "attachment_state" ) ) ; toolbar . enableAttachment ( item . getBoolean ( "attachment_state" ) ) ; model . setExpungedFlag ( item . getBoolean ( "expunged_state" ) ) ; toolbar . enableExpunged ( item . getBoolean ( "expunged_state" ) ) ; String t = item . get ( "pattern" ) ; if ( t == null ) { t = "" ; } model . setPatternString ( t ) ; toolbar . setPattern ( t ) ; model . setDataFiltering ( true ) ; } public XmlElement createDefaultElement ( boolean global ) { } }

Fix:
FilterToolbar toolbar = ( ( org . columba . mail . gui . view . AbstractMailView ) ( getMediator ( ) . getView ( ) ) ) . getFilterToolbar ( ) ;
Buggy code:
public class RevokeNode extends MiscellaneousStatementNode { private PrivilegeNode privileges ; private List grantees ; public String toString ( ) { } public String statementToString ( ) { } public void init ( Object privileges , Object grantees ) { } public QueryTreeNode bind ( ) throws StandardException { <START_BUG> privileges = ( ( PrivilegeNode ) ( privileges . bind ( new HashMap ( ) ) ) ) ; <END_BUG> return this ; } public ConstantAction makeConstantAction ( ) throws StandardException { } }

Fix:
privileges = ( ( PrivilegeNode ) ( privileges . bind ( new HashMap ( ) , grantees ) ) ) ;
Buggy code:
public class SpeciesComparisonTests { @ Test public void testSameNetwork ( ) { } @ Test public void testDifferentWeights ( ) { } @ Test public void testDifferentNetworks ( ) { NeuralNetwork nn1 = new NeuralNetwork ( 1 , 1 , new double [ ] { 1.0 } ) ; NeuralNetwork nn2 = new NeuralNetwork ( 1 , 1 , new double [ ] { 1.0 } ) ; NodeUtils . getNextId ( ) ; nn1 . addNewNode ( ) ; assertThat ( nn1 . getNumExcessGenes ( nn2 ) , equalTo ( 0 ) ) ; assertThat ( nn1 . getNumDisjointGenes ( nn2 ) , equalTo ( 3 ) ) ; assertThat ( nn2 . getNumExcessGenes ( nn1 ) , equalTo ( 1 ) ) ; assertThat ( nn2 . getNumDisjointGenes ( nn1 ) , equalTo ( 2 ) ) ; Species species = new Species ( nn1 ) ; assertThat ( species . computeSimilarity ( nn1 , nn1 ) , equalTo ( 0.0 ) ) ; <START_BUG> assertThat ( species . computeSimilarity ( nn1 , nn2 ) , equalTo ( 3.0 ) ) ; <END_BUG> species . addNetworkIfSpeciesMatch ( nn2 ) ; assertThat ( species . getNumNetworksInSpecies ( ) , equalTo ( 1 ) ) ; NeuralNetwork nn3 = new NeuralNetwork ( 1 , 1 , new double [ ] { 2.0 } ) ; Species species2 = new Species ( nn2 ) ; species2 . addNetworkIfSpeciesMatch ( nn3 ) ; assertThat ( species2 . getNumNetworksInSpecies ( ) , equalTo ( 2 ) ) ; } @ Test public void testClonedNetworks ( ) { } }

Fix:
assertThat ( species . computeSimilarity ( nn2 , nn1 ) , equalTo ( 3.0 ) ) ;
Buggy code:
public class ImportConflictBinding extends ImportBinding { public ReferenceBinding conflictingTypeBinding ; public ImportConflictBinding ( char [ ] [ ] compoundName , Binding methodBinding , ReferenceBinding conflictingTypeBinding , ImportReference reference ) { } public char [ ] readableName ( ) { <START_BUG> return CharOperation . concatWith ( compoundName , '.' ) ; <END_BUG> } public String toString ( ) { } }

Fix:
return CharOperation . concatWith ( this . compoundName , '.' ) ;
Buggy code:
public class MenuItem extends Item { Menu parent ; Menu menu ; int groupHandle ; int accelerator ; public MenuItem ( Menu parent , int style ) { } public MenuItem ( Menu parent , int style , int index ) { } void addAccelerator ( int accelGroup ) { } void addAccelerators ( int accelGroup ) { } public void addArmListener ( ArmListener listener ) { } public void addHelpListener ( HelpListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } void createHandle ( int index ) { } void fixMenus ( Decorations newParent ) { } public int getAccelerator ( ) { } int getAccelGroup ( ) { } Rectangle getBounds ( ) { } public boolean getEnabled ( ) { } public Menu getMenu ( ) { } public Menu getParent ( ) { } public boolean getSelection ( ) { } int gtk_activate ( int widget ) { } int gtk_select ( int item ) { } int gtk_show_help ( int widget , int helpType ) { } void hookEvents ( ) { } public boolean isEnabled ( ) { } void releaseChildren ( boolean destroy ) { if ( ( menu ) != null ) { <START_BUG> menu . releaseChildren ( false ) ; <END_BUG> menu = null ; } super . releaseChildren ( destroy ) ; } void releaseParent ( ) { } void releaseWidget ( ) { } void removeAccelerator ( int accelGroup ) { } void removeAccelerators ( int accelGroup ) { } public void removeArmListener ( ArmListener listener ) { } public void removeHelpListener ( HelpListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } void selectRadio ( ) { } public void setAccelerator ( int accelerator ) { } public void setEnabled ( boolean enabled ) { } public void setImage ( Image image ) { } public void setMenu ( Menu menu ) { } void setOrientation ( ) { } boolean setRadioSelection ( boolean value ) { } public void setSelection ( boolean selected ) { } public void setText ( String string ) { } void updateAccelerator ( int accelGroup , boolean add ) { } }

Fix:
menu . release ( false ) ;
Buggy code:
public class PeerWatcher extends Thread { private static final long SLEEP_TIME = 15 * 1000 ; public static final String TAG = "R2" ; private boolean run = true ; @ Override public void run ( ) { } private List < String > getPeersRepo ( ) { List < String > ret = new ArrayList < String > ( ) ; <START_BUG> ret . add ( "fake" ) ; <END_BUG> return ret ; } public void stopUpdate ( ) { } }

Fix:
ret . add ( "http:////dl.dropbox.com//u//3505759//serval//repo_exemple.html" ) ;
Buggy code:
public class RegisterActivity extends Activity implements LoaderCallbacks < Cursor > { private EditText mPasswordView ; private EditText mConfirmedView ; private AutoCompleteTextView mEmailView ; private Button registerButton ; protected void onCreate ( Bundle savedInstanceState ) { } private void populateAutoComplete ( ) { } public void registerPressed ( View view ) { } public void backToWelcome ( ) { } public void attemptRegister ( ) { mEmailView . setError ( null ) ; mPasswordView . setError ( null ) ; mConfirmedView . setError ( null ) ; String mEmail = mEmailView . getText ( ) . toString ( ) ; String mPassword = mPasswordView . getText ( ) . toString ( ) ; String mConfirm = mConfirmedView . getText ( ) . toString ( ) ; boolean cancel = false ; View focusView = null ; View focusView1 = null ; dataExchanger recorder = new dataExchanger ( "pDatabase" , getApplicationContext ( ) ) ; if ( TextUtils . isEmpty ( mEmail ) ) { mEmailView . setError ( getString ( error_field_required ) ) ; focusView = mEmailView ; cancel = true ; } else if ( ! ( isEmailValid ( mEmail ) ) ) { mEmailView . setError ( getString ( error_invalid_email ) ) ; focusView = mEmailView ; cancel = true ; } else if ( ( ! ( TextUtils . isEmpty ( mPassword ) ) ) && ( ! ( isPasswordValid ( mPassword ) ) ) ) { mPasswordView . setError ( getString ( error_invalid_password ) ) ; focusView = mPasswordView ; cancel = true ; } else if ( ( ! ( TextUtils . isEmpty ( mConfirm ) ) ) && ( ! ( isPasswordValid ( mConfirm ) ) ) ) { mPasswordView . setError ( getString ( error_invalid_password ) ) ; focusView = mConfirmedView ; cancel = true ; } else if ( ! ( mConfirm . equals ( mPassword ) ) ) { mPasswordView . setError ( getString ( error_unmatched_passwords ) ) ; focusView = mPasswordView ; focusView1 = mConfirmedView ; cancel = true ; } if ( cancel ) { focusView . requestFocus ( ) ; } else { if ( recorder . registerUser ( mEmail , mPassword ) ) { backToWelcome ( ) ; } else { mEmailView . setError ( getString ( error_existed_email ) ) ; <START_BUG> focusView . requestFocus ( ) ; <END_BUG> } } } private boolean isEmailValid ( String email ) { } private boolean isPasswordValid ( String password ) { } public void exitTheAct ( ) { } public void cancelPressed ( View view ) { } @ Override public Loader < Cursor > onCreateLoader ( int i , Bundle bundle ) { } @ Override public void onLoadFinished ( Loader < Cursor > cursorLoader , Cursor cursor ) { } private void addEmailsToAutoComplete ( List < String > emailAddressCollection ) { } @ Override public void onLoaderReset ( Loader < Cursor > loader ) { } private interface ProfileQuery { String [ ] PROJECTION = new String [ ] { Email . ADDRESS , Email . IS_PRIMARY } ; int ADDRESS = 0 ; int IS_PRIMARY = 1 ; } }

Fix:
mEmailView . requestFocus ( ) ;
Buggy code:
public class PCentricLayout extends AbstractPLayout { protected final MutablePSize prefSize ; protected PInsets insets = new ImmutablePInsets ( 4 ) ; protected PComponent content ; public PCentricLayout ( PComponent component ) { } public void setInsets ( PInsets insets ) { } public PInsets getInsets ( ) { } public void setContent ( PComponent component ) { } public PComponent getContent ( ) { } protected boolean canAdd ( PComponent component , Object constraint ) { } public void layOut ( ) { if ( ( content ) != null ) { PBounds ob = getOwner ( ) . getBounds ( ) ; PInsets insets = getInsets ( ) ; int x = ( ob . getX ( ) ) + ( insets . getFromLeft ( ) ) ; int y = ( ob . getY ( ) ) + ( insets . getFromTop ( ) ) ; int w = ( ( ob . getFinalX ( ) ) - ( insets . getFromRight ( ) ) ) - x ; int h = ( ( ob . getFinalY ( ) ) - ( insets . getFromBottom ( ) ) ) - y ; PSize prefSize = getPreferredSizeOf ( content ) ; int prefW = prefSize . getWidth ( ) ; int prefH = prefSize . getHeight ( ) ; int compX ; int compY ; int compW ; int compH ; if ( prefW > w ) { compX = x ; compW = w ; } else { compX = ( x + ( w // 2 ) ) - ( prefW // 2 ) ; compW = prefW ; } <START_BUG> if ( prefW > w ) { <END_BUG> compY = y ; compH = h ; } else { compY = ( y + ( h // 2 ) ) - ( prefH // 2 ) ; compH = prefH ; } setChildBounds ( content , compX , compY , compW , compH ) ; } } public PSize getPreferredSize ( ) { } No newline ; at end ; of file ; }

Fix:
if ( prefH > h ) {
Buggy code:
public class MorphAssistant extends ContentAssistant { public IAction [ ] getActions ( VexWidget vexWidget ) { } public String getTitle ( VexWidget vexWidget ) { <START_BUG> String message = Messages . getString ( "ChangeElementAction.dynamic.label" ) ; <END_BUG> String name = vexWidget . getCurrentElement ( ) . getName ( ) ; return MessageFormat . format ( message , new Object [ ] { name } ) ; } }

Fix:
String message = Messages . getString ( "dialog.convertElement.dynamicTitle" ) ;
Buggy code:
public class NewJFrame extends JFrame { public NewJFrame ( ) { } @ SuppressWarnings ( "unchecked" ) private void initComponents ( ) { } private void jMenuItem2ActionPerformed ( ActionEvent evt ) { } private void jMenuItem3ActionPerformed ( ActionEvent evt ) { } private void jMenuItem5ActionPerformed ( ActionEvent evt ) { } private void jMenuItem6ActionPerformed ( ActionEvent evt ) { } private void jMenuItem4ActionPerformed ( ActionEvent evt ) { CriarMesa criarMesa = new CriarMesa ( ) ; criarMesa . show ( ) ; Mesa mesa = new Mesa ( ) ; <START_BUG> mesa = mesa . desserializacao ( ) ; <END_BUG> criarMesa . getModelo ( ) . setText ( mesa . getModelo ( ) ) ; } public static void main ( String [ ] args ) { } private JMenu jMenu1 ; private JMenu jMenu2 ; private JMenu jMenu3 ; private JMenuBar jMenuBar1 ; private JMenuItem jMenuItem1 ; private JMenuItem jMenuItem2 ; private JMenuItem jMenuItem3 ; private JMenuItem jMenuItem4 ; private JMenuItem jMenuItem5 ; private JMenuItem jMenuItem6 ; }

Fix:
mesa = mesa . desserializar ( ) ;
Buggy code:
public abstract class MultiPageEditorPart extends EditorPart { private INestable activeServiceLocator ; private CTabFolder container ; private ArrayList nestedEditors = new ArrayList ( 3 ) ; protected MultiPageEditorPart ( ) { } public int addPage ( Control control ) { } public void addPage ( int index , Control control ) { } public int addPage ( IEditorPart editor , IEditorInput input ) throws PartInitException { } public void addPage ( int index , IEditorPart editor , IEditorInput input ) throws PartInitException { } private int getOrientation ( IEditorPart editor ) { } private CTabFolder createContainer ( Composite parent ) { } private CTabItem createItem ( int index , Control control ) { } protected abstract void createPages ( ) { } public final void createPartControl ( Composite parent ) { Composite pageContainer = createPageContainer ( parent ) ; this . container = createContainer ( pageContainer ) ; createPages ( ) ; if ( ( getActivePage ( ) ) == ( - 1 ) ) { <START_BUG> getTabFolder ( ) . setSelection ( 0 ) ; <END_BUG> IEditorPart part = getEditor ( 0 ) ; if ( part != null ) { final IServiceLocator serviceLocator = part . getEditorSite ( ) ; if ( serviceLocator instanceof INestable ) { activeServiceLocator = ( ( INestable ) ( serviceLocator ) ) ; activeServiceLocator . activate ( ) ; } } } } protected Composite createPageContainer ( Composite parent ) { } protected IEditorSite createSite ( IEditorPart editor ) { } public void dispose ( ) { } protected IEditorPart getActiveEditor ( ) { } protected int getActivePage ( ) { } protected Composite getContainer ( ) { } protected Control getControl ( int pageIndex ) { } protected IEditorPart getEditor ( int pageIndex ) { } private CTabItem getItem ( int pageIndex ) { } protected int getPageCount ( ) { } protected Image getPageImage ( int pageIndex ) { } protected String getPageText ( int pageIndex ) { } private CTabFolder getTabFolder ( ) { } protected void handlePropertyChange ( int propertyId ) { } public void init ( IEditorSite site , IEditorInput input ) throws PartInitException { } public boolean isDirty ( ) { } protected void pageChange ( int newPageIndex ) { } private void disposePart ( final IWorkbenchPart part ) { } public void removePage ( int pageIndex ) { } protected void setActivePage ( int pageIndex ) { } protected void setControl ( int pageIndex , Control control ) { } public void setFocus ( ) { } private void setFocus ( int pageIndex ) { } protected void setPageImage ( int pageIndex , Image image ) { } protected void setPageText ( int pageIndex , String text ) { } }

Fix:
setActivePage ( 0 ) ;
Buggy code:
public class ObjectiveEvaluation extends ObjectiveEvaluation_Base { public static Comparator < ObjectiveEvaluation > COMPARATOR_BY_OLDEST_DATE = new Comparator < ObjectiveEvaluation > ( ) { @ Override public int compare ( ObjectiveEvaluation o1 , ObjectiveEvaluation o2 ) { } private ObjectiveEvaluation getOldestObjective ( ObjectiveEvaluation objectiveEvaluation ) { } } ; public ObjectiveEvaluation ( Siadap siadap , String objective , SiadapEvaluationObjectivesType type ) { } private ObjectiveEvaluation ( Siadap siadap , String objective , String justification , SiadapEvaluationObjectivesType type ) { } public boolean isValidForVersion ( Integer version ) { } public ObjectiveEvaluation edit ( String objective , String editionJustification , SiadapEvaluationObjectivesType type ) { } public Siadap getSiadap ( ) { } public void addObjectiveIndicator ( String measurementIndicator , String superationCriteria , BigDecimal ponderationFactor ) { BigDecimal sum = BigDecimal . ZERO ; for ( ObjectiveEvaluationIndicator indicator : getIndicators ( ) ) { sum = sum . add ( indicator . getPonderationFactor ( ) ) ; } if ( ( sum . add ( ponderationFactor ) . compareTo ( BigDecimal . ONE ) ) > 0 ) { <START_BUG> throw new SiadapException ( "resources//SiadapResources" , "error.ponderation.cannot.be.over.100" ) ; <END_BUG> } checkSizeOfIndicators ( ) ; new ObjectiveEvaluationIndicator ( this , measurementIndicator , superationCriteria , ponderationFactor ) ; } private void checkSizeOfIndicators ( ) { } @ Override public IScoring getItemAutoEvaluation ( ) { } @ Override public IScoring getItemEvaluation ( ) { } @ Override public boolean isValid ( ) { } @ Override public void delete ( ) { } @ Deprecated public Set < module . siadap . domain . ObjectiveEvaluationIndicator > getIndicators ( ) { } }

Fix:
throw new SiadapException ( "error.ponderation.cannot.be.over.100" ) ;
Buggy code:
class Wave extends View { private final int WAVE_HEIGHT_LARGE = 16 ; private final int WAVE_HEIGHT_MIDDLE = 8 ; private final int WAVE_HEIGHT_LITTLE = 5 ; private final float WAVE_LENGTH_MULTIPLE_LARGE = 1.5F ; private final float WAVE_LENGTH_MULTIPLE_MIDDLE = 1.0F ; private final float WAVE_LENGTH_MULTIPLE_LITTLE = 0.5F ; private final float WAVE_HZ_FAST = 0.13F ; private final float WAVE_HZ_NORMAL = 0.09F ; private final float WAVE_HZ_SLOW = 0.05F ; public final int DEFAULT_ABOVE_WAVE_ALPHA = 50 ; public final int DEFAULT_BLOW_WAVE_ALPHA = 30 ; private final float X_SPACE = 20 ; private final double PI2 = 2 * ( Math . PI ) ; private Path mAboveWavePath = new Path ( ) ; private Path mBlowWavePath = new Path ( ) ; private Paint mAboveWavePaint = new Paint ( ) ; private Paint mBlowWavePaint = new Paint ( ) ; private int mAboveWaveColor ; private int mBlowWaveColor ; private float mWaveMultiple ; private float mWaveLength ; private int mWaveHeight ; private float mMaxRight ; private float mWaveHz ; private float mAboveOffset = 0.0F ; private float mBlowOffset ; private Wave . RefreshProgressRunnable mRefreshProgressRunnable ; private int left ; private int right ; private int bottom ; private double omega ; public Wave ( Context context , AttributeSet attrs ) { } public Wave ( Context context , AttributeSet attrs , int defStyle ) { } @ Override protected void onDraw ( Canvas canvas ) { } public void setAboveWaveColor ( int aboveWaveColor ) { } public void setBlowWaveColor ( int blowWaveColor ) { } public Paint getAboveWavePaint ( ) { } public Paint getBlowWavePaint ( ) { } public void initializeWaveSize ( int waveMultiple , int waveHeight , int waveHz ) { } public void initializePainters ( ) { } private float getWaveMultiple ( int size ) { } private int getWaveHeight ( int size ) { } private float getWaveHz ( int size ) { } private void calculatePath ( ) { } @ Override protected void onWindowVisibilityChanged ( int visibility ) { } @ Override protected void onDetachedFromWindow ( ) { } @ Override public void onWindowFocusChanged ( boolean hasWindowFocus ) { } private void startWave ( ) { } private void getWaveOffset ( ) { } private class RefreshProgressRunnable implements Runnable { public void run ( ) { synchronized ( Wave . this ) { long start = System . currentTimeMillis ( ) ; calculatePath ( ) ; invalidate ( ) ; <START_BUG> long gap = ( 16 - ( System . currentTimeMillis ( ) ) ) - start ; <END_BUG> postDelayed ( this , ( gap < 0 ? 0 : gap ) ) ; } } } }

Fix:
long gap = 16 - ( ( System . currentTimeMillis ( ) ) - start ) ;
Buggy code:
public class ViewMarketPostActivity extends ActionBarActivity { private MarketPost marketPost ; Vector < Reply > replyList = new Vector < Reply > ( ) ; public void addListenerSelectTutor ( final View button , final String replyOwner ) { } public void getReplies ( ) { } public void replyAction ( View button ) { final EditText replyET = ( ( EditText ) ( findViewById ( editText ) ) ) ; String replyMessage = replyET . getText ( ) . toString ( ) ; ParseUser currentUser = ParseUser . getCurrentUser ( ) ; <START_BUG> Reply reply = new Reply ( currentUser . get ( "name" ) . toString ( ) , replyMessage , marketPost . getPostId ( ) ) ; <END_BUG> reply . saveInBackground ( new SaveCallback ( ) { public void done ( ParseException e ) { if ( e != null ) { System . out . println ( e . getMessage ( ) ) ; } else { replyET . setText ( "" ) ; } } } ) ; Notification note = new Notification ( currentUser . getObjectId ( ) , marketPost . getUser ( ) , notificationType . REPLY , marketPost . getPostId ( ) ) ; note . saveInBackground ( new SaveCallback ( ) { public void done ( ParseException e ) { if ( e != null ) { System . out . println ( e . getMessage ( ) ) ; } } } ) ; finish ( ) ; startActivity ( getIntent ( ) ) ; } public void addListenerReply ( ) { } public void addListenerEdit ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
Reply reply = new Reply ( currentUser . get ( "name" ) . toString ( ) , replyMessage , marketPost . getPostId ( ) , currentUser . getObjectId ( ) ) ;
Buggy code:
class ConsistencyManager implements Runnable { private static Logger logger_ = Logger . getLogger ( ConsistencyManager . class ) ; class DigestResponseHandler implements IAsyncCallback { List < Message > responses_ = new ArrayList < Message > ( ) ; public void response ( Message msg ) { } public void attachContext ( Object o ) { } private void handleDigestResponses ( ) { DataInputBuffer bufIn = new DataInputBuffer ( ) ; ConsistencyManager . logger_ . debug ( "Handle<seq2seq4repair_space>Digest<seq2seq4repair_space>reponses" ) ; for ( Message response : responses_ ) { <START_BUG> byte [ ] body = ( ( byte [ ] ) ( response . getMessageBody ( ) [ 0 ] ) ) ; <END_BUG> bufIn . reset ( body , body . length ) ; try { ReadResponse result = ReadResponse . serializer ( ) . deserialize ( bufIn ) ; byte [ ] digest = result . digest ( ) ; if ( ! ( Arrays . equals ( row_ . digest ( ) , digest ) ) ) { doReadRepair ( ) ; break ; } } catch ( IOException ex ) { ConsistencyManager . logger_ . info ( LogUtil . throwableToString ( ex ) ) ; } } } private void doReadRepair ( ) throws IOException { } } class DataRepairHandler implements IAsyncCallback , ICacheExpungeHook < String , String > { private List < Message > responses_ = new ArrayList < Message > ( ) ; private IResponseResolver < Row > readResponseResolver_ ; private int majority_ ; DataRepairHandler ( int responseCount , IResponseResolver < Row > readResponseResolver ) { } public void response ( Message message ) { } public void attachContext ( Object o ) { } public void callMe ( String key , String value ) { } private void handleResponses ( ) { } } private static long scheduledTimeMillis_ = 600 ; private static ICachetable < String , String > readRepairTable_ = new org . apache . cassandra . utils . Cachetable < String , String > ( ConsistencyManager . scheduledTimeMillis_ ) ; private final Row row_ ; protected final List < EndPoint > replicas_ ; private final ReadCommand readCommand_ ; public ConsistencyManager ( Row row , List < EndPoint > replicas , ReadCommand readCommand ) { } public void run ( ) { } private ReadCommand constructReadMessage ( boolean isDigestQuery ) { } }

Fix:
byte [ ] body = response . getMessageBody ( ) ;
Buggy code:
public class MainVerboseAndShow { void target ( ) { } public static void main ( String [ ] args ) throws Throwable { new MainVerboseAndShow ( ) . target ( ) ; <START_BUG> if ( ! ( MessageHolder . startsAs ( Arrays . asList ( new String [ ] { "info<seq2seq4repair_space>weaving<seq2seq4repair_space>'ataspectj//ltwlog//MainVerboseAndShow'" , "weaveinfo<seq2seq4repair_space>Type<seq2seq4repair_space>'ataspectj.ltwlog.MainVerboseAndShow'<seq2seq4repair_space>(MainVerboseAndShow.java:22)<seq2seq4repair_space>advised<seq2seq4repair_space>by<seq2seq4repair_space>before<seq2seq4repair_space>advice<seq2seq4repair_space>from<seq2seq4repair_space>'ataspectj.ltwlog.Aspect1'<seq2seq4repair_space>(Aspect1.java)" , "info<seq2seq4repair_space>weaving<seq2seq4repair_space>'ataspectj//ltwlog//Aspect1'" } ) ) ) ) { <END_BUG> MessageHolder . dump ( ) ; throw new RuntimeException ( "failed" ) ; } } }

Fix:
if ( ! ( MessageHolder . startsAs ( Arrays . asList ( new String [ ] { "info<seq2seq4repair_space>weaving<seq2seq4repair_space>'ataspectj//ltwlog//MainVerboseAndShow'" , "weaveinfo<seq2seq4repair_space>Join<seq2seq4repair_space>point<seq2seq4repair_space>'method-execution(void<seq2seq4repair_space>ataspectj.ltwlog.MainVerboseAndShow.target())'<seq2seq4repair_space>in<seq2seq4repair_space>Type<seq2seq4repair_space>'ataspectj.ltwlog.MainVerboseAndShow'<seq2seq4repair_space>(MainVerboseAndShow.java:22)<seq2seq4repair_space>advised<seq2seq4repair_space>by<seq2seq4repair_space>before<seq2seq4repair_space>advice<seq2seq4repair_space>from<seq2seq4repair_space>'ataspectj.ltwlog.Aspect1'<seq2seq4repair_space>(Aspect1.java)" , "info<seq2seq4repair_space>weaving<seq2seq4repair_space>'ataspectj//ltwlog//Aspect1'" } ) ) ) ) {
Buggy code:
public class GameControlor { public Model model ; int currentPlayer ; GameState gs ; private UIControlor uicontrolor ; public GameControlor ( InitialRules rules ) { } public Model getModel ( ) { } public void setUIControlor ( UIControlor uicontrolor ) { } public UIControlor getUIControlor ( ) { } public void setSet ( GameState newState ) { } public GameState getSet ( ) { } void playLevel ( ) { } public void endTurn ( ) { } public Player currentPlayer ( ) { } public int currentPlayerNum ( ) { } public Player getPlayer ( int num ) { } public int numPlayer ( ) { } public int drawRandomDices ( ) { } public void initialHarvest ( ) { Iterator < Player > players = model . getPlayerIterator ( ) ; while ( players . hasNext ( ) ) { Player p = players . next ( ) ; <START_BUG> VertexBuilding firstBuilding = p . getBuilding ( 1 ) ; <END_BUG> model . harvest ( firstBuilding ) ; } } public void harvest ( int randomDices ) { } public void steal ( Player stealer , Player screwed ) { } public Card giveRandomCard ( ) throws Exception { } public void releaseCard ( Card c ) { } void addColony ( SettlersVertex v , Player p ) throws Exception { } void addFreeColony ( SettlersVertex v , Player p ) throws Exception { } public void addColony ( Pnt pnt , Player p ) throws Exception { } public void addFreeColony ( Pnt pnt , Player p ) throws Exception { } void addCity ( SettlersVertex v , Player p ) throws Exception { } public void addCity ( Pnt click , Player p ) throws Exception { } public void addRoad ( Pnt pnt , Player p ) throws BuildException { } public void addRoad ( SettlersEdge e , Player p ) { } public void addFreeRoad ( Pnt pnt , Player p ) throws Exception { } public void addFreeRoad ( SettlersEdge e , Player p ) throws Exception { } public void addFirstRoad ( Pnt pnt , Player p ) throws Exception { } public void addSecondRoad ( Pnt pnt , Player p ) throws Exception { } void addFirstRoad ( SettlersEdge e , Player p ) throws Exception { } void addSecondRoad ( SettlersEdge e , Player p ) throws Exception { } public UIControlor getUicontrolor ( ) { } public void setUicontrolor ( UIControlor uicontrolor ) { } }

Fix:
VertexBuilding firstBuilding = p . getBuilding ( 0 ) ;
Buggy code:
public class SelectorBlock extends FunBlock { Block [ ] elsebody ; public SelectorBlock ( Block [ ] body , String line , Block [ ] elsebody ) { } @ Override public void paint ( Coords Coord , Graphics2D g2d , boolean nextlinedraw ) { int lenh = 35 ; int lenv = 10 ; int lenhn = 50 ; int lenvn = 25 ; g2d . drawLine ( ( ( Coord . getX ( ) ) - lenhn ) , Coord . getY ( ) , Coord . getX ( ) , ( ( Coord . getY ( ) ) + lenvn ) ) ; g2d . drawLine ( Coord . getX ( ) , ( ( Coord . getY ( ) ) - lenvn ) , ( ( Coord . getX ( ) ) + lenhn ) , Coord . getY ( ) ) ; g2d . drawLine ( ( ( Coord . getX ( ) ) + lenhn ) , Coord . getY ( ) , Coord . getX ( ) , ( ( Coord . getY ( ) ) + lenvn ) ) ; g2d . drawLine ( Coord . getX ( ) , ( ( Coord . getY ( ) ) - lenvn ) , ( ( Coord . getX ( ) ) - lenhn ) , Coord . getY ( ) ) ; <START_BUG> drawCenteredString ( g2d , line , Coord . getX ( ) , Coord . getY ( ) ) ; <END_BUG> nextArrow ( Coord , g2d ) ; Coords retCoord = new Coords ( ( ( Coord . getX ( ) ) + 50 ) , Coord . getY ( ) ) ; Coord . setY ( ( ( ( Coord . getY ( ) ) + 50 ) + 20 ) ) ; Coord . setextremeDY ( ( ( ( Coord . getextremeDY ( ) ) + 50 ) + 20 ) ) ; drawbody ( Coord , g2d ) ; retCoord . setextremeRX ( ( ( ( ( ( Coord . getextremeRX ( ) ) + 110 ) - 50 ) + ( getwidth ( ) ) ) - ( minusbody ( ) ) ) ) ; g2d . drawLine ( retCoord . getX ( ) , retCoord . getY ( ) , retCoord . getextremeRX ( ) , retCoord . getY ( ) ) ; retCoord . setX ( retCoord . getextremeRX ( ) ) ; retCoord . setextremeLX ( ( ( retCoord . getX ( ) ) - 50 ) ) ; retCoord . setextremeRX ( ( ( retCoord . getX ( ) ) + 50 ) ) ; retCoord . setY ( ( ( retCoord . getY ( ) ) - 25 ) ) ; nextArrow ( retCoord , g2d ) ; retCoord . setY ( ( ( ( retCoord . getY ( ) ) + 50 ) + 20 ) ) ; retCoord . setextremeDY ( ( ( retCoord . getY ( ) ) + 25 ) ) ; if ( ( elsebody . length ) != 0 ) { drawelseBody ( retCoord , g2d ) ; } drawret ( Coord , retCoord , g2d ) ; Coord . setextremeRX ( ( ( ( ( Coord . getextremeRX ( ) ) + 110 ) + ( ( getwidth ( ) ) * 2 ) ) - ( ( minusbody ( ) ) * 2 ) ) ) ; } private void drawelseBody ( Coords retCoord , Graphics2D g2d ) { } private void drawret ( Coords Coord , Coords retCoord , Graphics2D g2d ) { } @ Override public int getwidth ( ) { } public int minusbody ( ) { } No newline ; at end ; of file ; }

Fix:
drawCenteredLines ( g2d , line , Coord . getX ( ) , Coord . getY ( ) ) ;
Buggy code:
public class Movie implements Serializable { private String name ; private int year ; private String criticsRating ; private int criticsScore ; private String synopsis ; private String apiUrl ; private String [ ] genre ; private String altUrl ; public Movie ( String mname , int myear , String mcriticsRating , int mcriticsScore , String msynopsis , String murl , String mgenre ) { } public Movie ( ) { } public String getName ( ) { } public void setName ( String nname ) { } public int getYear ( ) { } public String [ ] getGenre ( ) { } public void setGenre ( String s ) { String result ; result = s . replaceAll ( "\"" , "" ) ; <START_BUG> result = result . substring ( 1 , ( ( s . length ( ) ) - 1 ) ) ; <END_BUG> genre = result . split ( "," ) ; } public boolean containsGenre ( String s ) { } public String getCriticsRating ( ) { } public int getCriticsScoreInt ( ) { } public String getCriticsScore ( ) { } public String getSynopsis ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object o ) { } public String getApiUrl ( ) { } public String getAltUrl ( ) { } public void setAltUrl ( String maltUrl ) { } @ Override public String toString ( ) { } }

Fix:
result = result . substring ( 1 , ( ( result . length ( ) ) - 1 ) ) ;
Buggy code:
public class FieldDateResolutionFCListener implements FieldConfigListener { private static final long serialVersionUID = - 5929802948798314067L ; private QueryConfigHandler config = null ; public FieldDateResolutionFCListener ( QueryConfigHandler config ) { } public void buildFieldConfig ( FieldConfig fieldConfig ) { DateResolutionAttribute fieldDateResAttr = fieldConfig . addAttribute ( DateResolutionAttribute . class ) ; DateTools . Resolution dateRes = null ; if ( this . config . hasAttribute ( FieldDateResolutionMapAttribute . class ) ) { FieldDateResolutionMapAttribute dateResMapAttr = this . config . addAttribute ( FieldDateResolutionMapAttribute . class ) ; <START_BUG> dateRes = dateResMapAttr . getFieldDateResolutionMap ( ) . get ( fieldConfig . getFieldName ( ) . toString ( ) ) ; <END_BUG> } if ( dateRes == null ) { if ( this . config . hasAttribute ( DateResolutionAttribute . class ) ) { DateResolutionAttribute dateResAttr = this . config . addAttribute ( DateResolutionAttribute . class ) ; dateRes = dateResAttr . getDateResolution ( ) ; } } fieldDateResAttr . setDateResolution ( dateRes ) ; } }

Fix:
dateRes = dateResMapAttr . getFieldDateResolutionMap ( ) . get ( fieldConfig . getField ( ) ) ;
Buggy code:
public class Chunk extends ToString { protected int anchor ; protected int count ; protected List < Object > chunk ; public Chunk ( int pos , int count ) { } public Chunk ( Object [ ] iseq , int pos , int count ) { } public Chunk ( Object [ ] iseq , int pos , int count , int offset ) { } public Chunk ( List < Object > iseq , int pos , int count ) { } public Chunk ( List < Object > iseq , int pos , int count , int offset ) { } public int anchor ( ) { } public int size ( ) { } public int first ( ) { } public int last ( ) { } public int rcsfrom ( ) { } public int rcsto ( ) { } public List < Object > chunk ( ) { } public boolean verify ( List < Object > target ) { } public void applyDelete ( List < Object > target ) { } public void applyAdd ( int start , List < Object > target ) { } @ Override public void toString ( StringBuffer s ) { } public StringBuffer toString ( StringBuffer s , String prefix , String postfix ) { } public static < T > List < T > slice ( List < T > seq , int pos , int count ) { if ( count <= 0 ) { <START_BUG> return new ArrayList < T > ( seq . subList ( pos , pos ) ) ; <END_BUG> } else { return new ArrayList < T > ( seq . subList ( pos , ( pos + count ) ) ) ; } } public static List < Object > slice ( Object [ ] seq , int pos , int count ) { } public String rangeString ( ) { } public void rangeString ( StringBuffer s ) { } public void rangeString ( StringBuffer s , String separ ) { } }

Fix:
return new ArrayList < T > ( ) ;
Buggy code:
class NewDeploymentScannerDisable implements ModelUpdateOperationHandler , RuntimeOperationHandler { static final NewDeploymentScannerDisable INSTANCE = new NewDeploymentScannerDisable ( ) ; private NewDeploymentScannerDisable ( ) { } public Cancellable execute ( NewOperationContext context , ModelNode operation , ResultHandler resultHandler ) { final ModelNode address = operation . require ( ADDRESS ) ; final String name = address . get ( ( ( address . asInt ( ) ) - 1 ) ) . asString ( ) ; final ModelNode compensatingOperation = new ModelNode ( ) ; <START_BUG> compensatingOperation . get ( OP ) . set ( "enable-scanner" ) ; <END_BUG> compensatingOperation . get ( OP_ADDR ) . set ( operation . require ( OP_ADDR ) ) ; if ( context instanceof NewRuntimeOperationContext ) { final NewRuntimeOperationContext updateContext = ( ( NewRuntimeOperationContext ) ( context ) ) ; final ServiceController < ? > controller = updateContext . getServiceRegistry ( ) . getService ( DeploymentScannerService . getServiceName ( name ) ) ; if ( controller == null ) { resultHandler . handleFailed ( new ModelNode ( ) . set ( "scanner<seq2seq4repair_space>not<seq2seq4repair_space>configured" ) ) ; } else { try { final DeploymentScanner scanner = ( ( DeploymentScanner ) ( controller . getValue ( ) ) ) ; scanner . stopScanner ( ) ; context . getSubModel ( ) . get ( SCAN_ENABLED ) . set ( false ) ; resultHandler . handleResultComplete ( compensatingOperation ) ; } catch ( Throwable t ) { resultHandler . handleFailed ( getFailureResult ( t ) ) ; } } } return Cancellable . NULL ; } protected ModelNode getFailureResult ( Throwable t ) { } }

Fix:
compensatingOperation . get ( OP ) . set ( "enable" ) ;
Buggy code:
public class ThinUtilities { public static void enableAntiAliasing ( Graphics g ) { <START_BUG> if ( UIManager . get ( "antialiasing" ) . equals ( "1" ) ) { <END_BUG> Graphics2D g2 = ( ( Graphics2D ) ( g ) ) ; g2 . setRenderingHint ( RenderingHints . KEY_TEXT_ANTIALIASING , RenderingHints . VALUE_TEXT_ANTIALIAS_ON ) ; g2 . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; } } }

Fix:
if ( UIManager . get ( "antialiasing" ) . equals ( new Integer ( 1 ) ) ) {
Buggy code:
public class CriterionCodecTest { CodecContext context ; JsonCodec < Criterion > criterionCodec ; final PortNumber port = PortNumber . portNumber ( 1 ) ; final IpPrefix ipPrefix4 = IpPrefix . valueOf ( "10.1.1.0//24" ) ; final IpPrefix ipPrefix6 = IpPrefix . valueOf ( "fe80:://64" ) ; final MacAddress mac1 = MacAddress . valueOf ( "00:00:11:00:00:01" ) ; @ Before public void setUp ( ) { } @ Test public void checkCriterionTypes ( ) throws Exception { } @ Test public void matchInPortTest ( ) { } @ Test public void matchInPhyPortTest ( ) { } @ Test public void matchMetadataTest ( ) { } @ Test public void matchEthDstTest ( ) { } @ Test public void matchEthSrcTest ( ) { } @ Test public void matchEthTypeTest ( ) { } @ Test public void matchVlanIdTest ( ) { } @ Test public void matchVlanPcpTest ( ) { } @ Test public void matchIPDscpTest ( ) { } @ Test public void matchIPEcnTest ( ) { <START_BUG> Criterion criterion = Criteria . matchIPEcn ( ( ( byte ) ( 7 ) ) ) ; <END_BUG> ObjectNode result = criterionCodec . encode ( criterion , context ) ; assertThat ( result , CriterionJsonMatcher . matchesCriterion ( criterion ) ) ; } @ Test public void matchIPProtocolTest ( ) { } @ Test public void matchIPSrcTest ( ) { } @ Test public void matchIPDstTest ( ) { } @ Test public void matchTcpSrcTest ( ) { } @ Test public void matchTcpDstTest ( ) { } @ Test public void matchUdpSrcTest ( ) { } @ Test public void matchUdpDstTest ( ) { } @ Test public void matchSctpSrcTest ( ) { } @ Test public void matchSctpDstTest ( ) { } @ Test public void matchIcmpTypeTest ( ) { } @ Test public void matchIcmpCodeTest ( ) { } @ Test public void matchIPv6SrcTest ( ) { } @ Test public void matchIPv6DstTest ( ) { } @ Test public void matchIPv6FlowLabelTest ( ) { } @ Test public void matchIcmpv6TypeTest ( ) { } @ Test public void matchIcmpv6CodeTest ( ) { } @ Test public void matchIPv6NDTargetAddressTest ( ) { } @ Test public void matchIPv6NDSourceLinkLayerAddressTest ( ) { } @ Test public void matchIPv6NDTargetLinkLayerAddressTest ( ) { } @ Test public void matchMplsLabelTest ( ) { } @ Test public void matchIPv6ExthdrFlagsTest ( ) { } @ Test public void matchLambdaTest ( ) { } @ Test public void matchOpticalSignalTypeTest ( ) { } @ Test public void matchUnknownTypeTest ( ) throws Exception { } }

Fix:
Criterion criterion = Criteria . matchIPEcn ( ( ( byte ) ( 3 ) ) ) ;
Buggy code:
public class MainActivity extends AppCompatActivity { private static final int MAX_HEIGHT = 160 ; private static final int MIN_HEIGHT = 48 ; private PullToScaleHeaderLayout pullToScrollLayout ; private ImageView fadeCover ; private ImageView cover ; private int heightOfHeader ; private int heightOfFooter ; private int heightOfActionBar ; private ArrayAdapter < String > arrayAdapter ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void initScrollToScaleHeaderLayout ( ) { ArrayList < String > arrayList = new ArrayList < > ( ) ; <START_BUG> for ( int i = 0 ; i < 13 ; i ++ ) { <END_BUG> arrayList . add ( ( "text" + i ) ) ; } arrayAdapter = new ArrayAdapter ( this , layout . list_item_layout , arrayList ) ; heightOfHeader = MainActivity . dipToPx ( this , MainActivity . MAX_HEIGHT ) ; heightOfFooter = MainActivity . dipToPx ( this , MainActivity . MIN_HEIGHT ) ; heightOfActionBar = MainActivity . dipToPx ( this , MainActivity . MIN_HEIGHT ) ; pullToScrollLayout = ( ( PullToScaleHeaderLayout ) ( findViewById ( pull_to_scroll_layout ) ) ) ; fadeCover = ( ( ImageView ) ( findViewById ( fade_cover ) ) ) ; cover = ( ( ImageView ) ( findViewById ( R . id . cover ) ) ) ; pullToScrollLayout . setHeightOfActionBar ( heightOfActionBar ) ; pullToScrollLayout . setHeightOfHeader ( heightOfHeader ) ; pullToScrollLayout . setHeightOfFooter ( heightOfFooter ) ; pullToScrollLayout . setAdapter ( arrayAdapter ) ; pullToScrollLayout . setOnHeaderScrollChangedListener ( new PullToScaleHeaderLayout . OnHeaderScrollChangedListener ( ) { @ Override public void headerScrollChanged ( float scrollDistance ) { float friction = ( scrollDistance + ( heightOfHeader ) ) // ( heightOfHeader ) ; float alphaFriction = ( heightOfHeader ) // ( scrollDistance + ( heightOfHeader ) ) ; scaleView ( friction , friction , cover , fadeCover ) ; setAlpha ( alphaFriction , fadeCover ) ; setTranslate ( 0 , ( ( ( int ) ( scrollDistance ) ) // 2 ) , cover , fadeCover ) ; } @ Override public void actionBarTranslate ( float translateDistance ) { setTranslate ( 0 , translateDistance , cover , fadeCover ) ; } } ) ; } private void scaleView ( float frictionX , float fractionY , View ... params ) { } private void setAlpha ( float alpha , View ... params ) { } private synchronized void setTranslate ( float offsetX , float offsetY , View ... params ) { } public static int dipToPx ( Context context , float dpValue ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
for ( int i = 0 ; i < 15 ; i ++ ) {
Buggy code:
public class CoolItem extends Item { CoolBar parent ; Control control ; int id ; boolean ideal ; boolean minimum ; public CoolItem ( CoolBar parent , int style ) { } public CoolItem ( CoolBar parent , int style , int index ) { } public void addSelectionListener ( SelectionListener listener ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint ) { } void destroyWidget ( ) { } public Rectangle getBounds ( ) { } Rectangle getClientArea ( ) { checkWidget ( ) ; int index = parent . indexOf ( this ) ; if ( index == ( - 1 ) ) return new Rectangle ( 0 , 0 , 0 , 0 ) ; int hwnd = parent . handle ; RECT insetRect = new RECT ( ) ; OS . SendMessage ( hwnd , RB_GETBANDBORDERS , index , insetRect ) ; RECT rect = new RECT ( ) ; OS . SendMessage ( hwnd , RB_GETRECT , index , rect ) ; int x = ( rect . left ) + ( insetRect . left ) ; int y = rect . top ; int width = ( ( rect . right ) - ( rect . left ) ) - ( insetRect . left ) ; int height = ( rect . bottom ) - ( rect . top ) ; if ( ( ( parent . style ) & ( SWT . FLAT ) ) == 0 ) { y += insetRect . top ; width -= insetRect . right ; height -= ( insetRect . top ) + ( insetRect . bottom ) ; } if ( index == 0 ) { REBARBANDINFO rbBand = new REBARBANDINFO ( ) ; rbBand . cbSize = REBARBANDINFO . sizeof ; rbBand . fMask = OS . RBBIM_HEADERSIZE ; OS . SendMessage ( hwnd , RB_GETBANDINFO , index , rbBand ) ; width = ( width - ( rbBand . cxHeader ) ) + 1 ; } <START_BUG> return new Rectangle ( x , y , width , height ) ; <END_BUG> } public Control getControl ( ) { } public CoolBar getParent ( ) { } void releaseHandle ( ) { } public void setControl ( Control control ) { } public Point getPreferredSize ( ) { } public void setPreferredSize ( int width , int height ) { } public void setPreferredSize ( Point size ) { } public Point getSize ( ) { } public void setSize ( int width , int height ) { } public void setSize ( Point size ) { } public Point getMinimumSize ( ) { } public void setMinimumSize ( int width , int height ) { } public void setMinimumSize ( Point size ) { } boolean getWrap ( ) { } void setWrap ( boolean wrap ) { } public void removeSelectionListener ( SelectionListener listener ) { } }

Fix:
return new Rectangle ( x , y , Math . max ( 0 , width ) , Math . max ( 0 , height ) ) ;
Buggy code:
public class JsfManagedBeanProcessor implements DeploymentUnitProcessor { public static final DotName MANAGED_BEAN_ANNOTATION = DotName . createSimple ( "javax.faces.bean.ManagedBean" ) ; private static final String WEB_INF_FACES_CONFIG = "WEB-INF//faces-config.xml" ; private static final Logger log = Logger . getLogger ( "org.jboss.as.web.jsf" ) ; private static final String MANAGED_BEAN = "managed-bean" ; private static final String MANAGED_BEAN_CLASS = "managed-bean-class" ; private static final String CONFIG_FILES = "javax.faces.CONFIG_FILES" ; @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } private void processXmlManagedBeans ( final DeploymentUnit deploymentUnit , final Set < String > managedBeanClasses ) { for ( final VirtualFile facesConfig : getConfigurationFiles ( deploymentUnit ) ) { InputStream is = null ; try { is = facesConfig . openStream ( ) ; final XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ; inputFactory . setXMLResolver ( NoopXmlResolver . create ( ) ) ; XMLStreamReader parser = inputFactory . createXMLStreamReader ( is ) ; int indent = 0 ; boolean managedBean = false ; boolean managedBeanClass = false ; while ( true ) { int event = parser . next ( ) ; if ( event == ( XMLStreamConstants . END_DOCUMENT ) ) { parser . close ( ) ; break ; } if ( event == ( XMLStreamConstants . START_ELEMENT ) ) { indent ++ ; if ( indent == 2 ) { if ( parser . getLocalName ( ) . equals ( JsfManagedBeanProcessor . MANAGED_BEAN ) ) { managedBean = true ; } } else if ( ( indent == 3 ) && managedBean ) { if ( parser . getLocalName ( ) . equals ( JsfManagedBeanProcessor . MANAGED_BEAN_CLASS ) ) { managedBeanClass = true ; } } } else if ( event == ( XMLStreamConstants . END_ELEMENT ) ) { indent -- ; managedBeanClass = false ; if ( indent == 1 ) { managedBean = false ; } } else if ( managedBeanClass && ( event == ( XMLStreamConstants . CHARACTERS ) ) ) { <START_BUG> managedBeanClasses . add ( parser . getText ( ) ) ; <END_BUG> } } } catch ( Exception e ) { JsfManagedBeanProcessor . log . error ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>" + facesConfig ) + "<seq2seq4repair_space>injection<seq2seq4repair_space>into<seq2seq4repair_space>manage<seq2seq4repair_space>beans<seq2seq4repair_space>defined<seq2seq4repair_space>in<seq2seq4repair_space>this<seq2seq4repair_space>file<seq2seq4repair_space>will<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>available" ) ) ; } finally { try { if ( is != null ) { is . close ( ) ; } } catch ( IOException e ) { } } } } public Set < VirtualFile > getConfigurationFiles ( DeploymentUnit deploymentUnit ) { } private void handleAnnotations ( final CompositeIndex index , final Set < String > managedBeanClasses ) throws DeploymentUnitProcessingException { } private void installManagedBeanComponent ( String className , final EEModuleDescription moduleDescription , final DeploymentUnit deploymentUnit ) { } @ Override public void undeploy ( final DeploymentUnit context ) { } }

Fix:
managedBeanClasses . add ( parser . getText ( ) . trim ( ) ) ;