nus-yam/ex-repair huggingface dataset:
Buggy code:
public class DeploymentAddHandlerTestCase { @ Ignore ( "TODO:<seq2seq4repair_space>JBAS-9020:<seq2seq4repair_space>Archive<seq2seq4repair_space>deployments<seq2seq4repair_space>are<seq2seq4repair_space>not<seq2seq4repair_space>yet<seq2seq4repair_space>implemented" ) @ Test public void testContent ( ) throws OperationFailedException { final DeploymentAddHandler handler = DeploymentAddHandler . create ( contentRepository , null ) ; final OperationContext context = Mockito . mock ( OperationContext . class ) ; Mockito . when ( context . getResult ( ) ) . thenReturn ( new ModelNode ( ) ) ; <START_BUG> Mockito . when ( context . readModelForUpdate ( EMPTY_ADDRESS ) ) . thenReturn ( new ModelNode ( ) ) ; <END_BUG> Mockito . when ( context . getProcessType ( ) ) . thenReturn ( STANDALONE_SERVER ) ; Mockito . when ( context . getRunningMode ( ) ) . thenReturn ( NORMAL ) ; Mockito . when ( context . isNormalServer ( ) ) . thenReturn ( true ) ; final ModelNode operation = new ModelNode ( ) ; operation . get ( "address" ) . get ( 0 ) . setExpression ( "deployment" , "test.war" ) ; operation . get ( "content" ) . get ( 0 ) . get ( "archive" ) . set ( true ) ; operation . get ( "content" ) . get ( 0 ) . get ( "path" ) . set ( "test.war" ) ; handler . execute ( context , operation ) ; Mockito . verify ( context ) . addStep ( Mockito . any ( OperationStepHandler . class ) , RUNTIME ) ; Mockito . verify ( context ) . stepCompleted ( ) ; } @ Test ( expected = OperationFailedException . class ) public void testTooMuchContent ( ) throws OperationFailedException { } @ Test public void testValidator ( ) throws OperationFailedException { } private ContentRepository contentRepository = new ContentRepository ( ) { @ Override public void removeContent ( byte [ ] hash , Object reference ) { } @ Override public boolean syncContent ( byte [ ] hash ) { } @ Override public boolean hasContent ( byte [ ] hash ) { } @ Override public VirtualFile getContent ( byte [ ] hash ) { } @ Override public byte [ ] addContent ( InputStream stream ) throws IOException { } @ Override public void addContentReference ( byte [ ] hash , Object reference ) { } } ; }

Fix:
Mockito . when ( context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) ) . thenReturn ( new ModelNode ( ) ) ;
Buggy code:
public class SyntheticBackPressureTest { private static final ILogger log = Logger . getLogger ( SyntheticBackPressureTest . class ) ; public boolean syncInvocation = true ; public int syncBackupCount = 0 ; public int asyncBackupCount = 1 ; public long backupDelayNanos = 1000 * 1000 ; public boolean randomizeBackupDelay = true ; public int threadCount = 10 ; public int logFrequency = 10000 ; public int performanceUpdateFrequency = 1000 ; public KeyLocality keyLocality = KeyLocality . Random ; public int syncFrequency = 1 ; private AtomicLong operations = new AtomicLong ( ) ; private TestContext context ; private HazelcastInstance targetInstance ; public IntervalProbe latency ; @ Setup public void setup ( TestContext context ) throws Exception { } @ Teardown public void teardown ( ) throws Exception { } @ Run public void run ( ) { } @ Performance public long getOperationCount ( ) { } private class Worker implements ExecutionCallback , Runnable { private final ArrayList < Integer > partitionSequence = new ArrayList < Integer > ( ) ; private final Random random = new Random ( ) ; private final OperationService operationService ; private final boolean isClient ; private final ClientInvocationService clientInvocationService ; private final ClientPartitionService clientPartitionService ; private final ArrayList < ICompletableFuture > futureList = new ArrayList < ICompletableFuture > ( syncFrequency ) ; int partitionIndex = 0 ; public Worker ( ) { } @ Override public void onResponse ( Object response ) { <START_BUG> operations . addAndGet ( performanceUpdateFrequency ) ; <END_BUG> } @ Override public void onFailure ( Throwable t ) { } @ Override public void run ( ) { } public void doRun ( ) throws Exception { } private ICompletableFuture invoke ( int partitionId ) throws Exception { } private int nextPartitionId ( ) { } private long getBackupDelayNanos ( ) { } } public static void main ( String [ ] args ) throws Throwable { } }

Fix:
operations . addAndGet ( 1 ) ;
Buggy code:
public class ArrayLongsSegment extends LongsSegment { protected final long [ ] _buffer ; protected int _appendPtr ; protected int _readPtr ; public ArrayLongsSegment ( int size ) { } public static ArrayLongsSegment . Allocator allocator ( int segmentSize , int minSegmentsToRetain , int maxSegments ) { } @ Override public ArrayLongsSegment initForWriting ( ) { } @ Override public ArrayLongsSegment initForReading ( ) { } @ Override public void clear ( ) { } @ Override public final int availableForAppend ( ) { } @ Override public final int availableForReading ( ) { } @ Override public void append ( long [ ] src , int offset , int length ) { } @ Override public int tryAppend ( long [ ] src , int offset , int length ) { } @ Override public boolean tryAppend ( long value ) { } @ Override public int readLength ( ) { <START_BUG> if ( ( availableForReading ( ) ) > 1 ) { <END_BUG> return - 1 ; } return ( ( int ) ( _buffer [ ( ( _readPtr ) ++ ) ] ) ) ; } @ Override public void read ( long [ ] buffer , int offset , int length ) { } @ Override public int tryRead ( long [ ] buffer , int offset , int length ) { } @ Override public int skip ( int length ) { } public static class Allocator extends SegmentAllocatorBase < LongsSegment > { public Allocator ( int segmentSize , int minSegmentsToRetain , int maxSegments ) { } protected LongsSegment _allocateSegment ( ) { } } }

Fix:
if ( ( availableForReading ( ) ) < 1 ) {
Buggy code:
public class Configuration { public static final String DEFAULT_HOSTNAME = "bugswarm.net" ; public enum Protocol { HTTP , XMPP ; } private static final String HTTP_SCHEME = "HTTP:////" ; private static final String XMPP_PREFIX = "" ; private static final String HTTP_PREFIX = "api." ; private static final String BUG20_SYSFS_MACADDR_FILE = "//sys//devices//platform//ehci-omap.0//usb1//1-2//1-2.4//1-2.4:1.0//net//eth0//address" ; private static final int DEFAULT_XMPP_SERVER_PORT = 5222 ; private static final int DEFAULT_HTTP_SERVER_PORT = 80 ; private Dictionary < String , Object > config ; private final String resource ; public Configuration ( final String hostname , final String consumerApiKey , final String producerApiKey , final String username , final int httpPort , final int xmppPort ) { } public Configuration ( final Dictionary < String , Object > config ) { } private static String getMachineResource ( ) { } private static String readFirstLine ( final File file ) throws IOException { } public String getHostname ( final Configuration . Protocol protocol ) { } public int getHTTPPort ( ) { } public int getXMPPPort ( ) { } public String getConfingurationAPIKey ( ) { } public String getParticipationAPIKey ( ) { } public String getResource ( ) { } @ Override public String toString ( ) { } public String getUsername ( ) { } public static boolean isValid ( final Dictionary < String , Object > config ) { if ( config . isEmpty ( ) ) return false ; <START_BUG> if ( ( ( ! ( Configuration . hasEntry ( config , CONFIG_KEY_BUGSWARM_ENABLED ) ) ) || ( ( ! ( Configuration . hasEntry ( config , CONFIG_KEY_BUGSWARM_CONFIGURATION_APIKEY ) ) ) || ( ! ( Configuration . hasEntry ( config , CONFIG_KEY_BUGSWARM_PARTICIPATION_APIKEY ) ) ) ) ) || ( ! ( Configuration . hasEntry ( config , CONFIG_KEY_BUGSWARM_USERNAME ) ) ) ) <END_BUG> return false ; if ( ! ( Boolean . parseBoolean ( config . get ( CONFIG_KEY_BUGSWARM_ENABLED ) . toString ( ) ) ) ) return false ; return true ; } public boolean isValid ( ) { } private static boolean hasEntry ( final Dictionary < String , Object > dictionary , final String key ) { } }

Fix:
if ( ( ( ! ( Configuration . hasEntry ( config , CONFIG_KEY_BUGSWARM_ENABLED ) ) ) || ( ! ( Configuration . hasEntry ( config , CONFIG_KEY_BUGSWARM_PARTICIPATION_APIKEY ) ) ) ) || ( ! ( Configuration . hasEntry ( config , CONFIG_KEY_BUGSWARM_USERNAME ) ) ) )
Buggy code:
public class NetworkSettingsListView extends ListActivity { private static NetworkSettingsListView instance ; private List < JSONItem > items ; private NetworkSettingsListView . DataReceiver receiver ; private TextView lastRefresh ; public List < JSONItem > getItems ( ) { } public void setItems ( List < JSONItem > items ) { } public static NetworkSettingsListView getInstance ( ) { } @ Override protected void onCreate ( final Bundle savedState ) { } @ Override protected void onListItemClick ( final ListView listView , final View view , final int position , final long idVal ) { } protected void getData ( ) { } @ Override protected void onPause ( ) { } @ Override protected void onResume ( ) { } protected void updateList ( ) { JSONParsingResults results = new JSONParser ( ) . returnParsedData ( "//networkSettings.json" ) ; setItems ( results . getItem ( ) ) ; setListAdapter ( new android . widget . ArrayAdapter < String > ( this , layout . simple_list_item_1 , results . getNames ( ) ) ) ; <START_BUG> lastRefresh . setText ( ( "Refreshed<seq2seq4repair_space>on:<seq2seq4repair_space>" + ( new Date ( new File ( ( ( getFilesDir ( ) . toString ( ) ) + "//networkSettings.xml" ) ) . lastModified ( ) ) . toString ( ) ) ) ) ; <END_BUG> } class DataReceiver extends BroadcastReceiver { @ Override public void onReceive ( Context arg0 , Intent arg1 ) { } } No newline ; at end ; of file ; }

Fix:
lastRefresh . setText ( ( "Refreshed<seq2seq4repair_space>on:<seq2seq4repair_space>" + ( new Date ( new File ( ( ( getFilesDir ( ) . toString ( ) ) + "//networkSettings.json" ) ) . lastModified ( ) ) . toString ( ) ) ) ) ;
Buggy code:
public class RaDeploymentParsingProcessor implements DeploymentUnitProcessor { public RaDeploymentParsingProcessor ( ) { } @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final ResourceRoot deploymentRoot = phaseContext . getDeploymentUnit ( ) . getAttachment ( DEPLOYMENT_ROOT ) ; final VirtualFile file = deploymentRoot . getRoot ( ) ; if ( ( file == null ) || ( ! ( file . exists ( ) ) ) ) return ; final String deploymentRootName = file . getLowerCaseName ( ) ; if ( ! ( deploymentRootName . endsWith ( ".rar" ) ) ) { return ; } final VirtualFile alternateDescriptor = deploymentRoot . getAttachment ( ALTERNATE_CONNECTOR_DEPLOYMENT_DESCRIPTOR ) ; final VirtualFile serviceXmlFile ; if ( alternateDescriptor != null ) { serviceXmlFile = alternateDescriptor ; } else { serviceXmlFile = file . getChild ( "//META-INF//ra.xml" ) ; } InputStream xmlStream = null ; Connector result = null ; try { if ( ( serviceXmlFile != null ) && ( serviceXmlFile . exists ( ) ) ) { xmlStream = serviceXmlFile . openStream ( ) ; result = new RaParser ( ) . parse ( xmlStream ) ; if ( result == null ) throw ConnectorMessages . MESSAGES . failedToParseServiceXml ( serviceXmlFile ) ; } File root = file . getPhysicalFile ( ) ; URL url = root . toURI ( ) . toURL ( ) ; <START_BUG> String deploymentName = deploymentRootName . substring ( 0 , deploymentRootName . indexOf ( ".rar" ) ) ; <END_BUG> ConnectorXmlDescriptor xmlDescriptor = new ConnectorXmlDescriptor ( result , root , url , deploymentName ) ; phaseContext . getDeploymentUnit ( ) . putAttachment ( ATTACHMENT_KEY , xmlDescriptor ) ; } catch ( Exception e ) { throw ConnectorMessages . MESSAGES . failedToParseServiceXml ( e , serviceXmlFile ) ; } finally { VFSUtils . safeClose ( xmlStream ) ; } } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
String deploymentName = file . getName ( ) . substring ( 0 , file . getName ( ) . indexOf ( ".rar" ) ) ;
Buggy code:
public class ServiceURLAdapter { private URI uri ; private IServiceID serviceID ; public ServiceURLAdapter ( ServiceURL aServiceURL ) { } public ServiceURLAdapter ( ServiceURL aServiceURL , String [ ] scopes ) { } private void setURI ( ServiceURL aServiceURL ) { StringBuffer buf = new StringBuffer ( ) ; String protocol = aServiceURL . getProtocol ( ) ; if ( protocol == null ) { protocol = "unknown" ; } buf . append ( protocol ) ; buf . append ( ":////" ) ; buf . append ( aServiceURL . getHost ( ) ) ; buf . append ( ":" ) ; buf . append ( aServiceURL . getPort ( ) ) ; <START_BUG> buf . append ( "//" ) ; <END_BUG> uri = URI . create ( buf . toString ( ) ) ; } private void setIServiceID ( ServiceURL aServiceURL , String [ ] scopes ) { } public URI getURI ( ) { } public IServiceID getIServiceID ( ) { } }

Fix:
buf . append ( aServiceURL . getURLPath ( ) ) ;
Buggy code:
public class FeedbackMessage implements IClusterable { private static final long serialVersionUID = 1L ; public static final int DEBUG = 100 ; public static final int ERROR = 400 ; public static final int FATAL = 500 ; public static final int INFO = 200 ; public static final int UNDEFINED = 0 ; public static final int WARNING = 300 ; private static final String [ ] levelStrings = new String [ ] { "UNDEFINED" , "DEBUG" , "INFO" , "WARNING" , "ERROR" , "FATAL" } ; private final int level ; private final Serializable message ; private final Component reporter ; private boolean rendered = false ; public FeedbackMessage ( final Component reporter , final Serializable message , final int level ) { } public final boolean isRendered ( ) { } public final void markRendered ( ) { } public final int getLevel ( ) { } public String getLevelAsString ( ) { <START_BUG> return FeedbackMessage . levelStrings [ getLevel ( ) ] ; <END_BUG> } public final Serializable getMessage ( ) { } public final Component getReporter ( ) { } public final boolean isDebug ( ) { } public final boolean isError ( ) { } public final boolean isFatal ( ) { } public final boolean isInfo ( ) { } public final boolean isLevel ( int level ) { } public final boolean isUndefined ( ) { } public final boolean isWarning ( ) { } public String toString ( ) { } }

Fix:
return FeedbackMessage . levelStrings [ ( ( getLevel ( ) ) // 100 ) ] ;
Buggy code:
public class QueryResultResource { private static final Log LOG = LogFactory . getLog ( QueryResultResource . class ) ; private UriInfo uriInfo ; private Application application ; private String queryId ; private JerseyResourceDelegateContext context ; private static final String queryIdKeyName = "queryId" ; private static final String sessionIdKeyName = "sessionId" ; private static final String cacheIdKeyName = "cacheId" ; private static final String offsetKeyName = "offset" ; private static final String countKeyName = "count" ; private static final String tajoDigestHeaderName = "X-Tajo-Digest" ; public UriInfo getUriInfo ( ) { } public void setUriInfo ( UriInfo uriInfo ) { } public Application getApplication ( ) { } public void setApplication ( Application application ) { } public String getQueryId ( ) { } public void setQueryId ( String queryId ) { } private void initializeContext ( ) { } private static NonForwardQueryResultScanner getNonForwardQueryResultScanner ( MasterContext masterContext , Session session , QueryId queryId ) throws IOException { } @ GET @ Produces ( MediaType . APPLICATION_JSON ) public Response getQueryResult ( @ HeaderParam ( QueryResource . tajoSessionIdHeaderName ) String sessionId ) { } private static class GetQueryResultDelegate implements JerseyResourceDelegate { @ Override public Response run ( JerseyResourceDelegateContext context ) { } } @ GET @ Path ( "{cacheId}" ) @ Produces ( MediaType . APPLICATION_OCTET_STREAM ) public Response getQueryResultSet ( @ HeaderParam ( QueryResource . tajoSessionIdHeaderName ) String sessionId , @ PathParam ( "cacheId" ) String cacheId , @ DefaultValue ( "-1" ) @ QueryParam ( "offset" ) int offset , @ DefaultValue ( "100" ) @ QueryParam ( "count" ) int count ) { } private static class GetQueryResultSetDelegate implements JerseyResourceDelegate { @ Override public Response run ( JerseyResourceDelegateContext context ) { } private void skipOffsetRow ( NonForwardQueryResultScanner queryResultScanner , int offset ) throws IOException { <START_BUG> if ( offset < 0 ) { <END_BUG> return ; } int currentRow = queryResultScanner . getCurrentRowNumber ( ) ; if ( offset < ( currentRow + 1 ) ) { throw new RuntimeException ( "Offset<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>over<seq2seq4repair_space>the<seq2seq4repair_space>current<seq2seq4repair_space>row<seq2seq4repair_space>number" ) ; } queryResultScanner . getNextRows ( ( ( offset - currentRow ) - 1 ) ) ; } private String getEncodedBase64DigestString ( List < ByteString > outputList ) throws NoSuchAlgorithmException { } } private static class QueryResultStreamingOutput implements StreamingOutput { private final List < ByteString > outputList ; public QueryResultStreamingOutput ( List < ByteString > outputList ) { } @ Override public void write ( OutputStream outputStream ) throws IOException , WebApplicationException { } } }

Fix:
if ( offset <= 0 ) {
Buggy code:
public class SelectBrushQuery extends JFrame { private final Logger m_logger = LoggerFactory . getLogger ( SelectBrushQuery . class ) ; @ Nullable private File m_lastSelectedModel ; private final File m_baseDirectory ; private final ISceneModelFactory m_modelFactory ; private final Brush m_brush ; private final Object m_sync = new Object ( ) ; public SelectBrushQuery ( File baseDirectory , Brush brush , ISceneModelFactory sceneModelFactory ) { } public void poll ( ) { synchronized ( m_sync ) { if ( ( m_lastSelectedModel ) != null ) { <START_BUG> URI relativeUri = m_baseDirectory . toURI ( ) . relativize ( m_lastSelectedModel . toURI ( ) ) ; <END_BUG> try { ISceneModel model = m_modelFactory . create ( relativeUri ) ; m_brush . setBehaviour ( new io . github . jevaengine . builder . worldbuilder . world . PlaceSceneArtifactBrushBehaviour ( model , relativeUri , Direction . XYPlus , btnTraversable . isSelected ( ) ) ) ; } catch ( ISceneModelFactory e ) { m_logger . error ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>scene<seq2seq4repair_space>model" , e ) ; } } } m_lastSelectedModel = null ; } @ SuppressWarnings ( "unchecked" ) private void initComponents ( ) { } private void btnRefreshActionPerformed ( ActionEvent evt ) { } public static class FileTreeModel implements TreeModel { private final SelectBrushQuery . FileTreeModel . SelectBrushChild m_root ; public FileTreeModel ( File root ) { } @ Override public Object getChild ( Object parent , int index ) { } @ Override public int getChildCount ( Object parent ) { } @ Override public int getIndexOfChild ( Object parent , Object child ) { } @ Override public Object getRoot ( ) { } @ Override public boolean isLeaf ( Object node ) { } @ Override public void removeTreeModelListener ( TreeModelListener l ) { } @ Override public void valueForPathChanged ( TreePath path , Object newValue ) { } @ Override public void addTreeModelListener ( TreeModelListener l ) { } public static final class SelectBrushChild { private final File m_file ; private SelectBrushQuery . FileTreeModel . SelectBrushChild [ ] m_sortedFiles = null ; public SelectBrushChild ( File file ) { } private final void initChildren ( ) { } public File getFile ( ) { } public SelectBrushQuery . FileTreeModel . SelectBrushChild [ ] getFiles ( ) { } @ Override public String toString ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } } } private JTree browseBrushTree ; private JButton btnRefresh ; private JToggleButton btnTraversable ; private JScrollPane jScrollPane1 ; private JComboBox < Direction > lstDirection ; }

Fix:
URI relativeUri = URI . create ( "//" ) . resolve ( m_baseDirectory . toURI ( ) . relativize ( m_lastSelectedModel . toURI ( ) ) ) ;
Buggy code:
public class Banner { public String imagePath ; public Banner ( ) { } public void processSelectedImage ( Activity activity , int requestCode , int resultCode , Intent data , EventForm newEventForm , int RESULT_LOAD ) { try { if ( ( ( requestCode == RESULT_LOAD ) && ( resultCode == ( activity . RESULT_OK ) ) ) && ( data != null ) ) { String [ ] filePathColumn = new String [ ] { Media . DATA } ; <START_BUG> Cursor cursor = activity . getContentResolver ( ) . query ( GetImageFromCamera . getUri ( activity , data ) , filePathColumn , null , null , null ) ; <END_BUG> cursor . moveToFirst ( ) ; int columnIndex = cursor . getColumnIndex ( filePathColumn [ 0 ] ) ; imagePath = cursor . getString ( columnIndex ) ; cursor . close ( ) ; set ( newEventForm . eventBannerImageView , imagePath ) ; setSelected ( true , newEventForm ) ; setPath ( imagePath , newEventForm ) ; } } catch ( Exception e ) { Toast . makeText ( activity , "Please<seq2seq4repair_space>select<seq2seq4repair_space>an<seq2seq4repair_space>image!" , LENGTH_LONG ) . show ( ) ; } } public void set ( ImageView eventBannerImageView , String imagePath ) { } public void clear ( Activity activity , ImageView bannerImageView ) { } public Bitmap drawableToBitmap ( Drawable drawable ) { } public ParseFile getImageFromGallery ( String filePath , String fileName ) { } public ParseFile getImageFromBitmap ( Bitmap bitmap , String fileName ) { } public void setSelected ( boolean status , EventForm eventForm ) { } public void setPath ( String path , EventForm eventForm ) { } }

Fix:
Cursor cursor = activity . getContentResolver ( ) . query ( GetImageFromCamera . getUri ( activity , data , requestCode ) , filePathColumn , null , null , null ) ;
Buggy code:
@ Root public class PointPath { @ Element private List < Point > points = new ArrayList < Point > ( ) ; public Point getPointAtPercent ( double percent ) { <START_BUG> int index = ( ( int ) ( Math . round ( ( ( ( points . size ( ) ) // 100 ) * percent ) ) ) ) - 1 ; <END_BUG> if ( index > ( points . size ( ) ) ) index = points . size ( ) ; return points . get ( index ) ; } public void addPoint ( int x , int y , int z ) { } public void addPoint ( int index , int x , int y , int z ) { } public void removePoint ( int index ) { } public String toString ( ) { } }

Fix:
int index = ( ( int ) ( Math . round ( ( ( ( ( double ) ( points . size ( ) ) ) // 100 ) * percent ) ) ) ) ;
Buggy code:
public class Panel extends HtmlContainer { private static final long serialVersionUID = - 5449444447932560536L ; public Panel ( final String componentName ) { } protected final void handleRender ( ) { final MarkupStream markupStream = findMarkupStream ( ) ; if ( ! ( markupStream . atOpenCloseTag ( ) ) ) { markupStream . throwMarkupException ( "A<seq2seq4repair_space>panel<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>referenced<seq2seq4repair_space>by<seq2seq4repair_space>an<seq2seq4repair_space>openclose<seq2seq4repair_space>tag." ) ; } <START_BUG> renderTag ( markupStream ) ; <END_BUG> renderAssociatedMarkup ( "panel" , "Markup<seq2seq4repair_space>for<seq2seq4repair_space>a<seq2seq4repair_space>panel<seq2seq4repair_space>component<seq2seq4repair_space>must<seq2seq4repair_space>begin<seq2seq4repair_space>with<seq2seq4repair_space>'<wicket:panel>'" ) ; } }

Fix:
renderComponentTag ( markupStream ) ;
Buggy code:
public class TestWildcardRandom extends LuceneTestCase { private IndexSearcher searcher ; private IndexReader reader ; private Directory dir ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; dir = newDirectory ( ) ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) . setMaxBufferedDocs ( TestUtil . nextInt ( random ( ) , 50 , 1000 ) ) ) ; Document doc = new Document ( ) ; Field field = newStringField ( "field" , "" , NO ) ; doc . add ( field ) ; NumberFormat df = new DecimalFormat ( "000" , new DecimalFormatSymbols ( Locale . ROOT ) ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { field . setStringValue ( df . format ( i ) ) ; writer . addDocument ( doc ) ; } reader = writer . getReader ( ) ; searcher = newSearcher ( reader ) ; <START_BUG> writer . close ( ) ; <END_BUG> if ( VERBOSE ) { System . out . println ( ( "TEST:<seq2seq4repair_space>setUp<seq2seq4repair_space>searcher=" + ( searcher ) ) ) ; } } private char N ( ) { } private String fillPattern ( String wildcardPattern ) { } private void assertPatternHits ( String pattern , int numHits ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } public void testWildcards ( ) throws Exception { } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public abstract class ByteArrayTransfer extends Transfer { public TransferData [ ] getSupportedTypes ( ) { } public boolean isSupportedType ( TransferData transferData ) { } protected void javaToNative ( Object object , TransferData transferData ) { } protected Object nativeToJava ( TransferData transferData ) { if ( ( ! ( isSupportedType ( transferData ) ) ) || ( ( transferData . pIDataObject ) == 0 ) ) return null ; IDataObject data = new IDataObject ( transferData . pIDataObject ) ; data . AddRef ( ) ; FORMATETC formatetc = transferData . formatetc ; STGMEDIUM stgmedium = new STGMEDIUM ( ) ; stgmedium . tymed = COM . TYMED_HGLOBAL ; <START_BUG> transferData . result = data . GetData ( formatetc , stgmedium ) ; <END_BUG> data . Release ( ) ; if ( ( transferData . result ) != ( COM . S_OK ) ) return null ; int hMem = stgmedium . unionField ; int size = OS . GlobalSize ( hMem ) ; byte [ ] buffer = new byte [ size ] ; int ptr = OS . GlobalLock ( hMem ) ; OS . MoveMemory ( buffer , ptr , size ) ; OS . GlobalUnlock ( hMem ) ; OS . GlobalFree ( hMem ) ; return buffer ; } boolean checkByteArray ( Object object ) { } }

Fix:
transferData . result = getData ( data , formatetc , stgmedium ) ;
Buggy code:
public class LayoutAction extends Action { static final Logger logger = Logger . getLogger ( LayoutAction . class ) ; Layout layout ; boolean inError = false ; public void begin ( ExecutionContext ec , String name , Attributes attributes ) { } public void end ( ExecutionContext ec , String e ) { if ( inError ) { return ; } if ( ( layout ) instanceof OptionHandler ) { ( ( OptionHandler ) ( layout ) ) . activateOptions ( ) ; } Object o = ec . peekObject ( ) ; if ( o != ( layout ) ) { LayoutAction . logger . warn ( "The<seq2seq4repair_space>object<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>top<seq2seq4repair_space>the<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>stack<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>the<seq2seq4repair_space>layout<seq2seq4repair_space>pushed<seq2seq4repair_space>earlier." ) ; } else { <START_BUG> LayoutAction . logger . warn ( "Popping<seq2seq4repair_space>layout<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>object<seq2seq4repair_space>stack" ) ; <END_BUG> ec . popObject ( ) ; try { LayoutAction . logger . debug ( "About<seq2seq4repair_space>to<seq2seq4repair_space>set<seq2seq4repair_space>the<seq2seq4repair_space>layout<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>containing<seq2seq4repair_space>appender." ) ; Appender appender = ( ( Appender ) ( ec . peekObject ( ) ) ) ; appender . setLayout ( layout ) ; } catch ( Exception ex ) { LayoutAction . logger . error ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>set<seq2seq4repair_space>the<seq2seq4repair_space>layout<seq2seq4repair_space>for<seq2seq4repair_space>containing<seq2seq4repair_space>appender." , ex ) ; } } } public void finish ( ExecutionContext ec ) { } }

Fix:
LayoutAction . logger . debug ( "Popping<seq2seq4repair_space>layout<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>object<seq2seq4repair_space>stack" ) ;
Buggy code:
public class BayesWeightSummerReducer extends MapReduceBase implements Reducer < StringTuple , DoubleWritable , StringTuple , DoubleWritable > { private static final Logger log = LoggerFactory . getLogger ( BayesWeightSummerReducer . class ) ; private HTable table ; private boolean useHbase ; @ Override public void reduce ( StringTuple key , Iterator < DoubleWritable > values , OutputCollector < StringTuple , DoubleWritable > output , Reporter reporter ) throws IOException { } @ Override public void configure ( JobConf job ) { try { <START_BUG> Parameters params = Parameters . fromString ( job . get ( "bayes.parameters" , "" ) ) ; <END_BUG> if ( params . get ( "dataSource" ) . equals ( "hbase" ) ) { useHbase = true ; } else { return ; } HBaseConfiguration hBconf = new HBaseConfiguration ( job ) ; table = new HTable ( hBconf , job . get ( "output.table" ) ) ; } catch ( IOException e ) { BayesWeightSummerReducer . log . error ( "Unexpected<seq2seq4repair_space>error<seq2seq4repair_space>during<seq2seq4repair_space>configuration" , e ) ; } } @ Override public void close ( ) throws IOException { } }

Fix:
Parameters params = new Parameters ( job . get ( "bayes.parameters" , "" ) ) ;
Buggy code:
public class MongoDbBean { private MongoClient mongoClient ; public MongoDbBean ( ) { } public MongoClient getConnection ( ) { } private Properties getMongoDbProperty ( ) { Properties prop = new Properties ( ) ; InputStream input = null ; try { <START_BUG> String filename = "mongodb.properties" ; <END_BUG> input = MongoDbBean . class . getClassLoader ( ) . getResourceAsStream ( filename ) ; if ( input == null ) { System . out . println ( ( "Sorry,<seq2seq4repair_space>unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>" + filename ) ) ; return null ; } prop . load ( input ) ; System . out . println ( ( "dbName:<seq2seq4repair_space>" + ( prop . getProperty ( "mongodb.dbName" ) ) ) ) ; System . out . println ( ( "userName:<seq2seq4repair_space>" + ( prop . getProperty ( "mongodb.userName" ) ) ) ) ; System . out . println ( ( "password:<seq2seq4repair_space>" + ( prop . getProperty ( "mongodb.password" ) ) ) ) ; } catch ( IOException ex ) { ex . printStackTrace ( ) ; } finally { if ( input != null ) { try { input . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } return prop ; } No newline ; at end ; of file ; }

Fix:
String filename = "ftp.properties" ;
Buggy code:
public class DateTimeDV extends AbstractDateTimeDV { public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { } protected DateTimeData parse ( String str ) throws SchemaDateTimeException { } protected XMLGregorianCalendar getXMLGregorianCalendar ( DateTimeData date ) { <START_BUG> return factory . newXMLGregorianCalendar ( BigInteger . valueOf ( date . unNormYear ) , date . unNormMonth , date . unNormDay , date . unNormHour , date . unNormMinute , ( ( int ) ( date . unNormSecond ) ) , ( ( date . unNormSecond ) != 0 ? getFractionalSecondsAsBigDecimal ( date ) : null ) , ( date . hasTimeZone ( ) ? ( ( date . timezoneHr ) * 60 ) + ( date . timezoneMin ) : DatatypeConstants . FIELD_UNDEFINED ) ) ; <END_BUG> } }

Fix:
return datatypeFactory . newXMLGregorianCalendar ( BigInteger . valueOf ( date . unNormYear ) , date . unNormMonth , date . unNormDay , date . unNormHour , date . unNormMinute , ( ( int ) ( date . unNormSecond ) ) , ( ( date . unNormSecond ) != 0 ? getFractionalSecondsAsBigDecimal ( date ) : null ) , ( date . hasTimeZone ( ) ? ( ( date . timezoneHr ) * 60 ) + ( date . timezoneMin ) : DatatypeConstants . FIELD_UNDEFINED ) ) ;
Buggy code:
public class CommandTestCase { @ Test public void testCommandOnly ( ) throws Exception { } @ Test public void testCommandWithArgsAndOutputTarget ( ) throws Exception { } protected DefaultOperationCallbackHandler parse ( String line ) { DefaultOperationCallbackHandler args = new DefaultOperationCallbackHandler ( ) ; try { <START_BUG> args . parse ( line ) ; <END_BUG> } catch ( CommandFormatException e ) { e . printStackTrace ( ) ; Assert . fail ( e . getLocalizedMessage ( ) ) ; } return args ; } }

Fix:
args . parse ( null , line ) ;
Buggy code:
public class JmlrEmail extends ControlSequence { public JmlrEmail ( ) { } public JmlrEmail ( String name ) { } public Object clone ( ) { <START_BUG> return new JmlrEmail ( getEmail ( ) ) ; <END_BUG> } public void process ( TeXParser parser , TeXObjectList stack ) throws IOException { } public void process ( TeXParser parser ) throws IOException { } }

Fix:
return new JmlrEmail ( getName ( ) ) ;
Buggy code:
public abstract class NativeCompiler < T extends NativeCompileSpec > implements Compiler < T > { private final CommandLineToolInvocationWorker commandLineToolInvocationWorker ; private final ArgsTransformer < T > argsTransformer ; private final Transformer < T , T > specTransformer ; private final CommandLineToolContext invocationContext ; private final String objectFileExtension ; private final boolean useCommandFile ; private final Logger logger = Logging . getLogger ( NativeCompiler . class ) ; private final BuildOperationProcessor buildOperationProcessor ; public NativeCompiler ( BuildOperationProcessor buildOperationProcessor , CommandLineToolInvocationWorker commandLineToolInvocationWorker , CommandLineToolContext invocationContext , ArgsTransformer < T > argsTransformer , Transformer < T , T > specTransformer , String objectFileExtension , boolean useCommandFile ) { } public WorkResult execute ( T spec ) { } protected List < String > getArguments ( T spec ) { } protected List < String > getSourceArgs ( File sourceFile ) { } protected abstract List < String > getOutputArgs ( T spec , File outputFile ) { } protected abstract void addOptionsFileArgs ( List < String > args , File tempDir ) { } protected abstract List < String > getPCHArgs ( T spec ) { } protected File getOutputFileDir ( File sourceFile , File objectFileDir , String fileSuffix ) { } protected List < String > maybeGetPCHArgs ( final T spec , File sourceFile ) { if ( ( spec . getPreCompiledHeader ( ) ) == null ) { return Lists . newArrayList ( ) ; } final SourceIncludes includes = spec . getSourceFileIncludes ( ) . get ( sourceFile ) ; String header = spec . getPreCompiledHeader ( ) ; if ( header . startsWith ( "<" ) ) { header = header . substring ( 1 , ( ( header . length ( ) ) - 1 ) ) ; } <START_BUG> boolean usePCH = header . equals ( includes . getAllIncludes ( ) . get ( 0 ) ) ; <END_BUG> if ( usePCH ) { return getPCHArgs ( spec ) ; } else { if ( includes . getAllIncludes ( ) . contains ( header ) ) { logger . log ( WARN , NativeCompiler . getCantUsePCHMessage ( spec . getPreCompiledHeader ( ) , sourceFile ) ) ; } return Lists . newArrayList ( ) ; } } private static String getCantUsePCHMessage ( String pchHeader , File sourceFile ) { } protected CommandLineToolInvocation createPerFileInvocation ( List < String > genericArgs , File sourceFile , File objectDir , T spec ) { } protected Iterable < String > buildPerFileArgs ( List < String > genericArgs , List < String > sourceArgs , List < String > outputArgs , List < String > pchArgs ) { } }

Fix:
boolean usePCH = ( ! ( includes . getAllIncludes ( ) . isEmpty ( ) ) ) && ( header . equals ( includes . getAllIncludes ( ) . get ( 0 ) ) ) ;
Buggy code:
public class UpgradeDriver extends Thread { WebDriver driver ; Map < String , Double > res_val = new HashMap < String , Double > ( ) ; public int sleep = 0 ; public boolean upgrade_res = false ; public boolean upgrade_vc = false ; public UpgradeDriver ( WebDriver driver ) { } public void run ( ) { synchronized ( this ) { TaskQueue . push ( new taskstructure . UpdateExistingBuildingsTask ( driver , this , "Village1" ) ) ; try { this . wait ( ) ; } catch ( InterruptedException e1 ) { e1 . printStackTrace ( ) ; } } this . updateBuildingCost ( ) ; while ( true ) { sleep = 0 ; upgrade_res = false ; upgrade_vc = false ; synchronized ( this ) { TaskQueue . push ( new taskstructure . CheckTimeUntilUpgradeTask ( driver , this , "Village1" ) ) ; try { this . wait ( ) ; } catch ( InterruptedException e2 ) { e2 . printStackTrace ( ) ; } } System . out . println ( ( ( "Upgrade<seq2seq4repair_space>driver<seq2seq4repair_space>sleeping<seq2seq4repair_space>for<seq2seq4repair_space>" + ( sleep ) ) + "<seq2seq4repair_space>seconds" ) ) ; try { Thread . sleep ( ( ( sleep ) * 1000 ) ) ; } catch ( InterruptedException e ) { } synchronized ( this ) { TaskQueue . push ( new CheckResourcesTask ( this ) ) ; try { this . wait ( ) ; } catch ( InterruptedException e1 ) { e1 . printStackTrace ( ) ; } } try { String loc = this . getCheapestUpgrade ( ) ; if ( ! ( loc . isEmpty ( ) ) ) { synchronized ( this ) { TaskQueue . push ( new UpgradeTask ( new URL ( ( "http:////ts2.travian.com//build.php?id=" + loc ) ) , this ) ) ; this . wait ( ) ; } } else { <START_BUG> Thread . sleep ( 600000 ) ; <END_BUG> } } catch ( IOException | ServiceException | InterruptedException e ) { e . printStackTrace ( ) ; } } } private void updateBuildingCost ( ) { } private Double getTotalCost ( String loc ) throws ServiceException , IOException { } private boolean canAffordUpgrade ( String loc ) throws ServiceException , IOException { } private String getCheapestUpgrade ( ) throws ServiceException , IOException { } }

Fix:
Thread . sleep ( ( 300 * 1000 ) ) ;
Buggy code:
public class WorkbenchPreview implements IThemePreview { private IPreferenceStore store ; private boolean disposed = false ; private CTabFolder folder ; private ITheme theme ; private ToolBar toolBar ; private CLabel viewMessage ; private ViewForm viewForm ; private IPropertyChangeListener fontAndColorListener = new IPropertyChangeListener ( ) { public void propertyChange ( PropertyChangeEvent event ) { } } ; private IPropertyChangeListener preferenceListener = new IPropertyChangeListener ( ) { public void propertyChange ( PropertyChangeEvent event ) { } } ; public void createControl ( Composite parent , ITheme currentTheme ) { this . theme = currentTheme ; store = WorkbenchPlugin . getDefault ( ) . getPreferenceStore ( ) ; folder = new CTabFolder ( parent , SWT . BORDER ) ; folder . setUnselectedCloseVisible ( false ) ; folder . setEnabled ( false ) ; folder . setMaximizeVisible ( true ) ; folder . setMinimizeVisible ( true ) ; viewForm = new ViewForm ( folder , SWT . NONE ) ; viewForm . marginHeight = 0 ; viewForm . marginWidth = 0 ; viewForm . setBorderVisible ( false ) ; toolBar = new ToolBar ( viewForm , ( ( SWT . FLAT ) | ( SWT . WRAP ) ) ) ; ToolItem toolItem = new ToolItem ( toolBar , SWT . PUSH ) ; Image hoverImage = WorkbenchImages . getImage ( IMG_LCL_VIEW_MENU_HOVER ) ; toolItem . setImage ( hoverImage ) ; viewForm . setTopRight ( toolBar ) ; viewMessage = new CLabel ( viewForm , SWT . NONE ) ; viewMessage . setText ( "Etu?" ) ; viewForm . setTopLeft ( viewMessage ) ; CTabItem item = new CTabItem ( folder , SWT . CLOSE ) ; item . setText ( "Lorem" ) ; Text text = new Text ( viewForm , SWT . NONE ) ; viewForm . setContent ( text ) ; <START_BUG> text . setText ( "Lorem<seq2seq4repair_space>ipsum<seq2seq4repair_space>dolor<seq2seq4repair_space>sit<seq2seq4repair_space>amet\n" ) ; <END_BUG> item = new CTabItem ( folder , SWT . CLOSE ) ; item . setText ( "Ipsum" ) ; item . setControl ( viewForm ) ; item . setImage ( WorkbenchImages . getImage ( IMG_TOOL_COPY ) ) ; folder . setSelection ( item ) ; item = new CTabItem ( folder , SWT . CLOSE ) ; item . setText ( "Dolor" ) ; item = new CTabItem ( folder , SWT . CLOSE ) ; item . setText ( "Sit" ) ; currentTheme . addPropertyChangeListener ( fontAndColorListener ) ; store . addPropertyChangeListener ( preferenceListener ) ; setColorsAndFonts ( ) ; setTabPosition ( ) ; setTabStyle ( ) ; } protected void setTabStyle ( ) { } protected void setTabPosition ( ) { } private void setColorsAndFonts ( ) { } public void dispose ( ) { } }

Fix:
text . setText ( "Lorem<seq2seq4repair_space>ipsum<seq2seq4repair_space>dolor<seq2seq4repair_space>sit<seq2seq4repair_space>amet" ) ;
Buggy code:
public class SubmitLink < T > extends Button < T > { private static final long serialVersionUID = 1L ; private Form form ; public SubmitLink ( MarkupContainer parent , String id ) { } public SubmitLink ( MarkupContainer parent , String id , IModel < T > model ) { } public SubmitLink ( MarkupContainer parent , String id , Form form ) { } public SubmitLink ( MarkupContainer parent , String id , IModel model , Form form ) { } @ Override protected void onComponentTag ( ComponentTag tag ) { } private String getTriggerJavaScript ( ) { Form form = getForm ( ) ; StringBuffer sb = new StringBuffer ( 100 ) ; sb . append ( "var<seq2seq4repair_space>e=document.getElementById('" ) ; sb . append ( form . getHiddenFieldId ( HIDDEN_FIELD_FAKE_SUBMIT ) ) ; sb . append ( "\');<seq2seq4repair_space>e.name=\'" ) ; sb . append ( SubmitLink . getInputName ( ) ) ; sb . append ( "';<seq2seq4repair_space>e.value='x';" ) ; sb . append ( "var<seq2seq4repair_space>f=document.getElementById('" ) ; <START_BUG> sb . append ( form . getJavascriptId ( ) ) ; <END_BUG> sb . append ( "');" ) ; if ( shouldInvokeJavascriptFormOnsubmit ( ) ) { sb . append ( "if<seq2seq4repair_space>(f.onsubmit<seq2seq4repair_space>!=<seq2seq4repair_space>undefined)<seq2seq4repair_space>{<seq2seq4repair_space>if<seq2seq4repair_space>(f.onsubmit()==false)<seq2seq4repair_space>return<seq2seq4repair_space>false;<seq2seq4repair_space>}" ) ; } sb . append ( "f.submit();return<seq2seq4repair_space>false;" ) ; return sb . toString ( ) ; } @ Override public final Form getForm ( ) { } protected boolean shouldInvokeJavascriptFormOnsubmit ( ) { } }

Fix:
sb . append ( form . getMarkupId ( ) ) ;
Buggy code:
public class DarkFieldEllipsoid { private SimpleVector scatterCoef ; private SimpleMatrix eigenVectors ; private SimpleMatrix scatterDirections ; private SimpleVector halfAxisLengths ; public DarkFieldEllipsoid ( SimpleMatrix scatterDirections , SimpleVector scatterCoef , SimpleVector eigenValues , SimpleMatrix eigenVectors ) { } private SimpleVector transformPointIntoEigenVectorSystem ( SimpleVector myPoint ) { } public SimpleVector calculateSquaredProjectedCoefficients ( ) { SimpleVector projScatterCoef = new SimpleVector ( this . scatterCoef . getLen ( ) ) ; for ( int channel = 0 ; channel < ( scatterCoef . getLen ( ) ) ; channel ++ ) { SimpleVector curDir = scatterDirections . getCol ( channel ) ; SimpleVector point = transformPointIntoEigenVectorSystem ( curDir ) ; double curCoef ; if ( ( halfAxisLengths . min ( ) ) == 0 ) { curCoef = 0 ; } else { SimpleVector scaledPoint = SimpleOperators . divideElementWise ( point , halfAxisLengths ) ; <START_BUG> curCoef = 1 // ( scaledPoint . normL2 ( ) ) ; <END_BUG> } projScatterCoef . setElementValue ( channel , curCoef ) ; } return projScatterCoef ; } }

Fix:
curCoef = 1 // ( ( scaledPoint . normL2 ( ) ) * ( scaledPoint . normL2 ( ) ) ) ;
Buggy code:
public class SeedStorageSlot { public NBTTagCompound tag ; public int count ; final int slotId ; final int invId ; public SeedStorageSlot ( NBTTagCompound tag , int nr , int slotId , int invId ) { } public ItemStack getStack ( Item item , int meta ) { } private int getTotalStat ( ) { } public int getId ( ) { <START_BUG> return ( 1000 * ( invId ) ) + ( slotId ) ; <END_BUG> } public static class SlotComparator implements Comparator < SeedStorageSlot > { private final String stat ; public SlotComparator ( String stat ) { } @ Override public int compare ( SeedStorageSlot o1 , SeedStorageSlot o2 ) { } } }

Fix:
return ( invId ) >= 0 ? ( 1000 * ( invId ) ) + ( slotId ) : slotId ;
Buggy code:
public final class ModuleDependencyProcessor implements DeploymentUnitProcessor { private static final String DEPENDENCIES_ATTR = "Dependencies" ; private static final String EXPORT_PARAM = "export" ; private static final String OPTIONAL_PARAM = "optional" ; private static final String SERVICES_PARAM = "services" ; public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( MODULE_SPECIFICATION ) ; final ServiceModuleLoader deploymentModuleLoader = deploymentUnit . getAttachment ( SERVICE_MODULE_LOADER ) ; final List < ResourceRoot > allResourceRoots = DeploymentUtils . allResourceRoots ( deploymentUnit ) ; for ( final ResourceRoot resourceRoot : allResourceRoots ) { final Manifest manifest = resourceRoot . getAttachment ( MANIFEST ) ; if ( manifest == null ) continue ; final String dependencyString = manifest . getMainAttributes ( ) . getValue ( ModuleDependencyProcessor . DEPENDENCIES_ATTR ) ; if ( dependencyString == null ) continue ; final String [ ] dependencyDefs = dependencyString . split ( "," ) ; for ( final String dependencyDef : dependencyDefs ) { <START_BUG> final String [ ] dependencyParts = dependencyDef . split ( "<seq2seq4repair_space>" ) ; <END_BUG> if ( ( dependencyParts . length ) == 0 ) { throw new RuntimeException ( ( "Invalid<seq2seq4repair_space>dependency:<seq2seq4repair_space>" + dependencyString ) ) ; } final ModuleIdentifier dependencyId = ModuleIdentifier . fromString ( dependencyParts [ 0 ] ) ; final boolean export = containsParam ( dependencyParts , ModuleDependencyProcessor . EXPORT_PARAM ) ; final boolean optional = containsParam ( dependencyParts , ModuleDependencyProcessor . OPTIONAL_PARAM ) ; final boolean services = containsParam ( dependencyParts , ModuleDependencyProcessor . SERVICES_PARAM ) ; final ModuleLoader dependencyLoader ; if ( dependencyId . getName ( ) . startsWith ( "deployment." ) ) { dependencyLoader = deploymentModuleLoader ; } else { dependencyLoader = Module . getBootModuleLoader ( ) ; } final ModuleDependency dependency = new ModuleDependency ( dependencyLoader , dependencyId , optional , export , services ) ; moduleSpecification . addDependency ( dependency ) ; deploymentUnit . addToAttachmentList ( MANIFEST_DEPENDENCIES , dependency ) ; } } if ( ( deploymentUnit . getParent ( ) ) != null ) { final List < ModuleDependency > parentDependencies = deploymentUnit . getParent ( ) . getAttachmentList ( MANIFEST_DEPENDENCIES ) ; moduleSpecification . addDependencies ( parentDependencies ) ; } } public void undeploy ( final DeploymentUnit context ) { } private boolean containsParam ( final String [ ] parts , final String expected ) { } }

Fix:
final String [ ] dependencyParts = dependencyDef . trim ( ) . split ( "<seq2seq4repair_space>" ) ;
Buggy code:
public class AbstractPatchingTestCase { protected File tempDir ; @ ArquillianResource protected ContainerController controller ; @ Before public void prepareForAll ( ) throws IOException { } @ After public void cleanupForAll ( ) throws Exception { if ( controller . isStarted ( PatchingTestUtil . CONTAINER ) ) controller . stop ( PatchingTestUtil . CONTAINER ) ; if ( PatchingTestUtil . doCleanup ) { if ( IoUtils . recursiveDelete ( tempDir ) ) { tempDir . deleteOnExit ( ) ; } } final boolean success = CliUtilsForPatching . rollbackAll ( ) ; if ( ! success ) { final File home = new File ( PatchingTestUtil . AS_DISTRIBUTION ) ; PatchingTestUtil . resetInstallationState ( home , PatchingTestUtil . BASE_MODULE_DIRECTORY ) ; <START_BUG> Assert . fail ( ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>rollback<seq2seq4repair_space>all<seq2seq4repair_space>patches<seq2seq4repair_space>" + ( CliUtilsForPatching . info ( ) ) ) ) ; <END_BUG> } } }

Fix:
Assert . fail ( ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>rollback<seq2seq4repair_space>all<seq2seq4repair_space>patches<seq2seq4repair_space>" + ( CliUtilsForPatching . info ( false ) ) ) ) ;
Buggy code:
public class DatabaseSeed { private SQLiteDatabase db ; public DatabaseSeed ( Context ctx ) { } public void seedDatabase ( ) { db . execSQL ( MovieEntry . getSQLDropTableQuery ( ) ) ; db . execSQL ( MovieEntry . getSQLCreateTableQuery ( ) ) ; ContentValues values = new ContentValues ( ) ; values . put ( COLUMN_NAME_ID , 5 ) ; values . put ( COLUMN_NAME_TITLE , "Shawshank<seq2seq4repair_space>Redemption" ) ; values . put ( COLUMN_NAME_DESCRIPTION , "Derp" ) ; values . put ( COLUMN_NAME_GENRE , "Drama" ) ; values . put ( COLUMN_NAME_VOTES , 10 ) ; values . put ( COLUMN_NAME_COMMUNITY_RATING , 5.5 ) ; long newRowId ; newRowId = db . insert ( TABLE_NAME , COLUMN_NAME_NULLABLE , values ) ; db . execSQL ( RatingEntry . getSQLDropTableQuery ( ) ) ; db . execSQL ( RatingEntry . getSQLCreateTableQuery ( ) ) ; ContentValues ratingValues = new ContentValues ( ) ; ratingValues . put ( RatingTable . RatingEntry . COLUMN_NAME_ID , 5 ) ; ratingValues . put ( COLUMN_NAME_RATING , 4.0 ) ; ratingValues . put ( COLUMN_NAME_MOVIEID , 3 ) ; ratingValues . put ( COLUMN_NAME_USERID , 3 ) ; <START_BUG> long newRowIdRating = db . insert ( RatingTable . RatingEntry . TABLE_NAME , RatingTable . RatingEntry . COLUMN_NAME_NULLABLE , values ) ; <END_BUG> } public void clearDatabase ( ) { } }

Fix:
long newRowIdRating = db . insert ( RatingTable . RatingEntry . TABLE_NAME , RatingTable . RatingEntry . COLUMN_NAME_NULLABLE , ratingValues ) ;