nus-yam/ex-repair huggingface dataset:
Buggy code:
public class P4Change extends P4Base { protected String emptyChangeList = null ; protected String description = "AutoSubmit<seq2seq4repair_space>By<seq2seq4repair_space>Ant" ; public void setDescription ( String desc ) { } public String getEmptyChangeList ( ) throws TaskException { } public void execute ( ) throws TaskException { if ( ( emptyChangeList ) == null ) emptyChangeList = getEmptyChangeList ( ) ; final Project myProj = project ; P4Handler handler = new P4HandlerAdapter ( ) { public void process ( String line ) { if ( util . match ( "//Change//" , line ) ) { line = util . substitute ( "s//[^0-9]////g" , line ) ; int changenumber = Integer . parseInt ( line ) ; log ( ( "Change<seq2seq4repair_space>Number<seq2seq4repair_space>is<seq2seq4repair_space>" + changenumber ) , MSG_INFO ) ; <START_BUG> myProj . setProperty ( "p4.change" , ( "" + changenumber ) ) ; <END_BUG> } else if ( util . match ( "//error//" , line ) ) { throw new TaskException ( "Perforce<seq2seq4repair_space>Error,<seq2seq4repair_space>check<seq2seq4repair_space>client<seq2seq4repair_space>settings<seq2seq4repair_space>and//or<seq2seq4repair_space>server" ) ; } } } ; handler . setOutput ( emptyChangeList ) ; execP4Command ( "change<seq2seq4repair_space>-i" , handler ) ; } protected String backslash ( String value ) { } }

Fix:
setProperty ( "p4.change" , ( "" + changenumber ) ) ;
Buggy code:
public class Button extends FormComponent { private boolean defaultFormProcessing = true ; public Button ( String id ) { } public Button ( final String id , final IModel object ) { } public final boolean getDefaultFormProcessing ( ) { } public final Button setDefaultFormProcessing ( boolean defaultFormProcessing ) { } public void updateModel ( ) { } protected String getOnClickScript ( ) { } protected void onComponentTag ( final ComponentTag tag ) { final ValueMap attributes = tag . getAttributes ( ) ; super . onComponentTag ( tag ) ; try { String value = getValue ( ) ; <START_BUG> if ( value != null ) { <END_BUG> tag . put ( "value" , value ) ; } } catch ( Exception e ) { } final String onClickJavaScript = getOnClickScript ( ) ; if ( onClickJavaScript != null ) { tag . put ( "onclick" , onClickJavaScript ) ; } } protected void onSubmit ( ) { } }

Fix:
if ( ( value != null ) && ( "" . equals ( value ) ) ) {
Buggy code:
public class TestSpansAdvanced extends LuceneTestCase { protected Directory mDirectory ; protected IndexReader reader ; protected IndexSearcher searcher ; private static final String FIELD_ID = "ID" ; protected static final String FIELD_TEXT = "TEXT" ; @ Override public void setUp ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } protected void addDocument ( final RandomIndexWriter writer , final String id , final String text ) throws IOException { } public void testBooleanQueryWithSpanQueries ( ) throws IOException { } protected void doTestBooleanQueryWithSpanQueries ( IndexSearcher s , final float expectedScore ) throws IOException { } protected static void assertHits ( Searcher s , Query query , final String description , final String [ ] expectedIds , final float [ ] expectedScores ) throws IOException { <START_BUG> QueryUtils . check ( query , s ) ; <END_BUG> final float tolerance = 1.0E-5F ; TopDocs topdocs = s . search ( query , null , 10000 ) ; assertEquals ( expectedIds . length , topdocs . totalHits ) ; for ( int i = 0 ; i < ( topdocs . totalHits ) ; i ++ ) { int id = topdocs . scoreDocs [ i ] . doc ; float score = topdocs . scoreDocs [ i ] . score ; Document doc = s . doc ( id ) ; assertEquals ( expectedIds [ i ] , doc . get ( TestSpansAdvanced . FIELD_ID ) ) ; boolean scoreEq = ( Math . abs ( ( ( expectedScores [ i ] ) - score ) ) ) < tolerance ; if ( ! scoreEq ) { System . out . println ( ( ( ( ( i + "<seq2seq4repair_space>warning,<seq2seq4repair_space>expected<seq2seq4repair_space>score:<seq2seq4repair_space>" ) + ( expectedScores [ i ] ) ) + ",<seq2seq4repair_space>actual<seq2seq4repair_space>" ) + score ) ) ; System . out . println ( s . explain ( query , id ) ) ; } assertEquals ( expectedScores [ i ] , score , tolerance ) ; assertEquals ( s . explain ( query , id ) . getValue ( ) , score , tolerance ) ; } } }

Fix:
QueryUtils . check ( random , query , s ) ;
Buggy code:
public final class TestDistributedLanczosSolverCLI extends MahoutTestCase { @ Test public void testDistributedLanczosSolverCLI ( ) throws Exception { Path testData = getTestTempDirPath ( "testdata" ) ; DistributedRowMatrix corpus = new TestDistributedRowMatrix ( ) . randomDistributedMatrix ( 500 , 450 , 500 , 10 , 10.0 , true , testData . toString ( ) ) ; corpus . setConf ( new Configuration ( ) ) ; Path output = getTestTempDirPath ( "output" ) ; Path tmp = getTestTempDirPath ( "tmp" ) ; String [ ] args = new String [ ] { "-i" , new Path ( testData , "distMatrix" ) . toString ( ) , "-o" , output . toString ( ) , "--tempDir" , tmp . toString ( ) , "--numRows" , "500" , "--numCols" , "500" , "--rank" , "10" , "--symmetric" , "true" } ; new DistributedLanczosSolver ( ) . new DistributedLanczosSolverJob ( ) . run ( args ) ; Path rawEigenvectors = new Path ( output , DistributedLanczosSolver . RAW_EIGENVECTORS ) ; Matrix eigenVectors = new org . apache . mahout . math . DenseMatrix ( 10 , corpus . numCols ( ) ) ; Configuration conf = new Configuration ( ) ; int i = 0 ; for ( VectorWritable value : new org . apache . mahout . common . iterator . sequencefile . SequenceFileValueIterable < VectorWritable > ( rawEigenvectors , conf ) ) { Vector v = value . get ( ) ; eigenVectors . assignRow ( i , v ) ; i ++ ; } <START_BUG> assertEquals ( "number<seq2seq4repair_space>of<seq2seq4repair_space>eigenvectors" , 9 , i ) ; <END_BUG> } @ Test public void testDistributedLanczosSolverEVJCLI ( ) throws Exception { } }

Fix:
assertEquals ( "number<seq2seq4repair_space>of<seq2seq4repair_space>eigenvectors" , 10 , i ) ;
Buggy code:
class ShowtimeHTTP { private String ipAddress ; private String port ; public ShowtimeHTTP ( ) { } public void sendAction ( String action ) { } public void search ( String text ) { <START_BUG> String urlString = ( ( ( ( "http:////" + ( ipAddress ) ) + ":" ) + ( port ) ) + "//showtime//open?url=search:" ) + text ; <END_BUG> sendURL ( urlString ) ; } private void sendURL ( final String urlString ) { } public String getIpAddress ( ) { } public void setIpAddress ( String ipAddress ) { } public String getPort ( ) { } public void setPort ( String port ) { } }

Fix:
String urlString = ( ( ( ( "http:////" + ( ipAddress ) ) + ":" ) + ( port ) ) + "//showtime//open?url=search:" ) + ( text . replace ( "<seq2seq4repair_space>" , "+" ) ) ;
Buggy code:
public class RackUnawareStrategy extends AbstractReplicationStrategy { public RackUnawareStrategy ( TokenMetadata tokenMetadata , IEndPointSnitch snitch ) { } public ArrayList < InetAddress > getNaturalEndpoints ( Token token , TokenMetadata metadata , String table ) { int replicas = DatabaseDescriptor . getReplicationFactor ( table ) ; List < Token > tokens = metadata . sortedTokens ( ) ; ArrayList < InetAddress > endpoints = new ArrayList < InetAddress > ( replicas ) ; if ( tokens . isEmpty ( ) ) return endpoints ; Iterator < Token > iter = TokenMetadata . ringIterator ( tokens , token ) ; while ( ( ( endpoints . size ( ) ) < replicas ) && ( iter . hasNext ( ) ) ) { <START_BUG> endpoints . add ( metadata . getEndPoint ( iter . next ( ) ) ) ; <END_BUG> } return endpoints ; } }

Fix:
endpoints . add ( metadata . getEndpoint ( iter . next ( ) ) ) ;
Buggy code:
public class MovieFragment extends AbstractBaseFragment implements MoviePresenter . MovieView { private MoviePresenter presenter ; private GridView gridView ; List < Movie > movies = new ArrayList < > ( ) ; BaseAdapter movieAdapter ; @ Override public void onCreatePresenter ( ) { } @ Override public int getLayoutId ( ) { } @ Override public void initView ( ) { gridView = ( ( GridView ) ( getView ( ) . findViewById ( gridview ) ) ) ; movieAdapter = new BaseAdapter ( ) { @ Override public int getCount ( ) { return movies . size ( ) ; } @ Override public Object getItem ( int position ) { return movies . get ( position ) ; } @ Override public long getItemId ( int position ) { return position ; } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { ViewHolder holder ; if ( convertView == null ) { convertView = LayoutInflater . from ( getActivity ( ) ) . inflate ( layout_movie_item , null ) ; holder = new ViewHolder ( ) ; holder . imageView = ( ( ImageView ) ( convertView . findViewById ( image ) ) ) ; holder . textView = ( ( TextView ) ( convertView . findViewById ( text ) ) ) ; convertView . setTag ( holder ) ; } else { holder = ( ( ViewHolder ) ( convertView . getTag ( ) ) ) ; } Movie movie = ( ( Movie ) ( getItem ( position ) ) ) ; <START_BUG> Picasso . with ( getActivity ( ) ) . load ( movie . imageUrl ) . into ( holder . imageView ) ; <END_BUG> holder . textView . setText ( movie . name ) ; return convertView ; } class ViewHolder { ImageView imageView ; TextView textView ; } } ; gridView . setAdapter ( movieAdapter ) ; } @ Override public void registerListener ( ) { } @ Override public void initBusiness ( ) { } @ Override public MoviePresenter getPresenter ( ) { } @ Override public void showMovieList ( final List < Movie > movies ) { } }

Fix:
Picasso . with ( getActivity ( ) ) . load ( movie . imageUrl ) . centerCrop ( ) . resize ( 200 , 280 ) . into ( holder . imageView ) ;
Buggy code:
@ RunWith ( Parameterized . class ) public class FullScaleIT { private final boolean useOneStageGroupPerStage ; Logger logger = LoggerFactory . getLogger ( FullScaleIT . class ) ; @ Parameters ( name = "useOneStageGroupPerStage={0}" ) public static Iterable < Object [ ] > testParameters ( ) { } public FullScaleIT ( boolean useOneStageGroupPerStage ) { } MongoConfiguration mongoConfiguration ; MongoConnector mongoConnector ; private Main core ; @ Before public void setUp ( ) throws Exception { mongoConfiguration = new MongoConfiguration ( ) ; mongoConfiguration . setNamespace ( "hydra-test-FullScaleIT" ) ; mongoConnector = new MongoConnector ( mongoConfiguration ) ; mongoConnector . connect ( ) ; mongoConnector . getDB ( ) . dropDatabase ( ) ; mongoConnector = new MongoConnector ( mongoConfiguration ) ; mongoConnector . connect ( ) ; CoreMapConfiguration coreConfiguration = new CoreMapConfiguration ( mongoConfiguration , new MapConfiguration ( ) ) ; <START_BUG> coreConfiguration . setDefaultJvmParameters ( "-Xms4m<seq2seq4repair_space>-Xmx16m" ) ; <END_BUG> core = new Main ( coreConfiguration ) ; } @ After public void tearDown ( ) throws Exception { } @ Test ( timeout = 60000 ) public void testAPrimitivePipelineWorks ( ) throws Exception { } private Set < String > createDocuments ( int numDocs ) throws UnknownHostException { } private void createPrimitivePipeline ( ) throws Exception { } private MongoDocumentIO buildMongoDocumentIO ( MongoConfiguration mongoConfiguration ) throws UnknownHostException { } private void uploadJar ( String jarFileName ) { } }

Fix:
coreConfiguration . setDefaultJvmParameters ( "-Xms4m<seq2seq4repair_space>-Xmx64m" ) ;
Buggy code:
public class JUTJavaBean2JavaFXBean { private class CustomType { } protected class JavaBean { private String readOnlyString ; private int readOnlyInt ; private JUTJavaBean2JavaFXBean . CustomType readOnlyCustomType ; private String readWriteString ; private int readWriteInt ; private JUTJavaBean2JavaFXBean . CustomType readWriteCustomType ; private JavaBean ( String string , int primitiveInt , JUTJavaBean2JavaFXBean . CustomType customType ) { } public String getReadOnlyString ( ) { } private int getReadOnlyInt ( ) { } private JUTJavaBean2JavaFXBean . CustomType getReadOnlyCustomType ( ) { } private String getReadWriteString ( ) { } private void setReadWriteString ( String readWriteString ) { } private int getReadWriteInt ( ) { } private void setReadWriteInt ( int readWriteInt ) { } private JUTJavaBean2JavaFXBean . CustomType getReadWriteCustomType ( ) { } private void setReadWriteCustomType ( JUTJavaBean2JavaFXBean . CustomType readWriteCustomType ) { } } private class JavaFXBean { private JUTJavaBean2JavaFXBean . JavaBean javaBean ; private ReadOnlyStringProperty readOnlyStringProperty ; private ReadOnlyIntegerProperty readOnlyIntegerProperty ; private ReadOnlyObjectProperty < JUTJavaBean2JavaFXBean . CustomType > readOnlyCustomTypeProperty ; private StringProperty stringProperty ; private IntegerProperty integerProperty ; private ObjectProperty < JUTJavaBean2JavaFXBean . CustomType > customTypeProperty ; private JavaFXBean ( JUTJavaBean2JavaFXBean . JavaBean javaBean ) { } private ReadOnlyStringProperty getReadOnlyStringProperty ( ) { } private ReadOnlyIntegerProperty getReadOnlyIntegerProperty ( ) { } private ReadOnlyObjectProperty < JUTJavaBean2JavaFXBean . CustomType > getReadOnlyCustomTypeProperty ( ) { } private StringProperty getStringProperty ( ) { } private IntegerProperty getIntegerProperty ( ) { } @ SuppressWarnings ( "unchecked" ) private ObjectProperty < JUTJavaBean2JavaFXBean . CustomType > getCustomTypeProperty ( ) { } } @ Test public void readOnlyString ( ) { } @ Test public void readOnlyStringAfterModification ( ) { String string = "Nordwijk<seq2seq4repair_space>an<seq2seq4repair_space>Zee" ; JUTJavaBean2JavaFXBean . JavaBean javaBean = new JUTJavaBean2JavaFXBean . JavaBean ( string , 0 , new JUTJavaBean2JavaFXBean . CustomType ( ) ) ; JUTJavaBean2JavaFXBean . JavaFXBean javaFXBean = new JUTJavaBean2JavaFXBean . JavaFXBean ( javaBean ) ; <START_BUG> string += "<seq2seq4repair_space>bei<seq2seq4repair_space>schönem<seq2seq4repair_space>Wetter" ; <END_BUG> javaBean . readOnlyString = string ; assertThat ( javaFXBean . getReadOnlyStringProperty ( ) . get ( ) , is ( string ) ) ; } No newline ; at end ; of file ; }

Fix:
string += "<seq2seq4repair_space>bei<seq2seq4repair_space>schoenem<seq2seq4repair_space>Wetter" ;
Buggy code:
public class HeaderItemList { private List list ; public HeaderItemList ( ) { } public HeaderItemList ( List v ) { } public void insertElementAt ( HeaderItem item , int index ) { } public void remove ( HeaderItem item ) { } public int indexOf ( HeaderItem item ) { } public List getVector ( ) { } public void add ( HeaderItem item ) { } public void replace ( int index , HeaderItem item ) { if ( ( index < ( list . size ( ) ) ) && ( index >= 0 ) ) { list . remove ( index ) ; <START_BUG> list . set ( index , item ) ; <END_BUG> } } public void uidRemove ( Object uid ) { } public HeaderItem uidGet ( Object uid ) { } public HeaderItem get ( int index ) { } public int count ( ) { } public void clear ( ) { } }

Fix:
list . add ( index , item ) ;
Buggy code:
public class ProgressMonitorJobsDialog extends ProgressMonitorDialog { private NewProgressViewer viewer ; private int viewerHeight = - 1 ; Composite viewerComposite ; private Button detailsButton ; private long watchTime = - 1 ; protected boolean alreadyClosed = false ; private IProgressMonitor wrapperedMonitor ; protected boolean enableDetailsButton = false ; public ProgressMonitorJobsDialog ( Shell parent ) { } protected Control createDialogArea ( Composite parent ) { } void handleDetailsButtonSelect ( ) { Shell shell = getShell ( ) ; Point shellSize = shell . getSize ( ) ; Composite composite = ( ( Composite ) ( getDialogArea ( ) ) ) ; if ( ( viewer ) != null ) { viewer . getControl ( ) . dispose ( ) ; viewer = null ; composite . layout ( ) ; shell . setSize ( shellSize . x , ( ( shellSize . y ) - ( viewerHeight ) ) ) ; detailsButton . setText ( ProgressMonitorJobsDialog_DetailsTitle ) ; } else { if ( ( ProgressManager . getInstance ( ) . getRootElements ( DEBUG_SHOW_SYSTEM_JOBS ) . length ) == 0 ) { detailsButton . setEnabled ( false ) ; return ; } viewer = new NewProgressViewer ( viewerComposite , ( ( ( ( SWT . MULTI ) | ( SWT . H_SCROLL ) ) | ( SWT . V_SCROLL ) ) | ( SWT . BORDER ) ) ) ; viewer . setUseHashlookup ( true ) ; viewer . setSorter ( new ViewerSorter ( ) { public int compare ( Viewer testViewer , Object e1 , Object e2 ) { return ( ( Comparable ) ( e1 ) ) . compareTo ( e2 ) ; } } ) ; <START_BUG> ProgressTreeContentProvider provider = new ProgressTreeContentProvider ( viewer , Policy . DEBUG_SHOW_SYSTEM_JOBS ) ; <END_BUG> viewer . setContentProvider ( provider ) ; viewer . setInput ( provider ) ; viewer . setLabelProvider ( new ProgressLabelProvider ( ) ) ; GridData viewerData = new GridData ( GridData . FILL_BOTH ) ; viewer . getControl ( ) . setLayoutData ( viewerData ) ; GridData viewerCompositeData = ( ( GridData ) ( viewerComposite . getLayoutData ( ) ) ) ; viewerCompositeData . heightHint = convertHeightInCharsToPixels ( 10 ) ; viewerComposite . layout ( true ) ; viewer . getControl ( ) . setVisible ( true ) ; viewerHeight = viewerComposite . computeTrim ( 0 , 0 , 0 , viewerCompositeData . heightHint ) . height ; detailsButton . setText ( ProgressMonitorJobsDialog_HideTitle ) ; shell . setSize ( shellSize . x , ( ( shellSize . y ) + ( viewerHeight ) ) ) ; } } protected void createButtonsForButtonBar ( Composite parent ) { } protected void createSpacer ( Composite parent ) { } protected void createDetailsButton ( Composite parent ) { } protected Control createButtonBar ( Composite parent ) { } protected void clearCursors ( ) { } protected void updateForSetBlocked ( IStatus reason ) { } public void run ( boolean fork , boolean cancelable , IRunnableWithProgress runnable ) throws InterruptedException , InvocationTargetException { } protected void enableDetails ( boolean enableState ) { } public void watchTicks ( ) { } public void createWrapperedMonitor ( ) { } public IProgressMonitor getProgressMonitor ( ) { } public boolean close ( ) { } }

Fix:
ProgressTreeContentProvider provider = new ProgressTreeContentProvider ( viewer , true ) ;
Buggy code:
public final class IndexUpgrader { private static void printUsage ( ) { } @ SuppressWarnings ( "deprecation" ) public static void main ( String [ ] args ) throws IOException { } static IndexUpgrader parseArgs ( String [ ] args ) throws IOException { } private final Directory dir ; private final IndexWriterConfig iwc ; private final boolean deletePriorCommits ; public IndexUpgrader ( Directory dir , Version matchVersion ) { } public IndexUpgrader ( Directory dir , Version matchVersion , PrintStream infoStream , boolean deletePriorCommits ) { } public IndexUpgrader ( Directory dir , IndexWriterConfig iwc , boolean deletePriorCommits ) { } public void upgrade ( ) throws IOException { if ( ! ( DirectoryReader . indexExists ( dir ) ) ) { throw new IndexNotFoundException ( dir . toString ( ) ) ; } if ( ! ( deletePriorCommits ) ) { final Collection < IndexCommit > commits = DirectoryReader . listCommits ( dir ) ; if ( ( commits . size ( ) ) > 1 ) { throw new IllegalArgumentException ( ( "This<seq2seq4repair_space>tool<seq2seq4repair_space>was<seq2seq4repair_space>invoked<seq2seq4repair_space>to<seq2seq4repair_space>not<seq2seq4repair_space>delete<seq2seq4repair_space>prior<seq2seq4repair_space>commit<seq2seq4repair_space>points,<seq2seq4repair_space>but<seq2seq4repair_space>the<seq2seq4repair_space>following<seq2seq4repair_space>commits<seq2seq4repair_space>were<seq2seq4repair_space>found:<seq2seq4repair_space>" + commits ) ) ; } } final IndexWriterConfig c = iwc . clone ( ) ; c . setMergePolicy ( new UpgradeIndexMergePolicy ( c . getMergePolicy ( ) ) ) ; c . setIndexDeletionPolicy ( new KeepOnlyLastCommitDeletionPolicy ( ) ) ; final IndexWriter w = new IndexWriter ( dir , c ) ; try { InfoStream infoStream = c . getInfoStream ( ) ; if ( infoStream . isEnabled ( "IndexUpgrader" ) ) { infoStream . message ( "IndexUpgrader" , ( ( ( ( ( ( "Upgrading<seq2seq4repair_space>all<seq2seq4repair_space>pre-" + ( Constants . LUCENE_MAIN_VERSION ) ) + "<seq2seq4repair_space>segments<seq2seq4repair_space>of<seq2seq4repair_space>index<seq2seq4repair_space>directory<seq2seq4repair_space>'" ) + ( dir ) ) + "'<seq2seq4repair_space>to<seq2seq4repair_space>version<seq2seq4repair_space>" ) + ( Constants . LUCENE_MAIN_VERSION ) ) + "..." ) ) ; } w . forceMerge ( 1 ) ; if ( infoStream . isEnabled ( "IndexUpgrader" ) ) { infoStream . message ( "IndexUpgrader" , ( "All<seq2seq4repair_space>segments<seq2seq4repair_space>upgraded<seq2seq4repair_space>to<seq2seq4repair_space>version<seq2seq4repair_space>" + ( Constants . LUCENE_MAIN_VERSION ) ) ) ; } } finally { <START_BUG> w . close ( ) ; <END_BUG> } } }

Fix:
w . shutdown ( ) ;
Buggy code:
public class MixedParamUrlCodingStrategy extends BookmarkablePageRequestTargetUrlCodingStrategy { private final String [ ] parameterNames ; public MixedParamUrlCodingStrategy ( String mountPath , Class bookmarkablePageClass , String pageMapName , String [ ] parameterNames ) { } public MixedParamUrlCodingStrategy ( String mountPath , Class bookmarkablePageClass , String [ ] parameterNames ) { } protected void appendParameters ( AppendingStringBuffer url , Map parameters ) { } protected ValueMap decodeParameters ( String urlFragment , Map urlParameters ) { PageParameters params = new PageParameters ( ) ; params . putAll ( urlParameters ) ; String urlPath = urlFragment ; if ( urlPath . startsWith ( "//" ) ) { urlPath = urlPath . substring ( 1 ) ; } if ( ( urlPath . length ( ) ) > 0 ) { String [ ] pathParts = urlPath . split ( "//" ) ; if ( ( pathParts . length ) > ( parameterNames . length ) ) { throw new IllegalArgumentException ( "Too<seq2seq4repair_space>many<seq2seq4repair_space>path<seq2seq4repair_space>parts,<seq2seq4repair_space>please<seq2seq4repair_space>provide<seq2seq4repair_space>sufficient<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>path<seq2seq4repair_space>parameter<seq2seq4repair_space>names" ) ; } for ( int i = 0 ; i < ( pathParts . length ) ; i ++ ) { <START_BUG> params . put ( parameterNames [ i ] , pathParts [ i ] ) ; <END_BUG> } } return params ; } }

Fix:
params . put ( parameterNames [ i ] , urlDecode ( pathParts [ i ] ) ) ;
Buggy code:
public class ItemBlockOre extends ItemBlockArtifice { public ItemBlockOre ( Block block ) { } @ Override public String getUnlocalizedName ( ItemStack stack ) { if ( ( stack . getItemDamage ( ) ) >= ( rockBlockNames . length ) ) <START_BUG> Block . getBlockFromItem ( stack . getItem ( ) ) . getUnlocalizedName ( ) ; <END_BUG> return ( ( Block . getBlockFromItem ( stack . getItem ( ) ) . getUnlocalizedName ( ) ) + "." ) + ( ArtificeBlocks . rockBlockNames [ stack . getItemDamage ( ) ] ) ; } }

Fix:
return Block . getBlockFromItem ( stack . getItem ( ) ) . getUnlocalizedName ( ) ;
Buggy code:
@ Version ( AsVersion . V_7_1_3_Final ) public class SimpleMixedDomain_7_1_3_Final_TestCase extends SimpleMixedDomainTest { @ BeforeClass public static void beforeClass ( ) { <START_BUG> MixedDomainTestSuite . getSupport ( SimpleMixedDomain_7_1_3_Final_TestCase . class ) ; <END_BUG> } }

Fix:
MixedDomainTestSuite . getSupport ( MixedDomain_7_1_3_Final_TestSuite . class ) ;
Buggy code:
class Node { public long mData ; public Node next ; public Node previous ; public Node ( long data ) { } public void displayNode ( ) { <START_BUG> System . out . print ( ( ( objectData ) + "<seq2seq4repair_space>" ) ) ; <END_BUG> } }

Fix:
System . out . print ( ( ( mData ) + "<seq2seq4repair_space>" ) ) ;
Buggy code:
public class CustomFontTab extends GraphicsTab { String text = GraphicsExample . getResourceString ( "SWT" ) ; GraphicsBackground fontForeground ; Combo fontFaceCb ; Combo fontStyleCb ; Spinner fontPointSpinner ; Button colorButton ; ArrayList fontNames ; int [ ] styleValues ; String [ ] fontStyles ; Menu menu ; public CustomFontTab ( GraphicsExample example ) { } public String getCategory ( ) { } public String getText ( ) { } public String getDescription ( ) { } public void dispose ( ) { } public void createControlPanel ( Composite parent ) { } public void paint ( GC gc , int width , int height ) { if ( ! ( example . checkAdvancedGraphics ( ) ) ) return ; Device device = gc . getDevice ( ) ; String fontFace = ( ( String ) ( fontNames . get ( fontFaceCb . getSelectionIndex ( ) ) ) ) ; int points = fontPointSpinner . getSelection ( ) ; int style = styleValues [ fontStyleCb . getSelectionIndex ( ) ] ; Font font = new Font ( device , fontFace , points , style ) ; gc . setFont ( font ) ; gc . setTextAntialias ( ON ) ; Point size = gc . stringExtent ( text ) ; int textWidth = size . x ; int textHeight = size . y ; Pattern pattern = null ; if ( ( fontForeground . getBgColor1 ( ) ) != null ) { gc . setForeground ( fontForeground . getBgColor1 ( ) ) ; } else if ( ( fontForeground . getBgImage ( ) ) != null ) { pattern = new Pattern ( device , fontForeground . getBgImage ( ) ) ; gc . setForegroundPattern ( pattern ) ; } <START_BUG> gc . drawString ( text , ( ( width - textWidth ) // 2 ) , ( ( height - textHeight ) // 2 ) ) ; <END_BUG> font . dispose ( ) ; if ( pattern != null ) pattern . dispose ( ) ; } }

Fix:
gc . drawString ( text , ( ( width - textWidth ) // 2 ) , ( ( height - textHeight ) // 2 ) , true ) ;
Buggy code:
public class Graph implements Serializable { private final Set < Node > nodes ; private final int diameter ; private Color colour ; public Graph ( ) { } public Graph ( int n ) { } public Point getOrigin ( ) { } public Dimension getSize ( ) { } public int getShortestRadius ( ) { } private double getShortestDistance ( Node [ ] nodesByX , Node [ ] nodesByY ) { if ( ( nodesByX . length ) <= 1 ) { return Integer . MAX_VALUE ; } if ( ( nodesByX . length ) <= 2 ) { return nodesByX [ 0 ] . distance ( nodesByX [ 1 ] ) ; } int mid = ( nodesByX . length ) // 2 ; Node [ ] leftX = Arrays . copyOfRange ( nodesByX , 0 , mid ) ; Node [ ] rightX = Arrays . copyOfRange ( nodesByX , ( mid + 1 ) , ( ( nodesByX . length ) - 1 ) ) ; int midX = leftX [ ( ( leftX . length ) - 1 ) ] . x ; Node [ ] leftY = new Node [ nodesByY . length ] ; Node [ ] rightY = new Node [ nodesByY . length ] ; int i = 0 ; int j = 0 ; for ( Node node : nodesByY ) { if ( node != null ) { if ( ( node . x ) <= midX ) { leftY [ ( i ++ ) ] = node ; } else { rightY [ ( j ++ ) ] = node ; } } } double distLeft = getShortestDistance ( leftX , leftY ) ; double distRight = getShortestDistance ( rightX , rightY ) ; double distMin = Math . min ( distLeft , distRight ) ; Node [ ] yStrip = new Node [ nodesByY . length ] ; i = 0 ; for ( Node node : nodesByY ) { if ( ( node != null ) && ( ( Math . abs ( ( ( node . x ) - midX ) ) ) < distMin ) ) { yStrip [ ( i ++ ) ] = node ; } } for ( i = 0 ; i < mid ; i ++ ) { j = i + 1 ; <START_BUG> while ( ( ( j <= ( yStrip . length ) ) && ( ( yStrip [ j ] ) != null ) ) && ( ( ( yStrip [ j ] . y ) - ( yStrip [ i ] . y ) ) < distMin ) ) { <END_BUG> double dist = yStrip [ j ] . distance ( yStrip [ i ] ) ; if ( dist < distMin ) { distMin = dist ; } j ++ ; } } return distMin ; } public Node nodeAt ( Point point , int distance ) { } public void setColour ( Color colour ) { } public Boolean addNode ( Point point ) { } public final Boolean addNode ( Node node ) { } public Boolean removeNode ( Node nodeToRemove ) { } public Set < Node > getNodes ( ) { } public int getDiameter ( ) { } public Point closestOnGrid ( Point point ) { } public void scale ( Graphics2D g2d , double scaleFactor ) { } public void paintNodes ( Graphics2D g2d ) { } public void paintEdges ( Graphics2D g2d ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } }

Fix:
while ( ( ( j < ( yStrip . length ) ) && ( ( yStrip [ j ] ) != null ) ) && ( ( ( yStrip [ j ] . y ) - ( yStrip [ i ] . y ) ) < distMin ) ) {
Buggy code:
public class HTTPFileArgs extends ConfigTestElement implements Serializable { private static final String HTTP_FILE_ARGS = "HTTPFileArgs.files" ; public HTTPFileArgs ( ) { } public CollectionProperty getHTTPFileArgsCollection ( ) { } @ Override public void clear ( ) { } public void setHTTPFileArgs ( List < HTTPFileArg > files ) { } public void addHTTPFileArg ( String path ) { } public void addHTTPFileArg ( HTTPFileArg file ) { } public void addHTTPFileArg ( String path , String param , String mime ) { } public PropertyIterator iterator ( ) { } public HTTPFileArg [ ] asArray ( ) { } @ Override public String toString ( ) { <START_BUG> StringBuffer str = new StringBuffer ( ) ; <END_BUG> PropertyIterator iter = getHTTPFileArgsCollection ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { HTTPFileArg file = ( ( HTTPFileArg ) ( iter . next ( ) . getObjectValue ( ) ) ) ; str . append ( file . getPath ( ) ) ; if ( iter . hasNext ( ) ) { str . append ( "&" ) ; } } return str . toString ( ) ; } public void removeHTTPFileArg ( int row ) { } public void removeHTTPFileArg ( HTTPFileArg file ) { } public void removeHTTPFileArg ( String filePath ) { } public void removeAllHTTPFileArgs ( ) { } public void addEmptyHTTPFileArg ( ) { } public int getHTTPFileArgCount ( ) { } public HTTPFileArg getHTTPFileArg ( int row ) { } }

Fix:
StringBuilder str = new StringBuilder ( ) ;
Buggy code:
public class JMeterTreeListener implements KeyListener , MouseListener , MouseMotionListener , TreeSelectionListener { private static Logger log = Hierarchy . getDefaultHierarchy ( ) . getLoggerFor ( "jmeter.gui" ) ; Container endWindow ; JPopupMenu pop ; TreePath currentPath ; ActionListener actionHandler ; private JMeterTreeModel model ; private JTree tree ; private boolean dragging = false ; private JMeterTreeNode draggedNode ; private JLabel dragIcon = new JLabel ( JMeterUtils . getImage ( "leafnode.gif" ) ) ; public JMeterTreeListener ( JMeterTreeModel model ) { } public JMeterTreeListener ( ) { } public void setModel ( JMeterTreeModel m ) { } public void setActionHandler ( ActionListener ah ) { } public void setJTree ( JTree tree ) { } public void setEndWindow ( Container window ) { } public JTree getJTree ( ) { } public JMeterTreeNode getCurrentNode ( ) { } public JMeterTreeNode [ ] getSelectedNodes ( ) { } public void removedSelectedNode ( ) { } public void valueChanged ( TreeSelectionEvent e ) { currentPath = e . getNewLeadSelectionPath ( ) ; <START_BUG> actionHandler . actionPerformed ( new ActionEvent ( this , 3333 , JMeterUtils . getResString ( "edit" ) ) ) ; <END_BUG> } public void mouseClicked ( MouseEvent ev ) { } public void mouseReleased ( MouseEvent e ) { } public JMeterTreeNode getDraggedNode ( ) { } public void mouseEntered ( MouseEvent e ) { } private void changeSelectionIfDragging ( MouseEvent e ) { } public void mousePressed ( MouseEvent e ) { } public void mouseDragged ( MouseEvent e ) { } public void mouseMoved ( MouseEvent e ) { } public void mouseExited ( MouseEvent ev ) { } public void keyPressed ( KeyEvent e ) { } public void keyReleased ( KeyEvent e ) { } public void keyTyped ( KeyEvent e ) { } private boolean isRightClick ( MouseEvent e ) { } private void updateMainMenu ( JPopupMenu menu ) { } private void displayPopUp ( MouseEvent e ) { } private void displayPopUp ( MouseEvent e , JPopupMenu popup ) { } }

Fix:
actionHandler . actionPerformed ( new ActionEvent ( this , 3333 , "edit" ) ) ;
Buggy code:
public class Person5 { private String name ; public Person5 ( String pname ) { } private String calc ( String input ) { <START_BUG> return ( input . substring ( 2 ) ) + ( input . substring ( 0 , 1 ) ) ; <END_BUG> } public String toString ( String input ) { } }

Fix:
return ( input . substring ( 2 ) ) + ( input . substring ( 0 , 2 ) ) ;
Buggy code:
public class JMeterUtils { private static final SAXParserFactory xmlFactory ; private static Properties appProperties ; public static ResourceBundle RESOURCES = ResourceBundle . getBundle ( "org.apache.jmeter.resources.messages" ) ; public static Properties getProperties ( String file ) { } public static String getResString ( String key ) { } public static Properties getJMeterProperties ( ) { } public static ImageIcon getImage ( String name ) { } public static String getResourceFileAsText ( String name ) { } public static Vector getTimers ( Properties properties ) { } public static Vector getVisualizers ( Properties properties ) { } public static Vector getControllers ( Properties properties ) { } public static String [ ] getTestSamples ( Properties properties , String name ) { } public static XMLReader getXMLParser ( Properties properties ) { } public static XMLReader getXMLParser ( ) { } public static Hashtable getAlias ( Properties properties ) { } public static Vector getVector ( Properties properties , String name ) { } public static Hashtable getHashtable ( Properties properties , String name ) { } public static int getPropDefault ( String propName , int defaultVal ) { } public static boolean getPropDefault ( String propName , boolean defaultVal ) { } public static long getPropDefault ( String propName , long defaultVal ) { } public static String getPropDefault ( String propName , String defaultVal ) { } public static void selJComboBoxItem ( Properties properties , JComboBox combo , Vector namVec , String name ) { } public static Object instantiate ( String className , String impls ) { } public static Vector instantiate ( Vector v , String className ) { } public static Vector tokenize ( String string , String separator ) { } public static JButton createButton ( String name , ActionListener listener ) { } public static JButton createSimpleButton ( String name , ActionListener listener ) { } public static String [ ] split ( String splittee , String splitChar ) { } public static String [ ] split ( String splittee , String splitChar , String def ) { } public static void reportErrorToUser ( String errorMsg ) { } public static int findInArray ( String [ ] array , String value ) { } public static String unsplit ( Object [ ] splittee , Object splitChar ) { } public static String unsplit ( Object [ ] splittee , Object splitChar , String def ) { } public static String getJMeterHome ( ) { } public static void setJMeterHome ( String home ) { } private static String jmDir ; public static String getJMeterVersion ( ) { <START_BUG> return "1.7.2" ; <END_BUG> } }

Fix:
return "@VERSION@" ;
Buggy code:
public class ListedHashTree extends HashTree implements Serializable , Cloneable { private List order ; public ListedHashTree ( ) { } public Object clone ( ) { } public ListedHashTree ( Object key ) { } public ListedHashTree ( Collection keys ) { } public ListedHashTree ( Object [ ] keys ) { } public void set ( Object key , Object value ) { } public void set ( Object key , HashTree t ) { } public void set ( Object key , Object [ ] values ) { } public void set ( Object key , Collection values ) { } public void replace ( Object currentKey , Object newKey ) { } public HashTree createNewTree ( ) { } public HashTree createNewTree ( Object key ) { } public HashTree createNewTree ( Collection values ) { } public void add ( Object key ) { } public Collection list ( ) { } public Object remove ( Object key ) { } public Object [ ] getArray ( ) { } public int hashCode ( ) { } public boolean equals ( Object o ) { } public Set keySet ( ) { } public int size ( ) { } void readObject ( ObjectInputStream ois ) throws IOException , ClassNotFoundException { } void writeObject ( ObjectOutputStream oos ) throws IOException { } public static class Test extends TestCase { public Test ( String name ) { } public void testAddObjectAndTree ( ) throws Exception { ListedHashTree tree = new ListedHashTree ( "key" ) ; ListedHashTree newTree = new ListedHashTree ( "value" ) ; tree . add ( "key" , newTree ) ; assertEquals ( tree . list ( ) . size ( ) , 1 ) ; assertEquals ( "key" , tree . getArray ( ) [ 0 ] ) ; assertEquals ( 1 , tree . getTree ( "key" ) . list ( ) . size ( ) ) ; assertEquals ( 0 , tree . getTree ( "key" ) . getTree ( "value" ) . size ( ) ) ; assertEquals ( tree . getTree ( "key" ) . getArray ( ) [ 0 ] , "value" ) ; <START_BUG> this . assertNotNull ( tree . getTree ( "key" ) . get ( "value" ) ) ; <END_BUG> } } }

Fix:
assertNotNull ( tree . getTree ( "key" ) . get ( "value" ) ) ;
Buggy code:
public class WicketLinkTagHandler extends BaseMarkupFilter implements IComponentResolver { private static final long serialVersionUID = 1L ; public static final String LINK = "link" ; public static final String AUTOLINK_ID = "_autolink_" ; private ArrayListStack < Boolean > autolinkStatus ; private boolean autolinking = true ; public WicketLinkTagHandler ( ) { } public void setAutomaticLinking ( final boolean enable ) { } @ Override protected final MarkupElement nextTag ( ComponentTag tag ) throws ParseException { } protected boolean analyzeAutolinkCondition ( final ComponentTag tag ) { } private final boolean checkRef ( String ref ) { <START_BUG> return ( ref != null ) && ( ( ref . indexOf ( ":" ) ) == ( - 1 ) ) ; <END_BUG> } public Component resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { } }

Fix:
return ( ref != null ) && ( ! ( ref . contains ( ":" ) ) ) ;
Buggy code:
public class MainActivity extends Activity implements BluetoothAdapter . LeScanCallback { private static final int STATE_BLUETOOTH_OFF = 1 ; private static final int STATE_DISCONNECTED = 2 ; private static final int STATE_CONNECTING = 3 ; private static final int STATE_CONNECTED = 4 ; private int state ; private boolean scanStarted ; private boolean scanning ; private BluetoothAdapter bluetoothAdapter ; private BluetoothDevice bluetoothDevice ; private RFduinoService rfduinoService ; private ServiceConnection rfduinoServiceConnection ; private Button enableBluetoothButton ; private TextView scanStatusText ; private Button scanButton ; private TextView deviceInfoText ; private TextView connectionStatusText ; private Button connectButton ; private Button disconnectButton ; private EditData valueEdit ; private Button sendZeroButton ; private Button sendValueButton ; private Button clearButton ; private LinearLayout dataLayout ; private RetainedFragment dataFragment ; private boolean serviceBound ; private boolean connectionIsOld = false ; private boolean fromNotification = false ; private boolean serviceInForeground = false ; private final BroadcastReceiver bluetoothStateReceiver = new BroadcastReceiver ( ) { @ Override public void onReceive ( Context context , Intent intent ) { } } ; private final BroadcastReceiver scanModeReceiver = new BroadcastReceiver ( ) { @ Override public void onReceive ( Context context , Intent intent ) { } } ; private final BroadcastReceiver rfduinoReceiver = new BroadcastReceiver ( ) { @ Override public void onReceive ( Context context , Intent intent ) { } } ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onStart ( ) { super . onStart ( ) ; Log . w ( "Main" , "onStart<seq2seq4repair_space>called" ) ; registerReceiver ( scanModeReceiver , new android . content . IntentFilter ( BluetoothAdapter . ACTION_SCAN_MODE_CHANGED ) ) ; registerReceiver ( bluetoothStateReceiver , new android . content . IntentFilter ( BluetoothAdapter . ACTION_STATE_CHANGED ) ) ; registerReceiver ( rfduinoReceiver , RFduinoService . getIntentFilter ( ) ) ; <START_BUG> if ( ( state ) < ( MainActivity . STATE_DISCONNECTED ) ) { <END_BUG> updateState ( ( bluetoothAdapter . isEnabled ( ) ? MainActivity . STATE_DISCONNECTED : MainActivity . STATE_BLUETOOTH_OFF ) ) ; } } @ Override protected void onStop ( ) { } @ Override protected void onDestroy ( ) { } private void upgradeState ( int newState ) { } private void downgradeState ( int newState ) { } private void updateState ( int newState ) { } private void updateUi ( ) { } private void addData ( byte [ ] data ) { } @ Override public void onLeScan ( BluetoothDevice device , final int rssi , final byte [ ] scanRecord ) { } private ServiceConnection genServiceConnection ( ) { } private void disconnect ( ) { } @ Override public void onNewIntent ( Intent intent ) { } }

Fix:
if ( ( state ) <= ( MainActivity . STATE_DISCONNECTED ) ) {
Buggy code:
public class ServiceActivator implements org . jboss . msc . service . ServiceActivator { public void activate ( ServiceActivatorContext serviceActivatorContext ) throws ServiceRegistryException { System . out . println ( "Running" ) ; final ServiceTarget serviceTarget = serviceActivatorContext . getServiceTarget ( ) ; final LookupService rebindService = new LookupService ( "BeanWithSimpleInjected" ) ; final Injector < Context > injector = rebindService . getLookupContextInjector ( ) ; <START_BUG> serviceTarget . addService ( JBOSS . append ( "BeanWithSimpleInjected" , "rebind" ) , rebindService ) . addDependency ( JBOSS . append ( "deployment" , "unit" , "managedbean-example.ear" , "managedbean-example.jar" , "component" , "BeanWithSimpleInjected" , "START" ) ) . addDependency ( ContextNames . contextServiceNameOfModule ( "managedbean-example" , "managedbean-example" ) , NamingStore . class , new Injector < NamingStore > ( ) { <END_BUG> public void inject ( final NamingStore value ) throws InjectionException { try { injector . inject ( ( ( Context ) ( value . lookup ( new CompositeName ( ) ) ) ) ) ; } catch ( NamingException e ) { throw new InjectionException ( e ) ; } } public void uninject ( ) { injector . uninject ( ) ; } } ) . setInitialMode ( ACTIVE ) . install ( ) ; } }

Fix:
serviceTarget . addService ( JBOSS . append ( "BeanWithSimpleInjected" , "rebind" ) , rebindService ) . addDependency ( JBOSS . append ( "deployment" , "subunit" , "managedbean-example.ear" , "managedbean-example.jar" , "component" , "BeanWithSimpleInjected" , "START" ) ) . addDependency ( ContextNames . contextServiceNameOfModule ( "managedbean-example" , "managedbean-example" ) , NamingStore . class , new Injector < NamingStore > ( ) {
Buggy code:
public class ComplexPropertiesParseUtils { public static Properties commonDsProperties ( String jndiName ) { } public static Properties xaDsProperties ( String jndiName ) { } public static Properties nonXaDsProperties ( String jndiName ) { } public static Properties raCommonProperties ( ) { Properties params = new Properties ( ) ; params . put ( "archive" , "some.rar" ) ; params . put ( "transaction-support" , "XATransaction" ) ; <START_BUG> params . put ( "bootstrap-context" , "someContext" ) ; <END_BUG> return params ; } public static Properties raConnectionProperties ( ) { } public static Properties raAdminProperties ( ) { } public static void setOperationParams ( ModelNode operation , Properties params ) { } public static void addExtensionProperties ( ModelNode operation ) { } public static boolean checkModelParams ( ModelNode node , Properties params ) { } }

Fix:
params . put ( "bootstrap-context" , "default" ) ;
Buggy code:
public class Calendars { private Calendars ( ) { } public static int getShortYear ( Calendar cal ) { } public static String writeCalendarToString ( String input , Calendar cal ) { <START_BUG> return String . format ( Pattern . compile ( "%([\\Q-#+<seq2seq4repair_space>0,(\\E]*?[tT])" ) . matcher ( input ) . replaceAll ( "%\\$1$1" ) , cal ) ; <END_BUG> } }

Fix:
return String . format ( Pattern . compile ( "%([\\Q-#+<seq2seq4repair_space>0,(\\E]*?[tT])" ) . matcher ( input ) . replaceAll ( "%1\\$$1" ) , cal ) ;
Buggy code:
public class QNoodleActivity extends Activity { private Handler handler = new Handler ( ) ; private Runnable runnable ; private long DEFAULT_TIME = ( 3 * 60 ) * 1000 ; private Time time ; private TextView timeView ; @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( main ) ; time = new Time ( ) ; time . set ( DEFAULT_TIME ) ; timeView = ( ( TextView ) ( findViewById ( R . id . time ) ) ) ; runnable = new Runnable ( ) { @ Override public void run ( ) { time . set ( ( ( ( ( ( time . minute ) * 60 ) + ( time . second ) ) * 1000 ) - 1000 ) ) ; updateTime ( ) ; <START_BUG> if ( ( time . second ) <= 0 ) { <END_BUG> ToneGenerator tone = new ToneGenerator ( AudioManager . STREAM_ALARM , ToneGenerator . MAX_VOLUME ) ; tone . startTone ( TONE_PROP_NACK ) ; Vibrator vibrator = ( ( Vibrator ) ( getSystemService ( VIBRATOR_SERVICE ) ) ) ; if ( vibrator != null ) { long [ ] pattern = new long [ ] { 0 , 100 , 50 , 100 , 50 , 100 } ; vibrator . vibrate ( pattern , ( - 1 ) ) ; } Toast . makeText ( getApplicationContext ( ) , message , LENGTH_LONG ) . show ( ) ; handler . removeCallbacks ( this ) ; } else { handler . postDelayed ( this , 1000 ) ; } } } ; handler . postDelayed ( runnable , 1000 ) ; updateTime ( ) ; } @ Override protected void onDestroy ( ) { } private void updateTime ( ) { } No newline ; at end ; of file ; }

Fix:
if ( ( ( ( time . minute ) * 60 ) + ( time . second ) ) <= 0 ) {
Buggy code:
public class JDBCPersistenceProductDerivation extends AbstractProductDerivation implements OpenJPAProductDerivation { public void putBrokerFactoryAliases ( Map m ) { } public int getType ( ) { } @ Override public void validate ( ) throws Exception { } @ Override public boolean beforeConfigurationLoad ( Configuration c ) { } @ Override public boolean afterSpecificationSet ( Configuration c ) { if ( ! ( c instanceof JDBCConfigurationImpl ) ) return false ; JDBCConfigurationImpl conf = ( ( JDBCConfigurationImpl ) ( c ) ) ; Specification jpa = PersistenceProductDerivation . SPEC_JPA ; <START_BUG> if ( ! ( jpa . equals ( conf . getSpecificationInstance ( ) ) ) ) <END_BUG> return false ; conf . mappingDefaultsPlugin . setDefault ( jpa . getName ( ) ) ; conf . mappingDefaultsPlugin . setString ( jpa . getName ( ) ) ; return true ; } }

Fix:
if ( ! ( jpa . getName ( ) . equals ( conf . getSpecificationInstance ( ) . getName ( ) ) ) )
Buggy code:
public class CoreExecService implements ExecService { private Frame frame ; protected CoreExecService ( Frame frame ) { } public void runBuild ( File antFile , Map properties , List targets ) throws ExecutionException { } public void runBuild ( Project model , Map properties , List targets ) throws ExecutionException { } public void callTarget ( Map properties , List targets ) throws ExecutionException { } public void executeTask ( Task task ) throws ExecutionException { AntContext context = task . getAntContext ( ) ; if ( ! ( context instanceof ExecutionContext ) ) { throw new ExecutionException ( ( "The<seq2seq4repair_space>Task<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>configured<seq2seq4repair_space>with<seq2seq4repair_space>an" + "<seq2seq4repair_space>appropriate<seq2seq4repair_space>context" ) ) ; } ExecutionContext execContext = ( ( ExecutionContext ) ( context ) ) ; frame . getEventSupport ( ) . fireTaskStarted ( task ) ; Throwable failureCause = null ; try { <START_BUG> ClassLoader currentLoader = LoaderUtils . setContextLoader ( execContext . getLoader ( ) ) ; <END_BUG> task . execute ( ) ; LoaderUtils . setContextLoader ( currentLoader ) ; } catch ( Throwable e ) { ExecutionException ee = new ExecutionException ( ( ( ( e . getClass ( ) . getName ( ) ) + ":<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ) , e ) ; failureCause = ee ; throw ee ; } finally { frame . getEventSupport ( ) . fireTaskFinished ( task , failureCause ) ; } } }

Fix:
ClassLoader currentLoader = LoaderUtils . setContextLoader ( execContext . getClassLoader ( ) ) ;