nus-yam/ex-repair huggingface dataset:
Buggy code:
public class DockerApi implements Serializable { String endPoint = "http:////localhost:5555" ; Logger logger = Logger . getLogger ( this . getClass ( ) . getName ( ) ) ; public String getDockerInfo ( ) { } public String buildImage ( String imageName , byte [ ] tarBytes ) { } public String deleteImage ( String imageName ) { } public String listImage ( ) { } public String createContainer ( CreateContainerBodyBuilder bodyBuilder , String name ) { } public void startContainer ( String containerId ) { } public String stopContainer ( String containerId ) { } public String killContainer ( String containerId ) { } public String getContainersLogs ( String containerId , int tail ) { } public String removeContainer ( String containerId ) { } public Collection < ContainerInfo > listContainers ( ) { <START_BUG> String url = ( endPoint ) + "//images//json?all=0" ; <END_BUG> Client client = ClientBuilder . newClient ( ) ; Response response = client . target ( url ) . request ( ) . accept ( APPLICATION_JSON ) . get ( ) ; if ( ( response . getStatus ( ) ) != ( OK . getStatusCode ( ) ) ) { throw new RuntimeException ( ( "returned<seq2seq4repair_space>code<seq2seq4repair_space>" + ( response . getStatus ( ) ) ) ) ; } InputStream r = response . readEntity ( InputStream . class ) ; ContainersInfoReader reader = new ContainersInfoReader ( ) ; Collection < ContainerInfo > containers = reader . getContainers ( r ) ; return containers ; } }

Fix:
String url = ( endPoint ) + "//containers//json" ;
Buggy code:
@ ContextConfiguration ( locations = { "classpath:spring.xml" } ) public class JdbcTemplateToolTest extends AbstractJUnit4SpringContextTests { @ Test public void testList ( ) throws IOException , SQLException { } @ Test public void testCount ( ) throws IOException , SQLException { } @ Test public void testGet ( ) throws IOException , SQLException , NoColumnAnnotationFoundException , NoIdAnnotationFoundException { } @ Test public void testGet2 ( ) throws IOException , SQLException , NoColumnAnnotationFoundException , NoIdAnnotationFoundException { build ( ) ; JdbcTemplateTool jtt = super . applicationContext . getBean ( "jdbcTemplateTool" , JdbcTemplateTool . class ) ; <START_BUG> Employee e = jtt . get ( Person . class , 1 ) ; <END_BUG> assertThat ( e . getName ( ) , is ( "jackie" ) ) ; } @ Test public void testUpdate ( ) throws Exception { } @ Test public void testBatchUpdate ( ) throws IOException , SQLException { } @ Test public void testSave ( ) throws Exception { } @ Test public void testSaveWithoutSomeField ( ) throws Exception { } @ Test public void testDelete ( ) throws Exception { } }

Fix:
Person e = jtt . get ( Person . class , 1 ) ;
Buggy code:
public class LogBuffer { private static final int NUM_OF_MESSAGES = 100 ; private static final int TIME_FREQUENCY = ( 1000 * 60 ) * 5 ; private static final String LOGGING_SERVER_ALIAS = "com.backendless.services.logging.LogService" ; private int numOfMessages ; private int timeFrequency ; private Set < LogMessage > logMessages ; private ScheduledExecutorService scheduledExecutorService = Executors . newSingleThreadScheduledExecutor ( ) ; private ScheduledFuture < ? > scheduledFuture ; public static class SingletonHolder { public static final LogBuffer HOLDER_INSTANCE = new LogBuffer ( ) ; } public static LogBuffer getInstance ( ) { } private LogBuffer ( ) { } public void setLogReportingPolicy ( int numOfMessages , int timeFrequency ) { } public void flush ( ) { } private void setupTimer ( ) { } void enqueue ( String logger , Level level , String message , Throwable exception ) { <START_BUG> if ( ( ( numOfMessages ) == 1 ) || ( ( timeFrequency ) == 0 ) ) { <END_BUG> reportSingleLogMessage ( logger , level , message , ( exception != null ? getStackTrace ( exception ) : null ) ) ; return ; } logMessages . add ( new LogMessage ( logger , level , new Date ( System . currentTimeMillis ( ) ) , message , ( exception != null ? getStackTrace ( exception ) : null ) ) ) ; if ( ( ( numOfMessages ) > 1 ) && ( ( logMessages . size ( ) ) >= ( numOfMessages ) ) ) { flush ( ) ; } } private void scheduledTask ( ) { } private String getStackTrace ( Throwable t ) { } public void reportSingleLogMessage ( String logger , Level loglevel , String message , String exception ) { } public void reportBatch ( List < LogMessage > logBatches ) { } }

Fix:
if ( ( numOfMessages ) == 1 ) {
Buggy code:
public class SimplexSolver extends AbstractLinearOptimizer { private static final double DEFAULT_EPSILON = 1.0E-6 ; protected final double epsilon ; public SimplexSolver ( ) { } public SimplexSolver ( final double epsilon ) { } private Integer getPivotColumn ( SimplexTableau tableau ) { } private Integer getPivotRow ( final int col , final SimplexTableau tableau ) { } protected void doIteration ( final SimplexTableau tableau ) throws OptimizationException { } private boolean isPhase1Solved ( final SimplexTableau tableau ) { } public boolean isOptimal ( final SimplexTableau tableau ) { } protected void solvePhase1 ( final SimplexTableau tableau ) throws OptimizationException { } @ Override public RealPointValuePair doOptimize ( ) throws OptimizationException { <START_BUG> final SimplexTableau tableau = new SimplexTableau ( f , constraints , goalType , restrictToNonNegative , epsilon ) ; <END_BUG> solvePhase1 ( tableau ) ; tableau . discardArtificialVariables ( ) ; while ( ! ( isOptimal ( tableau ) ) ) { doIteration ( tableau ) ; } return tableau . getSolution ( ) ; } }

Fix:
final SimplexTableau tableau = new SimplexTableau ( function , linearConstraints , goal , nonNegative , epsilon ) ;
Buggy code:
public class DropHandler { @ SubscribeEvent public void onBlockDestroy ( BlockEvent . HarvestDropsEvent event ) { <START_BUG> if ( ( ( event . block ) != null ) && ( ( event . harvester ) != null ) ) { <END_BUG> ItemStack block = new ItemStack ( event . block , 1 , event . blockMetadata ) ; for ( DropsObject dropsObject : DropsObject . dropsObj ) if ( dropsObject . isBlockEqual ( block ) ) { event . drops . clear ( ) ; dropsObject . replaceDrop ( event . drops , event . harvester . getCurrentEquippedItem ( ) ) ; } } } }

Fix:
if ( ( ( ( event . block ) != null ) && ( ( event . harvester ) != null ) ) && ( ( DropsObject . dropsObj ) != null ) ) {
Buggy code:
public class FeedIssueChangesLongDatesTest { @ ClassRule public static DbTester db = new DbTester ( ) . schema ( FeedIssueChangesLongDatesTest . class , "schema.sql" ) ; @ Test public void execute ( ) throws Exception { FeedIssueChangesLongDatesTest . db . prepareDbUnit ( getClass ( ) , "before.xml" ) ; System2 system = mock ( System2 . class ) ; when ( system . now ( ) ) . thenReturn ( 1500000000000L ) ; DatabaseMigration migration = new FeedIssueChangesLongDates ( FeedIssueChangesLongDatesTest . db . database ( ) , system ) ; migration . execute ( ) ; int count = FeedIssueChangesLongDatesTest . db . countSql ( "select<seq2seq4repair_space>count(*)<seq2seq4repair_space>from<seq2seq4repair_space>issue_changes<seq2seq4repair_space>where<seq2seq4repair_space>created_at_ms<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>null<seq2seq4repair_space>and<seq2seq4repair_space>updated_at_ms<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>null" ) ; assertThat ( count ) . isEqualTo ( 3 ) ; int countWithAllDateFieldsNull = FeedIssueChangesLongDatesTest . db . countSql ( "select<seq2seq4repair_space>count(*)<seq2seq4repair_space>from<seq2seq4repair_space>issue_changes<seq2seq4repair_space>where<seq2seq4repair_space>created_at_ms<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>null<seq2seq4repair_space>and<seq2seq4repair_space>updated_at_ms<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>null<seq2seq4repair_space>and<seq2seq4repair_space>issue_change_creation_date_ms<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>null" ) ; <START_BUG> assertThat ( countWithAllDateFieldsNull ) . isEqualTo ( 1 ) ; <END_BUG> } }

Fix:
assertThat ( countWithAllDateFieldsNull ) . isEqualTo ( 2 ) ;
Buggy code:
public class DefaultMarkupResourceStreamProvider implements IMarkupResourceStreamProvider { private static final Logger log = LoggerFactory . getLogger ( DefaultMarkupResourceStreamProvider . class ) ; public DefaultMarkupResourceStreamProvider ( ) { } public IResourceStream getMarkupResourceStream ( final MarkupContainer container , Class < ? > containerClass ) { final IResourceStreamLocator locator = Application . get ( ) . getResourceSettings ( ) . getResourceStreamLocator ( ) ; String style = container . getStyle ( ) ; String variation = container . getVariation ( ) ; Locale locale = container . getLocale ( ) ; <START_BUG> String ext = container . getMarkupType ( ) ; <END_BUG> while ( containerClass != ( MarkupContainer . class ) ) { String path = containerClass . getName ( ) . replace ( '.' , '//' ) ; IResourceStream resourceStream = locator . locate ( container . getClass ( ) , path , style , variation , locale , ext ) ; if ( resourceStream != null ) { return new MarkupResourceStream ( resourceStream , new ContainerInfo ( container ) , containerClass ) ; } containerClass = containerClass . getSuperclass ( ) ; } return null ; } }

Fix:
String ext = container . getMarkupType ( ) . getExtension ( ) ;
Buggy code:
public class QuotedPrintableCodec implements BinaryDecoder , BinaryEncoder , StringDecoder , StringEncoder { private final String charset ; private static final BitSet PRINTABLE_CHARS = new BitSet ( 256 ) ; private static final byte ESCAPE_CHAR = '=' ; private static final byte TAB = 9 ; private static final byte SPACE = 32 ; public QuotedPrintableCodec ( ) { } public QuotedPrintableCodec ( String charset ) { } private static final void encodeQuotedPrintable ( int b , ByteArrayOutputStream buffer ) { } public static final byte [ ] encodeQuotedPrintable ( BitSet printable , byte [ ] bytes ) { } public static final byte [ ] decodeQuotedPrintable ( byte [ ] bytes ) throws DecoderException { } public byte [ ] encode ( byte [ ] bytes ) { } public byte [ ] decode ( byte [ ] bytes ) throws DecoderException { } public String encode ( String pString ) throws EncoderException { } public String decode ( String pString , String charset ) throws UnsupportedEncodingException , DecoderException { } public String decode ( String pString ) throws DecoderException { if ( pString == null ) { return null ; } try { return decode ( pString , getDefaultCharset ( ) ) ; } catch ( UnsupportedEncodingException e ) { <START_BUG> throw new DecoderException ( e . getMessage ( ) ) ; <END_BUG> } } public Object encode ( Object pObject ) throws EncoderException { } public Object decode ( Object pObject ) throws DecoderException { } public String getDefaultCharset ( ) { } public String encode ( String pString , String charset ) throws UnsupportedEncodingException { } }

Fix:
throw new DecoderException ( e . getMessage ( ) , e ) ;
Buggy code:
public class SunRmic extends DefaultRmicAdapter { public boolean execute ( ) throws TaskException { <START_BUG> getRmic ( ) . log ( "Using<seq2seq4repair_space>SUN<seq2seq4repair_space>rmic<seq2seq4repair_space>compiler" , MSG_VERBOSE ) ; <END_BUG> Commandline cmd = setupRmicCommand ( ) ; LogOutputStream logstr = new LogOutputStream ( getRmic ( ) , Project . MSG_WARN ) ; try { Class c = Class . forName ( "sun.rmi.rmic.Main" ) ; Constructor cons = c . getConstructor ( new Class [ ] { OutputStream . class , String . class } ) ; Object rmic = cons . newInstance ( new Object [ ] { logstr , "rmic" } ) ; Method doRmic = c . getMethod ( "compile" , new Class [ ] { String [ ] . class } ) ; Boolean ok = ( ( Boolean ) ( doRmic . invoke ( rmic , new Object [ ] { cmd . getArguments ( ) } ) ) ) ; return ok . booleanValue ( ) ; } catch ( ClassNotFoundException ex ) { throw new TaskException ( ( "Cannot<seq2seq4repair_space>use<seq2seq4repair_space>SUN<seq2seq4repair_space>rmic,<seq2seq4repair_space>as<seq2seq4repair_space>it<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>available" + ( "<seq2seq4repair_space>A<seq2seq4repair_space>common<seq2seq4repair_space>solution<seq2seq4repair_space>is<seq2seq4repair_space>to<seq2seq4repair_space>set<seq2seq4repair_space>the<seq2seq4repair_space>environment<seq2seq4repair_space>variable" + "<seq2seq4repair_space>JAVA_HOME<seq2seq4repair_space>or<seq2seq4repair_space>CLASSPATH." ) ) ) ; } catch ( Exception ex ) { if ( ex instanceof TaskException ) { throw ( ( TaskException ) ( ex ) ) ; } else { throw new TaskException ( "Error<seq2seq4repair_space>starting<seq2seq4repair_space>SUN<seq2seq4repair_space>rmic:<seq2seq4repair_space>" , ex ) ; } } finally { try { logstr . close ( ) ; } catch ( IOException e ) { throw new TaskException ( "Error" , e ) ; } } } }

Fix:
getLogger ( ) . debug ( "Using<seq2seq4repair_space>SUN<seq2seq4repair_space>rmic<seq2seq4repair_space>compiler" ) ;
Buggy code:
public class ContentProtectionSampleAppListActivity extends Activity implements OnItemClickListener { public static final String getName ( ) { <START_BUG> return "Content<seq2seq4repair_space>Protection<seq2seq4repair_space>Player" ; <END_BUG> } private static Map < String , PlayerSelectionOption > selectionMap ; ArrayAdapter < String > selectionAdapter ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onItemClick ( AdapterView < ? > l , View v , int pos , long id ) { } No newline ; at end ; of file ; }

Fix:
return "ContentProtectionSampleAppListActivity" ;
Buggy code:
final class StandardHostValve extends ValveBase { private static final Log log = LogFactory . getLog ( StandardHostValve . class ) ; private static final ClassLoader MY_CLASSLOADER = StandardHostValve . class . getClassLoader ( ) ; protected static final boolean STRICT_SERVLET_COMPLIANCE ; protected static final boolean ACCESS_SESSION ; public StandardHostValve ( ) { } private static final StringManager sm = StringManager . getManager ( Package ) ; @ Override public final void invoke ( Request request , Response response ) throws IOException , ServletException { Context context = request . getContext ( ) ; if ( context == null ) { response . sendError ( SC_INTERNAL_SERVER_ERROR , StandardHostValve . sm . getString ( "standardHost.noContext" ) ) ; return ; } if ( request . isAsyncSupported ( ) ) { request . setAsyncSupported ( context . getPipeline ( ) . isAsyncSupported ( ) ) ; } boolean asyncAtStart = request . isAsync ( ) ; boolean asyncDispatching = request . isAsyncDispatching ( ) ; try { context . bind ( IS_SECURITY_ENABLED , StandardHostValve . MY_CLASSLOADER ) ; if ( ( ! asyncAtStart ) && ( ! ( context . fireRequestInitEvent ( request ) ) ) ) { return ; } try { if ( ( ! asyncAtStart ) || asyncDispatching ) { context . getPipeline ( ) . getFirst ( ) . invoke ( request , response ) ; } else { if ( ! ( response . isErrorReportRequired ( ) ) ) { throw new IllegalStateException ( StandardHostValve . sm . getString ( "standardHost.asyncStateError" ) ) ; } } } catch ( Throwable t ) { ExceptionUtils . handleThrowable ( t ) ; if ( response . isErrorReportRequired ( ) ) { container . getLogger ( ) . error ( ( "Exception<seq2seq4repair_space>Processing<seq2seq4repair_space>" + ( request . getRequestURI ( ) ) ) , t ) ; } else { request . setAttribute ( ERROR_EXCEPTION , t ) ; throwable ( request , response , t ) ; } } Throwable t = ( ( Throwable ) ( request . getAttribute ( ERROR_EXCEPTION ) ) ) ; if ( ! ( context . getState ( ) . isAvailable ( ) ) ) { return ; } if ( response . isErrorReportRequired ( ) ) { response . setSuspended ( false ) ; if ( t != null ) { throwable ( request , response , t ) ; } else { status ( request , response ) ; } } <START_BUG> if ( ( ! ( request . isAsync ( ) ) ) && ( ! ( response . isErrorReportRequired ( ) ) ) ) { <END_BUG> context . fireRequestDestroyEvent ( request ) ; } } finally { if ( StandardHostValve . ACCESS_SESSION ) { request . getSession ( false ) ; } context . unbind ( IS_SECURITY_ENABLED , StandardHostValve . MY_CLASSLOADER ) ; } } @ Override public final void event ( Request request , Response response , CometEvent event ) throws IOException , ServletException { } private void status ( Request request , Response response ) { } protected void throwable ( Request request , Response response , Throwable throwable ) { } private boolean custom ( Request request , Response response , ErrorPage errorPage ) { } private static ErrorPage findErrorPage ( Context context , Throwable exception ) { } }

Fix:
if ( ( ! ( request . isAsync ( ) ) ) && ( ( ! asyncAtStart ) || ( ! ( response . isErrorReportRequired ( ) ) ) ) ) {
Buggy code:
public class ProcessTypeHandler implements OperationStepHandler { public static final ProcessTypeHandler INSTANCE = new ProcessTypeHandler ( ) ; private ProcessTypeHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { context . getResult ( ) . set ( "Server" ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class JarResourcePatternResolver extends PathMatchingResourcePatternResolver { private Class < ? > jarClass = null ; public JarResourcePatternResolver ( Class < ? > jarClass ) throws IOException { } private JarResourcePatternResolver ( ResourceLoader resourceLoader ) { } @ Override public Resource [ ] getResources ( String locationPattern ) throws IOException { } protected Resource [ ] findPathMatchingJarResources ( String locationPattern ) { List < Resource > result = new ArrayList < Resource > ( 16 ) ; JarResourceLoader jarResourceLoader = ( ( JarResourceLoader ) ( getResourceLoader ( ) ) ) ; String directory = StringUtils . getFileDirectory ( locationPattern ) ; <START_BUG> Set < String > entriesPath = jarResourceLoader . getEntryFilesByDir ( directory ) ; <END_BUG> if ( entriesPath == null ) return result . toArray ( new Resource [ result . size ( ) ] ) ; for ( String entryPath : entriesPath ) { String path = "//" + entryPath ; if ( getPathMatcher ( ) . match ( locationPattern , path ) ) { Resource resource = getResource ( path ) ; if ( resource == null ) continue ; result . add ( resource ) ; } } return result . toArray ( new Resource [ result . size ( ) ] ) ; } }

Fix:
Set < String > entriesPath = jarResourceLoader . getEntryFilesByDir ( directory , getPathMatcher ( ) ) ;
Buggy code:
public class HandlerRemoveUpdate extends AbstractLoggingSubsystemUpdate < Void > { private static final long serialVersionUID = 4158226899360272190L ; private final String name ; public HandlerRemoveUpdate ( String name ) { } protected < P > void applyUpdate ( UpdateContext updateContext , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { } public AbstractSubsystemUpdate < LoggingSubsystemElement , ? > getCompensatingUpdate ( LoggingSubsystemElement original ) { <START_BUG> return new HandlerAddUpdate ( original . getHandler ( name ) ) ; <END_BUG> } protected void applyUpdate ( LoggingSubsystemElement element ) throws UpdateFailedException { } }

Fix:
return null ;
Buggy code:
public class EJB3SubsystemXMLPersister implements XMLElementWriter < SubsystemMarshallingContext > { public static final EJB3SubsystemXMLPersister INSTANCE = new EJB3SubsystemXMLPersister ( ) ; @ Override public void writeContent ( final XMLExtendedStreamWriter writer , final SubsystemMarshallingContext context ) throws XMLStreamException { <START_BUG> context . startSubsystemElement ( EJB3_1_4 . getUriString ( ) , false ) ; <END_BUG> writeElements ( writer , context ) ; writer . writeEndElement ( ) ; } protected void writeElements ( final XMLExtendedStreamWriter writer , final SubsystemMarshallingContext context ) throws XMLStreamException { } private void writeIIOP ( final XMLExtendedStreamWriter writer , final ModelNode model ) throws XMLStreamException { } private void writeThreadPools ( final XMLExtendedStreamWriter writer , final ModelNode threadPoolsModel ) throws XMLStreamException { } protected void writeRemote ( final XMLExtendedStreamWriter writer , final ModelNode model ) throws XMLStreamException { } private void writeAsync ( final XMLExtendedStreamWriter writer , final ModelNode model ) throws XMLStreamException { } private void writeMDB ( final XMLExtendedStreamWriter writer , final ModelNode mdbModelNode ) throws XMLStreamException { } private void writeEntityBean ( final XMLExtendedStreamWriter writer , final ModelNode entityModelNode ) throws XMLStreamException { } private void writeSingletonBean ( final XMLExtendedStreamWriter writer , final ModelNode singletonBeanModel ) throws XMLStreamException { } private void writeStatefulBean ( final XMLExtendedStreamWriter writer , final ModelNode statefulBeanModel ) throws XMLStreamException { } private void writeDefaultSLSBPool ( final XMLExtendedStreamWriter writer , final ModelNode model ) throws XMLStreamException { } private void writeBeanInstancePools ( final XMLExtendedStreamWriter writer , final ModelNode beanInstancePoolModelNode ) throws XMLStreamException { } private void writeStrictMaxPoolConfig ( final XMLExtendedStreamWriter writer , final Property strictMaxPoolModel ) throws XMLStreamException { } private void writeCaches ( XMLExtendedStreamWriter writer , ModelNode model ) throws XMLStreamException { } private void writeClusterPassivationStores ( XMLExtendedStreamWriter writer , ModelNode model ) throws XMLStreamException { } private void writeFilePassivationStores ( XMLExtendedStreamWriter writer , ModelNode model ) throws XMLStreamException { } private void writeTimerService ( final XMLExtendedStreamWriter writer , final ModelNode timerServiceModel ) throws XMLStreamException { } private void writeDatabaseDataStores ( final XMLExtendedStreamWriter writer , final ModelNode timerServiceModel ) throws XMLStreamException { } private void writeFileDataStores ( final XMLExtendedStreamWriter writer , final ModelNode timerServiceModel ) throws XMLStreamException { } private void writeChannelCreationOptions ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } }

Fix:
context . startSubsystemElement ( EJB3_1_5 . getUriString ( ) , false ) ;
Buggy code:
class PatchXml_1_0 extends PatchXmlUtils implements XMLStreamConstants , XMLElementReader < PatchXml . Result < PatchMetadataResolver > > , XMLElementWriter < Patch > { @ Override public void writeContent ( final XMLExtendedStreamWriter writer , final Patch patch ) throws XMLStreamException { } @ Override public void readElement ( XMLExtendedStreamReader reader , PatchXml . Result < PatchMetadataResolver > factory ) throws XMLStreamException { final PatchBuilder builder = new PatchBuilder ( ) ; <START_BUG> doReadElement ( reader , builder ) ; <END_BUG> factory . setResult ( builder ) ; } }

Fix:
doReadElement ( reader , builder , factory . getOriginalIdentity ( ) ) ;
Buggy code:
public class SubsystemDescriptionDump implements OperationStepHandler { private final ExtensionRegistry extensionRegistry ; protected static final SimpleAttributeDefinition PATH = new SimpleAttributeDefinition ( "path" , ModelType . STRING , false ) ; public static final String OPERATION_NAME = "subsystem-description-dump" ; public static final OperationDefinition DEFINITION = new org . jboss . as . controller . SimpleOperationDefinition ( SubsystemDescriptionDump . OPERATION_NAME , new NonResolvingResourceDescriptionResolver ( ) , EntryType . PRIVATE , EnumSet . of ( READ_ONLY ) , SubsystemDescriptionDump . PATH ) ; public SubsystemDescriptionDump ( final ExtensionRegistry extensionRegistry ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } public static void dumpManagementResourceRegistration ( final ExtensionRegistry registry , final String path ) throws OperationFailedException { ManagementResourceRegistration profile = registry . getProfileRegistration ( ) ; try { for ( PathElement pe : profile . getChildAddresses ( EMPTY_ADDRESS ) ) { ManagementResourceRegistration registration = profile . getSubModel ( PathAddress . pathAddress ( pe ) ) ; String subsystem = pe . getValue ( ) ; SubsystemInformation info = registry . getSubsystemInfo ( subsystem ) ; ModelNode desc = SubsystemDescriptionDump . readFullModelDescription ( PathAddress . pathAddress ( pe ) , registration ) ; <START_BUG> String name = ( ( ( ( subsystem + "-" ) + ( info . getManagementInterfaceMajorVersion ( ) ) ) + "." ) + ( info . getManagementInterfaceMinorVersion ( ) ) ) + ".dmr" ; <END_BUG> PrintWriter pw = new PrintWriter ( new File ( path , name ) ) ; desc . writeString ( pw , false ) ; pw . close ( ) ; } } catch ( IOException e ) { throw new OperationFailedException ( "could<seq2seq4repair_space>not<seq2seq4repair_space>save," , e ) ; } } public static ModelNode readFullModelDescription ( PathAddress address , ImmutableManagementResourceRegistration reg ) { } }

Fix:
String name = ( ( ( ( ( ( subsystem + "-" ) + ( info . getManagementInterfaceMajorVersion ( ) ) ) + "." ) + ( info . getManagementInterfaceMinorVersion ( ) ) ) + "." ) + ( info . getManagementInterfaceMicroVersion ( ) ) ) + ".dmr" ;
Buggy code:
public class ResourceStreamRequestTarget implements IRequestTarget { private static final Logger log = LoggerFactory . getLogger ( ResourceStreamRequestTarget . class ) ; private String fileName ; private final IResourceStream resourceStream ; public ResourceStreamRequestTarget ( IResourceStream resourceStream ) { } public void detach ( RequestCycle requestCycle ) { } public boolean equals ( Object obj ) { } public String getFileName ( ) { } public final IResourceStream getResourceStream ( ) { } public int hashCode ( ) { } public void respond ( RequestCycle requestCycle ) { } public ResourceStreamRequestTarget setFileName ( String fileName ) { } public String toString ( ) { } protected void configure ( final RequestCycle requestCycle , final Response response , final IResourceStream resourceStream ) { String responseType = resourceStream . getContentType ( ) ; if ( responseType != null ) { response . setContentType ( ( ( responseType + ";<seq2seq4repair_space>charset=" ) + ( response . getCharacterEncoding ( ) ) ) ) ; } else { if ( ( getFileName ( ) ) != null ) response . detectContentType ( requestCycle , getFileName ( ) ) ; else <START_BUG> response . detectContentType ( requestCycle , requestCycle . getRequest ( ) . getRelativeURL ( ) ) ; <END_BUG> } if ( ( resourceStream . length ( ) ) >= 0 ) { response . setContentLength ( resourceStream . length ( ) ) ; } String file = getFileName ( ) ; if ( ( file != null ) && ( response instanceof WebResponse ) ) { ( ( WebResponse ) ( response ) ) . setAttachmentHeader ( file ) ; } } }

Fix:
response . detectContentType ( requestCycle , requestCycle . getRequest ( ) . getURL ( ) ) ;
Buggy code:
@ Controller @ RequestMapping ( "//owners//*//pets//{petId}//visits//new" ) @ SessionAttributes ( "visit" ) public class AddVisitForm { private final Clinic clinic ; @ Autowired public AddVisitForm ( Clinic clinic ) { } @ InitBinder public void setAllowedFields ( WebDataBinder dataBinder ) { <START_BUG> dataBinder . setDisallowedFields ( "id" ) ; <END_BUG> } @ RequestMapping ( method = RequestMethod . GET ) public String setupForm ( @ PathVariable ( "petId" ) int petId , Model model ) { } @ RequestMapping ( method = RequestMethod . POST ) public String processSubmit ( @ ModelAttribute ( "visit" ) Visit visit , BindingResult result , SessionStatus status ) { } }

Fix:
dataBinder . setDisallowedFields ( new String [ ] { "id" } ) ;
Buggy code:
public class ContextedExceptionTest extends AbstractExceptionContextTest < ContextedException > { @ Override public void setUp ( ) throws Exception { } public void testContextedException ( ) { } public void testContextedExceptionString ( ) { } public void testContextedExceptionThrowable ( ) { } public void testContextedExceptionStringThrowable ( ) { } public void testContextedExceptionStringThrowableContext ( ) { } public void testNullExceptionPassing ( ) { <START_BUG> exceptionContext = new ContextedException ( TEST_MESSAGE_2 , new Exception ( TEST_MESSAGE ) , null ) . addContextValue ( "test1" , null ) . addContextValue ( "test2" , "some<seq2seq4repair_space>value" ) . addContextValue ( "test<seq2seq4repair_space>Date" , new Date ( ) ) . addContextValue ( "test<seq2seq4repair_space>Nbr" , new Integer ( 5 ) ) . addContextValue ( "test<seq2seq4repair_space>Poorly<seq2seq4repair_space>written<seq2seq4repair_space>obj" , new ObjectWithFaultyToString ( ) ) ; <END_BUG> String message = exceptionContext . getMessage ( ) ; assertTrue ( ( message != null ) ) ; } public void testRawMessage ( ) { } }

Fix:
exceptionContext = new ContextedException ( TEST_MESSAGE_2 , new Exception ( TEST_MESSAGE ) , null ) . addContextValue ( "test1" , null ) . addContextValue ( "test2" , "some<seq2seq4repair_space>value" ) . addContextValue ( "test<seq2seq4repair_space>Date" , new Date ( ) ) . addContextValue ( "test<seq2seq4repair_space>Nbr" , Integer . valueOf ( 5 ) ) . addContextValue ( "test<seq2seq4repair_space>Poorly<seq2seq4repair_space>written<seq2seq4repair_space>obj" , new ObjectWithFaultyToString ( ) ) ;
Buggy code:
public final class SimplePool { private Object [ ] pool ; private int max ; private int minSpare ; private int maxSpare ; private int current = - 1 ; Object lock ; public static final int DEFAULT_SIZE = 16 ; public SimplePool ( ) { } public SimplePool ( int max ) { } public void set ( Object o ) { } public void put ( Object o ) { int idx = - 1 ; synchronized ( lock ) { if ( ( current ) < ( ( max ) - 1 ) ) idx = ++ ( current ) ; <START_BUG> if ( idx > 0 ) <END_BUG> pool [ idx ] = o ; } } public Object get ( ) { } public int getMax ( ) { } }

Fix:
if ( idx >= 0 )
Buggy code:
public class DoStatement extends Statement { public Expression condition ; public Statement action ; private Label breakLabel ; private Label continueLabel ; int mergedInitStateIndex = - 1 ; public DoStatement ( Expression condition , Statement action , int s , int e ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { breakLabel = new Label ( ) ; continueLabel = new Label ( ) ; LoopingFlowContext loopingContext = new LoopingFlowContext ( flowContext , this , breakLabel , continueLabel , currentScope ) ; Constant cst = condition . constant ; boolean isConditionTrue = ( cst != ( NotAConstant ) ) && ( ( cst . booleanValue ( ) ) == true ) ; cst = condition . optimizedBooleanConstant ( ) ; boolean isConditionOptimizedTrue = ( cst != ( NotAConstant ) ) && ( ( cst . booleanValue ( ) ) == true ) ; boolean isConditionOptimizedFalse = ( cst != ( NotAConstant ) ) && ( ( cst . booleanValue ( ) ) == false ) ; int previousMode = flowInfo . reachMode ( ) ; if ( ( ( action ) != null ) && ( ! ( action . isEmptyBlock ( ) ) ) ) { flowInfo = action . analyseCode ( currentScope , loopingContext , flowInfo ) ; if ( ( ! ( flowInfo . isReachable ( ) ) ) && ( ! ( loopingContext . initsOnContinue . isReachable ( ) ) ) ) { continueLabel = null ; } } flowInfo . setReachMode ( previousMode ) ; flowInfo = condition . analyseCode ( currentScope , loopingContext , ( ( action ) == null ? flowInfo : flowInfo . mergedWith ( loopingContext . initsOnContinue ) ) ) ; if ( ( ! isConditionOptimizedFalse ) && ( ( continueLabel ) != null ) ) { <START_BUG> loopingContext . complainOnFinalAssignmentsInLoop ( currentScope , flowInfo ) ; <END_BUG> } FlowInfo mergedInfo = FlowInfo . mergedOptimizedBranches ( loopingContext . initsOnBreak , isConditionOptimizedTrue , flowInfo . initsWhenFalse ( ) , false , ( ! isConditionTrue ) ) ; mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; return mergedInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public StringBuffer printStatement ( int indent , StringBuffer output ) { } public void resolve ( BlockScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
loopingContext . complainOnDeferredChecks ( currentScope , flowInfo ) ;
Buggy code:
public class TestParameterConfiguration extends OpenCmsTestCase { public void testEscapeUnescapeParameterConfiguration ( ) throws Exception { } public void testMergeParameterConfiguration ( ) throws Exception { } public void testReadParameterConfiguration ( ) throws Exception { String testPropPath = "org//opencms//configuration//opencms-test.properties" ; URL url = this . getClass ( ) . getClassLoader ( ) . getResource ( testPropPath ) ; String decodedPath = URLDecoder . decode ( url . getPath ( ) , "UTF-8" ) ; File file = new File ( decodedPath ) ; System . out . println ( ( ( "URL:<seq2seq4repair_space>'" + url ) + "'" ) ) ; System . out . println ( ( ( "URL<seq2seq4repair_space>path<seq2seq4repair_space>decoded:<seq2seq4repair_space>'" + decodedPath ) + "'" ) ) ; System . out . println ( ( ( "File:<seq2seq4repair_space>'" + file ) + "'" ) ) ; assertTrue ( ( ( "Test<seq2seq4repair_space>property<seq2seq4repair_space>file<seq2seq4repair_space>'" + ( file . getAbsolutePath ( ) ) ) + "'<seq2seq4repair_space>not<seq2seq4repair_space>found" ) , file . exists ( ) ) ; CmsParameterConfiguration cmsProp = new CmsParameterConfiguration ( file . getAbsolutePath ( ) ) ; assertEquals ( "C:\\dev\\workspace\\opencms-core\\test\\data" , cmsProp . get ( "test.path.one" ) ) ; assertEquals ( 4 , cmsProp . getList ( "test.list" ) . size ( ) ) ; assertEquals ( 3 , cmsProp . getList ( "test.otherlist" ) . size ( ) ) ; assertEquals ( "comma,<seq2seq4repair_space>escaped<seq2seq4repair_space>with<seq2seq4repair_space>\\<seq2seq4repair_space>backslash" , cmsProp . get ( "test.escaping" ) ) ; assertEquals ( "this<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>long<seq2seq4repair_space>long<seq2seq4repair_space>long<seq2seq4repair_space>long<seq2seq4repair_space>long<seq2seq4repair_space>long<seq2seq4repair_space>line!" , cmsProp . get ( "test.multiline" ) ) ; ExtendedProperties extProp = new ExtendedProperties ( file . getAbsolutePath ( ) ) ; assertEquals ( extProp . size ( ) , cmsProp . size ( ) ) ; for ( String key : cmsProp . keySet ( ) ) { Object value = cmsProp . getObject ( key ) ; assertTrue ( ( ( "Key<seq2seq4repair_space>'" + key ) + "'<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>in<seq2seq4repair_space>CmsConfiguration" ) , extProp . containsKey ( key ) ) ; <START_BUG> assertTrue ( ( ( "Objects<seq2seq4repair_space>for<seq2seq4repair_space>'" + key ) + "'<seq2seq4repair_space>not<seq2seq4repair_space>equal" ) , value . equals ( extProp . getProperty ( key ) ) ) ; <END_BUG> } } }

Fix:
assertEquals ( ( ( "Objects<seq2seq4repair_space>for<seq2seq4repair_space>" + key ) + "<seq2seq4repair_space>not<seq2seq4repair_space>equal" ) , extProp . getProperty ( key ) , value ) ;
Buggy code:
@ HK2 ( populate = false ) public abstract class GenericControllerTest extends JerseyTestNg . ContainerPerClassTest { private static final Logger LOGGER = LoggerFactory . getLogger ( GenericControllerTest . class ) ; public static final int DEFAULT_HK2_TEST_BIND_RANK = 10 ; @ BeforeClass public void setUpTests ( ) throws Exception { } @ Override public void configureClient ( final ClientConfig config ) { } @ Override protected Application configure ( ) { GenericControllerTest . LOGGER . debug ( "Registering<seq2seq4repair_space>web<seq2seq4repair_space>application<seq2seq4repair_space>configurations..." ) ; enable ( LOG_TRAFFIC ) ; enable ( DUMP_ENTITY ) ; ServiceLocator serviceLocator = ServiceLocatorUtilities . createAndPopulateServiceLocator ( ) ; <START_BUG> ResourceConfig application = ApplicationConfig . createApp ( serviceLocator ) ; <END_BUG> registerInjectionPoints ( application ) ; return application ; } protected abstract void registerInjectionPoints ( final ResourceConfig application ) { } }

Fix:
ResourceConfig application = ApplicationConfig . createApp ( serviceLocator , null ) ;
Buggy code:
public class GitChangeLogParser extends ChangeLogParser { private boolean authorOrCommitter ; public GitChangeLogParser ( boolean authorOrCommitter ) { } public List < GitChangeSet > parse ( @ Nonnull List < String > changelog ) { } @ Override public GitChangeSetList parse ( Run build , RepositoryBrowser < ? > browser , File changelogFile ) throws IOException , SAXException { Set < GitChangeSet > r = new LinkedHashSet < GitChangeSet > ( ) ; LineIterator lineIterator = null ; try { <START_BUG> lineIterator = FileUtils . lineIterator ( changelogFile ) ; <END_BUG> return new GitChangeSetList ( build , browser , parse ( lineIterator ) ) ; } finally { LineIterator . closeQuietly ( lineIterator ) ; } } private List < GitChangeSet > parse ( Iterator < String > changelog ) { } private GitChangeSet parseCommit ( List < String > lines , boolean authorOrCommitter ) { } private static int THRESHOLD = 1000 ; }

Fix:
lineIterator = FileUtils . lineIterator ( changelogFile , "UTF-8" ) ;
Buggy code:
public class PaletteStorageHelper { private SQLiteDatabase database ; private DBManager dBManager ; private String [ ] allColumns = new String [ ] { DBManager . COLUMN_ID , DBManager . COLUMN_NAME , DBManager . COLUMN_COLORS } ; public static final int SUCCESS = 0 ; public static final int DUPLICATE = 1 ; public static final int FAILURE = 2 ; public PaletteStorageHelper ( Context context ) { } public void open ( ) throws SQLException { } public void close ( ) { } public int save ( Palette p ) { } public boolean remove ( Palette p ) { } public boolean isSaved ( Palette p ) { String temp = colorsToString ( p ) ; open ( ) ; <START_BUG> Cursor cursor = database . rawQuery ( ( ( ( ( ( ( ( "SELECT<seq2seq4repair_space>" + ( DBManager . COLUMN_COLORS ) ) + "<seq2seq4repair_space>FROM<seq2seq4repair_space>" ) + ( DBManager . TABLE_PALETTES ) ) + "<seq2seq4repair_space>WHERE<seq2seq4repair_space>" ) + ( DBManager . COLUMN_COLORS ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + temp ) , null ) ; <END_BUG> close ( ) ; if ( ( cursor . getCount ( ) ) > 0 ) return true ; return false ; } public Palette [ ] getAllPalettes ( ) { } private String colorsToString ( Palette p ) { } private Palette cursorToPalette ( Cursor cursor ) { } }

Fix:
Cursor cursor = database . rawQuery ( ( ( ( ( ( ( ( ( "SELECT<seq2seq4repair_space>" + ( DBManager . COLUMN_COLORS ) ) + "<seq2seq4repair_space>FROM<seq2seq4repair_space>" ) + ( DBManager . TABLE_PALETTES ) ) + "<seq2seq4repair_space>WHERE<seq2seq4repair_space>" ) + ( DBManager . COLUMN_COLORS ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>\'" ) + temp ) + "'" ) , null ) ;
Buggy code:
public class Main { public static void main ( String [ ] args ) { XMLHelper . init ( ) ; try { JFrame f = new JFrame ( "Antidote" ) ; AppContext context = new AppContext ( f ) ; EventResponder resp = new EventResponder ( context ) ; Antidote gui = new Antidote ( context ) ; f . setDefaultCloseOperation ( 3 ) ; f . setJMenuBar ( context . getActions ( ) . createMenuBar ( ) ) ; f . getContentPane ( ) . add ( BorderLayout . CENTER , gui ) ; f . getContentPane ( ) . add ( BorderLayout . NORTH , context . getActions ( ) . createToolBar ( ) ) ; <START_BUG> ImageIcon icon = context . getResources ( ) . getImageIcon ( "icon-small.gif" ) ; <END_BUG> if ( icon != null ) { f . setIconImage ( icon . getImage ( ) ) ; } else { System . out . println ( "Application<seq2seq4repair_space>icon<seq2seq4repair_space>not<seq2seq4repair_space>found." ) ; } f . pack ( ) ; f . setVisible ( true ) ; if ( ( args . length ) > 0 ) { LoadFileCmd load = new LoadFileCmd ( context ) ; load . setFile ( new File ( args [ 0 ] ) ) ; load . run ( ) ; } } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } }

Fix:
ImageIcon icon = context . getResources ( ) . loadImageIcon ( "icon-small.gif" ) ;
Buggy code:
public class RiemannIntegrator implements SampledFunctionIntegrator { public double [ ] integrate ( SampledFunctionIterator iter ) throws ExhaustedSampleException , FunctionException { RiemannIntegratorSampler sampler = new RiemannIntegratorSampler ( iter ) ; double [ ] sum = null ; try { while ( true ) { <START_BUG> sum = sampler . nextSamplePoint ( ) . getY ( ) ; <END_BUG> } } catch ( ExhaustedSampleException e ) { } return sum ; } }

Fix:
sum = sampler . nextSamplePoint ( ) . y ;
Buggy code:
public abstract class AbstractRemoveStepHandler implements NewStepHandler { public void execute ( NewOperationContext context , ModelNode operation ) throws OperationFailedException { } protected void performRemove ( NewOperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { <START_BUG> context . removeModel ( EMPTY_ADDRESS ) ; <END_BUG> } protected void performRuntime ( final NewOperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { } protected void recoverServices ( final NewOperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { } protected boolean requiresRuntime ( NewOperationContext context ) { } }

Fix:
context . removeResource ( EMPTY_ADDRESS ) ;
Buggy code:
class Map { private int width ; private int height ; private ArrayList < Room > rooms ; private ArrayList < Hall > halls ; private char [ ] [ ] data ; public Map ( int mwidth , int mheight ) { } public void out ( ) { } private void generateMap ( ) { rooms = new ArrayList < Room > ( ) ; halls = new ArrayList < Hall > ( ) ; <START_BUG> MapGen . generateMap ( rooms , halls , new Room ( 0 , 0 , width , height ) ) ; <END_BUG> } private void generateData ( ) { } No newline ; at end ; of file ; }

Fix:
MapGen . generateMap ( rooms , halls , new Room ( 0 , 0 , ( ( width ) - 1 ) , ( ( height ) - 1 ) ) ) ;
Buggy code:
public class InstitutionRegister extends ActionBarActivity { private EditText mName ; private EditText mCNPJ ; private EditText mEmail ; private EditText mPassword ; private EditText mPasswordConf ; private EditText mCountry ; private EditText mState ; private EditText mCity ; private EditText mStreet ; private EditText mNumber ; private EditText mApartment ; private EditText mPhone ; private Spinner mItems ; private Button mSubmit ; private Context mContext ; private OnClickListener mOnSubmitClickListener = new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { } } ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_institution_register ) ; mContext = this ; mName = ( ( EditText ) ( findViewById ( AIG_edit_name ) ) ) ; mCNPJ = ( ( EditText ) ( findViewById ( AIG_edit_cnpj ) ) ) ; mEmail = ( ( EditText ) ( findViewById ( AIG_edit_email ) ) ) ; mPassword = ( ( EditText ) ( findViewById ( AIG_edit_password ) ) ) ; mPasswordConf = ( ( EditText ) ( findViewById ( AIG_edit_conf_pass ) ) ) ; mCountry = ( ( EditText ) ( findViewById ( AIG_edit_country ) ) ) ; mState = ( ( EditText ) ( findViewById ( AIG_edit_state ) ) ) ; mCity = ( ( EditText ) ( findViewById ( AIG_edit_city ) ) ) ; mStreet = ( ( EditText ) ( findViewById ( AIG_edit_street ) ) ) ; mNumber = ( ( EditText ) ( findViewById ( AIG_edit_number ) ) ) ; mApartment = ( ( EditText ) ( findViewById ( AIG_edit_apartment ) ) ) ; mPhone = ( ( EditText ) ( findViewById ( AIG_edit_phone ) ) ) ; mItems = ( ( Spinner ) ( findViewById ( AIG_items ) ) ) ; ArrayAdapter < CharSequence > adapter = ArrayAdapter . createFromResource ( this , items , simple_spinner_item ) ; mItems . setAdapter ( adapter ) ; mSubmit = ( ( Button ) ( findViewById ( AIG_submit ) ) ) ; mSubmit . setOnClickListener ( mOnSubmitClickListener ) ; mName . setText ( "test" ) ; mCNPJ . setText ( "123456789" ) ; <START_BUG> mEmail . setText ( "a@a.a" ) ; <END_BUG> mPassword . setText ( "t" ) ; mPasswordConf . setText ( "e" ) ; mCountry . setText ( "Brasil" ) ; mState . setText ( "Rio<seq2seq4repair_space>Grande<seq2seq4repair_space>do<seq2seq4repair_space>Sul" ) ; mCity . setText ( "Porto<seq2seq4repair_space>Alegre" ) ; mStreet . setText ( "São<seq2seq4repair_space>mateus" ) ; mNumber . setText ( "486" ) ; mApartment . setText ( "901" ) ; mPhone . setText ( "123" ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public ArrayList < Double > getLocationFromAddress ( String strAddress ) { } }

Fix:
mEmail . setText ( "test@test.com" ) ;
Buggy code:
public abstract class Algorithms { public double budget ; public double energyInKW ; public double availableSpace ; public double energyInVolts ; public ProductContainer [ ] containers ; public ArrayList < Panel > viablePanels ; public ArrayList < Inverter > viableInverters ; public ArrayList < Racking > viableRacks ; public ArrayList < Battery > viableBatteries ; public ArrayList < BatteryController > viableBatteryControllers ; public ArrayList < BatteryMeter > viableBatteryMeters ; public ArrayList < DCACDisconnect > viableDCACDisconnects ; public ArrayList < BatteryWire > viableBatteryWires ; public ArrayList < PVWire > viablePVWires ; protected Algorithms . ImpossibleParameters parameters ; public Algorithms ( double budget , double energyInKW , double availableSpace , ProductContainer [ ] containers ) { } public Algorithms ( double budget , double energyInKW , double availableSpace , double energyInVolts , ProductContainer [ ] containers ) { } public abstract void findViablePanels ( ) { } public abstract void findViableRacks ( ) { } public abstract void findViableInverters ( ) { } public abstract void findViableBatteries ( ) { } public abstract void findViableBatteryControllers ( ) { } public abstract void findViableDCACDisconnect ( ) { } public void findViableBatteryMeters ( ) { } public void findViableBatteryWires ( ) { viableBatteryWires = new ArrayList < BatteryWire > ( ) ; <START_BUG> containers [ 7 ] . loToHi ( "pricing" ) ; <END_BUG> viableBatteryWires . add ( ( ( BatteryWire ) ( containers [ 7 ] . products . get ( 0 ) ) ) ) ; } public void findViablePVWires ( ) { } public Boolean impossibleParameters ( ) { } protected class ImpossibleParameters { protected Boolean valid ; protected String badParameter ; protected String restrictedProduct ; public ImpossibleParameters ( ) { } public void badParameter ( String product , String ... fieldName ) { } } No newline ; at end ; of file ; }

Fix:
containers [ 7 ] . loToHi ( "price" ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class BasicOperationsUnitTestCase { @ ContainerResource private ManagementClient managementClient ; @ Test public void testSocketBindingsWildcards ( ) throws IOException { } @ Test public void testReadResourceRecursiveDepth ( ) throws IOException { } @ Test public void testReadAttributeWildcards ( ) throws IOException { final ModelNode address = new ModelNode ( ) ; address . add ( "socket-binding-group" , "*" ) ; address . add ( "socket-binding" , "*" ) ; address . protect ( ) ; final ModelNode operation = new ModelNode ( ) ; operation . get ( OP ) . set ( READ_ATTRIBUTE_OPERATION ) ; operation . get ( OP_ADDR ) . set ( address ) ; operation . get ( NAME ) . set ( PORT ) ; final ModelNode result = managementClient . getControllerClient ( ) . execute ( operation ) ; Assert . assertTrue ( result . hasDefined ( RESULT ) ) ; Assert . assertEquals ( SUCCESS , result . get ( OUTCOME ) . asString ( ) ) ; final Collection < ModelNode > steps = BasicOperationsUnitTestCase . getSteps ( result . get ( RESULT ) ) ; Assert . assertFalse ( steps . isEmpty ( ) ) ; for ( final ModelNode step : steps ) { Assert . assertTrue ( step . hasDefined ( OP_ADDR ) ) ; Assert . assertTrue ( step . hasDefined ( RESULT ) ) ; final ModelNode stepResult = step . get ( RESULT ) ; <START_BUG> Assert . assertTrue ( ( ( ( stepResult . getType ( ) ) == ( ModelType . EXPRESSION ) ) || ( ( stepResult . asInt ( ) ) > 0 ) ) ) ; <END_BUG> } } @ Test public void testSocketBindingDescriptions ( ) throws IOException { } @ Test public void testRecursiveReadIncludingRuntime ( ) throws IOException { } @ Test public void testHttpSocketBinding ( ) throws IOException { } @ Test public void testSimpleReadAttribute ( ) throws IOException { } @ Test @ Ignore public void testMetricReadAttribute ( ) throws IOException { } @ Test public void testReadAttributeChild ( ) throws IOException { } @ Test public void testInterfaceAdd ( ) throws IOException { } protected ModelNode execute ( final ModelNode operation ) throws IOException { } static void assertSuccessful ( final ModelNode result ) { } static ModelNode createReadAttributeOperation ( final ModelNode address , final String attributeName ) { } protected static List < ModelNode > getSteps ( final ModelNode result ) { } }

Fix:
Assert . assertTrue ( ( ( ( stepResult . getType ( ) ) == ( ModelType . EXPRESSION ) ) || ( ( stepResult . asInt ( ) ) >= 0 ) ) ) ;