nus-yam/ex-repair huggingface dataset:
Buggy code:
public class PublisherInterceptor extends AbstractLifecycleInterceptor { private static final Logger log = Logger . getLogger ( PublisherInterceptor . class ) ; PublisherInterceptor ( ) { } public void invoke ( int state , InvocationContext context ) { HttpMetadata metadata = context . getAttachment ( HttpMetadata . class ) ; if ( state == ( Bundle . STARTING ) ) { String servletName = metadata . getServletName ( ) ; try { PublisherInterceptor . log . info ( ( "Publish<seq2seq4repair_space>HttpMetadata:<seq2seq4repair_space>" + metadata ) ) ; Bundle bundle = context . getBundle ( ) ; Class < ? > servletClass = bundle . loadClass ( servletName ) ; HttpServlet servlet = ( ( HttpServlet ) ( servletClass . newInstance ( ) ) ) ; ClassLoader ctxLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; try { HttpService httpService = getHttpService ( context , true ) ; <START_BUG> httpService . registerServlet ( "//servlet" , servlet , null , null ) ; <END_BUG> } finally { Thread . currentThread ( ) . setContextClassLoader ( ctxLoader ) ; } } catch ( RuntimeException rte ) { throw rte ; } catch ( Exception ex ) { throw new LifecycleInterceptorException ( ( "Cannot<seq2seq4repair_space>publish:<seq2seq4repair_space>" + servletName ) , ex ) ; } } else if ( state == ( Bundle . STOPPING ) ) { PublisherInterceptor . log . info ( ( "Unpublish<seq2seq4repair_space>HttpMetadata:<seq2seq4repair_space>" + metadata ) ) ; ClassLoader ctxLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; try { HttpService httpService = getHttpService ( context , false ) ; if ( httpService != null ) httpService . unregister ( "//servlet" ) ; } finally { Thread . currentThread ( ) . setContextClassLoader ( ctxLoader ) ; } } } private HttpService getHttpService ( InvocationContext context , boolean required ) { } }

Fix:
httpService . registerServlet ( "//example-interceptor//servlet" , servlet , null , null ) ;
Buggy code:
public class LocalRootFolder extends AbstractFolder implements RootFolder { public LocalRootFolder ( FolderItem item , String path ) { } public AbstractFolder getTrashFolder ( ) { } public AbstractFolder getInboxFolder ( ) { } <START_BUG> public boolean supportsAddFolder ( AbstractFolder newFolder ) { <END_BUG> return true ; } }

Fix:
public boolean supportsAddFolder ( IFolder newFolder ) {
Buggy code:
public class Building { private static final DecimalFormat FORMAT1 = new DecimalFormat ( "###0.##" ) ; private static final DecimalFormat FORMAT4 = new DecimalFormat ( "###0.####" ) ; private static final DecimalFormat ENERGY_FORMAT = new DecimalFormat ( "######.##" ) ; private static final double STORY_HEIGHT = 4 ; private Foundation foundation ; private final ArrayList < Wall > walls ; private final ArrayList < Window > windows ; private final ArrayList < SolarPanel > solarPanels ; private Roof roof ; private final ArrayList < Vector2 > wallVertices ; private double area ; private double height ; private double cx ; private double cy ; private double wallArea ; private double windowArea ; private double windowToFloorRatio ; private boolean wallComplete ; private Path2D . Double wallPath ; public Building ( final Foundation foundation ) { } public boolean isWallComplete ( ) { } public Foundation getFoundation ( ) { } public Roof getRoof ( ) { } public boolean calculate ( ) { } public double getArea ( ) { } public double getHeight ( ) { } public double getCenterX ( ) { } public double getCenterY ( ) { } public double getWallArea ( ) { } public double getWindowArea ( ) { } public double getWindowToFloorRatio ( ) { } public int getSolarPanelCount ( ) { } public int getWallCount ( ) { } public int getWindowCount ( ) { } public boolean contains ( final double x , final double y , final boolean init ) { <START_BUG> if ( wallComplete ) <END_BUG> return false ; final int n = wallVertices . size ( ) ; if ( n == 0 ) return false ; if ( init ) { if ( ( wallPath ) == null ) wallPath = new Path2D . Double ( ) ; else wallPath . reset ( ) ; Vector2 v = wallVertices . get ( 0 ) ; wallPath . moveTo ( v . getX ( ) , v . getY ( ) ) ; for ( int i = 1 ; i < n ; i ++ ) { v = wallVertices . get ( i ) ; wallPath . lineTo ( v . getX ( ) , v . getY ( ) ) ; } v = wallVertices . get ( 0 ) ; wallPath . lineTo ( v . getX ( ) , v . getY ( ) ) ; wallPath . closePath ( ) ; } return ( wallPath ) != null ? wallPath . contains ( x , y ) : false ; } @ Override public boolean equals ( final Object o ) { } @ Override public int hashCode ( ) { } public String geometryToJson ( ) { } @ Override public String toString ( ) { } public static long getBuildingId ( final HousePart p ) { } public static Foundation getBuildingFoundation ( final HousePart p ) { } public static String getBuildingSolarPotentials ( ) { } }

Fix:
if ( ! ( wallComplete ) )
Buggy code:
public class JMSTopicAddJndiHandler extends AbstractAddJndiHandler { public static final JMSTopicAddJndiHandler INSTANCE = new JMSTopicAddJndiHandler ( ) ; private JMSTopicAddJndiHandler ( ) { } @ Override protected void addJndiNameToControl ( String toAdd , String resourceName , HornetQServer server , OperationContext context ) { ManagementService mgmt = server . getManagementService ( ) ; TopicControl control = TopicControl . class . cast ( mgmt . getResource ( ( ( ResourceNames . JMS_TOPIC ) + resourceName ) ) ) ; try { control . addJNDI ( toAdd ) ; } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { <START_BUG> context . getFailureDescription ( ) . set ( e . toString ( ) ) ; <END_BUG> } } @ Override public ModelNode getModelDescription ( Locale locale ) { } }

Fix:
context . getFailureDescription ( ) . set ( e . getLocalizedMessage ( ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( DatabaseTimerServiceTestCase . DatabaseTimerServiceTestCaseServerSetup . class ) public class DatabaseTimerServiceTestCase { private static int TIMER_INIT_TIME_MS = 100 ; private static int TIMER_TIMEOUT_TIME_MS = 100 ; private static String INFO_MSG_FOR_CHECK = "info" ; static class DatabaseTimerServiceTestCaseServerSetup implements ServerSetupTask { @ Override public void setup ( final ManagementClient managementClient , final String containerId ) throws Exception { } @ Override public void tearDown ( final ManagementClient managementClient , final String containerId ) throws Exception { } } @ Deployment public static Archive < ? > deploy ( ) { final WebArchive war = ShrinkWrap . create ( WebArchive . class , "testTimerServiceSimple.war" ) ; war . addPackage ( DatabaseTimerServiceTestCase . class . getPackage ( ) ) ; <START_BUG> war . addAsManifestResource ( DatabaseTimerServiceTestCase . class . getPackage ( ) , "jboss-ejb3.xml" , "jboss-ejb3.xml" ) ; <END_BUG> return war ; } @ Test public void testTimedObjectTimeoutMethod ( ) throws NamingException { } }

Fix:
war . addAsWebInfResource ( DatabaseTimerServiceTestCase . class . getPackage ( ) , "jboss-ejb3.xml" , "jboss-ejb3.xml" ) ;
Buggy code:
public class AlturaComponent implements IComponentPlugin { public static final String PLUGIN_ID = "org.columba.chat.altura" ; public AlturaComponent ( ) { } public void init ( ) { try { PluginMetadata metadata = PluginManager . getInstance ( ) . getPluginMetadata ( AlturaComponent . PLUGIN_ID ) ; InputStream is = this . getClass ( ) . getResourceAsStream ( "//org//columba//chat//action//action.xml" ) ; <START_BUG> PluginManager . getInstance ( ) . getHandler ( ORG_COLUMBA_CORE_ACTION ) . loadExternalExtensionsFromStream ( metadata , is ) ; <END_BUG> } catch ( PluginHandlerNotFoundException ex ) { } } public void postStartup ( ) { } public void registerCommandLineArguments ( ) { } public void handleCommandLineParameters ( CommandLine commandLine ) { } }

Fix:
PluginManager . getInstance ( ) . getExtensionHandler ( ORG_COLUMBA_CORE_ACTION ) . loadExternalExtensionsFromStream ( metadata , is ) ;
Buggy code:
public class FileTransfer extends ByteArrayTransfer { private static FileTransfer _instance = new FileTransfer ( ) ; private static final String CF_HDROP = "CF_HDROP<seq2seq4repair_space>" ; private static final int CF_HDROPID = COM . CF_HDROP ; private static final String CF_HDROP_SEPARATOR = "" ; private FileTransfer ( ) { } public static FileTransfer getInstance ( ) { } public void javaToNative ( Object object , TransferData transferData ) { } public Object nativeToJava ( TransferData transferData ) { if ( ( ! ( isSupportedType ( transferData ) ) ) || ( ( transferData . pIDataObject ) == 0 ) ) return null ; IDataObject dataObject = new IDataObject ( transferData . pIDataObject ) ; dataObject . AddRef ( ) ; FORMATETC formatetc = new FORMATETC ( ) ; formatetc . cfFormat = COM . CF_HDROP ; formatetc . ptd = 0 ; formatetc . dwAspect = COM . DVASPECT_CONTENT ; formatetc . lindex = - 1 ; formatetc . tymed = COM . TYMED_HGLOBAL ; STGMEDIUM stgmedium = new STGMEDIUM ( ) ; stgmedium . tymed = COM . TYMED_HGLOBAL ; <START_BUG> transferData . result = dataObject . GetData ( formatetc , stgmedium ) ; <END_BUG> dataObject . Release ( ) ; if ( ( transferData . result ) != ( COM . S_OK ) ) return null ; int count = OS . DragQueryFile ( stgmedium . unionField , - 1 , null , 0 ) ; String [ ] fileNames = new String [ count ] ; for ( int i = 0 ; i < count ; i ++ ) { int size = ( OS . DragQueryFile ( stgmedium . unionField , i , null , 0 ) ) + 1 ; TCHAR lpszFile = new TCHAR ( 0 , size ) ; OS . DragQueryFile ( stgmedium . unionField , i , lpszFile , size ) ; fileNames [ i ] = lpszFile . toString ( 0 , lpszFile . strlen ( ) ) ; } OS . DragFinish ( stgmedium . unionField ) ; return fileNames ; } protected int [ ] getTypeIds ( ) { } protected String [ ] getTypeNames ( ) { } boolean checkFile ( Object object ) { } protected boolean validate ( Object object ) { } }

Fix:
transferData . result = getData ( dataObject , formatetc , stgmedium ) ;
Buggy code:
public class InlinePanelPage_8 extends WebPage { private static final long serialVersionUID = 1L ; private int number = 0 ; private final List < InlinePanelPage_8 . ListNode > nodes = new ArrayList < InlinePanelPage_8 . ListNode > ( ) ; public InlinePanelPage_8 ( ) { } public class ListNode extends Fragment { private static final long serialVersionUID = 1L ; private final WebMarkupContainer nextContainer ; public ListNode ( String id , int number ) { } public InlinePanelPage_8 . ListNode addNext ( AjaxRequestTarget target , int number ) { InlinePanelPage_8 . ListNode next = new InlinePanelPage_8 . ListNode ( "next" , number ) ; nextContainer . add ( next ) ; nextContainer . setVisible ( true ) ; <START_BUG> target . addComponent ( nextContainer ) ; <END_BUG> return next ; } } }

Fix:
target . add ( nextContainer ) ;
Buggy code:
public class Job { private Job ( ) { } public static void main ( String [ ] args ) throws IOException { } private static void runJob ( String input , String output , String measureClassName , double t1 , double t2 , double convergenceDelta , int maxIterations ) throws IOException { JobClient client = new JobClient ( ) ; JobConf conf = new JobConf ( Job . class ) ; Path outPath = new Path ( output ) ; client . setConf ( conf ) ; <START_BUG> FileSystem dfs = FileSystem . get ( conf ) ; <END_BUG> if ( dfs . exists ( outPath ) ) dfs . delete ( outPath , true ) ; InputDriver . runJob ( input , ( output + "//data" ) ) ; MeanShiftCanopyJob . runJob ( ( output + "//data" ) , ( output + "//meanshift" ) , measureClassName , t1 , t2 , convergenceDelta , maxIterations ) ; FileStatus [ ] status = dfs . listStatus ( new Path ( ( output + "//meanshift" ) ) ) ; OutputDriver . runJob ( status [ ( ( status . length ) - 1 ) ] . getPath ( ) . toString ( ) , ( output + "//clustered-points" ) ) ; } }

Fix:
FileSystem dfs = FileSystem . get ( outPath . toUri ( ) , conf ) ;
Buggy code:
public class Data implements Serializable { private static Logger log = LoggingManager . getLoggerForClass ( ) ; Map data ; ArrayList header ; int currentPos ; int size ; public Data ( ) { } public void replaceHeader ( String oldHeader , String newHeader ) { } public void append ( Data d ) { } public int getCurrentPos ( ) { } public void removeRow ( ) { } public void removeRow ( int index ) { } public void addRow ( ) { } public void setCurrentPos ( int r ) { } public void sort ( String column , boolean asc ) { } private void swapRows ( int row1 , int row2 ) { } private void sortData ( String column , int start , int end ) { } public int size ( ) { } public void addColumnValue ( String column , Object value ) { } public int findValue ( String column , Object value ) { } public void setColumnValue ( String column , Object value ) { } public boolean hasHeader ( String column ) { } public boolean next ( ) { } public static Data getDataFromResultSet ( ResultSet rs ) throws SQLException { } public boolean previous ( ) { } public void reset ( ) { } public Object getColumnValue ( String column ) { } public Object getColumnValue ( int column ) { } public Object getColumnValue ( int column , int row ) { } public void removeColumn ( int col ) { } public void setHeaders ( String [ ] h ) { } public String [ ] getHeaders ( ) { } public List getColumnAsObjectArray ( String columnName ) { } public String [ ] getColumn ( String columnName ) { } public void setData ( String [ ] contents , String delimiter ) { } public void setColumnData ( String colName , Object value ) { } public void setColumnData ( int col , List data ) { } public void addHeader ( String s ) { header . add ( s ) ; <START_BUG> data . put ( s , new ArrayList ( size ( ) ) ) ; <END_BUG> } public void setLine ( String [ ] line ) { } public void setLine ( String [ ] line , String deflt ) { } public String [ ] getDataAsText ( ) { } public String toString ( ) { } }

Fix:
data . put ( s , new ArrayList ( Math . max ( size ( ) , 100 ) ) ) ;
Buggy code:
public class FilePageStore implements IPageStore { protected static Log log = LogFactory . getLog ( FilePageStore . class ) ; private File defaultWorkDir ; public FilePageStore ( ) { } public Page getPage ( String sessionId , int id , int versionNumber ) { } public void removePage ( String sessionId , Page page ) { } public void storePage ( String sessionId , Page page ) { File sessionDir = new File ( getWorkDir ( ) , sessionId ) ; sessionDir . mkdirs ( ) ; File pageFile = getPageFile ( page . getNumericId ( ) , page . getCurrentVersionNumber ( ) , sessionDir ) ; page . internalDetach ( ) ; FileOutputStream fos = null ; try { long t1 = System . currentTimeMillis ( ) ; final ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; try { new ObjectOutputStream ( out ) . writeObject ( page ) ; } finally { out . close ( ) ; } byte [ ] bytes = out . toByteArray ( ) ; fos = new FileOutputStream ( pageFile ) ; ByteBuffer bb = ByteBuffer . wrap ( bytes ) ; fos . getChannel ( ) . write ( bb ) ; if ( FilePageStore . log . isDebugEnabled ( ) ) { long t2 = System . currentTimeMillis ( ) ; <START_BUG> FilePageStore . log . info ( ( ( ( ( ( ( ( ( "storing<seq2seq4repair_space>page<seq2seq4repair_space>" + ( page . getNumericId ( ) ) ) + "," ) + ( page . getCurrentVersionNumber ( ) ) ) + "<seq2seq4repair_space>for<seq2seq4repair_space>session<seq2seq4repair_space>" ) + sessionId ) + "<seq2seq4repair_space>took<seq2seq4repair_space>" ) + ( t2 - t1 ) ) + "<seq2seq4repair_space>miliseconds" ) ) ; <END_BUG> } } catch ( Exception e ) { FilePageStore . log . error ( ( ( ( ( ( "Error<seq2seq4repair_space>saving<seq2seq4repair_space>page<seq2seq4repair_space>" + ( page . getId ( ) ) ) + "," ) + ( page . getCurrentVersionNumber ( ) ) ) + "<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>sessionid<seq2seq4repair_space>" ) + sessionId ) , e ) ; } finally { try { if ( fos != null ) { fos . close ( ) ; } } catch ( IOException ex ) { } } } public void unbind ( String sessionId ) { } protected File getWorkDir ( ) { } private File getPageFile ( int id , int versionNumber , File sessionDir ) { } }

Fix:
FilePageStore . log . debug ( ( ( ( ( ( ( ( ( "storing<seq2seq4repair_space>page<seq2seq4repair_space>" + ( page . getNumericId ( ) ) ) + "," ) + ( page . getCurrentVersionNumber ( ) ) ) + "<seq2seq4repair_space>for<seq2seq4repair_space>session<seq2seq4repair_space>" ) + sessionId ) + "<seq2seq4repair_space>took<seq2seq4repair_space>" ) + ( t2 - t1 ) ) + "<seq2seq4repair_space>miliseconds" ) ) ;
Buggy code:
public abstract class RenderedDynamicImageResource extends DynamicImageResource { private int height = 100 ; private transient SoftReference imageData ; private int type = BufferedImage . TYPE_INT_RGB ; private int width = 100 ; public RenderedDynamicImageResource ( final int width , final int height ) { } public int getHeight ( ) { } public int getType ( ) { } public int getWidth ( ) { } public void invalidate ( ) { } public void setHeight ( int height ) { } public void setType ( int type ) { } public void setWidth ( int width ) { } protected byte [ ] getImageData ( ) { byte [ ] data ; synchronized ( this ) { if ( ( imageData ) != null ) data = ( ( byte [ ] ) ( imageData . get ( ) ) ) ; else data = null ; } if ( data == null ) { data = render ( ) ; synchronized ( this ) { imageData = new SoftReference ( data ) ; } <START_BUG> lastModifiedTime = Time . now ( ) ; <END_BUG> } return data ; } protected byte [ ] render ( ) { } protected abstract boolean render ( Graphics2D graphics ) { } }

Fix:
setLastModifiedTime ( Time . now ( ) ) ;
Buggy code:
public class TestNFS4Server { NFS4Server mNFS4Server ; int mPort ; @ Before public void setup ( ) throws Exception { Configuration conf = TestUtils . setupConf ( ) ; mNFS4Server = new NFS4Server ( ) ; mNFS4Server . setConf ( conf ) ; <START_BUG> mNFS4Server . start ( 0 ) ; <END_BUG> mPort = mNFS4Server . getPort ( ) ; } @ After public void cleanup ( ) { } @ Test public void testNull ( ) throws IOException , UnknownHostException { } @ Test public void testDiscconnectReconnect ( ) throws IOException , UnknownHostException { } protected void doDiscconnectReconnect ( ) throws IOException , UnknownHostException { } }

Fix:
mNFS4Server . start ( LOCALHOST , 0 ) ;
Buggy code:
@ Named public class CreateNegotiationCaseDelegate implements JavaDelegate { @ EJB private CustomerServiceBean customerService ; @ EJB private InsuranceContractServiceBean insuranceContractService ; @ EJB private CarDataServiceBean carDataService ; public void execute ( DelegateExecution delegateExecution ) throws Exception { } private void createExampleMessage ( DelegateExecution delegateExecution , Map < String , Object > variablesToRemove ) { delegateExecution . removeVariables ( variablesToRemove . keySet ( ) ) ; RentalAgreementMessage message = new RentalAgreementMessage ( ) ; message . setRentalAgreementRequestId ( 1 ) ; message . setAdditionalInfo ( "Test" ) ; <START_BUG> message . setBenefits ( Arrays . asList ( AWESOME ) ) ; <END_BUG> message . setInsuranceType ( PARTIAL ) ; CustomerData customerData = new CustomerData ( ) ; customerData . setName ( "Robert<seq2seq4repair_space>Voscort" ) ; customerData . setAddress ( "TestAddress" ) ; customerData . setCompany ( "Capitol" ) ; customerData . setEmail ( "robert.voscort@capitol.to" ) ; customerData . setPhoneNumber ( "0190666666" ) ; message . setCustomerData ( customerData ) ; CarData car1 = new CarData ( ) ; car1 . setLicenseNumber ( "TR-L-2608" ) ; car1 . setHsn ( "489032" ) ; car1 . setTsn ( "8593402" ) ; CarData car2 = new CarData ( ) ; car2 . setLicenseNumber ( "MS-X-320" ) ; car2 . setHsn ( "49302" ) ; car2 . setTsn ( "520358" ) ; message . setCarsData ( Arrays . asList ( car1 , car2 ) ) ; String json = JSON ( message ) . toString ( ) ; delegateExecution . setVariable ( "message" , json ) ; } }

Fix:
message . setBenefits ( Arrays . asList ( BRAKEDOWNCOVER ) ) ;
Buggy code:
public class MessageBuilder { private String senderCode ; private String receiverCode ; private Date sendingDate ; private String text ; private MessageType type ; public MessageBuilder setSenderCode ( String senderCode ) { } public MessageBuilder setReceiverCode ( String receiverCode ) { } public MessageBuilder setSendingDate ( Date sendingDate ) { if ( sendingDate == null ) { throw new IllegalArgumentException ( ) ; } <START_BUG> this . sendingDate = sendingDate ; <END_BUG> return this ; } public MessageBuilder setText ( String text ) { } public MessageBuilder setType ( MessageType type ) { } public Message build ( ) { } }

Fix:
this . sendingDate = new Date ( sendingDate . getTime ( ) ) ;
Buggy code:
public class PrimeFactorsLauncher { public static void main ( String [ ] args ) { PrimeFactors primeFactorsLauncher = new PrimeFactors ( ) ; System . out . println ( "Let's<seq2seq4repair_space>print<seq2seq4repair_space>all<seq2seq4repair_space>the<seq2seq4repair_space>prime<seq2seq4repair_space>factors<seq2seq4repair_space>of<seq2seq4repair_space>a<seq2seq4repair_space>number:" ) ; <START_BUG> primeFactorsLauncher . generatePrimes ( 30 ) ; <END_BUG> } }

Fix:
primeFactorsLauncher . generatePrimes ( 16 ) ;
Buggy code:
public class HexTest { private static final String BAD_ENCODING_NAME = "UNKNOWN" ; private static final boolean LOG = false ; private boolean charsetSanityCheck ( String name ) { } private void checkDecodeHexOddCharacters ( char [ ] data ) { } private void log ( String s ) { } private void log ( Throwable t ) { } @ Test public void testCustomCharset ( ) throws UnsupportedEncodingException , DecoderException { } private void testCustomCharset ( String name , String parent ) throws UnsupportedEncodingException , DecoderException { } @ Test public void testCustomCharsetBadNameEncodeByteArray ( ) throws UnsupportedEncodingException { } @ Test public void testCustomCharsetBadNameEncodeObject ( ) { } @ Test public void testCustomCharsetBadNameDecodeObject ( ) throws UnsupportedEncodingException { } @ Test public void testCustomCharsetToString ( ) { } @ Test public void testDecodeArrayOddCharacters ( ) { } @ Test public void testDecodeBadCharacterPos0 ( ) { } @ Test public void testDecodeBadCharacterPos1 ( ) { } @ Test public void testDecodeClassCastException ( ) { } @ Test public void testDecodeHexOddCharacters1 ( ) { } @ Test public void testDecodeHexOddCharacters3 ( ) { } @ Test public void testDecodeHexOddCharacters5 ( ) { } @ Test public void testDecodeStringOddCharacters ( ) { } @ Test public void testDencodeEmpty ( ) throws DecoderException { } @ Test public void testEncodeClassCastException ( ) { } @ Test public void testEncodeDecodeRandom ( ) throws DecoderException , EncoderException { } @ Test public void testEncodeEmpty ( ) throws EncoderException { } @ Test public void testEncodeZeroes ( ) { } @ Test public void testHelloWorldLowerCaseHex ( ) { byte [ ] b = StringUtils . getBytesUtf8 ( "Hello<seq2seq4repair_space>World" ) ; final String expected = "48656c6c6f20576f726c64" ; char [ ] actual ; actual = Hex . encodeHex ( b ) ; assertEquals ( expected , new String ( actual ) ) ; actual = Hex . encodeHex ( b , true ) ; assertEquals ( expected , new String ( actual ) ) ; actual = Hex . encodeHex ( b , false ) ; <START_BUG> assertEquals ( expected , new String ( actual ) ) ; <END_BUG> } @ Test public void testHelloWorldUpperCaseHex ( ) { } @ Test public void testRequiredCharset ( ) throws UnsupportedEncodingException , DecoderException { } }

Fix:
assertEquals ( expected . toUpperCase ( ) , new String ( actual ) ) ;
Buggy code:
public class PackageRequestTargetUrlCodingStrategy extends AbstractRequestTargetUrlCodingStrategy { private static final Logger log = LoggerFactory . getLogger ( PackageRequestTargetUrlCodingStrategy . class ) ; private final PackageName packageName ; public PackageRequestTargetUrlCodingStrategy ( final String path , PackageName packageName ) { } public IRequestTarget decode ( RequestParameters requestParameters ) { PackageRequestTargetUrlCodingStrategy . log . debug ( ( "path=" + ( requestParameters . getPath ( ) ) ) ) ; String remainder = requestParameters . getPath ( ) . substring ( getMountPath ( ) . length ( ) ) ; PackageRequestTargetUrlCodingStrategy . log . debug ( ( "remainder=" + remainder ) ) ; final String parametersFragment ; int ix = remainder . indexOf ( '//' , 1 ) ; if ( ix == ( - 1 ) ) { ix = remainder . length ( ) ; parametersFragment = "" ; } else { parametersFragment = remainder . substring ( ix ) ; } if ( remainder . startsWith ( "//" ) ) { remainder = remainder . substring ( 1 ) ; ix -- ; } else { return null ; } PackageRequestTargetUrlCodingStrategy . log . debug ( ( "remainder=" + remainder ) ) ; PackageRequestTargetUrlCodingStrategy . log . debug ( ( "parametersFragment=" + parametersFragment ) ) ; final String bookmarkablePageClassName = ( ( packageName ) + "." ) + ( remainder . substring ( 0 , ix ) ) ; try { Class bookmarkablePageClass = Session . get ( ) . getClassResolver ( ) . resolveClass ( bookmarkablePageClassName ) ; PageParameters parameters = new PageParameters ( decodeParameters ( parametersFragment , requestParameters . getParameters ( ) ) ) ; final String pageMapName = ( ( String ) ( parameters . remove ( PAGEMAP ) ) ) ; requestParameters . setPageMapName ( pageMapName ) ; BookmarkablePageRequestTarget target = new BookmarkablePageRequestTarget ( pageMapName , bookmarkablePageClass , parameters ) ; return target ; } catch ( RuntimeException ex ) { <START_BUG> if ( ( ex . getCause ( ) ) instanceof ClassNotFoundException ) { <END_BUG> return null ; } throw ex ; } } public final CharSequence encode ( IRequestTarget requestTarget ) { } public boolean matches ( IRequestTarget requestTarget ) { } public String toString ( ) { } }

Fix:
if ( ( ( ex . getCause ( ) ) != null ) && ( ( ex . getCause ( ) ) instanceof ClassNotFoundException ) ) {
Buggy code:
public class PropertyDump extends AbstractTask { public void execute ( ) { final Map properties = getContext ( ) . getProperties ( ) ; final Iterator iterator = properties . keySet ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { final String key = ( ( String ) ( iterator . next ( ) ) ) ; final Object value = properties . get ( key ) ; <START_BUG> getContext ( ) . warn ( ( ( key + "=" ) + value ) ) ; <END_BUG> } } }

Fix:
getContext ( ) . info ( ( ( key + "=" ) + value ) ) ;
Buggy code:
public class TestCookieManager extends JMeterTestCase { private CookieManager man = null ; public TestCookieManager ( String name ) { } private JMeterContext jmctx = null ; @ Override public void setUp ( ) throws Exception { } public void testRemoveCookie ( ) throws Exception { } public void testSendCookie ( ) throws Exception { } public void testSendCookie2 ( ) throws Exception { } public void testDomainHandling ( ) throws Exception { } public void testCrossDomainHandling ( ) throws Exception { } public void testSimilarHostNames ( ) throws Exception { } public void testSessionCookie ( ) throws Exception { } public void testCookieWithEquals ( ) throws Exception { } public void testOldCookie ( ) throws Exception { } public void testNewCookie ( ) throws Exception { } public void testCookies1 ( ) throws Exception { } public void testCookies2 ( ) throws Exception { } public void testDuplicateCookie ( ) throws Exception { } public void testDuplicateCookie2 ( ) throws Exception { } public void testMissingPath0 ( ) throws Exception { } public void testMissingPath1 ( ) throws Exception { } public void testRootPath0 ( ) throws Exception { } public void testRootPath1 ( ) throws Exception { } public void testCookieMatching ( ) throws Exception { } public void testCookieOrdering1 ( ) throws Exception { } public void testCookieOrdering2 ( ) throws Exception { } public void testCookiePolicy2109 ( ) throws Exception { } public void testCookiePolicyNetscape ( ) throws Exception { } public void testCookiePolicyIgnore ( ) throws Exception { } public void testLoad ( ) throws Exception { assertEquals ( 0 , man . getCookieCount ( ) ) ; <START_BUG> man . addFile ( "testfiles//cookies.txt" ) ; <END_BUG> assertEquals ( 3 , man . getCookieCount ( ) ) ; int num = 0 ; assertEquals ( "name" , man . get ( num ) . getName ( ) ) ; assertEquals ( "value" , man . get ( num ) . getValue ( ) ) ; assertEquals ( "path" , man . get ( num ) . getPath ( ) ) ; assertEquals ( "domain" , man . get ( num ) . getDomain ( ) ) ; assertTrue ( man . get ( num ) . getSecure ( ) ) ; assertEquals ( num , man . get ( num ) . getExpires ( ) ) ; num ++ ; assertEquals ( "name2" , man . get ( num ) . getName ( ) ) ; assertEquals ( "value2" , man . get ( num ) . getValue ( ) ) ; assertEquals ( "//" , man . get ( num ) . getPath ( ) ) ; assertEquals ( "" , man . get ( num ) . getDomain ( ) ) ; assertFalse ( man . get ( num ) . getSecure ( ) ) ; assertEquals ( 0 , man . get ( num ) . getExpires ( ) ) ; num ++ ; assertEquals ( "a" , man . get ( num ) . getName ( ) ) ; assertEquals ( "b" , man . get ( num ) . getValue ( ) ) ; assertEquals ( "d" , man . get ( num ) . getPath ( ) ) ; assertEquals ( "c" , man . get ( num ) . getDomain ( ) ) ; assertTrue ( man . get ( num ) . getSecure ( ) ) ; assertEquals ( 0 , man . get ( num ) . getExpires ( ) ) ; } }

Fix:
man . addFile ( findTestPath ( "testfiles//cookies.txt" ) ) ;
Buggy code:
public abstract class SimpleAgent extends Agent { @ Override protected void setup ( ) { registerWithYellowPages ( ) ; System . out . println ( ( ( getAID ( ) . getLocalName ( ) ) + "<seq2seq4repair_space>representin'!" ) ) ; addBehaviour ( new CyclicBehaviour ( ) { @ Override public void action ( ) { ACLMessage msg = myAgent . receive ( ) ; if ( msg == null ) { return ; } if ( ( ( msg . getConversationId ( ) ) != null ) && ( msg . getConversationId ( ) . equalsIgnoreCase ( "math-problem" ) ) ) { <START_BUG> System . out . println ( ( "I<seq2seq4repair_space>can<seq2seq4repair_space>solve<seq2seq4repair_space>this!<seq2seq4repair_space>agents.Problem:<seq2seq4repair_space>" + ( msg . getContent ( ) ) ) ) ; <END_BUG> problemReceived ( msg ) ; } else { System . out . println ( ( ( getAID ( ) . getLocalName ( ) ) + "<seq2seq4repair_space>received<seq2seq4repair_space>a<seq2seq4repair_space>message!" ) ) ; broadcastReceived ( msg ) ; } block ( ) ; } } ) ; addBehaviour ( new OneShotBehaviour ( ) { @ Override public void action ( ) { broadcastMessage ( "go<seq2seq4repair_space>go<seq2seq4repair_space>go" ) ; } } ) ; } private void registerWithYellowPages ( ) { } protected abstract void problemReceived ( ACLMessage msg ) { } protected abstract String getServiceName ( ) { } private void broadcastMessage ( String content ) { } abstract void broadcastReceived ( ACLMessage msg ) { } @ Override protected void takeDown ( ) { } }

Fix:
System . out . println ( ( "I<seq2seq4repair_space>can<seq2seq4repair_space>solve<seq2seq4repair_space>this!<seq2seq4repair_space>Problem:<seq2seq4repair_space>" + ( msg . getContent ( ) ) ) ) ;
Buggy code:
public class FriendFragment extends Fragment { private static final String TAG = "FriendFragment" ; private static final int RESULT_OK = 1 ; private static final int RESULT_CANCELED = 0 ; RestClient restClient ; GenieService genieService ; ArrayList < User > userArray = new ArrayList < User > ( ) ; UsersAdapter adapter ; private RecyclerView mRecyclerView ; private Adapter mAdapter ; private LayoutManager mLayoutManager ; public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { <START_BUG> View view = inflater . inflate ( activity_browsefriends , container , false ) ; <END_BUG> restClient = new RestClient ( ) ; genieService = restClient . getGenieService ( ) ; mRecyclerView = ( ( RecyclerView ) ( view . findViewById ( my_recycler_view ) ) ) ; mRecyclerView . setHasFixedSize ( true ) ; mLayoutManager = new android . support . v7 . widget . LinearLayoutManager ( getActivity ( ) ) ; mRecyclerView . setLayoutManager ( mLayoutManager ) ; mAdapter = new UsersAdapter ( userArray ) ; mRecyclerView . setAdapter ( mAdapter ) ; getFriends ( view , mAdapter ) ; return view ; } @ Override public void onCreateOptionsMenu ( Menu menu , MenuInflater inflater ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void getFriends ( final View view , final RecyclerView . Adapter adapter ) { } public void facebookLogout ( ) { } }

Fix:
View view = inflater . inflate ( friends , container , false ) ;
Buggy code:
public class BurgerAppSQLiteHelper extends SQLiteOpenHelper { UserTable userTable = new UserTable ( ) ; CustomerTable customerTable = new CustomerTable ( ) ; BurgerTypeTable burgerTypeTable = new BurgerTypeTable ( ) ; BurgerSizeTable burgerSizeTable = new BurgerSizeTable ( ) ; BurgerMeatTable burgerMeatTable = new BurgerMeatTable ( ) ; DrinkTypeTable drinkTypeTable = new DrinkTypeTable ( ) ; OrderTable orderTable = new OrderTable ( ) ; OrderLineBurgerTable orderLineBurgerTable = new OrderLineBurgerTable ( ) ; OrderLineDrinkTable orderLineDrinkTable = new OrderLineDrinkTable ( ) ; Activity context ; public BurgerAppSQLiteHelper ( Context context , String name , CursorFactory factory , int version ) { } @ Override public void onCreate ( SQLiteDatabase db ) { db . execSQL ( userTable . getSqlCreate ( ) ) ; db . execSQL ( customerTable . getSqlCreate ( ) ) ; db . execSQL ( burgerTypeTable . getSqlCreate ( ) ) ; db . execSQL ( burgerSizeTable . getSqlCreate ( ) ) ; db . execSQL ( burgerMeatTable . getSqlCreate ( ) ) ; db . execSQL ( drinkTypeTable . getSqlCreate ( ) ) ; db . execSQL ( orderTable . getSqlCreate ( ) ) ; db . execSQL ( orderLineBurgerTable . getSqlCreate ( ) ) ; db . execSQL ( orderLineDrinkTable . getSqlCreate ( ) ) ; <START_BUG> DDBBSQLite . initData ( this . context ) ; <END_BUG> } @ Override public void onUpgrade ( SQLiteDatabase db , int oldVersion , int newVersion ) { } }

Fix:
DDBBSQLite . initData ( this . context , db ) ;
Buggy code:
public class EnumLabel < T extends Enum < T > > extends WebComponent { private static final long serialVersionUID = 1L ; public EnumLabel ( final String id ) { } public EnumLabel ( final String id , T value ) { } public EnumLabel ( final String id , IModel < T > model ) { } @ Override protected void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } private String getStringValue ( ) { } protected String resourceKey ( T value ) { <START_BUG> return ( ( value . getClass ( ) . getSimpleName ( ) ) + "." ) + ( value . name ( ) ) ; <END_BUG> } protected String nullValue ( ) { } @ Override protected void onComponentTag ( ComponentTag tag ) { } @ SuppressWarnings ( "unchecked" ) public final IModel < T > getModel ( ) { } public final void setModel ( IModel < T > model ) { } @ SuppressWarnings ( "unchecked" ) public final T getModelObject ( ) { } public final void setModelObject ( T object ) { } }

Fix:
return ( ( value . getDeclaringClass ( ) . getSimpleName ( ) ) + "." ) + ( value . name ( ) ) ;
Buggy code:
public class OnQuestion implements Subscribable < PFlow > { @ Override public void onMessage ( PFlow pf ) { List < PFlow > list = new javolution . util . FastList < PFlow > ( ) ; IndexHits < Relationship > q = Order . context ( pf . getOPNode ( ) ) ; try { Iterator < Relationship > it = q . iterator ( ) ; while ( it . hasNext ( ) ) { Relationship r = it . next ( ) ; Subscribable < PFlow > onQuestion = pf . getManipulator ( ) . onQuestion ( r ) ; if ( onQuestion != null ) { <START_BUG> PFlow nextPF = new PFlow ( pf , pf . getVector ( ) . question ( r ) ) ; <END_BUG> nextPF . questionChannel ( ) . subscribe ( onQuestion ) ; list . add ( nextPF ) ; } else { pf . sendAnswer ( pf . getVector ( ) . answered ( r ) ) ; } } } finally { q . close ( ) ; } if ( list . isEmpty ( ) ) pf . done ( ) ; else pf . waitBeforeClosePipe ( list . size ( ) ) ; for ( PFlow nextPF : list ) { nextPF . questionChannel ( ) . publish ( nextPF ) ; } } @ Override public DisposingExecutor getQueue ( ) { } No newline ; at end ; of file ; }

Fix:
PFlow nextPF = new PFlow ( pf , pf . getVector ( ) . question2 ( r ) ) ;
Buggy code:
public class FileSystemDirectory implements PartitionedDirectoryBackend { private File root ; private String rootPath ; protected final Logger log = LoggerFactory . getLogger ( this . getClass ( ) ) ; private String enc = "utf-8" ; public FileSystemDirectory ( String path , String enc ) { } public FileSystemDirectory ( ) { } public void setRootPath ( String rootPath ) { } public void setEnc ( String enc ) { } public void checkState ( ) { } @ Override @ PostConstruct public void open ( ) { } @ Override @ PreDestroy public void close ( ) { } @ Override public boolean isopen ( ) { } @ Override public void insert ( int partition , List < String > key , List < String > value ) { } @ Override public void delete ( int partition , List < String > key ) { } @ Override public List < String > lookup ( int partition , List < String > key ) { } @ Override public Map < List < String > , List < String > > prefixlookup ( int partition , List < String > key ) { } private void recursive_add ( List < String > key , String dir , Map < List < String > , List < String > > map ) { } private void file_add ( List < String > key , String value , Map < List < String > , List < String > > map ) { } private String _buildpath ( List < String > dir ) { } private List < String > _get_partition_dir ( int partition , List < String > dir ) { } private String _buildfile ( String dir ) { } private String buildfile ( String dir ) { } private String _builddir ( String dir ) { } private String builddir ( String dir ) { } private class PrefixFilter implements FileFilter { private final String prefix ; public PrefixFilter ( String prefix ) { } public boolean accept ( File pathname ) { <START_BUG> return ( ( prefix . length ( ) ) <= ( pathname . length ( ) ) ) && ( pathname . getName ( ) . substring ( 0 , prefix . length ( ) ) . equals ( prefix ) ) ; <END_BUG> } } }

Fix:
return ( ( prefix . length ( ) ) <= ( pathname . getName ( ) . length ( ) ) ) && ( pathname . getName ( ) . substring ( 0 , prefix . length ( ) ) . equals ( prefix ) ) ;
Buggy code:
public class Frame { public static final byte FRAMETYPE_DATAFRAME = 1 ; public static final byte FRAMETYPE_COMMAND = 2 ; public static final byte FRAMETYPE_COMMAND_RESPONSE = 3 ; public static final byte FRAMETYPE_MESSAGE = 4 ; public static final byte FRAMETYPE_ERROR_MESSAGE = 5 ; public static final byte FRAMETYPE_ROUTED_FRAME = 6 ; public static final byte FRAMETYPE_DELAYED_FRAME = 7 ; public static final byte FRAMETYPE_ROUTED_FRAME_RSSI = 8 ; public static final byte FRAMETYPE_TIMESTAMP_FRAME = 9 ; public static final short Dataframe_Mask = 240 ; public static final byte Valuetype_Mask = 15 ; public static final byte DATAFRAME = 32 ; public static final byte DATAFRAME_WITH_CHANNEL_OFFSET = 0 ; public static final byte DATAFRAME_WITH_CHANNEL_INDEX = 64 ; public static final byte BINARY_DUMP = 10 ; private byte frameType ; private byte [ ] data ; private byte length ; public static enum Number { Float32 ( 1 ) , Int32 ( 2 ) , Int16 ( 3 ) , UInt8 ( 4 ) , UInt32 ( 5 ) , Long64 ( 6 ) ; private int byteRepresentation ; public int getByteRepresentation ( ) { } private Number ( int byteRepresentation ) { } public int getByteLength ( ) { } public static Frame . Number getNumber ( byte bitmask ) { } } public Frame ( byte [ ] payload ) { } public static Vector < Frame > toBayEOSFrames ( Vector < SerialFrame > serialFrames ) { } public static Frame toBayEOSFrame ( byte [ ] payload ) { <START_BUG> if ( ( payload . length ) == 0 ) <END_BUG> return null ; byte frameType = payload [ 0 ] ; switch ( frameType ) { case Frame . FRAMETYPE_DATAFRAME : return new DataFrame ( payload ) ; case Frame . FRAMETYPE_COMMAND : case Frame . FRAMETYPE_COMMAND_RESPONSE : return new CommandAndResponseFrame ( payload ) ; case Frame . FRAMETYPE_MESSAGE : case Frame . FRAMETYPE_ERROR_MESSAGE : return new MessageFrame ( payload ) ; case Frame . FRAMETYPE_ROUTED_FRAME : break ; case Frame . FRAMETYPE_DELAYED_FRAME : break ; case Frame . FRAMETYPE_ROUTED_FRAME_RSSI : break ; case Frame . FRAMETYPE_TIMESTAMP_FRAME : break ; default : break ; } return null ; } public static Object [ ] parsePayload ( byte [ ] payload , Frame . Number valuetype ) { } public byte [ ] getData ( ) { } public byte getType ( ) { } public int getLength ( ) { } public byte [ ] asByteArray ( ) { } }

Fix:
if ( ( payload == null ) || ( ( payload . length ) == 0 ) )
Buggy code:
public class TestIndonesianAnalyzer extends BaseTokenStreamTestCase { public void testResourcesAvailable ( ) { } public void testBasics ( ) throws IOException { } public void testExclude ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , new IndonesianAnalyzer ( TEST_VERSION_CURRENT ) , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } }

Fix:
checkRandomData ( random ( ) , new IndonesianAnalyzer ( TEST_VERSION_CURRENT ) , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class List extends Scrollable { int modelHandle ; static final int TEXT_COLUMN = 0 ; public List ( Composite parent , int style ) { } public void add ( String string ) { } public void add ( String string , int index ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } void createHandle ( int index ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void deregister ( ) { } public void deselect ( int index ) { } public void deselect ( int start , int end ) { } public void deselect ( int [ ] indices ) { } public void deselectAll ( ) { } GdkColor getBackgroundColor ( ) { } public int getFocusIndex ( ) { } GdkColor getForegroundColor ( ) { } public String getItem ( int index ) { } public int getItemCount ( ) { } public int getItemHeight ( ) { } public String [ ] getItems ( ) { } public String [ ] getSelection ( ) { } public int getSelectionCount ( ) { } public int getSelectionIndex ( ) { } public int [ ] getSelectionIndices ( ) { } public int getTopIndex ( ) { } int gtk_changed ( int widget ) { } int gtk_button_press_event ( int widget , int event ) { } int gtk_key_press_event ( int widget , int event ) { } int gtk_row_activated ( int tree , int path , int column ) { } void hookEvents ( ) { } public int indexOf ( String string ) { } public int indexOf ( String string , int start ) { } public boolean isSelected ( int index ) { } int paintWindow ( ) { } void register ( ) { } void releaseWidget ( ) { } public void remove ( int index ) { } public void remove ( int start , int end ) { } public void remove ( String string ) { } public void remove ( int [ ] indices ) { } public void removeAll ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void select ( int index ) { } public void select ( int start , int end ) { } public void select ( int [ ] indices ) { } public void selectAll ( ) { } void selectFocusIndex ( int index ) { } void setBackgroundColor ( GdkColor color ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize ) { } void setForegroundColor ( GdkColor color ) { } public void setItem ( int index , String string ) { } public void setItems ( String [ ] items ) { } public void setSelection ( int index ) { } public void setSelection ( int start , int end ) { } public void setSelection ( int [ ] indices ) { } public void setSelection ( String [ ] items ) { } public void setTopIndex ( int index ) { } public void showSelection ( ) { checkWidget ( ) ; int index = getSelectionIndex ( ) ; if ( index == ( - 1 ) ) return ; int iter = OS . g_malloc ( OS . GtkTreeIter_sizeof ( ) ) ; OS . gtk_tree_model_iter_nth_child ( modelHandle , iter , 0 , index ) ; int path = OS . gtk_tree_model_get_path ( modelHandle , iter ) ; <START_BUG> OS . gtk_tree_view_scroll_to_cell ( handle , path , 0 , true , 0 , 0 ) ; <END_BUG> OS . gtk_tree_path_free ( path ) ; OS . g_free ( iter ) ; } int treeSelectionProc ( int model , int path , int iter , int [ ] selection , int length ) { } }

Fix:
OS . gtk_tree_view_scroll_to_cell ( handle , path , 0 , false , 0 , 0 ) ;
Buggy code:
public class MDMComponent { private static final Log log = LogFactory . getLog ( MDMComponent . class ) ; private ServiceRegistration mdmServiceRegistration ; protected void activate ( ComponentContext context ) { BundleContext bundleContext = context . getBundleContext ( ) ; <START_BUG> mdmServiceRegistration = bundleContext . registerService ( MDMOperations . class . getName ( ) , new MDMOperations ( ) , context . getProperties ( ) ) ; <END_BUG> MDMComponent . log . debug ( "WSO2<seq2seq4repair_space>MDM<seq2seq4repair_space>Service<seq2seq4repair_space>Registration<seq2seq4repair_space>activated" ) ; } protected void deactivate ( ComponentContext context ) { } }

Fix:
mdmServiceRegistration = bundleContext . registerService ( MDMOperations . class . getName ( ) , new MDMOperations ( ) , null ) ;
Buggy code:
public class StandardOutputStreamLogTest { private static final String ARBITRARY_TEXT = "arbitrary<seq2seq4repair_space>text" ; @ Rule public final ExpectedException thrown = ExpectedException . none ( ) ; @ Test public void logWriting ( ) throws Throwable { } @ Test public void restoreSystemOutputStream ( ) throws Throwable { } @ Test public void stillWritesToSystemOutputStreamIfNoLogModeHasBeenSpecified ( ) throws Throwable { } @ Test public void doesNotWriteToSystemOutputStreamForLogOnlyMode ( ) throws Throwable { } @ Test public void collectsLogAfterClearing ( ) throws Throwable { } @ Test public void cannotBeCreatedWithoutLogMode ( ) { thrown . expect ( NullPointerException . class ) ; thrown . expectMessage ( equalTo ( "The<seq2seq4repair_space>LogMode<seq2seq4repair_space>is<seq2seq4repair_space>missing." ) ) ; <START_BUG> new StandardErrorStreamLog ( null ) ; <END_BUG> } private StandardOutputStreamLog createLogWithoutSpecificMode ( ) { } private void executeRuleWithStatement ( TestRule rule , Statement statement ) throws Throwable { } private class WriteTextToStandardOutputStream extends Statement { @ Override public void evaluate ( ) throws Throwable { } } private class ClearLogWhileWritingTextToStandardOutputStream extends Statement { private final StandardOutputStreamLog log ; private ClearLogWhileWritingTextToStandardOutputStream ( StandardOutputStreamLog log ) { } @ Override public void evaluate ( ) throws Throwable { } } }

Fix:
new StandardOutputStreamLog ( null ) ;