nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ContinuousValueEncoder extends FeatureVectorEncoder { public ContinuousValueEncoder ( String name ) { } @ Override public void addToVector ( byte [ ] originalForm , double weight , Vector data ) { int probes = getProbes ( ) ; String name = getName ( ) ; for ( int i = 0 ; i < probes ; i ++ ) { int n = hashForProbe ( originalForm , data . size ( ) , name , i ) ; if ( isTraceEnabled ( ) ) { <START_BUG> trace ( name . getBytes ( Charsets . UTF_8 ) , n ) ; <END_BUG> } data . set ( n , ( ( data . get ( n ) ) + ( getWeight ( originalForm , weight ) ) ) ) ; } } @ Override protected int hashForProbe ( byte [ ] originalForm , int dataSize , String name , int probe ) { } @ Override protected double getWeight ( byte [ ] originalForm , double w ) { } @ Override public String asString ( String originalForm ) { } }

Fix:
trace ( ( ( String ) ( null ) ) , n ) ;
Buggy code:
public final class GenericDataModel extends AbstractDataModel { private static final Logger log = LoggerFactory . getLogger ( GenericDataModel . class ) ; private final long [ ] userIDs ; private final FastByIDMap < PreferenceArray > preferenceFromUsers ; private final long [ ] itemIDs ; private final FastByIDMap < PreferenceArray > preferenceForItems ; private final FastByIDMap < FastByIDMap < Long > > timestamps ; public GenericDataModel ( FastByIDMap < PreferenceArray > userData ) { } public GenericDataModel ( FastByIDMap < PreferenceArray > userData , FastByIDMap < FastByIDMap < Long > > timestamps ) { } @ Deprecated public GenericDataModel ( DataModel dataModel ) throws TasteException { } public static FastByIDMap < PreferenceArray > toDataMap ( FastByIDMap < Collection < Preference > > data , boolean byUser ) { } public static FastByIDMap < PreferenceArray > toDataMap ( DataModel dataModel ) throws TasteException { } public FastByIDMap < PreferenceArray > getRawUserData ( ) { } public FastByIDMap < PreferenceArray > getRawItemData ( ) { } @ Override public LongPrimitiveArrayIterator getUserIDs ( ) { } @ Override public PreferenceArray getPreferencesFromUser ( long userID ) throws NoSuchUserException { } @ Override public FastIDSet getItemIDsFromUser ( long userID ) throws TasteException { } @ Override public LongPrimitiveArrayIterator getItemIDs ( ) { } @ Override public PreferenceArray getPreferencesForItem ( long itemID ) throws NoSuchItemException { } @ Override public Float getPreferenceValue ( long userID , long itemID ) throws TasteException { } @ Override public Long getPreferenceTime ( long userID , long itemID ) throws TasteException { } @ Override public int getNumItems ( ) { } @ Override public int getNumUsers ( ) { } @ Override public int getNumUsersWithPreferenceFor ( long itemID ) { } @ Override public int getNumUsersWithPreferenceFor ( long itemID1 , long itemID2 ) { } @ Override public void removePreference ( long userID , long itemID ) { } @ Override public void setPreference ( long userID , long itemID , float value ) { } @ Override public void refresh ( Collection < Refreshable > alreadyRefreshed ) { } @ Override public boolean hasPreferenceValues ( ) { } @ Override public String toString ( ) { StringBuilder result = new StringBuilder ( 200 ) ; result . append ( "GenericDataModel[users:" ) ; for ( int i = 0 ; i < ( Math . min ( 3 , userIDs . length ) ) ; i ++ ) { if ( i > 0 ) { result . append ( ',' ) ; } result . append ( userIDs [ i ] ) ; } <START_BUG> if ( ( result . length ( ) ) > 3 ) { <END_BUG> result . append ( "..." ) ; } result . append ( ']' ) ; return result . toString ( ) ; } }

Fix:
if ( ( userIDs . length ) > 3 ) {
Buggy code:
public class DOMImplementationImpl implements DOMImplementation { static DOMImplementationImpl singleton = new DOMImplementationImpl ( ) ; public boolean hasFeature ( String feature , String version ) { } public static DOMImplementation getDOMImplementation ( ) { } public DocumentType createDocumentType ( String qualifiedName , String publicID , String systemID , String internalSubset ) { } public Document createDocument ( String namespaceURI , String qualifiedName , DocumentType doctype ) throws DOMException { <START_BUG> if ( ( doctype . getOwnerDocument ( ) ) != null ) { <END_BUG> throw new DOMExceptionImpl ( DOMException . WRONG_DOCUMENT_ERR , "DOM005<seq2seq4repair_space>Wrong<seq2seq4repair_space>document" ) ; } DocumentImpl doc = new DocumentImpl ( doctype ) ; Element e = doc . createElementNS ( namespaceURI , qualifiedName ) ; doc . appendChild ( e ) ; return doc ; } }

Fix:
if ( ( doctype != null ) && ( ( doctype . getOwnerDocument ( ) ) != null ) ) {
Buggy code:
public class TestAbstractSchemaName extends TestCase { private EntityManagerFactory emf ; public void setUp ( ) { <START_BUG> Map props = new HashMap ( ) ; <END_BUG> props . put ( "openjpa.MetaDataFactory" , ( ( "jpa(Types=" + ( NamedEntity . class . getName ( ) ) ) + ")" ) ) ; emf = Persistence . createEntityManagerFactory ( "test" , props ) ; NamedEntity e = new NamedEntity ( ) ; e . setName ( "e" ) ; EntityManager em = emf . createEntityManager ( ) ; em . getTransaction ( ) . begin ( ) ; em . persist ( e ) ; em . getTransaction ( ) . commit ( ) ; em . close ( ) ; } public void tearDown ( ) { } public void testQuery ( ) { } public static void main ( String [ ] args ) { } }

Fix:
Map props = new HashMap ( System . getProperties ( ) ) ;
Buggy code:
public class Path extends Resource { public NSBezierPath handle ; public Path ( Device device ) { } public Path ( Device device , Path path , float flatness ) { } public Path ( Device device , PathData data ) { } public void addArc ( float x , float y , float width , float height , float startAngle , float arcAngle ) { } public void addPath ( Path path ) { } public void addRectangle ( float x , float y , float width , float height ) { } public void addString ( String string , float x , float y , Font font ) { if ( isDisposed ( ) ) SWT . error ( ERROR_GRAPHIC_DISPOSED ) ; if ( font == null ) SWT . error ( ERROR_NULL_ARGUMENT ) ; if ( font . isDisposed ( ) ) SWT . error ( ERROR_INVALID_ARGUMENT ) ; NSString str = NSString . stringWith ( string ) ; NSTextStorage textStorage = ( ( NSTextStorage ) ( new NSTextStorage ( ) . alloc ( ) ) ) ; textStorage . initWithString_ ( str ) ; NSLayoutManager layoutManager = ( ( NSLayoutManager ) ( new NSLayoutManager ( ) . alloc ( ) . init ( ) ) ) ; NSTextContainer textContainer = ( ( NSTextContainer ) ( new NSTextContainer ( ) . alloc ( ) ) ) ; NSSize size = new NSSize ( ) ; size . width = Float . MAX_VALUE ; size . height = Float . MAX_VALUE ; textContainer . initWithContainerSize ( size ) ; textStorage . addLayoutManager ( layoutManager ) ; layoutManager . addTextContainer ( textContainer ) ; NSRange range = new NSRange ( ) ; range . length = str . length ( ) ; textStorage . beginEditing ( ) ; textStorage . addAttribute ( OS . NSFontAttributeName ( ) , font . handle , range ) ; textStorage . endEditing ( ) ; range = layoutManager . glyphRangeForTextContainer ( textContainer ) ; if ( ( range . length ) != 0 ) { int glyphs = OS . malloc ( ( ( 4 * ( range . length ) ) * 2 ) ) ; layoutManager . getGlyphs ( glyphs , range ) ; NSBezierPath path = NSBezierPath . bezierPath ( ) ; NSPoint point = new NSPoint ( ) ; point . x = x ; point . y = y ; path . moveToPoint ( point ) ; path . appendBezierPathWithGlyphs ( glyphs , range . length , font . handle ) ; NSAffineTransform transform = NSAffineTransform . transform ( ) ; transform . scaleXBy ( 1 , ( - 1 ) ) ; <START_BUG> transform . translateXBy ( 0 , ( - ( y + ( textStorage . size ( ) . height ) ) ) ) ; <END_BUG> path . transformUsingAffineTransform ( transform ) ; OS . free ( glyphs ) ; handle . appendBezierPath ( path ) ; } textContainer . release ( ) ; layoutManager . release ( ) ; textStorage . release ( ) ; } public void close ( ) { } public boolean contains ( float x , float y , GC gc , boolean outline ) { } public void cubicTo ( float cx1 , float cy1 , float cx2 , float cy2 , float x , float y ) { } void destroy ( ) { } public void getBounds ( float [ ] bounds ) { } public void getCurrentPoint ( float [ ] point ) { } public PathData getPathData ( ) { } void init ( PathData data ) { } public boolean isDisposed ( ) { } public void lineTo ( float x , float y ) { } public void moveTo ( float x , float y ) { } public void quadTo ( float cx , float cy , float x , float y ) { } public String toString ( ) { } }

Fix:
transform . translateXBy ( 0 , ( - ( ( 2 * y ) + ( textStorage . size ( ) . height ) ) ) ) ;
Buggy code:
public class SmallNGSCmd { static Logger logger = LogManager . getRootLogger ( ) ; static Options options = new Options ( ) ; public static void main ( String [ ] args ) { } public static void parseArguments ( String [ ] args , SmallNGSPipeline smallPipeline ) { } public static void printHelp ( ) { } public static void printBanner ( ) { <START_BUG> SmallNGSCmd . logger . info ( ( "\n\n\n" + ( ( ( "<seq2seq4repair_space>=======================================================================\n" + "<seq2seq4repair_space>|<seq2seq4repair_space>NGS<seq2seq4repair_space>smallRNA<seq2seq4repair_space>pipeline:<seq2seq4repair_space>|" ) + "<seq2seq4repair_space>|<seq2seq4repair_space>performs<seq2seq4repair_space>a<seq2seq4repair_space>range<seq2seq4repair_space>of<seq2seq4repair_space>analyses<seq2seq4repair_space>on<seq2seq4repair_space>smallRNA<seq2seq4repair_space>NGS<seq2seq4repair_space>data<seq2seq4repair_space>|\n" ) + "<seq2seq4repair_space>=======================================================================\n\n\n" ) ) ) ; <END_BUG> SmallNGSCmd . logger . info ( "***<seq2seq4repair_space>report<seq2seq4repair_space>bugs<seq2seq4repair_space>to<seq2seq4repair_space>simon.rayner@medisin.uio.no\n" ) ; } }

Fix:
SmallNGSCmd . logger . info ( ( "\n\n\n" + ( ( ( "<seq2seq4repair_space>=======================================================================\n" + "<seq2seq4repair_space>|<seq2seq4repair_space>NGS<seq2seq4repair_space>smallRNA<seq2seq4repair_space>pipeline:<seq2seq4repair_space>|\n" ) + "<seq2seq4repair_space>|<seq2seq4repair_space>performs<seq2seq4repair_space>a<seq2seq4repair_space>range<seq2seq4repair_space>of<seq2seq4repair_space>analyses<seq2seq4repair_space>on<seq2seq4repair_space>smallRNA<seq2seq4repair_space>NGS<seq2seq4repair_space>data<seq2seq4repair_space>|\n" ) + "<seq2seq4repair_space>=======================================================================\n\n\n" ) ) ) ;
Buggy code:
public final class FontData { public String name ; public float height ; public int style ; public String atsName ; String lang ; String country ; String variant ; public FontData ( ) { } public FontData ( String string ) { } public FontData ( String name , int height , int style ) { } FontData ( String name , float height , int style ) { } public boolean equals ( Object object ) { } public int getHeight ( ) { } float getHeightF ( ) { } public String getLocale ( ) { } public String getName ( ) { } public int getStyle ( ) { } public int hashCode ( ) { } public void setHeight ( int height ) { } void setHeight ( float height ) { } public void setLocale ( String locale ) { } public void setName ( String name ) { } public void setStyle ( int style ) { } public String toString ( ) { <START_BUG> StringBuffer buffer = new StringBuffer ( ) ; <END_BUG> buffer . append ( "1|" ) ; buffer . append ( getName ( ) ) ; buffer . append ( "|" ) ; buffer . append ( getHeightF ( ) ) ; buffer . append ( "|" ) ; buffer . append ( getStyle ( ) ) ; buffer . append ( "|" ) ; buffer . append ( "CARBON|1|" ) ; if ( ( atsName ) != null ) buffer . append ( atsName ) ; return buffer . toString ( ) ; } }

Fix:
StringBuffer buffer = new StringBuffer ( 128 ) ;
Buggy code:
public class CamelDebugContextEditorInput implements ICamelEditorInput { public static final String ID = CamelDebugContextEditorInput . class . getName ( ) ; private final CamelDebugFacade debugger ; private final ILaunchConfiguration launchConfig ; private File tempFile ; private IFile lastSaveAsFile ; private CamelDebugContextFileStoreEditorInput lastInput ; public CamelDebugContextEditorInput ( CamelDebugFacade debugger , ILaunchConfiguration launchConfig ) { } @ Override public Object getAdapter ( @ SuppressWarnings ( "rawtypes" ) Class adapter ) { } @ Override public boolean exists ( ) { } @ Override public ImageDescriptor getImageDescriptor ( ) { } @ Override public String getName ( ) { } @ Override public IPersistableElement getPersistable ( ) { } @ Override public String getToolTipText ( ) { } @ Override public RouteContainer loadModel ( ) { } @ Override public void save ( String xml ) { } @ Override public IEditorInput getFileEditorInput ( ) { if ( ( this . lastInput ) == null ) { try { String fileUnderDebug = CamelDebugUtils . getRawCamelContextFilePathFromLaunchConfig ( this . launchConfig ) ; IProject p = CamelDebugUtils . getProjectForFilePath ( fileUnderDebug ) ; File targetFolder = p . getLocation ( ) . append ( "target" ) . toFile ( ) ; if ( ! ( targetFolder . exists ( ) ) ) targetFolder . mkdirs ( ) ; File tempDir = File . createTempFile ( ".CamelContextInDebug_" , "_temp" , targetFolder ) ; tempDir . delete ( ) ; tempDir . mkdirs ( ) ; <START_BUG> tempFile = new File ( tempDir , fileUnderDebug . substring ( ( ( fileUnderDebug . lastIndexOf ( File . separatorChar ) ) + 1 ) ) ) ; <END_BUG> IFileSystem fileSystem = EFS . getLocalFileSystem ( ) ; IFileStore fileStore = fileSystem . fromLocalFile ( tempFile ) ; String xml = debugger . getContextXmlDump ( ) ; if ( xml != null ) IOUtils . writeText ( tempFile , xml ) ; this . lastInput = new CamelDebugContextFileStoreEditorInput ( fileStore , this . debugger ) ; return this . lastInput ; } catch ( Exception e ) { Activator . getLogger ( ) . warning ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>temporary<seq2seq4repair_space>file:<seq2seq4repair_space>" + e ) , e ) ; } } return this . lastInput ; } public void refresh ( ) { } @ Override public IFile getLastSaveAsFile ( ) { } @ Override public void setLastSaveAsFile ( IFile lastSaveAsFile ) { } }

Fix:
tempFile = new File ( tempDir , fileUnderDebug . substring ( ( ( fileUnderDebug . lastIndexOf ( "//" ) ) + 1 ) ) ) ;
Buggy code:
public class TableModelThreadedView extends TreeTableModelDecorator { private boolean enabled ; private HashMap hashtable ; private int idCount = 0 ; private Collator collator ; public TableModelThreadedView ( TreeTableModelInterface tableModel ) { } public void toggleView ( boolean b ) { } public boolean isEnabled ( ) { } public void setEnabled ( boolean b ) { } protected String parseSubject ( String subject ) { } protected String [ ] parseReferences ( String references ) { } protected boolean add ( MessageNode node , MessageNode rootNode ) { } protected void thread ( MessageNode rootNode ) { } protected MessageNode generateDummy ( MessageNode node , int i , String [ ] referenceList , MessageNode rootNode ) { } protected void sort ( MessageNode node ) { } protected boolean containsRecentChildren ( MessageNode parent ) { for ( int i = 0 ; i < ( parent . getChildCount ( ) ) ; i ++ ) { MessageNode child = ( ( MessageNode ) ( parent . getChildAt ( i ) ) ) ; if ( ( ( org . columba . mail . message . ColumbaHeader ) ( child . getHeader ( ) ) ) . getFlags ( ) . getRecent ( ) ) { <START_BUG> log . debug ( "found<seq2seq4repair_space>recent<seq2seq4repair_space>message" ) ; <END_BUG> return true ; } else { containsRecentChildren ( child ) ; } } return false ; } public MessageNode addItem ( MessageNode child ) { } public void modify ( Object [ ] uids ) { } public void remove ( Object [ ] uids ) { } public void set ( HeaderList headerList ) { } public void update ( ) { } class MessageHeaderComparator implements Comparator { protected int column ; protected boolean ascending ; public MessageHeaderComparator ( int sortCol , boolean sortAsc ) { } public int compare ( Object o1 , Object o2 ) { } public boolean equals ( Object obj ) { } } }

Fix:
log . info ( "found<seq2seq4repair_space>recent<seq2seq4repair_space>message" ) ;
Buggy code:
public abstract class AbstractXMLDataSourceRuntimeHandler < T > extends AbstractRuntimeOnlyHandler { protected static final String CONNECTION_PROPERTIES = "connection-properties" ; protected static final String XA_DATASOURCE_PROPERTIES = "xa-datasource-properties" ; protected static final String DATA_SOURCE = "data-source" ; protected static final String XA_DATA_SOURCE = "xa-data-source" ; private final Map < PathAddress , T > dataSourceConfigs = Collections . synchronizedMap ( new HashMap < PathAddress , T > ( ) ) ; @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { } public void registerDataSource ( final PathAddress address , final T dataSource ) { } public void unregisterDataSource ( final PathAddress address ) { } protected abstract void executeReadAttribute ( final String attributeName , final OperationContext context , final T dataSource , final PathAddress address ) { } private static IllegalStateException unknownOperation ( String opName ) { } private T getDataSourceConfig ( final PathAddress operationAddress ) throws OperationFailedException { final List < PathElement > relativeAddress = new ArrayList < PathElement > ( ) ; for ( int i = ( operationAddress . size ( ) ) - 1 ; i >= 0 ; i -- ) { PathElement pe = operationAddress . getElement ( i ) ; relativeAddress . add ( 0 , pe ) ; if ( DEPLOYMENT . equals ( pe . getKey ( ) ) ) { break ; } } final PathAddress pa = PathAddress . pathAddress ( relativeAddress ) ; final T config ; if ( ( operationAddress . getLastElement ( ) . getKey ( ) . equals ( AbstractXMLDataSourceRuntimeHandler . CONNECTION_PROPERTIES ) ) || ( operationAddress . getLastElement ( ) . getKey ( ) . equals ( AbstractXMLDataSourceRuntimeHandler . XA_DATASOURCE_PROPERTIES ) ) ) { config = dataSourceConfigs . get ( pa . subAddress ( 0 , ( ( pa . size ( ) ) - 1 ) ) ) ; } else { config = dataSourceConfigs . get ( pa ) ; } if ( config == null ) { String exceptionMessage = ROOT_LOGGER . noDataSourceRegisteredForAddress ( operationAddress ) ; <START_BUG> throw new OperationFailedException ( exceptionMessage ) ; <END_BUG> } return config ; } protected void setLongIfNotNull ( final OperationContext context , final Long value ) { } protected void setIntIfNotNull ( final OperationContext context , final Integer value ) { } protected void setBooleanIfNotNull ( final OperationContext context , final Boolean value ) { } protected void setStringIfNotNull ( final OperationContext context , final String value ) { } }

Fix:
throw new OperationFailedException ( new ModelNode ( ) . set ( exceptionMessage ) ) ;
Buggy code:
public class BlueprintExtender implements BundleActivator , SynchronousBundleListener { private static final Logger LOGGER = LoggerFactory . getLogger ( BlueprintExtender . class ) ; private BundleContext context ; private ScheduledExecutorService executors ; private Map < Bundle , BlueprintContainerImpl > containers ; private BlueprintEventDispatcher eventDispatcher ; private NamespaceHandlerRegistry handlers ; private RecursiveBundleTracker bt ; private ServiceRegistration parserServiceReg ; public void start ( BundleContext context ) { } private void checkInitialBundle ( Bundle b ) { } public void stop ( BundleContext context ) { } private List < Bundle > getBundlesToDestroy ( ) { } private static int getServiceUsage ( ServiceReference ref ) { } public void bundleChanged ( BundleEvent event ) { } private void destroyContext ( Bundle bundle ) { } private void checkBundle ( Bundle bundle ) { } private boolean isCompatible ( Bundle bundle ) { } private boolean hasWildcards ( String path ) { } private String getFilePart ( URL url ) { } private String cachePath ( Bundle bundle , String filePath ) { <START_BUG> return ( ( ( ( bundle . getSymbolicName ( ) ) + "//" ) + ( bundle . getVersion ( ) ) ) + "//" ) + filePath ; <END_BUG> } private URL getOverrideURLForCachePath ( String privatePath ) { } private URL getOverrideURL ( Bundle bundle , String path ) { } private URL getOverrideURL ( Bundle bundle , URL path , String basePath ) { } private void addEntry ( Bundle bundle , String path , List < Object > pathList ) { } private void addEntries ( Bundle bundle , String path , String filePattern , List < Object > pathList ) { } private class BlueprintBundleTrackerCustomizer implements BundleTrackerCustomizer { public BlueprintBundleTrackerCustomizer ( ) { } public Object addingBundle ( Bundle b , BundleEvent event ) { } public void modifiedBundle ( Bundle b , BundleEvent event , Object arg2 ) { } public void removedBundle ( Bundle b , BundleEvent event , Object arg2 ) { } } }

Fix:
return ( ( Integer . toHexString ( bundle . hashCode ( ) ) ) + "//" ) + filePath ;
Buggy code:
public class Mouse extends Beast { public Mouse ( int x , int y , int speed , ImgLoader imgLoader , Maze maze ) { } @ Override public void updateDirection ( ) { <START_BUG> dir = direction . getCollisionCourse ( x , y , player . getX ( ) , player . getY ( ) ) . getOpposite ( ) ; <END_BUG> } @ Override protected direction getNextDirection ( ) { } }

Fix:
nextDir = direction . getCollisionCourse ( x , y , player . getX ( ) , player . getY ( ) ) . getOpposite ( ) ;
Buggy code:
public class ContainsSelector extends BaseExtendSelector implements ResourceSelector { private String contains = null ; private boolean casesensitive = true ; private boolean ignorewhitespace = false ; public static final String EXPRESSION_KEY = "expression" ; public static final String CONTAINS_KEY = "text" ; public static final String CASE_KEY = "casesensitive" ; public static final String WHITESPACE_KEY = "ignorewhitespace" ; public ContainsSelector ( ) { } public String toString ( ) { <START_BUG> StringBuffer buf = new StringBuffer ( "{containsselector<seq2seq4repair_space>text:<seq2seq4repair_space>" ) ; <END_BUG> buf . append ( '"' ) . append ( contains ) . append ( '"' ) ; buf . append ( "<seq2seq4repair_space>casesensitive:<seq2seq4repair_space>" ) ; buf . append ( ( casesensitive ? "true" : "false" ) ) ; buf . append ( "<seq2seq4repair_space>ignorewhitespace:<seq2seq4repair_space>" ) ; buf . append ( ( ignorewhitespace ? "true" : "false" ) ) ; buf . append ( "}" ) ; return buf . toString ( ) ; } public void setText ( String contains ) { } public void setCasesensitive ( boolean casesensitive ) { } public void setIgnorewhitespace ( boolean ignorewhitespace ) { } public void setParameters ( Parameter [ ] parameters ) { } public void verifySettings ( ) { } public boolean isSelected ( File basedir , String filename , File file ) { } public boolean isSelected ( Resource r ) { } }

Fix:
StringBuilder buf = new StringBuilder ( "{containsselector<seq2seq4repair_space>text:<seq2seq4repair_space>" ) ;
Buggy code:
public abstract class GenericBenchmark { private static Logger logger = LogManager . getLogger ( GenericBenchmark . class ) ; private static final Conf conf = Conf . INSTANCE ; protected static String END_OF_LINE ; protected static String instancesPath ; protected String resultsPath ; protected static String resultsFile ; protected String imageID ; protected Integer cpuValue ; protected Integer ramGbValue ; protected Integer diskGbValue ; protected Integer runningTime ; protected String ipAddress ; protected String vmId ; protected String benchmarkName ; protected VmAutonomic vm ; protected static Long benchmarkStartTimestamp ; protected static Long benchmarkEndTimestamp ; protected long timestampStartVM ; protected long timestampStartBenchmark ; public GenericBenchmark ( int cpus , int ramGb , int diskGb , int runningTime , String benchmarkName ) { } public List < String > getVmConsoleOutputLines ( ) { } protected void writeResultToCsv ( double result ) { <START_BUG> String toWrite = ( ( ( ( ( ( ( ( ( ( ( vm . getName ( ) ) + "," ) + ( benchmarkName ) ) + "," ) + ( cpuValue ) ) + "," ) + ( ramGbValue ) ) + "," ) + ( diskGbValue ) ) + "," ) + result ) + ( GenericBenchmark . END_OF_LINE ) ; <END_BUG> try ( FileWriter fileWriter = new FileWriter ( GenericBenchmark . resultsFile , true ) ; BufferedWriter bufferedWriter = new BufferedWriter ( fileWriter ) ; PrintWriter out = new PrintWriter ( bufferedWriter ) ) { out . println ( toWrite ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } protected static boolean hasBenchmarkTerminated ( List < String > vmConsoleOutputLines ) { } protected static boolean isBenchmarkRunning ( List < String > vmConsoleOutputLines ) { } public String getVmId ( ) { } public void runBenchmark ( VmAutonomic vm ) { } public boolean stepConfigured ( ) { } public boolean stepExecuted ( ) { } public abstract void executeBenchmark ( ) { } public abstract String getInitScript ( ) { } protected abstract boolean stepConfiguredBenchmark ( ) { } protected abstract boolean stepExecutedBenchmark ( ) { } @ Override public String toString ( ) { } }

Fix:
String toWrite = ( ( ( ( ( ( ( ( ( ( ( ( ( vm . getName ( ) ) + "," ) + ( benchmarkName ) ) + "," ) + ( cpuValue ) ) + "," ) + ( ramGbValue ) ) + "," ) + ( diskGbValue ) ) + "," ) + ( vm . getHostName ( ) ) ) + "," ) + result ) + ( GenericBenchmark . END_OF_LINE ) ;
Buggy code:
public class DefaultTextProducer implements TextProducer { private static final Random RANDOM = new Random ( ) ; private static final int DEFAULT_LENGTH = 5 ; private static final char [ ] DEFAULT_CHARS = new char [ ] { 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'k' , 'm' , 'n' , 'p' , 'r' , 'w' , 'x' , 'y' , '2' , '3' , '4' , '5' , '6' , '7' , '8' } ; private final String text ; public DefaultTextProducer ( ) { } public DefaultTextProducer ( int length ) { } public DefaultTextProducer ( int length , char [ ] dictionary ) { } public DefaultTextProducer ( String text ) { } @ Override public String getText ( ) { } private String generateText ( int length , char [ ] dictionary ) { String txt = "" ; for ( int i = 0 ; i < length ; i ++ ) { <START_BUG> txt += dictionary [ DefaultTextProducer . RANDOM . nextInt ( DefaultTextProducer . DEFAULT_LENGTH ) ] ; <END_BUG> } return txt ; } }

Fix:
txt += dictionary [ DefaultTextProducer . RANDOM . nextInt ( dictionary . length ) ] ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class EnumValueHandler extends AbstractValueHandler { private Enum < ? > [ ] _vals = null ; private boolean _ordinal = false ; private static final Localizer _loc = Localizer . forPackage ( EnumValueHandler . class ) ; public boolean getStoreOrdinal ( ) { } public void setStoreOrdinal ( boolean ordinal ) { } public Column [ ] map ( ValueMapping vm , String name , ColumnIO io , boolean adapt ) { } public Column [ ] map ( ValueMapping vm , DBIdentifier name , ColumnIO io , boolean adapt ) { } public boolean isVersionable ( ) { } public Object toDataStoreValue ( ValueMapping vm , Object val , JDBCStore store ) { if ( val == null ) return null ; if ( _ordinal ) <START_BUG> return new Integer ( ( ( Enum ) ( val ) ) . ordinal ( ) ) ; <END_BUG> return ( ( Enum ) ( val ) ) . name ( ) ; } public Object toObjectValue ( ValueMapping vm , Object val ) { } }

Fix:
return Integer . valueOf ( ( ( Enum ) ( val ) ) . ordinal ( ) ) ;
Buggy code:
public class AjCompiler extends Compiler { public AjCompiler ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , ICompilerRequestor requestor , IProblemFactory problemFactory ) { } public AjCompiler ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , ICompilerRequestor requestor , IProblemFactory problemFactory , boolean parseLiteralExpressionsAsConstants ) { } protected void process ( CompilationUnitDeclaration unit , int i ) { <START_BUG> EclipseFactory world = EclipseFactory . forLookupEnvironment ( lookupEnvironment ) ; <END_BUG> world . showMessage ( INFO , ( "compiling<seq2seq4repair_space>" + ( new String ( unit . getFileName ( ) ) ) ) , null , null ) ; super . process ( unit , i ) ; world . finishedCompilationUnit ( unit ) ; } }

Fix:
EclipseFactory world = EclipseFactory . fromLookupEnvironment ( lookupEnvironment ) ;
Buggy code:
public class FragmentAdapter extends FragmentPagerAdapter { final int PAGE_COUNT = 2 ; private String [ ] tabTitles = new String [ ] { "Gallery" , "Inbox" } ; private Context context ; public FragmentAdapter ( FragmentManager fm , Context context ) { } @ Override public int getCount ( ) { } @ Override public Fragment getItem ( int position ) { if ( position == 0 ) { return GalleryFragment . newInstance ( ( position + 1 ) ) ; } else { <START_BUG> return InboxFragment . newInstance ( ( position + 1 ) ) ; <END_BUG> } } @ Override public CharSequence getPageTitle ( int position ) { } No newline ; at end ; of file ; }

Fix:
return InboxFragment . newInstance ( dir ) ;
Buggy code:
public class FabbricaDiComandiRiflessiva implements FabbricaDiComandi { public Comando costruisciComando ( String istruzione ) { Scanner scannerDiParole = new Scanner ( istruzione ) ; String nomeComando = null ; String parametro = null ; Comando comando ; if ( scannerDiParole . hasNext ( ) ) nomeComando = scannerDiParole . next ( ) ; if ( scannerDiParole . hasNext ( ) ) parametro = scannerDiParole . next ( ) ; try { String nomeClasse = "it.uniroma3.diadia.comandi.Comando" ; nomeClasse += Character . toUpperCase ( nomeComando . charAt ( 0 ) ) ; <START_BUG> nomeClasse += nomeComando . substring ( 1 ) ; <END_BUG> comando = ( ( Comando ) ( Class . forName ( nomeClasse ) . newInstance ( ) ) ) ; comando . setParametro ( parametro ) ; } catch ( Exception e ) { comando = new ComandoNonValido ( ) ; } return comando ; } }

Fix:
nomeClasse += nomeComando . substring ( 1 ) . toLowerCase ( ) ;
Buggy code:
public class SuperTypeNamesCollector { public class TypeDeclarationVisitor extends ASTVisitor { public boolean visit ( TypeDeclaration typeDeclaration , BlockScope scope ) { } public boolean visit ( TypeDeclaration typeDeclaration , CompilationUnitScope scope ) { } public boolean visit ( TypeDeclaration memberTypeDeclaration , ClassScope scope ) { } public boolean visit ( FieldDeclaration fieldDeclaration , MethodScope scope ) { } public boolean visit ( Initializer initializer , MethodScope scope ) { } public boolean visit ( ConstructorDeclaration constructorDeclaration , ClassScope scope ) { } public boolean visit ( MethodDeclaration methodDeclaration , ClassScope scope ) { } } SearchPattern pattern ; char [ ] typeSimpleName ; char [ ] typeQualification ; MatchLocator locator ; IType type ; IProgressMonitor progressMonitor ; char [ ] [ ] [ ] result ; int resultIndex ; public SuperTypeNamesCollector ( SearchPattern pattern , char [ ] typeSimpleName , char [ ] typeQualification , MatchLocator locator , IType type , IProgressMonitor progressMonitor ) { } protected void addToResult ( char [ ] [ ] compoundName ) { } protected CompilationUnitDeclaration buildBindings ( ICompilationUnit compilationUnit , boolean isTopLevelOrMember ) throws JavaModelException { } public char [ ] [ ] [ ] collect ( ) throws JavaModelException { } protected void collectSuperTypeNames ( ReferenceBinding binding ) { } protected String [ ] getPathsOfDeclaringType ( ) { if ( ( ( this . typeQualification ) == null ) && ( ( this . typeSimpleName ) == null ) ) return null ; final PathCollector pathCollector = new PathCollector ( ) ; IJavaSearchScope scope = SearchEngine . createWorkspaceScope ( ) ; <START_BUG> IndexManager indexManager = JavaModelManager . getJavaModelManager ( ) . getIndexManager ( ) ; <END_BUG> SearchPattern searchPattern = new TypeDeclarationPattern ( ( ( this . typeSimpleName ) != null ? null : this . typeQualification ) , null , this . typeSimpleName , IIndexConstants . TYPE_SUFFIX , this . pattern . getMatchRule ( ) ) ; IndexQueryRequestor searchRequestor = new IndexQueryRequestor ( ) { public boolean acceptIndexMatch ( String documentPath , SearchPattern indexRecord , SearchParticipant participant , AccessRuleSet access ) { TypeDeclarationPattern record = ( ( TypeDeclarationPattern ) ( indexRecord ) ) ; if ( ( record . enclosingTypeNames ) != ( IIndexConstants . ONE_ZERO_CHAR ) ) { pathCollector . acceptIndexMatch ( documentPath , indexRecord , participant , access ) ; } return true ; } } ; indexManager . performConcurrentJob ( new PatternSearchJob ( searchPattern , new JavaSearchParticipant ( ) , scope , searchRequestor ) , IJavaSearchConstants . WAIT_UNTIL_READY_TO_SEARCH , ( ( progressMonitor ) == null ? null : new SubProgressMonitor ( progressMonitor , 100 ) ) ) ; return pathCollector . getPaths ( ) ; } protected boolean matches ( char [ ] [ ] compoundName ) { } protected boolean matches ( ReferenceBinding binding ) { } }

Fix:
IndexManager indexManager = JavaModelManager . getIndexManager ( ) ;
Buggy code:
public class JavaSearchScope extends AbstractSearchScope implements IJavaSearchScope { private boolean includesBinaries = true ; private boolean includesClasspaths = true ; private IResource fLastCheckedResource ; private boolean fLastResult ; private IPath [ ] paths = new IPath [ 1 ] ; private int pathsCount = 0 ; public void add ( IResource element ) { } public void add ( IResource element , boolean addJarsAndSourceFolders ) { } private void add ( IPath path ) { } public boolean encloses ( String resourcePathString ) { } protected boolean encloses ( IResource element ) { } public boolean encloses ( IJavaElement element ) { } public IPath [ ] enclosingProjectsAndJars ( ) { try { Vector paths = new Vector ( ) ; IJavaModel javaModel = JavaModelManager . getJavaModel ( ResourcesPlugin . getWorkspace ( ) ) ; IWorkspaceRoot root = javaModel . getWorkspace ( ) . getRoot ( ) ; for ( int i = 0 ; i < ( this . elementCount ) ; i ++ ) { IResource element = this . elements [ i ] ; IPath path = element . getProject ( ) . getFullPath ( ) ; IProject project = element . getProject ( ) ; if ( ( project . exists ( ) ) && ( project . isOpen ( ) ) ) { if ( ! ( paths . contains ( path ) ) ) paths . add ( path ) ; if ( this . includesClasspaths ) { IJavaProject javaProject = javaModel . getJavaProject ( project . getName ( ) ) ; <START_BUG> IClasspathEntry [ ] entries = javaProject . getExpandedClasspath ( true ) ; <END_BUG> for ( int j = 0 ; j < ( entries . length ) ; j ++ ) { IClasspathEntry entry = entries [ j ] ; switch ( entry . getEntryKind ( ) ) { case IClasspathEntry . CPE_PROJECT : path = entry . getPath ( ) ; if ( ( ! ( paths . contains ( path ) ) ) && ( root . getProject ( path . lastSegment ( ) ) . isAccessible ( ) ) ) { paths . add ( path ) ; } break ; case IClasspathEntry . CPE_LIBRARY : if ( this . includesBinaries ) { path = entry . getPath ( ) ; if ( ! ( paths . contains ( path ) ) ) paths . add ( path ) ; } break ; } } } } } IPath [ ] result = new IPath [ paths . size ( ) ] ; paths . copyInto ( result ) ; return result ; } catch ( JavaModelException e ) { return new IPath [ 0 ] ; } } public boolean includesBinaries ( ) { } public boolean includesClasspaths ( ) { } public void setIncludesBinaries ( boolean includesBinaries ) { } public void setIncludesClasspaths ( boolean includesClasspaths ) { } }

Fix:
IClasspathEntry [ ] entries = ( ( JavaProject ) ( javaProject ) ) . getExpandedClasspath ( true ) ;
Buggy code:
public class SpacewarTestCase extends TestCase { public void testSimpleExample ( ) { <START_BUG> File outdir = new File ( "testdata//spacewar//doc" ) ; <END_BUG> File sourcepath = new File ( "testdata//spacewar" ) ; String [ ] args = new String [ ] { "-d" , outdir . getAbsolutePath ( ) , "-sourcepath" , sourcepath . getAbsolutePath ( ) , "spacewar" , "coordination" } ; org . aspectj . tools . ajdoc . Main . main ( args ) ; assertTrue ( true ) ; } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } }

Fix:
File outdir = new File ( "testdata//spacewar//docdir" ) ;
Buggy code:
public class BGExecutorService implements Executor { protected static final Logger LOGGER = Logger . getLogger ( "octotron" ) ; private final String prefix ; private final ThreadPoolExecutor executor ; private long max_waiting = 0L ; public BGExecutorService ( String prefix , int core_pool_size , int maximum_pool_size , long keep_alive_ms , BlockingQueue < Runnable > queue , long max_waiting ) { } public BGExecutorService ( String prefix , long max_waiting ) { } public BGExecutorService ( String prefix , int threads , long max_waiting ) { } public final String GetName ( ) { } public void execute ( Runnable command ) { <START_BUG> if ( ( max_waiting ) > 0 ) { <END_BUG> BGExecutorService . LOGGER . log ( Level . INFO , ( ( prefix ) + "<seq2seq4repair_space>executor<seq2seq4repair_space>is<seq2seq4repair_space>full,<seq2seq4repair_space>blocking<seq2seq4repair_space>the<seq2seq4repair_space>calling<seq2seq4repair_space>thread" ) ) ; WaitQueueSize ( max_waiting ) ; } executor . execute ( command ) ; } public void SetMaxWaiting ( int max_waiting ) { } public final int GetWaitingCount ( ) { } public final long GetCompletedCount ( ) { } private long completed_last = 0 ; public final long GetRecentCompletedCount ( ) { } public void WaitAll ( ) { } public void WaitQueueSize ( long size ) { } public void Finish ( ) { } public void LockOnThread ( ) { } }

Fix:
if ( ( ( max_waiting ) > 0 ) && ( ( GetWaitingCount ( ) ) > ( max_waiting ) ) ) {
Buggy code:
public class Manager { private static final String LOCALE_SEPARATOR = "_" ; private static final Locale SYSTEM_LOCALE = Locale . getDefault ( ) ; private static final String SYSTEM_PLATFORM = SWT . getPlatform ( ) ; private static Manager instance ; public static Manager getInstance ( ) { } private static SortedMap buildPathMapForGestureConfigurationMap ( SortedMap gestureConfigurationMap ) { } private static SortedMap buildPathMapForKeyConfigurationMap ( SortedMap keyConfigurationMap ) { } private static SortedMap buildPathMapForScopeMap ( SortedMap scopeMap ) { } private static Path pathForGestureConfiguration ( String id , Map gestureConfigurationMap ) { } private static Path pathForKeyConfiguration ( String id , Map keyConfigurationMap ) { } static Path pathForLocale ( String locale ) { } static Path pathForPlatform ( String platform ) { } private static Path pathForScope ( String id , Map scopeMap ) { } static Path systemLocale ( ) { } static Path systemPlatform ( ) { } private Machine keyMachine ; private Manager ( ) { } public Machine getKeyMachine ( ) { } public String getTextForAction ( String command ) throws IllegalArgumentException { if ( command == null ) throw new IllegalArgumentException ( ) ; String text = null ; Map commandMap = getKeyMachine ( ) . getCommandMap ( ) ; SortedSet keySequenceSet = ( ( SortedSet ) ( commandMap . get ( command ) ) ) ; if ( ( keySequenceSet != null ) && ( ! ( keySequenceSet . isEmpty ( ) ) ) ) <START_BUG> text = ( ( KeySequence ) ( keySequenceSet . first ( ) ) ) . toString ( ) ; <END_BUG> return text != null ? text : "" ; } public void initializeConfigurations ( ) { } public void update ( ) { } }

Fix:
text = ( ( KeySequence ) ( keySequenceSet . first ( ) ) ) . formatKeySequence ( ) ;
Buggy code:
public abstract class FormComponent extends WebMarkupContainer { public interface IVisitor { public void formComponent ( FormComponent formComponent ) { } } private final class DisabledAttributeModel extends Model { private static final long serialVersionUID = 1L ; public Object getObject ( Component component ) { <START_BUG> return ( FormComponent . this . authorize ( ENABLE ) ) && ( FormComponent . this . isEnabled ( ) ) ? null : "disabled" ; <END_BUG> } } private static final class DisabledAttributeModifier extends AttributeModifier { private static final long serialVersionUID = 1L ; public DisabledAttributeModifier ( FormComponent . DisabledAttributeModel model ) { } } protected static final short FLAG_CONVERT_EMPTY_INPUT_STRING_TO_NULL = FLAG_RESERVED1 ; private static final short FLAG_PERSISTENT = FLAG_RESERVED2 ; private static final String NO_RAW_INPUT = "[-NO-RAW-INPUT-]" ; private String rawInput = FormComponent . NO_RAW_INPUT ; private Object validators = null ; private IModel labelModel = null ; public FormComponent ( final String id ) { } public FormComponent ( final String id , IModel model ) { } public final FormComponent add ( final IValidator validator ) { } public final Form getForm ( ) { } public FormComponent setLabel ( final IModel labelModel ) { } public IModel getLabel ( ) { } public String getInput ( ) { } public String getInputName ( ) { } public final Class getValidationType ( ) { } public final List getValidators ( ) { } public final String getValue ( ) { } public final void invalid ( ) { } public boolean isMultiPart ( ) { } public final boolean isPersistent ( ) { } public final boolean isValid ( ) { } public final boolean isValidated ( ) { } public void setModelValue ( final String value ) { } public final void setPersistent ( final boolean persistent ) { } public abstract void updateModel ( ) { } public final void valid ( ) { } final void clearInput ( ) { } public final void validate ( ) { } protected String getModelValue ( ) { } protected final int inputAsInt ( ) { } protected final int inputAsInt ( final int defaultValue ) { } protected final int [ ] inputAsIntArray ( ) { } protected final String [ ] inputAsStringArray ( ) { } protected void onComponentTag ( final ComponentTag tag ) { } protected void onInvalid ( ) { } protected void onModelChanged ( ) { } protected void onValid ( ) { } protected boolean supportsPersistence ( ) { } private void validators_add ( final IValidator validator ) { } private IValidator validators_get ( int index ) { } private int validators_size ( ) { } public final void registerNewUserInput ( ) { } private String getUserInput ( ) { } }

Fix:
return ( FormComponent . this . isActionAuthorized ( ENABLE ) ) && ( FormComponent . this . isEnabled ( ) ) ? null : "disabled" ;
Buggy code:
public class Jikes extends DefaultCompilerAdapter { public boolean execute ( ) throws BuildException { attributes . log ( "Using<seq2seq4repair_space>jikes<seq2seq4repair_space>compiler" , MSG_VERBOSE ) ; Path classpath = new Path ( project ) ; if ( ( bootclasspath ) != null ) { classpath . append ( bootclasspath ) ; } <START_BUG> addExtdirsToClasspath ( classpath ) ; <END_BUG> if ( ( ( bootclasspath ) == null ) || ( ( bootclasspath . size ( ) ) == 0 ) ) { includeJavaRuntime = true ; } else { } classpath . append ( getCompileClasspath ( ) ) ; classpath . append ( src ) ; String jikesPath = System . getProperty ( "jikes.class.path" ) ; if ( jikesPath != null ) { classpath . append ( new Path ( project , jikesPath ) ) ; } Commandline cmd = new Commandline ( ) ; cmd . setExecutable ( "jikes" ) ; if ( ( deprecation ) == true ) cmd . createArgument ( ) . setValue ( "-deprecation" ) ; if ( ( destDir ) != null ) { cmd . createArgument ( ) . setValue ( "-d" ) ; cmd . createArgument ( ) . setFile ( destDir ) ; } cmd . createArgument ( ) . setValue ( "-classpath" ) ; cmd . createArgument ( ) . setPath ( classpath ) ; if ( ( encoding ) != null ) { cmd . createArgument ( ) . setValue ( "-encoding" ) ; cmd . createArgument ( ) . setValue ( encoding ) ; } if ( debug ) { cmd . createArgument ( ) . setValue ( "-g" ) ; } if ( optimize ) { cmd . createArgument ( ) . setValue ( "-O" ) ; } if ( verbose ) { cmd . createArgument ( ) . setValue ( "-verbose" ) ; } if ( depend ) { cmd . createArgument ( ) . setValue ( "-depend" ) ; } String emacsProperty = project . getProperty ( "build.compiler.emacs" ) ; if ( ( emacsProperty != null ) && ( Project . toBoolean ( emacsProperty ) ) ) { cmd . createArgument ( ) . setValue ( "+E" ) ; } String warningsProperty = project . getProperty ( "build.compiler.warnings" ) ; if ( warningsProperty != null ) { attributes . log ( "!!<seq2seq4repair_space>the<seq2seq4repair_space>build.compiler.warnings<seq2seq4repair_space>property<seq2seq4repair_space>is<seq2seq4repair_space>deprecated.<seq2seq4repair_space>!!" , MSG_WARN ) ; attributes . log ( "!!<seq2seq4repair_space>Use<seq2seq4repair_space>the<seq2seq4repair_space>nowarn<seq2seq4repair_space>attribute<seq2seq4repair_space>instead.<seq2seq4repair_space>!!" , MSG_WARN ) ; if ( ! ( Project . toBoolean ( warningsProperty ) ) ) { cmd . createArgument ( ) . setValue ( "-nowarn" ) ; } } if ( attributes . getNowarn ( ) ) { cmd . createArgument ( ) . setValue ( "-nowarn" ) ; } String pedanticProperty = project . getProperty ( "build.compiler.pedantic" ) ; if ( ( pedanticProperty != null ) && ( Project . toBoolean ( pedanticProperty ) ) ) { cmd . createArgument ( ) . setValue ( "+P" ) ; } String fullDependProperty = project . getProperty ( "build.compiler.fulldepend" ) ; if ( ( fullDependProperty != null ) && ( Project . toBoolean ( fullDependProperty ) ) ) { cmd . createArgument ( ) . setValue ( "+F" ) ; } addCurrentCompilerArgs ( cmd ) ; int firstFileName = cmd . size ( ) ; logAndAddFilesToCompile ( cmd ) ; return ( executeExternalCompile ( cmd . getCommandline ( ) , firstFileName ) ) == 0 ; } }

Fix:
classpath . addExtdirs ( extdirs ) ;
Buggy code:
public class LineStyleTab extends GraphicsTab { Button colorButton ; GraphicsBackground lineColor ; Menu menu ; Spinner lineWidthSpinner ; public LineStyleTab ( GraphicsExample example ) { } public String getCategory ( ) { } public String getText ( ) { } public String getDescription ( ) { } public void dispose ( ) { } public void createControlPanel ( Composite parent ) { Composite comp ; comp = new Composite ( parent , SWT . NONE ) ; comp . setLayout ( new GridLayout ( 2 , false ) ) ; new Label ( comp , SWT . CENTER ) . setText ( GraphicsExample . getResourceString ( "LineWidth" ) ) ; lineWidthSpinner = new Spinner ( comp , ( ( SWT . BORDER ) | ( SWT . WRAP ) ) ) ; lineWidthSpinner . setSelection ( 10 ) ; lineWidthSpinner . setMinimum ( 1 ) ; lineWidthSpinner . setMaximum ( 30 ) ; lineWidthSpinner . addListener ( Selection , new Listener ( ) { public void handleEvent ( Event event ) { example . redraw ( ) ; } } ) ; ColorMenu cm = new ColorMenu ( ) ; <START_BUG> cm . setPatternItems ( true ) ; <END_BUG> menu = cm . createMenu ( parent . getParent ( ) , new ColorListener ( ) { public void setColor ( GraphicsBackground gb ) { lineColor = gb ; colorButton . setImage ( gb . getThumbNail ( ) ) ; example . redraw ( ) ; } } ) ; comp = new Composite ( parent , SWT . NONE ) ; comp . setLayout ( new GridLayout ( ) ) ; lineColor = ( ( GraphicsBackground ) ( menu . getItem ( 4 ) . getData ( ) ) ) ; colorButton = new Button ( comp , SWT . PUSH ) ; colorButton . setText ( GraphicsExample . getResourceString ( "Color" ) ) ; colorButton . setImage ( lineColor . getThumbNail ( ) ) ; colorButton . addListener ( Selection , new Listener ( ) { public void handleEvent ( Event event ) { final Button button = ( ( Button ) ( event . widget ) ) ; final Composite parent = button . getParent ( ) ; Rectangle bounds = button . getBounds ( ) ; Point point = parent . toDisplay ( new Point ( bounds . x , bounds . y ) ) ; menu . setLocation ( point . x , ( ( point . y ) + ( bounds . height ) ) ) ; menu . setVisible ( true ) ; } } ) ; } public void paint ( GC gc , int width , int height ) { } static String getPlatformFont ( ) { } }

Fix:
cm . setPatternItems ( example . checkAdvancedGraphics ( ) ) ;
Buggy code:
public class MarkupInheritanceTest extends WicketTestCase { private static Log log = LogFactory . getLog ( MarkupInheritanceTest . class ) ; public MarkupInheritanceTest ( String name ) { } public void testRenderHomePage_1 ( ) throws Exception { } public void testRenderHomePage_2 ( ) throws Exception { } public void testRenderHomePage_3 ( ) throws Exception { } public void testRenderHomePage_4 ( ) throws Exception { } public void testRenderHomePage_5 ( ) throws Exception { } public void testRenderHomePage_6 ( ) throws Exception { } public void testRenderHomePage_7 ( ) throws Exception { } public void testRenderHomePage_8 ( ) throws Exception { <START_BUG> application . getSettings ( ) . setStripWicketTags ( true ) ; <END_BUG> executeTest ( MarkupInheritanceExtension_8 . class , "MarkupInheritanceExpectedResult_8.html" ) ; } public void testRenderHomePage_9 ( ) throws Exception { } }

Fix:
application . getMarkupSettings ( ) . setStripWicketTags ( true ) ;