nus-yam/ex-repair huggingface dataset:
Buggy code:
public class LocalizedFormatsTest { @ Test public void testMessageNumber ( ) { <START_BUG> Assert . assertEquals ( 311 , LocalizedFormats . values ( ) . length ) ; <END_BUG> } @ Test public void testAllKeysPresentInPropertiesFiles ( ) { } @ Test public void testAllPropertiesCorrespondToKeys ( ) { } @ Test public void testNoMissingFrenchTranslation ( ) { } @ Test public void testNoOpEnglishTranslation ( ) { } @ Test public void testVariablePartsConsistency ( ) { } }

Fix:
Assert . assertEquals ( 309 , LocalizedFormats . values ( ) . length ) ;
Buggy code:
public class TableVisualizer extends AbstractVisualizer implements Clearable { private static final long serialVersionUID = 240L ; private static final ImageIcon imageSuccess = JMeterUtils . getImage ( JMeterUtils . getPropDefault ( "viewResultsTree.success" , "icon_success_sml.gif" ) , JMeterUtils . getResString ( "table_visualizer_success" ) ) ; private static final ImageIcon imageFailure = JMeterUtils . getImage ( JMeterUtils . getPropDefault ( "viewResultsTree.failure" , "icon_warning_sml.gif" ) , JMeterUtils . getResString ( "table_visualizer_warning" ) ) ; private static final String [ ] COLUMNS = new String [ ] { "table_visualizer_sample_num" , "table_visualizer_start_time" , "table_visualizer_thread_name" , "sampler_label" , "table_visualizer_sample_time" , "table_visualizer_status" , "table_visualizer_bytes" } ; private ObjectTableModel model = null ; private JTable table = null ; private JTextField dataField = null ; private JTextField averageField = null ; private JTextField deviationField = null ; private JTextField noSamplesField = null ; private JScrollPane tableScrollPanel = null ; private JCheckBox autoscroll = null ; private JCheckBox childSamples = null ; private transient Calculator calc = new Calculator ( ) ; private Format format = new SimpleDateFormat ( "HH:mm:ss.SSS" ) ; private static final TableCellRenderer [ ] RENDERERS = new TableCellRenderer [ ] { null , new RightAlignRenderer ( ) , null , null , null , null , null } ; public TableVisualizer ( ) { } public static boolean testFunctors ( ) { } public String getLabelResource ( ) { } protected synchronized void updateTextFields ( SampleResult res ) { } public void add ( SampleResult res ) { if ( childSamples . isSelected ( ) ) { SampleResult [ ] subResults = res . getSubResults ( ) ; if ( ( subResults . length ) > 0 ) { for ( SampleResult sr : subResults ) { add ( sr ) ; } return ; } } synchronized ( calc ) { <START_BUG> calc . addValue ( res . getTime ( ) ) ; <END_BUG> int count = calc . getCount ( ) ; Sample newS = new Sample ( res . getSampleLabel ( ) , res . getTime ( ) , 0 , 0 , 0 , 0 , 0 , 0 , res . isSuccessful ( ) , count , res . getEndTime ( ) , res . getBytes ( ) , res . getThreadName ( ) ) ; model . addRow ( newS ) ; } updateTextFields ( res ) ; if ( autoscroll . isSelected ( ) ) { table . scrollRectToVisible ( table . getCellRect ( ( ( table . getRowCount ( ) ) - 1 ) , 0 , true ) ) ; } } public synchronized void clearData ( ) { } @ Override public String toString ( ) { } private void init ( ) { } public static class SampleSuccessFunctor extends Functor { public SampleSuccessFunctor ( String methodName ) { } @ Override public Object invoke ( Object p_invokee ) { } } }

Fix:
calc . addSample ( res ) ;
Buggy code:
public class PieChartActivity extends DemoBase implements OnSeekBarChangeListener , OnChartValueSelectedListener { private PieChart mChart ; private SeekBar mSeekBarX ; private SeekBar mSeekBarY ; private TextView tvX ; private TextView tvY ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; getWindow ( ) . setFlags ( FLAG_FULLSCREEN , FLAG_FULLSCREEN ) ; setContentView ( activity_piechart ) ; tvX = ( ( TextView ) ( findViewById ( tvXMax ) ) ) ; tvY = ( ( TextView ) ( findViewById ( tvYMax ) ) ) ; mSeekBarX = ( ( SeekBar ) ( findViewById ( seekBar1 ) ) ) ; mSeekBarY = ( ( SeekBar ) ( findViewById ( seekBar2 ) ) ) ; mSeekBarX . setOnSeekBarChangeListener ( this ) ; mSeekBarY . setOnSeekBarChangeListener ( this ) ; mChart = ( ( PieChart ) ( findViewById ( chart1 ) ) ) ; Typeface tf = Typeface . createFromAsset ( getAssets ( ) , "OpenSans-Regular.ttf" ) ; mChart . setValueTypeface ( tf ) ; mChart . setCenterTextTypeface ( Typeface . createFromAsset ( getAssets ( ) , "OpenSans-Light.ttf" ) ) ; mChart . setHoleRadius ( 60.0F ) ; mChart . setDrawYValues ( true ) ; mChart . setDrawCenterText ( true ) ; mChart . setDescription ( "This<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>description." ) ; mChart . setDrawHoleEnabled ( true ) ; mChart . setDrawXValues ( true ) ; mChart . setTouchEnabled ( true ) ; mChart . setUsePercentValues ( true ) ; mChart . setOnChartValueSelectedListener ( this ) ; mSeekBarX . setProgress ( 4 ) ; mSeekBarY . setProgress ( 100 ) ; Legend l = mChart . getLegend ( ) ; <START_BUG> l . setPosition ( RIGHT_OF_CHART ) ; <END_BUG> l . setYEntrySpace ( 3.0F ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private String [ ] mParties = new String [ ] { "Party<seq2seq4repair_space>A" , "Party<seq2seq4repair_space>B" , "Party<seq2seq4repair_space>C" , "Party<seq2seq4repair_space>D" , "Party<seq2seq4repair_space>E" } ; @ Override public void onProgressChanged ( SeekBar seekBar , int progress , boolean fromUser ) { } @ Override public void onValuesSelected ( Entry [ ] values , Highlight [ ] highs ) { } @ Override public void onNothingSelected ( ) { } @ Override public void onStartTrackingTouch ( SeekBar seekBar ) { } @ Override public void onStopTrackingTouch ( SeekBar seekBar ) { } }

Fix:
l . setPosition ( BELOW_CHART_LEFT ) ;
Buggy code:
class JoinSet { private final List _graph = new ArrayList ( ) ; private int _size = 0 ; private List _sorted = null ; public JoinSet ( ) { } public JoinSet ( JoinSet copy ) { } public Join getRecordedJoin ( Join join ) { } private JoinSet . Node getNode ( Join join , int idx ) { } public Join last ( ) { } public Iterator joinIterator ( ) { } private int getSeenIndex ( Join join ) { } public boolean add ( Join join ) { } public boolean addAll ( JoinSet js ) { } private void addNode ( Join join ) { } public Iterator iterator ( ) { } public boolean remove ( Join join ) { } private boolean remove ( Join join , int idx ) { } public boolean removeAll ( JoinSet js ) { } public boolean retainAll ( JoinSet js ) { } public void clear ( ) { } public boolean contains ( Join join ) { } public boolean containsAll ( JoinSet js ) { } public boolean isEmpty ( ) { } public int size ( ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public String toString ( ) { <START_BUG> StringBuffer buf = new StringBuffer ( ) ; <END_BUG> buf . append ( "[" ) ; for ( Iterator itr = iterator ( ) ; itr . hasNext ( ) ; ) { buf . append ( "<" ) . append ( itr . next ( ) ) . append ( ">" ) ; if ( itr . hasNext ( ) ) buf . append ( ",<seq2seq4repair_space>" ) ; } return buf . append ( "]" ) . toString ( ) ; } private static class Node implements Cloneable { public Join join ; public JoinSet . Node next ; public boolean forward ; public Node ( Join join , boolean forward ) { } public int hashCode ( ) { } public boolean equals ( Object other ) { } public Object clone ( ) { } public String toString ( ) { return ( ( ( ( ( join ) + "(" ) + ( forward ? "forward" : "backward" ) ) + ")" ) + ";<seq2seq4repair_space>next:<seq2seq4repair_space>" ) + ( next ) ; } } }

Fix:
StringBuilder buf = new StringBuilder ( ) ;
Buggy code:
public class GroupsController implements Initializable { @ FXML private TitledPane manageGroups ; @ FXML private ListView groups ; @ FXML private ListView members ; @ FXML private TextField groupSelected ; @ FXML private TextField newGroupName ; @ FXML private Button addGroupBtn ; @ FXML private TextField addUserName ; @ FXML private Button addUserBtn ; @ FXML private Button deleteGroupBtn ; @ FXML private Button deleteMemberBtn ; @ FXML private Button finishBtn ; private MainController application ; private final ObservableList obsGroupsList = FXCollections . observableArrayList ( ) ; private final ObservableList obsMembersList = FXCollections . observableArrayList ( ) ; List < Group > listGroups = null ; public void setApp ( MainController application ) { } @ FXML public void initialize ( URL location , ResourceBundle resources ) { } public void loadGroups ( ) { } @ FXML public void changeGroupName ( ActionEvent event ) { } @ FXML public void deleteGroup ( ActionEvent event ) { } @ FXML public void deleteMemberFromGroup ( ActionEvent event ) { } @ FXML public void addNewGroup ( ActionEvent event ) { } @ FXML public void addMemberInGroup ( ActionEvent event ) { if ( Strings . isNullOrEmpty ( addUserName . getText ( ) ) ) { showWarningDialog ( "Veuillez<seq2seq4repair_space>entrer<seq2seq4repair_space>le<seq2seq4repair_space>login<seq2seq4repair_space>de<seq2seq4repair_space>l'utilisateur." ) ; } else { String selectedGrp = groups . getSelectionModel ( ) . getSelectedItem ( ) . toString ( ) ; for ( Group g : listGroups ) { if ( g . getNom ( ) . equals ( selectedGrp ) ) { Boolean inGroup = false ; for ( User u : g . getUsers ( ) ) { if ( addUserName . getText ( ) . equalsIgnoreCase ( u . getLogin ( ) ) ) { showWarningDialog ( "Ajout<seq2seq4repair_space>impossible:<seq2seq4repair_space>L'utilisateur<seq2seq4repair_space>existe<seq2seq4repair_space>déjà<seq2seq4repair_space>dans<seq2seq4repair_space>le<seq2seq4repair_space>groupe<seq2seq4repair_space>!" ) ; inGroup = true ; return ; } } if ( ! inGroup ) { User user = checkIfFriend ( addUserName . getText ( ) ) ; if ( user != null ) { <START_BUG> application . getIHMtoDATA ( ) . acceptUserInGroup ( user , g ) ; <END_BUG> obsMembersList . add ( user . getLogin ( ) ) ; showInformationDialog ( ( ( user . getLogin ( ) ) + "<seq2seq4repair_space>a<seq2seq4repair_space>été<seq2seq4repair_space>ajouté<seq2seq4repair_space>dans<seq2seq4repair_space>le<seq2seq4repair_space>groupe<seq2seq4repair_space>avec<seq2seq4repair_space>succès." ) ) ; addUserName . clear ( ) ; return ; } else { showWarningDialog ( "Ajout<seq2seq4repair_space>impossible:<seq2seq4repair_space>L'utilisateur<seq2seq4repair_space>n'est<seq2seq4repair_space>pas<seq2seq4repair_space>votre<seq2seq4repair_space>ami<seq2seq4repair_space>ou<seq2seq4repair_space>n'existe<seq2seq4repair_space>pas." ) ; return ; } } } } } } private void displayUsers ( String groupName ) { } private void disableFields ( Boolean b ) { } @ FXML private void finish ( ) { } private User checkIfFriend ( String login ) { } }

Fix:
application . getIHMtoDATA ( ) . addUserInGroup ( user , g ) ;
Buggy code:
public class ClawHeightDecrementNoPID extends Command { private static final double movespeed = - 1.0 ; private static final double stopspeed = 0.0 ; private boolean atLimit ; private double initialPosition ; public ClawHeightDecrementNoPID ( ) { } protected void initialize ( ) { } protected void execute ( ) { } protected boolean isFinished ( ) { <START_BUG> return ( clawElevator . getPosition ( ) ) >= ( ( initialPosition ) - ( ClawElevator . TOTE_HEIGHT ) ) ; <END_BUG> } protected void end ( ) { } protected void interrupted ( ) { } }

Fix:
return ( clawElevator . getPosition ( ) ) <= ( ( initialPosition ) - ( ClawElevator . TOTE_HEIGHT ) ) ;
Buggy code:
class VAJWorkspaceScanner extends DirectoryScanner { private static final String [ ] DEFAULTEXCLUDES = new String [ ] { "IBM*//**" , "Java<seq2seq4repair_space>class<seq2seq4repair_space>libraries//**" , "Sun<seq2seq4repair_space>class<seq2seq4repair_space>libraries*//**" , "JSP<seq2seq4repair_space>Page<seq2seq4repair_space>Compile<seq2seq4repair_space>Generated<seq2seq4repair_space>Code//**" , "VisualAge*//**" } ; private Vector packagesIncluded = new Vector ( ) ; public void addDefaultExcludes ( ) { } public Vector findMatchingProjects ( ) { } public Package [ ] getIncludedPackages ( ) { } public void scan ( ) { } public void scanProject ( Project project ) { try { Package [ ] packages = project . getPackages ( ) ; if ( packages != null ) { for ( int i = 0 ; i < ( packages . length ) ; i ++ ) { Package item = packages [ i ] ; String name = ( ( project . getName ( ) ) + ( File . separator ) ) + ( item . getName ( ) . replace ( '.' , File . separatorChar ) ) ; if ( ( isIncluded ( name ) ) && ( ! ( isExcluded ( name ) ) ) ) { packagesIncluded . addElement ( item ) ; } } } } catch ( IvjException e ) { <START_BUG> throw VAJLocalUtil . createBuildException ( "VA<seq2seq4repair_space>Exception<seq2seq4repair_space>occured:<seq2seq4repair_space>" , e ) ; <END_BUG> } } }

Fix:
throw VAJLocalUtil . createBuildException ( "VA<seq2seq4repair_space>Exception<seq2seq4repair_space>occurred:<seq2seq4repair_space>" , e ) ;
Buggy code:
class ClasspathMultiDirectory extends ClasspathDirectory { String sourcePath ; NameEnvironment nameEnvironment ; ClasspathMultiDirectory ( String sourcePath , String binaryPath ) { } void clear ( ) { } public boolean equals ( Object o ) { } NameEnvironmentAnswer findClass ( char [ ] className , char [ ] [ ] packageName ) { if ( ( nameEnvironment . additionalSourceFilenames ) != null ) { String sourceFilename = ( new String ( className ) ) + ".java" ; if ( exists ( sourcePath , sourceFilename , packageName ) ) { String fullSourceName = ( sourcePath ) + ( NameEnvironment . assembleName ( sourceFilename , packageName , '//' ) ) ; String [ ] additionalSourceFilenames = nameEnvironment . additionalSourceFilenames ; for ( int i = 0 , l = additionalSourceFilenames . length ; i < l ; i ++ ) if ( fullSourceName . equals ( additionalSourceFilenames [ i ] ) ) <START_BUG> return new NameEnvironmentAnswer ( new SourceFile ( fullSourceName ) ) ; <END_BUG> } } return super . findClass ( className , packageName ) ; } public String toString ( ) { } }

Fix:
return new NameEnvironmentAnswer ( new SourceFile ( fullSourceName , packageName ) ) ;
Buggy code:
public class CreateSkillDialog extends JFrame implements ActionListener { private JPanel inputPanel ; private JTextField nameField ; private JLabel spLabel ; private JTextField levelsText ; private JButton jButton1 ; private JScrollPane jScrollPane1 ; private JTextPane jTextArea1 ; private JCheckBox startLevelCheck ; private JTextField initialCostText ; private JLabel jLabel1 ; private JLabel levelLabel ; private JTextField spText ; private JLabel nameLabel ; private JComboBox < DFOClass > baseClass ; private JTextField requiredLevelText ; public CreateSkillDialog ( ) { } private void initGUI ( ) { } @ Override public void actionPerformed ( ActionEvent arg0 ) { } private String getFolderToPutIn ( ) { DFOClass selected = ( ( DFOClass ) ( baseClass . getSelectedItem ( ) ) ) ; <START_BUG> return selected . getUniqueName ( ) . substring ( ( ( selected . getUniqueName ( ) . indexOf ( "//" ) ) + 1 ) ) ; <END_BUG> } }

Fix:
return selected . getUniqueName ( ) ;
Buggy code:
public class Node { public static int nodeGIN = 0 ; public ArrayList < Integer > cons = new ArrayList < > ( ) ; public double val ; public boolean used ; public int gin ; public Node ( boolean stahpid ) { } public double get ( ) { } public Node getNode ( ) { Node n = new Node ( false ) ; ArrayList < Integer > nt = new ArrayList < > ( ) ; for ( int i = 0 ; i < ( cons . size ( ) ) ; i ++ ) { <START_BUG> nt . add ( ( ( int ) ( cons . get ( i ) ) ) ) ; <END_BUG> } n . cons = nt ; n . val = val ; n . gin = gin ; return n ; } }

Fix:
nt . add ( ( 0 + ( cons . get ( i ) ) ) ) ;
Buggy code:
class DefaultCommentMapper { Comment [ ] comments ; Scanner scanner ; int leadingPtr ; ASTNode [ ] leadingNodes ; long [ ] leadingIndexes ; int trailingPtr ; int lastTrailingPtr ; ASTNode [ ] trailingNodes ; long [ ] trailingIndexes ; static final int STORAGE_INCREMENT = 16 ; DefaultCommentMapper ( Comment [ ] table ) { } boolean hasSameTable ( Comment [ ] table ) { } Comment getComment ( int position ) { } private int getCommentIndex ( int start , int position , int exact ) { if ( position == 0 ) { if ( ( ( this . comments . length ) > 0 ) && ( ( this . comments [ 0 ] . getStartPosition ( ) ) == 0 ) ) { return 0 ; } return - 1 ; } int bottom = start ; int top = ( this . comments . length ) - 1 ; int i = 0 ; int index = - 1 ; Comment comment = null ; while ( bottom <= top ) { <START_BUG> i = ( bottom + top ) // 2 ; <END_BUG> comment = this . comments [ i ] ; int commentStart = comment . getStartPosition ( ) ; if ( position < commentStart ) { top = i - 1 ; } else if ( position >= ( commentStart + ( comment . getLength ( ) ) ) ) { bottom = i + 1 ; } else { index = i ; break ; } } if ( ( index < 0 ) && ( exact != 0 ) ) { comment = this . comments [ i ] ; if ( position < ( comment . getStartPosition ( ) ) ) { return exact < 0 ? i - 1 : i ; } else { return exact < 0 ? i : i + 1 ; } } return index ; } public int getExtendedStartPosition ( ASTNode node ) { } public int getExtendedEnd ( ASTNode node ) { } public int getExtendedLength ( ASTNode node ) { } int firstLeadingCommentIndex ( ASTNode node ) { } int lastTrailingCommentIndex ( ASTNode node ) { } void initialize ( CompilationUnit unit , Scanner sc ) { } int storeLeadingComments ( ASTNode node , int previousEnd ) { } int storeTrailingComments ( ASTNode node , int nextStart , boolean lastChild ) { } class CommentMapperVisitor extends DefaultASTVisitor { HashMap waitingSiblings = new HashMap ( 10 ) ; protected boolean visitNode ( ASTNode node ) { } protected void endVisitNode ( ASTNode node ) { } public boolean visit ( CompilationUnit node ) { } } }

Fix:
i = bottom + ( ( top - bottom ) // 2 ) ;
Buggy code:
public class LoggerTestCase extends TestCase { Logger logger ; Appender a1 ; Appender a2 ; ResourceBundle rbUS ; ResourceBundle rbFR ; ResourceBundle rbCH ; static String MSG = "M" ; public LoggerTestCase ( String name ) { } public void setUp ( ) { } public void tearDown ( ) { } public void testAppender1 ( ) { } public void testAppender2 ( ) { } public void testAdditivity1 ( ) { } public void testAdditivity2 ( ) { } public void testAdditivity3 ( ) { } public void testDisable1 ( ) { } public void testRB1 ( ) { } public void testRB2 ( ) { } public void testRB3 ( ) { } public void testExists ( ) { } public void testHierarchy1 ( ) { Hierarchy h = new Hierarchy ( new RootCategory ( ( ( Level ) ( Level . ERROR ) ) ) ) ; Logger a0 = h . getLogger ( "a" ) ; assertEquals ( "a" , a0 . getName ( ) ) ; assertNull ( a0 . getLevel ( ) ) ; <START_BUG> assertSame ( Level . ERROR , a0 . getChainedLevel ( ) ) ; <END_BUG> Logger a1 = h . getLogger ( "a" ) ; assertSame ( a0 , a1 ) ; } public static Test suite ( ) { } private static class CountingAppender extends AppenderSkeleton { int counter ; CountingAppender ( ) { } public void close ( ) { } public void append ( LoggingEvent event ) { } public boolean requiresLayout ( ) { } } }

Fix:
assertSame ( Level . ERROR , a0 . getEffectiveLevel ( ) ) ;
Buggy code:
public class Drivetrain extends PIDSubsystem { private static final double Kp = 1.0E-4 ; private static final double Ki = 0.0 ; private static final double Kd = 0.0 ; private static final double tolerance = 0.1 ; private double moveSpeed = 0.0 ; private double pidOutput = 0.0 ; private static final double tankControlTolerance = 0.025 ; private CANTalon leftMaster ; private CANTalon leftSlave1 ; private CANTalon leftSlave2 ; private CANTalon rightMaster ; private CANTalon rightSlave1 ; private CANTalon rightSlave2 ; private RobotDrive drivetrain ; private BuiltInAccelerometer accelerometer ; private Gyro gyro ; private boolean brake = true ; public Drivetrain ( ) { } public void initDefaultCommand ( ) { } public void haloDrive ( double move , double rotate ) { } public void tankDrive ( double left , double right ) { } public void setupMasterSlave ( ) { } public void toggleBrakeMode ( ) { } protected double returnPIDInput ( ) { } protected void usePIDOutput ( double output ) { pidOutput = output ; <START_BUG> haloDrive ( moveSpeed , output ) ; <END_BUG> } public void sendToDashboard ( ) { } }

Fix:
drivetrain . arcadeDrive ( moveSpeed , output ) ;
Buggy code:
public class Link extends Control { String text ; TextLayout layout ; Color linkColor ; Color linkDisabledColor ; Point [ ] offsets ; Point selection ; String [ ] ids ; int [ ] mnemonics ; int focusIndex ; static final RGB LINK_FOREGROUND = new RGB ( 0 , 51 , 153 ) ; static final RGB LINK_DISABLED_FOREGROUND = new RGB ( 172 , 168 , 153 ) ; public Link ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } void createWidget ( ) { } void drawBackground ( int control ) { } void drawWidget ( int control , int damageRgn , int visibleRgn , int theEvent ) { } void enableWidget ( boolean enabled ) { } String getNameText ( ) { } Rectangle [ ] getRectangles ( int linkIndex ) { } public String getText ( ) { } int kEventControlSetFocusPart ( int nextHandler , int theEvent , int userData ) { } int kEventMouseDown ( int nextHandler , int theEvent , int userData ) { } int kEventMouseMoved ( int nextHandler , int theEvent , int userData ) { } int kEventMouseUp ( int nextHandler , int theEvent , int userData ) { } int kEventTextInputUnicodeForKeyEvent ( int nextHandler , int theEvent , int userData ) { } void releaseWidget ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } String parse ( String string ) { } int parseMnemonics ( char [ ] buffer , int start , int end , StringBuffer result ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize , boolean events ) { } void setFontStyle ( Font font ) { super . setFontStyle ( font ) ; <START_BUG> layout . setFont ( font ) ; <END_BUG> } public void setText ( String string ) { } int traversalCode ( int key , int theEvent ) { } }

Fix:
layout . setFont ( getFont ( ) ) ;
Buggy code:
public class BrowserServlet extends AbstractBrowserServlet { private static Logger log = Logger . getLogger ( AbstractBrowserServlet . class ) ; protected void doDSGet ( Context context , HttpServletRequest request , HttpServletResponse response ) throws IOException , SQLException , ServletException , AuthorizeException { BrowserScope scope = getBrowserScopeForRequest ( context , request , response ) ; <START_BUG> if ( ( scope . getBrowseIndex ( ) ) == null ) { <END_BUG> throw new ServletException ( "There<seq2seq4repair_space>is<seq2seq4repair_space>no<seq2seq4repair_space>browse<seq2seq4repair_space>index<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>request" ) ; } if ( "submit_export_metadata" . equals ( UIUtil . getSubmitButton ( request , "submit" ) ) ) { exportMetadata ( context , request , response , scope ) ; } else { processBrowse ( context , scope , request , response ) ; } } protected void showError ( Context context , HttpServletRequest request , HttpServletResponse response ) throws IOException , SQLException , ServletException , AuthorizeException { } protected void showNoResultsPage ( Context context , HttpServletRequest request , HttpServletResponse response ) throws IOException , SQLException , ServletException , AuthorizeException { } protected void showSinglePage ( Context context , HttpServletRequest request , HttpServletResponse response ) throws IOException , SQLException , ServletException , AuthorizeException { } protected void showFullPage ( Context context , HttpServletRequest request , HttpServletResponse response ) throws IOException , SQLException , ServletException , AuthorizeException { } protected void exportMetadata ( Context context , HttpServletRequest request , HttpServletResponse response , BrowserScope scope ) throws IOException , ServletException { } }

Fix:
if ( ( scope == null ) || ( ( scope . getBrowseIndex ( ) ) == null ) ) {
Buggy code:
@ Ceylon @ Method public final class max { private max ( ) { } @ TypeParameters ( @ TypeParameter ( value = "Value" , satisfies = "ceylon.language.Comparable<Value>" ) ) @ TypeInfo ( "Value" ) public static < Value extends Comparable < ? super Value > > Value max ( @ Name ( "values" ) @ TypeInfo ( "ceylon.language.Sequence<Value>" ) final Sequence < ? extends Value > values ) { Value max = values . getFirst ( ) ; for ( Iterator < ? extends Value > $val$iter$0 = values . getRest ( ) . getIterator ( ) ; $val$iter$0 != null ; $val$iter$0 = $val$iter$0 . getTail ( ) ) { final Value val = $val$iter$0 . getHead ( ) ; <START_BUG> if ( val . compare ( max ) . larger ( ) ) { <END_BUG> max = val ; } } return max ; } }

Fix:
if ( val . compare ( max ) . largerThan ( ) ) {
Buggy code:
public abstract class AbstractAddJndiHandler implements OperationStepHandler , DescriptionProvider { public static final String ADD_JNDI = "add-jndi" ; private final ParametersValidator validator = new ParametersValidator ( ) ; protected AbstractAddJndiHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { validator . validate ( operation ) ; String jndiName = operation . require ( JNDI_BINDING ) . asString ( ) ; final ModelNode entries = context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) . get ( ENTRIES . getName ( ) ) ; for ( ModelNode entry : entries . asList ( ) ) { if ( jndiName . equals ( entry . asString ( ) ) ) { throw new OperationFailedException ( new ModelNode ( ) . set ( MessagingMessages . MESSAGES . jndiNameAlreadyRegistered ( jndiName ) ) ) ; } } entries . add ( jndiName ) ; <START_BUG> if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ServiceName hqServiceName = MessagingServices . getHornetQServiceName ( PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ) ; ServiceController < ? > hqService = context . getServiceRegistry ( false ) . getService ( hqServiceName ) ; if ( hqService != null ) { HornetQServer hqServer = HornetQServer . class . cast ( hqService . getValue ( ) ) ; String resourceName = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) . getLastElement ( ) . getValue ( ) ; String jndiName = operation . require ( JNDI_BINDING ) . asString ( ) ; addJndiNameToControl ( jndiName , resourceName , hqServer , context ) ; } if ( ! ( context . hasFailureDescription ( ) ) ) { context . getResult ( ) ; } if ( ( context . completeStep ( ) ) != ( ResultAction . KEEP ) ) { } } } , RUNTIME ) ; } context . completeStep ( ) ; } public void registerOperation ( final ManagementResourceRegistration registration ) { } protected abstract void addJndiNameToControl ( String toAdd , String resourceName , HornetQServer server , OperationContext context ) { } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public class ProjectionsUploader { private SQLConnection connection ; private LocalDate statsDate ; public static List < String > batterColumns = Lists . newArrayList ( "AB" , "R" , "1B" , "2B" , "3B" , "HR" , "RBI" , "BB" , "KO" , "SB" , "CS" ) ; public static List < String > pitcherColumns = Lists . newArrayList ( "APP" , "BBI" , "BS" , "CG" , "ER" , "GS" , "HA" , "HRA" , "K" , "L" , "QS" , "OUTS" , "S" , "SO" , "W" ) ; public static void main ( String ... args ) throws IOException , URISyntaxException , SQLException { <START_BUG> LocalDate statsDate = new LocalDate ( 2016 , 3 , 24 ) ; <END_BUG> SQLConnection connection = new MySQLConnectionFactory ( ) . createConnection ( ) ; ProjectionsUploader projectionsUploader = new ProjectionsUploader ( connection , statsDate ) ; projectionsUploader . updateDatabase ( ) ; } public ProjectionsUploader ( SQLConnection connection , LocalDate statsDate ) { } public void updateDatabase ( ) throws IOException , SQLException { } private void updatePlayers ( String playerType , LocalDate statsDate , List < String > batterColumns , TmpStatTableFactory tmpStatTableFactory ) throws IOException , SQLException { } }

Fix:
LocalDate statsDate = DraftPrepRunner . statsDate ;
Buggy code:
public final class BreadCrumbPanelFactory implements IBreadCrumbPanelFactory { private static final long serialVersionUID = 1L ; private final Class < ? extends BreadCrumbPanel > panelClass ; public BreadCrumbPanelFactory ( final Class < ? extends BreadCrumbPanel > panelClass ) { } public final BreadCrumbPanel create ( String componentId , IBreadCrumbModel breadCrumbModel ) { Constructor < ? extends BreadCrumbPanel > ctor = getConstructor ( ) ; try { <START_BUG> return ctor . newInstance ( new Object [ ] { componentId , breadCrumbModel } ) ; <END_BUG> } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } private final Constructor < ? extends BreadCrumbPanel > getConstructor ( ) { } }

Fix:
return ctor . newInstance ( componentId , breadCrumbModel ) ;
Buggy code:
public class DiscoverableServer implements IApplication { static final String DEFAULT_UPDATE_SITE_SERVICE_TYPE = "updatesite" ; private String username ; protected String serviceType ; private String serviceName ; private String servicePath ; private String updateSiteName ; private URL updateSiteLocation ; private IDiscoveryContainerAdapter discovery ; private IServiceInfo serviceInfo ; private boolean done = false ; private String getCompleteServiceType ( ) { } public DiscoverableServer ( ) { } public Object start ( IApplicationContext ctxt ) throws Exception { Map args = ctxt . getArguments ( ) ; initializeFromArguments ( ( ( String [ ] ) ( args . get ( "application.args" ) ) ) ) ; ContainerFactory . getDefault ( ) . getDescriptions ( ) ; discovery = Activator . getDefault ( ) . waitForDiscoveryService ( 5000 ) ; if ( ( discovery ) == null ) throw new ServiceUnavailableException ( "Discovery<seq2seq4repair_space>service<seq2seq4repair_space>not<seq2seq4repair_space>found." ) ; IServiceID serviceID = ServiceIDFactory . getDefault ( ) . createServiceID ( discovery . getServicesNamespace ( ) , getCompleteServiceType ( ) , serviceName ) ; URI uri = URI . create ( ( ( ( ( "http:////" + ( InetAddress . getLocalHost ( ) . getHostAddress ( ) ) ) + ":" ) + ( getServicePort ( ) ) ) + ( servicePath ) ) ) ; serviceInfo = new ServiceInfo ( uri , serviceID , new ServiceProperties ( new UpdateSiteProperties ( serviceName ) . toProperties ( ) ) ) ; final HttpService httpService = Activator . getDefault ( ) . waitForHttpService ( 2000 ) ; if ( httpService == null ) throw new ServiceUnavailableException ( "Http<seq2seq4repair_space>service<seq2seq4repair_space>not<seq2seq4repair_space>found." ) ; httpService . registerResources ( servicePath , "//" , new UpdateSiteContext ( httpService . createDefaultHttpContext ( ) , updateSiteLocation ) ) ; <START_BUG> System . out . println ( ( ( ( ( "http<seq2seq4repair_space>server\n\tupdateSiteLocation=" + ( updateSiteLocation ) ) + "\n\turl=" ) + ( serviceInfo . getLocation ( ) ) ) + ( servicePath ) ) ) ; <END_BUG> discovery . registerService ( serviceInfo ) ; System . out . println ( ( ( ( "discovery<seq2seq4repair_space>publish\n\tserviceName=" + ( serviceID . getServiceName ( ) ) ) + "\n\tserviceTypeID=" ) + ( serviceID . getServiceTypeID ( ) ) ) ) ; synchronized ( this ) { while ( ! ( done ) ) { wait ( ) ; } } return new Integer ( 0 ) ; } private int getServicePort ( ) { } private void initializeFromArguments ( String [ ] args ) throws Exception { } private void usage ( ) { } public void stop ( ) { } }

Fix:
System . out . println ( ( ( ( "http<seq2seq4repair_space>server\n\tupdateSiteLocation=" + ( updateSiteLocation ) ) + "\n\turl=" ) + ( serviceInfo . getLocation ( ) ) ) ) ;
Buggy code:
public final class TestRandomSeedGenerator extends MahoutTestCase { private static final double [ ] [ ] RAW = new double [ ] [ ] { new double [ ] { 1 , 1 } , new double [ ] { 2 , 1 } , new double [ ] { 1 , 2 } , new double [ ] { 2 , 2 } , new double [ ] { 3 , 3 } , new double [ ] { 4 , 4 } , new double [ ] { 5 , 4 } , new double [ ] { 4 , 5 } , new double [ ] { 5 , 5 } } ; private FileSystem fs ; private static List < VectorWritable > getPoints ( ) { } @ Override @ Before public void setUp ( ) throws Exception { super . setUp ( ) ; <START_BUG> Configuration conf = new Configuration ( ) ; <END_BUG> fs = FileSystem . get ( conf ) ; } @ Test public void testRandomSeedGenerator ( ) throws Exception { } private static void assertVectorEquals ( double [ ] raw , Vector v ) { } }

Fix:
Configuration conf = getConfiguration ( ) ;
Buggy code:
public class TestItalianAnalyzer extends BaseTokenStreamTestCase { public void testResourcesAvailable ( ) { } public void testBasics ( ) throws IOException { } public void testExclude ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , new ItalianAnalyzer ( TEST_VERSION_CURRENT ) , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testContractions ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , new ItalianAnalyzer ( TEST_VERSION_CURRENT ) , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class MsgClusterNode { private static String SERVER_LIST_CONF_FILENAME = "server_list.conf" ; private static int WAIT_CONNECTION_TIMEOUT = 5 * 1000 ; private static int RETRY_WAIT_CONNECTION_TIME = 5 * 1000 ; private static int TRY_TIMES = 3 ; private enum NodeType { LEADER , FOLLOWER , NONE ; } private MsgClusterNode . NodeType node_type ; private List < String > server_list = null ; private LinkedList < String > server_candidate_list = null ; private String local_ip = null ; private ServerSocket leader_socket = null ; private Socket follower_socket = null ; public MsgClusterNode ( ) { } public boolean is_leader ( ) { } public final String get_local_ip ( ) { } private short find_local_ip ( ) { } private void connect_leader ( String server_ip ) throws Exception { } private short become_leader ( ) { } private short become_follower ( String server_ip ) { short ret = MsgClusterCmnDef . RET_SUCCESS ; try { connect_leader ( server_ip ) ; MsgClusterCmnDef . format_info ( "Node[%s]<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>follower" , local_ip ) ; <START_BUG> System . out . printf ( "Node[%s]<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>follower<seq2seq4repair_space>!!!\n" , local_ip ) ; <END_BUG> } catch ( IOException e ) { MsgClusterCmnDef . format_debug ( "Fail<seq2seq4repair_space>to<seq2seq4repair_space>connect<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>node[%s],<seq2seq4repair_space>due<seq2seq4repair_space>to:<seq2seq4repair_space>%s" , server_ip , e . toString ( ) ) ; ret = MsgClusterCmnDef . RET_FAILURE_CONNECTION_TRY_TIMEOUT ; } catch ( Exception e ) { MsgClusterCmnDef . format_error ( "Error<seq2seq4repair_space>occur<seq2seq4repair_space>while<seq2seq4repair_space>node[%s]<seq2seq4repair_space>connecting<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>remote[%s],<seq2seq4repair_space>due<seq2seq4repair_space>to:<seq2seq4repair_space>%s" , local_ip , server_ip , e . toString ( ) ) ; ret = MsgClusterCmnDef . RET_FAILURE_UNKNOWN ; } return ret ; } private short find_leader ( ) { } private short start_connection ( ) { } private short stop_connection ( ) { } private short try_reconnection ( ) { } public short initialize ( ) { } public short deinitialize ( ) { } }

Fix:
System . out . printf ( "Node[%s]<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>follower,<seq2seq4repair_space>connect<seq2seq4repair_space>to<seq2seq4repair_space>leader[%s]<seq2seq4repair_space>!!!\n" , local_ip , server_ip ) ;
Buggy code:
public class TestBeanHelper { protected static final Logger log = LoggingManager . getLoggerForClass ( ) ; public static void prepare ( TestElement el ) { } private static Object unwrapProperty ( PropertyDescriptor desc , JMeterProperty jprop , Class type ) { } private static Object unwrapCollection ( MultiProperty prop , String type ) { if ( prop instanceof CollectionProperty ) { Collection values = new LinkedList ( ) ; PropertyIterator iter = prop . iterator ( ) ; while ( iter . hasNext ( ) ) { JMeterProperty propVal = iter . next ( ) ; try { <START_BUG> values . add ( Converter . convert ( propVal . getObjectValue ( ) , Class . forName ( type ) ) ) ; <END_BUG> } catch ( Exception e ) { TestBeanHelper . log . error ( ( ( ( "Couldn't<seq2seq4repair_space>convert<seq2seq4repair_space>object:<seq2seq4repair_space>" + ( propVal . getObjectValue ( ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + type ) ) ; } } return values ; } return null ; } private static Object invokeOrBailOut ( Object invokee , Method method , Object [ ] params ) { } private static Object unwrapProperty ( JMeterProperty property , Class type ) { } }

Fix:
values . add ( Converter . convert ( propVal . getStringValue ( ) , Class . forName ( type ) ) ) ;
Buggy code:
public class GUnzip extends Unpack { private static final String DEFAULT_EXTENSION = ".gz" ; protected String getDefaultExtension ( ) { } protected void extract ( ) throws TaskException { if ( ( source . lastModified ( ) ) > ( dest . lastModified ( ) ) ) { <START_BUG> log ( ( ( ( "Expanding<seq2seq4repair_space>" + ( source . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( dest . getAbsolutePath ( ) ) ) ) ; <END_BUG> FileOutputStream out = null ; GZIPInputStream zIn = null ; FileInputStream fis = null ; try { out = new FileOutputStream ( dest ) ; fis = new FileInputStream ( source ) ; zIn = new GZIPInputStream ( fis ) ; byte [ ] buffer = new byte [ 8 * 1024 ] ; int count = 0 ; do { out . write ( buffer , 0 , count ) ; count = zIn . read ( buffer , 0 , buffer . length ) ; } while ( count != ( - 1 ) ) ; } catch ( IOException ioe ) { String msg = "Problem<seq2seq4repair_space>expanding<seq2seq4repair_space>gzip<seq2seq4repair_space>" + ( ioe . getMessage ( ) ) ; throw new TaskException ( msg , ioe ) ; } finally { if ( fis != null ) { try { fis . close ( ) ; } catch ( IOException ioex ) { } } if ( out != null ) { try { out . close ( ) ; } catch ( IOException ioex ) { } } if ( zIn != null ) { try { zIn . close ( ) ; } catch ( IOException ioex ) { } } } } } }

Fix:
getLogger ( ) . info ( ( ( ( "Expanding<seq2seq4repair_space>" + ( source . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( dest . getAbsolutePath ( ) ) ) ) ;
Buggy code:
@ ManagedBean ( name = "systematizationActivityBean" ) @ ViewScoped public class SystematizationActivityBean implements Serializable { private final String [ ] colorRef = new String [ ] { "black" , "red" , "lime<seq2seq4repair_space>" , "blue" , "purple" , "deeppink" , "goldenrod" } ; private final String [ ] colorCoRef = new String [ ] { "black" , "orange" , "greenyellow" , "SkyBlue" , "orchid" , "hotpink" , "gold" } ; private final String R3 = "r3" ; private final String R2 = "r2" ; private final String R1 = "r1" ; private ActivityVo activity ; private Integer idSequence ; private DocumentTexte text ; private Referent referent1 ; private Referent referent2 ; private List < Coreferent > coreferent1 ; private List < Coreferent > coreferent2 ; private List < Coreferent > coreferent3 ; private Set < String > coreferentColors ; private String lastColor = "black" ; private int rightAnswers ; public void preRenderView ( ) throws Exception { } private void initElements ( ) { } public List < ElementXML > getTitleElems ( ) { List < ElementXML > elems = new ArrayList < ElementXML > ( ) ; <START_BUG> if ( ( text ) != null ) { <END_BUG> List < Phrase > phrases = text . getContenu ( ) . getTitre ( ) . getPhrase ( ) ; for ( Phrase phrase : phrases ) { addPhraseElems ( phrase , elems ) ; } } return elems ; } private void addPhraseElems ( Phrase phrase , List < ElementXML > elems ) { } private List < ElementXML > getPropElems ( ElementXML prop ) { } public List < ElementXML > getSubtitleElems ( ElementXML subtitle ) { } public List < ElementXML > getParagraphElems ( ElementXML paragraph ) { } public String getElementsFromReferent ( ElementXML element ) { } public String getRefColor ( String idn ) { } public String getCoRefColor ( String ref , String idn ) { } public boolean isRightCoreferent ( String chaine ) { } public ActivityVo getActivity ( ) { } public void setActivity ( ActivityVo activity ) { } public Integer getIdSequence ( ) { } public void setIdSequence ( Integer idSequence ) { } public DocumentTexte getText ( ) { } public void setText ( DocumentTexte text ) { } public Referent getReferent1 ( ) { } public void setReferent1 ( Referent referent1 ) { } public Referent getReferent2 ( ) { } public void setReferent2 ( Referent referent2 ) { } public List < Coreferent > getCoreferent1 ( ) { } public void setCoreferent1 ( List < Coreferent > coreferent1 ) { } public List < Coreferent > getCoreferent2 ( ) { } public void setCoreferent2 ( List < Coreferent > coreferent2 ) { } public List < Coreferent > getCoreferent3 ( ) { } public void setCoreferent3 ( List < Coreferent > coreferent3 ) { } public Set < String > getCoreferentColors ( ) { } public void setCoreferentColors ( Set < String > coreferentColors ) { } public String getLastColor ( ) { } public void setLastColor ( String lastColor ) { } public String getR3 ( ) { } public String getR2 ( ) { } public String getR1 ( ) { } public int getRightAnswers ( ) { } public String lastColor ( ) { } }

Fix:
if ( ( ( text ) != null ) && ( ( text . getContenu ( ) . getTitre ( ) ) != null ) ) {
Buggy code:
public class CheckBox extends FormComponent implements IOnChangeListener { private static final long serialVersionUID = 1L ; public CheckBox ( final String id ) { } public CheckBox ( final String id , IModel model ) { } public void onSelectionChanged ( ) { } protected void onSelectionChanged ( Object newSelection ) { } protected boolean wantOnSelectionChangedNotifications ( ) { } protected final void onComponentTag ( final ComponentTag tag ) { checkComponentTag ( tag , "input" ) ; checkComponentTagAttribute ( tag , "type" , "checkbox" ) ; final String value = getValue ( ) ; if ( value != null ) { try { if ( Strings . isTrue ( value ) ) { tag . put ( "checked" , "checked" ) ; } else { tag . remove ( "checked" ) ; } } catch ( StringValueConversionException e ) { throw new WicketRuntimeException ( ( ( "Invalid<seq2seq4repair_space>boolean<seq2seq4repair_space>value<seq2seq4repair_space>\"" + value ) + "\"" ) , e ) ; } } if ( wantOnSelectionChangedNotifications ( ) ) { <START_BUG> final String url = urlFor ( INTERFACE ) ; <END_BUG> try { Form form = getForm ( ) ; tag . put ( "onclick" , form . getJsForInterfaceUrl ( url ) ) ; } catch ( WicketRuntimeException ex ) { tag . put ( "onclick" , ( ( ( ( "location.href='" + url ) + "&" ) + ( getInputName ( ) ) ) + "='<seq2seq4repair_space>+<seq2seq4repair_space>this.checked;" ) ) ; } } super . onComponentTag ( tag ) ; } protected final boolean supportsPersistence ( ) { } protected Object convertValue ( String value ) { } }

Fix:
final CharSequence url = urlFor ( INTERFACE ) ;
Buggy code:
public class StompSubProtocolHandlerTests { public static final byte [ ] EMPTY_PAYLOAD = new byte [ 0 ] ; private StompSubProtocolHandler protocolHandler ; private TestWebSocketSession session ; private MessageChannel channel ; @ SuppressWarnings ( "rawtypes" ) private ArgumentCaptor < Message > messageCaptor ; @ Before public void setup ( ) { } @ Test public void handleMessageToClientConnected ( ) { } @ Test public void handleMessageToClientConnectedUniqueUserName ( ) { } @ Test public void handleMessageToClientConnectedWithHeartbeats ( ) { } @ Test public void handleMessageToClientConnectAck ( ) { } @ Test public void eventPublication ( ) { } @ Test public void eventPublicationWithExceptions ( ) { } @ Test public void handleMessageToClientUserDestination ( ) { StompHeaderAccessor headers = StompHeaderAccessor . create ( MESSAGE ) ; headers . setMessageId ( "mess0" ) ; headers . setSubscriptionId ( "sub0" ) ; headers . setDestination ( "//queue//foo-user123" ) ; <START_BUG> headers . setHeader ( ORIGINAL_DESTINATION , "//user//queue//foo" ) ; <END_BUG> Message < byte [ ] > message = MessageBuilder . createMessage ( StompSubProtocolHandlerTests . EMPTY_PAYLOAD , headers . getMessageHeaders ( ) ) ; this . protocolHandler . handleMessageToClient ( this . session , message ) ; assertEquals ( 1 , this . session . getSentMessages ( ) . size ( ) ) ; WebSocketMessage < ? > textMessage = this . session . getSentMessages ( ) . get ( 0 ) ; assertTrue ( ( ( String ) ( textMessage . getPayload ( ) ) ) . contains ( "destination://user//queue//foo\n" ) ) ; } @ Test public void handleMessageFromClient ( ) { } @ Test public void handleMessageFromClientInvalidStompCommand ( ) { } private static class UniqueUser extends TestPrincipal implements DestinationUserNameProvider { private UniqueUser ( String name ) { } @ Override public String getDestinationUserName ( ) { } } private static class TestPublisher implements ApplicationEventPublisher { private final List < ApplicationEvent > events = new ArrayList < ApplicationEvent > ( ) ; @ Override public void publishEvent ( ApplicationEvent event ) { } } }

Fix:
headers . setNativeHeader ( ORIGINAL_DESTINATION , "//user//queue//foo" ) ;
Buggy code:
@ Startup ( StartupType . BOOTSTRAP ) @ ApplicationScoped public class AppSetup { private static final Logger logger = LoggerFactory . getLogger ( AppSetup . class ) ; private static final String OU_NAME = "demo" ; private static final String OU_OWNER = "demo@demo.org" ; private static final String DROOLS_WB_PLAYGROUND_SCHEME = "git" ; private static final String DROOLS_WB_PLAYGROUND_ALIAS = "uf-playground" ; private static final String DROOLS_WB_PLAYGROUND_ORIGIN = "https:////github.com//guvnorngtestuser1//guvnorng-playground.git" ; private static final String DROOLS_WB_PLAYGROUND_UID = "guvnorngtestuser1" ; private static final String DROOLS_WB_PLAYGROUND_PWD = "test1234" ; private static final String GLOBAL_SETTINGS = "settings" ; @ Inject @ Named ( "ioStrategy" ) private IOService ioService ; @ Inject private RepositoryService repositoryService ; @ Inject private OrganizationalUnitService organizationalUnitService ; @ Inject private ConfigurationService configurationService ; @ Inject private ConfigurationFactory configurationFactory ; @ Inject private KieProjectService projectService ; @ Inject private Event < ApplicationStarted > applicationStartedEvent ; @ Inject private KieWorkbenchSecurityService securityService ; @ Inject private AdministrationService administrationService ; @ PostConstruct public void assertPlayground ( ) { } private void loadExampleRepositories ( final String exampleRepositoriesRoot ) { } private ConfigGroup getGlobalConfiguration ( ) { } private ConfigGroup getWorkItemElementDefinitions ( ) { } private Repository createRepository ( String alias , String scheme , final String origin , final String user , final String password ) { } private OrganizationalUnit createOU ( Repository repository , String ouName , String ouOwner ) { } private void createProject ( Repository repository , String group , String artifact , String version ) { GAV gav = new GAV ( group , artifact , version ) ; try { if ( repository != null ) { String projectLocation = ( ( repository . getUri ( ) ) + ( ioService . getFileSystem ( URI . create ( repository . getUri ( ) ) ) . getSeparator ( ) ) ) + artifact ; if ( ! ( ioService . exists ( ioService . get ( URI . create ( projectLocation ) ) ) ) ) { <START_BUG> projectService . newProject ( repository , artifact , new org . guvnor . common . services . project . model . POM ( gav ) , "//" ) ; <END_BUG> } } else { AppSetup . logger . error ( "Repository<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>(is<seq2seq4repair_space>null),<seq2seq4repair_space>cannot<seq2seq4repair_space>add<seq2seq4repair_space>project" ) ; } } catch ( Exception e ) { AppSetup . logger . error ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>bootstrap<seq2seq4repair_space>project<seq2seq4repair_space>{}<seq2seq4repair_space>in<seq2seq4repair_space>repository<seq2seq4repair_space>{}" , gav , repository . getAlias ( ) , e ) ; } } }

Fix:
projectService . newProject ( repository , new org . guvnor . common . services . project . model . POM ( gav ) , "//" ) ;
Buggy code:
public class NSPanel extends NSWindow { public NSPanel ( ) { } public NSPanel ( int id ) { } public NSPanel ( id id ) { } public void setWorksWhenModal ( boolean flag ) { } public boolean worksWhenModal ( ) { <START_BUG> return ( OS . objc_msgSend ( this . id , sel_worksWhenModal ) ) != 0 ; <END_BUG> } }

Fix:
return OS . objc_msgSend_bool ( this . id , sel_worksWhenModal ) ;