nus-yam/ex-repair huggingface dataset:
Buggy code:
class SubQ implements Val , Subquery { private final ClassMapping _candidate ; private final boolean _subs ; private final String _alias ; private final SelectConstructor _cons = new SelectConstructor ( ) ; private Class _type = null ; private ClassMetaData _meta = null ; private QueryExpressions _exps = null ; private long _startIdx = 0 ; private long _endIdx = Long . MAX_VALUE ; public SubQ ( ClassMapping candidate , boolean subs , String alias ) { } public ClassMapping getCandidate ( ) { } public Class getType ( ) { } public void setImplicitType ( Class type ) { } public boolean isVariable ( ) { } public ClassMetaData getMetaData ( ) { } public void setMetaData ( ClassMetaData meta ) { } public String getCandidateAlias ( ) { } public void setQueryExpressions ( QueryExpressions query , long startIdx , long endIdx ) { } public void initialize ( Select sel , JDBCStore store , boolean nullTest ) { } public Joins getJoins ( ) { } public Object toDataStoreValue ( Object val , JDBCStore store ) { } public void select ( Select sel , JDBCStore store , Object [ ] params , boolean pks , JDBCFetchConfiguration fetch ) { } public void selectColumns ( Select sel , JDBCStore store , Object [ ] params , boolean pks , JDBCFetchConfiguration fetch ) { } public void groupBy ( Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { <START_BUG> sel . groupBy ( newSQLBuffer ( sel , store , params , fetch ) , false ) ; <END_BUG> } public void orderBy ( Select sel , JDBCStore store , Object [ ] params , boolean asc , JDBCFetchConfiguration fetch ) { } private SQLBuffer newSQLBuffer ( Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } public Object load ( Result res , JDBCStore store , JDBCFetchConfiguration fetch ) throws SQLException { } public boolean hasVariable ( Variable var ) { } public void calculateValue ( Select sel , JDBCStore store , Object [ ] params , Val other , JDBCFetchConfiguration fetch ) { } public void clearParameters ( ) { } public int length ( ) { } public void appendTo ( SQLBuffer sql , int index , Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } private void appendTo ( SQLBuffer sql , int index , Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch , boolean size ) { } public void appendIsEmpty ( SQLBuffer sql , Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } public void appendIsNotEmpty ( SQLBuffer sql , Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } public void appendSize ( SQLBuffer sql , Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } public void appendIsNull ( SQLBuffer sql , Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } public void appendIsNotNull ( SQLBuffer sql , Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } }

Fix:
sel . groupBy ( newSQLBuffer ( sel , store , params , fetch ) ) ;
Buggy code:
public class TestListenerTest extends TestCase implements TestListener { private TestResult fResult ; private int fStartCount ; private int fEndCount ; private int fFailureCount ; private int fErrorCount ; public TestListenerTest ( String name ) { } public void addError ( Test test , Throwable t ) { } <START_BUG> public void addFailure ( Test test , Throwable t ) { <END_BUG> ( fFailureCount ) ++ ; } public void endTest ( Test test ) { } protected void setUp ( ) { } public void startTest ( Test test ) { } public void testError ( ) { } public void testFailure ( ) { } public void testStartStop ( ) { } }

Fix:
public void addFailure ( Test test , AssertionFailedError t ) {
Buggy code:
public class ConstrainFunctionsTest { double columns ; NumberValue value ; LocalDateTime date ; DateValue valueDate = new DateValue ( ) ; String crea ; StringValue valueString ; @ Before public void setUp ( ) { columns = 3 ; value = new NumberValue ( ) ; value . setValue ( 2 ) ; date = LocalDateTime . now ( ) ; valueDate = new DateValue ( ) ; crea = "crea" ; <START_BUG> valueString = new StringValue ( ) ; <END_BUG> } @ Test public void testGreaterDate ( ) { } @ Test public void testGreaterEqDate ( ) { } @ Test public void testSmallerEqDate ( ) { } @ Test public void testSmallerDate ( ) { } @ Test public void testEqualDate ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testGreaterString ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testGreaterEqString ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testSmallerEqString ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testSmallerString ( ) { } @ Test public void testEqualString ( ) { } @ Test public void testGreaterNumber ( ) { } @ Test public void testGreaterEqNumber ( ) { } @ Test public void testSmallerEqNumber ( ) { } @ Test public void testSmallerNumber ( ) { } @ Test public void testEqualNumber ( ) { } }

Fix:
valueString = new StringValue ( "" ) ;
Buggy code:
public class IPlanetEjbcTask extends Task { private boolean keepgenerated = false ; private boolean debug = false ; private Path classpath ; private File dest ; private File ejbdescriptor ; private File iasdescriptor ; private File iashome ; public void setClasspath ( Path classpath ) { } public void setDebug ( boolean debug ) { } public void setDest ( File dest ) { } public void setEjbdescriptor ( File ejbdescriptor ) { } public void setIasdescriptor ( File iasdescriptor ) { } public void setIashome ( File iashome ) { } public void setKeepgenerated ( boolean keepgenerated ) { } public Path createClasspath ( ) { if ( ( classpath ) == null ) { <START_BUG> classpath = new Path ( project ) ; <END_BUG> } return classpath . createPath ( ) ; } public void execute ( ) throws TaskException { } private Path getClasspath ( ) { } private SAXParser getParser ( ) throws TaskException { } private void checkConfiguration ( ) throws TaskException { } private void executeEjbc ( SAXParser saxParser ) throws TaskException { } }

Fix:
classpath = new Path ( getProject ( ) ) ;
Buggy code:
public class PrimeTest { @ Test public void testIsPrime ( ) throws Exception { <START_BUG> int [ ] positiveTests = new int [ ] { 2 , 3 , 5 , 7 , 11 , 13 , 17 , 29 , 71 , 113 , 173 , 4657 } ; <END_BUG> int [ ] negativeTests = new int [ ] { 4 , 6 , 8 , 12 , 14 , 15 , 21 , 35 , 1431 , 3327 , 4653 } ; for ( int i : positiveTests ) { assertEquals ( String . format ( "%d<seq2seq4repair_space>is<seq2seq4repair_space>prime<seq2seq4repair_space>but<seq2seq4repair_space>method<seq2seq4repair_space>returns<seq2seq4repair_space>false" , i ) , true , Prime . isPrime ( i ) ) ; } for ( int i : negativeTests ) { assertEquals ( String . format ( "%d<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>prime<seq2seq4repair_space>but<seq2seq4repair_space>method<seq2seq4repair_space>returns<seq2seq4repair_space>true" , i ) , false , Prime . isPrime ( i ) ) ; } } No newline ; at end ; of file ; }

Fix:
int [ ] positiveTests = new int [ ] { 2 , 3 , 5 , 7 , 11 , 13 , 17 , 29 , 71 , 113 , 173 , 4657 , 7652413 } ;
Buggy code:
public interface VEXDocumentFragment { public static final String MIME_TYPE = "application//x-vex-document-fragment" ; <START_BUG> public IContent getContent ( ) ; <END_BUG> public int getLength ( ) { } public VEXElement [ ] getElements ( ) { } public String [ ] getNodeNames ( ) { } public VEXNode [ ] getNodes ( ) { } }

Fix:
public Content getContent ( ) ;
Buggy code:
public abstract class AbstractValidator implements IValidator { public final ValidationErrorMessage errorMessage ( final String input , final FormComponent component ) { } public final ValidationErrorMessage errorMessage ( final String resourceKey , final IModel resourceModel , final String input , final FormComponent component ) { Localizer localizer = component . getLocalizer ( ) ; String message = localizer . getString ( resourceKey , component , resourceModel ) ; <START_BUG> return new ValidationErrorMessage ( input , component , message ) ; <END_BUG> } public final ValidationErrorMessage errorMessage ( final String resourceKey , final Map map , final String input , final FormComponent component ) { } public final ValidationErrorMessage errorMessage ( final String resourceKey , final String input , final FormComponent component ) { } protected Map getMessageContextVariables ( final String input , final FormComponent component ) { } protected final String getResourceKey ( final FormComponent component ) { } }

Fix:
return new ValidationErrorMessage ( component , message ) ;
Buggy code:
public abstract class PulsingPostingsFormat extends PostingsFormat { private final int freqCutoff ; private final int minBlockSize ; private final int maxBlockSize ; private final PostingsBaseFormat wrappedPostingsBaseFormat ; public PulsingPostingsFormat ( String name , PostingsBaseFormat wrappedPostingsBaseFormat , int freqCutoff ) { } public PulsingPostingsFormat ( String name , PostingsBaseFormat wrappedPostingsBaseFormat , int freqCutoff , int minBlockSize , int maxBlockSize ) { } @ Override public String toString ( ) { } @ Override public FieldsConsumer fieldsConsumer ( SegmentWriteState state ) throws IOException { } @ Override public FieldsProducer fieldsProducer ( SegmentReadState state ) throws IOException { PostingsReaderBase docsReader = null ; PostingsReaderBase pulsingReader = null ; boolean success = false ; try { docsReader = wrappedPostingsBaseFormat . postingsReaderBase ( state ) ; pulsingReader = new PulsingPostingsReader ( docsReader ) ; <START_BUG> FieldsProducer ret = new org . apache . lucene . codecs . BlockTreeTermsReader ( state . dir , state . fieldInfos , state . segmentInfo , pulsingReader , state . context , state . segmentSuffix , state . termsIndexDivisor ) ; <END_BUG> success = true ; return ret ; } finally { if ( ! success ) { IOUtils . closeWhileHandlingException ( docsReader , pulsingReader ) ; } } } public int getFreqCutoff ( ) { } }

Fix:
FieldsProducer ret = new org . apache . lucene . codecs . BlockTreeTermsReader ( state . directory , state . fieldInfos , state . segmentInfo , pulsingReader , state . context , state . segmentSuffix , state . termsIndexDivisor ) ;
Buggy code:
public class PubsubParser { public static String sub ( String sub ) throws JSONException { } public static String subscribe ( JSONObject json_filter , int handler_callback ) throws JSONException { JSONObject root = new JSONObject ( ) ; root . put ( "name" , "subscribe" ) ; <START_BUG> root . put ( "query" , json_filter . toString ( ) ) ; <END_BUG> root . put ( "id" , handler_callback ) ; return root . toString ( ) ; } public static String unsubscribe ( int handler_callback ) throws JSONException { } public static String publish ( JSONObject doc ) throws JSONException { } }

Fix:
root . put ( "query" , json_filter ) ;
Buggy code:
public class TestServiceListener extends TestListener implements IServiceListener { public TestServiceListener ( int eventsToExpect ) { } public void serviceDiscovered ( IServiceEvent anEvent ) { events . add ( anEvent ) ; <START_BUG> if ( ( getEventCount ( ) ) == ( amountOfEventsToExpect ) ) { <END_BUG> synchronized ( this ) { notifyAll ( ) ; } } } public void serviceUndiscovered ( IServiceEvent anEvent ) { } }

Fix:
if ( ( events . size ( ) ) == ( amountOfEventsToExpect ) ) {
Buggy code:
public class ActionSaveProjectAs extends ActionSaveProject { public static ActionSaveProjectAs SINGLETON = new ActionSaveProjectAs ( ) ; public static final String separator = "//" ; protected ActionSaveProjectAs ( ) { } public void actionPerformed ( ActionEvent e ) { } public boolean trySave ( boolean overwrite ) { } protected File getNewFile ( ) { ProjectBrowser pb = ProjectBrowser . getInstance ( ) ; Project p = ProjectManager . getManager ( ) . getCurrentProject ( ) ; JFileChooser chooser = null ; URL url = p . getURL ( ) ; if ( ( url != null ) && ( ( url . getFile ( ) . length ( ) ) > 0 ) ) { chooser = OsUtil . getFileChooser ( url . getFile ( ) ) ; } if ( chooser == null ) { chooser = OsUtil . getFileChooser ( ) ; } if ( url != null ) { chooser . setSelectedFile ( new File ( url . getFile ( ) ) ) ; } <START_BUG> String sChooserTitle = Argo . localize ( "Actions" , "text.save_as_project.chooser_title" ) ; <END_BUG> chooser . setDialogTitle ( ( sChooserTitle + ( p . getName ( ) ) ) ) ; chooser . setFileFilter ( CompressedFileFilter ) ; int retval = chooser . showSaveDialog ( pb ) ; if ( retval == ( JFileChooser . APPROVE_OPTION ) ) { File file = chooser . getSelectedFile ( ) ; if ( file != null ) { String name = file . getName ( ) ; if ( ! ( name . endsWith ( COMPRESSED_FILE_EXT ) ) ) { file = new File ( file . getParent ( ) , ( name + ( Project . COMPRESSED_FILE_EXT ) ) ) ; } } return file ; } else { return null ; } } public boolean shouldBeEnabled ( ) { } }

Fix:
String sChooserTitle = Argo . localize ( "Actions" , "filechooser.save-as-project" ) ;
Buggy code:
public class RombergIntegrator extends UnivariateRealIntegratorImpl { private static final long serialVersionUID = 4616482344304576900L ; @ Deprecated public RombergIntegrator ( UnivariateRealFunction f ) { } public RombergIntegrator ( ) { } @ Deprecated public double integrate ( final double min , final double max ) throws IllegalArgumentException , FunctionEvaluationException , MaxIterationsExceededException { } public double integrate ( final UnivariateRealFunction f , final double min , final double max ) throws IllegalArgumentException , FunctionEvaluationException , MaxIterationsExceededException { } protected void verifyIterationCount ( ) throws IllegalArgumentException { super . verifyIterationCount ( ) ; if ( ( maximalIterationCount ) > 32 ) { <START_BUG> throw MathRuntimeException . createIllegalArgumentException ( "invalid<seq2seq4repair_space>iteration<seq2seq4repair_space>limits:<seq2seq4repair_space>min={0},<seq2seq4repair_space>max={1}" , new Object [ ] { 0 , 32 } ) ; <END_BUG> } } }

Fix:
throw MathRuntimeException . createIllegalArgumentException ( "invalid<seq2seq4repair_space>iteration<seq2seq4repair_space>limits:<seq2seq4repair_space>min={0},<seq2seq4repair_space>max={1}" , 0 , 32 ) ;
Buggy code:
public class ReactorExchanger { CoolingCircuit circuit ; Reactor reactor ; MainControl mc ; public ReactorExchanger ( CoolingCircuit circuit , Reactor reactor , MainControl mc ) { } public void exchange ( ) { int result = ( ( circuit . getWaterelement ( circuit . getPointerA ( ) ) . getTemperature ( ) ) + ( reactor . getTemperature ( ) ) ) // 2 ; reactor . setTemperature ( result ) ; <START_BUG> circuit . getWaterelement ( circuit . getPointerB ( ) ) . setTemperature ( result ) ; <END_BUG> mc . onReactorTempChange ( result ) ; } }

Fix:
circuit . getWaterelement ( circuit . getPointerA ( ) ) . setTemperature ( result ) ;
Buggy code:
public abstract class EJBComponentConfiguration extends ComponentConfiguration { private final TransactionManagementType transactionManagementType ; private final ConcurrentMap < MethodIntf , ConcurrentMap < String , ConcurrentMap < ArrayKey , TransactionAttributeType > > > txAttrs ; protected EjbJarConfiguration ejbJarConfiguration ; public EJBComponentConfiguration ( final EJBComponentDescription description , final EEModuleClassConfiguration ejbModuleClassConfiguration ) { } protected void addComponentSystemInterceptorFactory ( InterceptorFactory interceptorFactory ) { } protected void addComponentInstanceSystemInterceptorFactory ( InterceptorFactory interceptorFactory ) { <START_BUG> getComponentSystemInterceptorFactories ( ) . add ( interceptorFactory ) ; <END_BUG> } protected abstract void addCurrentInvocationContextInterceptorFactory ( ) { } public String getName ( ) { } TransactionManagementType getTransactionManagementType ( ) { } ConcurrentMap < MethodIntf , ConcurrentMap < String , ConcurrentMap < ArrayKey , TransactionAttributeType > > > getTxAttrs ( ) { } void setEjbJarConfiguration ( EjbJarConfiguration ejbJarConfiguration ) { } public EjbJarConfiguration getEjbJarConfiguration ( ) { } }

Fix:
getComponentInstanceSystemInterceptorFactories ( ) . add ( interceptorFactory ) ;
Buggy code:
public class OpenNewAtsTaskEditorActionTest extends AbstractAtsActionRunTest { @ Override public Action createAction ( ) { return new OpenNewAtsTaskEditorAction ( new IOpenNewAtsTaskEditorHandler ( ) { @ Override public ITaskEditorProvider getTaskEditorProviderCopy ( ) { return new ITaskEditorProvider ( ) { @ Override public void setTableLoadOptions ( TableLoadOption ... tableLoadOptions ) { } @ Override public void setCustomizeData ( CustomizeData customizeData ) { } @ Override public Collection < ? extends Artifact > getTaskEditorTaskArtifacts ( ) throws OseeCoreException { <START_BUG> AtsChangeSet changes = new AtsChangeSet ( getClass ( ) . getSimpleName ( ) ) ; <END_BUG> Set < TaskArtifact > arts = Collections . singleton ( AtsTestUtil . getOrCreateTaskOffTeamWf1 ( changes ) ) ; changes . execute ( ) ; return arts ; } @ Override public String getTaskEditorLabel ( SearchType searchType ) { return "Tasks" ; } @ Override public Collection < TableLoadOption > getTableLoadOptions ( ) { return Collections . singleton ( NoUI ) ; } @ Override public String getName ( ) { return "Tasks" ; } @ Override public ITaskEditorProvider copyProvider ( ) { return null ; } } ; } @ Override public CustomizeData getCustomizeDataCopy ( ) { return null ; } } ) ; } }

Fix:
AtsChangeSet changes = new AtsChangeSet ( OpenNewAtsTaskEditorActionTest . class . getName ( ) ) ;
Buggy code:
public class CXFFacetInstallDelegate implements IDelegate { public void execute ( final IProject project , IProjectFacetVersion fv , Object config , IProgressMonitor monitor ) throws CoreException { } @ SuppressWarnings ( "unchecked" ) private void addSpringApplicationContextWeb24 ( IProject webProject , WebApp webapp ) { } @ SuppressWarnings ( "unchecked" ) private void addSpringApplicationContextWeb25 ( IProject webProject , org . eclipse . jst . javaee . web . WebApp webapp ) { } @ SuppressWarnings ( "unchecked" ) private void addCXFJSTWEB24Servlet ( IProject webProject , WebApp webapp ) { List servlets = webapp . getServlets ( ) ; for ( int i = 0 ; i < ( servlets . size ( ) ) ; i ++ ) { Servlet servlet = ( ( Servlet ) ( servlets . get ( i ) ) ) ; if ( servlet . getServletName ( ) . equals ( "cxf" ) ) { return ; } } WebapplicationFactory factory = WebapplicationFactory . eINSTANCE ; <START_BUG> org . eclipse . jst . j2ee . webapplication . Servlet cxfServlet = factory . createServlet ( ) ; <END_BUG> ServletType servletType = factory . createServletType ( ) ; cxfServlet . setWebType ( servletType ) ; cxfServlet . setServletName ( "cxf" ) ; servletType . setClassName ( "org.apache.cxf.transport.servlet.CXFServlet" ) ; cxfServlet . setDisplayName ( "cxf" ) ; cxfServlet . setLoadOnStartup ( Integer . valueOf ( 1 ) ) ; webapp . getServlets ( ) . add ( cxfServlet ) ; ServletMapping servletMapping = factory . createServletMapping ( ) ; servletMapping . setServlet ( cxfServlet ) ; servletMapping . setUrlPattern ( "//services//*" ) ; webapp . getServletMappings ( ) . add ( servletMapping ) ; SessionConfig sessionConfig = factory . createSessionConfig ( ) ; sessionConfig . setSessionTimeout ( 60 ) ; webapp . setSessionConfig ( sessionConfig ) ; } @ SuppressWarnings ( "unchecked" ) private void addCXFJSTWEB25Servlet ( IProject webProject , org . eclipse . jst . javaee . web . WebApp webapp ) { } }

Fix:
Servlet cxfServlet = factory . createServlet ( ) ;
Buggy code:
public class ServerRestartHandler implements OperationStepHandler , DescriptionProvider { public static final String OPERATION_NAME = "restart" ; private final ServerInventory serverInventory ; public ServerRestartHandler ( final ServerInventory serverInventory ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { if ( ( context . getRunningMode ( ) ) == ( RunningMode . ADMIN_ONLY ) ) { throw new OperationFailedException ( new ModelNode ( HostControllerMessages . MESSAGES . cannotStartServersInvalidMode ( context . getRunningMode ( ) ) ) ) ; } final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final PathElement element = address . getLastElement ( ) ; final String serverName = element . getValue ( ) ; final boolean blocking = operation . get ( "blocking" ) . asBoolean ( false ) ; final ModelNode model = Tools . readModel ( context . readResourceFromRoot ( EMPTY_ADDRESS , true ) ) ; context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ServerStatus origStatus = serverInventory . determineServerStatus ( serverName ) ; if ( origStatus != ( ServerStatus . STARTED ) ) { throw new OperationFailedException ( new ModelNode ( HostControllerMessages . MESSAGES . cannotRestartServer ( serverName , origStatus ) ) ) ; } final ServerStatus status = serverInventory . restartServer ( serverName , ( - 1 ) , model , blocking ) ; context . getResult ( ) . set ( status . toString ( ) ) ; context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } } , RUNTIME ) ; <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } @ Override public ModelNode getModelDescription ( final Locale locale ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public abstract class AbstractDataSourceAdd implements ModelAddOperationHandler { public static final Logger log = Logger . getLogger ( "org.jboss.as.connector.subsystems.datasources" ) ; @ Override public OperationResult execute ( final OperationContext context , final ModelNode operation , final ResultHandler resultHandler ) throws OperationFailedException { } protected abstract void populateModel ( final ModelNode operation , final ModelNode model ) { } protected abstract AbstractDataSourceService createDataSourceService ( final String jndiName , final ModelNode operation ) throws OperationFailedException { } static void populateAddModel ( final ModelNode existingModel , final ModelNode newModel , final String connectionPropertiesProp , final AttributeDefinition [ ] attributes ) { <START_BUG> if ( existingModel . has ( connectionPropertiesProp ) ) { <END_BUG> for ( Property property : existingModel . get ( connectionPropertiesProp ) . asPropertyList ( ) ) { newModel . get ( connectionPropertiesProp , property . getName ( ) ) . set ( property . getValue ( ) . asString ( ) ) ; } } for ( final AttributeDefinition attribute : attributes ) { if ( existingModel . hasDefined ( attribute . getName ( ) ) ) { newModel . get ( attribute . getName ( ) ) . set ( existingModel . get ( attribute . getName ( ) ) ) ; } } } }

Fix:
if ( existingModel . hasDefined ( connectionPropertiesProp ) ) {
Buggy code:
public class App implements Runnable { public static final String SYSPROP_ADDR = "address" ; public static final String SYSPROP_PORT = "port" ; private App ( Store store , File initial ) { } private MainWindow mainWindow ; private File initial ; private Store store ; public static void main ( String [ ] args ) throws Exception { Store store = new Store ( ) ; File initial = new File ( System . getProperty ( "user.dir" ) ) ; try { File tmp = new File ( args [ 0 ] ) ; if ( tmp . exists ( ) ) { <START_BUG> initial = tmp ; <END_BUG> } } catch ( Exception e ) { } App app = new App ( store , initial ) ; if ( ( System . getProperty ( App . SYSPROP_ADDR ) ) == null ) { try { if ( ( System . getProperty ( "java.net.preferIPv4Stack" ) ) == null ) { System . setProperty ( "java.net.preferIPv4Stack" , "true" ) ; } DatagramSocket s = new DatagramSocket ( ) ; s . connect ( InetAddress . getByAddress ( new byte [ ] { 1 , 1 , 1 , 1 } ) , 0 ) ; InetAddress tmp = s . getLocalAddress ( ) ; s . close ( ) ; if ( ( tmp . getAddress ( ) . length ) > 8 ) { System . setProperty ( App . SYSPROP_ADDR , ( ( "[" + ( tmp . getHostAddress ( ) ) ) + "]" ) ) ; } else { System . setProperty ( App . SYSPROP_ADDR , tmp . getHostAddress ( ) ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; System . setProperty ( App . SYSPROP_ADDR , "unknown-address" ) ; } } int port = 0 ; try { port = Integer . parseInt ( System . getProperty ( App . SYSPROP_PORT ) ) ; } catch ( Exception e ) { } Thread t = new Thread ( app ) ; t . start ( ) ; Server server = new Server ( port ) ; server . setHandler ( new de . onyxbits . filecast . io . PickupHandler ( store ) ) ; server . start ( ) ; t . join ( ) ; System . setProperty ( "port" , ( ( server . getConnectors ( ) [ 0 ] . getLocalPort ( ) ) + "" ) ) ; SwingUtilities . invokeLater ( app . mainWindow ) ; } public void run ( ) { } }

Fix:
initial = tmp . getAbsoluteFile ( ) ;
Buggy code:
public class TestRabinowitz { public static class Parameter { protected ArrayList < String > lines ; protected BufferedReader buffer ; protected String filename ; protected boolean isPedigree ; protected String ped_file ; protected String phe_file ; protected String converted_ped_file ; protected String converted_phe_file ; protected String id_file ; protected int [ ] cov_idx ; protected int [ ] phe_idx ; protected int method ; protected boolean adjustment ; protected boolean includeFounder ; protected int replication ; public Parameter ( ) { } public void read ( String file ) throws IOException { } public void sweepComments ( ) throws IOException { boolean flag = true ; String line ; while ( ( line = buffer . readLine ( ) ) != null ) { <START_BUG> if ( Pattern . matches ( "^\\s*////*.*" , line ) ) { <END_BUG> continue ; } else { lines . add ( line ) ; } } } public void parseValue ( ) { } } public static void main ( String [ ] args ) throws IOException { } }

Fix:
if ( Pattern . matches ( "^////.*" , line ) ) {
Buggy code:
class ClasspathJar extends ClasspathLocation { String zipFilename ; ZipFile zipFile ; SimpleLookupTable directoryCache ; ClasspathJar ( String zipFilename ) { } void buildDirectoryStructure ( ) { } void cleanup ( ) { } public boolean equals ( Object o ) { if ( ( this ) == o ) return true ; if ( ! ( o instanceof ClasspathJar ) ) return false ; <START_BUG> return zipFilename . equalsIgnoreCase ( ( ( ClasspathJar ) ( o ) ) . zipFilename ) ; <END_BUG> } NameEnvironmentAnswer findClass ( char [ ] className , char [ ] [ ] packageName ) { } boolean isPackage ( char [ ] [ ] compoundName , char [ ] packageName ) { } public String toString ( ) { } }

Fix:
return zipFilename . equals ( ( ( ClasspathJar ) ( o ) ) . zipFilename ) ;
Buggy code:
public class FakeMob { private final int id ; private final UUID uniqueId ; private String name = null ; private Location loc ; private EntityType type ; private WrappedDataWatcher dataWatcher = null ; private final List < Player > loadedPlayers = new ArrayList < Player > ( ) ; private boolean sitting = false ; private boolean playerLook = false ; private MobInventory inventory = new MobInventory ( ) ; private MobShop shop = null ; private WrappedSignedProperty playerSkin ; private final List < InteractAction > interacts = new ArrayList < InteractAction > ( ) ; public FakeMob ( int id , Location loc , EntityType type ) { } public UUID getUniqueID ( ) { } public List < InteractAction > getInteractActions ( ) { } public void clearInteractAction ( ) { } public void addInteractAction ( InteractAction action ) { } public void removeInteractAction ( InteractAction action ) { } public MobInventory getInventory ( ) { } public void setInventory ( MobInventory inv ) { } public boolean haveShop ( ) { } public MobShop getShop ( ) { } public void setShop ( MobShop shop ) { } public int getEntityId ( ) { } public WrappedSignedProperty getPlayerSkin ( ) { } public void setPlayerSkin ( WrappedSignedProperty skin ) { } public List < Player > getNearbyPlayers ( ) { } public List < Player > getNearbyPlayers ( double radius ) { } public void updateInventory ( ) { } public boolean isPlayerLoaded ( Player player ) { } public void loadPlayer ( Player player ) { } public void unloadPlayer ( Player player ) { } public boolean isInRange ( Player player ) { <START_BUG> return ( this . loc . distance ( player . getLocation ( ) ) ) <= 48.0 ; <END_BUG> } public int getId ( ) { } public String getCustomName ( ) { } public Location getLocation ( ) { } public World getWorld ( ) { } public EntityType getType ( ) { } public boolean isSitting ( ) { } public boolean isPlayerLook ( ) { } public void setLocation ( Location loc ) { } public void setCustomName ( String name ) { } public void setSitting ( boolean sitting ) { } public void setPlayerLook ( boolean look ) { } public void teleport ( Location loc ) { } public void setType ( EntityType type ) { } public void updateMetadata ( ) { } public void updateCustomName ( ) { } public void sendSpawnPacket ( Player player ) { } public void sendPlayerSpawnPacket ( final Player player ) { } public void sendEntitySpawnPacket ( Player player ) { } public void sendMetaPacket ( Player player ) { } public void sendInventoryPacket ( Player player ) { } public void sendLookPacket ( Player player , Location point ) { } public void sendLookPacket ( Player player , double yaw ) { } public void sendPositionPacket ( Player player ) { } public void sendDestroyPacket ( Player player ) { } }

Fix:
return ( ( this . loc . getWorld ( ) ) != ( player . getLocation ( ) . getWorld ( ) ) ) && ( ( this . loc . distance ( player . getLocation ( ) ) ) <= 48.0 ) ;
Buggy code:
public class RecordAnswerResultTask extends AsyncTask < Void , Void , Void > { private int wordId ; private int result ; private Bundle LoginInfo ; private Context context ; private String status ; public RecordAnswerResultTask ( Context c , int wordId , int r , Bundle b ) { } @ Override protected Void doInBackground ( Void ... voids ) { try { JSONObject Info = new JSONObject ( ) ; Info . put ( "wordId" , String . valueOf ( wordId ) ) ; <START_BUG> Info . put ( "result" , String . valueOf ( result ) ) ; <END_BUG> Info . put ( "username" , LoginInfo . getString ( "username" ) ) ; Info . put ( "serialNum" , LoginInfo . getString ( "serialNum" ) ) ; Info . put ( "identifier" , LoginInfo . getString ( "identifier" ) ) ; StringEntity Content = new StringEntity ( Info . toString ( ) , HTTP . UTF_8 ) ; Content . setContentEncoding ( "UTF-8" ) ; Content . setContentType ( "application//json" ) ; DefaultHttpClient httpclient = new DefaultHttpClient ( ) ; HttpPost httpost = new HttpPost ( new URI ( ServerInformation . serverRecordAnswerResultURL ) ) ; httpost . setEntity ( Content ) ; httpost . addHeader ( "Accept" , "text//plain" ) ; JSONObject response = new JSONObject ( httpclient . execute ( httpost , new BasicResponseHandler ( ) ) . toString ( ) ) ; status = response . getString ( "status" ) ; if ( ( status . equals ( "success" ) ) != true ) Log . i ( "DeleteWordTask" , ( "response<seq2seq4repair_space>status<seq2seq4repair_space>:<seq2seq4repair_space>" + ( response . getString ( "status" ) ) ) ) ; } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } catch ( URISyntaxException e ) { e . printStackTrace ( ) ; } return null ; } @ Override protected void onPostExecute ( Void aVoid ) { } }

Fix:
Info . put ( "result" , result ) ;
Buggy code:
public class AsyncAppenderTest { static Category cat = Category . getInstance ( AsyncAppenderTest . class ) ; static int delayBeforeClose ; public static void main ( String [ ] argv ) { } static void usage ( String msg ) { } static void init ( String configFile , String delayBeforeCloseStr ) { } static void test ( ) { Category root = Category . getRoot ( ) ; for ( int i = 0 ; i < 100 ; i ++ ) { root . debug ( ( "Message<seq2seq4repair_space>" + i ) ) ; } try { <START_BUG> Thread . currentThread ( ) . sleep ( AsyncAppenderTest . delayBeforeClose ) ; <END_BUG> } catch ( Exception e ) { } LogManager . shutdown ( ) ; } }

Fix:
Thread . sleep ( AsyncAppenderTest . delayBeforeClose ) ;
Buggy code:
public class XpathAssertionTests { private static final Map < String , String > musicNamespace = Collections . singletonMap ( "ns" , "http:////example.org//music//people" ) ; private MockMvc mockMvc ; @ Before public void setup ( ) throws Exception { } @ Test public void testExists ( ) throws Exception { } @ Test public void testDoesNotExist ( ) throws Exception { } @ Test public void testString ( ) throws Exception { } @ Test public void testNumber ( ) throws Exception { } @ Test public void testBoolean ( ) throws Exception { } @ Test public void testNodeCount ( ) throws Exception { } @ Test public void testFeedWithLinefeedChars ( ) throws Exception { <START_BUG> standaloneSetup ( new XpathAssertionTests . BlogFeedController ( ) ) . build ( ) . perform ( get ( "//blog.atom" ) . accept ( APPLICATION_ATOM_XML ) ) . andExpect ( status ( ) . isOk ( ) ) . andExpect ( content ( ) . contentType ( APPLICATION_ATOM_XML ) ) . andExpect ( xpath ( "////feed//title" ) . string ( "Test<seq2seq4repair_space>Feed" ) ) . andExpect ( xpath ( "////feed//icon" ) . string ( "http:////www.example.com//favicon.ico" ) ) ; <END_BUG> } @ Controller private static class MusicController { @ RequestMapping ( "//music//people" ) @ ResponseBody public XpathAssertionTests . PeopleWrapper getPeople ( ) { } } @ SuppressWarnings ( "unused" ) @ XmlRootElement ( name = "people" , namespace = "http:////example.org//music//people" ) @ XmlAccessorType ( XmlAccessType . FIELD ) private static class PeopleWrapper { @ XmlElementWrapper ( name = "composers" ) @ XmlElement ( name = "composer" ) private List < Person > composers ; @ XmlElementWrapper ( name = "performers" ) @ XmlElement ( name = "performer" ) private List < Person > performers ; public PeopleWrapper ( ) { } public PeopleWrapper ( List < Person > composers , List < Person > performers ) { } public List < Person > getComposers ( ) { } public List < Person > getPerformers ( ) { } } @ Controller public class BlogFeedController { @ RequestMapping ( value = "//blog.atom" , method = { GET , HEAD } ) @ ResponseBody public String listPublishedPosts ( ) { } } }

Fix:
standaloneSetup ( new XpathAssertionTests . BlogFeedController ( ) ) . build ( ) . perform ( get ( "//blog.atom" ) . accept ( APPLICATION_ATOM_XML ) ) . andExpect ( status ( ) . isOk ( ) ) . andExpect ( content ( ) . contentTypeCompatibleWith ( APPLICATION_ATOM_XML ) ) . andExpect ( xpath ( "////feed//title" ) . string ( "Test<seq2seq4repair_space>Feed" ) ) . andExpect ( xpath ( "////feed//icon" ) . string ( "http:////www.example.com//favicon.ico" ) ) ;
Buggy code:
public class Check extends WebMarkupContainer { private static final long serialVersionUID = 1L ; public Check ( String id ) { } public Check ( String id , IModel model ) { } protected void onComponentTag ( final ComponentTag tag ) { checkComponentTag ( tag , "input" ) ; checkComponentTagAttribute ( tag , "type" , "checkbox" ) ; CheckGroup group = ( ( CheckGroup ) ( findParent ( CheckGroup . class ) ) ) ; String path = getPath ( ) ; if ( group == null ) { throw new WicketRuntimeException ( ( ( "Check<seq2seq4repair_space>component<seq2seq4repair_space>[" + path ) + "]<seq2seq4repair_space>cannot<seq2seq4repair_space>find<seq2seq4repair_space>its<seq2seq4repair_space>parent<seq2seq4repair_space>CheckGroup.<seq2seq4repair_space>All<seq2seq4repair_space>Check<seq2seq4repair_space>components<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>child<seq2seq4repair_space>of<seq2seq4repair_space>or<seq2seq4repair_space>below<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>hierarchy<seq2seq4repair_space>of<seq2seq4repair_space>a<seq2seq4repair_space>CheckGroup<seq2seq4repair_space>component." ) ) ; } tag . put ( "name" , group . getInputName ( ) ) ; tag . put ( "value" , path ) ; Collection collection = ( ( Collection ) ( group . getModelObject ( ) ) ) ; if ( collection == null ) { throw new WicketRuntimeException ( ( ( "CheckGroup<seq2seq4repair_space>[" + ( group . getPath ( ) ) ) + "]<seq2seq4repair_space>contains<seq2seq4repair_space>a<seq2seq4repair_space>null<seq2seq4repair_space>model<seq2seq4repair_space>object,<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>an<seq2seq4repair_space>object<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>java.util.Collection" ) ) ; } String rawInput = group . getRawInput ( ) ; if ( rawInput != null ) { <START_BUG> if ( rawInput . equals ( path ) ) { <END_BUG> tag . put ( "checked" , "checked" ) ; } } else if ( collection . contains ( getModelObject ( ) ) ) { tag . put ( "checked" , "checked" ) ; } super . onComponentTag ( tag ) ; } }

Fix:
if ( ( rawInput . indexOf ( path ) ) != ( - 1 ) ) {
Buggy code:
public class BooleanQuery extends Query { private static int maxClauseCount = 1024 ; public static class TooManyClauses extends RuntimeException { public TooManyClauses ( ) { } public String getMessage ( ) { } } public static int getMaxClauseCount ( ) { } public static void setMaxClauseCount ( int maxClauseCount ) { } private ArrayList clauses = new ArrayList ( ) ; private boolean disableCoord ; public BooleanQuery ( ) { } public BooleanQuery ( boolean disableCoord ) { } public boolean isCoordDisabled ( ) { } public Similarity getSimilarity ( Searcher searcher ) { } public void setMinimumNumberShouldMatch ( int min ) { } protected int minNrShouldMatch = 0 ; public int getMinimumNumberShouldMatch ( ) { } public void add ( Query query , BooleanClause . Occur occur ) { } public void add ( BooleanClause clause ) { } public BooleanClause [ ] getClauses ( ) { } public List clauses ( ) { } private class BooleanWeight implements Weight { protected Similarity similarity ; protected Vector weights = new Vector ( ) ; public BooleanWeight ( Searcher searcher ) throws IOException { } public Query getQuery ( ) { } public float getValue ( ) { } public float sumOfSquaredWeights ( ) throws IOException { } public void normalize ( float norm ) { } public Scorer scorer ( IndexReader reader ) throws IOException { } public Explanation explain ( IndexReader reader , int doc ) throws IOException { } } private static boolean allowDocsOutOfOrder = false ; public static void setAllowDocsOutOfOrder ( boolean allow ) { } public static boolean getAllowDocsOutOfOrder ( ) { } public static void setUseScorer14 ( boolean use14 ) { } public static boolean getUseScorer14 ( ) { } protected Weight createWeight ( Searcher searcher ) throws IOException { } public Query rewrite ( IndexReader reader ) throws IOException { <START_BUG> if ( ( clauses . size ( ) ) == 1 ) { <END_BUG> BooleanClause c = ( ( BooleanClause ) ( clauses . get ( 0 ) ) ) ; if ( ! ( c . isProhibited ( ) ) ) { Query query = c . getQuery ( ) . rewrite ( reader ) ; if ( ( getBoost ( ) ) != 1.0F ) { if ( query == ( c . getQuery ( ) ) ) query = ( ( Query ) ( query . clone ( ) ) ) ; query . setBoost ( ( ( getBoost ( ) ) * ( query . getBoost ( ) ) ) ) ; } return query ; } } BooleanQuery clone = null ; for ( int i = 0 ; i < ( clauses . size ( ) ) ; i ++ ) { BooleanClause c = ( ( BooleanClause ) ( clauses . get ( i ) ) ) ; Query query = c . getQuery ( ) . rewrite ( reader ) ; if ( query != ( c . getQuery ( ) ) ) { if ( clone == null ) clone = ( ( BooleanQuery ) ( this . clone ( ) ) ) ; clone . clauses . set ( i , new BooleanClause ( query , c . getOccur ( ) ) ) ; } } if ( clone != null ) { return clone ; } else return this ; } public void extractTerms ( Set terms ) { } public Object clone ( ) { } public String toString ( String field ) { } public boolean equals ( Object o ) { } public int hashCode ( ) { } }

Fix:
if ( ( ( minNrShouldMatch ) == 0 ) && ( ( clauses . size ( ) ) == 1 ) ) {
Buggy code:
public class Test_org_eclipse_swt_graphics_Image extends SwtPerformanceTestCase { public Test_org_eclipse_swt_graphics_Image ( String name ) { } public static void main ( String [ ] args ) { } protected void setUp ( ) throws Exception { } public void test_ConstructorLorg_eclipse_swt_graphics_DeviceII ( ) { } public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_ImageI ( ) { } public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_Rectangle ( ) { } public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_ImageData ( ) { } public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_ImageDataLorg_eclipse_swt_graphics_ImageData ( ) { final int COUNT = 4000 ; Image [ ] images = new Image [ COUNT ] ; String name = getPath ( ( ( ( imageFilenames [ 0 ] ) + "." ) + ( imageFormats [ 0 ] ) ) ) ; FileInputStream inStream = null ; try { inStream = new FileInputStream ( name ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } ImageData imageData = new ImageLoader ( ) . load ( inStream ) [ 0 ] ; <START_BUG> ImageData imageData1 = new ImageData ( imageData . width , imageData . height , 8 , new PaletteData ( new RGB [ ] { new RGB ( 0 , 0 , 0 ) } ) ) ; <END_BUG> try { inStream . close ( ) ; } catch ( IOException e1 ) { e1 . printStackTrace ( ) ; } PerformanceMeter meter = createMeter ( "Image<seq2seq4repair_space>constr.(Device,ImageData,ImageData)" ) ; meter . start ( ) ; for ( int i = 0 ; i < COUNT ; i ++ ) { images [ i ] = new Image ( display , imageData , imageData1 ) ; } meter . stop ( ) ; for ( int i = 0 ; i < COUNT ; i ++ ) { images [ i ] . dispose ( ) ; } disposeMeter ( meter ) ; } public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLjava_io_InputStream ( ) { } public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLjava_lang_String ( ) { } public void test_dispose ( ) { } public void test_equalsLjava_lang_Object ( ) { } public void test_getBackground ( ) { } public void test_getBounds ( ) { } public void test_getImageData ( ) { } public void test_hashCode ( ) { } public void test_isDisposed ( ) { } public void test_setBackgroundLorg_eclipse_swt_graphics_Color ( ) { } public static Test suite ( ) { } public static Vector methodNames ( ) { } protected void runTest ( ) throws Throwable { } Display display ; }

Fix:
ImageData imageData1 = new ImageData ( imageData . width , imageData . height , 4 , new PaletteData ( new RGB [ ] { new RGB ( 0 , 0 , 0 ) } ) ) ;
Buggy code:
public class StringEscapeUtils { private static final char CSV_DELIMITER = ',' ; private static final char CSV_QUOTE = '"' ; private static final String CSV_QUOTE_STR = String . valueOf ( StringEscapeUtils . CSV_QUOTE ) ; private static final char [ ] CSV_SEARCH_CHARS = new char [ ] { StringEscapeUtils . CSV_DELIMITER , StringEscapeUtils . CSV_QUOTE , CharUtils . CR , CharUtils . LF } ; public StringEscapeUtils ( ) { } public static String escapeJava ( String str ) { } public static void escapeJava ( Writer out , String str ) throws IOException { } public static String escapeJavaScript ( String str ) { } public static void escapeJavaScript ( Writer out , String str ) throws IOException { } private static String escapeJavaStyleString ( String str , boolean escapeSingleQuotes ) { } private static void escapeJavaStyleString ( Writer out , String str , boolean escapeSingleQuote ) throws IOException { } private static String hex ( char ch ) { } public static String unescapeJava ( String str ) { } public static void unescapeJava ( Writer out , String str ) throws IOException { } public static String unescapeJavaScript ( String str ) { } public static void unescapeJavaScript ( Writer out , String str ) throws IOException { } public static String escapeHtml ( String str ) { } public static void escapeHtml ( Writer writer , String string ) throws IOException { } public static String unescapeHtml ( String str ) { } public static void unescapeHtml ( Writer writer , String string ) throws IOException { } public static void escapeXml ( Writer writer , String str ) throws IOException { } public static String escapeXml ( String str ) { } public static void unescapeXml ( Writer writer , String str ) throws IOException { } public static String unescapeXml ( String str ) { } public static String escapeSql ( String str ) { } public static String escapeCsv ( String str ) { } public static void escapeCsv ( Writer out , String str ) throws IOException { } public static String unescapeCsv ( String str ) { } public static void unescapeCsv ( Writer out , String str ) throws IOException { if ( str == null ) { return ; } if ( ( str . length ( ) ) < 2 ) { out . write ( str ) ; return ; } if ( ( ( str . charAt ( 0 ) ) != ( StringEscapeUtils . CSV_QUOTE ) ) || ( ( str . charAt ( ( ( str . length ( ) ) - 1 ) ) ) != ( StringEscapeUtils . CSV_QUOTE ) ) ) { out . write ( str ) ; return ; } String quoteless = str . substring ( 1 , ( ( str . length ( ) ) - 1 ) ) ; if ( StringUtils . containsAny ( quoteless , StringEscapeUtils . CSV_SEARCH_CHARS ) ) { <START_BUG> str = StringUtils . replace ( quoteless , ( ( "" + ( StringEscapeUtils . CSV_QUOTE ) ) + ( StringEscapeUtils . CSV_QUOTE ) ) , StringEscapeUtils . CSV_QUOTE_STR ) ; <END_BUG> } out . write ( str ) ; } }

Fix:
str = StringUtils . replace ( quoteless , ( ( StringEscapeUtils . CSV_QUOTE_STR ) + ( StringEscapeUtils . CSV_QUOTE_STR ) ) , StringEscapeUtils . CSV_QUOTE_STR ) ;
Buggy code:
@ ServiceProvider ( service = Renderer . class , position = 200 ) public class ArrowRenderer implements Renderer { protected final float BASE_RATIO = 0.5F ; protected float defaultArrowSize = 3.0F ; public void preProcess ( PreviewModel previewModel ) { } public void render ( Item item , RenderTarget target , PreviewProperties properties ) { } public void renderStraight ( RenderTarget target , Item item , float x1 , float y1 , float x2 , float y2 , float radius , float size , Color color ) { } public PreviewProperty [ ] getProperties ( ) { } public boolean isRendererForitem ( Item item , PreviewProperties properties ) { <START_BUG> return ( ( ( ( item instanceof EdgeItem ) && ( properties . getBooleanValue ( DIRECTED ) ) ) && ( ( Boolean ) ( item . getData ( EdgeItem . DIRECTED ) ) ) ) && ( ! ( ( Boolean ) ( item . getData ( SELF_LOOP ) ) ) ) ) && ( ! ( properties . getBooleanValue ( MOVING ) ) ) ; <END_BUG> } }

Fix:
return ( ( ( ( ( item instanceof EdgeItem ) && ( properties . getBooleanValue ( SHOW_EDGES ) ) ) && ( properties . getBooleanValue ( DIRECTED ) ) ) && ( ( Boolean ) ( item . getData ( EdgeItem . DIRECTED ) ) ) ) && ( ! ( ( Boolean ) ( item . getData ( SELF_LOOP ) ) ) ) ) && ( ! ( properties . getBooleanValue ( MOVING ) ) ) ;
Buggy code:
public class JGroupsSubsystemParserTest { private JGroupsSubsystemParser parser = new JGroupsSubsystemParser ( ) ; @ Test public void parse ( ) throws Exception { } private List < ModelNode > parse ( String name ) throws IOException , XMLStreamException { final List < ModelNode > operations = new ArrayList < ModelNode > ( ) ; XMLMapper mapper = Factory . create ( ) ; mapper . registerRootElement ( new QName ( CURRENT . getUri ( ) , "subsystem" ) , this . parser ) ; URL url = Thread . currentThread ( ) . getContextClassLoader ( ) . getResource ( name ) ; Assert . assertNotNull ( url ) ; <START_BUG> XMLStreamReader reader = XMLInputFactory . newFactory ( ) . createXMLStreamReader ( new StreamSource ( url . toString ( ) ) ) ; <END_BUG> mapper . parseDocument ( operations , reader ) ; return operations ; } }

Fix:
XMLStreamReader reader = XMLInputFactory . newInstance ( ) . createXMLStreamReader ( new StreamSource ( url . toString ( ) ) ) ;
Buggy code:
@ SuppressWarnings ( "rawtypes" ) public class ReflectorTest { @ Test public void simpleTest ( ) { NLogger . debug ( Reflector . toJson ( makeTestPerson ( ) , true ) ) ; String json = Reflector . toJson ( makeTestPerson ( ) , false ) ; assertEquals ( "{\"firstName\":\"Hwasu\",\"lastName\":\"Jung\",\"phone\":{\"code\":2,\"number\":\"322-3493\"},\"fax\":{\"code\":9999,\"number\":\"00100\"},\"phoneList\":[]}" , json ) ; Map map1 = Reflector . toMapFromJson ( json ) ; NLogger . debug ( map1 ) ; <START_BUG> Person p1 = Reflector . toBeanFromJson ( json , Person . class ) ; <END_BUG> NLogger . debug ( Reflector . toString ( p1 ) ) ; Person p2 = Reflector . toBeanFrom ( map1 , Person . class ) ; NLogger . debug ( Reflector . toString ( p2 ) ) ; Map map2 = Reflector . toMapFrom ( p2 ) ; NLogger . debug ( map2 ) ; } private Person makeTestPerson ( ) { } @ Test public void cloneTest ( ) { } @ Test public void singleQuoteTesst ( ) { } @ Test public void objectMapperTest ( ) throws ParseException { } @ Test public void mergeMapTest ( ) { } @ Test public void simpleArrayTest ( ) { } @ Test public void copyTest ( ) { } @ Test public void mergeBeanTest ( ) { } }

Fix:
Person p1 = Reflector . toBeanFrom ( json , Person . class ) ;