nus-yam/ex-repair huggingface dataset:
Buggy code:
public class DocumentType { Database db = OpenTenureApplication . getInstance ( ) . getDatabase ( ) ; String code ; String description ; String displayValue ; @ Override public String toString ( ) { } public String getCode ( ) { } public void setCode ( String code ) { } public String getDescription ( ) { } public void setDescription ( String description ) { } public String getDisplayValue ( ) { } public void setDisplayValue ( String displayValue ) { } public int add ( ) { } public int addType ( DocumentType docType ) { } public static DocumentType getDocumentType ( String code ) { } public int updadateDocumentType ( ) { } public List < DocumentType > getDocumentTypes ( ) { } public List < String > getDocumentTypesDisplayValues ( String localization ) { } public int getIndexByCodeType ( String code ) { } public String getTypebyDisplayVaue ( String value ) { ResultSet rs = null ; Connection localConnection = null ; PreparedStatement statement = null ; try { localConnection = db . getConnection ( ) ; <START_BUG> statement = localConnection . prepareStatement ( "SELECT<seq2seq4repair_space>CODE<seq2seq4repair_space>FROM<seq2seq4repair_space>DOCUMENT_TYPE<seq2seq4repair_space>CT<seq2seq4repair_space>WHERE<seq2seq4repair_space>DISPLAY_VALUE<seq2seq4repair_space>=<seq2seq4repair_space>?" ) ; <END_BUG> statement . setString ( 1 , value ) ; rs = statement . executeQuery ( ) ; while ( rs . next ( ) ) { return rs . getString ( 1 ) ; } return null ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } catch ( Exception exception ) { exception . printStackTrace ( ) ; } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { } } if ( statement != null ) { try { statement . close ( ) ; } catch ( SQLException e ) { } } if ( localConnection != null ) { try { localConnection . close ( ) ; } catch ( SQLException e ) { } } } return null ; } public String getDisplayVauebyType ( String value ) { } }

Fix:
statement = localConnection . prepareStatement ( "SELECT<seq2seq4repair_space>CODE<seq2seq4repair_space>FROM<seq2seq4repair_space>DOCUMENT_TYPE<seq2seq4repair_space>CT<seq2seq4repair_space>WHERE<seq2seq4repair_space>DISPLAY_VALUE<seq2seq4repair_space>LIKE<seq2seq4repair_space>'%'<seq2seq4repair_space>||<seq2seq4repair_space>?<seq2seq4repair_space>||<seq2seq4repair_space>'%'<seq2seq4repair_space>" ) ;
Buggy code:
public class Functor { private static Logger log = LoggingManager . getLoggerForClass ( ) ; Object invokee ; String methodName ; Object [ ] args ; Class [ ] types ; Method methodToInvoke ; public Functor ( Object invokee , String methodName ) { } public Functor ( Object invokee , String methodName , Class [ ] types ) { } public Functor ( String methodName ) { } public Functor ( String methodName , Class [ ] types ) { } public Functor ( Object invokee , String methodName , Object [ ] args ) { } public Functor ( String methodName , Object [ ] args ) { } public Functor ( Object invokee , String methodName , Object [ ] args , Class [ ] types ) { } public Object invoke ( ) { try { return createMethod ( getTypes ( ) ) . invoke ( invokee , getArgs ( ) ) ; } catch ( Exception e ) { <START_BUG> Functor . log . warn ( "Trouble<seq2seq4repair_space>functing<seq2seq4repair_space>method:<seq2seq4repair_space>" , e ) ; <END_BUG> throw new JMeterError ( e ) ; } } public Object invoke ( Object p_invokee ) { } public Object invoke ( Object [ ] p_args ) { } public Object invoke ( Object p_invokee , Object [ ] p_args ) { } private Method createMethod ( Class [ ] p_types ) { } protected Class getPrimitive ( Class t ) { } protected Class [ ] getNewArray ( int i , Class replacement , Class [ ] orig ) { } private Class [ ] getTypes ( ) { } private Object [ ] getArgs ( ) { } }

Fix:
Functor . log . warn ( ( ( ( "Trouble<seq2seq4repair_space>functing<seq2seq4repair_space>method:<seq2seq4repair_space>" + ( methodName ) ) + "<seq2seq4repair_space>invokee:<seq2seq4repair_space>" ) + ( invokee . getClass ( ) . getName ( ) ) ) , e ) ;
Buggy code:
public class MockServletContext implements ServletContext { private static final Logger log = LoggerFactory . getLogger ( MockServletContext . class ) ; private final Application application ; private final ValueMap attributes = new ValueMap ( ) ; private final ValueMap initParameters = new ValueMap ( ) ; private final ValueMap mimeTypes = new ValueMap ( ) ; private File webappRoot ; public MockServletContext ( final Application application , final String path ) { } public void addInitParameter ( final String name , final String value ) { } public void addMimeType ( final String fileExtension , final String mimeType ) { } public Object getAttribute ( final String name ) { } public Enumeration < String > getAttributeNames ( ) { } public ServletContext getContext ( String name ) { } public String getInitParameter ( final String name ) { } public Enumeration < String > getInitParameterNames ( ) { } public int getMajorVersion ( ) { } public String getMimeType ( final String name ) { } public int getMinorVersion ( ) { } public RequestDispatcher getNamedDispatcher ( final String name ) { } public String getRealPath ( String name ) { } public RequestDispatcher getRequestDispatcher ( final String name ) { } public URL getResource ( String name ) throws MalformedURLException { } public InputStream getResourceAsStream ( String name ) { if ( ( webappRoot ) == null ) { return null ; } if ( name . startsWith ( "//" ) ) { name = name . substring ( 1 ) ; } File f = new File ( webappRoot , name ) ; if ( ! ( f . exists ( ) ) ) { return null ; } else { try { return new FileInputStream ( f ) ; } catch ( FileNotFoundException e ) { <START_BUG> e . printStackTrace ( ) ; <END_BUG> return null ; } } } public Set < String > getResourcePaths ( String name ) { } public String getServerInfo ( ) { } public Servlet getServlet ( String name ) throws ServletException { } public String getServletContextName ( ) { } public Enumeration < String > getServletNames ( ) { } public Enumeration < Servlet > getServlets ( ) { } public void log ( Exception e , String msg ) { } public void log ( String msg ) { } public void log ( String msg , Throwable cause ) { } public void removeAttribute ( final String name ) { } public void setAttribute ( final String name , final Object o ) { } public String getContextPath ( ) { } }

Fix:
MockServletContext . log . error ( e . getMessage ( ) , e ) ;
Buggy code:
public class Name { private String [ ] name ; private byte labels ; public static Name root = new Name ( "" ) ; static final int MAXLABELS = 64 ; public Name ( String s , Name origin ) { } public Name ( String s ) { } Name ( DataByteInputStream in , Compression c ) throws IOException { } public Name ( Name d , int n ) { } public void append ( Name d ) { } public short length ( ) { } public byte labels ( ) { } public boolean subdomain ( Name domain ) { } public String toString ( ) { } public void toWire ( DataByteOutputStream out , Compression c ) throws IOException { } public void toWireCanonical ( DataByteOutputStream out ) throws IOException { } public boolean equals ( Object arg ) { } public int hashCode ( ) { int code = labels ; for ( int i = 0 ; i < ( labels ) ; i ++ ) { for ( int j = 0 ; j < ( name [ i ] . length ( ) ) ; j ++ ) <START_BUG> code += name [ i ] . charAt ( j ) ; <END_BUG> } return code ; } }

Fix:
code += Character . toLowerCase ( name [ i ] . charAt ( j ) ) ;
Buggy code:
abstract class AbstractBindingWriteHandler extends WriteAttributeHandlers . WriteAttributeOperationHandler { private static final ServiceName SOCKET_BINDING = SocketBinding . JBOSS_BINDING_NAME ; private final ParameterValidator resolvedValueValidator ; protected AbstractBindingWriteHandler ( ) { } protected AbstractBindingWriteHandler ( ParameterValidator valueValidator ) { } protected AbstractBindingWriteHandler ( ParameterValidator valueValidator , ParameterValidator resolvedValueValidator ) { } protected boolean requiresRestart ( ) { } abstract void handleRuntimeChange ( final ModelNode operation , final String attributeName , final ModelNode attributeValue , final SocketBinding binding ) throws OperationFailedException { } abstract void handleRuntimeRollback ( final ModelNode operation , final String attributeName , final ModelNode previousValue , final SocketBinding binding ) { } @ Override protected void modelChanged ( final OperationContext context , final ModelNode operation , final String attributeName , final ModelNode newValue , final ModelNode currentValue ) throws OperationFailedException { } protected boolean requiresRuntime ( OperationContext context ) { <START_BUG> return ( context . getType ( ) ) == ( Type . SERVER ) ; <END_BUG> } private void handleBindingReinstall ( OperationContext context , String bindingName , ModelNode bindingModel ) throws OperationFailedException { } private void revertBindingReinstall ( OperationContext context , String bindingName , ModelNode bindingModel , String attributeName , ModelNode previousValue ) { } }

Fix:
return context . isNormalServer ( ) ;
Buggy code:
@ NamedQuery ( name = "setParam1" , query = "SELECT<seq2seq4repair_space>o<seq2seq4repair_space>FROM<seq2seq4repair_space>Entity1<seq2seq4repair_space>o<seq2seq4repair_space>WHERE<seq2seq4repair_space>o.pk<seq2seq4repair_space>LIKE<seq2seq4repair_space>:pk" ) public class TestEJBQueryInterface extends AbstractTestCase { public TestEJBQueryInterface ( String name ) { } public void setUp ( ) { } public void testResultList ( ) { } public void testGetSingleList ( ) { } public void testExecuteUpdate ( ) { } public void testSetMaxResults ( ) { } public void testSetFirstResults ( ) { EntityManager em = currentEntityManager ( ) ; <START_BUG> List l = em . createQuery ( "Select<seq2seq4repair_space>object(o)<seq2seq4repair_space>from<seq2seq4repair_space>Entity1<seq2seq4repair_space>o" ) . setFirstResult ( 3 ) . getResultList ( ) ; <END_BUG> Entity1 ent = ( ( Entity1 ) ( l . get ( 0 ) ) ) ; assertNotNull ( ent ) ; assertEquals ( "string3" , ent . getStringField ( ) ) ; assertEquals ( 5 , ent . getIntField ( ) ) ; endEm ( em ) ; } public void xxxtestSetParameter1 ( ) { } }

Fix:
List l = em . createQuery ( "Select<seq2seq4repair_space>object(o)<seq2seq4repair_space>from<seq2seq4repair_space>Entity1<seq2seq4repair_space>o<seq2seq4repair_space>order<seq2seq4repair_space>by<seq2seq4repair_space>o.pk" ) . setFirstResult ( 3 ) . getResultList ( ) ;
Buggy code:
public class EqualInputValidator extends AbstractFormValidator { private static final long serialVersionUID = 1L ; private final FormComponent [ ] components ; public EqualInputValidator ( FormComponent formComponent1 , FormComponent formComponent2 ) { } public FormComponent [ ] getDependentFormComponents ( ) { } public void validate ( Form form ) { final FormComponent formComponent1 = components [ 0 ] ; final FormComponent < ? > formComponent2 = components [ 1 ] ; if ( ! ( Objects . equal ( formComponent1 . getInput ( ) , formComponent2 . getInput ( ) ) ) ) { final String key = resourceKey ( ) ; <START_BUG> formComponent2 . error ( new wicket . validation . ValidationError ( key , messageModel ( ) ) ) ; <END_BUG> } } }

Fix:
formComponent2 . error ( new ValidationError ( ) . addMessageKey ( key ) . setVars ( messageModel ( ) ) ) ;
Buggy code:
public class RemotingModelControllerClient extends AbstractModelControllerClient { private Endpoint endpoint ; private ManagementClientChannelStrategy strategy ; private boolean closed ; private final ModelControllerClientConfiguration clientConfiguration ; public RemotingModelControllerClient ( final ModelControllerClientConfiguration configuration ) { } @ Override public void close ( ) throws IOException { } protected synchronized Channel getChannel ( ) throws IOException { if ( closed ) { throw ControllerClientMessages . MESSAGES . objectIsClosed ( ModelControllerClient . class . getSimpleName ( ) ) ; } if ( ( strategy ) == null ) { try { final ProtocolChannelClient . Configuration configuration = ProtocolConfigurationFactory . create ( clientConfiguration ) ; endpoint = Remoting . createEndpoint ( "management-client" , EMPTY ) ; endpoint . addConnectionProvider ( "remote" , new RemoteConnectionProviderFactory ( ) , EMPTY ) ; configuration . setEndpoint ( endpoint ) ; configuration . setEndpointName ( "management-client" ) ; final ProtocolChannelClient setup = ProtocolChannelClient . create ( configuration ) ; <START_BUG> strategy = ManagementClientChannelStrategy . create ( setup , this , clientConfiguration . getCallbackHandler ( ) , clientConfiguration . getSaslOptions ( ) ) ; <END_BUG> } catch ( IOException e ) { throw e ; } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } return strategy . getChannel ( ) ; } }

Fix:
strategy = ManagementClientChannelStrategy . create ( setup , this , clientConfiguration . getCallbackHandler ( ) , clientConfiguration . getSaslOptions ( ) , clientConfiguration . getSSLContext ( ) ) ;
Buggy code:
public class DecisionTreeTests { private DecisionTree tree ; private List < DataVector > testingData ; int dataSize = 20 ; int numOfAttr = 20 ; int numOfClass = 10 ; private double bootstrapRate = 2.0 // 3 ; @ Before public void setup ( ) { testingData = Helper . setupTestingData ( dataSize , numOfAttr , numOfClass ) ; int numOfAttrSample = getNumOfAttrSample ( testingData ) ; if ( 0 > numOfAttrSample ) { Assert . fail ( ) ; } else { <START_BUG> tree = new DecisionTree ( testingData , bootstrapRate , numOfAttrSample , 0 ) ; <END_BUG> } } @ Test public void testConstructor ( ) { } @ Test public void testClassify ( ) { } @ Test public void printCreatedTree ( ) { } private int getNumOfAttrSample ( List < DataVector > data ) { } No newline ; at end ; of file ; }

Fix:
tree = new DecisionTree ( testingData , bootstrapRate , numOfAttrSample , ( - 1 ) , 0 ) ;
Buggy code:
public class TreeColumn extends Item { Tree parent ; boolean resizable ; boolean moveable ; String toolTipText ; int id ; public TreeColumn ( Tree parent , int style ) { } public TreeColumn ( Tree parent , int style , int index ) { } public void addControlListener ( ControlListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } void destroyWidget ( ) { } public int getAlignment ( ) { } public boolean getMoveable ( ) { } String getNameText ( ) { } public Tree getParent ( ) { } public boolean getResizable ( ) { } public String getToolTipText ( ) { } public int getWidth ( ) { } public void pack ( ) { } void releaseHandle ( ) { } void releaseParent ( ) { } public void removeControlListener ( ControlListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setAlignment ( int alignment ) { } public void setImage ( Image image ) { } void setImage ( Image image , boolean sort , boolean right ) { } public void setMoveable ( boolean moveable ) { } public void setResizable ( boolean resizable ) { } void setSortDirection ( int direction ) { } public void setText ( String string ) { checkWidget ( ) ; if ( string == null ) error ( ERROR_NULL_ARGUMENT ) ; if ( string . equals ( text ) ) return ; int index = parent . indexOf ( this ) ; if ( index == ( - 1 ) ) return ; super . setText ( string ) ; int hHeap = OS . GetProcessHeap ( ) ; <START_BUG> TCHAR buffer = new TCHAR ( parent . getCodePage ( ) , fixMnemonic ( string ) , true ) ; <END_BUG> int byteCount = ( buffer . length ( ) ) * ( TCHAR . sizeof ) ; int pszText = OS . HeapAlloc ( hHeap , HEAP_ZERO_MEMORY , byteCount ) ; OS . MoveMemory ( pszText , buffer , byteCount ) ; int hwndHeader = parent . hwndHeader ; if ( hwndHeader == 0 ) return ; HDITEM hdItem = new HDITEM ( ) ; hdItem . mask = OS . HDI_TEXT ; hdItem . pszText = pszText ; int result = OS . SendMessage ( hwndHeader , HDM_SETITEM , index , hdItem ) ; if ( pszText != 0 ) OS . HeapFree ( hHeap , 0 , pszText ) ; if ( result == 0 ) error ( ERROR_CANNOT_SET_TEXT ) ; } public void setToolTipText ( String string ) { } public void setWidth ( int width ) { } void updateToolTip ( int index ) { } }

Fix:
TCHAR buffer = new TCHAR ( parent . getCodePage ( ) , fixMnemonic ( string , true ) , true ) ;
Buggy code:
public abstract class CRPersisterTest { protected CRPersister persister ; @ Test public void testPersist ( ) { ChallengeRating cr = new ChallengeRating ( 0 , "1//2" , 200 , 65 , 50 , 35 ) ; persister . persist ( cr ) ; <START_BUG> assertTrue ( ( "Expected<seq2seq4repair_space>strictly<seq2seq4repair_space>psoitive<seq2seq4repair_space>id,<seq2seq4repair_space>but<seq2seq4repair_space>got<seq2seq4repair_space>" + ( cr . id ) ) , ( ( cr . id ) > 0 ) ) ; <END_BUG> } @ Test public void testFetchAll ( ) { } @ Test public void testFetchById ( ) { } @ Test public void testFetchLikeName ( ) { } @ Test public void testFetchByName ( ) { } }

Fix:
assertTrue ( ( "Expected<seq2seq4repair_space>strictly<seq2seq4repair_space>positive<seq2seq4repair_space>id,<seq2seq4repair_space>but<seq2seq4repair_space>got<seq2seq4repair_space>" + ( cr . id ) ) , ( ( cr . id ) > 0 ) ) ;
Buggy code:
public class PatchConflictsUnitTestCase extends AbstractPatchingTest { @ Test public void testOverrideModules ( ) throws Exception { } @ Test public void testOverrideAllImpliesOverrideModules ( ) throws Exception { } @ Test public void testModuleOverrideAndRollback ( ) throws Exception { } protected PatchingTestStepBuilder testModuleConflicts ( final ContentVerificationPolicy resolvePolicy ) throws Exception { final PatchingTestBuilder builder = createDefaultBuilder ( ) ; final byte [ ] moduleHash = new byte [ 20 ] ; final File base = builder . getFile ( "modules" , "system" , "layers" , "base" ) ; createModule0 ( base , "org.jboss.test" , randomString ( ) ) ; final PatchingTestStepBuilder oneOff1 = builder . createStepBuilder ( ) ; <START_BUG> oneOff1 . setPatchId ( "one-off-1" ) . oneOffPatchIdentity ( PRODUCT_VERSION ) . oneOffPatchElement ( "base:oo1" , Constants . BASE , false ) . updateModuleWithRandomContent ( "org.jboss.test" , IoUtils . NO_CONTENT , moduleHash ) ; <END_BUG> try { apply ( oneOff1 ) ; Assert . fail ( "should<seq2seq4repair_space>have<seq2seq4repair_space>detected<seq2seq4repair_space>conflicts" ) ; } catch ( ContentConflictsException expected ) { final ModuleItem item = new ModuleItem ( "org.jboss.test" , "main" , moduleHash ) ; Assert . assertTrue ( expected . getConflicts ( ) . contains ( item ) ) ; } apply ( oneOff1 , resolvePolicy ) ; return oneOff1 ; } }

Fix:
oneOff1 . setPatchId ( "one-off-1" ) . oneOffPatchIdentity ( PRODUCT_VERSION ) . oneOffPatchElement ( "base-oo1" , Constants . BASE , false ) . updateModuleWithRandomContent ( "org.jboss.test" , IoUtils . NO_CONTENT , moduleHash ) ;
Buggy code:
public class ColorDialog extends Dialog { RGB rgb ; public ColorDialog ( Shell parent ) { } public ColorDialog ( Shell parent , int style ) { } void changeColor ( int sender ) { } public RGB getRGB ( ) { } public RGB open ( ) { NSColorPanel panel = NSColorPanel . sharedColorPanel ( ) ; if ( ( rgb ) != null ) { NSColor color = NSColor . colorWithDeviceRed ( ( ( rgb . red ) // 255.0F ) , ( ( rgb . green ) // 255.0F ) , ( ( rgb . blue ) // 255.0F ) , 1 ) ; panel . setColor ( color ) ; } SWTPanelDelegate delegate = ( ( SWTPanelDelegate ) ( new SWTPanelDelegate ( ) . alloc ( ) . init ( ) ) ) ; int jniRef = OS . NewGlobalRef ( this ) ; if ( jniRef == 0 ) SWT . error ( ERROR_NO_HANDLES ) ; <START_BUG> delegate . setTag ( jniRef ) ; <END_BUG> panel . setDelegate ( delegate ) ; rgb = null ; panel . orderFront ( null ) ; NSApplication . sharedApplication ( ) . runModalForWindow_ ( panel ) ; panel . setDelegate ( null ) ; delegate . release ( ) ; OS . DeleteGlobalRef ( jniRef ) ; NSColor color = panel . color ( ) ; if ( color != null ) { color = color . colorUsingColorSpaceName_ ( NSString . stringWith ( "NSCalibratedRGBColorSpace" ) ) ; rgb = new RGB ( ( ( int ) ( ( color . redComponent ( ) ) * 255 ) ) , ( ( int ) ( ( color . greenComponent ( ) ) * 255 ) ) , ( ( int ) ( ( color . blueComponent ( ) ) * 255 ) ) ) ; } return rgb ; } public void setRGB ( RGB rgb ) { } void windowWillClose ( int sender ) { } }

Fix:
OS . object_setInstanceVariable ( delegate . id , SWT_OBJECT , jniRef ) ;
Buggy code:
public class ApplyPermissionsService extends Service { private Process suProcess ; private DataOutputStream os ; public ApplyPermissionsService ( ) { } @ Override public IBinder onBind ( Intent intent ) { } @ Override public void onCreate ( ) { } public void setReasonableMinfrees ( ) { ActivityManager activityManager = ( ( ActivityManager ) ( getSystemService ( ACTIVITY_SERVICE ) ) ) ; ActivityManager . MemoryInfo memoryInfo = new ActivityManager . MemoryInfo ( ) ; activityManager . getMemoryInfo ( memoryInfo ) ; long totalRAM = memoryInfo . totalMem ; <START_BUG> if ( totalRAM < 1000000000 ) { <END_BUG> try { this . os . writeBytes ( "echo<seq2seq4repair_space>\'2048,3072,4096,28342,31041,33740\'<seq2seq4repair_space>><seq2seq4repair_space>//sys//module//lowmemorykiller//parameters//minfree\n" ) ; this . os . flush ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } else { try { this . os . writeBytes ( "echo<seq2seq4repair_space>\'2048,3072,4096,69100,77738,86375\'<seq2seq4repair_space>><seq2seq4repair_space>//sys//module//lowmemorykiller//parameters//minfree\n" ) ; this . os . flush ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } private boolean deviceIsRooted ( ) { } public boolean checkIfPermissionsAreSetCorrect ( ) { } public void alterPermissions ( ) { } }

Fix:
if ( totalRAM < 1200000000 ) {
Buggy code:
public class TestTreeBag < T > extends AbstractTestSortedBag < T > { public TestTreeBag ( String testName ) { } @ Override public SortedBag < T > makeObject ( ) { } public void testCollections265 ( ) { <START_BUG> Bag bag = new TreeBag ( ) ; <END_BUG> try { bag . add ( new Object ( ) ) ; TestTreeBag . fail ( "IllegalArgumentException<seq2seq4repair_space>expected" ) ; } catch ( IllegalArgumentException iae ) { } } @ SuppressWarnings ( "unchecked" ) public SortedBag < T > setupBag ( ) { } public void testOrdering ( ) { } @ Override public String getCompatibilityVersion ( ) { } }

Fix:
Bag < Object > bag = new TreeBag < Object > ( ) ;
Buggy code:
@ Transactional @ Service public class ReferendumRecuentoService { @ Autowired private ReferendumRecuentoRepository referendumRecuentoRepository ; @ Autowired private PropuestaService propuestaService ; public ReferendumRecuento save ( ReferendumRecuento referendumRecuento ) { } public List < ReferendumRecuento > save ( List < ReferendumRecuento > referendumRecuentos ) { } public ReferendumRecuento findIdVotacionRecuento ( int idVotacion ) { } public ReferendumRecuento findIdVotacionModificacion ( Integer idModificacion ) { } public List < Propuesta > getVotacionDeRecuento ( Integer idVotacion ) { } public List < Propuesta > getVotacionDeModificacion ( Integer idModificacion ) { RestTemplate restTemplate = new RestTemplate ( ) ; <START_BUG> String urlModificacion = "http:////localhost//Modificacion//modificacion//resultados.do?votacionId=" + idModificacion ; <END_BUG> String jsonString = restTemplate . getForObject ( urlModificacion , String . class ) ; return parseoJsonAPropuestas ( jsonString , idModificacion , false ) ; } public List < Propuesta > parseoJsonAPropuestas ( String jsonString , int idVotacion , boolean recuento ) { } public Object [ ] ParseoDatosVisualizacion ( List < Propuesta > propuestas ) { } }

Fix:
String urlModificacion = "http:////localhost:8181//modificacion//results?votacionId=" + idModificacion ;
Buggy code:
public class ProfileStreamPipelineBuilder < P extends Profile , O extends ProfileStreamOptions < T > , T > { private ProfileStreamFilters < P , T > profileStreamFilters ; public ProfileStreamPipelineBuilder ( ProfileStreamFilters < P , T > profileStreamFilters ) { } public Iterable < P > build ( Iterable < P > profiles , O options , Optional < GeneQueryResponse > geneQueryResponse ) { Set < T > queryFactors = options . getSelectedQueryFactors ( ) ; Set < String > uppercaseGeneIDs = ( geneQueryResponse . isPresent ( ) ) ? geneQueryResponse . get ( ) . getAllGeneIds ( ) : new HashSet < String > ( ) ; Set < T > allQueryFactors = options . getAllQueryFactors ( ) ; Iterable < P > profilesPipeline = profiles ; if ( ! ( uppercaseGeneIDs . isEmpty ( ) ) ) { profilesPipeline = profileStreamFilters . filterByGeneIds ( profilesPipeline , uppercaseGeneIDs ) ; } if ( geneQueryResponse . isPresent ( ) ) { profilesPipeline = profileStreamFilters . averageIntoGeneSets ( profilesPipeline , geneQueryResponse . get ( ) . getQueryTermsToIds ( ) ) ; } if ( ! ( queryFactors . isEmpty ( ) ) ) { <START_BUG> profilesPipeline = ( options . isSpecific ( ) ) ? profileStreamFilters . filterBySpecificQueryFactors ( profiles , queryFactors , allQueryFactors ) : profileStreamFilters . filterByQueryFactors ( profilesPipeline , queryFactors ) ; <END_BUG> } return profilesPipeline ; } }

Fix:
profilesPipeline = ( options . isSpecific ( ) ) ? profileStreamFilters . filterBySpecificQueryFactors ( profilesPipeline , queryFactors , allQueryFactors ) : profileStreamFilters . filterByQueryFactors ( profilesPipeline , queryFactors ) ;
Buggy code:
class NewDomainModelImpl extends BasicModelController implements NewDomainModel { protected NewDomainModelImpl ( final ExtensibleConfigurationPersister configurationPersister ) { } protected NewDomainModelImpl ( final ModelNode model , final ExtensibleConfigurationPersister configurationPersister ) { } private void createCoreModel ( ) { } public ModelNode getModel ( ) { <START_BUG> return super . getModel ( ) ; <END_BUG> } protected static void initialize ( final ModelNodeRegistration root , final ExtensibleConfigurationPersister configurationPersister ) { } protected ModelNodeRegistration getRegistry ( ) { } }

Fix:
return super . getModel ( ) . clone ( ) ;
Buggy code:
public class StreamOutManager { private static Logger logger = LoggerFactory . getLogger ( StreamOutManager . class ) ; private static ConcurrentMap < InetAddress , StreamOutManager > streamManagers = new ConcurrentHashMap < InetAddress , StreamOutManager > ( ) ; public static final Set < InetAddress > pendingDestinations = Collections . synchronizedSet ( new HashSet < InetAddress > ( ) ) ; public static StreamOutManager get ( InetAddress to ) { } public static void remove ( InetAddress to ) { } public static Set < InetAddress > getDestinations ( ) { } public static List < PendingFile > getPendingFiles ( InetAddress host ) { } private final List < PendingFile > files = new ArrayList < PendingFile > ( ) ; private final Map < String , PendingFile > fileMap = new HashMap < String , PendingFile > ( ) ; private final InetAddress to ; private long totalBytes = 0L ; private final SimpleCondition condition = new SimpleCondition ( ) ; private StreamOutManager ( InetAddress to ) { } public void addFilesToStream ( PendingFile [ ] pendingFiles ) { } public void update ( String path , long pos ) { } public void startNext ( ) { if ( ( files . size ( ) ) > 0 ) { File file = new File ( files . get ( 0 ) . getFilename ( ) ) ; if ( StreamOutManager . logger . isDebugEnabled ( ) ) StreamOutManager . logger . debug ( ( ( ( ( "Streaming<seq2seq4repair_space>" + ( file . length ( ) ) ) + "<seq2seq4repair_space>length<seq2seq4repair_space>file<seq2seq4repair_space>" ) + file ) + "<seq2seq4repair_space>..." ) ) ; <START_BUG> instance . stream ( file . getAbsolutePath ( ) , 0L , file . length ( ) , FBUtilities . getLocalAddress ( ) , to ) ; <END_BUG> } } public void finishAndStartNext ( String file ) throws IOException { } public void waitForStreamCompletion ( ) { } List < PendingFile > getFiles ( ) { } }

Fix:
instance . stream ( file . getAbsolutePath ( ) , to ) ;
Buggy code:
public class MLGraphBuilder extends GraphBuilder { private Node root ; private Relationship relationship ; private Relationship r ; private byte [ ] hash ; @ Override public void startGraph ( ) { } @ Override public Relationship relationship ( ) { } @ Override public void fail ( Exception e ) { } @ Override public void endGraph ( ) throws AnimoException { } @ Override protected Object [ ] start ( Statement statement , Object reference , boolean ready ) throws AnimoException { MessageDigest md = MessageDigester . md ( ) ; <START_BUG> Node parent = ( hasParent ( ) ) ? ( ( Relationship ) ( getParent ( ) [ 1 ] ) ) . getEndNode ( ) : root ; <END_BUG> ready = ( ! ( statement instanceof ELEMENT ) ) && ( reference != null ) ; byte [ ] hash = null ; if ( ready ) { updateMD ( md , reference ) ; hash = cloneMD ( md ) . digest ( ) ; updateMD ( md , statement ) ; } Relationship r = statement . build ( parent , reference , hash , ready , ignoreNotFound ) ; Object [ ] o = new Object [ ] { md , r , ready , order ( ) , statement , reference } ; step ( ) ; return o ; } @ Override protected byte [ ] end ( Object [ ] item ) throws AnimoException { } private void destructive ( Relationship r ) { } private void destructive ( Node n ) { } }

Fix:
Node parent = ( hasParent ( ) ) ? ( ( Relationship ) ( peekParent ( ) [ 1 ] ) ) . getEndNode ( ) : root ;
Buggy code:
class DayTimeDurationDV extends DurationDV { public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { } protected Duration getDuration ( DateTimeData date ) { int sign = 1 ; if ( ( ( ( ( date . day ) < 0 ) || ( ( date . hour ) < 0 ) ) || ( ( date . minute ) < 0 ) ) || ( ( date . second ) < 0 ) ) { sign = - 1 ; } <START_BUG> return factory . newDuration ( ( sign == 1 ) , null , null , ( ( date . day ) != ( DatatypeConstants . FIELD_UNDEFINED ) ? BigInteger . valueOf ( ( sign * ( date . day ) ) ) : null ) , ( ( date . hour ) != ( DatatypeConstants . FIELD_UNDEFINED ) ? BigInteger . valueOf ( ( sign * ( date . hour ) ) ) : null ) , ( ( date . minute ) != ( DatatypeConstants . FIELD_UNDEFINED ) ? BigInteger . valueOf ( ( sign * ( date . minute ) ) ) : null ) , ( ( date . second ) != ( DatatypeConstants . FIELD_UNDEFINED ) ? new BigDecimal ( String . valueOf ( ( sign * ( date . second ) ) ) ) : null ) ) ; <END_BUG> } }

Fix:
return datatypeFactory . newDuration ( ( sign == 1 ) , null , null , ( ( date . day ) != ( DatatypeConstants . FIELD_UNDEFINED ) ? BigInteger . valueOf ( ( sign * ( date . day ) ) ) : null ) , ( ( date . hour ) != ( DatatypeConstants . FIELD_UNDEFINED ) ? BigInteger . valueOf ( ( sign * ( date . hour ) ) ) : null ) , ( ( date . minute ) != ( DatatypeConstants . FIELD_UNDEFINED ) ? BigInteger . valueOf ( ( sign * ( date . minute ) ) ) : null ) , ( ( date . second ) != ( DatatypeConstants . FIELD_UNDEFINED ) ? new BigDecimal ( String . valueOf ( ( sign * ( date . second ) ) ) ) : null ) ) ;
Buggy code:
public class JobsBundleTest { private final Environment environment = mock ( Environment . class ) ; private final LifecycleEnvironment applicationContext = mock ( LifecycleEnvironment . class ) ; @ Test public void assertJobsBundleIsWorking ( ) { <START_BUG> when ( environment . lifecycle ( ) ) . thenReturn ( mock ( LifecycleEnvironment . class ) ) ; <END_BUG> new JobsBundle ( ) . run ( environment ) ; final ArgumentCaptor < JobManager > jobManagerCaptor = ArgumentCaptor . forClass ( JobManager . class ) ; verify ( applicationContext ) . manage ( jobManagerCaptor . capture ( ) ) ; JobManager jobManager = jobManagerCaptor . getValue ( ) ; assertThat ( jobManager , is ( notNullValue ( ) ) ) ; } }

Fix:
when ( environment . lifecycle ( ) ) . thenReturn ( applicationContext ) ;
Buggy code:
@ RunWith ( FeaturesRunner . class ) @ Features ( { PlatformFeature . class , CoreFeature . class , EmbeddedAutomationServerFeature . class } ) @ Deploy ( { "org.nuxeo.labs.operation" } ) public class RESTTest { private static final Log log = LogFactory . getLog ( RESTTest . class ) ; protected static final String URL_TEST_GET = "http:////dam.cloud.nuxeo.com//nuxeo//api//v1//path////" ; @ Inject CoreSession session ; @ Inject AutomationService service ; @ Before public void setUp ( ) { } @ After public void cleanup ( ) { } @ Test public void testRESTGet ( ) throws Exception { OperationContext ctx ; OperationChain chain ; ctx = new OperationContext ( session ) ; assertNotNull ( ctx ) ; chain = new OperationChain ( "testChain" ) ; Properties props = new Properties ( ) ; props . put ( "Authorization" , "Basic<seq2seq4repair_space>QWRtaW5pc3RyYXRvcjpBZG1pbmlzdHJhdG9y" ) ; props . put ( "Accept" , "application//json" ) ; props . put ( "Content-Type" , "application//json" ) ; chain . add ( ID ) . set ( "method" , "GET" ) . set ( "url" , RESTTest . URL_TEST_GET ) . set ( "headers" , props ) ; Blob result = ( ( Blob ) ( service . run ( ctx , chain ) ) ) ; assertTrue ( ( result instanceof StringBlob ) ) ; String jsonResult = result . getString ( ) ; ObjectMapper mapper = new ObjectMapper ( ) ; JsonNode rootNode = mapper . readTree ( jsonResult ) ; int status = rootNode . get ( "status" ) . getIntValue ( ) ; if ( status == 200 ) { JsonNode theDoc = rootNode . get ( "result" ) ; String str ; str = theDoc . get ( "type" ) . getTextValue ( ) ; <START_BUG> assertEquals ( "Roo" , str ) ; <END_BUG> } else { String statusMsg = rootNode . get ( "statusMessage" ) . getTextValue ( ) ; String error = rootNode . get ( "error" ) . getTextValue ( ) ; RESTTest . log . error ( ( ( ( ( ( ( ( "PROBLEM<seq2seq4repair_space>REACHING<seq2seq4repair_space>" + ( RESTTest . URL_TEST_GET ) ) + ",<seq2seq4repair_space>status:<seq2seq4repair_space>" ) + status ) + ",<seq2seq4repair_space>statusMessage:<seq2seq4repair_space>" ) + statusMsg ) + ",<seq2seq4repair_space>error:<seq2seq4repair_space>" ) + error ) ) ; } } }

Fix:
assertEquals ( "Root" , str ) ;
Buggy code:
public abstract class FormComponent extends WebMarkupContainer { public interface IVisitor { public void formComponent ( FormComponent formComponent ) { } } private final class DisabledAttributeModel extends Model { private static final long serialVersionUID = 1L ; public Object getObject ( Component component ) { } } private static final class DisabledAttributeModifier extends AttributeModifier { private static final long serialVersionUID = 1L ; public DisabledAttributeModifier ( FormComponent . DisabledAttributeModel model ) { } } protected static final short FLAG_CONVERT_EMPTY_INPUT_STRING_TO_NULL = FLAG_RESERVED1 ; private static final short FLAG_PERSISTENT = FLAG_RESERVED2 ; private static final String NO_RAW_INPUT = "[-NO-RAW-INPUT-]" ; private String rawInput = FormComponent . NO_RAW_INPUT ; private Object validators = null ; private IModel labelModel = null ; public FormComponent ( final String id ) { } public FormComponent ( final String id , IModel model ) { } public final FormComponent add ( final IValidator validator ) { } public final Form getForm ( ) { } public FormComponent setLabel ( final IModel labelModel ) { } public IModel getLabel ( ) { } public String getInput ( ) { } public String getInputName ( ) { String id = getId ( ) ; final StringBuffer inputName = new StringBuffer ( id . length ( ) ) ; Component c = this ; while ( true ) { inputName . insert ( 0 , id ) ; c = c . getParent ( ) ; if ( ( ( c == null ) || ( c instanceof Form ) ) || ( c instanceof Page ) ) { break ; } <START_BUG> inputName . insert ( 0 , ':' ) ; <END_BUG> id = c . getId ( ) ; } return inputName . toString ( ) ; } public final Class getValidationType ( ) { } public final List getValidators ( ) { } public final String getValue ( ) { } public final void invalid ( ) { } public boolean isMultiPart ( ) { } public final boolean isPersistent ( ) { } public final boolean isValid ( ) { } public final boolean isValidated ( ) { } public void setModelValue ( final String value ) { } public final void setPersistent ( final boolean persistent ) { } public abstract void updateModel ( ) { } public final void valid ( ) { } public final void validate ( ) { } protected String getModelValue ( ) { } protected final int inputAsInt ( ) { } protected final int inputAsInt ( final int defaultValue ) { } protected final int [ ] inputAsIntArray ( ) { } protected final String [ ] inputAsStringArray ( ) { } protected void onComponentTag ( final ComponentTag tag ) { } protected void onInvalid ( ) { } protected void onModelChanged ( ) { } protected void onValid ( ) { } protected boolean supportsPersistence ( ) { } private void validators_add ( final IValidator validator ) { } private IValidator validators_get ( int index ) { } private int validators_size ( ) { } final void registerNewUserInput ( ) { } private String getUserInput ( ) { } }

Fix:
inputName . insert ( 0 , PATH_SEPARATOR ) ;
Buggy code:
public class CacheMetricsHandler extends AbstractRuntimeOnlyHandler { @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) { <START_BUG> PathAddress address = Operations . getPathAddress ( operation ) ; <END_BUG> String containerName = address . getElement ( ( ( address . size ( ) ) - 2 ) ) . getValue ( ) ; String cacheName = address . getElement ( ( ( address . size ( ) ) - 1 ) ) . getValue ( ) ; String name = Operations . getAttributeName ( operation ) ; CacheMetric metric = CacheMetric . forName ( name ) ; if ( metric == null ) { context . getFailureDescription ( ) . set ( ROOT_LOGGER . unknownMetric ( name ) ) ; } else { Cache < ? , ? > cache = ServiceContainerHelper . findValue ( context . getServiceRegistry ( false ) , CACHE . getServiceName ( containerName , cacheName ) ) ; if ( cache != null ) { context . getResult ( ) . set ( metric . getValue ( cache ) ) ; } } context . completeStep ( NOOP_RESULT_HANDLER ) ; } }

Fix:
PathAddress address = context . getCurrentAddress ( ) ;
Buggy code:
public class GuiXmlLoader { public static final String LAYOUT_WINDOW_PREFFIX = "window:" ; public static void load ( String path ) { Document doc = null ; try { doc = Dom4jUtil . getDOM ( path ) ; } catch ( Exception e1 ) { e1 . printStackTrace ( ) ; } AttributeModel attr ; Element e = doc . getRootElement ( ) ; if ( ( ComponentManager . getComponent ( ( ( GuiXmlLoader . LAYOUT_WINDOW_PREFFIX ) + path ) ) ) != null ) { ComponentManager . getComponent ( ( ( GuiXmlLoader . LAYOUT_WINDOW_PREFFIX ) + path ) ) . setVisible ( true ) ; return ; } try { attr = GuiXmlLoader . parseAttribute ( e ) ; Window window ; if ( "jframe" . equals ( e . getName ( ) . toLowerCase ( ) ) ) { window = new JFrame ( ) ; } else if ( "jdialog" . equals ( e . getName ( ) . toLowerCase ( ) ) ) { window = new JDialog ( ) ; } else if ( "jwindow" . equals ( e . getName ( ) . toLowerCase ( ) ) ) { window = new JWindow ( ) ; } else { JOptionPane . showMessageDialog ( null , "只能使用JFrame//JWindow//JDialog作为根元素！" ) ; return ; } <START_BUG> if ( ( attr . getId ( ) ) == null ) { <END_BUG> ComponentManager . putComponent ( attr . getId ( ) , window ) ; } if ( ( ComponentManager . getMainWindow ( ) ) == null ) { ComponentManager . setMainWindow ( window ) ; } BeanUtil . apply ( attr , window ) ; ComponentManager . setCommonAttribute ( window , attr ) ; if ( window instanceof JFrame ) { if ( AttributeValidator . bounds ( attr . getMaximizedBounds ( ) ) ) { int [ ] arr = AttributeTransfer . bounds ( attr . getMaximizedBounds ( ) ) ; ( ( JFrame ) ( window ) ) . setMaximizedBounds ( new Rectangle ( arr [ 0 ] , arr [ 1 ] , arr [ 2 ] , arr [ 3 ] ) ) ; } } if ( ! ( AttributeValidator . isBlank ( attr . getIconImage ( ) ) ) ) { window . setIconImage ( ( ( ImageIcon ) ( AttributeTransfer . icon ( attr . getIconImage ( ) ) ) ) . getImage ( ) ) ; } if ( ! ( AttributeValidator . isBlank ( attr . getLocationRelativeTo ( ) ) ) ) { window . setLocationRelativeTo ( ComponentManager . getComponent ( attr . getLocationRelativeTo ( ) ) ) ; } EventListener l = ListenerManager . getListener ( attr . getId ( ) ) ; if ( l != null ) { ListenerManager . setComponentListeners ( window , l ) ; ( ( org . arong . axmlswing . event . AbstractListener ) ( l ) ) . init ( window ) ; } GuiXmlLoader . parse ( window , e , attr ) ; window . setVisible ( true ) ; ComponentManager . putComponent ( ( ( GuiXmlLoader . LAYOUT_WINDOW_PREFFIX ) + path ) , window ) ; } catch ( IllegalArgumentException e1 ) { e1 . printStackTrace ( ) ; } catch ( IllegalAccessException e1 ) { e1 . printStackTrace ( ) ; } finally { } } @ SuppressWarnings ( "unchecked" ) public static void parse ( Container container , Element e , AttributeModel attr ) { } public static void common ( String id , Container comp , AttributeModel attr , EventListener l , Container container , Element e ) { } @ SuppressWarnings ( "unchecked" ) private static AttributeModel parseAttribute ( Element e ) throws IllegalAccessException , IllegalArgumentException { } }

Fix:
if ( ( attr . getId ( ) ) != null ) {
Buggy code:
public class Test01Exceptions extends TestCase { public static void main ( String [ ] args ) { } boolean verbose = false ; final String fieldName = "bi" ; String [ ] exceptionQueries = new String [ ] { "*" , "a*" , "ab*" , "?" , "a?" , "ab?" , "a???b" , "a?" , "a*b?" , "word1<seq2seq4repair_space>word2" , "word2<seq2seq4repair_space>AND" , "word1<seq2seq4repair_space>OR" , "AND(word2)" , "AND(word2,)" , "AND(word2,word1,)" , "OR(word2)" , "OR(word2<seq2seq4repair_space>," , "OR(word2<seq2seq4repair_space>,<seq2seq4repair_space>word1<seq2seq4repair_space>,)" , "xx<seq2seq4repair_space>NOT" , "xx<seq2seq4repair_space>(a<seq2seq4repair_space>AND<seq2seq4repair_space>b)" , "(a<seq2seq4repair_space>AND<seq2seq4repair_space>b" , "a<seq2seq4repair_space>OR<seq2seq4repair_space>b)" , "or(word2+<seq2seq4repair_space>not<seq2seq4repair_space>ord+,<seq2seq4repair_space>and<seq2seq4repair_space>xyz,def)" , "" } ; public void test01Exceptions ( ) throws Exception { <START_BUG> String m = ExceptionQueryTest . getFailQueries ( exceptionQueries , verbose ) ; <END_BUG> if ( ( m . length ( ) ) > 0 ) { fail ( ( "No<seq2seq4repair_space>ParseException<seq2seq4repair_space>for:\n" + m ) ) ; } } }

Fix:
String m = ExceptionQueryTst . getFailQueries ( exceptionQueries , verbose ) ;
Buggy code:
public class ConfigurationPersisterFactory { private static final String HOST_XML = "host.xml" ; private static final String DOMAIN_XML = "domain.xml" ; public static ExtensibleConfigurationPersister createHostXmlConfigurationPersister ( final File configDir ) { HostXml hostXml = new HostXml ( Module . getSystemModuleLoader ( ) ) ; <START_BUG> return new ConfigurationPersisterFactory . TempHackConfigurationPersister ( ConfigurationPersisterFactory . getFile ( configDir , ConfigurationPersisterFactory . HOST_XML ) , new QName ( CURRENT . getUriString ( ) , "host" ) , hostXml , hostXml ) ; <END_BUG> } public static ExtensibleConfigurationPersister createDomainXmlConfigurationPersister ( final File configDir ) { } private static File getFile ( final File configDir , final String file ) { } private static class TempHackConfigurationPersister extends BackupXmlConfigurationPersister { public TempHackConfigurationPersister ( final File fileName , final QName rootElement , XMLElementReader < List < ModelNode > > rootParser , XMLElementWriter < ModelMarshallingContext > rootDeparser ) { } @ Override public void store ( ModelNode model ) throws ConfigurationPersistenceException { } } }

Fix:
return new BackupXmlConfigurationPersister ( ConfigurationPersisterFactory . getFile ( configDir , ConfigurationPersisterFactory . HOST_XML ) , new QName ( CURRENT . getUriString ( ) , "host" ) , hostXml , hostXml ) ;
Buggy code:
public class AnnotationPatternTestCase extends TestCase { public void testParseSimpleAnnotationPattern ( ) { } public void testParseAndAnnotationPattern ( ) { } public void testParseNotAnnotationPattern ( ) { } public void testParseBracketedAnnotationPattern ( ) { } public void testParseFQAnnPattern ( ) { } public void testParseComboPattern ( ) { } public void testParseBadPattern ( ) { PatternParser p = new PatternParser ( "@@Foo" ) ; try { AnnotationTypePattern bad = p . maybeParseAnnotationPattern ( ) ; fail ( "ParserException<seq2seq4repair_space>expected" ) ; } catch ( ParserException pEx ) { <START_BUG> assertEquals ( "expected<seq2seq4repair_space>name<seq2seq4repair_space>pattern" , pEx . getMessage ( ) ) ; <END_BUG> } } public void testParseBadPattern2 ( ) { } public void testParseNameOrVarAnnotationPattern ( ) { } public void testParseNameOrVarAnnotationPatternWithNot ( ) { } public void testParseNameOrVarAnnotationPatternWithOr ( ) { } public void testParseNameOrVarAnnotationWithBinding ( ) { } public void testParseNameOrVarAnnotationPatternWithAnd ( ) { } public void testMaybeParseAnnotationPattern ( ) { } public void testParseTypePatternsWithAnnotations ( ) { } public void testParseTypePatternsWithAnnotationsComplex ( ) { } public void testNotSyntax ( ) { } public void testParseMethodOrConstructorSigNoAP ( ) { } public void testParseMethodOrConstructorSigSimpleAP ( ) { } public void testParseMethodOrConstructorSigComplexAP ( ) { } public void testParseMethodFieldSigNoAP ( ) { } public void testParseFieldSigSimpleAP ( ) { } public void testParseFieldSigComplexAP ( ) { } public void testExactAnnotationPatternMatching ( ) { } public void testBindingAnnotationPatternMatching ( ) { } public void testAndAnnotationPatternMatching ( ) { } public void testNotAnnotationPatternMatching ( ) { } public void testAnyAnnotationPatternMatching ( ) { } public TestScope makeSimpleScope ( ) { } static class AnnotatedElementImpl implements AnnotatedElement { private String [ ] annotationTypes ; public AnnotatedElementImpl ( String [ ] annotationTypes ) { } public boolean hasAnnotation ( TypeX ofType ) { } public ResolvedTypeX [ ] getAnnotationTypes ( ) { } } }

Fix:
assertEquals ( "name<seq2seq4repair_space>pattern" , pEx . getMessage ( ) ) ;
Buggy code:
public class GUnzip extends Unpack { private static final String DEFAULT_EXTENSION = ".gz" ; protected String getDefaultExtension ( ) { } protected void extract ( ) { if ( ( source . lastModified ( ) ) > ( dest . lastModified ( ) ) ) { log ( ( ( ( "Expanding<seq2seq4repair_space>" + ( source . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( dest . getAbsolutePath ( ) ) ) ) ; FileOutputStream out = null ; GZIPInputStream zIn = null ; FileInputStream fis = null ; try { out = new FileOutputStream ( dest ) ; fis = new FileInputStream ( source ) ; zIn = new GZIPInputStream ( fis ) ; byte [ ] buffer = new byte [ 8 * 1024 ] ; int count = 0 ; do { out . write ( buffer , 0 , count ) ; count = zIn . read ( buffer , 0 , buffer . length ) ; } while ( count != ( - 1 ) ) ; } catch ( IOException ioe ) { String msg = "Problem<seq2seq4repair_space>expanding<seq2seq4repair_space>gzip<seq2seq4repair_space>" + ( ioe . getMessage ( ) ) ; <START_BUG> throw new org . apache . tools . ant . BuildException ( msg , ioe , location ) ; <END_BUG> } finally { if ( fis != null ) { try { fis . close ( ) ; } catch ( IOException ioex ) { } } if ( out != null ) { try { out . close ( ) ; } catch ( IOException ioex ) { } } if ( zIn != null ) { try { zIn . close ( ) ; } catch ( IOException ioex ) { } } } } } }

Fix:
throw new org . apache . tools . ant . BuildException ( msg , ioe , getLocation ( ) ) ;