nus-yam/ex-repair huggingface dataset:
Buggy code:
@ Log4j public class SimulationAndCircuitGenerator { @ BeforeClass public static void setUpBeforeClass ( ) throws Exception { } @ Test public void test ( ) { } @ Test public void test2 ( ) { Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; shell . setText ( "VueTest" ) ; shell . setLayout ( new FillLayout ( ) ) ; shell . setSize ( 800 , 800 ) ; VueHall vueHall = new VueHall ( shell , SWT . NONE ) ; vueHall . setSize ( 300 , 300 ) ; Simulation s = new Simulation ( vueHall ) ; CircuitGenerator cg = new CircuitGenerator ( vueHall ) ; Point p1 = new Point ( 50 , 50 ) ; Point p2 = new Point ( 100 , 50 ) ; Point p3 = new Point ( 200 , 100 ) ; Point p4 = new Point ( 500 , 500 ) ; Point p5 = new Point ( 300 , 500 ) ; Point p6 = new Point ( 100 , 600 ) ; Point p7 = new Point ( 50 , 600 ) ; cg . createSegment ( p1 , p2 ) ; cg . createSegment ( p2 , p3 ) ; cg . createSegment ( p3 , p4 ) ; VueRail vueRail2 = cg . createSegment ( p4 , p5 ) ; VueRail vueRail1 = cg . createSegment ( p5 , p6 ) ; cg . createSegment ( p6 , p7 ) ; cg . createSegment ( p7 , p1 ) ; VueToboggan vTobo = cg . createExit ( p3 ) ; vTobo . setAngle ( 75 ) ; vTobo . getToboggan ( ) . setAutoDeleteBagages ( false ) ; VueTapisRoulant vueTapis = cg . createEntry ( p5 , 100 , 10 , 20 , true ) ; vueTapis . setAngle ( 150 ) ; TapisRoulant tapis = vueTapis . getTapisRoulant ( ) ; <START_BUG> cg . addChariot ( vueRail1 . getRail ( ) . getNoeudSuivant ( ) , 40 , 80 , tapis . getConnexionCircuit ( ) , null , vueHall . getHall ( ) . getCircuit ( ) . calculChemin ( vueRail1 . getRail ( ) . getNoeudSuivant ( ) , tapis . getConnexionCircuit ( ) ) ) ; <END_BUG> cg . addChariot ( vueRail2 . getRail ( ) . getNoeudSuivant ( ) , 50 , 80 , tapis . getConnexionCircuit ( ) , null , vueHall . getHall ( ) . getCircuit ( ) . calculChemin ( vueRail1 . getRail ( ) . getNoeudSuivant ( ) , tapis . getConnexionCircuit ( ) ) ) ; vueHall . getHall ( ) . init ( ) ; shell . open ( ) ; vueHall . updateView ( ) ; vueHall . draw ( ) ; s . init ( ) ; s . play ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) { shell . layout ( ) ; display . sleep ( ) ; } } } }

Fix:
cg . addChariot ( vueRail1 . getRail ( ) . getNoeudSuivant ( ) , 10 , 80 , tapis . getConnexionCircuit ( ) , null , vueHall . getHall ( ) . getCircuit ( ) . calculChemin ( vueRail1 . getRail ( ) . getNoeudSuivant ( ) , tapis . getConnexionCircuit ( ) ) ) ;
Buggy code:
public final class HashtableOfArrayToObject implements Cloneable { public Object [ ] [ ] keyTable ; public Object [ ] valueTable ; public int elementSize ; int threshold ; public HashtableOfArrayToObject ( ) { } public HashtableOfArrayToObject ( int size ) { } public Object clone ( ) throws CloneNotSupportedException { } public boolean containsKey ( Object [ ] key ) { } public Object get ( Object [ ] key ) { } public Object [ ] getKey ( Object [ ] key , int keyLength ) { } private int hashCode ( Object [ ] element ) { } private int hashCode ( Object [ ] element , int length ) { int hash = 0 ; <START_BUG> for ( int i = 0 ; i < length ; i ++ ) <END_BUG> hash = Util . combineHashCodes ( hash , element [ i ] . hashCode ( ) ) ; return hash & 2147483647 ; } public Object put ( Object [ ] key , Object value ) { } public Object removeKey ( Object [ ] key ) { } private void rehash ( ) { } public int size ( ) { } public String toString ( ) { } }

Fix:
for ( int i = length - 1 ; i >= 0 ; i -- )
Buggy code:
public interface ServerSecurityManager { void push ( final String securityDomain ) { } void push ( final String securityDomain , String userName , char [ ] password , final Subject subject ) { } void authenticate ( ) { } void authenticate ( final String runAs , final String runAsPrincipal , final Set < String > extraRoles ) { } void pop ( ) { } Principal getCallerPrincipal ( ) { } Subject getSubject ( ) { } <START_BUG> boolean isCallerInRole ( final String ejbName , final Object mappedRoles , final Map < String , Collection < String > > roleLinks , final String ... roleNames ) ; <END_BUG> boolean authorize ( String ejbName , CodeSource ejbCodeSource , String ejbMethodIntf , Method ejbMethod , Set < Principal > methodRoles , String contextID ) { } }

Fix:
boolean isCallerInRole ( final Object mappedRoles , final Map < String , Collection < String > > roleLinks , final String ... roleNames ) ;
Buggy code:
public class WorkbenchErrorHandler extends AbstractStatusHandler { private WorkbenchStatusDialogManager statusDialogManager ; void setStatusDialog ( WorkbenchStatusDialogManager manager ) { } public void handle ( final StatusAdapter statusAdapter , int style ) { } private void showStatusAdapter ( StatusAdapter statusAdapter , boolean block ) { if ( ! ( PlatformUI . isWorkbenchRunning ( ) ) ) { WorkbenchPlugin . log ( statusAdapter . getStatus ( ) ) ; return ; } getStatusDialogManager ( ) . addStatusAdapter ( statusAdapter , block ) ; if ( block ) { Shell shell ; <START_BUG> while ( ( ( shell = getStatusDialogManager ( ) . getShell ( ) ) != null ) && ( ! ( getStatusDialogManager ( ) . getShell ( ) . isDisposed ( ) ) ) ) { <END_BUG> if ( ! ( shell . getDisplay ( ) . readAndDispatch ( ) ) ) { Display . getDefault ( ) . sleep ( ) ; } } } } private WorkbenchStatusDialogManager getStatusDialogManager ( ) { } protected void configureStatusDialog ( final WorkbenchStatusDialogManager statusDialog ) { } }

Fix:
while ( ( ( shell = getStatusDialogManager ( ) . getShell ( ) ) != null ) && ( ! ( shell . isDisposed ( ) ) ) ) {
Buggy code:
public class LabelsIntegrationTest { @ Rule public DebuggableTemporaryFolder temporaryFolder = new DebuggableTemporaryFolder ( ) ; private ProjectWorkspace workspace ; @ Before public void setUpWorkspace ( ) throws IOException { } @ Test public void shouldFailWithDashDashAll ( ) throws IOException { } @ Test public void shouldFailWithExplicitTargetsThatReferToFailingTests ( ) throws IOException { } @ Test public void shouldPassWithDashDashAllWhenExcludingUnscientificTests ( ) throws IOException { } @ Test public void shouldPassWithDashDashAllWhenIncludingOnlyScientificTests ( ) throws IOException { } @ Test public void shouldFailBecauseWeExplicitlyAskedForAFailingTestToRunEvenThoughWeTriedToExcludeIt ( ) throws IOException { } @ Test public void shouldPassWhenFailingTestIncludedAndExcludedWithAlwaysExcludeFlag ( ) throws IOException { } @ Test public void shouldIgnoreFailingTestWithTheCorrectLabelConjunction ( ) throws IOException { } private void assertTestsFail ( String ... args ) throws IOException { ProjectWorkspace . ProcessResult result = workspace . runBuckCommand ( args ) ; result . assertTestFailure ( ) ; assertThat ( result . getStderr ( ) , containsString ( "Earth<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>flat!" ) ) ; <START_BUG> assertThat ( result . getStderr ( ) , containsString ( "TESTS<seq2seq4repair_space>FAILED:<seq2seq4repair_space>1<seq2seq4repair_space>Failures" ) ) ; <END_BUG> } private void assertTestsPass ( String ... args ) throws IOException { } }

Fix:
assertThat ( result . getStderr ( ) , containsString ( "TESTS<seq2seq4repair_space>FAILED:<seq2seq4repair_space>1<seq2seq4repair_space>FAILURE" ) ) ;
Buggy code:
public class Application extends Controller { private static final RestGraphDatabase gdb = new RestGraphDatabase ( Application . neo4jUrl ( ) , System . getenv ( "NEO4J_LOGIN" ) , System . getenv ( "NEO4J_PASSWORD" ) ) ; private static final RepositoryService service = new RepositoryService ( Application . gdb , new org . neo4j . rest . graphdb . query . RestCypherQueryEngine ( Application . gdb . getRestAPI ( ) ) ) ; private static final String COMMA_SPLIT = "\\s*,\\s*" ; private static String neo4jUrl ( ) { } public static void reindex ( ) { } private static void index ( ) { } public static void show ( Integer id ) { } public static void install ( Integer id ) { } public static void update ( Integer id ) { } public static void index ( String tags , String q ) { } static Map < String , Category > parseTagsString ( String tags ) { } public static void like ( Integer id , int stars , String comment ) { if ( Application . loggedIn ( ) ) { Application . service . like ( id , Application . email ( ) , stars , comment ) ; } <START_BUG> Application . index ( ) ; <END_BUG> } public static void add ( ) { } private static Collection < AppInfo > sharedApps ( ) { } public static void addApp ( String name , String repository , String giturl , String herokuapp , String stack , String type , String language , String framework , String build , String addon , String email , String description , String docurl , String videourl ) { } public static void updateApp ( Integer id , String name , String repository , String giturl , String herokuapp , String stack , String type , String language , String framework , String build , String addon , String description , String docurl , String videourl ) { } public static void addAddons ( ) { } private static String addonName ( Addon addon ) { } private static String toJson ( Object value ) { } public static void login ( String email , String password ) { } public static void logout ( ) { } private static String email ( ) { } private static String token ( ) { } private static HerokuApi herokuApi ( ) { } private static boolean loggedIn ( ) { } private static List < AppInfo > listApps ( Collection < AppInfo > sharedApps ) { } private static boolean isShared ( Collection < AppInfo > sharedApps , App app ) { } private static String toStack ( App herokuApp ) { } }

Fix:
Application . show ( id ) ;
Buggy code:
public class TabbarActionSelectionListenerTest extends SiriusDiagramTestCase implements EcoreModeler { private static final String PATH = "//data//unit//tabbar//vp-3632//" ; private static final String SEMANTIC_MODEL_FILENAME = "vp-3632.ecore" ; private static final String SESSION_MODEL_FILENAME = "vp-3632.aird" ; private static final String REPRESENTATION_NAME_PATTERN = "newPackage%d<seq2seq4repair_space>package<seq2seq4repair_space>entities" ; private ArrayList < DDiagramEditor > editors ; @ Override protected void setUp ( ) throws Exception { } public void testNumberOfListenerIsCorrectAfterOpenCloseDiagrams ( ) { } private void closeEditor ( DDiagramEditor editor ) { } private DDiagramEditor openEditor ( int i ) { } private void closeAllEditors ( ) { } private void openAllEditors ( ) { } private Object [ ] getWorkbenchWindowSelectionListeners ( ) { } private Object [ ] getPageSelectionListeners ( ) { IWorkbenchPage page = PlatformUI . getWorkbench ( ) . getActiveWorkbenchWindow ( ) . getActivePage ( ) ; Object [ ] listeners = null ; if ( page instanceof IPartService ) { Option < Object > option = ReflectionHelper . getFieldValueWithoutException ( page , "selectionListeners" ) ; if ( option . some ( ) ) { listeners = ( ( List ) ( option . get ( ) ) ) . toArray ( ) ; } } if ( listeners == null ) { Option < Object > option = ReflectionHelper . getFieldValueWithoutException ( page , "selectionService" ) ; if ( option . some ( ) ) { ISelectionService pageSelectionService = ( ( ISelectionService ) ( option . get ( ) ) ) ; <START_BUG> Option < Object > listenerListOption = getFieldValueWithoutException ( pageSelectionService . getClass ( ) . getSuperclass ( ) , pageSelectionService , "listeners" ) ; <END_BUG> if ( listenerListOption . some ( ) ) { listeners = ( ( ListenerList ) ( listenerListOption . get ( ) ) ) . getListeners ( ) ; } } } return listeners ; } private Object [ ] getPartServiceListeners ( ) { } private Option < Object > getFieldValueWithoutException ( Class < ? > clazz , Object instance , String fieldName ) { } }

Fix:
Option < Object > listenerListOption = ReflectionHelper . getFieldValueWithoutException ( pageSelectionService , "listeners" ) ;
Buggy code:
public class TransacaoServiceImpl implements TransacaoService { private TransacaoDao dao ; private static final Logger LOG = Logger . getLogger ( TransacaoServiceImpl . class ) ; public TransacaoServiceImpl ( ) { } @ Override public Transacao gravar ( Transacao transacao ) throws SQLException { } @ Override public void remover ( Transacao transacao ) throws SQLException { } @ Override public void removerPorId ( Integer id ) throws SQLException { try { Transacao transacaoBanco = this . dao . buscar ( id ) ; this . dao . beginTransaction ( ) ; <START_BUG> this . dao . remover ( transacaoBanco ) ; <END_BUG> this . dao . commit ( ) ; } catch ( Throwable exc ) { this . dao . rollback ( ) ; throw new SQLException ( exc ) ; } } @ Override public Transacao buscar ( Integer usuarioId , Integer transacaoId ) { } @ Override public List < Transacao > listarDoPeriodo ( Integer usuarioId , Integer mes , Integer ano , boolean considerarDataPagamento , boolean mesesAnteriorProximo , TransacaoTipo tipo ) { } }

Fix:
this . dao . removerPorId ( id ) ;
Buggy code:
public class LocalPatchGarbageCollectionHandler implements OperationStepHandler { public static final LocalPatchGarbageCollectionHandler INSTANCE = new LocalPatchGarbageCollectionHandler ( ) ; private final String PATCH_ID = PatchResourceDefinition . PATCH_ID . getName ( ) ; @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final String patchId = operation . require ( PATCH_ID ) . asString ( ) ; context . acquireControllerLock ( ) ; final ServiceController < ? > mgrService = context . getServiceRegistry ( false ) . getRequiredService ( NAME ) ; final InstallationManager mgr = ( ( InstallationManager ) ( mgrService . getValue ( ) ) ) ; final PatchableTarget . TargetInfo info ; try { info = mgr . getIdentity ( ) . loadTargetInfo ( ) ; } catch ( IOException e ) { <START_BUG> throw new OperationFailedException ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>identity<seq2seq4repair_space>info" , e ) ; <END_BUG> } if ( info . getCumulativePatchID ( ) . equals ( patchId ) ) { throw MESSAGES . patchActive ( patchId ) ; } if ( info . getPatchIDs ( ) . contains ( patchId ) ) { throw MESSAGES . patchActive ( patchId ) ; } final InstalledImage installedImage = info . getDirectoryStructure ( ) . getInstalledImage ( ) ; final File history = installedImage . getPatchHistoryDir ( patchId ) ; if ( history . exists ( ) ) { LocalPatchGarbageCollectionHandler . recursiveDelete ( history ) ; } final File patchRoot = installedImage . getPatchHistoryDir ( patchId ) ; if ( patchRoot . exists ( ) ) { LocalPatchGarbageCollectionHandler . recursiveDelete ( patchRoot ) ; } context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } static boolean recursiveDelete ( File root ) { } }

Fix:
throw new OperationFailedException ( MESSAGES . failedToLoadIdentity ( ) , e ) ;
Buggy code:
public class XMPPRoomID extends BaseID implements IChatID { private static final long serialVersionUID = - 4843967090539640622L ; public static final String DOMAIN_DEFAULT = "conference" ; public static final String NICKNAME = "nickname" ; URI uri = null ; String longName = null ; protected String fixHostname ( String host , String domain ) { } protected String fixUsername ( String connUsername ) { } protected String [ ] getRoomAndHost ( String roomatconfhost ) { } public XMPPRoomID ( Namespace namespace , String username , String host , String domain , String groupname , String nickname ) throws URISyntaxException { } public XMPPRoomID ( Namespace namespace , XMPPID userid , String domain , String groupname , String nickname ) throws URISyntaxException { } public XMPPRoomID ( Namespace namespace , XMPPConnection conn , String roomid , String longName ) throws URISyntaxException { } public XMPPRoomID ( Namespace namespace , XMPPConnection conn , String roomid ) throws URISyntaxException { } protected int namespaceCompareTo ( BaseID o ) { } protected boolean namespaceEquals ( BaseID o ) { } protected String fixPath ( String path ) { } protected String namespaceGetName ( ) { } protected int namespaceHashCode ( ) { } protected URI namespaceToURI ( ) throws URISyntaxException { } public String getMucString ( ) { } public String getNickname ( ) { } public String getLongName ( ) { } public String toString ( ) { } public Object getAdapter ( Class clazz ) { <START_BUG> if ( clazz . equals ( IChatID . class ) ) { <END_BUG> return this ; } else return super . getAdapter ( clazz ) ; } public String getUsername ( ) { } }

Fix:
if ( clazz . isInstance ( this ) ) {
Buggy code:
public class MessageDrivenComponentDescription extends EJBComponentDescription { private String messageListenerInterfaceName ; private String resourceAdapterName ; public MessageDrivenComponentDescription ( final String componentName , final String componentClassName , final EjbJarDescription ejbJarDescription , final ServiceName deploymentUnitServiceName ) { } @ Override public ComponentConfiguration createConfiguration ( EEModuleConfiguration moduleConfiguration ) { } String getMessageListenerInterfaceName ( ) { } String getResourceAdapterName ( ) { } public void setMessageListenerInterfaceName ( String messageListenerInterfaceName ) { if ( ( messageListenerInterfaceName == null ) || ( messageListenerInterfaceName . isEmpty ( ) ) ) { throw new IllegalArgumentException ( "Cannot<seq2seq4repair_space>set<seq2seq4repair_space>null<seq2seq4repair_space>or<seq2seq4repair_space>empty<seq2seq4repair_space>string<seq2seq4repair_space>as<seq2seq4repair_space>message<seq2seq4repair_space>listener<seq2seq4repair_space>interface" ) ; } this . messageListenerInterfaceName = messageListenerInterfaceName ; <START_BUG> ViewDescription viewDescription = new org . jboss . as . ejb3 . component . EJBViewDescription ( this , messageListenerInterfaceName , MethodIntf . SERVICE_ENDPOINT ) ; <END_BUG> this . getViews ( ) . add ( viewDescription ) ; } public void setResourceAdapterName ( String resourceAdapterName ) { } @ Override protected void setupViewInterceptors ( ViewDescription view ) { } @ Override protected void addCurrentInvocationContextFactory ( ) { } @ Override protected void addCurrentInvocationContextFactory ( ViewDescription view ) { } @ Override public boolean isMessageDriven ( ) { } }

Fix:
ViewDescription viewDescription = new org . jboss . as . ejb3 . component . EJBViewDescription ( this , messageListenerInterfaceName , MethodIntf . MESSAGE_ENDPOINT ) ;
Buggy code:
public class TraXLiaison implements ErrorListener , XSLTLiaison3 , XSLTLoggerAware { private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; private Project project ; private String factoryName = null ; private TransformerFactory tfactory = null ; private Resource stylesheet ; private XSLTLogger logger ; private EntityResolver entityResolver ; private Transformer transformer ; private Templates templates ; private long templatesModTime ; private URIResolver uriResolver ; private Vector outputProperties = new Vector ( ) ; private Hashtable params = new Hashtable ( ) ; private Vector attributes = new Vector ( ) ; private boolean suppressWarnings = false ; private TraceConfiguration traceConfiguration = null ; public TraXLiaison ( ) throws Exception { } public void setStylesheet ( File stylesheet ) throws Exception { } public void setStylesheet ( Resource stylesheet ) throws Exception { } public void transform ( File infile , File outfile ) throws Exception { } private Source getSource ( InputStream is , File infile ) throws ParserConfigurationException , SAXException { } private Source getSource ( InputStream is , Resource resource ) throws ParserConfigurationException , SAXException { } private String resourceToURI ( Resource resource ) { } private void readTemplates ( ) throws IOException , ParserConfigurationException , TransformerConfigurationException , SAXException { } private void createTransformer ( ) throws Exception { } private void setTransformationParameters ( ) { } private TransformerFactory getFactory ( ) throws BuildException { } public void setFactory ( String name ) { } public void setAttribute ( String name , Object value ) { } public void setOutputProperty ( String name , String value ) { } public void setEntityResolver ( EntityResolver aResolver ) { } public void setURIResolver ( URIResolver aResolver ) { } public void addParam ( String name , String value ) { } public void setLogger ( XSLTLogger l ) { } public void error ( TransformerException e ) { } public void fatalError ( TransformerException e ) { logError ( e , "Fatal<seq2seq4repair_space>Error" ) ; <START_BUG> throw new BuildException ( "Fatal<seq2seq4repair_space>error<seq2seq4repair_space>during<seq2seq4repair_space>transformation" , e ) ; <END_BUG> } public void warning ( TransformerException e ) { } private void logError ( TransformerException e , String type ) { } protected String getSystemId ( File file ) { } public void configure ( XSLTProcess xsltTask ) { } }

Fix:
throw new BuildException ( ( "Fatal<seq2seq4repair_space>error<seq2seq4repair_space>during<seq2seq4repair_space>transformation<seq2seq4repair_space>using<seq2seq4repair_space>" + ( stylesheet ) ) , e ) ;
Buggy code:
public class StepEventHandler { private SourceParser sourceParser ; private Logger logger ; private VirtualMachine vm ; private String classfilter ; private Threads threads ; public StepEventHandler ( SourceParser sourceParser , Logger logger , VirtualMachine vm , String classfilter ) { } private void requestEvents ( ) { } public void handleEvent ( Event event ) { if ( ( event instanceof StepEvent ) == false ) { return ; } StepEvent stepEvent = ( ( StepEvent ) ( event ) ) ; Location location = stepEvent . location ( ) ; for ( ThreadReference thread : vm . allThreads ( ) ) { String threadName = thread . name ( ) ; <START_BUG> if ( threadName . equals ( "main" ) ) { <END_BUG> continue ; } int stackDepth ; try { stackDepth = thread . frameCount ( ) ; } catch ( IncompatibleThreadStateException e ) { continue ; } if ( ( threads . containsKey ( threadName ) ) == false ) { threads . put ( threadName , new StepStack ( ) ) ; } StepStack stepStack = threads . get ( threadName ) ; if ( ( stepStack . size ( ) ) < stackDepth ) { stepStack . push ( new Steps ( ) ) ; } else if ( ( stepStack . size ( ) ) > stackDepth ) { stepStack . pop ( ) ; } Steps steps = stepStack . peek ( ) ; if ( steps != null ) { Step newStep = new Step ( ) ; newStep . location = location ; try { while ( ( steps . empty ( ) ) == false ) { Step lastStep = steps . pop ( ) ; newStep . declaredVariables = lastStep . declaredVariables ; if ( ( sameLocation ( newStep . location , lastStep . location ) ) == false ) { logLocation ( lastStep ) ; logVariables ( thread , lastStep , newStep ) ; } else { newStep . usedVariables = lastStep . usedVariables ; } } saveUsedVariables ( thread , newStep ) ; } catch ( AbsentInformationException e ) { } steps . push ( newStep ) ; } } return ; } private void logVariables ( ThreadReference thread , Step lastStep , Step newStep ) throws AbsentInformationException { } private Variable getFullVariableName ( String variableName , ThreadReference thread , Step step ) { } private String getVariableType ( ThreadReference thread , String variable , ReferenceType ref ) { } private String getValue ( ThreadReference thread , Location location , String variableName ) { } private void logLocation ( Step step ) throws AbsentInformationException { } private void saveUsedVariables ( ThreadReference thread , Step step ) throws AbsentInformationException { } private boolean sameLocation ( Location location1 , Location location2 ) throws AbsentInformationException { } }

Fix:
if ( ( threadName . equals ( "main" ) ) == false ) {
Buggy code:
@ Tag ( "YouTrack" ) public class YouTrackRepository extends BaseRepositoryImpl { private String myDefaultSearch = "Assignee:<seq2seq4repair_space>me<seq2seq4repair_space>sort<seq2seq4repair_space>by:<seq2seq4repair_space>updated<seq2seq4repair_space>#Unresolved" ; @ SuppressWarnings ( { "UnusedDeclaration" } ) public YouTrackRepository ( ) { } public YouTrackRepository ( TaskRepositoryType type ) { } @ NotNull @ Override public BaseRepository clone ( ) { } private YouTrackRepository ( YouTrackRepository other ) { } public Task [ ] getIssues ( @ Nullable String request , int max , long since ) throws Exception { } @ Nullable @ Override public CancellableConnection createCancellableConnection ( ) { } private HttpClient login ( PostMethod method ) throws Exception { } @ Nullable public Task findTask ( @ NotNull String id ) throws Exception { } @ TestOnly @ NotNull public Element fetchRequestAsElement ( @ NotNull String id ) throws Exception { } HttpMethod doREST ( String request , boolean post ) throws Exception { } @ Override public void setTaskState ( @ NotNull Task task , @ NotNull CustomTaskState state ) throws Exception { } @ NotNull @ Override public Set < CustomTaskState > getAvailableTaskStates ( @ NotNull Task task ) throws Exception { } @ Nullable private Task createIssue ( Element element ) { } public String getDefaultSearch ( ) { } public void setDefaultSearch ( String defaultSearch ) { } @ SuppressWarnings ( { "EqualsWhichDoesntCheckParameterClass" } ) @ Override public boolean equals ( Object o ) { } private static final Logger LOG = Logger . getInstance ( "#com.intellij.tasks.youtrack.YouTrackRepository" ) ; @ Override public void updateTimeSpent ( @ NotNull LocalTask task , @ NotNull String timeSpent , @ NotNull String comment ) throws Exception { } private void checkVersion ( ) throws Exception { HttpMethod method = doREST ( "//rest//workflow//version" , false ) ; try { InputStream stream = method . getResponseBodyAsStream ( ) ; Element element = new SAXBuilder ( false ) . build ( stream ) . getRootElement ( ) ; final boolean timeTrackingAvailable = ( element . getName ( ) . equals ( "version" ) ) && ( ( VersionComparatorUtil . compare ( element . getChildText ( "version" ) , "4.1" ) ) >= 0 ) ; if ( ! timeTrackingAvailable ) { <START_BUG> throw new Exception ( "This<seq2seq4repair_space>version<seq2seq4repair_space>of<seq2seq4repair_space>Youtrack<seq2seq4repair_space>the<seq2seq4repair_space>time<seq2seq4repair_space>tracking<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>supported" ) ; <END_BUG> } } finally { method . releaseConnection ( ) ; } } @ Override protected int getFeatures ( ) { } }

Fix:
throw new Exception ( "Time<seq2seq4repair_space>tracking<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>in<seq2seq4repair_space>this<seq2seq4repair_space>version<seq2seq4repair_space>of<seq2seq4repair_space>Youtrack" ) ;
Buggy code:
public class HtmlParser { public static String stripHtmlTags ( String s , boolean breakToNl ) { } public static String restoreSpecialCharacters ( String s ) { } public static String htmlToText ( String html ) { } public static String substituteSpecialCharacters ( String s ) { } public static String substituteSpecialCharactersInHeaderfields ( String s ) { } public static String validateHTMLString ( String input ) { } public static String substituteEmailAddress ( String s ) { } public static String substituteURL ( String s ) { PatternMatcher urlMatcher = new Perl5Matcher ( ) ; PatternCompiler urlCompiler = new Perl5Compiler ( ) ; Pattern urlPattern ; String urls = "(http|https|ftp)" ; String letters = "\\w" ; <START_BUG> String gunk = "//#~:.?+=&@!\\-%" ; <END_BUG> String punc = ".:?\\-" ; String any = ( ( ( ( ( "${" + letters ) + "}${" ) + gunk ) + "}${" ) + punc ) + "}" ; String pattern = ( ( ( ( ( ( ( ( "\\b" + "(" ) + urls ) + ":[" ) + any ) + "]+?)(?=[" ) + punc ) + "]*[^" ) + any ) + "]|$)" ; try { urlCompiler = new Perl5Compiler ( ) ; urlPattern = urlCompiler . compile ( pattern , CASE_INSENSITIVE_MASK ) ; urlMatcher = new Perl5Matcher ( ) ; String result = Util . substitute ( urlMatcher , urlPattern , new Perl5Substitution ( "<A<seq2seq4repair_space>HREF=$1>$1<//A>" ) , s , SUBSTITUTE_ALL ) ; return result ; } catch ( MalformedPatternException e ) { log . error ( "Error<seq2seq4repair_space>transforming<seq2seq4repair_space>urls<seq2seq4repair_space>to<seq2seq4repair_space>links" , e ) ; return null ; } } }

Fix:
String gunk = "//#~:;.?+=&@!\\-%" ;
Buggy code:
public class PageB extends WebPage { private static final long serialVersionUID = 1L ; private PageA a ; private final String test ; public PageB ( String test ) { } @ Override public boolean equals ( Object obj ) { if ( obj instanceof PageB ) { <START_BUG> return ( ( getNumericId ( ) ) == ( ( ( PageB ) ( obj ) ) . getNumericId ( ) ) ) && ( test . equals ( ( ( PageB ) ( obj ) ) . test ) ) ; <END_BUG> } return false ; } public void setA ( PageA a ) { } public PageA getA ( ) { } }

Fix:
return ( ( getPageId ( ) ) == ( ( ( PageB ) ( obj ) ) . getPageId ( ) ) ) && ( test . equals ( ( ( PageB ) ( obj ) ) . test ) ) ;
Buggy code:
public class OutParameterPreviewTask extends DatasetPreviewTask { public static final String PREFIX_OUTPUTPARAMETER = "outputParams" ; protected OutParameterPreviewTask ( ReportEngine engine ) { } protected QueryDefinition constructQuery ( DataSetHandle dataset , DataRequestSession session ) throws BirtException { <START_BUG> QueryDefinition query = super . constructQuery ( dataset , session ) ; <END_BUG> query . getBindings ( ) . clear ( ) ; PropertyHandle propertyHandle = dataset . getPropertyHandle ( PARAMETERS_PROP ) ; int paramsSize = propertyHandle . getListValue ( ) . size ( ) ; Iterator paramIter = propertyHandle . iterator ( ) ; for ( int n = 1 ; n <= paramsSize ; n ++ ) { DataSetParameterHandle paramDefn = ( ( DataSetParameterHandle ) ( paramIter . next ( ) ) ) ; if ( ! ( paramDefn . isOutput ( ) ) ) continue ; String bindingName = paramDefn . getName ( ) ; IBinding binding = new Binding ( bindingName ) ; binding . setExpression ( new org . eclipse . birt . data . engine . api . querydefn . ScriptExpression ( ( ( ( ( OutParameterPreviewTask . PREFIX_OUTPUTPARAMETER ) + "[\"" ) + ( paramDefn . getName ( ) ) ) + "\"]" ) ) ) ; binding . setDataType ( DataAdapterUtil . adaptModelDataType ( paramDefn . getDataType ( ) ) ) ; query . addBinding ( binding ) ; } return query ; } }

Fix:
QueryDefinition query = super . constructQuery ( dataset ) ;
Buggy code:
public class MainActivity extends ActionBarActivity { private Command captureProc ; public static final String TAG = "NetMon" ; public static final int PACKETS = 20 ; public static final String FILE_DIR = "//sdcard//netlogs//" ; public static final int TRUNCATE_POINT = 100 ; public static final String HOST = "nm_host" ; public static final String PATH = "nm_path" ; public static final String METHOD = "nm_method" ; public static final String STATUS = "nm_status" ; public static final String CONTENT = "nm_content" ; public static final String REQ_HEADER = "qh_" ; public static final String RSP_HEADER = "ph_" ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void startCapture ( ) { if ( ( captureProc ) == null ) { String filename = ( ( ( MainActivity . FILE_DIR ) + "tcpdump_" ) + ( System . currentTimeMillis ( ) ) ) + ".pcap" ; <START_BUG> String commandStr = ( ( "tcpdump<seq2seq4repair_space>-w<seq2seq4repair_space>" + filename ) + "<seq2seq4repair_space>\'tcp<seq2seq4repair_space>port<seq2seq4repair_space>80<seq2seq4repair_space>and<seq2seq4repair_space>" ) + "(((ip[2:2]<seq2seq4repair_space>-<seq2seq4repair_space>((ip[0]&0xf)<<2))<seq2seq4repair_space>-<seq2seq4repair_space>((tcp[12]&0xf0)>>2))<seq2seq4repair_space>!=<seq2seq4repair_space>0)\'" ; <END_BUG> Log . v ( MainActivity . TAG , ( "Starting<seq2seq4repair_space>capture:<seq2seq4repair_space>" + commandStr ) ) ; try { captureProc = new Command ( 0 , commandStr ) ; RootShell . getShell ( true ) . add ( captureProc ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } catch ( RootDeniedException e ) { e . printStackTrace ( ) ; } catch ( TimeoutException e ) { e . printStackTrace ( ) ; } } } private void stopCapture ( ) { } }

Fix:
String commandStr = ( ( "tcpdump<seq2seq4repair_space>--packet-buffered<seq2seq4repair_space>-w<seq2seq4repair_space>" + filename ) + "<seq2seq4repair_space>\'tcp<seq2seq4repair_space>port<seq2seq4repair_space>80<seq2seq4repair_space>and<seq2seq4repair_space>" ) + "(((ip[2:2]<seq2seq4repair_space>-<seq2seq4repair_space>((ip[0]&0xf)<<2))<seq2seq4repair_space>-<seq2seq4repair_space>((tcp[12]&0xf0)>>2))<seq2seq4repair_space>!=<seq2seq4repair_space>0)\'" ;
Buggy code:
public class ArrayReference extends Reference { public Expression receiver ; public Expression position ; public TypeBinding arrayElementBinding ; public ArrayReference ( Expression rec , Expression pos ) { } public FlowInfo analyseAssignment ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , Assignment assignment , boolean compoundAssignment ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = Constant . NotAConstant ; TypeBinding arrayTb = receiver . resolveType ( scope ) ; if ( arrayTb == null ) return null ; if ( ! ( arrayTb . isArrayType ( ) ) ) { scope . problemReporter ( ) . referenceMustBeArrayTypeAt ( arrayTb , this ) ; return null ; } TypeBinding positionTb = position . resolveTypeExpecting ( scope , IntBinding ) ; if ( positionTb == null ) return null ; position . implicitWidening ( IntBinding , positionTb ) ; <START_BUG> return arrayElementBinding = ( ( ArrayBinding ) ( arrayTb ) ) . elementsType ( scope ) ; <END_BUG> } public String toStringExpression ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } }

Fix:
return this . expressionType = arrayElementBinding = ( ( ArrayBinding ) ( arrayTb ) ) . elementsType ( scope ) ;
Buggy code:
public class SpongeScore implements Score { private Text name ; private int score ; private UUID uuid = UUID . randomUUID ( ) ; private Map < ScoreObjective , net . minecraft . scoreboard . Score > scores = new HashMap < ScoreObjective , net . minecraft . scoreboard . Score > ( ) ; public SpongeScore ( Text name ) { } @ Override public Text getName ( ) { } @ Override public int getScore ( ) { } @ Override public void setScore ( int score ) { } private void updateScore ( ) { } @ Override public Set < Objective > getObjectives ( ) { } public void addToObjective ( Objective objective ) { } @ SuppressWarnings ( { "deprecation" , "unchecked" } ) public void addToScoreObjective ( ScoreObjective scoreObjective ) { } public void removeFromObjective ( Objective objective ) { } @ SuppressWarnings ( "deprecation" ) public void removeFromScoreObjective ( ScoreObjective objective ) { <START_BUG> objective . getScoreboard ( ) . removeObjectiveFromEntity ( Texts . legacy ( ) . to ( this . name ) , objective ) ; <END_BUG> } public Score getScore ( ScoreObjective objective ) { } public UUID getUuid ( ) { } }

Fix:
objective . theScoreboard . removeObjectiveFromEntity ( Texts . legacy ( ) . to ( this . name ) , objective ) ;
Buggy code:
@ Service public class EventServiceImpl implements NewEventService { @ Autowired private EventDAO eventDAO ; @ Autowired private EventPostResponse evntResponse ; private final Date tempDate = new Date ( ) ; @ Override public EventPostResponse submitNewEvent ( Event event , MultipartFile imageFile ) { } private String saveUploadedFile ( MultipartFile imageFile , String organiserName ) throws IOException { <START_BUG> if ( ( imageFile != null ) || ( ! ( imageFile . getName ( ) . isEmpty ( ) ) ) ) { <END_BUG> StringBuilder imageName = new StringBuilder ( ) ; imageName . append ( organiserName ) ; imageName . append ( "_" ) ; imageName . append ( tempDate . getTime ( ) ) ; imageName . append ( "_" ) ; imageName . append ( imageFile . getOriginalFilename ( ) ) ; StringBuilder builder = new StringBuilder ( ) ; builder . append ( IMAGE_UPLOAD_PATH ) ; builder . append ( imageName . toString ( ) ) ; StringBuilder imageURL = new StringBuilder ( ) ; imageURL . append ( AMAZON_IMAGE_URL ) ; imageURL . append ( imageName . toString ( ) ) ; File tempFile = new File ( builder . toString ( ) ) ; FileUtils . writeByteArrayToFile ( tempFile , imageFile . getBytes ( ) ) ; return imageURL . toString ( ) ; } return null ; } private void getLatLongForEventLocation ( Event event ) throws InvalidAddressException { } }

Fix:
if ( ( imageFile != null ) && ( ! ( imageFile . getName ( ) . isEmpty ( ) ) ) ) {
Buggy code:
public class DNTEntries implements Accumulator < ArrayList < Object > , StringBuilder > { private StringBuilder buf = new StringBuilder ( ) ; private DNT dnt ; private ArrayList < Pair < String , Types > > fields ; private String columns ; public DNTEntries ( DNT dnt , ArrayList < Pair < String , Types > > fields ) { } @ Override public void accumulate ( ArrayList < Object > element ) { buf . append ( ( ( ( ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>" + ( dnt . getId ( ) ) ) + "<seq2seq4repair_space>" ) + ( columns ) ) + "<seq2seq4repair_space>VALUES<seq2seq4repair_space>(" ) ) ; buf . append ( element . get ( 0 ) ) ; for ( int i = 1 ; i < ( element . size ( ) ) ; i ++ ) { buf . append ( ',' ) ; switch ( fields . get ( i ) . getRight ( ) ) { case STRING : <START_BUG> String insert = ( ( String ) ( element . get ( i ) ) ) . replace ( "\\" , "\\\\" ) . replace ( "'" , "\\\'" ) ; <END_BUG> insert = ( insert . isEmpty ( ) ) ? "null" : ( "'" + insert ) + "'" ; buf . append ( insert ) ; break ; default : buf . append ( fields . get ( i ) . getRight ( ) . TYPE . cast ( element . get ( i ) ) ) ; break ; } } buf . append ( ");\n" ) ; } @ Override public StringBuilder dissipate ( ) { } }

Fix:
String insert = ( ( String ) ( element . get ( i ) ) ) . replaceAll ( "'" , "''" ) ;
Buggy code:
public class BlockStone extends BlockMultiBlock { public BlockStone ( ) { } @ Override public TileEntity createNewTileEntity ( World world , int metadata ) { <START_BUG> return new TileStoneMultiblock ( ) ; <END_BUG> } }

Fix:
return new ParticleAcceleratorMultiblock ( ) ;
Buggy code:
public class FooTest { static Logger log = Logger . getLogger ( IndexerTest . class . getName ( ) ) ; @ Test public void testRun2Directories ( ) throws Exception { Foo foo = new Foo ( ) ; foo . run ( ) ; <START_BUG> int i = 7000 ; <END_BUG> assertEquals ( i , foo . getSequenceSize ( ) ) ; } }

Fix:
int i = 319 ;
Buggy code:
public class BeanDefinitionVisitor { private StringValueResolver valueResolver ; public BeanDefinitionVisitor ( StringValueResolver valueResolver ) { } protected BeanDefinitionVisitor ( ) { } public void visitBeanDefinition ( BeanDefinition beanDefinition ) { } protected void visitParentName ( BeanDefinition beanDefinition ) { } protected void visitBeanClassName ( BeanDefinition beanDefinition ) { } protected void visitFactoryBeanName ( BeanDefinition beanDefinition ) { } protected void visitFactoryMethodName ( BeanDefinition beanDefinition ) { <START_BUG> String factoryMethodName = beanDefinition . getFactoryBeanName ( ) ; <END_BUG> if ( factoryMethodName != null ) { String resolvedName = resolveStringValue ( factoryMethodName ) ; if ( ! ( factoryMethodName . equals ( resolvedName ) ) ) { beanDefinition . setFactoryMethodName ( resolvedName ) ; } } } protected void visitScope ( BeanDefinition beanDefinition ) { } protected void visitPropertyValues ( MutablePropertyValues pvs ) { } protected void visitIndexedArgumentValues ( Map < Integer , ConstructorArgumentValues . ValueHolder > ias ) { } protected void visitGenericArgumentValues ( List < ConstructorArgumentValues . ValueHolder > gas ) { } protected Object resolveValue ( Object value ) { } @ SuppressWarnings ( "unchecked" ) protected void visitArray ( Object [ ] arrayVal ) { } @ SuppressWarnings ( "unchecked" ) protected void visitList ( List listVal ) { } @ SuppressWarnings ( "unchecked" ) protected void visitSet ( Set setVal ) { } @ SuppressWarnings ( "unchecked" ) protected void visitMap ( Map < ? , ? > mapVal ) { } protected String resolveStringValue ( String strVal ) { } }

Fix:
String factoryMethodName = beanDefinition . getFactoryMethodName ( ) ;
Buggy code:
public class ShopKeeper extends NPC { public ShopKeeper ( Point location , Map map ) { } public void initActions ( ) { } public void initInventory ( ) { int id = 1000 ; for ( int i = 0 ; i < 2 ; i ++ ) { Item newItem = ItemDictionary . itemFromID ( ( id + i ) ) ; <START_BUG> newItem . setPrice ( 500 ) ; <END_BUG> inventory . addItem ( ( ( TakeableItem ) ( newItem ) ) ) ; } } protected Occupation initOccupation ( ) { } @ Override public void startInteraction ( NPC npc ) { } protected HashMap < Map . Direction , String > initSprites ( ) { } public void talk ( ) { } public void buy ( ) { } public void sell ( TakeableItem item ) { } }

Fix:
( ( TakeableItem ) ( newItem ) ) . setMonetaryValue ( ( 500 + ( i * 100 ) ) ) ;
Buggy code:
@ WebServlet ( "//NewAccountServlet" ) public class NewAccountServlet extends HttpServlet { private static final long serialVersionUID = 1L ; public NewAccountServlet ( ) { } protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { AccountManager am = ( ( AccountManager ) ( getServletContext ( ) . getAttribute ( "accunt<seq2seq4repair_space>manager" ) ) ) ; String username = request . getParameter ( "username" ) ; String password = request . getParameter ( "password" ) ; <START_BUG> if ( ( User . getUserByUsername ( username ) ) == null ) { <END_BUG> RequestDispatcher dispatch = request . getRequestDispatcher ( "nameInUse.jsp" ) ; dispatch . forward ( request , response ) ; } else { am . createNewAccount ( username , password , 1 ) ; RequestDispatcher dispatch = request . getRequestDispatcher ( "homepage.jsp" ) ; dispatch . forward ( request , response ) ; } } }

Fix:
if ( ( User . getUserByUsername ( username ) ) != null ) {
Buggy code:
public class MercadoBitcoinDigest extends BaseParamsDigest { private final String method ; private final String pin ; private final String tonce ; private MercadoBitcoinDigest ( String method , String pin , String signCode , String tonce ) { } public static MercadoBitcoinDigest createInstance ( String method , String pin , String signCode , String tonce ) { } @ Override public String digestParams ( RestInvocation restInvocation ) { Mac hmac512 = getMac ( ) ; String message = ( ( ( ( this . method ) + ":" ) + ( this . pin ) ) + ":" ) + ( this . tonce ) ; hmac512 . update ( message . getBytes ( ) ) ; <START_BUG> return String . format ( "%x" , new BigInteger ( 1 , hmac512 . doFinal ( ) ) ) . toLowerCase ( ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
return String . format ( "%0128x" , new BigInteger ( 1 , hmac512 . doFinal ( ) ) ) . toLowerCase ( ) ;
Buggy code:
public abstract class PostingsFormat { public static final PostingsFormat [ ] EMPTY = new PostingsFormat [ 0 ] ; public final String name ; protected PostingsFormat ( String name ) { } public abstract FieldsConsumer fieldsConsumer ( SegmentWriteState state ) throws IOException { } public static void debug ( String s , String desc ) { } public static void debug ( String s ) { } public abstract FieldsProducer fieldsProducer ( SegmentReadState state ) throws IOException { } public abstract void files ( Directory dir , SegmentInfo segmentInfo , int id , Set < String > files ) throws IOException { } @ Override public String toString ( ) { <START_BUG> return name ; <END_BUG> } }

Fix:
return ( "PostingsFormat(name=" + ( name ) ) + ")" ;
Buggy code:
public class ConnectionTreeNode extends AbstractUIComponentTreeNode < OIMConnection > implements ContextMenuEnabledNode , DisplayableNode < ConnectionDetails > { private static final Logger logger = LoggerFactory . getLogger ( ConnectionTreeNode . class ) ; private OIMConnection connection ; private ConnectionDetails connectionDetailsUI ; private JPopupMenu popupMenu ; private JMenuItem refreshMenu ; public ConnectionTreeNode ( String name , Config . Configuration configuration , UIComponentTree selectionTree , DisplayArea displayArea ) { } @ Override public void initializeComponent ( ) { } @ Override public OIMConnection getComponent ( ) { } @ Override public boolean isDisplayable ( ) { } @ Override public ConnectionDetails getDisplayComponent ( ) { } @ Override public boolean hasContextMenu ( ) { } @ Override public JPopupMenu getContextMenu ( ) { } @ Override public void destroyComponent ( ) { } public static class ConnectionsRegisterUI implements RegisterUI { @ Override public void registerMenu ( Config configuration , JMenuBar menu , Map < OIMAdmin . STANDARD_MENUS , JMenu > commonMenus , UIComponentTree selectionTree , DisplayArea displayArea ) { if ( ( commonMenus != null ) && ( commonMenus . containsKey ( NEW ) ) ) { JMenuItem newConnectionMenuItem = new JMenuItem ( "Connection" ) ; newConnectionMenuItem . addActionListener ( new AbstractAction ( ) { @ Override public void actionPerformed ( ActionEvent e ) { ConnectionTreeNode . logger . trace ( "Processing<seq2seq4repair_space>action<seq2seq4repair_space>on<seq2seq4repair_space>menu<seq2seq4repair_space>{}<seq2seq4repair_space>" , newConnectionMenuItem ) ; <START_BUG> ConnectionDetails connectionDetailUI = new ConnectionDetails ( "New<seq2seq4repair_space>Connection..." , configuration . getConnectionDetails ( "" ) , selectionTree , displayArea ) ; <END_BUG> connectionDetailUI . initialize ( ) ; displayArea . add ( connectionDetailUI ) ; ConnectionTreeNode . logger . trace ( "Processed<seq2seq4repair_space>action<seq2seq4repair_space>on<seq2seq4repair_space>menu<seq2seq4repair_space>{}<seq2seq4repair_space>" , newConnectionMenuItem ) ; } } ) ; commonMenus . get ( NEW ) . add ( newConnectionMenuItem ) ; } } @ Override public void registerSelectionTree ( Config configuration , UIComponentTree selectionTree , DisplayArea displayArea ) { } } }

Fix:
ConnectionDetails connectionDetailUI = new ConnectionDetails ( "New<seq2seq4repair_space>Connection..." , configuration , selectionTree , displayArea ) ;
Buggy code:
public class NumberConvertorTest extends AndroidTestCase { private NumberConverter _numberConverter ; @ Override public void setUp ( ) throws Exception { } public void testConvertsStringWith2DPSuccesfully ( ) { } public void testConvertsStringWith0DPSuccesfully ( ) { } public void testReturnsNaNWhenNotANumber ( ) { String convertedValue = _numberConverter . converFloatToString ( Float . NaN , 0 ) ; <START_BUG> assertEquals ( convertedValue , "NaN" ) ; <END_BUG> } }

Fix:
assertEquals ( convertedValue , "." ) ;
Buggy code:
public class TapEnchantedEffect extends OneShotEffect { public TapEnchantedEffect ( ) { } public TapEnchantedEffect ( final TapEnchantedEffect effect ) { } @ Override public boolean apply ( Game game , Ability source ) { <START_BUG> Permanent permanent = game . getPermanent ( source . getSourceId ( ) ) ; <END_BUG> if ( permanent != null ) { Permanent attach = game . getPermanent ( permanent . getAttachedTo ( ) ) ; if ( attach != null ) { attach . tap ( game ) ; return true ; } } return false ; } @ Override public TapEnchantedEffect copy ( ) { } }

Fix:
Permanent permanent = ( ( Permanent ) ( source . getSourceObject ( game ) ) ) ;