nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ResultSetStreamTest extends BaseJDBCTestCase { public ResultSetStreamTest ( String name ) { } private static String filePath ; private static String sep ; public void testInsertData ( ) throws Exception , SQLException { } private void insertData ( ) throws FileNotFoundException , IOException , SQLException { } private void assertMisMatchStreamLength ( SQLException sqle ) { } public void testBinaryStreamProcessing ( ) throws Exception , SQLException { } public void binaryStreamProcessing ( ) throws IOException , SQLException { } static final String TEST_STRING_DATA = "ABCDEFG" + ( ( "ÀÁÂÃÄÅ" + "ÿĀ" ) + "あいうえお" ) ; public void testGetAsciiStream ( ) throws IOException , SQLException { } public void testGetCharacterStream ( ) throws IOException , SQLException { } public static Test basesuite ( String name ) { TestSuite suite = new TestSuite ( ResultSetStreamTest . class , name ) ; <START_BUG> Test test = new org . apache . derbyTesting . junit . SupportFilesSetup ( suite , new String [ ] { "functionTests//testData//ResultSetStream//littleclob.utf" , "functionTests//testData//ResultSetStream//short.utf" , "functionTests//testData//ResultSetStream//resultsetstream.gif" } ) ; <END_BUG> return new CleanDatabaseTestSetup ( test ) { protected void decorateSQL ( Statement s ) throws SQLException { s . execute ( "create<seq2seq4repair_space>table<seq2seq4repair_space>t2<seq2seq4repair_space>(len<seq2seq4repair_space>int,<seq2seq4repair_space>data<seq2seq4repair_space>LONG<seq2seq4repair_space>VARCHAR<seq2seq4repair_space>FOR<seq2seq4repair_space>BIT<seq2seq4repair_space>DATA)" ) ; s . execute ( "create<seq2seq4repair_space>table<seq2seq4repair_space>t3(text_data<seq2seq4repair_space>clob)" ) ; } } ; } public static Test suite ( ) { } }

Fix:
Test test = new org . apache . derbyTesting . junit . SupportFilesSetup ( suite , new String [ ] { "functionTests//testData//ResultSetStream//littleclob.utf" , "functionTests//testData//ResultSetStream//short.utf" , "functionTests//testData//ResultSetStream//resultsetStream.gif" } ) ;
Buggy code:
@ Secured ( false ) @ RequestMapping ( value = "//channel//{channelId}//view" , method = RequestMethod . GET ) @ HttpConstraint ( PERMIT ) public ModelAndView view ( @ PathVariable ( "channelId" ) final String channelId , final HttpServletRequest request , final HttpServletResponse response ) throws IOException , ServletException { } @ Secured ( false ) @ RequestMapping ( value = "//channel//{channelId}//viewPlain" , method = RequestMethod . GET ) @ HttpConstraint ( PERMIT ) public ModelAndView viewPlain ( @ PathVariable ( "channelId" ) final String channelId ) { } @ Secured ( false ) @ RequestMapping ( value = "//channel//{channelId}//tree" , method = RequestMethod . GET ) @ HttpConstraint ( PERMIT ) public ModelAndView tree ( @ PathVariable ( "channelId" ) final String channelId ) { } @ Secured ( false ) @ RequestMapping ( value = "//channel//{channelId}//validation" , method = RequestMethod . GET ) @ HttpConstraint ( PERMIT ) public ModelAndView viewValidation ( @ PathVariable ( "channelId" ) final String channelId ) { } @ Secured ( false ) @ RequestMapping ( value = "//channel//{channelId}//details" , method = RequestMethod . GET ) @ HttpConstraint ( PERMIT ) public ModelAndView details ( @ PathVariable ( "channelId" ) final String channelId ) { } @ RequestMapping ( value = "//channel//{channelId}//delete" , method = RequestMethod . GET ) public ModelAndView delete ( @ PathVariable ( "channelId" ) final String channelId ) { } @ RequestMapping ( value = "//channel//{channelId}//artifacts//{artifactId}//delete" , method = RequestMethod . GET ) public ModelAndView deleteArtifact ( @ PathVariable ( "channelId" ) final String channelId , @ PathVariable ( "artifactId" ) final String artifactId ) { } @ RequestMapping ( value = "//channel//{channelId}//artifacts//{artifactId}//get" , method = RequestMethod . GET ) public void getArtifact ( @ PathVariable ( "channelId" ) final String channelId , @ PathVariable ( "artifactId" ) final String artifactId , final HttpServletResponse response ) throws IOException { } @ RequestMapping ( value = "//channel//{channelId}//artifacts//{artifactId}//dump" , method = RequestMethod . GET ) public void dumpArtifact ( @ PathVariable ( "channelId" ) final String channelId , @ PathVariable ( "artifactId" ) final String artifactId , final HttpServletResponse response ) throws IOException { } @ RequestMapping ( value = "//channel//{channelId}//artifacts//{artifactId}//view" , method = RequestMethod . GET ) public ModelAndView viewArtifact ( @ PathVariable ( "channelId" ) final String channelId , @ PathVariable ( "artifactId" ) final String artifactId ) { } @ RequestMapping ( value = "//channel//{channelId}//add" , method = RequestMethod . GET ) public ModelAndView add ( @ PathVariable ( "channelId" ) final String channelId ) { <START_BUG> final ModelAndView mav = new ModelAndView ( "//channel//add" ) ; <END_BUG>

Fix:
final ModelAndView mav = new ModelAndView ( "channel//add" ) ;
Buggy code:
public class Splash extends Activity implements Runnable { private final int LOAD_DELAY_TIME = 1 * 1000 ; private Handler handler ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void checkMessagesAndOrderAroundMe ( ) { new GetMessages ( this , new HttpCallback ( ) { @ Override public void onAnswerReturn ( Object answer ) { if ( answer instanceof Integer ) { return ; } ArrayList < Message > arrayList = ( ( ArrayList < Message > ) ( answer ) ) ; if ( ( arrayList . size ( ) ) == 0 ) { getContentResolver ( ) . delete ( CONTENT_URI_ORDERS_AROUND_ME , null , null ) ; return ; } else { Cursor c = getContentResolver ( ) . query ( CONTENT_URI_ORDERS_AROUND_ME , null , null , null , null ) ; if ( c . moveToFirst ( ) ) do { for ( Message m : arrayList ) { <START_BUG> String rowOrderId = c . getString ( c . getColumnIndex ( COL_ID ) ) ; <END_BUG> if ( rowOrderId . equalsIgnoreCase ( m . getOrderid ( ) ) ) { break ; } getContentResolver ( ) . delete ( CONTENT_URI_ORDERS_AROUND_ME , ( ( DataProvider . COL_ORDER_ID ) + "<seq2seq4repair_space>=<seq2seq4repair_space>?" ) , new String [ ] { rowOrderId } ) ; } } while ( c . moveToNext ( ) ) ; } } } ) . setIsWithNoConnectionDialog ( false ) . setIsWithProgressDialog ( false ) . execute ( ) ; } @ Override protected void onResume ( ) { } private void load ( ) { } @ Override public void run ( ) { } private void launchActivity ( Class < ? > class1 ) { } }

Fix:
String rowOrderId = c . getString ( c . getColumnIndex ( COL_ORDER_ID ) ) ;
Buggy code:
public class CrosscuttingMembers { private ResolvedTypeX inAspect ; private World world ; private PerClause perClause ; private List shadowMungers = new ArrayList ( 4 ) ; private List typeMungers = new ArrayList ( 4 ) ; private List declareParents = new ArrayList ( 4 ) ; private List declareSofts = new ArrayList ( 0 ) ; private List declareDominates = new ArrayList ( 4 ) ; public CrosscuttingMembers ( ResolvedTypeX inAspect ) { } public void addConcreteShadowMunger ( ShadowMunger m ) { } public void addShadowMungers ( Collection c ) { } private void addShadowMunger ( ShadowMunger m ) { } public void addTypeMungers ( Collection c ) { } public void addTypeMunger ( ConcreteTypeMunger m ) { } public void addDeclares ( Collection c ) { } public void addDeclare ( Declare declare ) { if ( declare instanceof DeclareErrorOrWarning ) { ShadowMunger m = new Checker ( ( ( DeclareErrorOrWarning ) ( declare ) ) ) ; addShadowMunger ( m ) ; } else if ( declare instanceof DeclarePrecedence ) { declareDominates . add ( declare ) ; } else if ( declare instanceof DeclareParents ) { DeclareParents dp = ( ( DeclareParents ) ( declare ) ) ; exposeTypes ( dp . getParents ( ) . getExactTypes ( ) ) ; declareParents . add ( dp ) ; } else if ( declare instanceof DeclareSoft ) { DeclareSoft d = ( ( DeclareSoft ) ( declare ) ) ; Pointcut concretePointcut = d . getPointcut ( ) . concretize ( inAspect , 0 ) ; declareSofts . add ( new DeclareSoft ( d . getException ( ) , concretePointcut ) ) ; <START_BUG> ShadowMunger m = Advice . makeSoftener ( world , concretePointcut , d . getException ( ) ) ; <END_BUG> addConcreteShadowMunger ( m ) ; } else { throw new RuntimeException ( "unimplemented" ) ; } } public void exposeTypes ( Collection typesToExpose ) { } public void exposeType ( TypeX typeToExpose ) { } public void addPrivilegedAccesses ( Collection accessedMembers ) { } private void addPrivilegedAccess ( ResolvedMember member ) { } public Collection getCflowEntries ( ) { } public boolean replaceWith ( CrosscuttingMembers other ) { } public PerClause getPerClause ( ) { } public void setPerClause ( PerClause perClause ) { } public List getDeclareDominates ( ) { } public List getDeclareParents ( ) { } public List getDeclareSofts ( ) { } public List getShadowMungers ( ) { } public List getTypeMungers ( ) { } }

Fix:
ShadowMunger m = Advice . makeSoftener ( world , concretePointcut , d . getException ( ) , inAspect ) ;
Buggy code:
@ Controller @ RequestMapping ( TAMACallFlowController . HANG_UP_URL ) public class HangupController extends SafeIVRController { private TAMAIVRContextFactory ivrContextFactory ; public HangupController ( IVRMessage ivrMessage , KookooCallDetailRecordsService callDetailRecordsService , TAMAIVRContextFactory ivrContextFactory ) { } @ Autowired public HangupController ( IVRMessage ivrMessage , KookooCallDetailRecordsService callDetailRecordsService ) { } @ Override public KookooIVRResponseBuilder gotDTMF ( KooKooIVRContext kooKooIVRContext ) { TAMAIVRContext ivrContext = ivrContextFactory . create ( kooKooIVRContext ) ; <START_BUG> return new KookooIVRResponseBuilder ( ) . withSid ( ivrContext . callId ( ) ) . withPlayAudios ( MORE_OPTIONS , SIGNATURE_MUSIC ) . language ( ivrContext . preferredLanguage ( ) ) ; <END_BUG> } }

Fix:
return new KookooIVRResponseBuilder ( ) . withSid ( ivrContext . callId ( ) ) . withPlayAudios ( MORE_OPTIONS , SIGNATURE_MUSIC ) . language ( ivrContext . preferredLanguage ( ) ) . withHangUp ( ) ;
Buggy code:
public class CassandraBulkLoader { public static class Map extends MapReduceBase implements Mapper < Text , Text , Text , Text > { private Text word = new Text ( ) ; public void map ( Text key , Text value , OutputCollector < Text , Text > output , Reporter reporter ) throws IOException { } } public static class Reduce extends MapReduceBase implements Reducer < Text , Text , Text , Text > { private Path [ ] localFiles ; private ArrayList < String > tokens = new ArrayList < String > ( ) ; private JobConf jobconf ; public void configure ( JobConf job ) { this . jobconf = job ; String cassConfig ; try { localFiles = DistributedCache . getLocalCacheFiles ( job ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } cassConfig = localFiles [ 0 ] . getParent ( ) . toString ( ) ; System . setProperty ( "storage-config" , cassConfig ) ; CassandraBulkLoader . startMessagingService ( ) ; for ( String token : this . tokens ) { String [ ] values = token . split ( ":" ) ; InetAddress address ; try { address = InetAddress . getByName ( values [ 1 ] ) ; } catch ( UnknownHostException e ) { throw new RuntimeException ( e ) ; } <START_BUG> StorageService . instance ( ) . updateTokenMetadataUnsafe ( new BigIntegerToken ( new BigInteger ( values [ 0 ] ) ) , address ) ; <END_BUG> } } public void close ( ) { } public void reduce ( Text key , Iterator < Text > values , OutputCollector < Text , Text > output , Reporter reporter ) throws IOException { } } public static void runJob ( String [ ] args ) { } public static Message createMessage ( String Keyspace , String Key , String CFName , List < ColumnFamily > ColumnFamiles ) { } public static void startMessagingService ( ) { } public static void shutdownMessagingService ( ) { } public static void main ( String [ ] args ) throws Exception { } }

Fix:
StorageService . instance ( ) . updateForeignTokenUnsafe ( new BigIntegerToken ( new BigInteger ( values [ 0 ] ) ) , address ) ;
Buggy code:
public class ClosureUtilsTest extends TestCase { private static final Object cString = "Hello" ; public ClosureUtilsTest ( final String name ) { } static class MockClosure < T > implements Closure < T > { int count = 0 ; public void execute ( final T object ) { } public void reset ( ) { } } static class MockTransformer < T > implements Transformer < T , T > { int count = 0 ; public T transform ( final T object ) { } } public void testExceptionClosure ( ) { } public void testNopClosure ( ) { } public void testInvokeClosure ( ) { StringBuffer buf = new StringBuffer ( "Hello" ) ; ClosureUtils . invokerClosure ( "reverse" ) . execute ( buf ) ; assertEquals ( "olleH" , buf . toString ( ) ) ; buf = new StringBuffer ( "Hello" ) ; <START_BUG> ClosureUtils . invokerClosure ( "setLength" , new Class [ ] { Integer . TYPE } , new Object [ ] { new Integer ( 2 ) } ) . execute ( buf ) ; <END_BUG> assertEquals ( "He" , buf . toString ( ) ) ; } public void testForClosure ( ) { } public void testWhileClosure ( ) { } public void testDoWhileClosure ( ) { } @ SuppressWarnings ( "unchecked" ) public void testChainedClosure ( ) { } public void testIfClosure ( ) { } @ SuppressWarnings ( "unchecked" ) public void testSwitchClosure ( ) { } public void testSwitchMapClosure ( ) { } public void testTransformerClosure ( ) { } public void testSingletonPatternInSerialization ( ) { } }

Fix:
ClosureUtils . invokerClosure ( "setLength" , new Class [ ] { Integer . TYPE } , new Object [ ] { Integer . valueOf ( 2 ) } ) . execute ( buf ) ;
Buggy code:
public abstract class GenericTypeResolver { private static final Map < Class , Map < TypeVariable , Type > > typeVariableCache = new org . springframework . util . ConcurrentReferenceHashMap < Class , Map < TypeVariable , Type > > ( ) ; @ Deprecated public static Type getTargetType ( MethodParameter methodParam ) { } public static Class < ? > resolveParameterType ( MethodParameter methodParam , Class < ? > clazz ) { } public static Class < ? > resolveReturnType ( Method method , Class < ? > clazz ) { } public static Class < ? > resolveReturnTypeForGenericMethod ( Method method , Object [ ] args , ClassLoader classLoader ) { } public static Class < ? > resolveReturnTypeArgument ( Method method , Class < ? > genericIfc ) { } public static Class < ? > resolveTypeArgument ( Class < ? > clazz , Class < ? > genericIfc ) { } private static Class < ? > getSingleGeneric ( ResolvableType resolvableType ) { } public static Class [ ] resolveTypeArguments ( Class < ? > clazz , Class < ? > genericIfc ) { ResolvableType type = ResolvableType . forClass ( clazz ) . as ( genericIfc ) ; if ( ! ( type . hasGenerics ( ) ) ) { return null ; } <START_BUG> return type . resolveGenerics ( ) ; <END_BUG> } @ Deprecated public static Class < ? > resolveType ( Type genericType , Map < TypeVariable , Type > map ) { } @ Deprecated public static Map < TypeVariable , Type > getTypeVariableMap ( Class < ? > clazz ) { } private static void buildTypeVariableMap ( ResolvableType type , Map < TypeVariable , Type > typeVariableMap ) { } @ SuppressWarnings ( "serial" ) private static class TypeVariableMapVariableResolver implements ResolvableType . VariableResolver { private final Map < TypeVariable , Type > typeVariableMap ; public TypeVariableMapVariableResolver ( Map < TypeVariable , Type > typeVariableMap ) { } @ Override public ResolvableType resolveVariable ( TypeVariable < ? > variable ) { } @ Override public Object getSource ( ) { } } }

Fix:
return type . resolveGenerics ( Object . class ) ;
Buggy code:
public class MyDeque < T > { Object [ ] deque ; int first ; int last ; public MyDeque ( ) { } public T getFirst ( ) { if ( ( first ) != ( ( ( last ) + 1 ) % ( deque . length ) ) ) { if ( ( first ) > 0 ) { <START_BUG> return ( ( T ) ( deque [ ( ( first ) - 1 ) ] ) ) ; <END_BUG> } else { return ( ( T ) ( deque [ ( ( deque . length ) - 1 ) ] ) ) ; } } return null ; } public T getLast ( ) { } public void addFirst ( T value ) { } public void addLast ( T value ) { } public void add ( int ind , T value ) { } public void resize ( int newLength ) { } public T removeFirst ( ) { } public T removeLast ( ) { } public String toString ( ) { } }

Fix:
return ( ( T ) ( deque [ ( ( ( first ) - 1 ) % ( deque . length ) ) ] ) ) ;
Buggy code:
public class MarkupCache { private static final Log log = LogFactory . getLog ( MarkupCache . class ) ; private final Map markupCache = new ConcurrentHashMap ( ) ; private final Watcher afterLoadListeners = new Watcher ( ) ; private final Application application ; public MarkupCache ( final Application application ) { } public final MarkupStream getMarkupStream ( final MarkupContainer container ) { } public final MarkupStream getMarkupStream ( final MarkupContainer container , final boolean throwException ) { } public final boolean hasAssociatedMarkup ( final MarkupContainer container ) { } private MarkupResourceStream newMarkupResourceStream ( final Class containerClass , final ContainerInfo containerInfo ) { <START_BUG> IResourceStream markupResource = application . getResourceSettings ( ) . getResourceStreamLocator ( ) . locate ( containerClass , containerInfo . getStyle ( ) , containerInfo . getLocale ( ) , containerInfo . getFileExtension ( ) ) ; <END_BUG> if ( markupResource == null ) { return null ; } return new MarkupResourceStream ( markupResource , containerInfo , containerClass ) ; } private final Markup getMarkup ( final ContainerInfo containerInfo , final Class clazz ) { } private final Markup loadMarkup ( final String key , final MarkupResourceStream markupResourceStream ) { } private final Markup loadMarkupAndWatchForChanges ( final String key , final MarkupResourceStream markupResourceStream ) { } private final String markupKey ( final ContainerInfo containerInfo , final Class clazz ) { } public void clear ( ) { } private Markup checkForMarkupInheritance ( final String key , final Markup markup ) { } private int requiresBaseMarkup ( final Markup markup ) { } }

Fix:
IResourceStream markupResource = application . getResourceSettings ( ) . getResourceStreamLocator ( ) . locate ( containerClass , containerClass . getName ( ) . replace ( '.' , '//' ) , containerInfo . getStyle ( ) , containerInfo . getLocale ( ) , containerInfo . getFileExtension ( ) ) ;
Buggy code:
@ Service ( "documentService" ) public class DocumentService { private static final Logger log = LoggerFactory . getLogger ( DocumentService . class ) ; @ Autowired protected IdentityService identityService ; @ Autowired protected RuntimeService runtimeService ; @ Autowired protected TaskService taskService ; @ Autowired protected UserService userService ; @ Autowired protected InvoiceDao invoiceDao ; @ Autowired protected BookReportDao bookReportDao ; @ Autowired protected WorkflowService workflowService ; @ Transactional ( readOnly = true ) public List < Document > getGroupDocumentsByUser ( String userId ) { } @ Transactional public String createDocument ( Document document ) { } public void submitToWorkflow ( String docId ) { } @ Transactional public void updateDocument ( Document document ) { } @ Transactional ( readOnly = true ) public Document getDocument ( String id ) { <START_BUG> return null ; <END_BUG> } private Document _getDocument ( String id ) { } }

Fix:
return this . _getDocument ( id ) ;
Buggy code:
public class TestDemo extends LuceneTestCase { public void testDemo ( ) throws IOException , ParseException { Analyzer analyzer = new org . apache . lucene . analysis . standard . StandardAnalyzer ( Version . LUCENE_CURRENT ) ; Directory directory = new RAMDirectory ( ) ; IndexWriter iwriter = new IndexWriter ( directory , analyzer , true , new IndexWriter . MaxFieldLength ( 25000 ) ) ; Document doc = new Document ( ) ; String text = "This<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>text<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>indexed." ; doc . add ( new org . apache . lucene . document . Field ( "fieldname" , text , Store . YES , Index . ANALYZED ) ) ; iwriter . addDocument ( doc ) ; iwriter . close ( ) ; IndexSearcher isearcher = new IndexSearcher ( directory , true ) ; <START_BUG> QueryParser parser = new QueryParser ( "fieldname" , analyzer ) ; <END_BUG> Query query = parser . parse ( "text" ) ; ScoreDoc [ ] hits = isearcher . search ( query , null , 1000 ) . scoreDocs ; assertEquals ( 1 , hits . length ) ; for ( int i = 0 ; i < ( hits . length ) ; i ++ ) { Document hitDoc = isearcher . doc ( hits [ i ] . doc ) ; assertEquals ( "This<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>text<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>indexed." , hitDoc . get ( "fieldname" ) ) ; } isearcher . close ( ) ; directory . close ( ) ; } }

Fix:
QueryParser parser = new QueryParser ( Version . LUCENE_CURRENT , "fieldname" , analyzer ) ;
Buggy code:
public class BrowseHandler extends AbstractHandler { public Object execute ( ExecutionEvent event ) throws ExecutionException { IWorkbenchWindow window = HandlerUtil . getActiveWorkbenchWindowChecked ( event ) ; IContainerManager containerManager = Activator . getDefault ( ) . getContainerManager ( ) ; IContainer [ ] containers = containerManager . getAllContainers ( ) ; BrowseDialog dialog = new BrowseDialog ( window . getShell ( ) , containers ) ; int status = dialog . open ( ) ; if ( status == ( Window . OK ) ) { Object [ ] object = dialog . getResult ( ) ; IRosterEntry entry = ( ( IRosterEntry ) ( object [ 0 ] ) ) ; IRoster roster = entry . getRoster ( ) ; if ( roster != null ) { IChatManager manager = roster . getPresenceContainerAdapter ( ) . getChatManager ( ) ; IChatMessageSender icms = manager . getChatMessageSender ( ) ; ITypingMessageSender itms = manager . getTypingMessageSender ( ) ; try { MessagesView view = ( ( MessagesView ) ( window . getActivePage ( ) . showView ( VIEW_ID ) ) ) ; <START_BUG> view . selectTab ( icms , itms , roster . getUser ( ) . getID ( ) , entry . getUser ( ) . getID ( ) ) ; <END_BUG> } catch ( PartInitException e ) { e . printStackTrace ( ) ; } } } return null ; } }

Fix:
view . selectTab ( icms , itms , roster . getUser ( ) . getID ( ) , entry . getUser ( ) . getID ( ) , entry . getUser ( ) . getName ( ) ) ;
Buggy code:
public class SystemTable { private static Logger logger = LoggerFactory . getLogger ( SystemTable . class ) ; public static final String STATUS_CF = "LocationInfo" ; public static final String INDEX_CF = "IndexInfo" ; private static final ByteBuffer LOCATION_KEY = ByteBufferUtil . bytes ( "L" ) ; private static final ByteBuffer RING_KEY = ByteBufferUtil . bytes ( "Ring" ) ; private static final ByteBuffer BOOTSTRAP_KEY = ByteBufferUtil . bytes ( "Bootstrap" ) ; private static final ByteBuffer COOKIE_KEY = ByteBufferUtil . bytes ( "Cookies" ) ; private static final ByteBuffer BOOTSTRAP = ByteBufferUtil . bytes ( "B" ) ; private static final ByteBuffer TOKEN = ByteBufferUtil . bytes ( "Token" ) ; private static final ByteBuffer GENERATION = ByteBufferUtil . bytes ( "Generation" ) ; private static final ByteBuffer CLUSTERNAME = ByteBufferUtil . bytes ( "ClusterName" ) ; private static final ByteBuffer PARTITIONER = ByteBufferUtil . bytes ( "Partioner" ) ; private static DecoratedKey decorate ( ByteBuffer key ) { } public static void purgeIncompatibleHints ( ) throws IOException { } public static synchronized void updateToken ( InetAddress ep , Token token ) { } public static synchronized void removeToken ( Token token ) { } public static synchronized void updateToken ( Token token ) { } private static void forceBlockingFlush ( String cfname ) { } public static HashMap < Token , InetAddress > loadTokens ( ) { } public static void checkHealth ( ) throws IOException , ConfigurationException { } public static Token getSavedToken ( ) { } public static int incrementAndGetGeneration ( ) throws IOException { } public static boolean isBootstrapped ( ) { Table table = Table . open ( SYSTEM_TABLE ) ; QueryFilter filter = QueryFilter . getNamesFilter ( SystemTable . decorate ( SystemTable . BOOTSTRAP_KEY ) , new QueryPath ( SystemTable . STATUS_CF ) , SystemTable . BOOTSTRAP ) ; ColumnFamily cf = table . getColumnFamilyStore ( SystemTable . STATUS_CF ) . getColumnFamily ( filter ) ; if ( cf == null ) return false ; IColumn c = cf . getColumn ( SystemTable . BOOTSTRAP ) ; <START_BUG> return ( c . value ( ) . get ( 0 ) ) == 1 ; <END_BUG> } public static void setBootstrapped ( boolean isBootstrapped ) { } public static boolean isIndexBuilt ( String table , String indexName ) { } public static void setIndexBuilt ( String table , String indexName ) { } public static void setIndexRemoved ( String table , String indexName ) { } }

Fix:
return ( c . value ( ) . get ( c . value ( ) . position ( ) ) ) == 1 ;
Buggy code:
public class ClassicalRungeKuttaIntegratorTest extends TestCase { public ClassicalRungeKuttaIntegratorTest ( String name ) { } public void testSanityChecks ( ) { } public void testDecreasingSteps ( ) throws DerivativeException , IntegratorException { TestProblemAbstract [ ] problems = TestProblemFactory . getProblems ( ) ; for ( int k = 0 ; k < ( problems . length ) ; ++ k ) { double previousError = Double . NaN ; for ( int i = 4 ; i < 10 ; ++ i ) { <START_BUG> TestProblemAbstract pb = ( ( TestProblemAbstract ) ( problems [ k ] . clone ( ) ) ) ; <END_BUG> double step = ( ( pb . getFinalTime ( ) ) - ( pb . getInitialTime ( ) ) ) * ( Math . pow ( 2.0 , ( - i ) ) ) ; FirstOrderIntegrator integ = new ClassicalRungeKuttaIntegrator ( step ) ; TestProblemHandler handler = new TestProblemHandler ( pb , integ ) ; integ . addStepHandler ( handler ) ; EventHandler [ ] functions = pb . getEventsHandlers ( ) ; for ( int l = 0 ; l < ( functions . length ) ; ++ l ) { integ . addEventHandler ( functions [ l ] , Double . POSITIVE_INFINITY , ( 1.0E-6 * step ) , 1000 ) ; } assertEquals ( functions . length , integ . getEventHandlers ( ) . size ( ) ) ; double stopTime = integ . integrate ( pb , pb . getInitialTime ( ) , pb . getInitialState ( ) , pb . getFinalTime ( ) , new double [ pb . getDimension ( ) ] ) ; if ( ( functions . length ) == 0 ) { assertEquals ( pb . getFinalTime ( ) , stopTime , 1.0E-10 ) ; } double error = handler . getMaximalValueError ( ) ; if ( i > 4 ) { assertTrue ( ( error < ( Math . abs ( previousError ) ) ) ) ; } previousError = error ; assertEquals ( 0 , handler . getMaximalTimeError ( ) , 1.0E-12 ) ; integ . clearEventHandlers ( ) ; assertEquals ( 0 , integ . getEventHandlers ( ) . size ( ) ) ; } } } public void testSmallStep ( ) throws DerivativeException , IntegratorException { } public void testBigStep ( ) throws DerivativeException , IntegratorException { } public void testBackward ( ) throws DerivativeException , IntegratorException { } public void testKepler ( ) throws DerivativeException , IntegratorException { } private static class KeplerHandler implements StepHandler { public KeplerHandler ( TestProblem3 pb ) { } public boolean requiresDenseOutput ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) throws DerivativeException { } private double maxError = 0 ; private TestProblem3 pb ; } public void testStepSize ( ) throws DerivativeException , IntegratorException { } public static Test suite ( ) { } }

Fix:
TestProblemAbstract pb = problems [ k ] . copy ( ) ;
Buggy code:
public class StructureCreator { private HashMap < Location , Block > blocks = new HashMap < Location , Block > ( ) ; private HashMap < Block , Integer > metas = new HashMap < Block , Integer > ( ) ; private HashMap < Location , StructureCreator . ICheckBlockValidity > errorCheckers = new HashMap < Location , StructureCreator . ICheckBlockValidity > ( ) ; public void addBlock ( Location location , Block block ) { } public void addBlock ( Location location , Block block , int meta ) { } public void addBlock ( Location location , Block block , int meta , StructureCreator . ICheckBlockValidity validityChecker ) { } public boolean isStructureValid ( ) { } public void generateStructure ( ) { } public void generateStructure ( boolean forceOptionalBlocks ) { } public void generateStructure ( boolean forceOptionalBlocks , boolean forceNonOptionalBlocks ) { if ( ( ! forceNonOptionalBlocks ) && ( ! ( isStructureValid ( ) ) ) ) return ; for ( Location l : blocks . keySet ( ) ) { if ( ( errorCheckers . get ( l ) . isBlockValid ( blocks . get ( l ) , metas . get ( blocks . get ( l ) ) , l ) ) || forceOptionalBlocks ) <START_BUG> l . getWorld ( ) . setBlock ( l . getRoundedX ( ) , l . getRoundedY ( ) , l . getRoundedZ ( ) , blocks . get ( l ) , 0 , 2 ) ; <END_BUG> } } public static class DefaultValidityChecker implements StructureCreator . ICheckBlockValidity { @ Override public boolean isBlockValid ( Block block , int meta , Location location ) { } @ Override public boolean canStructureGenerate ( Block block , int meta , Location location ) { } } public static interface ICheckBlockValidity { public boolean isBlockValid ( Block block , int meta , Location location ) { } public boolean canStructureGenerate ( Block block , int meta , Location location ) { } } }

Fix:
l . getWorld ( ) . setBlock ( l . getRoundedX ( ) , l . getRoundedY ( ) , l . getRoundedZ ( ) , blocks . get ( l ) , metas . get ( blocks . get ( l ) ) , 2 ) ;
Buggy code:
public class NimbusClient { public static NimbusClient getConfiguredClient ( Map conf ) { String nimbusHost = ( ( String ) ( conf . get ( NIMBUS_HOST ) ) ) ; <START_BUG> int nimbusPort = ( ( Long ) ( conf . get ( NIMBUS_THRIFT_PORT ) ) ) . intValue ( ) ; <END_BUG> return new NimbusClient ( nimbusHost , nimbusPort ) ; } private TTransport conn ; private Client client ; public NimbusClient ( String host ) { } public NimbusClient ( String host , int port ) { } public Client getClient ( ) { } public void close ( ) { } }

Fix:
int nimbusPort = Utils . getInt ( conf . get ( NIMBUS_THRIFT_PORT ) ) ;
Buggy code:
public class QueueDefinition extends SimpleResourceDefinition { public static final PathElement PATH = PathElement . pathElement ( QUEUE ) ; public static final SimpleAttributeDefinition ADDRESS = create ( "queue-address" , STRING ) . setXmlName ( CommonAttributes . ADDRESS ) . setAllowExpression ( true ) . setRestartAllServices ( ) . build ( ) ; static final SimpleAttributeDefinition [ ] ATTRIBUTES = new SimpleAttributeDefinition [ ] { QueueDefinition . ADDRESS , CommonAttributes . FILTER , CommonAttributes . DURABLE } ; public static final SimpleAttributeDefinition EXPIRY_ADDRESS = create ( CommonAttributes . EXPIRY_ADDRESS ) . setStorageRuntime ( ) . build ( ) ; public static final SimpleAttributeDefinition DEAD_LETTER_ADDRESS = create ( CommonAttributes . DEAD_LETTER_ADDRESS ) . setStorageRuntime ( ) . build ( ) ; static final AttributeDefinition ID = create ( "id" , LONG ) . setStorageRuntime ( ) . build ( ) ; static final AttributeDefinition [ ] READONLY_ATTRIBUTES = new AttributeDefinition [ ] { CommonAttributes . PAUSED , CommonAttributes . TEMPORARY , QueueDefinition . ID , QueueDefinition . DEAD_LETTER_ADDRESS , QueueDefinition . EXPIRY_ADDRESS } ; static final AttributeDefinition [ ] METRICS = new AttributeDefinition [ ] { CommonAttributes . MESSAGE_COUNT , CommonAttributes . DELIVERING_COUNT , CommonAttributes . MESSAGES_ADDED , CommonAttributes . SCHEDULED_COUNT , CommonAttributes . CONSUMER_COUNT } ; public static QueueDefinition newRuntimeQueueDefinition ( final boolean registerRuntimeOnly ) { } public static QueueDefinition newQueueDefinition ( final boolean registerRuntimeOnly ) { } private final boolean registerRuntimeOnly ; private final boolean runtimeOnly ; private final List < AccessConstraintDefinition > accessConstraints ; private QueueDefinition ( final boolean registerRuntimeOnly , final boolean runtimeOnly , final String path , final AbstractAddStepHandler addHandler , final OperationStepHandler removeHandler ) { } @ Override public void registerAttributes ( ManagementResourceRegistration registry ) { } @ Override public void registerOperations ( ManagementResourceRegistration registry ) { super . registerOperations ( registry ) ; if ( registerRuntimeOnly ) { <START_BUG> INSTANCE . registerOperations ( registry , getResourceDescriptionResolver ( ) ) ; <END_BUG> } } @ Override public List < AccessConstraintDefinition > getAccessConstraints ( ) { } static boolean forwardToRuntimeQueue ( OperationContext context , ModelNode operation , OperationStepHandler handler ) { } }

Fix:
INSTANCE . registerOperations ( registry ) ;
Buggy code:
public class ExternalFoldersManager { private static final boolean DEBUG = false ; private static final String EXTERNAL_PROJECT_NAME = ".org.eclipse.jdt.core.external.folders" ; private static final String LINKED_FOLDER_NAME = ".link" ; private HashMap folders ; private int counter = 0 ; public static HashSet getExternalFolders ( IClasspathEntry [ ] classpath ) { } public static boolean isExternalFolderPath ( IPath externalPath ) { if ( externalPath == null ) return false ; if ( ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getProject ( externalPath . segment ( 0 ) ) . exists ( ) ) return false ; File externalFolder = externalPath . toFile ( ) ; if ( externalFolder . isFile ( ) ) return false ; <START_BUG> if ( ( org . eclipse . jdt . internal . compiler . util . Util . isArchiveFileName ( externalPath . lastSegment ( ) ) ) && ( ! ( externalFolder . exists ( ) ) ) ) <END_BUG> return false ; return true ; } public static boolean isInternalPathForExternalFolder ( IPath resourcePath ) { } public IFolder addFolder ( IPath externalFolderPath ) { } private synchronized IFolder addFolder ( IPath externalFolderPath , IProject externalFoldersProject ) { } public IFolder createLinkFolder ( IPath externalFolderPath , boolean refreshIfExistAlready , IProgressMonitor monitor ) throws CoreException { } public synchronized void cleanUp ( IProgressMonitor monitor ) throws CoreException { } public IProject getExternalFoldersProject ( ) { } private IProject createExternalFoldersProject ( IProgressMonitor monitor ) { } public synchronized IFolder getFolder ( IPath externalFolderPath ) { } private HashMap getFolders ( ) { } public void refreshReferences ( IProject source , IProgressMonitor monitor ) { } public synchronized IFolder removeFolder ( IPath externalFolderPath ) { } }

Fix:
if ( ( ( externalPath . getFileExtension ( ) ) != null ) && ( ! ( externalFolder . exists ( ) ) ) )
Buggy code:
public class NcwmsCatalogue extends DataCatalogue implements WmsCatalogue { private static final String DYNAMIC_DATASET_CACHE_NAME = "dynamicDatasetCache" ; private StyleCatalogue styleCatalogue ; public NcwmsCatalogue ( NcwmsConfig config ) throws IOException { } public NcwmsConfig getConfig ( ) { } @ Override public ServerInfo getServerInfo ( ) { } @ Override public ContactInfo getContactInfo ( ) { } @ Override public Dataset getDatasetFromId ( String datasetId ) { } @ Override public EnhancedVariableMetadata getLayerMetadata ( final VariableMetadata variableMetadata ) throws EdalLayerNotFoundException { } private NcwmsDynamicService getDynamicServiceFromLayerName ( String layerName ) { } @ Override public LayerNameMapper getLayerNameMapper ( ) { } @ Override public StyleCatalogue getStyleCatalogue ( ) { } @ Override public String getDatasetTitle ( String datasetId ) { } @ Override public boolean isDownloadable ( String layerName ) { VariableConfig xmlVariable = getXmlVariable ( layerName ) ; if ( xmlVariable != null ) { <START_BUG> xmlVariable . isDownloadable ( ) ; <END_BUG> } else { NcwmsDynamicService dynamicService = getDynamicServiceFromLayerName ( layerName ) ; if ( dynamicService != null ) { return dynamicService . isDownloadable ( ) ; } } return false ; } @ Override public boolean isQueryable ( String layerName ) { } @ Override public boolean isDisabled ( String layerName ) { } private VariableConfig getXmlVariable ( String layerName ) { } }

Fix:
return xmlVariable . isDownloadable ( ) ;
Buggy code:
public class LoopingFlowContext extends SwitchFlowContext { public Label continueLabel ; public UnconditionalFlowInfo initsOnContinue = FlowInfo . DEAD_END ; Reference [ ] finalAssignments ; VariableBinding [ ] finalVariables ; int assignCount = 0 ; Scope associatedScope ; public LoopingFlowContext ( FlowContext parent , AstNode associatedNode , Label breakLabel , Label continueLabel , Scope associatedScope ) { } public void complainOnFinalAssignmentsInLoop ( BlockScope scope , FlowInfo flowInfo ) { } public Label continueLabel ( ) { } public String individualToString ( ) { } public boolean isContinuable ( ) { } public boolean isContinuedTo ( ) { } public void recordContinueFrom ( FlowInfo flowInfo ) { if ( ! ( flowInfo . isReachable ( ) ) ) return ; if ( ( initsOnContinue ) == ( FlowInfo . DEAD_END ) ) { initsOnContinue = flowInfo . copy ( ) . unconditionalInits ( ) ; } else { <START_BUG> initsOnContinue = initsOnContinue . mergedWith ( flowInfo . unconditionalInits ( ) ) ; <END_BUG> } } boolean recordFinalAssignment ( VariableBinding binding , Reference finalAssignment ) { } void removeFinalAssignmentIfAny ( Reference reference ) { } }

Fix:
initsOnContinue = initsOnContinue . mergedWith ( flowInfo . copy ( ) . unconditionalInits ( ) ) ;
Buggy code:
public class FieldDeclaration extends BodyDeclaration { public static final ChildPropertyDescriptor JAVADOC_PROPERTY = BodyDeclaration . internalJavadocPropertyFactory ( FieldDeclaration . class ) ; public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = BodyDeclaration . internalModifiersPropertyFactory ( FieldDeclaration . class ) ; public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = BodyDeclaration . internalModifiers2PropertyFactory ( FieldDeclaration . class ) ; public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor ( FieldDeclaration . class , "type" , Type . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; public static final ChildListPropertyDescriptor FRAGMENTS_PROPERTY = new ChildListPropertyDescriptor ( FieldDeclaration . class , "fragments" , VariableDeclarationFragment . class , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS_2_0 ; private static final List PROPERTY_DESCRIPTORS_3_0 ; public static List propertyDescriptors ( int apiLevel ) { } private Type baseType = null ; private ASTNode . NodeList variableDeclarationFragments = new ASTNode . NodeList ( FieldDeclaration . FRAGMENTS_PROPERTY ) ; FieldDeclaration ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final int internalGetSetIntProperty ( SimplePropertyDescriptor property , boolean get , int value ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { } final ChildPropertyDescriptor internalJavadocProperty ( ) { } final SimplePropertyDescriptor internalModifiersProperty ( ) { } final ChildListPropertyDescriptor internalModifiers2Property ( ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Type getType ( ) { if ( ( this . baseType ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . baseType ) == null ) { preLazyInit ( ) ; this . baseType = this . ast . newPrimitiveType ( PrimitiveType . INT ) ; postLazyInit ( this . baseType , FieldDeclaration . TYPE_PROPERTY ) ; } } } return this . baseType ; } public void setType ( Type type ) { } public List fragments ( ) { } void appendDebugString ( StringBuffer buffer ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
synchronized ( this ) {
Buggy code:
@ RunAsClient @ RunWith ( Arquillian . class ) public class DeploymentTestCase { private static final long TIMEOUT = 10000 ; private static final String WAR_JBOSS_FILE = "jboss-web.xml" ; private static final String JAR_JBOSS_FILE = "jboss.xml" ; private static final String EAR_JBOSS_FILE = "jboss-app.xml" ; @ Test public void testDeployUndeployEAR ( ) throws Exception { } private DeploymentManager getDeploymentManager ( ) throws Exception { } private ProgressObject jsr88Deploy ( DeploymentManager manager , Archive < ? > archive ) throws Exception { } private ProgressObject jsr88Undeploy ( DeploymentManager manager , TargetModuleID [ ] resultTargetModuleIDs ) throws Exception { } private StateType awaitCompletion ( ProgressObject progress , long timeout ) throws InterruptedException { } private void assertServletAccess ( String context ) throws IOException { } private InputStream createDeploymentPlan ( String deploymentFile ) throws Exception { boolean webInf = false ; String jbossDescriptorName = null ; if ( deploymentFile . endsWith ( ".war" ) ) { jbossDescriptorName = DeploymentTestCase . WAR_JBOSS_FILE ; webInf = true ; } else if ( deploymentFile . endsWith ( ".jar" ) ) { jbossDescriptorName = DeploymentTestCase . JAR_JBOSS_FILE ; } else if ( deploymentFile . endsWith ( ".ear" ) ) { jbossDescriptorName = DeploymentTestCase . EAR_JBOSS_FILE ; } ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; JarOutputStream plan = new JarOutputStream ( baos ) ; <START_BUG> URL descriptorURL = getClass ( ) . getClassLoader ( ) . getResource ( ( ( DeploymentTestCase . class . getPackage ( ) . getName ( ) . replace ( "." , "//" ) ) + jbossDescriptorName ) ) ; <END_BUG> File jbossDescriptorFile = new File ( descriptorURL . getPath ( ) ) ; JarUtils . addJarEntry ( plan , ( ( "!//" + ( webInf ? "WEB-INF//" : "META-INF//" ) ) + jbossDescriptorName ) , new FileInputStream ( jbossDescriptorFile ) ) ; DeploymentMetaData metaData = new DeploymentMetaData ( deploymentFile ) ; metaData . addEntry ( deploymentFile , jbossDescriptorName ) ; String metaStr = metaData . toXMLString ( ) ; JarUtils . addJarEntry ( plan , ENTRY_NAME , new ByteArrayInputStream ( metaStr . getBytes ( ) ) ) ; plan . flush ( ) ; plan . close ( ) ; return new ByteArrayInputStream ( baos . toByteArray ( ) ) ; } private Archive < ? > getWebArchive ( ) { } private Archive < ? > getEjbArchive ( ) { } private Archive < ? > getEarArchive ( ) { } }

Fix:
URL descriptorURL = getClass ( ) . getClassLoader ( ) . getResource ( ( ( ( DeploymentTestCase . class . getPackage ( ) . getName ( ) . replace ( "." , "//" ) ) + "//" ) + jbossDescriptorName ) ) ;
Buggy code:
public class User extends EtaObject implements Serializable { private static final long serialVersionUID = 1L ; public static final String TAG = "User" ; public static final String PARAM_EMAIL = Params . EMAIL ; public static final String PARAM_PASSWORD = Params . PASSWORD ; public static final String PARAM_BIRTH_YEAR = Params . BIRTH_YEAR ; public static final String PARAM_GENDER = Params . GENDER ; public static final String PARAM_SUCCESS_REDIRECT = Params . SUCCESS_REDIRECT ; public static final String PARAM_ERROR_REDIRECT = Params . ERROR_REDIRECT ; public static final String PARAM_OLD_PASSWORD = Params . OLD_PASSWORD ; public static final String PARAM_FACEBOOK_TOKEN = Params . FACEBOOK_TOKEN ; public static final String ENDPOINT_ID = Endpoint . USER_ID ; public static final String ENDPOINT_RESET = Endpoint . USER_RESET ; public static final int NO_USER = - 1 ; private int mId = User . NO_USER ; private String mErn ; private String mGender ; private int mBirthYear = 0 ; private String mName ; private String mEmail ; private Permission mPermissions ; private ArrayList < User . UserStatusListener > mSubscribers = new ArrayList < User . UserStatusListener > ( ) ; public User ( ) { } public static User fromJSON ( String user ) { } @ SuppressWarnings ( "unchecked" ) public static User fromJSON ( JSONObject user ) { } private static User fromJSON ( User u , JSONObject user ) { } public JSONObject toJSON ( ) { } public static JSONObject toJSON ( User u ) { } public boolean isLoggedIn ( ) { <START_BUG> return ( ( mEmail ) != null ) && ( ( mId ) != 0 ) ; <END_BUG> } public int getId ( ) { } public User setId ( int id ) { } public String getErn ( ) { } public User setErn ( String ern ) { } public String getGender ( ) { } public User setGender ( String gender ) { } public int getBirthYear ( ) { } public User setBirthYear ( int birthYear ) { } public String getName ( ) { } public User setName ( String name ) { } public String getEmail ( ) { } public User setEmail ( String email ) { } public Permission getPermissions ( ) { } public void setPermissions ( Permission permissions ) { } public String getFacebookEndpoint ( ) { } public void subscribe ( User . UserStatusListener statusListener ) { } public void unsubscribe ( User . UserStatusListener statusListener ) { } public void notifySubscribers ( Integer response , Object object ) { } public interface UserStatusListener { public void onStatusChange ( Integer response , Object object ) { } } @ Override public boolean equals ( Object o ) { } @ Override public String toString ( ) { } public String toString ( boolean everything ) { } No newline ; at end ; of file ; }

Fix:
return ( ( mEmail ) != null ) && ( ( mId ) > ( - 1 ) ) ;
Buggy code:
public class BundleResolveSubProcessor implements DeploymentUnitProcessor { @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { DeploymentUnit depUnit = phaseContext . getDeploymentUnit ( ) ; Deployment deployment = depUnit . getAttachment ( DEPLOYMENT_KEY ) ; <START_BUG> XBundle bundle = depUnit . getAttachment ( INSTALLED_BUNDLE_KEY ) ; <END_BUG> if ( ( bundle == null ) || ( ( deployment . isAutoStart ( ) ) == false ) ) return ; if ( ( depUnit . getParent ( ) ) == null ) return ; BundleResolveProcessor . resolveBundle ( phaseContext , bundle ) ; } @ Override public void undeploy ( final DeploymentUnit depUnit ) { } }

Fix:
XBundle bundle = depUnit . getAttachment ( BUNDLE_KEY ) ;
Buggy code:
public class ValidatorMetaDataParser extends MetaDataElementParser { public static ValidatorMetaData parse ( XMLStreamReader reader ) throws XMLStreamException { ValidatorMetaData validator = new ValidatorMetaData ( ) ; final int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { final String value = reader . getAttributeValue ( i ) ; if ( ( reader . getAttributeNamespace ( i ) ) != null ) { continue ; } final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; switch ( attribute ) { case ID : { validator . setId ( value ) ; break ; } default : throw unexpectedAttribute ( reader , i ) ; } } DescriptionsImpl descriptions = new DescriptionsImpl ( ) ; while ( ( reader . hasNext ( ) ) && ( ( reader . nextTag ( ) ) != ( END_ELEMENT ) ) ) { if ( DescriptionsMetaDataParser . parse ( reader , descriptions ) ) { if ( ( validator . getDescriptions ( ) ) == null ) { validator . setDescriptions ( descriptions ) ; } continue ; } final Element element = Element . forName ( reader . getLocalName ( ) ) ; switch ( element ) { case VALIDATOR_CLASS : <START_BUG> validator . setValidatorClass ( reader . getElementText ( ) ) ; <END_BUG> break ; case INIT_PARAM : List < ParamValueMetaData > initParams = validator . getInitParams ( ) ; if ( initParams == null ) { initParams = new ArrayList < ParamValueMetaData > ( ) ; validator . setInitParams ( initParams ) ; } initParams . add ( ParamValueMetaDataParser . parse ( reader ) ) ; break ; default : throw unexpectedElement ( reader ) ; } } return validator ; } }

Fix:
validator . setValidatorClass ( reader . getElementText ( ) . trim ( ) ) ;
Buggy code:
public abstract class DocValuesWriterBase extends PerDocConsumer { protected final String segmentName ; protected final String segmentSuffix ; private final Counter bytesUsed ; protected final IOContext context ; protected DocValuesWriterBase ( PerDocWriteState state ) { } protected abstract Directory getDirectory ( ) throws IOException { } @ Override public void close ( ) throws IOException { } @ Override public DocValuesConsumer addValuesField ( FieldInfo field ) throws IOException { } public static String docValuesId ( String segmentsName , int fieldId ) { <START_BUG> return ( segmentsName + "-" ) + fieldId ; <END_BUG> } public Comparator < BytesRef > getComparator ( ) throws IOException { } }

Fix:
return ( segmentsName + "_" ) + fieldId ;