nus-yam/ex-repair huggingface dataset:
Buggy code:
public class QueryExecuter { public static Connection getConnection ( ) { } Connection conn ; PreparedStatement pstmt ; ResultSet rs ; public QueryExecuter ( ) { } public List < Object > executeQuries ( Query ... sqls ) { } public Object execute ( Query sql ) { } public void close ( ) { } public int insertIfExistUpdate ( Object ... record ) { } public int insertIfNotExist ( Object ... records ) { } public int insert ( Object ... records ) { } public int update ( Object ... records ) { } public int delete ( Object ... records ) { } public boolean delete ( Class < ? > cLass , String WhereClause , Object ... parameters ) { <START_BUG> ExecuteQuery exe = new ExecuteQuery ( ( "delete<seq2seq4repair_space>from<seq2seq4repair_space>" + ( cLass . getAnnotation ( Table . class ) . value ( ) ) ) , null ) ; <END_BUG> for ( int i = 0 ; i < ( parameters . length ) ; i ++ ) { exe . addParameters ( parameters [ i ] ) ; } return ( ( boolean ) ( execute ( exe ) ) ) ; } @ SuppressWarnings ( "unchecked" ) public Object insertAndGetPrimaryKey ( Object record ) { } @ SuppressWarnings ( "unchecked" ) public < T > List < T > getList ( Class < T > cLass ) { } @ SuppressWarnings ( "unchecked" ) public < T > List < T > getList ( Class < T > cLass , String condition , Object ... parameters ) { } @ SuppressWarnings ( "unchecked" ) public < T > T get ( Class < T > cLass , Object ... primaryKey ) { } @ SuppressWarnings ( "unchecked" ) public < T > T get ( Class < T > cLass , String WhereClause , Object ... keys ) { } private static String setterString ( String fieldName ) { } }

Fix:
ExecuteQuery exe = new ExecuteQuery ( ( ( ( "delete<seq2seq4repair_space>from<seq2seq4repair_space>" + ( cLass . getAnnotation ( Table . class ) . value ( ) ) ) + "<seq2seq4repair_space>where<seq2seq4repair_space>" ) + WhereClause ) , null ) ;
Buggy code:
public class GameScreen implements Screen { Stage stage ; private int timer ; boolean wasTouched ; boolean isTouched ; List < Letter > letters ; List < Letter > lastWord ; int score ; Texture black = new Texture ( "black_dot.png" ) ; Group top ; Group middle ; Group back ; @ Override public void show ( ) { } @ Override public void render ( float delta ) { wasTouched = isTouched ; isTouched = input . isTouched ( ) ; if ( ( isTouched ) && ( ! ( wasTouched ) ) ) { WordBuilder . start ( ) ; } else if ( ( ! ( isTouched ) ) && ( wasTouched ) ) { int ts = WordBuilder . stop ( ) ; if ( ts > 0 ) { lastWord = new ArrayList < Letter > ( ) ; for ( Letter l : letters ) { lastWord . add ( l ) ; l . remove ( ) ; } } else { for ( Letter l : letters ) l . activate ( ) ; } letters . clear ( ) ; } if ( isTouched ) { Vector2 tc = stage . screenToStageCoordinates ( new Vector2 ( input . getX ( ) , input . getY ( ) ) ) ; float x = tc . x ; float y = tc . y ; Letter A = ( ( Letter ) ( stage . hit ( x , y , true ) ) ) ; if ( A != null ) { if ( A . isActive ( ) ) { A . deactivate ( ) ; WordBuilder . add ( A ) ; letters . add ( A ) ; } } } if ( ( ( timer ) % 20 ) == 9 ) { Letter L = new Letter ( ( ( int ) ( ( Math . random ( ) ) * 26 ) ) , ( ( int ) ( ( Math . random ( ) ) * ( GdxGame . WIDTH ) ) ) , ( ( int ) ( ( GdxGame . HEIGHT ) + ( 100 * ( GdxGame . H_RATIO ) ) ) ) ) ; L . setZIndex ( 0 ) ; middle . addActor ( L ) ; } int length = lastWord . size ( ) ; if ( ( length > 0 ) && ( length < 10 ) ) { <START_BUG> float lspacer = ( Letter . SIZE ) // 20.0F ; <END_BUG> float spacer = ( ( Letter . SIZE ) * ( 9 - length ) ) // 2.0F ; int space = ( GdxGame . REN_WIDTH ) // 9 ; int count = 0 ; for ( Letter l : lastWord ) { float x = ( ( int ) ( ( spacer + ( count * space ) ) + lspacer ) ) ; float y = lspacer ; top . addActor ( new Letter ( l . getLetterVal ( ) , x , y ) ) ; System . out . print ( l ) ; System . out . println ( ( ( x + "<seq2seq4repair_space>" ) + y ) ) ; count ++ ; } } stage . act ( ) ; gl20 . glClearColor ( 0 , 0 , 0 , 1 ) ; gl . glClear ( GL_COLOR_BUFFER_BIT ) ; stage . draw ( ) ; wasTouched = isTouched ; isTouched = input . isTouched ( ) ; ( timer ) ++ ; } @ Override public void resize ( int width , int height ) { } @ Override public void pause ( ) { } @ Override public void resume ( ) { } @ Override public void hide ( ) { } @ Override public void dispose ( ) { } }

Fix:
float lspacer = ( Letter . SIZE ) // 16.0F ;
Buggy code:
public class TestBufferedIndexInput extends LuceneTestCase { private static void writeBytes ( File aFile , long size ) throws IOException { } private static final long TEST_FILE_LENGTH = 100 * 1024 ; public void testReadByte ( ) throws Exception { } public void testReadBytes ( ) throws Exception { TestBufferedIndexInput . MyBufferedIndexInput input = new TestBufferedIndexInput . MyBufferedIndexInput ( ) ; runReadBytes ( input , BUFFER_SIZE , random ) ; final int inputBufferSize = 128 ; <START_BUG> File tmpInputFile = File . createTempFile ( "IndexInput" , "tmpFile" ) ; <END_BUG> tmpInputFile . deleteOnExit ( ) ; TestBufferedIndexInput . writeBytes ( tmpInputFile , TestBufferedIndexInput . TEST_FILE_LENGTH ) ; runReadBytesAndClose ( new SimpleFSIndexInput ( tmpInputFile , inputBufferSize , 10 ) , inputBufferSize , random ) ; runReadBytesAndClose ( new NIOFSIndexInput ( tmpInputFile , inputBufferSize , 10 ) , inputBufferSize , random ) ; } private void runReadBytesAndClose ( IndexInput input , int bufferSize , Random r ) throws IOException { } private void runReadBytes ( IndexInput input , int bufferSize , Random r ) throws IOException { } private byte [ ] buffer = new byte [ 10 ] ; private void checkReadBytes ( IndexInput input , int size , int pos ) throws IOException { } public void testEOF ( ) throws Exception { } private static byte byten ( long n ) { } private static class MyBufferedIndexInput extends BufferedIndexInput { private long pos ; private long len ; public MyBufferedIndexInput ( long len ) { } public MyBufferedIndexInput ( ) { } @ Override protected void readInternal ( byte [ ] b , int offset , int length ) throws IOException { } @ Override protected void seekInternal ( long pos ) throws IOException { } @ Override public void close ( ) throws IOException { } @ Override public long length ( ) { } } public void testSetBufferSize ( ) throws IOException { } private static class MockFSDirectory extends Directory { List < IndexInput > allIndexInputs = new ArrayList < IndexInput > ( ) ; Random rand ; private Directory dir ; public MockFSDirectory ( File path , Random rand ) throws IOException { } @ Override public IndexInput openInput ( String name ) throws IOException { } public void tweakBufferSizes ( ) { } @ Override public IndexInput openInput ( String name , int bufferSize ) throws IOException { } @ Override public IndexOutput createOutput ( String name ) throws IOException { } @ Override public void close ( ) throws IOException { } @ Override public void deleteFile ( String name ) throws IOException { } @ Override public long fileModified ( String name ) throws IOException { } @ Override public boolean fileExists ( String name ) throws IOException { } @ Override public String [ ] listAll ( ) throws IOException { } @ Override public void sync ( Collection < String > names ) throws IOException { } @ Override public long fileLength ( String name ) throws IOException { } } }

Fix:
File tmpInputFile = _TestUtil . createTempFile ( "IndexInput" , "tmpFile" , TEMP_DIR ) ;
Buggy code:
public class ConditionTask extends ConditionBase { private String value = "true" ; private String property ; public void setProperty ( String p ) { } public void setValue ( String v ) { } public void execute ( ) throws TaskException { if ( ( countConditions ( ) ) > 1 ) { throw new TaskException ( "You<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>nest<seq2seq4repair_space>more<seq2seq4repair_space>than<seq2seq4repair_space>one<seq2seq4repair_space>condition<seq2seq4repair_space>into<seq2seq4repair_space><condition>" ) ; } if ( ( countConditions ( ) ) < 1 ) { throw new TaskException ( "You<seq2seq4repair_space>must<seq2seq4repair_space>nest<seq2seq4repair_space>a<seq2seq4repair_space>condition<seq2seq4repair_space>into<seq2seq4repair_space><condition>" ) ; } Condition c = ( ( Condition ) ( getConditions ( ) . nextElement ( ) ) ) ; if ( c . eval ( ) ) { <START_BUG> getProject ( ) . setNewProperty ( property , value ) ; <END_BUG> } } }

Fix:
setProperty ( property , value ) ;
Buggy code:
public final class MarkupParserTest extends WicketTestCase { private static final Log log = LogFactory . getLog ( MarkupParserTest . class ) ; public MarkupParserTest ( String name ) { } private MarkupFragment parse ( final String namespace , final String markup ) throws IOException , ResourceStreamNotFoundException { } private MarkupFragment parse ( final String markup ) throws IOException , ResourceStreamNotFoundException { } private MarkupResourceStream newMarkupResourceStream ( final IResourceStreamLocator locator , final Class c , final String style , final Locale locale , final String extension ) { } private MarkupFragment parse ( final MarkupResourceStream resource ) throws IOException , ResourceStreamNotFoundException { } public final void testTagParsing ( ) throws Exception { } public final void testTagParsingFragments ( ) throws Exception { } public final void test ( ) throws Exception { } public final void testXhtmlDocument ( ) throws Exception { } public final void testFileDocument ( ) throws IOException , ParseException , ResourceStreamNotFoundException { } public final void testWicketTag ( ) throws IOException , ParseException , ResourceStreamNotFoundException { } public final void testDefaultWicketTag ( ) throws IOException , ParseException , ResourceStreamNotFoundException { } public final void testScript ( ) throws IOException , ParseException , ResourceStreamNotFoundException { } public final void testCDATA ( ) throws IOException , ParseException , ResourceStreamNotFoundException { } public final void testBalancing ( ) throws IOException , ResourceStreamNotFoundException { MarkupFragment markup = parse ( "<span<seq2seq4repair_space>wicket:id=\"span\"><img<seq2seq4repair_space>wicket:id=\"img\"><span<seq2seq4repair_space>wicket:id=\"span2\"><//span><//span>" ) ; <START_BUG> ComponentTag t = markup . getTag ( 0 ) ; <END_BUG> assertEquals ( t . getId ( ) , "span" ) ; assertNotNull ( markup . getChildFragment ( "span" , false ) ) ; MarkupFragment fragment = ( ( MarkupFragment ) ( markup . get ( 1 ) ) ) ; assertEquals ( fragment . getId ( ) , "img" ) ; assertNotNull ( markup . getChildFragment ( "span:img" , false ) ) ; fragment = ( ( MarkupFragment ) ( markup . get ( 2 ) ) ) ; assertEquals ( fragment . getId ( ) , "span2" ) ; assertNotNull ( markup . getChildFragment ( "span:span2" , false ) ) ; } }

Fix:
ComponentTag t = markup . getTag ( ) ;
Buggy code:
public final class CubeShader extends Shader { interface Resources extends DefaultResources { CubeShader . Resources INSTANCE = GWT . create ( CubeShader . Resources . class ) ; @ Source ( "source//cube.vs" ) TextResource getVertexShader ( ) { } @ Source ( "source//cube.fs" ) TextResource getFragmentShader ( ) { } } public CubeShader ( ) { } @ Override protected void initUniforms ( ) { } @ Override protected void updateVertexSource ( String src ) { List < String > vars = Arrays . asList ( LOGDEPTHBUF_PAR ) ; List < String > main = Arrays . asList ( LOGDEPTHBUF ) ; <START_BUG> super . updateFragmentSource ( Shader . updateShaderSource ( src , vars , main ) ) ; <END_BUG> } @ Override protected void updateFragmentSource ( String src ) { } }

Fix:
super . updateVertexSource ( Shader . updateShaderSource ( src , vars , main ) ) ;
Buggy code:
public class UserMapManager implements UserManager { private static Map < String , User > userMap ; private static User currentUser ; public UserMapManager ( ) { } public boolean isInSystem ( String u ) { } public boolean handleLogInRequest ( String id , String password ) { User u = UserMapManager . userMap . get ( id ) ; <START_BUG> if ( ( ( ( UserMapManager . currentUser ) == null ) && ( u != null ) ) && ( u . logIn ( password ) ) ) { <END_BUG> UserMapManager . currentUser = u ; return true ; } return false ; } public User lastLogIn ( ) { } public boolean isAdmin ( User u ) { } public void addUser ( User u ) { } public User searchUser ( String s ) { } public User getCurrentUser ( ) { } }

Fix:
if ( ( u != null ) && ( u . logIn ( password ) ) ) {
Buggy code:
public class RunTCaseClient extends IIComponent { public synchronized void manageEvent ( Event_ event_ ) throws IllegalArgumentException { if ( event_ instanceof RunCTCRequested ) { RunCTCRequested runRequest = ( ( RunCTCRequested ) ( event_ ) ) ; ConcreteTCase concreteTCase = runRequest . getConcreteTCase ( ) ; <START_BUG> String workingDirectory = runRequest . getCompilationInfo ( ) . getWorkingDirectory ( ) ; <END_BUG> new Thread ( new RunTCaseClientRunner ( concreteTCase , workingDirectory ) ) . start ( ) ; } else throw new IllegalArgumentException ( ) ; } }

Fix:
String workingDirectory = runRequest . getWorkingDirectory ( ) ;
Buggy code:
public class AddList extends Activity { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_add_list ) ; final Button createListButton = ( ( Button ) ( findViewById ( createListButton ) ) ) ; createListButton . setOnClickListener ( new View . OnClickListener ( ) { public void onClick ( View v ) { final EditText name = ( ( EditText ) ( findViewById ( listName ) ) ) ; final EditText groupName = ( ( EditText ) ( findViewById ( groupName ) ) ) ; String [ ] argsGroup = new String [ ] { "name" , groupName . getText ( ) . toString ( ) } ; List < Integer > groupsChosen = new ArrayList < > ( ) ; <START_BUG> if ( ( ( groupsChosen != null ) && ( ( groupsChosen . size ( ) ) == 0 ) ) && ( ( groupsChosen . get ( 0 ) ) != ( - 1 ) ) ) { <END_BUG> groupsChosen = MainActivity . get ( "Group" , argsGroup ) ; String [ ] args = new String [ ] { name . getText ( ) . toString ( ) , groupName . getText ( ) . toString ( ) , "0" } ; MainActivity . doCreate ( "List" , args ) ; closeActivity ( ) ; } else { Toast . makeText ( getApplicationContext ( ) , "This<seq2seq4repair_space>group<seq2seq4repair_space>doesn't<seq2seq4repair_space>exist<seq2seq4repair_space>yet" , LENGTH_SHORT ) . show ( ) ; } } } ) ; } private void closeActivity ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
if ( ( ( groupsChosen != null ) && ( ( groupsChosen . size ( ) ) != 0 ) ) && ( ( groupsChosen . get ( 0 ) ) != ( - 1 ) ) ) {
Buggy code:
public class ExtendedBeanInfoFactory implements BeanInfoFactory , Ordered { public BeanInfo getBeanInfo ( Class < ? > beanClass ) throws IntrospectionException { } private boolean supports ( Class < ? > beanClass ) { for ( Method method : beanClass . getMethods ( ) ) { <START_BUG> if ( ExtendedBeanInfo . isNonVoidWriteMethod ( method ) ) { <END_BUG> return true ; } } return false ; } public int getOrder ( ) { } }

Fix:
if ( ExtendedBeanInfo . isCandidateWriteMethod ( method ) ) {
Buggy code:
public class RegistryFactoryServiceInstaller implements CacheServiceInstaller { private final Logger logger = Logger . getLogger ( this . getClass ( ) ) ; private final CacheServiceBuilder < RegistryFactory < Object , Object > > builder ; protected RegistryFactoryServiceInstaller ( CacheServiceBuilder < RegistryFactory < Object , Object > > builder ) { } private static BindInfo createBinding ( String container , String cache ) { } @ Override public Collection < ServiceName > getServiceNames ( String container , String cache ) { } @ Override public void install ( ServiceTarget target , String container , String cache ) { ServiceName name = REGISTRY_FACTORY . getServiceName ( container , cache ) ; ContextNames . BindInfo bindInfo = RegistryFactoryServiceInstaller . createBinding ( container , cache ) ; this . logger . debugf ( "Installing<seq2seq4repair_space>%s<seq2seq4repair_space>service,<seq2seq4repair_space>bound<seq2seq4repair_space>to<seq2seq4repair_space>" , name . getCanonicalName ( ) , bindInfo . getAbsoluteJndiName ( ) ) ; this . builder . build ( target , name , container , cache ) . setInitialMode ( ServiceController . Mode . ON_DEMAND ) . install ( ) ; RegistryService . build ( target , container , cache ) . setInitialMode ( ServiceController . Mode . ON_DEMAND ) . install ( ) ; <START_BUG> new org . jboss . as . clustering . naming . BinderServiceBuilder ( target ) . build ( bindInfo , name , RegistryFactory . class ) . install ( ) ; <END_BUG> } }

Fix:
new org . jboss . as . clustering . naming . BinderServiceBuilder ( bindInfo , name , RegistryFactory . class ) . build ( target ) . install ( ) ;
Buggy code:
public class AccessForInlineVisitor extends ASTVisitor { PrivilegedHandler handler ; AspectDeclaration inAspect ; EclipseFactory world ; public boolean isInlinable = true ; public AccessForInlineVisitor ( AspectDeclaration inAspect , PrivilegedHandler handler ) { } public void endVisit ( SingleNameReference ref , BlockScope scope ) { } public void endVisit ( QualifiedNameReference ref , BlockScope scope ) { } public void endVisit ( FieldReference ref , BlockScope scope ) { } public void endVisit ( MessageSend send , BlockScope scope ) { } public void endVisit ( AllocationExpression send , BlockScope scope ) { } public void endVisit ( QualifiedTypeReference ref , BlockScope scope ) { } public void endVisit ( SingleTypeReference ref , BlockScope scope ) { } private FieldBinding getAccessibleField ( FieldBinding binding , TypeBinding receiverType ) { <START_BUG> if ( ! ( binding . isValidBinding ( ) ) ) <END_BUG> return binding ; makePublic ( receiverType ) ; if ( isPublic ( binding ) ) return binding ; if ( binding instanceof PrivilegedFieldBinding ) return binding ; if ( binding instanceof InterTypeFieldBinding ) return binding ; if ( ( binding . isPrivate ( ) ) && ( ( binding . declaringClass ) != ( inAspect . binding ) ) ) { binding . modifiers = AstUtil . makePackageVisible ( binding . modifiers ) ; } ResolvedMember m = world . makeResolvedMember ( binding , receiverType ) ; if ( inAspect . accessForInline . containsKey ( m ) ) return ( ( FieldBinding ) ( inAspect . accessForInline . get ( m ) ) ) ; FieldBinding ret = new org . aspectj . ajdt . internal . compiler . lookup . InlineAccessFieldBinding ( inAspect , binding , m ) ; inAspect . accessForInline . put ( m , ret ) ; return ret ; } private MethodBinding getAccessibleMethod ( MethodBinding binding , TypeBinding receiverType ) { } static class SuperAccessMethodPair { public ResolvedMember originalMethod ; public MethodBinding accessMethod ; public SuperAccessMethodPair ( ResolvedMember originalMethod , MethodBinding accessMethod ) { } } private MethodBinding getSuperAccessMethod ( MethodBinding binding ) { } private boolean isPublic ( FieldBinding fieldBinding ) { } private boolean isPublic ( MethodBinding methodBinding ) { } private void makePublic ( TypeBinding binding ) { } public void endVisit ( AssertStatement assertStatement , BlockScope scope ) { } public void endVisit ( ClassLiteralAccess classLiteral , BlockScope scope ) { } public boolean visit ( TypeDeclaration localTypeDeclaration , BlockScope scope ) { } }

Fix:
if ( ( binding == null ) || ( ! ( binding . isValidBinding ( ) ) ) )
Buggy code:
public class SetClasspathOperation extends JavaModelOperation { IClasspathEntry [ ] oldResolvedPath ; IClasspathEntry [ ] newResolvedPath ; IClasspathEntry [ ] newRawPath ; boolean canChangeResources ; boolean classpathWasSaved ; boolean needCycleCheck ; boolean needValidation ; boolean needSave ; IPath newOutputLocation ; JavaProject project ; boolean identicalRoots ; public static final IClasspathEntry [ ] DO_NOT_SET_ENTRIES = new IClasspathEntry [ 0 ] ; public static final IClasspathEntry [ ] DO_NOT_UPDATE_PROJECT_REFS = new IClasspathEntry [ 0 ] ; public static final IPath DO_NOT_SET_OUTPUT = new Path ( "Reuse<seq2seq4repair_space>Existing<seq2seq4repair_space>Output<seq2seq4repair_space>Location" ) ; public SetClasspathOperation ( JavaProject project , IClasspathEntry [ ] oldResolvedPath , IClasspathEntry [ ] newRawPath , IPath newOutputLocation , boolean canChangeResource , boolean needValidation , boolean needSave ) { } protected void addClasspathDeltas ( IPackageFragmentRoot [ ] roots , int flag , JavaElementDelta delta ) { } protected boolean canModifyRoots ( ) { } protected int classpathContains ( IClasspathEntry [ ] list , IClasspathEntry entry ) { } protected void collectAllSubfolders ( IFolder folder , ArrayList collection ) throws JavaModelException { } protected ArrayList determineAffectedPackageFragments ( IPath location ) throws JavaModelException { } protected void executeOperation ( ) throws JavaModelException { } protected void generateClasspathChangeDeltas ( ) { } protected ISchedulingRule getSchedulingRule ( ) { } private int getSourceAttachmentDeltaFlag ( IPath oldPath , IPath newPath ) { } public boolean isReadOnly ( ) { } protected void saveClasspathIfNecessary ( ) throws JavaModelException { } public String toString ( ) { } private void updateClasspath ( ) throws JavaModelException { } protected void updateAffectedProjects ( IPath prerequisiteProjectPath ) { } protected void updateCycleMarkersIfNecessary ( ) { } protected void updateOutputLocation ( ) throws JavaModelException { } protected void updateProjectReferencesIfNecessary ( ) throws JavaModelException { if ( ( ( this . newRawPath ) == ( SetClasspathOperation . DO_NOT_SET_ENTRIES ) ) || ( ( this . newRawPath ) == ( SetClasspathOperation . DO_NOT_UPDATE_PROJECT_REFS ) ) ) return ; <START_BUG> JavaModelManager . getJavaModelManager ( ) . deltaState . performClasspathResourceChange ( project , oldResolvedPath , newResolvedPath , newRawPath , canChangeResources ) ; <END_BUG> } public IJavaModelStatus verify ( ) { } }

Fix:
JavaModelManager . getJavaModelManager ( ) . deltaState . updateProjectReferences ( project , oldResolvedPath , newResolvedPath , newRawPath , canChangeResources ) ;
Buggy code:
@ ApplicationScoped public class WarCdiFactory { private static JestClient sESClient ; private static EsStorage sESStorage ; @ Produces @ ApimanLogger public static IApimanLogger provideLogger ( WarApiManagerConfig config , InjectionPoint injectionPoint ) { } @ Produces @ ApplicationScoped public static ISecurityContext provideSecurityContext ( WarApiManagerConfig config , @ New DefaultSecurityContext defaultSC , @ New KeycloakSecurityContext keycloakSC ) { } @ Produces @ ApplicationScoped public static IStorage provideStorage ( WarApiManagerConfig config , @ New JpaStorage jpaStorage , @ New EsStorage esStorage ) { IStorage storage = null ; if ( "jpa" . equals ( config . getStorageType ( ) ) ) { storage = jpaStorage ; } else if ( "es" . equals ( config . getStorageType ( ) ) ) { storage = WarCdiFactory . initES ( config , esStorage ) ; } else { throw new RuntimeException ( ( "Unknown<seq2seq4repair_space>storage<seq2seq4repair_space>type:<seq2seq4repair_space>" + ( config . getStorageType ( ) ) ) ) ; } <START_BUG> return new SecureStorageWrapper ( config , storage ) ; <END_BUG> } @ Produces @ ApplicationScoped public static IStorageQuery provideStorageQuery ( WarApiManagerConfig config , @ New JpaStorage jpaStorage , @ New EsStorage esStorage ) { } @ Produces @ ApplicationScoped public static IApiKeyGenerator provideApiKeyGenerator ( @ New UuidApiKeyGenerator uuidApiKeyGen ) { } @ Produces @ ApplicationScoped public static IIdmStorage provideIdmStorage ( WarApiManagerConfig config , @ New JpaIdmStorage jpaIdmStorage , @ New EsStorage esStorage ) { } @ Produces @ ApplicationScoped public static JestClient provideTransportClient ( WarApiManagerConfig config ) { } private static JestClient createJestClient ( WarApiManagerConfig config ) { } private static EsStorage initES ( WarApiManagerConfig config , EsStorage esStorage ) { } private static Class < ? extends IApimanDelegateLogger > getDelegate ( WarApiManagerConfig config ) { } @ SuppressWarnings ( "unchecked" ) private static Class < ? extends IApimanDelegateLogger > loadByFQDN ( String fqdn ) { } }

Fix:
return storage ;
Buggy code:
public class GuiScreenBackupManager extends GuiScreen { int imageTextLines = 0 ; public GuiScreenBackupManager ( String title , net . minecraft . client . gui . GuiScreen previousScreen ) { } @ Override public void initGui ( ) { } @ Override public void drawScreen ( int mouseX , int mouseY , float partialTicks ) { } @ Override public void guiClicked ( String identifier , IGui gui , int mouseX , int mouseY , int mouseButton ) { } public class GuiBackupList implements IGui , IMouseListener { int x ; int y ; int width ; int height ; List < GuiScreenBackupManager . GuiBackupEntry > backupEntries ; int scrollHeight = 0 ; int listHeight = 0 ; int lastEntryHeight ; public GuiBackupList ( int x , int y , int width , int height , BackupManager manager ) { } @ Override public void draw ( Minecraft minecraft , int mouseX , int mouseY ) { } private void drawScrollBar ( ) { } private int getMaxScrollHeight ( ) { <START_BUG> return ( ( listHeight ) - ( height ) ) + ( this . lastEntryHeight ) ; <END_BUG> } @ Override public void handleMouseWheel ( int mouseX , int mouseY , int dWheelRaw ) { } public void addScroll ( int amount ) { } public void updateList ( BackupManager manager ) { } @ Override public void update ( ) { } @ Override public boolean mouseDown ( int mouseX , int mouseY , int mouseButton ) { } @ Override public void mouseUp ( int mouseX , int mouseY , int mouseButton ) { } @ Override public void mouseClickMove ( int mouseX , int mouseY , int mouseButton , long timeSinceClick ) { } @ Override public void handleKeyTyped ( int keyCode , char character ) { } } public class GuiBackupEntry { GuiSimpleButton restoreButton ; String name ; String date ; String cause ; int backupID ; int height = 0 ; public GuiBackupEntry ( BackupEntry entry ) { } public int draw ( Minecraft minecraft , int mouseX , int mouseY , int xPosition , int yPosition , int width ) { } public void update ( ) { } public boolean mouseDown ( int mouseX , int mouseY , int mouseButton ) { } } }

Fix:
return ( ( ( listHeight ) - ( height ) ) + ( this . lastEntryHeight ) ) + 9 ;
Buggy code:
@ Service public class CountServiceImpl implements CountService { RestTemplate restTemplate = new RestTemplate ( ) ; @ Override public CountPojo getCountViaApiCall ( ) { <START_BUG> CountPojo countPojo = restTemplate . getForObject ( "http:////localhost:8081//countPojo" , CountPojo . class ) ; <END_BUG> return countPojo ; } }

Fix:
CountPojo countPojo = restTemplate . getForObject ( "http:////localhost:8081//count" , CountPojo . class ) ;
Buggy code:
public class CacheContainerRemove extends AbstractRemoveStepHandler { public static final CacheContainerRemove INSTANCE = new CacheContainerRemove ( ) ; @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } private static void reinstallExistingCacheServices ( OperationContext context , ModelNode containerModel , String containerName , ServiceVerificationHandler verificationHandler ) throws OperationFailedException { } private static void removeExistingCacheServices ( OperationContext context , ModelNode containerModel , String containerName ) throws OperationFailedException { } private static List < Property > getCachesFromParentModel ( String cacheType , ModelNode model ) { } private static ModelNode createCacheRemoveOperation ( String cacheType , String containerName , String cacheName ) { } private static ModelNode createCacheAddOperation ( String cacheType , String containerName , String cacheName ) { } private static PathAddress getCacheAddress ( String containerName , String cacheName , String cacheType ) { <START_BUG> PathAddress cacheAddr = PathAddress . pathAddress ( PathElement . pathElement ( SUBSYSTEM , SUBSYSTEM_NAME ) , PathElement . pathElement ( "cache-container" , containerName ) , PathElement . pathElement ( cacheType , cacheName ) ) ; <END_BUG> return cacheAddr ; } }

Fix:
PathAddress cacheAddr = PathAddress . pathAddress ( PathElement . pathElement ( SUBSYSTEM , SUBSYSTEM_NAME ) , PathElement . pathElement ( CACHE_CONTAINER , containerName ) , PathElement . pathElement ( cacheType , cacheName ) ) ;
Buggy code:
public class MappableTypeFactory { private Set < MappableType < ? > > mappableTypes = new LinkedHashSet < MappableType < ? > > ( ) ; public void add ( MappableType < ? > mappableType ) { } @ SuppressWarnings ( "unchecked" ) public < T > MappableType < T > getMappableType ( T object ) { for ( MappableType type : mappableTypes ) { if ( type . isInstance ( object ) ) { return type ; } } <START_BUG> throw new IllegalArgumentException ( ( ( "Object<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>[" + ( object . getClass ( ) . getName ( ) ) ) + "]<seq2seq4repair_space>not<seq2seq4repair_space>mappable<seq2seq4repair_space>-<seq2seq4repair_space>no<seq2seq4repair_space>suitable<seq2seq4repair_space>MappableType<seq2seq4repair_space>exists" ) ) ; <END_BUG> } }

Fix:
throw new IllegalArgumentException ( ( ( "Object<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>[" + ( object . getClass ( ) . getName ( ) ) ) + "]<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>mappable<seq2seq4repair_space>-<seq2seq4repair_space>no<seq2seq4repair_space>suitable<seq2seq4repair_space>MappableType<seq2seq4repair_space>exists" ) ) ;
Buggy code:
public class AddressbookPanel extends JPanel implements ActionListener , ChangeListener { private AddressbookDNDListView addressbook ; private ComposerInterface composerInterface ; private JLabel chooseLabel ; private JButton chooseButton ; private JButton toButton ; private JButton ccButton ; private JButton bccButton ; private AddressbookListModel [ ] list ; private int [ ] books ; private CTabbedPane pane ; public AddressbookPanel ( ComposerInterface composerInterface ) { } protected void init ( ) { } public JPanel createPanel ( int uid ) { JPanel panel = new JPanel ( ) ; panel . setLayout ( new BorderLayout ( ) ) ; addressbook = new AddressbookDNDListView ( ) ; addressbook . setAcceptDrop ( false ) ; JScrollPane scrollPane = new JScrollPane ( addressbook ) ; panel . add ( scrollPane , BorderLayout . CENTER ) ; JPanel topPanel = new JPanel ( ) ; topPanel . setBorder ( BorderFactory . createEmptyBorder ( 5 , 5 , 5 , 5 ) ) ; topPanel . setLayout ( new BorderLayout ( ) ) ; JPanel labelPanel = new JPanel ( ) ; labelPanel . setLayout ( new GridLayout ( 1 , 3 , 5 , 5 ) ) ; toButton = new JButton ( "To:" ) ; toButton . setActionCommand ( "TO" ) ; toButton . addActionListener ( this ) ; ccButton = new JButton ( "Cc:" ) ; ccButton . setActionCommand ( "CC" ) ; ccButton . addActionListener ( this ) ; bccButton = new JButton ( "Bcc:" ) ; bccButton . setActionCommand ( "BCC" ) ; bccButton . addActionListener ( this ) ; labelPanel . add ( toButton ) ; labelPanel . add ( ccButton ) ; labelPanel . add ( bccButton ) ; topPanel . add ( labelPanel , BorderLayout . NORTH ) ; JPanel middlePanel = new JPanel ( ) ; GridBagLayout layout = new GridBagLayout ( ) ; middlePanel . setLayout ( layout ) ; GridBagConstraints c = new GridBagConstraints ( ) ; JLabel containsLabel = new JLabel ( "contains:" ) ; containsLabel . setEnabled ( false ) ; JTextField textField = new JTextField ( ) ; textField . setEnabled ( false ) ; c . anchor = GridBagConstraints . WEST ; c . gridx = 0 ; c . insets = new Insets ( 5 , 0 , 0 , 5 ) ; c . weightx = 0.0 ; c . gridwidth = GridBagConstraints . RELATIVE ; layout . setConstraints ( containsLabel , c ) ; middlePanel . add ( containsLabel ) ; c . anchor = GridBagConstraints . EAST ; c . weightx = 1.0 ; c . insets = new Insets ( 5 , 0 , 0 , 0 ) ; c . gridwidth = GridBagConstraints . REMAINDER ; c . gridx = 1 ; c . fill = GridBagConstraints . HORIZONTAL ; layout . setConstraints ( textField , c ) ; middlePanel . add ( textField ) ; topPanel . add ( middlePanel , BorderLayout . CENTER ) ; panel . add ( topPanel , BorderLayout . NORTH ) ; <START_BUG> Folder folder = tree . getFolder ( uid ) ; <END_BUG> setHeaderList ( folder . getHeaderItemList ( ) ) ; return panel ; } public void setHeaderList ( HeaderItemList list ) { } public void actionPerformed ( ActionEvent ev ) { } public void stateChanged ( ChangeEvent e ) { } }

Fix:
Folder folder = ( ( Folder ) ( treeModel . getFolder ( uid ) ) ) ;
Buggy code:
public class InvalidMatrixExceptionTest extends TestCase { public void testConstructorMessage ( ) { String msg = "message" ; <START_BUG> InvalidMatrixException ex = new InvalidMatrixException ( msg , new Object [ 0 ] ) ; <END_BUG> assertEquals ( msg , ex . getMessage ( ) ) ; } }

Fix:
InvalidMatrixException ex = new InvalidMatrixException ( msg , null ) ;
Buggy code:
public class ConvertingPropertyEditorAdapter extends PropertyEditorSupport { private final ConversionService conversionService ; private final TypeDescriptor targetDescriptor ; private final boolean canConvertToString ; public ConvertingPropertyEditorAdapter ( ConversionService conversionService , TypeDescriptor targetDescriptor ) { } @ Override public void setAsText ( String text ) throws IllegalArgumentException { <START_BUG> setValue ( this . conversionService . convert ( text , TypeDescriptor . valueOf ( String . class ) , this . targetDescriptor ) ) ; <END_BUG> } @ Override public String getAsText ( ) { } }

Fix:
setValue ( this . conversionService . convert ( text , this . targetDescriptor ) ) ;
Buggy code:
public final class LocalizedImageResource implements Serializable , IResourceListener { private Component component ; private boolean isFactoryResource ; private Locale locale ; private Resource resource ; private String style ; private static final class ImageValueParser extends MetaPatternParser { private static final Group factoryName = new Group ( MetaPattern . VARIABLE_NAME ) ; private static final Group imageName = new Group ( MetaPattern . VARIABLE_NAME ) ; private static final Group specification = new Group ( MetaPattern . ANYTHING_NON_EMPTY ) ; private static final MetaPattern pattern = new MetaPattern ( new MetaPattern [ ] { LocalizedImageResource . ImageValueParser . factoryName , MetaPattern . COLON , new wicket . util . parse . metapattern . OptionalMetaPattern ( new MetaPattern [ ] { LocalizedImageResource . ImageValueParser . imageName } ) , MetaPattern . COLON , LocalizedImageResource . ImageValueParser . specification } ) ; private ImageValueParser ( final CharSequence input ) { } private String getFactoryName ( ) { } private String getImageName ( ) { } private String getSpecification ( ) { } } public LocalizedImageResource ( final Component component ) { } public final void bind ( ) { } public final void onResourceRequested ( ) { } public final void setResource ( final Resource resource ) { } public final void setSrcAttribute ( final ComponentTag tag ) { if ( ( ( ( locale ) != null ) && ( ! ( locale . equals ( component . getLocale ( ) ) ) ) ) || ( ( ( style ) != null ) && ( ! ( style . equals ( component . getStyle ( ) ) ) ) ) ) { this . locale = component . getLocale ( ) ; this . style = component . getStyle ( ) ; if ( ( resource ) instanceof SharedResource ) { if ( isFactoryResource ) { this . resource = null ; } else { final SharedResource sharedResource = ( ( SharedResource ) ( resource ) ) ; sharedResource . setLocale ( locale ) ; sharedResource . setStyle ( style ) ; } } else { this . resource = null ; } } if ( ( resource ) == null ) { final String src = tag . getString ( "src" ) ; if ( src != null ) { this . resource = loadStaticImage ( src ) ; } else { final String value = tag . getString ( "value" ) ; if ( value != null ) { this . resource = newImage ( value ) ; this . isFactoryResource = true ; } else { this . resource = loadStaticImage ( component . getModelObjectAsString ( ) ) ; } } } final String url ; if ( ( this . resource ) instanceof SharedResource ) { url = component . getPage ( ) . urlFor ( ( ( SharedResource ) ( resource ) ) . getPath ( ) ) ; } else { url = component . urlFor ( IResourceListener . class ) ; } <START_BUG> tag . put ( "src" , component . getResponse ( ) . encodeURL ( url ) . replaceAll ( "&" , "&amp;" ) ) ; <END_BUG> } private ImageResource loadStaticImage ( final String path ) { } private Resource newImage ( final String value ) { } }

Fix:
tag . put ( "src" , Strings . replaceAll ( component . getResponse ( ) . encodeURL ( url ) , "&" , "&amp;" ) ) ;
Buggy code:
public class ValidLogger implements IParameterValidator { public void validate ( String name , String value ) throws ParameterException { <START_BUG> if ( ( ! ( value . equals ( "console" ) ) ) && ( ! ( value . equals ( "sqlite" ) ) ) ) { <END_BUG> throw new ParameterException ( ( ( "Parameter<seq2seq4repair_space>" + name ) + "<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>valid<seq2seq4repair_space>(console<seq2seq4repair_space>or<seq2seq4repair_space>sqlite)" ) ) ; } } }

Fix:
if ( ( ( name . equals ( "--logger" ) ) && ( ! ( value . equals ( "console" ) ) ) ) && ( ! ( value . equals ( "sqlite" ) ) ) ) {
Buggy code:
public class EntireGraphingPanel extends JPanel implements ActionListener , KeyListener , MouseListener , MouseMotionListener , MouseWheelListener { public EntireGraphingPanel ( ) { } private void init ( ) { } public void actionPerformed ( ActionEvent e ) { } public MultiGraphLayeredPane getMultiGraphLayeredPane ( ) { } public GraphPositionPanel getGraphPositionPanel ( ) { } public void setLog ( GenericLog genLog ) { } public void zoomIn ( ) { } public void zoomOut ( ) { } public void play ( ) { } public void pause ( ) { } public void fastForward ( ) { } public void eject ( ) { } public void stop ( ) { } public void slowDown ( ) { } public void fling ( ) { } public int getGraphPosition ( ) { } public int getGraphPositionMax ( ) { } public int getZoom ( ) { } private void moveGraphPosition ( int amount ) { } public void setGraphPosition ( int newPos ) { } public void setGraphPositionMax ( ) { boolean found = false ; for ( int i = 0 ; ( i < ( multiGraph . getComponentCount ( ) ) ) && ( ! found ) ; i ++ ) { if ( ( multiGraph . getComponent ( i ) ) instanceof SingleGraphPanel ) { SingleGraphPanel gl = ( ( SingleGraphPanel ) ( multiGraph . getComponent ( i ) ) ) ; <START_BUG> graphPositionMax = gl . graphSize ( ) ; <END_BUG> found = true ; } } } private void resetGraphPosition ( ) { } private void goToLastGraphPosition ( ) { } public boolean isPlaying ( ) { } private void moveEntireGraphingPanel ( int newPosition ) { } private void stopDragging ( ) { } private void stopFlinging ( ) { } @ Override public void mouseClicked ( MouseEvent e ) { } @ Override public void mouseDragged ( MouseEvent e ) { } @ Override public void mouseMoved ( MouseEvent e ) { } @ Override public void mouseEntered ( MouseEvent e ) { } @ Override public void mouseExited ( MouseEvent e ) { } @ Override public void mousePressed ( MouseEvent e ) { } @ Override public void mouseReleased ( MouseEvent e ) { } @ Override public void mouseWheelMoved ( MouseWheelEvent e ) { } @ Override public void keyPressed ( KeyEvent e ) { } @ Override public void keyReleased ( KeyEvent e ) { } @ Override public void keyTyped ( KeyEvent e ) { } private MultiGraphLayeredPane multiGraph ; private GraphPositionPanel graphPositionPanel ; private int graphPosition ; private int graphPositionMax ; private boolean playing ; private Timer playTimer ; private Timer flingTimer ; private boolean dragging ; private boolean flinging ; private long thePast ; double draggingAccumulator ; private int prevDragXCoord ; private int flingInertia ; private int zoom ; private static final long serialVersionUID = 6880240079754110792L ; }

Fix:
graphPositionMax = ( gl . graphSize ( ) ) - 1 ;
Buggy code:
public class WithincodePointcut extends Pointcut { SignaturePattern signature ; public WithincodePointcut ( SignaturePattern signature ) { } public FuzzyBoolean fastMatch ( ResolvedTypeX type ) { } public FuzzyBoolean match ( Shadow shadow ) { } public void write ( DataOutputStream s ) throws IOException { } public static Pointcut read ( DataInputStream s , ISourceContext context ) throws IOException { } public void resolveBindings ( IScope scope , Bindings bindings ) { } public void postRead ( ResolvedTypeX enclosingType ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public String toString ( ) { } public Test findResidue ( Shadow shadow , ExposedState state ) { } public Pointcut concretize1 ( ResolvedTypeX inAspect , IntMap bindings ) { <START_BUG> return this ; <END_BUG> } }

Fix:
return new WithincodePointcut ( signature ) ;
Buggy code:
public class jChat extends JavaPlugin { private static final File confFile = new File ( "plugins//jChat//config.yml" ) ; private static final Logger logger = Logger . getLogger ( "Minecraft" ) ; private final jChatPlayerListener playerListener ; private static jChat instance ; private PluginDescriptionFile desc ; private PluginManager pm ; public Configuration conf ; public PermissionHandler externalPermissions ; public Map < String , UUID > players = new HashMap < String , UUID > ( ) ; public jChat ( ) { } public static void log ( final Level level , final String msg ) { } public void onDisable ( ) { } public void onEnable ( ) { } public void revertDisplayName ( final Player player ) { } public void setDisplayName ( final Player player ) { final String prefix = searchNodes ( player , "prefix" ) ; final String suffix = ( searchNodes ( player , "suffix" ) ) + "§f" ; <START_BUG> player . setDisplayName ( ( ( prefix + ( ChatColor . stripColor ( player . getDisplayName ( ) ) ) ) + suffix ) ) ; <END_BUG> players . put ( player . getName ( ) , player . getWorld ( ) . getUID ( ) ) ; } private void createConfiguration ( ) { } private void loadConfiguration ( ) { } private String searchNodes ( final Player player , final String parentNode ) { } private void connectPermissions ( ) { } }

Fix:
player . setDisplayName ( ( ( prefix + ( ChatColor . stripColor ( player . getName ( ) ) ) ) + suffix ) ) ;
Buggy code:
public class LogStoreParticipantRefreshHandler implements OperationStepHandler { static final LogStoreParticipantRefreshHandler INSTANCE = new LogStoreParticipantRefreshHandler ( ) ; public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { MBeanServer mbs = TransactionExtension . getMBeanServer ( context ) ; final Resource resource = context . readResource ( EMPTY_ADDRESS ) ; try { final ObjectName on = LogStoreResource . getObjectName ( resource ) ; final ModelNode model = resource . getModel ( ) . clone ( ) ; AttributeList attributes = mbs . getAttributes ( on , PARTICIPANT_JMX_NAMES ) ; for ( Attribute attribute : attributes . asList ( ) ) { String modelName = LogStoreConstants . jmxNameToModelName ( MODEL_TO_JMX_PARTICIPANT_NAMES , attribute . getName ( ) ) ; if ( modelName != null ) { ModelNode aNode = model . get ( modelName ) ; Object value = attribute . getValue ( ) ; if ( aNode != null ) aNode . set ( ( value == null ? "" : value . toString ( ) ) ) ; } } resource . writeModel ( model ) ; } catch ( Exception e ) { throw new OperationFailedException ( "JMX<seq2seq4repair_space>error:<seq2seq4repair_space>" , e ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } }

Fix:
context . completeStep ( NOOP_ROLLBACK_HANDLER ) ;
Buggy code:
public class ListPage extends ListActivity { private static final int LENGTH_TITLE = 5 ; private SimpleDateFormat sdf = new SimpleDateFormat ( "yyyy-MM-dd" ) ; @ Override public void onCreate ( Bundle savedInstanceState ) { } private OnItemClickListener ftStoryClick = new OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > parent , View v , int position , long id ) { } } ; private void updateListView ( ) { } public class mySimpleCursorAdaptor extends SimpleCursorAdapter { public mySimpleCursorAdaptor ( Context context , int layout , Cursor c , String [ ] from , int [ ] to ) { } @ Override public void bindView ( View view , Context context , Cursor cursor ) { super . bindView ( view , context , cursor ) ; ImageView ftImage = ( ( ImageView ) ( view . findViewById ( imageViewLMRImage ) ) ) ; TextView ftTitle = ( ( TextView ) ( view . findViewById ( textViewLMRTitle ) ) ) ; TextView ftTime = ( ( TextView ) ( view . findViewById ( textViewLMRTime ) ) ) ; try { Bitmap bm = Media . getBitmap ( ListPage . this . getContentResolver ( ) , Uri . parse ( cursor . getString ( 2 ) ) ) ; <START_BUG> ftImage . setImageBitmap ( Bitmap . createScaledBitmap ( bm , 40 , 40 , true ) ) ; <END_BUG> } catch ( FileNotFoundException e ) { } catch ( IOException e ) { } if ( ( cursor . getString ( 1 ) . length ( ) ) > ( ListPage . LENGTH_TITLE ) ) ftTitle . setText ( ( ( cursor . getString ( 1 ) . substring ( 0 , ListPage . LENGTH_TITLE ) ) + "..." ) ) ; else ftTitle . setText ( cursor . getString ( 1 ) ) ; ftTime . setText ( sdf . format ( new Date ( Long . parseLong ( cursor . getString ( 5 ) ) ) ) ) ; } } }

Fix:
ftImage . setImageBitmap ( bm ) ;
Buggy code:
public class Menu extends Widget { NSMenu nsMenu ; short id ; int x ; int y ; int itemCount ; boolean hasLocation ; boolean modified ; boolean closed ; MenuItem [ ] items ; MenuItem cascade ; MenuItem defaultItem ; MenuItem lastTarget ; Decorations parent ; public Menu ( Control parent ) { } public Menu ( Decorations parent , int style ) { } public Menu ( Menu parentMenu ) { } public Menu ( MenuItem parentItem ) { } static Control checkNull ( Control control ) { } static Menu checkNull ( Menu menu ) { } static MenuItem checkNull ( MenuItem item ) { } static int checkStyle ( int style ) { } void _setVisible ( boolean visible ) { } public void addHelpListener ( HelpListener listener ) { } public void addMenuListener ( MenuListener listener ) { } void createHandle ( ) { display . addMenu ( this ) ; <START_BUG> SWTMenu widget = ( ( SWTMenu ) ( new SWTMenu ( ) . alloc ( ) ) ) ; <END_BUG> widget . initWithTitle ( NSString . stringWith ( "" ) ) ; widget . setAutoenablesItems ( false ) ; widget . setDelegate ( widget ) ; nsMenu = widget ; } void createItem ( MenuItem item , int index ) { } void createWidget ( ) { } void deregister ( ) { } void destroyItem ( MenuItem item ) { } void destroyWidget ( ) { } void fixMenus ( Decorations newParent ) { } public MenuItem getDefaultItem ( ) { } public boolean getEnabled ( ) { } public MenuItem getItem ( int index ) { } public int getItemCount ( ) { } public MenuItem [ ] getItems ( ) { } String getNameText ( ) { } public Decorations getParent ( ) { } public MenuItem getParentItem ( ) { } public Menu getParentMenu ( ) { } public Shell getShell ( ) { } public boolean getVisible ( ) { } public int indexOf ( MenuItem item ) { } public boolean isEnabled ( ) { } public boolean isVisible ( ) { } void menu_willHighlightItem ( int menu , int itemID ) { } void menuNeedsUpdate ( int menu ) { } void menuWillClose ( int menu ) { } void menuWillOpen ( int menu ) { } int modifierIndex ( String accelText ) { } int numberOfItemsInMenu ( int menu ) { } void register ( ) { } void releaseChildren ( boolean destroy ) { } void releaseHandle ( ) { } void releaseParent ( ) { } void releaseWidget ( ) { } public void removeHelpListener ( HelpListener listener ) { } public void removeMenuListener ( MenuListener listener ) { } public void setDefaultItem ( MenuItem item ) { } public void setEnabled ( boolean enabled ) { } public void setLocation ( int x , int y ) { } public void setLocation ( Point location ) { } public void setVisible ( boolean visible ) { } }

Fix:
NSMenu widget = ( ( NSMenu ) ( new SWTMenu ( ) . alloc ( ) ) ) ;